Skip to content

Have the turn-end check give an ask's question a paragraph of its own - #6502

Merged
max-sixty merged 5 commits into
mainfrom
question-own-paragraph
Nov 19, 2026
Merged

max-sixty merged 5 commits into
mainfrom
question-own-paragraph

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

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's text now says the question stands in a paragraph of its own. threads.md says "paragraph" in place of "line" too, since a Markdown line joins its paragraph.

On ask-choice and ask-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. The threads.md wording 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.md paragraph 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 on main.

From open item #22 on the fork-messages page. Max asked to merge the pull requests we're confident in. Tests: test_clerk.py, both test_product_page.py files.

This was written by Claude Code on behalf of max-sixty

…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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Base automatically changed from journey-fork-follow-up to main November 19, 2026 08:09
@max-sixty
max-sixty merged commit 87639d9 into main Nov 19, 2026
4 checks passed
@max-sixty
max-sixty deleted the question-own-paragraph branch November 19, 2026 18:04
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_
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