Skip to content

Give the printed leaf comment forms their page argument, and route an event id off --section - #837

Merged
max-sixty merged 2 commits into
mainfrom
fix/ci-35422088941
Sep 19, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/ci-35422088941

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

publish-site on main failed at the deploy gate's hosted-agent pass. The turn spent three commands failing to reach Leaf's reply interface, and the revision that did reach the page never carried the heading the ask named. This PR fixes the two dead ends those three commands hit: a refusal that offers no recourse when --section is handed an id from another namespace, and five printed command forms that omit their required PAGE argument. It does not make the failed run green — what the turn chose to publish is the model's, and the section below says why I did not reach for the gate's retry instead.

What the run did

The gate reported:

RuntimeError: https://leaf.page/examples/triage-board/ agent did not publish ‘Deployment de34a7d1 verified’; it reached revision 2 from 1 with the page reading listening; it replied: deployment verified

Workers Observability for that turn (event 56f596b2765bf1b5f1a6f40bc4232ab6, turn 01a0b800-c8fd-7f72-a404-2316ffc1f704) records the sequence: one commandExecution at exit 0, one fileChange, then three commandExecution items with status failed at exits 1, 2 and 1, then the final model message the host published as the reply. No publish command ran at all. The gate's own activity profile names the three that failed:

$LEAF reply --section 56f596b2… --quote 'deployment verified' "deployment verified"
$LEAF reply . --section 56f596b2… "deployment verified"
$LEAF reply . --section 56f596b2… --text "deployment verified"

One wrong belief runs through all three: that --section takes the delivered event id. It takes an element id. The first also drops the PAGE argument entirely, so "deployment verified" landed as the page directory.

Revision 2 was not one of those three. _capture_anchor exits before activate_checked_source runs, so a reply refused on its section activates nothing; the turn's only other write was the host-bound final message, whose reply carries validate_source=True and so activated the edited index.html. What that revision actually held is the one thing the records do not say — no content is logged, by design — so whether the model wrote a different heading or the gate's fetch of the private revision never landed is not settled here. Either way the turn reached its reply through a route that never confirmed the edit.

The 503s earlier in the same log are separate and already answered: the image rollout draining, absorbed by the workflow's own until loop, with #835 since landing the reading that names them. The commit under test (#832) changed only browser runtime modules and their tests, so it did not cause this.

What changes

The refusal names the namespace. Reproduced at the CLI, leaf reply <page> --to <id> --section <that same id> exits with can't anchor in revision r1: no element id '…' in this version and nothing else, sending an agent that holds a log id to look through the page's markup for something that was never there. _foreign_id_recourse in conversation.py reads the log, and when --section's value is an event there the refusal continues:

; <id> is a comment in this page's log — `leaf reply <page> --to <id>` answers a message and `--for <event-id>` addresses a delivered move, while `--section` takes an element id the page's markup declares

It sits at _capture_anchor, the one door both leaf comment and leaf reply reach --section through, and it stays silent unless the log actually holds the value, so the existing typo refusals are untouched.

--for is named for every kind the log holds, not only for a message. A reader's press on a widget frozen into a reply is addressed through that action event's own id and nothing else — current_responses returns a reply obligation keyed on it, and --to names messages — so gating the pointer on a message kind would have left the one case where a single option is the only route without one. The article is derived rather than fixed, so action, undo, edit, and unresolve do not read as "a action".

Every printed command form carries its page. leaf comment --section <ask-id> cannot run: PAGE is a required argument, so the next token is eaten as the page directory. It was printed that way in five places — ANSWER_ASK_INSTRUCTION, both requires a page version refusals in cmd_reply, and the comment and reply handling sentences in the layer registry, which is the vocabulary an agent reads for the exact event it is answering. The public reference in references/conversation-threads.md already writes every form with its page; these now agree with it.

Why not the gate's retry

The turn replied without doing the work, and ask_until_answered re-asks only on a startup_failed receipt, so that shape gets one ask. Widening it is where #791 went, and you closed that with "rather than adding retries / conditional retries, can we fix the underlying issue that's causing the need for retries?" — so I have left the gate alone and fixed what the turn actually ran into. What remains unaddressed is the model's own choice, which no change here reaches.

Verification

Two new cases in tests/test_interact_anchors.py — one for a message id handed to --section, one for a delivered widget press — each fail against the refusal they replace with exactly its production message, and pass with the fix. uv run pytest tests/test_interact_anchors.py is green (53 passed), as are tests/test_interact_product.py and tests/test_interact_contract.py (329 passed).

Wider selection and its environment failures

uv run pytest tests/test_interact_session.py tests/test_interact_layer.py tests/test_interact_contract.py ran 627 passed, 3 skipped, with 2 failures and 2 errors that belong to this sandbox rather than the change: three are OSError: [Errno 30] Read-only file system on /tmp, which the agent sandbox mounts read-only, and test_staged_writes_honor_umask_without_copying_a_replaced_symlink_mode reads the sandbox user's umask. None touch the anchor or conversation paths.

publish-site has since gone green on main twice, at ce11d502 and d21cd640, so nothing is currently red and this is not urgent.

Failed run: 35422088941.

… event id off --section

The deploy gate's hosted turn in run 35422088941 spent three commands guessing at the reply interface: it handed the delivered comment's event id to `--section`, which takes an element id, and the refusal said only that the page holds no such element. Five printed command forms also omitted the required PAGE argument, which is the shape of the first of those three.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_foreign_id_recourse gates the --for pointer on MESSAGE_KINDS, but a message is not the only id an agent is handed, and it is not the kind that most needs the pointer. A reader's press on a widget frozen into a reply is answered through that action event's own id and nothing else — current_responses in delivery.py returns {"kind": "reply", "to": <root>, "for": <action-id>} for it (if owner := widget_conversations.get(event.get("widget"))), and --to cannot address it. Reproduced at the CLI, an agent that reaches for --section with that id now gets:

can't anchor in revision r1: no element id '<action-id>' in this version; <action-id> is a action in this page's log, while `--section` takes an element id the page's markup declares

The namespace is named and the option is not, in the one case where a single option is the only route — which is the gap this change exists to close. The same sentence also emits a action, and that reaches every vowel-initial kind the log holds: action, undo, edit, unresolve.

The inline suggestion names --for for every kind and keeps --to for the kind a message id also answers to. Pushing it here with a case in tests/test_interact_anchors.py that fails against this commit with exactly the message above.

The recourse gated its `--for` pointer on MESSAGE_KINDS, so the one case where a
single option is the only route got no option at all: a reader's press on a
widget frozen into a reply is addressed through that action event's own id and
nothing else — `current_responses` returns a reply obligation keyed on it, and
`--to` names messages. An agent handed that id and reaching for `--section` read
"is a action in this page's log" and was sent nowhere.

`--for` now appears for every kind, with `--to` kept for the kind a message id
also answers to. The article is derived rather than fixed, so `action`, `undo`,
`edit`, and `unresolve` stop reading as "a action".

The new case in tests/test_interact_anchors.py builds the frozen thread widget,
presses it as the reader, asserts the press is a live `--for` target, and fails
against the previous refusal with its exact production text.
@max-sixty
max-sixty merged commit 767e36c into main Sep 19, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix/ci-35422088941 branch September 19, 2026 07:59
max-sixty added a commit that referenced this pull request Sep 19, 2026
The route table read the event's kind, and `--for` does not take most kinds:
it takes an id whose `current_responses` entry is a reply, so a `resolve`, an
`undo` or an answered action was sent there only to meet `no longer requires a
reply` with no route at all. `logged_id` now takes the current responses and
names the command that settles what is owed — a reply, a receipt — or says
the thread takes a page version, or that nothing is owed. `--section`, `--to`
and the `--for` refusal read it; `receipt`, whose door has the log and not the
page, names the kind and the open requests and no route.

`--to`'s refusal needs the page to read the obligation, so `_message` and
`_thread_root` take it. #837's `--section` test answered the agent's own
comment, which is owed nothing; it now answers a reader's.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Sep 19, 2026
… owes for it (#857)

A hosted turn in the site's local verification published its edit, then
spent thirty seconds on six forms of `leaf receipt`, handing it a
comment's id, a delivery's id and a kind's name in turn. Each got back
only `unknown request 'X'`, which left it nothing to change but the
guess. #837 fixed the same dead end for `--section` after it failed the
deploy gate.

Which writer takes a bare id is not a matter of the event's kind but of
what the log still owes for it, and `current_responses` already reads
that: a reply, a receipt, a page version, or nothing. `logged_id` in
`skills/leaf/scripts/leaf/validation/admission.py` turns that reading
into a refusal's recourse: what the log holds the id as, and the command
that settles it. A message is the one id whose writer turns on its
conversation rather than on itself, since `--initiates` is refused while
the thread owes a response, whichever of its messages is owed it.
`thread_obligation` is that reading — the response standing on the
message's conversation, or the version its root declared, which stays
after the obligation clears — and `cmd_reply`'s `--initiates` and
version guards refuse on the same one rather than deriving their own.
Two readings of "which writer takes this message" is the duplication
this change exists to end. What each refusal now says:

- `--for` on `reply` used to answer every id it could not take with `no
longer requires a reply`. A request now names its receipt, a message
names `--for` or `--to … --initiates` by what its conversation owes, a
resolve says nothing is owed, and an id the log never held says so.
- `--section` was routed by kind in #837, which sent a `resolve` or an
answered action to `--for`, where it met that same refusal with no
route. It now reads the obligation.
- `--to` on `reply`, `resolve` and `edit` listed the page's messages but
never said what else an id was.
- The version branch named no route, while `cmd_reply`'s version refusal
was already offering one: a separate thread on the same Ask. All three
now share that sentence as `VERSION_THREAD_RECOURSE`. It names the Ask
as the recipe `--section <ask-id>` rather than by id, because the id is
markup — a later revision may retire it, and whether `--section` takes
it is the anchor rule's to say against the active revision, which the
log cannot vouch for.
- `receipt` says a misdirected id is not a request, where it goes
instead, and which requests are still open, or that there are none —
read off the same responses, since a request with no receipt is exactly
what one names. The dispatcher already holds the page, so
`_receipt_error` passes it through; `requests` reaches
`current_responses` on the refusal rather than at import, since
`delivery` loads it.

The tests that pinned #837's kind-based wording now assert the
obligation's route: #837's message case uses a reader's comment, which
is owed a reply. New tests hand `--section` a `resolve`, which is owed
nothing; the agent's own comment, whose `--to … --initiates` route the
test then follows; a comment whose thread is owed a reply, where the
test follows the `--for` the refusal names and checks the `--initiates`
guard names the same event; and a resolved version thread, where the
test checks that both refusals name the same recourse and that it is
accepted once filled with the Ask's id. The receipt test covers a
comment handed to `receipt`, and a request handed to `resolve --to` and
to `reply --for`.

Verified with the everyday suite and pre-commit. Each route is also
checked by reverting it: removing the obligation reading, restoring the
kind-based fallback, dropping the `--to` route, giving the receipt no
obligation, reading a message's own obligation in place of its
conversation's, dropping the version declaration from the reading, and
dropping the recourse from the version branch each fail the tests that
own them, the version declaration on each arm separately.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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