Repository navigation
Guard every generic sweep over MAPPINGS against a keyless mapping - #23
Merged
Merged
Conversation
Making `Mapping.ascconv_key` optional for the preview-only
`1st Signal/Mode` entry needed three guards in mappings.py, and those
are the three the feature itself traverses. Four other sites read the
field generically and only one of them failed.
`test_every_enum_choice_agrees_with_the_corpus` selected its enums as
`m.choices and m.bit is None`, so it asked the ASCCONV block for a key
that by construction does not exist and reported the mapping as
disagreeing with the corpus on 418 readings over 261 scans. It now
excludes keyless mappings and names the preview-side sweep that covers
them.
The two duplicate-key checks are the expensive ones, because they
passed: with one preview-only mapping their identity tuples stay
unique, and with a second they would pair the two on their shared empty
key and report a collision between mappings that write nothing at all.
Entry identity is now the `preview_path` where there is no key, and the
write-race check leaves out a mapping that never writes.
`probe._is_mapped("")` had become True, safe only because no real
ASCCONV key splits to an empty stem; it now answers for real keys only.
Verified: full suite 3743 passed, 26 skipped with -n auto; the enum
sweep still fails on a mutated choice, so the exclusion did not gut it;
the duplicate-key fix clears two distinct preview-only mappings and
still catches two sharing a preview_path.
CLAUDE.md records the finding, and separately that piping a suite run
through `tail` discards pytest's exit code -- which is why the failing
run was first reported as green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What this fixes
Making
Mapping.ascconv_keyoptional for the preview-only1st Signal/Modeentry needed three guards inmappings.py—displayreads the preview instead,resolverefuses with a reason,is_churnis not asked. Those are the three the feature itself traverses. Four other sites read the field generically, and only one of them failed.The full suite was red at
1 failed, 3742 passedbefore this.The four sites, by how they failed
test_every_enum_choice_agrees_with_the_corpusm.choices and m.bit is None, so it asked the ASCCONV block for a key that by construction does not exist — reported the mapping as disagreeing on 418 readings over 261 scanstest_no_two_mappings_claim_the_same_ascconv_key(ascconv_key, sequences, when, bit); unique with one keyless mapping, a false collision with twopreview_pathwhere there is no keytest_no_protocol_has_two_mappings_writing_one_key(ascconv_key, bit)— would report a write race between two mappings that write nothing at all,resolverefusing bothprobe._is_mapped_is_mapped("")becameTrue; the empty key joined the claimed set and the empty stem joinedstems. Safe only because no real ASCCONV key splits to an empty stembuild.stored_displaywas saved by accident — it returns early onmapping.choicesand never reaches the key. A keyless mapping without choices would have gone straight through.The two that passed are the expensive ones. A check that inverts on the second instance of a thing is worse than one that fails on the first, since the first instance is when someone is looking.
Verification
-n auto(12:15)Averaging1=None → 1=99) fails it, so the exclusion did not gut it. Mutation reverted intry/finallyand the file verified clean afterwardspreview_pathCLAUDE.md
Three entries: the finding itself (a scoping rule enforced in the table and not in the sweeps over the table is enforced nowhere — the sibling of the round-5 widening bug); that piping a suite run through
taildiscards pytest's exit code, which is why the failing run was first read as green; and a one-clause pin on the probe section's "115 to 249" so a future reader doesn't reconcile it against aMAPPINGScount of 250.Two figures in the write-up were measured after being drafted from guesswork — 418/261 and 49 grep lines replaced invented "~320" and "30".
🤖 Generated with Claude Code