Repository navigation
Pin that a pick an earlier runtime logged folds as absent - #2050
Merged
Merged
Conversation
A page whose log holds picks from before admission recorded each event's state operation (`detail.options`, no `meaning.state`) crashed `leaf page state` and `leaf status` with `KeyError: 'value'` in `folded_value` after #1971. #2020's recorded-operation gate in `state_projection` already leaves such an event out of the fold, as the state-home rule asks, but no test held it. This one appends the old shape after a current pick and checks `leaf page state` still reports the current pick; dropping the gate fails it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 8, 2026
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.
After #1971 changed how a pick is recorded, a page whose log held earlier picks (
detail.options, nomeaning.state) crashedleaf page stateandleaf statuswithKeyError: 'value'inprojection.py'sfolded_value. That broke the state-home rule inAGENTS.md: a record lacking fields this version expects is ignored where it is loaded, and never takes a session down.#2020 already fixed it:
state_projectionnow leaves out any event whose recorded state operation doesn't match the current widget's, and an event with none recorded never matches. The page that crashed (message-edit-survey, six old-format picks) reads cleanly onmain, as do copies of 24 other pages on this machine whose logs hold old-format picks. Nine more stop earlier, on an olderdata.jsonshape, before reaching the fold. Nothing held the behaviour, though, so this adds a test.The test appends the old shape after a current pick on the same widget, so the old one would win if it were folded, and checks that
leaf page stateexits 0 and reports only the current pick. With the gate removed, as #1971 had it, the test fails.