fix: the chip drift guard was watching a dict nothing used - #803
Merged
Conversation
`_EFFORT_LABELS` was defined and never read. Its test asserted its keys equalled EFFORTS - a guard on a derived dict, which by construction can never drift, so the test could never fail. Meanwhile `_SEVERITY_CHIP` and `_EFFORT_CHIP` - the dicts actually rendered into every marking - are hand-written and had no guard at all. Adding a level to review_types would have fallen through `.get()` to the bare identifier with nothing to say so, which is exactly the failure the old comment claimed to prevent. Deleted the dead dict; moved the guard onto the live ones via `_chip_vocabulary_drift()`. Returned rather than asserted at import, so a drifted table degrades to an ugly chip in production instead of refusing to import dispatch; the test is where it fails loudly. The test also removes a level and asserts the guard goes red, then restores it. A guard nobody has watched fail is a guess. Claude-Session: https://claude.ai/code/session_01Weq76G5TQhR9ogo4zCK1Gd
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.
Size: XS
Why
_EFFORT_LABELSwas defined and never read. Its test asserted its keys equalledEFFORTS- a guard on a derived dict, which by construction cannot drift,so the test could never fail.
Meanwhile
_SEVERITY_CHIPand_EFFORT_CHIP- the dicts actually rendered intoevery marking - are hand-written and had no guard at all. Adding a level to
review_typeswould fall through.get()to the bare identifier with nothingto say so.
Which is precisely the failure the old comment claimed to prevent:
The guard was watching a decoy.
What changed
_EFFORT_LABELS_chip_vocabulary_drift(), checkingSEVERITIESandEFFORTSagainstthe dicts that are actually rendered
ugly chip in production, not refuse to import dispatch. The test is where it
fails loudly
guard nobody has watched fail is a guess
Acceptance criteria
Out of scope
product choice in the inline markings, not something to change in passing.
Effortshould gain more levels. This only ensures that if it does,the omission is loud.
Verification
1836 passed, 2 skipped