Repository navigation
Give the printed leaf comment forms their page argument, and route an event id off --section - #837
Conversation
… 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
left a comment
There was a problem hiding this comment.
_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.
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]>
… 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]>
publish-siteonmainfailed 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--sectionis handed an id from another namespace, and five printed command forms that omit their requiredPAGEargument. 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:
Workers Observability for that turn (event
56f596b2765bf1b5f1a6f40bc4232ab6, turn01a0b800-c8fd-7f72-a404-2316ffc1f704) records the sequence: onecommandExecutionat exit 0, onefileChange, then threecommandExecutionitems with statusfailedat 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:One wrong belief runs through all three: that
--sectiontakes the delivered event id. It takes an element id. The first also drops thePAGEargument entirely, so"deployment verified"landed as the page directory.Revision 2 was not one of those three.
_capture_anchorexits beforeactivate_checked_sourceruns, so a reply refused on its section activates nothing; the turn's only other write was the host-bound final message, whose reply carriesvalidate_source=Trueand so activated the editedindex.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
untilloop, 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 withcan't anchor in revision r1: no element id '…' in this versionand 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_recourseinconversation.pyreads the log, and when--section's value is an event there the refusal continues:It sits at
_capture_anchor, the one door bothleaf commentandleaf replyreach--sectionthrough, and it stays silent unless the log actually holds the value, so the existing typo refusals are untouched.--foris 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_responsesreturns a reply obligation keyed on it, and--tonames 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, soaction,undo,edit, andunresolvedo not read as "a action".Every printed command form carries its page.
leaf comment --section <ask-id>cannot run:PAGEis a required argument, so the next token is eaten as the page directory. It was printed that way in five places —ANSWER_ASK_INSTRUCTION, bothrequires a page versionrefusals incmd_reply, and thecommentandreplyhandling sentences in the layer registry, which is the vocabulary an agent reads for the exact event it is answering. The public reference inreferences/conversation-threads.mdalready 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_answeredre-asks only on astartup_failedreceipt, 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.pyis green (53 passed), as aretests/test_interact_product.pyandtests/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.pyran 627 passed, 3 skipped, with 2 failures and 2 errors that belong to this sandbox rather than the change: three areOSError: [Errno 30] Read-only file systemon/tmp, which the agent sandbox mounts read-only, andtest_staged_writes_honor_umask_without_copying_a_replaced_symlink_modereads the sandbox user's umask. None touch the anchor or conversation paths.publish-sitehas since gone green onmaintwice, atce11d502andd21cd640, so nothing is currently red and this is not urgent.Failed run: 35422088941.