Repository navigation
Conversation
A version that marks an element `restated` now reads each decision resting on it without that element, instead of taking the decision out of force and letting its key fall back to the decision the user had replaced. | The user's acts | Version restates | Before | Now | | ---------------------------------------- | ---------------- | --------------- | ----------------------- | | single choice: a, then b | b | a picked again | nothing picked | | multiple: a; then a, b | b | a | a | | multiple: a; then a, b; then b | b | a | nothing picked | | card to Later, then to Next | Next | card in Later | card where markup has it | | accept, then reject resting on a paragraph | the paragraph | accepted, c1 closed again | undecided, c1 open | The last two rows are reachable only through a log written by hand: `page check` refuses `restated` on an `lf-column`, and admission rests a suggestion's decision on the suggestion alone. `events.InForce` reads each action a note reaches through `restated_reading`: an `attribute` set without the rewritten members, which keeps the action's id and drops its `answer` and `facts`, or nothing, and then every action before it at its key goes too. Every reader of what stands now takes that walk: the projection fold walks undos and notes where they fall, so InForce's second mode (floors and withdrawals given up front) and the `withdrawn`/`floors` arguments threaded to it are gone, and the served undo list and `sample_events` read the walk rather than `action_retracted`, which is gone. A served entry's `value` is the record as it stands, and the browser's fold draws it rather than the event's detail. `obligations.told_facts` is gone: a tab's `facts` word may now answer a question as well as reopen it. It was there so a replaced pick that won again could not answer; no replaced pick wins again now. The two cases that waited on a second press of Done now converge once a tab speaks: a version that takes out the one option Done didn't cover, and two tabs whose acts cross. What a user sees differently: - A rewritten option leaves the group's other picks, and never brings back a pick the user replaced or unpicked. - In the single-choice row, Undo takes back the pick of b and brings a back, as it would have before the version. - A pick's ids reach a widget in sorted order, as the server lists a set, rather than in the order the user clicked; the set is the same. Tests: `tests/model/test_restatement.py` holds the five rows through admission and the served reading; `test_obligations.py` shows both Done cases converging; the #2515 membership and sample tests now expect no fallback; a runtime case holds the browser to the served `value`. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
reviewed
Nov 27, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
One defect on the stale-tab path through InForce.admit (inline). Otherwise the walk agrees with the PR's table: undo of the narrowed single-choice pick brings a back because the pick of b stands as an empty set rather than being cut. tests/model/test_restatement.py and tests/model/test_obligations.py pass locally at this head.
Two review findings on the first commit: - A decision made on an older version that lands after the note restating what it rests on took out every decision at its key, including the user's pick on the new version. It now never comes into force and takes out nothing, as before this branch; a set still stands without the rewritten members. - `obligations.told_facts` still guards two cases the fold change doesn't reach, so it stays. Done rests on its widget alone, so a version that takes back a pick made after Done leaves the Done standing on the picks before it; and lf-options compares Done with the markup's `selected` where no pick stands. A tab works out `answered` in both, and only the reopen-only rule keeps the question asking. > _This was written by Claude Code on behalf of max-sixty_
Owner
Author
max-sixty
added a commit
that referenced
this pull request
Nov 28, 2026
) Three rules now decide whether a widget's question is answered, and what the user's decisions on it come to when a version restates something (`events.md`, "Widget answers"): 1. **A gesture carries its word.** Each act and undo carries the widget's `answered`, worked out by its class in the gesture's task, and the latest gesture in force decides. This is #7325's shape. 2. **A rewrite takes back only itself.** A version marking an element `restated` takes it out of the user's decisions resting on it. A pick set loses that option and keeps the rest, and restating the `lf-options` itself keeps every pick. Any other decision resting on it goes, such as a draft's words or a Done, and no key falls back to a decision the user replaced. This is #7452, which this PR replaces, minus its rule that also took out the decisions before a removed one, which only a hand-written log reached. 3. **A restating version asks again.** A note marking a widget or an element inside it reopens the widget's question until the user's next gesture on it, read from the version alone. A version that edits markup without restating asks nothing again. What goes: the `facts` declaration key and bookkeeping event, with `through`, the `stale-facts` and `unchanged-facts` refusals, `told_facts`, the rule that a gesture on an older version leaves kept facts standing, undo's `revision`, `host/widget-facts.ts`, the served and `page state` facts, and lf-options' "Done covers the set shown". `InForce`'s up-front mode and `action_retracted` go too, as in #7452. Page protocol 64. ## Why restate only Across the state home's 458 page logs, 884 versions changed the markup of an answered `lf-options`. 574 settled it, 260 wrote the user's pick into `selected`, and 34 changed wording or a label. Only about 3 added options without restating and might have meant to ask again. Every version whose note says it asks again used `restated`. Reopening on any markup change would have reopened about 300 answers the agent had just recorded. ## The case table | The user's acts | The version | Result | | --- | --- | --- | | single choice: a, then b | restates b | nothing picked, asks again | | single choice: a, then b | restates a | b picked, asks again | | multiple: a, a+b, Done | restates b | a picked, asks again | | multiple: a, a+b, then untick a | restates b | nothing picked, asks again | | multiple: Done, then a pick changes | — | stays answered | | checklist answered | adds a step, restates nothing | stays answered | | checklist answered | adds a step, restates the group | every pick kept, Done gone, asks again | | two tabs: B picks a and presses Done; A, behind, picks a last | — | A's word stands: asks again, Done still pressed in B | Each row is a test in `tests/model/test_restatement.py`. ## What a user sees differently from #7425 - A checklist given a step stays answered unless the version restates the group, which asks again and keeps every pick. - A pick changed after Done keeps the question answered. - Restating an option of a `multiple` group whose Done stands asks again while Done still shows pressed, so answering takes two presses, as with the two crossing tabs. No log in the state home has restated an option of a `multiple` group with Done standing. - A restated single choice keeps its pick, which takes two presses to confirm, so `$restated` tells authors to mark the picked option where the user should choose afresh. ## Size Against the merge base: Python +274 −428, browser TypeScript +79 −293 and its compiled JavaScript +67 −250, package JavaScript +26 −88, registries and schema +23 −99, tests +680 −1104, docs +136 −185. `uv run leaf-dev interface --base`: Declaration keys: removes `facts`. > _This was written by Claude Code on behalf of max-sixty_
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.
A prototype for the maintainer to decide on. A version that marks an element
restatednow reads each decision resting on it without that element, instead of taking the decision out of force and letting its key fall back to the decision the user had replaced.The last two rows are reachable only through a log written by hand:
page checkrefusesrestatedon anlf-column, and admission rests a suggestion's decision on the suggestion alone. In use, the change reacheslf-optionspicks, including a board card thatshowsone.How
events.InForcereads each action a note reaches throughrestated_reading. Anattributeset loses the rewritten members and keeps standing under the action's id, without itsanswerorfacts. Any other decision no longer applies, and every action before it at its key goes too. A decision made on an older version that lands after the note is read the same way, except that one which no longer applies never comes into force and takes nothing out. Every reader of what stands takes that one walk:withdrawn/floorsarguments threaded tostate_projection,page_readingandthread_markup_readingare gone;sample_eventsread the walk, andaction_retractedis gone;valueis the record as it stands, and the browser's fold (state/projection/model.ts) draws it rather than the event's detail.#2515's restored-answer filing was never separate code: memberships name the answers of the winner before and after each change, so they follow the new fold with no edit.
told_factsstaysIts reopen-only rule still guards two cases this change doesn't reach, both pinned in
test_a_tabs_word_reopens_a_question_but_never_answers_it:answer) rests on its widget alone, so a version that takes back a pick made after Done leaves the Done standing on the picks before it, and lf-options works out "answered".selectedwhere no pick stands, so a version that writes the pick Done covered into the markup reads as answered.Letting it go needs Done to rest on the options it names, which takes a declaration for detail fields that name members, and an answer for the second case.
What a user sees differently
Size
model.tsevents.md, the$restatedstring,package-data.md, the lf-options header, a schema descriptionuv run leaf-dev interface --base: no name added or removed. No protocol bump: no logged record changes, only how the serving Leaf folds one.Checks
tests/model(3679 passed), the undo and restatement tests intests/process/test_interact_server.py,pnpm run test:runtime(1219 passed),node build/browser/build.mjs --check, pre-commit, and by node id the 31 browser tests that touch restated, options, suggestions, boards and undo (all passed oncetest_an_answer_carrying_an_older_pick_cannot_undo_a_newer_onestopped pinning click order). A served page built with each case drew the threelf-optionsrows as the table says.