Plan: plan-review cases above the ceiling, and round two as it runs, to decide Neon against Carbon

Closes: #911. Relates to: #886, #887, #858, #878. Branch: test/battery-plan-round-two. Status: Done (2026-11-26) — measured; by the rule every Neon level passes, Carbon missed nothing (still at the ceiling), and the controls held real defects Carbon found; the swap is the operator’s decision

Context

The operator asked (2026-11-22) whether vertex-gemini/gemini-4-neon can replace Carbon as planSecondReviewer with results at least as good. Approach and decision rule agreed in conversation (2026-11-26). What the tree says today, by reading:

  • The planning task (tools/model-battery/tasks/planning.json, five cases under cases/planning, 12 scored defects) cannot separate them: both caught 36 of 36 over three runs with no false flag (store/planning/none).

  • Carbon reviews a plan at medium (REVIEW_THINKING_LEVEL in packages/pi-workflow/reflection-review.ts), not at high as #911 says; the level moved with #858.

  • Neon has a floor (REVIEW_THINKING_FLOOR, plan: medium) and no level of its own, so wantedThinking would send it the session’s level: xhigh for a plan written at xhigh. A swap would therefore come with a plan level for Neon, which this run chooses among medium, high and xhigh. Low is below the floor and is not measured.

  • Production’s round two reads the edited draft with round one’s review beside it (#886): plan-pause.ts passes earlier: { reviewer, text }, buildPlanReviewPrompt renders it (renderEarlier) and planReviewSystemPrompt(budget, true) adds its framing. The battery’s review driver (tools/model-battery/drivers/review.mjs) sends neither.

  • Adding cases to cases/planning would leave every packaged model owing them and its rows no longer comparable. #878 solved the same problem with experiment tasks (tasks/reviewer-large.json, "experiment": "reviewer").

Design

Two experiment tasks

Task file Cases round typicalTokens

tools/model-battery/tasks/planning-hard.json

cases/planning-hard: six cold cases

absent

30000

tools/model-battery/tasks/planning-round-two.json

cases/planning-round-two: six cases, each an edited draft with round one’s review

2

33000

Both: "path": "single-call", "driver": "review", "scorer": "anchors", "experiment": "planning", and a // saying what the task is. battery.json gains one permutation entry per task: "runs": 5, "subjects": ["vertex-gemini/gemini-4-carbon", "vertex-gemini/gemini-4-neon", "vertex-gemini/gemini-4-neon:high", "vertex-gemini/gemini-4-neon:xhigh"]. The two bare subjects are sent medium by production’s own rules (levelFor). experimentNote in battery.json gains one sentence naming the two arms. RESCORABLE in tools/model-battery/cli.mjs gains both names. The planning task, its cases and its records are not changed.

The driver sends round two as production does

  • Key. A round-two case’s key.json carries "earlier": { "reviewer": "vertex-anthropic/claude-fable-5-2", "file": "earlier-review.txt" }; the file sits in the case directory, beside plan.adoc.

  • subjectFor (plan branch): when the key has earlier, it reads the file, adds earlier: { reviewer, text } to the input of buildPlanReviewPrompt, and takes the system prompt from planReviewSystemPrompt(budget, true). Without it, nothing changes.

  • cases(casesDir, spec): loadTask (tools/model-battery/lib/task.mjs) passes the task’s spec. With spec.round === 2 every case must be a plan whose earlier names a reviewer and a file that exists and is not empty; without it, a case carrying earlier is refused. The error names the case and is thrown when the cases are listed, before any lane is planned or priced.

  • promptText(spec): with spec.round === 2 it appends planReviewSystemPrompt(budget, true) and renderEarlier.toString(), each after a \n---\n, at the end of the list.

  • checkSpec: round is the number 2, on a review task, or absent.

The case tree

All 12 cases carry one tree under context/: the 15 files of cases/planning/plan-rs-control/context, with four additions. Plan-case trees are read by the reviewer, not built, as today.

  1. core/src/spool.rs: a #[cfg(test)] mod tests with drain_takes_oldest_first (three items enqueued, drain(10), asserts ids 1, 2, 3) and drain_removes_item_files (after drain(10) no <id>.item remains).

  2. New core/tests/spool_len.rs: one test, len_follows_enqueue_and_drain (two enqueued, len() is 2, drain(10), len() is 0).

  3. daemon/src/settings.rs: a #[cfg(test)] mod tests with defaults_when_file_missing (load_settings(Path::new("/nonexistent")) gives poll_secs 5 and max_batch 100).

  4. DESIGN.md, decision 4: "Signals only set a flag. A signal handler sets an atomic flag and returns; the main loop acts on it at the top of its next pass."

The cold cases (cases/planning-hard)

Each bullet under a case is id · rubric · tier · what is planted; a cross-file defect’s evidence file is named and is its evidence. "Supplied" is the key’s context.

hard-requeue: requeue an item the uploader rejects (#318). Supplied: daemon/src/main.rs, DESIGN.md, docs/spool.adoc, CHANGELOG.adoc.

  • private-index-seam · P2 · cross-file · the daemon calls Spool::index() and Spool::write_index(); both are private in core/src/spool.rs.

  • drain-keeps-files-claim · P2 · cross-file · "`drain` leaves each item’s file until the next pass, so a rejected item’s bytes are still on disk"; drain removes each file as it reads it (core/src/spool.rs).

  • Decoy index-rewritten-whole: the plan rewrites the whole index on each requeue; DESIGN.md decision 1 makes that the rule.

hard-crash-safe: a crash mid-pass loses no item (#322); drain becomes peek and ack. Supplied: core/src/spool.rs, daemon/src/main.rs, docs/spool.adoc, CHANGELOG.adoc.

  • never-without-test · P2 · surface · "an item file is never removed before the uploader has acknowledged it" names no test, while the plan’s other never ("`ack` never removes an id that was not peeked") names a property test.

  • race-unit-tested · P1 · surface · the lock that stops two daemons draining one spool is tested by "unit: the second open returns an error": a race with no concurrency test.

  • part-guard-absent · P2 · cross-file · "`watch::poll` already skips files still being written (names ending .part)"; daemon/src/watch.rs skips only what is not a file.

hard-byte-budget: drain by a byte budget (#327); drain(max: usize) becomes drain(budget: Budget). Supplied: core/src/spool.rs, daemon/src/main.rs, docs/spool.adoc, CHANGELOG.adoc.

  • integration-test-caller-missed · P2 · cross-file · Scope lists core/src/spool.rs and daemon/src/main.rs as "the only callers of drain`"; `core/tests/spool_len.rs calls drain(10) and is not in Scope.

  • stop-vs-skip · P2 · surface · Design: a batch stops at the first item over the byte budget, which stays pending. The Steps row: such an item is skipped and the batch goes on.

  • rides-along-331 · P1 · surface · a "while here" step renames the max_batch key to batch.items for #331: another issue’s work.

hard-reload: reload settings on SIGHUP (#335). Supplied: daemon/src/main.rs, daemon/src/settings.rs, docs/spool.adoc, DESIGN.md, CHANGELOG.adoc.

  • load-never-fails-claim · P2 · cross-file · "`core::config::load` never fails: a file it cannot read or parse is skipped"; core/src/config.rs skips only a missing file and returns an error naming one it cannot read or parse.

  • default-ten · P2 · cross-file · "`poll_secs` keeps its default of 10 seconds"; docs/spool.adoc and daemon/src/settings.rs say 5.

  • left-to-implementer · P2 · surface · what is logged on a rejected reload, and whether the daemon keeps the old settings or exits, "is left to the implementer".

  • Decoy flag-not-handler: the handler only sets a flag and the loop reloads at the top of its next pass, up to poll_secs late; DESIGN.md decision 4 makes that the rule.

hard-size-cap: refuse inbox files over a size cap (#341). Supplied: daemon/src/watch.rs, docs/spool.adoc, CHANGELOG.adoc.

  • keys-read-in-settings · P2 · cross-file · “max_item_bytes` is read in core/src/config.rs, next to poll_secs and max_batch”; those keys are read in `daemon/src/settings.rs, and config.rs reads no key.

  • enqueue-returns-id · P2 · cross-file · "the stored item’s path, as Spool::enqueue returns it, is logged"; enqueue returns the id, io::Result<u64> (core/src/spool.rs).

  • old-index-reader · P3 · surface · the index gains a size column and "a reader for the old one-column format stays for one release".

hard-control: spool inbox files oldest first (#346). Supplied: daemon/src/watch.rs, core/src/spool.rs, docs/spool.adoc, CHANGELOG.adoc. No defect and no decoy: every seam is described as the tree has it.

The round-two cases (cases/planning-round-two)

Each case states what round one’s review (earlier-review.txt) failed, what the author’s edit did, and what the edited plan.adoc therefore holds. A decoy whose justification is plan.adoc is a round-one FAIL the edit fixed: raising it again is a false flag.

r2-unfixed: a dead-letter directory for rejected items (#352). Supplied: daemon/src/main.rs, docs/spool.adoc, CHANGELOG.adoc. Round one: P2 FAIL, the plan calls Spool::remove(id), which core/src/spool.rs lacks, and step 3’s test names no category. The edit: names the category; renames the call to "the existing Spool::discard(id)`"; changes the Design to write rejected items to `<spool>/dead/.

  • discard-does-not-exist · P2 · cross-file · Spool has open, enqueue, drain and len, and no discard (core/src/spool.rs).

  • dead-vs-rejected-dir · P2 · surface · the Design says <spool>/dead/; the Steps row still says <spool>/rejected/.

  • Decoy test-category-fixed (plan.adoc): step 3’s test now names its category.

r2-cited-test: cap each pass at max_batch uploads, retries counted (#357). Supplied: daemon/src/main.rs, docs/spool.adoc, CHANGELOG.adoc. Round one: P2 FAIL, "a pass never uploads more than max_batch items" names no test. The edit: "pinned by the existing test `drain_takes_oldest_first`"; and a new risk written as a sentence under the Risks table.

  • cited-test-does-not-pin · P2 · cross-file · that test drains with a max of 10 over three items and asserts their order: it never reaches the cap (core/src/spool.rs).

  • settings-read-once · P2 · cross-file · "a changed max_batch applies to the next pass, as today"; daemon/src/main.rs reads the settings once, before the loop. In both drafts; round one missed it.

  • prose-risk-no-mode · P1 · surface · "if the uploader is slow the spool grows without bound", under the table, with no mode and no mitigation.

r2-round-one-wrong: a user configuration layer (#361). Supplied: daemon/src/settings.rs, daemon/src/main.rs, docs/spool.adoc, CHANGELOG.adoc. Round one: P2 FAIL, "`core::config::load` takes one path; the plan passes two" (wrong: it takes &[&Path]); P3 FAIL, load_settings(system) kept as a wrapper. The edit: removes the wrapper, main.rs moving in the same step; leaves the load call; finds the user file with dirs::config_dir(), "which the daemon already depends on".

  • user-listed-first-loses · P2 · cross-file · the plan calls load(&[user, system]) "so the user file wins"; later layers win (core/src/merge.rs), so the system file wins. In both drafts; round one missed it.

  • dirs-not-a-dependency · P2 · cross-file · daemon/Cargo.toml depends on spool-core alone, and no step adds dirs.

  • Decoy load-takes-a-slice (core/src/config.rs): round one’s FAIL was wrong; repeating it is a false flag.

  • Decoy wrapper-removed (plan.adoc): the wrapper is gone.

r2-half-fixed: the oldest pending item’s age in spoold status (#366). Supplied: daemon/src/main.rs, docs/spool.adoc, CHANGELOG.adoc. Round one: P1 FAIL, the plan also changes the uploader’s retry count for #368; P2 FAIL, Spool::oldest() does not exist. The edit: drops the #368 paragraph from the Design and leaves its Steps row; adds a step that adds pub fn oldest.

  • still-carries-368 · P1 · surface · Steps row 5 still retries a failed upload three times, "(#368)".

  • open-creates-dir · P2 · cross-file · “Spool::open` fails when the directory is missing, so status prints no spool”; `open creates it (core/src/spool.rs). In both drafts; round one missed it.

  • Decoy oldest-now-added (plan.adoc): the plan now adds Spool::oldest.

r2-new-always: skip inbox files still being written (#371). Supplied: daemon/src/main.rs, docs/spool.adoc, CHANGELOG.adoc. Round one: P2 FAIL, "`poll` handles .part files today"; daemon/src/watch.rs has no such check. The edit: step 1 adds the check; the Design gains "a file is always spooled within one pass of its rename".

  • always-untested · P2 · surface · that always names no test; step 1’s test covers "a .part file is left in the inbox" alone.

  • poll-returns-count · P2 · cross-file · "`poll` returns the names of the files it moved, which main logs"; it returns a count, io::Result<usize> (daemon/src/watch.rs). In both drafts; round one missed it.

  • Decoy part-check-now-added (plan.adoc): the plan now adds the check.

r2-control: log each pass’s counts (#376). Supplied: daemon/src/main.rs, daemon/src/watch.rs, docs/spool.adoc, CHANGELOG.adoc. Round one: P2 FAIL, the plan names daemon/src/poll.rs where the file is daemon/src/watch.rs; P1 FAIL, step 2’s test names no category. The edit fixes both. No defect and no decoy.

Task Scored defects Cross-file Decoys Controls

planning-hard

14

8

2

1

planning-round-two

11

7

5

1

Authoring rules

  • Each plan.adoc follows the form of cases/planning/plan-rs-helper-claim/plan.adoc (header line, TL;DR, Design, a Steps table with a Test column, a Risks table with a Direction column, a last step naming docs/spool.adoc, CHANGELOG.adoc and the close), in 45 to 90 lines, and passes planShapeProblems (packages/pi-workflow/plan-shape.ts): no case plants what the shape check owns.

  • A planted claim is written once, as the author’s plain statement. A case plants what its bullets list and nothing else the tree contradicts; a control’s plan is checked against every file of the tree, its tests included, so that nothing it changes breaks a caller or a test it does not name.

  • Each key.json follows plan-rs-helper-claim/key.json: kind, context, and per defect id, rubric, blocking: true, tier, source (the class of mistake, one phrase), what, evidence for a cross-file one, and anchors; per decoy id, what, justification, anchors. A defect’s or decoy’s what contains at least one of its own anchor terms.

  • Each earlier-review.txt reviews the draft before the edit, in production’s answer form: a VERDICT: line, P1 to P4 each with PASS or FAIL and a sentence, then the "Beyond the declared context the reviewer read …" line production appends.

The run, and the rule that reads it

The run is the operator’s. node tools/task.mjs battery fill --task planning-hard --task planning-round-two --dry-run gives the projection: 12 cases x 5 runs x 4 subjects = 240 calls, about $38 by the stored per-call costs of the same subjects on planning. With his go, the same command without --dry-run, then one --retry-errors --jobs 1 pass for rate limits and timeouts.

The decision rule, fixed here. Per subject and per task, over its five runs: R is pooled recall (caught over planted); S is the highest per-run recall minus the lowest; X is pooled cross-file recall; F is the sum of false flags (FAIL blocks on the control, and flagged decoys); E is the number of calls that ended with no review. Neon at a level is at least as good as Carbon when, on both tasks:

# Condition

a

R(Neon) is not below R(Carbon) by more than the larger of the two S

b

X(Neon) is not below X(Carbon) by more than that same margin

c

F(Neon) is not above F(Carbon)

d

E(Neon) is not above E(Carbon)

  • Neon can replace Carbon, at the level that passes with the lowest mean cost per call; wall time breaks a tie.

  • Carbon stays when no level passes.

  • Still at the ceiling: when Carbon misses nothing on both tasks, the rule’s answer is reported with that caveat. This plan adds no further cases.

Erratum (2026-11-26): neither control is clean. hard-control’s Risks row says "the next pass tries again", but `main propagates poll’s error with `? and the daemon exits. r2-control’s Step 1 test needs a single-pass function and a writer seam that `main lacks, and the plan leaves that to the implementer. Carbon flagged these in 7 of its 10 control runs, and Neon at xhigh in 1; condition c counts them as false flags. They are reported on #911 with the result, and the cases stay as measured.

Scoring protocol, fixed here. A prediction goes on #911 before the run. After it, every miss and every false flag of all four subjects is read. An anchor changes only to credit a FAIL block that plainly names the defect in other words, or to stop a decoy matching a block that names a real defect; a defect all four subjects miss in every run is re-read against the tree, and one the tree does not support is removed from its key. Every such change is applied to every subject by battery rescore and listed on #911. The swap is the operator’s decision and its own issue.

Scope

  1. MR 1 (Relates to #911), branch test/battery-plan-round-two: the two task files, the driver, checkSpec, loadTask, RESCORABLE, the two manifest entries and the experimentNote sentence, the 12 cases, the tests below, battery render (the eight new rows read not measured), and the CHANGELOG line.

  2. The dry run and the prediction on #911; the operator’s go; the run.

  3. MR 2 (Closes #911), branch test/battery-plan-round-two-records: the records under tools/model-battery/store/planning-hard and store/planning-round-two, battery summarise and battery render, any key change the protocol made, the CHANGELOG line, and the result on #911 by the rule.

Tests

In tools/model-battery/test/, vitest. New file plan-round-two.test.mjs unless a row names another. budget below is snapshotBudget(DEFAULT_WORKFLOW_CONFIG) from packages/pi-workflow/workflow-config.ts, as the driver computes it.

Category Test Pins

contract

subjectFor on r2-unfixed: the system prompt equals planReviewSystemPrompt(budget, true) and the user prompt ends with renderEarlier of the key’s reviewer and the file’s text. On hard-requeue: the system prompt equals planReviewSystemPrompt(budget) and the user prompt holds no EARLIER REVIEW

round two is sent as production sends it; a cold case is sent as before

contract

loadTask("planning-round-two").promptTextForFingerprint() equals promptText(), \n---\n, planReviewSystemPrompt(budget, true), \n---\n, renderEarlier.toString(); for planning-hard, planning and reviewer it equals promptText()

no existing task’s fingerprint moves

contract

checkSpec accepts round: 2 on a review task and refuses 1, 3, "2", true, and 2 on a judge task

the spec’s shape

contract

in review-driver.test.mjs, beside its "list_files sees the context files and nothing of the case directory" test and with that file’s scripted helper: through execute, list_files on r2-unfixed names no earlier-review.txt, key.json or plan.adoc

the reviewer cannot read the earlier review or the key through its tools

contract

in review-driver.test.mjs, with scripted models whose ref and id are Carbon’s and Neon’s: levelFor on a plan case with no knob answers medium for each (Carbon’s with the note "production’s level for this model on a plan, medium")

the two bare subjects' level

contract

the manifest lists both tasks, each with 5 runs and exactly the four subjects

the permutation

regression

cases(dir, { round: 2 }) over temporary case directories refuses a case with no earlier, with no reviewer, with a missing file and with an empty file; cases(dir, {}) refuses a case carrying earlier; each error names the case

a round-two case is never run cold, and a cold case never as round two

regression

cases.test.mjs: its plan-case checks read the two new directories too, a decoy’s justification being plan.adoc or a context file; every new plan gives planShapeProblems an empty list; the 12 context/ trees have one digest and 16 files; each earlier-review.txt opens with a VERDICT: line and reviewBlocks reads P1 to P4 from it with at least one FAIL

the corpus is what this plan says: the shape check owns nothing planted, and all 12 cases carry the one tree

regression

per task, the scored defects, cross-file defects, decoys and controls counted from the keys equal the table above

the totals the rule divides by

regression

for every defect and decoy of the 12 keys, a FAIL block whose text is its what is credited to it by blockNamesDefect; a decoy’s block names no defect of its case

an anchor that cannot match its own description

regression

score.test.mjs: the key-format check’s roots gain the two directories. run.test.mjs: the packaged task list gains the two names. cli.test.mjs: the default rescore output gains their two lines

the lists that name every task

Mutants, each to fail its test: subjectFor ignoring earlier; the loader guard removed; promptText appending for every task.

Risks

Risk Mode Mitigation

An anchor misses a correct finding worded another way, understating one subject

silent

the what self-check test; the protocol reads every miss and rescores every subject

A decoy’s anchor matches a block about a real defect, overstating false flags

silent

the scorer skips a block that names a defect; the protocol reads every false flag

A round-two case run cold, or a cold case as round two

fail-closed

the loader refuses before any call (regression test)

The round-two framing leaks into existing fingerprints

silent

the fingerprint contract test

A planted defect the tree does not support

silent

cross-file evidence must exist (cases.test.mjs); the protocol re-reads a defect nobody catches

Hand-written round-one reviews differ from real ones

silent

production’s answer form is pinned by test; stated as a limit in the result

The set is still at the ceiling

loud

the rule’s third outcome; reported, no further cases here

Calls fail at Neon’s higher levels, as Carbon’s did at high

loud

condition d; one --retry-errors pass for rate limits and timeouts only

battery render moves cells this plan did not touch

loud

rendered in MR 1 first: a diff outside planning’s experiments table and the note is reported on #911 and left out

Cost above the projection

fail-closed

the battery refuses over its $300 budget before any call; the dry run is on #911 before the go

Delivery

  • Canonical page: docs/modules/ROOT/pages/model-battery.adoc, generated by battery render from the store and battery.json; the arms' sentence is experimentNote.

    Erratum (2026-11-26): experimentNote is read by no code, so the sentence there never reaches the page. The page names the two arms through its source, tools/model-battery/page-head.adoc (the Experiments bullet). The experimentNote sentence stays, beside its sibling.

  • CHANGELOG.adoc == Unreleased: a "Repo only" line with each MR.

  • This plan committed as docs/modules/ROOT/pages/plans/battery-plan-round-two.adoc, listed in docs/modules/ROOT/nav.adoc; Status In progress at start, Done at MR 2’s merge.

  • Validate before each push; MRs merged with squash off; #911 is closed by MR 2, with its merge SHA and the result noted on the issue.

Edit this page · latest