Repository navigation
Derive recorded payloads from effect declarations - #1971
Merged
Merged
Conversation
# Conflicts: # build/browser/generated/browser-runtime.js.map # build/browser/generated/browser-runtime.manifest.json # docs/how-it-works.html # skills/leaf/assets/vendor/browser-runtime.js # skills/leaf/packages/default/widgets/lf-options.js
leaf-agent
previously approved these changes
Oct 7, 2026
leaf-agent
reviewed
Oct 7, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
CI found two unfinished parts of the payload cutover, so this head should not merge yet.
- The
lf-localfixture intests/test_render_application_boundary.pystill suppliesdetail: {"choice": "chosen"}at two action records. Its three controller cases are refused becausevalueis required; the frozen-thread case times out after/api/statereturns 500. Those fixture records needdetail.valueto match the new declaration. - The changed
$keys.x-statetext has not been regenerated intodocs/registry.html.test_the_key_reference_is_generated_from_the_registryfails;leaf-dev keydocsupdates that generated reference.
These are mechanical repairs. I can push them if useful. Failing test job.
leaf-agent
dismissed
their stale review
October 7, 2026 07:40
CI failed: two stale action payload fixtures and the generated registry reference
leaf-agent
approved these changes
Oct 7, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 7, 2026
The draft edit browser journeys now check the recorded `value` payload required by the effect-derived event contract from #1971. Their user behavior is unchanged: an empty draft survives reload, and a refused edit retains the revised words through Retry. The [main CI run](https://github.com/max-sixty/leaf/actions/runs/37596375818) failed because both journeys still expected the old `text` field even though the admitted events contained the correct `value` field. Both named tests failed before this change and pass afterward (`uv run pytest tests/test_render_drafts.py::test_an_empty_draft_survives_reload_and_blocks_a_version_switch tests/test_render_drafts.py::test_a_refused_draft_keeps_text_and_offers_retry_without_a_details_pane -q -n0`). Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 10, 2026
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_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Recorded verbs currently repeat their payload schema and map payload fields back to the effect they declare. Derive that schema from the effect instead: body, attribute, and scalar-value records take
{value}, position records take{unit, value, rank}, and agent updates also requiretext.This cuts over the Python admission and projection owners, browser producers and readers, CLI, package declarations, authoring contracts, examples, and evaluation fixtures together. Scalar records inherit the destination property's constraints. Shared applicability checks reject invalid effects through both action and report admission, including duplicate or foreign members in attribute sets.
Recorded verbs no longer accept auxiliary payload fields or independent input refinements. Unrecorded commands retain custom schemas for interactions that need them.
Validation: 104 affected browser cases passed before integration; after integrating main, the retained options controls, report presentation holds, both admission writers, reading fixture, and CLI help passed their focused checks. Detached and frozen widget presentation tests also pass through the fixed scalar payload, and the generated registry reference matches its source. All 228 runtime tests, 81 browser model/build tests, pre-commit checks, and committed bundle verification passed. An authoring comparison used one Codex sample per arm: the candidate used the new contract successfully; the baseline used old payload aliases.