Skip to content

Pin that a pick an earlier runtime logged folds as absent - #2050

Merged
max-sixty merged 1 commit into
mainfrom
fold-old-choose-events
Oct 10, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fold-old-choose-events

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

After #1971 changed how a pick is recorded, a page whose log held earlier picks (detail.options, no meaning.state) crashed leaf page state and leaf status with KeyError: 'value' in projection.py's folded_value. That broke the state-home rule in AGENTS.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_projection now 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 on main, as do copies of 24 other pages on this machine whose logs hold old-format picks. Nine more stop earlier, on an older data.json shape, 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 state exits 0 and reports only the current pick. With the gate removed, as #1971 had it, the test fails.

This was written by Claude Code on behalf of max-sixty

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]>
@max-sixty
max-sixty merged commit 482db99 into main Oct 10, 2026
6 checks passed
@max-sixty
max-sixty deleted the fold-old-choose-events branch October 10, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants