Repository navigation
Put the agent's own sentence on the banner, on every host - #767
Conversation
…p it current The banner said "Claude working" and kept what the agent was doing in the disclosure behind it, so a reader watching a long piece of work saw one word change for its whole length. The row now carries the agent's sentence, and dates it once the claim is older than "just now" — ahead of the detail, because the detail is what the ellipsis eats first and a stale sentence with its date cut off is the one reading the row must not give. The shipped guidance asks for a sentence worth reading. `SKILL.md` states the priority: while a page is live, telling the reader what you are doing comes before doing it. `conversation-loop.md` gains the surfaces a reader follows, when to write each, and a section on long-running work: a reader's input reaches the agent only between its own operations, so work longer than a few minutes goes to background workers that report their own progress, and the coordinator keeps the replies and the page source. `TODO.md` records what this leaves open, including the banner naming an arbitrary one of several standing claims, observing Claude Code's tool steps the way App Server observes Codex's, and whether delegated work may hold a reader move open. The recorded demo and stills are re-shot on the new row. Validation: - `uv run pre-commit run --all-files` - `uv run pytest tests` (1135 passed) - `uv run pytest tests/test_render_startup.py tests/test_render_controls.py` (185 passed) - matched baseline/candidate previews of `review-a-plan` at 1440x900, fresh and five-minute-old claims, clean consoles in both arms Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
An App Server's streamed tool steps outranked the agent's declaration, so on Codex the banner said `Running pytest -q tests/…` where the reader wanted "checking whether the rollout holds". The two facts answer different questions: a watched step proves a session is alive and moving, which is why it can still make a page working over a declaration that says otherwise, while what the work *is* only the agent can say. A current `working` declaration now keeps the sentence and its own date on every host, and the step is reported beside it as `observed` — under a working reading alone, since a step standing beside "last checked in 30m ago" would argue with the amber dot that reading wears. The status disclosure shows it. `delivery claim` called with no detail writes one of Leaf's own, so a taken-up move says so at once. That wording is not the agent's sentence and is marked `stated: false`: a watched step whose floor reaches the same input knows more, and takes the sentence back. This is what keeps leaf.page's readings as detailed as they were, since the hosted agent declares nothing of its own. Teaching that agent to declare is left to `TODO.md` with the measurement behind it: a "declare each step" paragraph in its instructions produced four good sentences and a turn that ran a closing `resolve` and never replied, which `verify_site.py local` caught; the same tree passed with the paragraph removed. The page contract states the reader's experience again, which two rewrites had trimmed to the views and dropped: what the page wants of them, visible before they read; a move in every state; a drawable move's result at once; and what they have settled visible beside what is still theirs. `TODO.md` gains the section that work belongs to and gathers the items already pulling that way. For delegated work, one writer owns the reading and it is whoever is running: the coordinator while its turn is open, summarizing its workers, and the workers themselves once it ends and nothing in the session can write. Validation: - `uv run pre-commit run --all-files` - `uv run pytest tests` (1137 passed) - `uv run pytest tests/test_render_startup.py tests/test_render_controls.py` (185 passed) - `uv run scripts/verify_site.py local`: published revision 2 and replied, with the hosted banner reading the watched steps - the same check with only the instruction paragraph reverted, as the control that named it Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
Two things, one in the fold and one in a reference the change leaves behind. The row keeping the agent's sentence is the right call and the rest of the diff carries it cleanly — these are both about what the fold does when the declaration has nothing to say.
A working declaration with no detail now blanks the row while a live step exists
DETAIL is optional on the status command (required=False, default="" on the detail argument in cli.py), so a bare leaf status PAGE working is a supported renewal — and it writes an empty sentence with stated implicitly true. The new branch prefers it over stream_work, so under a Codex App Server the row drops from Codex working — Editing index.html to Codex working, and the step survives only in the disclosure. Calling canonical_activity directly with a fresh declaration and a live same-turn stream at the same event floor, on each side of the merge base:
395010683009dc3bdf3c5aed17aea2ec4bdb078e ('working', 'Editing index.html')
3e4e4dfd923ecc6eb3f72b79e71f82404172fad1 ('working', '') observed='Editing index.html'
That is the one case where the step is strictly more than the declaration, which is the argument the PR already makes for Leaf's own claim wording. Requiring the declaration to carry a sentence before it takes the row keeps every reading the PR intends; the suggestion is inline. With it applied, the new cases and the rest of test_interact_session.py and test_interact_server.py stay green.
references/host-codex.md still states the old precedence
It tells a Codex host author that "Plan updates, tool starts, reasoning summaries, and waits for approval or user input become the page's short current activity detail". After this change that holds only where no current stated declaration stands; otherwise they become observed and stand beside the sentence. session-lifetime.md and page-storage.md both took the new rule, and this is the file the host's reader acts on. Say the word and I will push the wording.
… in the Codex reference `leaf status <page> working` with no detail says that work is happening and nothing more, so preferring it over a watched step blanked the row on a page that had something to show. A declaration takes the sentence only when it has words. `references/host-codex.md` still told a Codex agent its tool starts and reasoning summaries become the page's activity detail, which stopped being true when the agent's own declaration started winning that seat. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
# Conflicts: # TODO.md
The nightly leg of `ci` on `main` went red on [run 35295861023](https://github.com/max-sixty/leaf/actions/runs/35295861023): `test_tab_extends_the_comment_with_individual_emoji_buttons` opened the command reference expecting its `z` row to read `Take back: shorten on “The store is capped…`, and read a register of 81 commands with no such row. The case now opens the reference from the moment the page says the press is live, which is the fact the row states. That row is dead until the page has taken in a log reading that accounts the reader's own send. `history.undo`'s `when` clause asks `!unaccountedGesture() && Boolean(undoable())` ([`keyboard/page.js:1178`](https://github.com/max-sixty/leaf/blob/8d8bec8005c970234abd5f33415c25463a09aa01/skills/leaf/assets/runtime/keyboard/page.js#L1178)), and `undoable()` reads the server projection `runtime.view.undo` and answers null while a state is still being applied ([`projection/commands.js:19`](https://github.com/max-sixty/leaf/blob/8d8bec8005c970234abd5f33415c25463a09aa01/skills/leaf/assets/runtime/projection/commands.js#L19)). The case pressed `?` straight off `painted()` — the forward paint the reaction makes in the turn it sends, a turn before that reading arrives — and the register is built at the press, so the sentence it asserts could not be in it. `render_harness.undo` already carries this exact hazard for the `z` press itself, and waits on the line offering the chip: the line and the dispatcher ask one predicate, so the chip standing on the line is the page saying the press will be taken. This case waits on the same fact one step earlier, before opening the reference that names it. Not caused by `8d8bec80`, the commit this run reports on. The ordering was never stated; #774 (`145da07d`, serving each page through starlette and uvicorn) moved the timing into the window it left open. CI says the same on its own: the nightly leg of `145da07d`'s [run 35289151800](https://github.com/max-sixty/leaf/actions/runs/35289151800) failed this case with this message, and the last green `main` nightly before it is `f292b4d2` ([run 35282456731](https://github.com/max-sixty/leaf/actions/runs/35282456731)). `dc694cd8` and `80c26f0f` sit between them and were replaced before their nightly ran, so CI has no reading on either; the local repeats below cover that gap. <details><summary>Measurements</summary> All on this runner, `-n0 --run-nightly`, one node id. At the old press point the press was dead in 6 of 6 runs, and the new wait returned 3–117 ms later — so the case was green only when the reading happened to land inside the poll of the `to_be_hidden()` above it. Reopening the reference 1.5 s after a failing read showed 82 commands, so the row was merely late rather than absent. Where the window opened, by repeat runs of the case alone: | commit | result | per run | | --- | --- | --- | | `43d92073` (#767) | 4 passed | 3.8 s | | `80c26f0f` (#773) | 4 passed | 3.8 s | | `145da07d` (#774) | 3 failed, 1 passed | 4.8 s | | `8d8bec80` (#776) | 1 failed | 4.8 s | | `e382d828` (`main`) | 2 failed, 1 passed | 4.8 s | </details> Checked: the case 6/6 green with the change, `tests/test_render_reactions.py` under `--run-nightly` (50 passed), and `pre-commit run --files tests/test_render_reactions.py`. The everyday suite ran 1130 passed / 5 failed here, and all five are this sandbox rather than the change — three `test_interact_session.py` cases that need a writable `/tmp` for their private unix socket, `test_staged_writes_honor_umask`, and `test_live_shell_artifact.py::test_a_browser_executes_the_published_capture_with_live_api_routes[True]` on its node bundle step. The `test` job of the run above is the Linux control and was green on this commit; this change touches only a nightly-only file. Co-authored-by: leaf-agent <[email protected]>
The banner said
Claude workingand kept what the agent was doing behind a disclosure, so a reader watching a long piece of work saw one word change for its whole length. Under a Codex App Server it said something more detailed and less useful —Running pytest -q tests/…— because streamed tool steps outranked the agent's own declaration. Both are now the same reading on every host: the row carries the agent's sentence, dated once the claim is older than "just now", and the watched step stands beside it in the status disclosure.The banner row
Claude working — running the browser suite, andClaude working · 5m ago — running the browser suiteonce the claim has aged. The date goes before the detail because the detail is what the ellipsis eats first, and a stale sentence with its date cut off is the one reading that row must not give. #671 had moved the detail into the disclosure four days ago for a calmer banner; this reverses that forworkingand leaves the complete wording in the disclosure.What the work is, versus that it is happening
A watched tool step proves a session is alive and moving, which is why it can still make a page
workingover a declaration that says otherwise. It cannot say what the reader is waiting for. So a currentworkingdeclaration keeps the reading's sentence and its own date, and the step is reported asobserved— under a working reading alone, since a step beside "last checked in 30m ago" would argue with the amber dot that reading wears.A declaration takes the sentence only when it has words:
leaf status <page> workingwith no detail says that work is happening and nothing more, which a watched step says better.delivery claimcalled with no detail writes one of Leaf's own, so a taken-up move says so at once. That wording is not the agent's sentence and is markedstated: false: a watched step whose floor reaches the same input knows more and takes the sentence back. This is what keeps leaf.page's readings as detailed as they were, since the hosted agent declares nothing of its own.Teaching that agent to declare is left to
TODO.mdwith the measurement behind it: a "declare each step" paragraph in its instructions produced four good sentences and a turn that ran a closingresolveand never replied, whichverify_site.py localcaught; the same tree passed with the paragraph removed.Guidance
SKILL.mdstates the priority: while a page is live, telling the reader what you are doing comes before doing it.references/conversation-loop.mdgains the surfaces a reader follows, when to write each, and a section on long-running work — a reader's input reaches the agent only between its own operations, so work longer than a few minutes goes to background workers, and one writer owns the reading: the coordinator while its turn is open, summarizing its workers, and the workers themselves once it ends and nothing in the session can write.The page contract states the reader's experience again, which two rewrites had trimmed to the views and dropped: what the page wants of them, visible before they read; a move in every state; a drawable move's result at once; and what they have settled visible beside what is still theirs.
TODO
Two new sections: "Make Leaf feel like a game", gathering the items already pulling that way, and "Agent activity on the page", holding what this leaves open — the banner naming an arbitrary one of several standing claims, observing Claude Code's tool steps the way App Server observes Codex's, and whether delegated work may hold a reader move open across turns.
Validation
uv run pre-commit run --all-filesuv run pytest tests(1138 passed on the tree with main merged in)uv run pytest tests/test_render_startup.py tests/test_render_controls.py(185 passed)uv run scripts/verify_site.py local: published revision 2 and replied, with the hosted banner reading the watched stepsreview-a-planat 1440×900, fresh and five-minute-old claims, clean consoles in both arms