Repository navigation
fix(docs): enforce WHO dispatch coverage in sync check and map event-only WHO 0/9 - #105
Merged
GreenGrassBlueOcean merged 2 commits intoOct 10, 2026
Merged
Conversation
…only WHO 0/9 - Call verify_who_catalog_coverage() during sync_documentation() so that --check fails if a registered WHO subsystem is missing from WHO_DEFINITIONS. - Check both _COMMAND_DISPATCH and _EVENT_DISPATCH in verify_who_catalog_coverage(), reporting whether missing WHOs are in commands, events, or both. - Add dedicated WHO_DEFINITIONS entries for event-only subsystems WHO 0 (Scenarios) and WHO 9 (Auxiliary), and remove OWNScenarioEvent from WHO 15. - Update README.md WHO catalog table to reflect WHO 0 and WHO 9. - Add unit tests verifying registry gap detection and sentinel failure modes.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…y tests - Refuse disk writes to README.md and coverage.svg when catalog coverage gaps exist, preventing partial inconsistent updates. - Set dispatch_who_keys=(25,) on WHO 25 definition, eliminating the hard-coded exclusion in verify_who_catalog_coverage(). - Isolate monkeypatched test cases in test_who_catalog_dispatch_coverage_detects_unmapped_registries. - Add explicit assertion that update mode preserves drifted files and refuses write on gaps.
fedem95
approved these changes
Oct 10, 2026
fedem95
left a comment
Contributor
There was a problem hiding this comment.
Approving, this covers both points from #101. Merged locally into current master: --check exits 0 and the suite passes (1302). With #100 merged on top as a test, --check now exits 1 with "WHO catalog gap: WHO 6 / WHO 8 registered in _COMMAND_DISPATCH and _EVENT_DISPATCH but not mapped in WHO_DEFINITIONS", and update mode exits 1 without touching README.md (compared before/after). CI green.
Small wording notes on the new rows:
- WHO 0 says "Basic scenario execution (1–32)";
OWNScenarioEvent.event's docstring says WHAT 1–31, andWHO_0.pdfgives up to 16 scenarios on the F420 and 20 on the IR 3456. - WHO 9 says "aux 1–9";
OWNAuxEventdoesn't restrict the channel, and I couldn't find a public WHO 9 document to check it against.
GreenGrassBlueOcean
deleted the
fix/sync-documentation-review-followups
branch
October 10, 2026 11:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #101 addressing review feedback from @fedem95 (#101 review):
Problem
--checkdid not callverify_who_catalog_coverage():The WHO catalog table is constructed strictly from
WHO_DEFINITIONS. If a new WHO subsystem was registered in the codebase dispatchers but omitted fromWHO_DEFINITIONS,sync_documentation.py --checkexited 0 without detecting the gap. Onlypytest tests/test_sync_documentation.pywould catch it.verify_who_catalog_coverage()only inspected_COMMAND_DISPATCH:Subsystems that only register event decoders were completely ignored by coverage verification.
OWNScenarioEvent) had no entry of its own and was lumped under WHO 15 (explicit_classes=("OWNScenarioEvent",)).OWNAuxEvent) had no row in the README catalog table at all.Solution
sync_documentationand--check:sync_documentation()now callsverify_who_catalog_coverage().WHO catalog gap: ...in the execution messages and preventis_in_syncfrom returning true.--checkexits 1 with actionable guidance when catalog gaps exist.main()andsync_documentation()refuse in-place disk writes toREADME.mdandcoverage.svgif unmapped WHO subsystems exist, preventing partial inconsistent updates.verify_who_catalog_coverage():_COMMAND_DISPATCHand_EVENT_DISPATCH._COMMAND_DISPATCH,_EVENT_DISPATCH, or both.dispatch_who_keys=(25,)on its definition (its underscore-prefixed parser functions are skipped during automatic resolution in favor ofexplicit_classes), eliminating the hardcoded exception inverify_who_catalog_coverage().Scenarios):OWNScenarioEvent.Auxiliary):OWNAuxEvent.CEN Scenarios): removedexplicit_classes=("OWNScenarioEvent",)so it cleanly mapsOWNCenCommandandOWNCENEvent.README.mdcatalog table with the new rows.test_build_who_catalog_table()to assert presence of WHO 0, WHO 9, and the cleaned-up WHO 15.test_who_catalog_dispatch_coverage_detects_unmapped_registries()for command-only, event-only, and dual dispatch gap detection.test_sync_documentation_fails_on_catalog_gap_and_refuses_write()verifying that unmapped subsystems cause--checkand update mode to exit 1 and refuse modifying drifted files.Verification
ruff check OWNd tests setup.py scriptsmypy OWNd tests/typingpython scripts/verify_library_standards.pypython scripts/sync_documentation.py --checkpytest tests/