Repository navigation
Have the turn-end check give an ask's question a paragraph of its own - #6502
Merged
Merged
Conversation
…heir prompt last
The claude-code journey's `fork-follow-up` failed whenever the line fork judged
`fork-lookup`'s question ("How many cards does this page's source hold? Count them
in the file.") `hand_over`: in 4 of the 10 journey runs on 18 November whose verdict
is known. The line-fork eval's `source-edited` case meanwhile passed 6/6. Two causes:
- The take criterion asked for work that "needs nothing the main session is
changing or about to change (its files and branch, the page's source, its pull
requests)". A Leaf session may always change its page's source again, so a line
fork that deliberated read any read of it as the session's, in its own words:
"The answer comes from the page's source, which the main session edits and may
change again". The criterion now separates changing from reading: take is work
that changes nothing the session works on, settles no question it is weighing,
and waits on nothing it has under way, such as a command it is running or a
change it has started and not finished; reading the session's files and the
page's source is such work. How it works says the same.
- The eval's replay couldn't show the miss. `claude -p --resume` reads its
environment afresh and puts every record the transcript lacks (working
directory, deferred tools, agent and skill listings, session context; some 3k
tokens) after the prompt. A live fork's request, captured from a journey, ends
with the prompt and otherwise matched the replay's message for message.
`fork_eval.fork` now resumes once against an address no API listens on, which
writes those records without a request, and carries them after the transcript's
first prompt, so the fork's request ends with its prompt and a line giving
today's date. A replay whose first resume writes none fails rather than
scoring the old order. The date stays out of the seed: a fork read a
session-start date of 18 November as the day of a case's 3 November
conversation (`turn-end-check/ask-step-done` 1/4 with it seeded, 4/4 without).
Skills are off, since a resume's skill listing differs offline and online.
`source-edited` now has the session add a card in a new column, as the journey's
session does, rather than a tile while "the cards and columns are unchanged".
`source-editing`, its `hand_over` control, now stops before the session's first
edit, the earlier point the old wording's "about to change" covered, with a Read of
the page's source running. A case's `{page}` and `{session}` are now replaced
throughout it, so that running call names the case's page.
Measured on the real conversations of three journey sessions at the lookup,
replayed with the prompt last, at the journey's effort (medium), 20 runs each:
| session | `hand_over`, old wording | new wording |
| ---------------------------------- | -----------------------: | ----------: |
| 15:12, fork steps after `release` | 12/20 | 0/20 |
| 18:27, the same order, sandboxed | 14/20 | 0/20 |
| 18:08, after the delivery steps | 3/20 | 0/20 |
The first at xhigh: 6/20 with the old wording. Replayed the old way, with the
environment after the prompt, the same sessions gave 1/60 at medium and 0/30 at
xhigh, and 12 live forks of a fourth session at the lookup all took it.
Eval, Opus 5.5 at xhigh, fixed harness: `source-edited` 4/10 `hand_over` on base,
0/10 on head (and 4/20 against 0/20 in two earlier rounds while the date was still
seeded); `source-editing` 5/5 `hand_over` on both. The other line-fork cases:
head 14/14, every `hand_over` case still handing over; base 13/14. Turn-end and
summary cases on head: 22/24, both failures the judge's "question on its own line"
(`ask-choice` failed it 2/4 under the old harness too).
`leaf-dev journey run claude-code` with the change passed all 17 steps twice.
> _This was written by Claude Code on behalf of max-sixty_
…context and request The line fork's prompt now opens by saying what Leaf asks of the fork: the working line it posts at once, and who should do the work, a fork beside the main session or the main session itself. The order after that is the rule against tools and deliberation, the running call and the thread's JSON, then the line, the take criterion and the JSON answer. The prompt used to say "The main session takes the message from here and does what it asks", which was written before a fork could take work (#5961). It stood just above the question of whether a fork should take it. It is gone, and the line now stays "until the agent's answer replaces it", whoever answers. Max asked for the reorder after reading the prompt as a fork receives it: "at no point is it completely obvious ... that the goal is to give an ephemeral line and to decide whether a fork or the main thread should own the subsequent work". Scored with `leaf-dev eval run 'line-fork*' --harness claude-code --repeat 5 --base HEAD`: base 43/45, head 44/45 ($4.52). Every `work` judgment was right on both arms. All three misses were `line-right` on why-ci, where the line gave away the cause ("with the -n 8 vs serial runs"): two on base, one on head.
Two line-fork cases: a message that changes how the session will do the work it said it does next (steer-plan), and one that changes a command the session is running (steer-running). Both belong with the session. The take rule doesn't name steering; the fork hands both over anyway, 10 of 10 runs across the two cases ($1.20), with the line judged right each time. They guard that behaviour against a later rewrite of the rule.
The turn-end check's fork often wrote an ask with its question inside a paragraph of status and advice, copying the shape of the agent's chat reply, though threads.md, which it reads, says to give a question a line of its own. On real pages, 9 of the 29 asks it posted between 17 and 18 Nov kept their question in a paragraph with other sentences, one of them mid-paragraph; the eval's `ask-choice` and `ask-permission` cases failed the judge on it 2 of 4 and 1 of 4 times. turn-end-check.md's `text` field now says the question stands in a paragraph of its own, apart from the facts and advice around it. On those two cases, over three batches against the same base, the base passed 15 of 24 runs and this change 16 of 16. The other seven ask cases passed 21 of 21 on base and 20 of 21 here, the miss one more question sharing its paragraph. Stating the rule only in threads.md, as "a paragraph of its own" in place of "a line of its own", changed nothing (13/20 against 16/20 on the five ask cases). That wording stays, since a Markdown line break joins the next line into the same paragraph, so a paragraph is what renders apart. The evals cost $12.
leaf-agent
reviewed
Nov 19, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
Holding the verdict on the decision the description leaves to the maintainer: whether the second statement of the rule in turn-end-check.md should stay. The fork already gets the threads.md paragraph "A thread shows in a narrow card" through clerk.py's excerpts, so the rule did reach it, and the evals show the field-level sentence is what changes the outcome. Restating it at the field reads as a fair use of the duplicate rather than a stray one. The PR is also stacked on #6477, so it targets that branch until the retarget. Nothing else in the diff needs changing. tests/model/test_clerk.py passes at this head.
max-sixty
added a commit
that referenced
this pull request
Nov 19, 2026
… a choice (#6536) A message that carries `lf-options` now says what is true of one option, such as what choosing it does and costs, only on that option's card. Its text holds the question, the facts true of every option and the advice. Before, the text usually walked through the options too, and the cards said it again: on `main`, turn-end asks restated the cards in 6 of 12 `ask-choice` runs, 12 of 12 `ask-permission` and 6 of 6 `ask-question`. `threads.md` drops "such as the options a question weighs", which asked for a paragraph per option even beside cards, and "Ask for a pick" says the text and the cards are read together. The turn-end check's `text` field says the same, replacing the sentence #6502 put there; the fork follows the field over its guidance excerpts, and with `threads.md` alone `ask-permission` still restated 3/3. With the field sentence, restating fell to 0/3 on `ask-choice`, `ask-permission` and `ask-question`, and the ask guards held 2/2. **To weigh:** no eval scores the `threads.md` change for the agent's own messages: `thread-choice-takes-a-press` reads no reference, so its arms get the same input. Its new `said-once` criterion catches the repetition there, which its frozen prompt drives. Its `markup-accepted` rubric no longer calls `value` and `recommended` undeclared, since `lf-option` declares both. From open item #29 on the fork-messages page, after Max asked whether an ask repeats its option cards; he picked merging it there. Runs cost $21. Tests: `test_clerk.py`, the layer-contract, interact-layer, thread-reading and hooks tests. > _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.
The turn-end check's fork often posts an ask with its question inside a paragraph of status and advice, copying the shape of the agent's chat reply. On real pages, 9 of the 29 asks it posted on 17–18 Nov kept the question in a paragraph with other sentences. The guidance it reads already says to give a question a line of its own (
threads.md), so this states it beside the field the fork writes:turn-end-check.md'stextnow says the question stands in a paragraph of its own.threads.mdsays "paragraph" in place of "line" too, since a Markdown line joins its paragraph.On
ask-choiceandask-permission, the two cases the judge failed on this, base passed 15/24 runs and head 16/16. The seven other cases on asks, four of which should post none, passed 21/21 on base and 20/21 on head. Thethreads.mdwording alone didn't help: 13/20 against 16/20 on base, across the five cases that post an ask.To weigh: this puts a second statement of the rule in the turn-end check's reference, beside the field it governs. The fork already reads the
threads.mdparagraph among its guidance excerpts (clerk.GUIDANCE), and that alone didn't change what it wrote. The runs used the fork eval's replay from #6477, now onmain.From open item #22 on the fork-messages page. Max asked to merge the pull requests we're confident in. Tests:
test_clerk.py, bothtest_product_page.pyfiles.