Skip to content

feat(branch): carry the status notes through factory members and correct the branch texts - #2013

Merged
yyhhyyyyyy merged 42 commits into
mainfrom
hui/branch-opening-policy
Nov 24, 2026
Merged

yyhhyyyyyy merged 42 commits into
mainfrom
hui/branch-opening-policy

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

This change keeps the deterministic part of the branch work: the corrected branch texts, the status notes' guidance delivered through factory members that ship empty, the scenario runner's support for comparing those members, and the scenario that exercises them.

The protocol texts now name their lines by placeholder: the guide entries for <dim-branch-line> and <dim-branch-lines> write P and O instead of a hard-coded main. A note to the former default branch says the move took the role from this line and names the line it moved to, then states the tree's own end rule and stops there: whether a line reports to its opener and keeps working is a model choice, so it is not in the shipped note. The design states that end rule for the note and records the report-and-continue sentence as a policy sentence of BranchToolConfig::former_default_note. The branch tool description's last sentence says an end ends the calling line and every line below it, and the design's protocol list follows it. The user-line birth identity states that such a line cannot end itself unless the user makes it the default branch.

BranchLine writes each note's protocol sentences from the code. The How you work here: block that follows them comes from BranchToolConfig::default_note, BranchToolConfig::user_default_note or BranchToolConfig::former_default_note, with the member's {parent} and {other} placeholders replaced by the line ids the note names. An unset or empty member writes no block, heading included, and the product sets none of the three, so a shipped note carries the protocol sentences alone. the_default_configuration_writes_no_guidance_block pins the shipped note byte for byte and its next model request, and pins that the product configures none of the three members, a_configured_note_block_reaches_the_note pins a configured block with its placeholders replaced, and the tests for a line the user opened and for the former default branch pin both cases for their members, the former default branch's test also pinning that its shipped note ends with the end guard. The compaction identity test covers the four lines a move can touch: the tool line the move makes the default branch, the tool line it displaces, a line the user opened that becomes the default branch, and the root, which gets no note.

The scenario runner now takes the text each candidate replaces as an input of its own: every --text ID names --baseline FILE beside --candidate FILE, and the current arm puts that baseline in place through the same factory overrides the candidate uses. A pair with a file missing, a text named twice, and a pair whose baseline and candidate hold the same bytes are refused before any run starts. The three status-note members are texts of their own: timeline-tree/default-note, timeline-tree/user-default-note and timeline-tree/former-default-note.

The runner can move the default branch more than once: a scenario states its moves in order, a move may name the line a session.branch_create call opened as its target, and a move may carry the input for the line it moved away from. That input is what makes the former default line answer, because a note goes in as an append input and an append input never starts a turn. A move waits for the note of every line that answers its follow-ups, and the exported Timeline is checked before the judge: a request that consumed a follow-up without its line's note fails the run as switch_note_missing and is not judged. A move still at the front of the run at its end is switch_incomplete and fails the run, while a move that stopped on its wall clock keeps the seconds ending and one that never moved is switch_target_not_reached, as on main.

The new scenario, user-line-becomes-default, opens a user line through a session.branch_create call, lets main open a tool line, moves the default branch to the tool line and then to the user line, and sends an input to each line after the moves. the_user_line_switch_carries_both_notes_into_the_requests runs it through the loopback fixture and asserts that each request carries the note its line received, with the placeholders replaced by the line ids, and that the current arm's requests carry no guidance block. The design updates its scenario count and the runner's description in section 12.3, and the prompt design record names the three flags in section 9.8.

The candidate texts are split out of this change, and the reason is the reported evaluation (#2013 (comment)). It ran 896 times and is a fail under the predeclared comparison rule: the compaction identity case falls from 15 of 20 runs to 5 of 20, and that loss tracks how often the candidate opened a line, so it does not show worse identity retention given a line, and it does not show the less frequent openings are harmless either. Six floor scenarios were judged fewer than 20 times per arm, and the one probe that measures opening a line, switch-then-open-lines/new-default-opens-a-line, came out 34 of 34 on the current arm and 34 of 36 on the candidate, so the second gate shows no rise. Green protocol CI would not settle either question, so the policy texts stay out of the shipped defaults until their gates pass.

What moved out is the three note blocks, the description's policy sentences (the four conditions for opening a line, their boundaries with neighbouring mechanisms, and what the brief carries), the design's policy sentences in sections 12.1 and 12.4, and the four baseline fixture files; the shipped description is the text the evaluation's current arm was given, byte for byte. The design's section 12.1 returns to the first versions it recorded and states that a shipped note carries no guidance block, and section 12.4 names the three members, states that the product sets none of them, and keeps the policy sentences it recorded before the candidate.

Two changes follow. The first pre-registers the evaluation: the compaction identity case gives both arms the same opportunity to show continuity without depending on whether a line was opened (reported as issue #2125), the scenarios whose work genuinely benefits measure how often a line is opened, and every floor scenario is judged at least 20 times per arm. The second puts the candidate texts at their members and goes through both gates in its own change.

CI still covers the protocol texts as before: the flow tests assert the guide entries, the status notes' sentences, the description's last sentence and the refusals, and the no-model scenario test asserts that the committed scenario set parses and that its shared premises stay equal.

The `<dim-branch-line>`, `<dim-branch-lines>` and `<dim-branch-message>`
entries named `main` as the parent, as the roster's line and as the
receiver. Any line may open a line, so the examples carry the design's
placeholders: `P` for the line a block came from or goes to, and `O` for
the line whose roster it is. No sentence changes. The copies the flow
tests pin follow.
§12.1 now holds the coordination paragraph of the branch tool, the four
conditions for opening a line with their exception and boundaries, the
brief a line receives, and the "How you work here" blocks of the status
notes: four bullets on a tool line that became the default branch, two
on a line the user opened, and two in the note to the former default
branch.

§12.4 names the three factory members that replace those blocks and
keeps the protocol sentences byte-identical. §20.32 states that an end
ends every line below it with `ancestor` set, as §10 describes.

The Chinese text mirrors the English one.
The branch tool's description now says what coordinating means on a line
that opens lines, when all four conditions for opening one hold, the
exception when the user asks for a line, the work these conditions do
not cover, and that an end ends every line below it.

A status note's "How you work here" block is written by BranchLine from
three factory members: `default_note` for a tool line a move makes the
default branch, `user_default_note` for a line the user opened, and
`former_default_note` for the former default branch. The note's
protocol sentences stay the code's, the former note names the line the
role moved to and restates the end rule, and the line ids the note
names replace the members' `{parent}` and `{other}` placeholders.

The evaluation can replace each block with `timeline-tree/default-note`,
`timeline-tree/user-default-note` and
`timeline-tree/former-default-note`. The compaction identity test now
covers a tool line a move makes the default branch, a tool line it
displaced, a line the user opened and the root.

The description grows by 586 characters, about 147 tokens per request.
A status note is written only when a move writes it.
The compaction identity test opens a line the user makes the default
branch at the root's head. That head can sit inside a model output the
root is still writing, and the open is refused for it; the cut now
waits for the root to be idle, as the other user-opened flows do.
The timeline export flow compacts a Session whose model declares 4,400
tokens. The branch tool's longer description raises the request frame,
and the compaction's resident parts no longer fit half of that budget,
so the manual compact answers `nothing_to_compact` instead of
`completed`. The window moves to 6,000, which keeps the flow's small
model and its completed compaction.
The note builder took the line id and the factory configuration as two
more arguments than clippy allows. It is now a method on BranchLine,
which holds both, so the call names only what the move decides.
BranchLine writes the closing sentence on any line that opened lines, not
only on the default branch, and §12.4 classes it as the opener's
coordination text.

@eric8810 eric8810 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.

The factory fields and status-note ordering match the design, and the compaction test adds useful identity coverage. The remaining gate is the behavioral evaluation; the rendering tests do not establish how the model decides whether to open a line.

[P2] Include a reproducible old-policy versus new-policy comparison. The scenario runner fills the current arm with Overrides::default() and applies the supplied text only to the candidate arm. This head already changes those defaults, so supplying the proposed text on this head can silently compare new policy against itself. The parent head, by itself, also lacks the three new note IDs. Use a shared assembly with the new override plumbing but the pre-change emitted policy in the current arm, or an explicit baseline input. Record which text each arm actually emitted, and attach the results for both stated gates (the committed-suite floor and the rise in the should-open scenarios). Keep the pending #1999 base separate from that policy comparison.

Static review; exact CI was in progress. I did not run paid model evaluations.

The scenario runner filled its current arm with the assembly's own texts, so an evaluation on a head that already carries the candidate compared the new policy with itself. Every `--text ID` now names `--baseline FILE` beside `--candidate FILE`, and the current arm puts the baseline in place through the same factory overrides the candidate uses.

A pair with a file missing, a text named twice, and a pair whose baseline and candidate hold the same bytes are refused before any run starts. Each run's record and the report name the texts its arm emitted by id, byte length and fingerprint, so a saved run and a pooled report state which two texts were compared.
A pooled report stated the texts of the first record that named any, so a pool of evaluations that were given different texts reported one set for runs that compared several. A pool now refuses an arm whose runs recorded different texts and says that such evaluations are pooled only when they were given the same texts or reported separately. The comment that said a record does not save the ids it was given now says what the report reads instead.

`a_pool_refuses_runs_that_recorded_different_texts` asserts that a pool states the texts its runs recorded and that runs of one arm with different texts are refused.
The evaluation tooling section now names the `--text`/`--baseline`/`--candidate` triple the runner takes, so the documented combination is one the runner accepts.

A report built from saved runs states the texts its runs recorded, so the section no longer says such a report has no text row. Both statements are in the Chinese translation too.
A report built from saved runs states one set of texts for each arm, so the pool bullet now names the refusal the runner gives a pool whose runs of one arm recorded different texts, and says that such evaluations are pooled only when they were given the same texts and are reported separately otherwise. The Chinese translation carries the same sentence.

The Goal page's evaluation section now names the flags the runner takes, `--text` with its `--baseline` and `--candidate`, so the two texts one evaluation judges together are described as the runner accepts them.
@yyhhyyyyyy

Copy link
Copy Markdown
Collaborator Author

Fixed in 94796e4.

Every --text ID now names --baseline FILE beside --candidate FILE, and the current arm puts that baseline in place through the same factory overrides the candidate uses, so an evaluation on this head no longer compares the new text with itself. A pair with a file missing, a text named twice, and a pair whose baseline and candidate hold the same bytes are refused before any run.

Each run's record states the texts its arm emitted by id, byte length and fingerprint, and the report states them from the records. A pool whose runs of one arm recorded different texts is refused with that reason, so no report states one set of texts for runs that compared several. a_pair_without_its_baseline_is_refused asserts the refusals; each_arm_emits_and_records_the_text_its_pair_names asserts that the current arm's requests carry the baseline, the candidate arm's the candidate, and that the records and the report name both; a_pool_refuses_runs_that_recorded_different_texts asserts that a pool states the texts its runs recorded and refuses runs of one arm that recorded different ones.

@yyhhyyyyyy
yyhhyyyyyy requested a review from eric8810 November 22, 2026 17:35

@eric8810 eric8810 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.

Re-reviewed 94796e48. Requiring both inputs closes the accidental new-versus-new comparison. Two remaining details affect whether the report can establish the stated behavioral gates:

  1. [P2] Make the pre-change status notes representable. The old renderer ended after the birth and change sentences. The current renderer always appends How you work here:, even with an empty guidance override, and rewrites the former-default change sentences outside the override. The CLI can use the exact old branch tool description, but it cannot emit the old status notes on the current arm. Either make those full old notes selectable for the baseline, or pin the old assembly and report which prompt differences are being measured. Assert against the rendered model request for a default move, not just the override input bytes.

  2. [P2] Do not pool unidentified runs under a named comparison. one_texts_per_arm skips legacy records with no fingerprints. A pool can therefore include both legacy and recorded runs, count both in the rates, and label them with the first recorded text pair. Reject mixed provenance (or keep it in explicitly separate, unlabeled results); all-legacy pools can remain supported as unrecorded. Label these hashes as configured inputs rather than asserting every note was emitted.

The real-model report for the two PR gates is still absent. Source review only; exact CI was in progress.

An empty default_note, user_default_note or former_default_note now writes the status note without the How you work here: heading, so a baseline that replaces the block with no text emits the note the pre-policy head wrote. The shipped blocks are non-empty and keep the heading.

The flow test asserts the note and the rendered model request byte for byte against the pre-policy output, and a second test keeps the shipped heading.
Four files under xtask/scenario-eval/branch-policy-baseline give the branch policy family its pre-change texts: the tool description from 4560a5d with its last protocol sentence aligned to the new one, and empty blocks for the three status notes that had no How you work here: guidance.

The description file is 2058 bytes with fingerprint 4818522f696ae9f0; the three empty files are 0 bytes with fingerprint cbf29ce484222325.
A pool or rejudge now refuses an arm that mixes runs which name their configured texts with runs written before the runner recorded them, before any judge call. An all-unrecorded pool stays supported, and the report states not recorded for that arm.

The report labels the per-arm hashes as configured texts rather than emitted texts, and reading a text file names the flag that was read, so a missing baseline is reported as a baseline.
A re-judge reads its saved runs through the same rule as a pool: each arm states one configured set of texts, so an arm that mixes runs naming their texts with runs written before the runner recorded them is refused. The test asserts the refusal for both arms and that it happens before any judge call.
@yyhhyyyyyy

Copy link
Copy Markdown
Collaborator Author

The status notes are now representable as the pre-change text, and a pool no longer mixes text provenance.

BranchLine::status_note writes no How you work here: heading when the block a factory member supplies is empty. The evaluation's baseline files give default_note, user_default_note and former_default_note empty blocks, so the current arm can emit the note the base head wrote. an_empty_note_block_writes_the_note_without_guidance asserts the note and the rendered model request for a default move byte for byte against that head's output; the_product_note_block_keeps_its_guidance_heading asserts that the shipped, non-empty block keeps the heading. The description baseline is the base head's text with its last sentence aligned to the new protocol sentence, so the arms differ only in the policy sentences. The four files, their sources, byte lengths and fingerprints are in the pull request description.

One measured difference is stated rather than hidden: the former-default note's protocol sentences changed in this change to state the full text the design gives that note, so the empty former block isolates that member's policy block but does not recreate the base head's former note. All four branch policy texts have a baseline, but the committed scenarios emit only the tool description and default_note: the three switches move the default branch from the root to a tool line, and no committed scenario moves it away from a tool line or opens a user line, so user_default_note and former_default_note are configured but never emitted. The report labels the per-arm hashes as configured inputs, not as texts every run emitted.

--pool and --rejudge now refuse an arm whose runs mix records that name their configured texts with records written before the runner recorded them; --rejudge checks before any judge call. An all-unrecorded pool stays supported and its report states not recorded for that arm. a_pool_refuses_mixed_text_provenance covers both arms of a pool, a_pool_refuses_runs_that_recorded_different_texts keeps the different-texts refusal, and a_rejudge_refuses_mixed_text_provenance covers the re-judge refusal before any judge call.

The real-model report is not in yet. The two gates will run after this revision is reviewed and the base branch is merged; the results will be added to the pull request when they are available.

@yyhhyyyyyy
yyhhyyyyyy requested a review from eric8810 November 22, 2026 18:29

@eric8810 eric8810 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.

Re-reviewed 278305fe. The empty override now omits the heading, the covered default-move baseline is checked at the model request, and pooling/rejudging refuse mixed provenance. Those resolve the previous tooling issues. I agree with keeping the shared protocol wording fixed when the experiment is about policy, provided the report states the difference.

[P2] Exercise the two changed note policies before using the report to clear the whole family. As the PR now documents, none of the committed scenarios emits user_default_note or former_default_note. Even a passing run of that suite would therefore say nothing about those two changed policies, while design §12.4 calls for judging the notes and coordination text together. Add a small scenario that moves the default from a tool line to a user-opened line (or two focused scenarios), assert both note forms actually reach the model, and judge the behavior they govern. Alternatively split those two policy changes out and limit this report's claim to the description and tool-line default note. The stated real-model gates are still pending.

Source review; exact CI was in progress.

@eric8810 eric8810 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.

Reviewed at head ebef1f4.

The shape is right: the texts come from the design (§12.1 and §12.4) and the code writes them from its own state rather than from a candidate, with the note's How you work here: block assembled from three factory members on BranchToolConfig — default_note, user_default_note, former_default_note — one per situation a line can be in. Keeping the wording in the capability that owns the branch tool is the correct placement: the description and the notes are that tool's contract with the model, and nothing else should spell them.

I did not get far enough to judge the substance of the texts: verify (linux) and ci-ok failed on this head, in this PR's own crate:

branch_flow::a_switched_line_keeps_its_identity_after_a_compaction
crates/dim-agent-capabilities/tests/branch_flow.rs:43 — branch flow completed: Elapsed(())
641 passed; 1 failed

That is a flow that ran out of time rather than a compile failure, in the crate whose timeline_tree.rs this PR changes, and the test name is about the identity a switched line keeps after compaction — the very subject the restated birth identity in these notes touches. So I would treat it as this PR's failure until it is shown to fail on main: a note or identity path that now waits for something that never arrives is exactly how a flow of this shape would time out. Not approving while a required check is red.

Non-blocking: none — I have not read enough of the diff to make a non-blocking point worth acting on, and inventing one would waste the author's time.

Verification: not run. I read the PR body, the file list, the stat of the change against main, and the failing test's panic line; I did not read the timeline_tree.rs delta, the new branch_flow.rs cases, the doc changes, or the baseline text fixture, and ran nothing.

@yyhhyyyyyy
yyhhyyyyyy requested a review from eric8810 November 23, 2026 08:51

@eric8810 eric8810 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.

The note wait and the exported request check address the original race for submitted follow-ups. One stop path can still admit a run that skips the scored follow-up entirely.

[P2] Exclude a run that reaches the turn limit after the move ACK but before its follow-up is sent. With the note still outstanding, fire_switch returns NotFired. If a line has just delivered the last turn/end, the turn-budget check stops the run. The final pending-switch check does not flag a moved switch, so this path keeps stop=turns and no error. No follow-up is sent or added to switch_notes.expected, and the pre-judge check cannot detect it. That partial scenario can enter the score with an ordinary judge result. Keep the turn limit, but mark an acknowledged switch with unsent scored follow-ups incomplete and exclude it. Extend the held-note fixture to deliver the last turn/end before the note, and assert the run is not eligible for scoring.

Source-order review; no real-model runs.

A run can reach its turn budget after a move answered while the note that releases its scored follow-up is still outstanding; such a run currently ends `turns` with no error and is judged like a complete scenario. `a_run_that_reaches_the_turn_budget_before_the_note_is_not_scored` adds a scripted peer whose last turn ends after the move's answer and before the note, and asserts the run is failed instead of scored.
A run that reached its turn budget after a move was acknowledged, while the note that releases the move's scored follow-up was still outstanding, ended `turns` with no error and was judged and counted in its arm's probe rates like a complete scenario. The final pending-switch check now marks any switch still at the front incomplete, except a wall-clock stop that already names the switch it stopped waiting on: a moved switch with unsent follow-ups is recorded as `switch_incomplete` and failed, so it enters no probe rate. `a_run_that_reaches_the_turn_budget_before_the_note_is_not_scored` pins the turn-budget path with a scripted peer.
A switch that never moved is reported as `switch_target_not_reached` again when the run stopped on its wall clock, so a scenario that could not switch is not read as a run that reached its budget; only a move that happened and left its scored follow-ups unsent is incomplete.
@yyhhyyyyyy

Copy link
Copy Markdown
Collaborator Author

The final pending-switch check now treats any switch still at the front of the run at its end as incomplete, not only one that never moved. A move that was acknowledged but whose scored follow-ups had not been sent when the run ended is recorded as switch_incomplete and is a failed run, so it enters no probe rate; a move that was acknowledged and stopped on its wall clock with an error that already names the switch it stopped waiting on keeps seconds, while a switch that never moved is recorded as switch_target_not_reached, as on main. The turn limit is unchanged.

The held-note fixture now also plays at the turn limit: the new scripted peer SwitchNoteAfterTheLastTurn writes the target line's turn start and turn end while it answers the first session.submit; the client keeps that turn end while it waits for the move's branch_set_default answer and reads it after the answer, and the peer writes the note after that answer, so the run stops on its turn budget before the note is read. a_run_that_reaches_the_turn_budget_before_the_note_is_not_scored asserts that the move happened, that no scored follow-up was sent, and that the run is a failed run rather than a scored one. On the tree with only the test added, before the fix, it failed with left: "turns", right: "switch_incomplete".

Fixed in 7c0c245 (test), f05221e (fix) and d8783cb (fix).

@yyhhyyyyyy
yyhhyyyyyy requested a review from eric8810 November 23, 2026 10:49

@eric8810 eric8810 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.

Re-reviewed d8783cba. The turn-limit finding is fixed: an acknowledged move with unsent scored follow-ups ends as switch_incomplete, and that status round-trips through the child report and saved results and is excluded from scoring. I verified a_run_that_reaches_the_turn_budget_before_the_note_is_not_scored passed in the Linux job for this head.

I’m holding off on approval because ci-ok is red: the CLI history-resume test tasks::tui_task_history_resume_windows_complete_main_pages_and_preserves_the_draft missed the “Earlier content not loaded” notice after resuming. That failure is outside this patch’s scenario runner and is tracked by the ordering fix in #2120; this run does not establish whether that fix clears the integration failure. The real-model policy floor and improvement were not measured in this review.

@yyhhyyyyyy

Copy link
Copy Markdown
Collaborator Author

Rechecked the d8783cba3 run. ci-ok is red because the verify (linux) job failed in tasks::tui_task_history_resume_windows_complete_main_pages_and_preserves_the_draft: the transcript had already painted Earlier content not loaded; /earlier to read it above the page rows, so the wait that comes after the paged-message-150, resumed paged and 75 messages waits could no longer match it and the harness reported Terminal did not show "Earlier content not loaded" (https://github.com/arcships/dim/actions/runs/45159483413/job/137640981752).

That is the same test and the same failure as #2113, where the notice is likewise painted one frame before the page rows.

This PR does not touch that path: git diff origin/main...HEAD changes nothing under crates/dimcode/, which holds the test and its harness, or crates/dim-cli/, which holds the windowed history read.

The fix is open in #2120 (Fixes #2113), which sends the notice after the published page and changes only crates/dim-cli/src/session_host/tasks.rs.

The real-model evaluation is running on d8783cba3; when it finishes I will post the policy floor and improvement results on this PR.

…licy-2

# Conflicts:
#	crates/dim-app-server/tests/transport_flow/timeline_export.rs
@yyhhyyyyyy

Copy link
Copy Markdown
Collaborator Author

The branch now merges main, and that merge includes #2120 (4ff6b0aa4), so this head no longer differs from main in the history-resume code the failing test covers.

The evaluation ran 896 times on d8783cba3: 56 per arm and scenario for the three should-open scenarios, 20 per arm and scenario for the thirteen floor scenarios, and 20 per arm for identity-after-compaction. The verdict is fail.

identity-after-compaction/identity-after-compaction falls from 15/20 to 5/20 (loss 0.500, p = 0.0011, Holm threshold 0.0021). The candidate arm opened a line in 5 of 20 runs and the current arm in 15 of 20; the five candidate runs that opened a line passed the probe 5/5 and the fifteen that did not were 0/15, so the loss is the line-opening rate. The candidate text opens a line only when the four conditions hold, and the user did not ask for one here; this task's two small independent modules do not need one.

Six of the thirteen floor scenarios have fewer than 20 judged runs in each arm, the fewest user-line-becomes-default's candidate arm with 4, after judge views over the judge's token budget, judge calls that failed and switch stops were excluded. Even without the regression the verdict would be inconclusive.

The second gate, a significant rise in the line-opening rate on the should-open scenarios, is not shown: the current arm is at 45/45 for both long-work-and-a-flaky-test probes, 55/55 for both refactor-and-a-pasted-report probes, and 34/34 for the three switch-then-open-lines must_show probes, including new-default-opens-a-line at 34/34, so the opening probe has no headroom; the other two scenarios report task outcomes, not an opening count.

The evaluated model and the fixed judge were DeepSeek V4.1 Flash, so the judge is the evaluated model itself and comes from its own family; the design reports that as a limitation of the measurement.

@eric8810 eric8810 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.

[P2] Keep the prompt policy out of the shipped defaults until its behavioral gates pass. The reported evaluation is a fail under the predeclared comparison rule: the compaction-identity probe drops from 15/20 to 5/20 after correction. The result tracks how often the model opened a line, so it does not by itself show worse identity retention given a line. But the data also don't establish that the less-frequent openings are harmless: six floor scenarios don't have enough judged runs, and the intended increase in should-open cases was not demonstrated. Green protocol CI would not settle those questions.

I'd split the deterministic note-delivery and scenario-runner work from the policy text, or keep the current policy defaults in this PR. Before a new candidate, predeclare an identity case that gives both arms the same opportunity to show continuity, separately measure line opening where the task genuinely benefits from it, and fill the judging floor. That would resolve the measurement ambiguity without retroactively waiving the failed comparison. This review relies on the author's reported runs; I didn't rerun the live evaluation.

@yyhhyyyyyy
yyhhyyyyyy requested a review from eric8810 November 24, 2026 02:04
Restore the branch tool description to its pre-policy text, keeping the corrected cascade sentence as its last line, and delete the three built-in status-note blocks so a note writes a guidance block only when the factory configures one.
The design returns section 12.1's tool description and status-note rows and section 12.4's policy pointers to that same state, and the tests this change added assert the empty default and a configured block instead of the built-in bullets.
The candidate texts, their baseline fixtures and the evaluation that judges them belong to a later change.
The shipped texts are the current arm again, so the four files that held a candidate's baseline are gone; a later change that puts a candidate in place brings its own.
The product sets none of the branch tool's note members, so the note a move writes ends after the sentences the move changes; the design's first-version blocks are supplied at the three members.
The default the product hands the branch tool names no note member, which is what makes a shipped status note stop after the sentences the move changes.
@yyhhyyyyyy yyhhyyyyyy changed the title feat(branch): the opening and coordination policy feat(branch): carry the status notes through factory members and correct the branch texts Nov 24, 2026
@yyhhyyyyyy

Copy link
Copy Markdown
Collaborator Author

The split is made as the review suggests: the deterministic work stays in this pull request, and the policy texts and their evaluation move to a later change.

Kept here: the corrected branch protocol texts (the guide entries with the line placeholders, the former default note's split by source and the move it names, the description's sentence on what an end does), the three status note members on BranchToolConfig, which ship empty so a note carries no How you work here: block, the scenario runner's work (baseline files beside each candidate, ordered moves, the user line as a move target, the input for the line a move moved away from, the wait for each note, the exported request check, and switch_incomplete), and the user-line-becomes-default scenario.

Moved out: the three note blocks, the description's policy sentences, the design's policy sentences in sections 12.1 and 12.4, and the four baseline files. The evaluation's current arm is the shipped text again, so a later change that puts a candidate in place brings its own baselines.

Commits: 1148425925d3f5c0d2159d3bb180e266e8a1dfc4 restores the shipped texts and adjusts the tests this change added, 858dae9661e4925fb8874671030bd058270dfd74 removes the baseline fixtures, cca66591e54c8d709ccb7c2357b159246a801867 states in the design that a shipped status note carries no guidance block, and 0a0bc83bbc45c54a30fe9d6a2079753efbd4ca2c pins the product's empty note configuration in the test.

The pre-registration comes next, in its own change: an identity case that gives both arms the same opportunity to show continuity without depending on whether a line was opened (reported as issue #2125), a measurement of how often a line is opened on the tasks that genuinely benefit from one, and a judging floor of at least 20 runs per arm for every floor scenario. The policy texts then go through both gates in their own change.

@zerob13 zerob13 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.

The split addresses the main evaluation concern: the candidate opening policy is out, the three guidance members ship unset, and the note-delivery machinery can be reviewed independently of the failed comparison.

[P2] Keep unevaluated recovery guidance out of the default former-line note. The tool-opened former-default note still tells the model to message its opener with a summary and keep working if end is refused. This is new relative to main and ships even when the configurable guidance block is empty. The runtime already returns branch_cannot_end and leaves the line open; sending a report and continuing are model choices under the sentence-level policy rule. Please keep the factual end guard here and defer the recovery instruction with the candidate policy. The failed comparison is not itself a blocker for the deterministic split.

Static review. Hosted CI for this revision was not yet complete.

The note a move writes on a tool line it moves away from told the model to message its opener and keep working when end is refused. Whether a line reports and keeps working is a model choice, so the note states only the tree's own end guard, and design section 12.4 records the removed sentence as a policy sentence of the former default note member, which ships unset.

The former default branch test now asserts that the shipped note ends with the guard, and the design rows and protocol list follow the shipped text.

@eric8810 eric8810 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.

Reviewed at head 0a0bc83.

This resolves the gate I left at 85fb6289 by taking the first of the two options I offered: the deterministic work is split from the policy text, and the policy text ships unset. BranchToolConfig is #[derive(Default)] with Option<Arc<str>> members and its doc comment says the product sets none of it — an unset member writes no How you work here: block, so the shipped prompts are what they were, with the candidate's guidance available to the evaluation through the factory. That is the separation the failed comparison needed: the deterministic corrections land now, and the policy text waits for gates it has not passed.

The corrections themselves are the ones the design states and the code was getting wrong. The protocol texts name their lines by placeholder — {parent} and {other} substituted once, in the block assembler, where the text is written — so the identity, roster and message entries no longer hard-code main and stay true after a default move. BRANCH_TOOL_DESCRIPTION's closing sentence now says an end ends the calling line and every line below it, which is the tree's own rule, and the design's protocol list follows it. The user-line birth identity states that such a line cannot end itself unless the user makes it the default. Wording that reaches the model through a factory member is documented as such at the member, rather than as a rule the renderer must remember.

Blocking: none.

Checks are green at this head. I read BranchToolConfig, the note assembler and its substitution, the three protocol constants and the file list; I did not read the 498 lines of branch_flow.rs, the prompt_guide.rs and minimal_execution.rs deltas, or the documentation changes, and ran nothing.

Non-blocking: none.

@yyhhyyyyyy

Copy link
Copy Markdown
Collaborator Author

The note on a tool line the default branch moved away from now keeps only the tree's end guard: only a line opened with create can end itself, and not while it or a line below it is the default branch. The sentence that told the model to message its opener with a summary and keep working when end is refused is gone. Fixed in 867a6f5.

The same review of the model-facing texts this change adds found the boundary in one more place: the design's protocol list in section 12.4 named the recovery instruction as a protocol sentence. It is out of the protocol list, and section 12.4's policy list now records it as a sentence of BranchToolConfig::former_default_note, which ships unset, so a shipped note carries no guidance block.

What stays in that note is the rest of it: the move took the role from this line and names the line it moved to, the line stays open and keeps coordinating the lines it opened, it can no longer open lines with create, and the rest of its birth identity's rules hold again.

a_former_default_tool_lines_note_reaches_the_model_request asserts that the shipped note ends with the end guard and the closing tag; it failed on 0a0bc83 before this change.

@yyhhyyyyyy
yyhhyyyyyy requested a review from zerob13 November 24, 2026 05:26

@eric8810 eric8810 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.

Reviewed at head 867a6f5.

Approving, citing my review at 0a0bc83b. The one commit since then moves a single sentence from the shipped protocol text into former_default_note, and that is the right classification rather than a wording edit: "If end is refused when your purpose is done, message P with what you found, did, changed and left undone and keep working" is advice about how to behave after a refusal, not a fact the tree's own state determines. The product sets none of the three members, so the shipped note no longer carries it, and the design's policy list goes from six sentences to seven with this one named among them.

That keeps the split I approved intact and consistent: what the tree can answer — whether create would succeed, whether a line may end, which line the role moved from — stays protocol; what a candidate is proposing about conduct stays behind the factory member. The design text and the Chinese page move with it.

Blocking: none. Checks are green at this head.

Verification: not run. I read the timeline_tree.rs hunk and both design deltas; I did not read the 4 added test lines and ran nothing.

Non-blocking: none.

@zerob13 zerob13 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.

The former-default tool-line note now ends with the factual end guard, and the report-and-continue instruction is deferred along with the other policy text. Product defaults remain unset. This resolves my previous finding; the failed candidate comparison is not evidence against this deterministic delivery change.

Linux CI on the earlier base passed the note suffix, empty defaults, compaction, and scenario-delivery regressions. I checked integration with current main (c819cfde) by source comparison: the merge is clean, #2130 touches no shared paths, and this PR’s patch is unchanged. The combined tree has not been run in CI. Technical approval for this head.

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.

3 participants