Repository navigation
Answer everything On me through the widget or thread that asks it - #5331
Conversation
Leaf no longer puts a to-do on the user with a Done of its own. Before, `leaf task create <subject> --on user` and the turn-end check could put a to-do on any thread, element or widget, and On me offered it a generic Done: on an `lf-code` block or a paragraph, the only answer was a check mark the widget never offered. Now On me holds obligations only, from a widget that declares `x-awaits` (any widget: bundled, from a package or the page's own), an agent message sent with `--obligation`, or an update to send again. On the page each is answered only through its source. Content that asks nothing, and a step such as trying a build, get a thread whose message carries `--obligation`. This reverses the user's 2026-10 choice to keep to-dos on the user for steps; the record moves into the `todos` header. Protocol 38 -> 39: a `todo` event has no `owner`, and `todo_end` is the agent's alone, neither browser-postable nor undoable. Removed: `user_task_obligations`, the to-do obligation source, `--on`, the `duplicate-obligation`, `users-question` and `agents-todo` refusals, the clerk's step kind, and in the browser the To-do Done on panel rows, cards and a thread's head, the `x` key and its stance, `queueActions.done`, local `todo_end` folding and its undo words, `offers`, `showOnMe` after `m`, and the `done` action face. A stance's exit is always Close's ✕, since no stance names another action now. Behavior the tests protected that changed on purpose: the Done, `x`, undo of Done, the To-do placeholder and the thread-head line of to-dos on the user are gone with their tests. Tests that used such a to-do as a convenient On me item use a question in a thread. The `todo-on-the-user` eval becomes `step-on-the-user-takes-a-thread`, and `closeout-asks-take-their-route` requires the reload step as a thread question.
# Conflicts: # browser/leaf.js # browser/runtime/floating-panel.js # browser/runtime/obligations/place.js # browser/runtime/queue-walk.js # browser/runtime/thread/model.js # browser/runtime/undo.js # browser/types/contract.d.ts # dev/leaf_dev/commands/stills.py # dist/kernel/kernel.json # dist/kernel/leaf.js # dist/kernel/runtime/bundle-data.js # dist/kernel/runtime/bundle-errors.js # dist/kernel/runtime/bundle-page-layout.js # src/leaf/events.md # tests/browser/navigation/test_on_panel.py # tests/browser/widgets/test_on_panel.py # tests/runtime/obligation-place.test.mjs
# Conflicts: # browser/runtime/current-target.js # browser/runtime/floating-panel.js # browser/runtime/queue-walk.js # browser/runtime/thread/model.js # browser/runtime/thread/thread-card.js # dev/leaf_dev/commands/stills.py # dist/kernel/kernel.json # dist/kernel/leaf.js # dist/kernel/runtime/bundle-data.js # dist/kernel/runtime/bundle-errors.js # dist/kernel/runtime/bundle-page-layout.js # dist/kernel/runtime/bundle-portable.js # src/leaf/clerk.py # tests/browser/navigation/test_on_panel.py # tests/browser/threads/test_agent_replies.py # tests/model/test_todos.py
# Conflicts: # browser/runtime/keyboard/touch-controls.js # browser/runtime/obligations/answer.js # build/browser/protocol-baseline.json # docs/how-it-works.html # skills/leaf/references/conversation-loop.md # src/leaf/clerk.py # tests/model/test_clerk.py # tests/runtime/queue-walk.test.mjs # tests/served_records.py
# Conflicts: # browser/runtime/floating-panel.js # tests/browser/widgets/test_on_panel.py
leaf-agent
left a comment
There was a problem hiding this comment.
The last merge from main (96fa219) kept this branch's old Web Awesome output instead of #5282's. That puts back the :is(html, body):has(wa-page) rule #5282 removed from browser/styles/vendor/webawesome-theme.css, a rule that forced a style pass across the whole document on every insertion or removal. It also brings back the chunk-UZNIMLIR → chunk-ZGMFNASY rename. The build/ patch and pnpm-lock.yaml already match main, so pnpm run check reports the four files as stale, and that is why test fails. Running pnpm run build:browser on the head regenerates exactly main's files, so restoring them fixes it:
git checkout origin/main -- browser/styles/vendor/webawesome-theme.css browser/vendor/webawesome-chrome.js packages/default/vendor/webawesome.esm.js browser/vendor/webawesome/chunk-UZNIMLIR.js
git rm browser/vendor/webawesome/chunk-ZGMFNASY.jsI can push this if you'd like.
Otherwise the removal holds together, and no leftover reader of owner, a user-authored todo_end, or the To-do Done turned up. The model selection for to-dos, the clerk, obligations, workflows and the interact contract passes on the head (753), as does pnpm run test:runtime (775).
…ale install The last merge from main committed vendor bundles built against a local node_modules whose Web Awesome patch predated the lockfile's, so CI's stale-output check failed. These are main's files again; a frozen-lockfile install rebuilds them unchanged.
…in removed Main took the protocol to 40 for its own log change (#5331), so this branch's message withdrawals, which a Leaf at main's 40 would refuse or crash on, need 41. The answered-reaction fixture's to-do loses the `owner` field main dropped from to-do records.
Conflicts, resolved: - Thread to-dos: main took a thread's to-dos and their Done away (#5331), and this branch had moved them into ThreadView. They go from ThreadView, its commands and surfaces.css, with the panel's inset rule for them; the quote stays. - The panel's ✓: main gave its own Resolve button a disc and a tone (#5329); the panel's ✓ is ThreadView's on this branch, which already has them. - floating-panel.css: main renamed the reply's outlet to `.lf-fp-reply-outlet` and dropped the Threads row's mark wash; this branch dropped the panel's quote rules and the reply part's wrapper. Both removals stand. - Tests: main's new held-news test and rewritten `z` reply test stand beside this branch's renamed drawn-commit test and selectors. `test_a_resolve_s_notice_stands_for_that_resolve_alone` expected the notice's Undo to show a gesture the agent had picked up before taking it back, the rule #5320 removed; main never reached that step, since its Resolve went back to Threads there (fixed on this branch). It now expects the press to take the Resolve back.
…wered #5331 took the user's to-dos out of Leaf, and with them the proofread to-do the package workspace fixture put on the user. The journey still expected that to-do to stay due after one reply answered both questions, so it read "1 waiting on me" against the page's "0 waiting on me". The count now expects nothing waiting; the three answers and the Email summary are checked as before.
…ettlement on every surface (#5427) A thread drawn in a seat that an `x-thread-seat` widget keeps now opens in that seat when the user walks to it or takes back a settlement. One test now covers every surface a thread can be resolved or reopened on, against every way of undoing or refusing that, and checks which surface shows the thread and where focus stands. ## What the user sees change - Resolve a thread in a seat, scroll away and press `z`: the first press shows the seat with the thread focused, and the second takes the Resolve back there. Before, the thread opened in the floating panel, then in a margin card. - `t` or Shift+`t` to a seated thread lands on it in the seat and opens no card. Before, a margin card opened beside the element showing the same thread. - A walk to a resolved seated thread opens the seat's Resolved disclosure before it lands. - A walk to a seated thread brings in the whole element when it fits the window. Where the seat makes the element taller than the window, the walk leaves the thread in view. Before, the landing on the element could scroll the thread back out. A reviewer reading the code found one more effect of the shared lookup, which no test here checks: from an open thread's subject, `r` now settles its seated thread and `c` enters its reply. ## How - `pageSeatThread` (`thread/inline.js`) names the card a page-owned seat draws for a thread. `surfaceFocusTarget` falls back to it after the widget outlets, so every route that asks for a surface finds the seat, and the margin's `seatedOnPage` calls it instead of repeating the query. - `destination.js` opens the disclosure holding a drawing before travelling to it. - `scrollToThread` (`anchor-travel.js`) skips the landing on the thread's place when the focused part stands inside a place taller than its room (`fitsWhole`). ## The test `test_every_way_back_from_a_settlement_returns_the_user_where_they_made_it` crosses four surfaces (margin card, floating panel, seat, package reader) with Resolve and Reopen and five ways back: `z` right after the settlement's landing, `z` with the thread in view, `z` that shows first and takes on the second press, the notice's Undo, and the server refusing. Of the 40 cells, 31 run. These 9 have no route: - Reopen in a card (5): no card draws a resolved thread. - Reopen then `z` right after landing, in the panel, seat and reader (3): the caret stands in the reply box, so `z` is a typed letter. - Reopen then the notice's Undo in the panel (1): the panel's field keeps the notice out of sight while it holds the caret. The test replaces five tests of single cells: `test_z_puts_the_user_back_in_the_thread_they_resolved`, `test_z_leaves_the_user_in_a_seated_thread_they_resolved`, `test_z_shows_a_settlement_the_user_left_before_taking_it`, `test_a_thread_resolved_in_the_panel_comes_back_to_the_panel` and `test_z_shows_a_thread_resolved_in_its_card_by_its_passage`. `package_workspace` moves to `render_cases_interaction.py`, so the test reaches it without importing another test module; the move changes nothing else. `test_primary_package_reader_retains_native_widgets_drafts_and_creation` now expects "0 waiting on me", since #5331 removed the to-do it counted. ## Left as it is On a page with both a seat and a package reader that accepts the thread, undoing a Resolve made in the seat returns the user to the reader, because the route asks the reader first. A reviewer found this by reading the code, and it has not been run. Pages with both are rare, so this change leaves it. A seated thread keeps its margin marker, whose card draws the same thread beside the seat. A Resolve made in that card now comes back in the seat rather than the card, because a route to the page finds the seat first, as Show on page does since #5415. The underlying fix is for a seat to claim its threads as a widget outlet does, which leaves one drawing per thread. It would also take the marker away from a seated thread, so it waits on a decision. ## Testing The type check, the runtime tests, the test above, `test_a_walk_lands_on_a_thread_in_its_seat_in_view`, the package tests and the Show on page tests pass locally. The browser tests ran in Chromium, with no narrow window and no touch input. The test's longest case takes 4.4 s on a loaded host. A separate reviewer used the seat journeys on a live page in Firefox and Chromium, before the commit that lands a fitting element whole. `test_replies_held_in_a_page_seat_show_when_the_user_turns_to_them[replied-browser]` fails locally at teardown, on the shift watch's `leaf-text.lf-ui moved without input by (0, 138)px`. It fails the same way with main's versions of the runtime files this change edits, so it is inherited. > _This was written by Claude Code on behalf of max-sixty_
…stop above the view (#5587) Two On me grouping tests have failed on main since #5468 (bisected from #5331's passing head to `b5f5c5d43`). #5468 made a key pressed at focus the user can't see let go of it and act from what they read. Both tests' page fits a 1440×900 window, so the walk's second `m` lands the Rollout ask (y 506–643) under the open On me view (y 381–802), with no room to scroll it clear. The next `m` then lets go and steps from the reading position, wrapping to the first Options card instead of reaching the thread's Reply. Both tests now open a 1400px-tall window, which puts every stop above the view, so they go back to checking the grouping and walk order they cover. This changes only the test setup, and the tests' assertions and #5468's rule stay as they are. A short page still walks round a subset of the list while the view covers a stop, as it does on main now. That is a product question for #5586: give the body end room for the open view, count a stop the walk just reached as the user's place, or accept the behavior. Verified locally: both tests fail on `main` (`d133d573a`) with the errors in #5534 and pass on this branch, three runs before the rebase and one after it. Closes #5534 — automated triage Co-authored-by: leaf-agent <[email protected]>
Tend's PR review now checks each change against the open backlog and gets the description to close what the change settles. Where the change leaves nothing of a `backlog` issue to do, by finishing what remains, removing its premise or recording a decision against what it asks, the description says `Closes #N`. Where it does part, the description says `Part of #N` and what is left, so the review of the last part can tell that part finishes the issue. On Tend's own pull request the review edits the description. On someone else's it asks in the review, and the ask goes in an approval rather than holding one back. The rule is a new section of `running-tend`, **Issues a change finishes**, after **Review threshold**. ## Why Leaf's backlog triage of 2026-11-04 found seven merged pull requests that did an open backlog issue's work without closing it. Four said `Part of #N`: #3879, #3902, #3856 and #3868. Three named no issue: #4487, #4124 and #5039. Nothing asked those three to look, since `/developing-leaf` asks for `Closes #N` only of a session that starts from a backlog item. Tend's nightly sweep reads a seventh of the open issues each night, long after the diff has left the reader's context, and, by the triage's count, it commented on none of them in ten nights. The review is the step every change passes with its diff in hand. The replay below sorts the seven more finely than the triage did. #4011, #4036 and #4013 were settled by #3879, #4124 and #5039. #3902 did half of #4023, whose five composition defects stayed open. #3856, #3868 and #4487 each did one item of #4027, which is still open. For those four the right description is `Part of #N` with what is left. A `Closes #N` would have been wrong. ## Replay Each case gets the rule as this branch ships it, together with `running-tend`'s **Review threshold** section, which it competes with. It also gets the PR's title, author, description and diff, capped at 80k characters with vendored files left out, and every `backlog` issue open when the PR merged, as it read then. That list is rebuilt from the issues' creation and close times, label events and body edit history, plus their comments up to the merge. Each case runs once through a headless `claude -p` on `claude-opus-5-5` (the review's model), with no tools, in a scratch home. The JSON verdict is graded against an expected answer fixed before the run. | PR | What it did | Expected | Result | | --- | --- | --- | --- | | #3879 | the play-through #4011 asked for | close #4011, or part with its open decision left | pass: part, the decision and the home-page test left | | #3902 | #4023's touch-target half | part of #4023 | pass (also part of #4027) | | #3856 | #4027's Android back item | part of #4027 | pass | | #3868 | #4027's Draw mode item | part of #4027 | pass | | #4487 | #4027's lf-draft back item | part of #4027 | pass | | #4124 | recorded the call that settled #4036 | close #4036 | **miss**: read #4036 and judged the call unrelated | | #5039 | one held-news count, #4013 | close #4013 | pass (also part of #4012) | | #5331 | removed #4060's premise | close #4060 | pass | | #4643, #4718, #4847, #5020, #5252 | nothing in the backlog | nothing | 5 pass | | #5441, #5446, #5454 | rightly a part of an open issue | that part | 3 pass | | #4212 | rightly said `Closes #4037` | close #4037 | pass | That is 6 of the 7 triage cases, the premise case, and 9 of 9 controls. No run closed or named an issue it shouldn't have. #5020 is a hard negative: it changes held-news notices, which #4013 is about, and the run left #4013 alone. #4124's miss held in all three wordings tried. The triage itself only inferred that the 2026-10-25 call in `reading-place.js` covers #4036's case. The clause for a removed premise or a recorded decision goes beyond the two cases Max named. It is there because the triage closed several issues as obsolete after a landed change removed their premise. Without the clause, the #5331 run read #4060 and declined: "It only makes one sentence of the issue's background out of date". With it, the run closed #4060. Two grades were corrected after the first run, each on evidence from the record. #5252 says `Part of #5194`, but #5194 was labelled `backlog` only on 2026-11-05, after #5252 merged. #5039 left a count that gains a digit outgrowing its room, as its own `thread-card.js` comment says, and #5288 fixed that on 2026-11-04, so `Part of #4013` naming that is also right at merge time. The final wording closed #4013 anyway. ```sh uv run python .tmp/replay/replay.py --jobs 4 uv run python .tmp/replay/replay.py --only 5331,4124 --rule-file .tmp/replay/arm-finishes-only.md --runs runs-finishes-only --results results-finishes-only.json ``` The final wording's 17 runs cost $6.75. All runs together cost $19.64, across three wordings and the two-run ablation. The script, cases, prompts, answers and results are in `.tmp/replay/` of the worktree that wrote this PR, not committed. The last run used this text before one sentence was split in two. ## Decisions Max may reverse - **Where the rule lives.** It lives in `running-tend`, which only Tend loads. `/developing-leaf`'s `Closes #N` under **Take a backlog item** stays as it is. That rule claims an item early: the closing keyword is what makes `TODO.md`'s `-linked:pr` query skip it. The review then corrects a claim the change only partly fulfils to `Part of #N`. Repeating the search in the author's skill would make every Leaf session pay for a check the review already makes on every PR. - **How it acts on others' pull requests.** The review asks and doesn't edit, since the author owns the description and Leaf sessions rewrite it whole from a file. The ask doesn't withhold approval. `tend-review` runs on `opened`, `synchronize`, `ready_for_review` and `reopened`, not on `edited`, so a held approval would wait for the next push. The review approves with the ask as its body. - **Scope.** Only issues labelled `backlog`. CI failure reports and cause issues close by their own routes. ## Not verified - **Use inside a full review.** The replay gives the section on its own, with the backlog inline. It shows that the rule, once applied, picks the right issue. It doesn't show whether a whole Tend review, with the bundled review skill in context, remembers to apply it. Tend's next reviews will show that. - **What-is-left lists.** The replay leaves out the earlier PRs that name each issue, which the rule tells the review to read. So its lists repeat items that earlier parts had done. #5454's ask lists #4027 items that #3856 and #3868 had finished. - **Repeat runs.** Each case ran once. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 <[email protected]>
Everything On me is now answered by the widget or thread that asks it. Leaf no longer puts a to-do on the user with a Done of its own, so a widget is never given an answer it doesn't declare. A step such as trying a build is asked in a thread, and the user's reply or a 👍 answers it.
Before,
leaf task create <subject> --on userput a to-do on the user on any thread, element or widget that had no open obligation, and the turn-end check did the same for each step it found. On me then offered that item a generic Done: on anlf-codeblock or a paragraph, the only answer was a check mark the widget never offered. This reverses the user's 2026-10 choice to keep such to-dos for steps.The rule, and where it lives
x-awaits(any widget: bundled, from a package or the page's own), an agent message sent with--obligation, or an update to send again. On the page, each is answered only through its source: the widget's declared actions, or a reply or settling reaction in the thread. A multi-selectlf-optionskeeps its Done, since that is the widget's own control. An answer the user gives elsewhere, such as in chat, the agent still records withleaf task end.--obligation.obligations.py's header, thex-awaitskey inbrowser/registry.json, How it works ("On me and the agent's list", with a new paragraph on what can ask),conversation-loop.md("The On lists", where the to-do row becomes an "action the user takes" row asked in a thread) andauthoring-on-me.md.todos.py's header records the decision.What goes
todoevent has noowner;todo_endis the agent's alone, is no longer browser-postable or undoable, and its handling clause for the user's Done is gone. A Leaf at 39 would misread a 40 log and the reverse, hence the bump. (maintook 38 → 39 for an undoable edit in Let undo take back a rewrite until the agent answers it #5221.)user_task_obligations, thetodoobligation source,--on, theduplicate-obligation/users-question/agents-todorefusals, andowneron served to-dos.queues.on_userrows arewidget,messageorupdate; to-do rows stay on On .kind. Every ask, a step included, is a thread question whose message says what to do and asks for a reply.turn-end-check.md(Check each turn end against the page from a skill reference, and let the fork fix a few stale words #4900) asks the fork that way, and the fork eval (dev/leaf_dev/fork_eval.py,evals/workflows/fork_eval.yaml) labels the step cases as questions.xkey and its "On a to-do waiting on me" stance;queueActions.done(public package API); localtodo_endfolding and its undo words;offers;showOnMe, which Keep text-document comments on their lines, and give page to-dos no place on the page #5223 had extended to landmon a page to-do's card; thedoneaction face andcheckedicon. A stance's exit is always Close's ✕, since no stance names another action now. The margin card's grid loses the row the to-do header held;leaf-dev probe review-a-plan --do drive:card-by-keyboard --basemeasures identical child boxes in both arms.A cost this keeps
A reply answers a step's question whatever it says. A to-do stayed open until Done, so "where do I get the build?" left the step On me; now that reply answers the question, and a plan step naming it reads done until the agent asks again with
--obligationand points the step at the new question.conversation-loop.mdtells the agent to ask again, and the clerk's header records the trade.Tests and evals
Behavior changed on purpose:
todo-on-the-userbecomesstep-on-the-user-takes-a-thread(pass: a thread message with--obligation).closeout-asks-take-their-routenow requires the/reload-pluginsstep as a thread question.on-lists-read-todo-recordsputs the phone build on the user as a question.x, undo of Done, the To-do placeholder, the thread-head line, and Keep text-document comments on their lines, and give page to-dos no place on the page #5223's page to-do on its card) are deleted. Tests that used one as a convenient On me item now use a question in a thread.On the candidate tree (Claude Code, 2 runs each):
step-on-the-user-takes-a-thread2/2,closeout-asks-take-their-route2/2,on-lists-read-todo-records1/2. The failed run listed both user items correctly and failed on the agent side, doubting that the benchmark re-run was under way. No base arm was run: the base instructions route a step throughleaf task create --on user, which these rubrics now fail by construction.pnpm run check:browser,pnpm run test:runtime(775) and the model selections covering to-dos, the clerk, obligations, hooks, undo and the protocol pass, as do the resolved browser tests and #5232's Back-from-an-obligation tests.test_an_item_arriving_above_takes_its_walk_place_and_moves_no_card_readfails here and onmainalike since #5318: the card read moves down by the new card's height (116px onmain, 95px here), so the list no longer holds its place when an item arrives above.