Status: done (2026-11-24)
Priority: 2
Size: L
Design ref: none (agent workflow). AGENTS.md, Taking a task and Surfacing; .claude/agents/vb-task.md; docs/review-agent-workflow.md, sections 6 and 8; docs/agents/README.md, docs/agents/worker.md (section 1); tools/inbox.js, tools/brief.js, tools/same.js, tools/agent-usage.js, tools/usage-page.js; backlog/VB-254.md, VB-255.md, VB-485.md (the reviews of 16 November)
Goal: An implementing agent’s code and tests can agree with each other and still rest on one misreading of the task or the design. The hard checks cannot catch that, because the tests were written from the same reading. Before a task’s work is merged (before a single-task session opens its PR, or before an orchestrated run merges a sub-agent’s branch), an eligible task gets one review by a vb-review sub-agent with a fresh context. The reviewer never sees the implementer’s conversation or reasoning. It reads the task as it stood before the work, the design sections that are its authority, the architecture’s rules, the diff and the evidence that tools have already computed. It reports where the change is wrong, in three grades: it finds semantic defects; it does not repeat checks and does not rewrite. The cycle is bounded at one review and one revision. Whether review pays is measured against a held-out control: a third of eligible tasks, chosen by a hash of the ID, get no review. The run files record each task’s arm, the review’s cost and what it found, and escaped defects are traced through a new optional Cause: header.
Acceptance criteria:
.claude/agents/vb-review.md (tools: Bash, Read, Grep, Glob; no Edit or Write). Its one responsibility is to find where the change is wrong against its authorities, not to fix or rewrite it. Its prompt is fixed, Review VB-NNN; base <sha>; head <sha>, and carries nothing from the implementer; it is started as a fresh sub-agent, never as a fork of the session. It reads node tools/review.js packet ID first and writes its draft findings to work/review/VB-NNN.json. Only after that does it read node tools/review.js claims ID (the implementer’s ticks and notes) and check each claim against the code. It does not read the implementer’s commit messages or transcript, does not rerun what the packet reports (npm test, verify, lint, ownership, counters, same), and edits nothing in the repository. It may write probes under work/review/ and run them, and run single named test scripts. It looks for, in this order: first, whether the change keeps the game’s vision and its design principles (design.md, The game, in Kim’s terms, and Principles for decisions, all Decided): a teleport, an act with no pawn, a patch where a parameter belongs, a pattern set rather than modelled, a wait by a chance or a count, a label used as a switch, a quota, the future shown as the simulation’s knowledge, or a change legal by every rule that still makes the game less like itself (added 24 November: the vision must stay consistent and coherent); then criteria unmet, or met only in letter; the change against a Decided or Agreed point of the design sections its refs name; behaviour the task did not ask for (on other households or systems, on saves, on cost); counterexamples the tests miss (boundaries, the dead and the dissolved, the empty, the first and last day of a season, a loaded save); tests that would pass without the change, or that assert the implementation rather than the contract; complexity or coupling the task did not need (a new module, owner, export, read between modules or special case), judged against target-v2 section 2 and AGENTS.md, Conventions. Ceiling: 40 model calls and 10 findings. tests/context-size.js counts its definition as a target of its own, at most 6,000 B.review.js when it reads the findings file. A blocking finding needs both an authority, quoted with its place (a criterion of the task; a principle, or a section of design.md with its status, Decided or Agreed; a rule of AGENTS.md, BACKLOG.md or target-v2 section 2), and a concrete failing scenario (a constructed state or input, and the wrong outcome). The scenario is demonstrated by a probe (tests/tiny.js, tests/lib/probe.js) where one can be built in a few calls. A finding that rests on a Proposed or “Under revision” point, on no authority, or on a scenario not shown is advisory at most. A matter of taste is a preference: at most three, never acted on, counted only. Each finding carries an id, grade, category (one of the seven above: principle, criterion, design, unintended, counterexample, test, coupling), authority, place (file:line), scenario, and the check that would catch it. Why: the review of VB-254’s diff on 16 November led to VB-485, whose first criterion was withdrawn as “built on a misdiagnosis” of a Decided point; the review of VB-255 found a real blocker (a plot open for ever). Requiring a blocking finding to quote its authority and show its scenario guards against the first case without losing the second.node tools/review.js packet ID [--base REF] [--head REF], in one call as brief.js is (the base defaults to git merge-base HEAD origin/main, the head to HEAD; a tools/help.js header). It prints: (a) the vision and the design principles (design.md, section 1, as at the base), whole, in every packet; then the brief of the task as it stood at the base: tools/brief.js on the base’s task file, with goal, criteria, open questions, the design sections of its refs with their status markers, and the rules for its kind, and none of the implementer’s ticks or notes; (b) for a plan task, the diff of design.md and of each task file it creates or changes, in the diff below; (c) the diff from base to head, with its stat, leaving out derived files and the task’s own file, cut at 60 KB (beyond that, the stat, with git diff BASE HEAD -- FILE named for the rest); (d) evidence computed by tools rather than asked of the reviewer:
npm test at the head;src/ in a temporary worktree (as tools/same.js makes one), reported as “fails on base” or “passes on base: does not detect the change” (for a task that is not a refactor);node tools/same.js --base BASE;tests/counters.js);src/manifest.json), @state lines added or changed, src/owners.json entries, verbs registered, job kinds, counters, exports past tests/width-baseline.json, and reads VB['…'] of one module by another that the base did not have (new edges in tools/dependencies.js);
review.js claims ID prints the criteria ticked at the head and the task file’s changes since the base (ticks are claims, so they are not in the packet), and refuses until the draft findings file exists. Tests on a constructed repository with two commits: a test that passes on the base is flagged, and claims refuses before the draft.node tools/review.js eligible ID decides from the task file and the diff alone, and prints the arm (review, control or ineligible) with the rule that decided it. A task is eligible when any of these holds:
@state field, an owner entry, a verb, a job kind, a work counter, or a read between modules;same) in three or more modules of src/;Flag: line.
Otherwise the task is ineligible: an S task in one module with no new structure, a change to tests, tools or documents alone, or a refactor showing same. An eligible task is control when a fixed hash of its ID (FNV-1a of VB-NNN, mod 3) is 0. Nobody chooses it; it is printed with the arm, and it holds until the evaluation task records Kim’s decision. The PR reports the shares the rule makes eligible and control over the tasks done from 17 to 24 November, each reconstructed from the commits that name it, as tools/usage-page.js attributes them (140 of those 313 were M or L, so about half eligible is expected).AGENTS.md, Taking a task, as a step between 4 and 5 of at most 600 bytes, for a session with no orchestrator (the step says so; in an orchestrated run the orchestrator starts the review, below); the rest is in the reviewer’s definition and review.js --help. After the last verify, the session commits and runs review.js eligible. For review, it starts the vb-review sub-agent with the fixed prompt: Sonnet for an S task, Opus for M and L, and the strongest model offered for a plan. If the verdict is revise (one or more blocking findings), the session makes one revision:
node tools/review.js confirm ID --reviewed SHA checks each blocking finding deterministically: the test named fails at SHA and passes at the head, or the rebuttal cites an authority. For each finding left unresolved it opens a priority 1 task with Cause: VB-NNN. The task is merged and stays done: hard checks alone decide a merge, and review does not use needs-review (decided 24 November, when this task was written). A task gets one review, whatever the mode and however many sessions or sub-agents it runs over. The guard is deterministic: review.js eligible prints reviewed (at SHA) when a record of an earlier review exists (a review note in the inbox, work/review/VB-NNN.json, or a review record in a committed run file under docs/agents/usage/), and a test shows each of the three. The PR gets a “Review” section: the arm and its rule, the verdict, and the findings by grade with their outcomes. Unresolved findings go under “For Kim” (AGENTS.md, Surfacing, with no orchestrator).docs/agents/worker.md, section 1, step 3, gains at most five lines. The orchestrator still reads no code and no findings, so review adds about three of its calls per reviewed task:
vb-task reports done, the orchestrator runs review.js eligible ID --head <its branch> in the same call as its next merge or check (the base is git merge-base <its branch> <the run's branch>), and merges an ineligible or control task as today;review, it starts vb-review in the background, in a worktree of the task’s branch, with the fixed prompt. Up to two reviewers run beside the three or four implementers, in slots of their own. A reviewer reserves no IDs and claims no files. It leaves its findings as a review note (verdict=, blocking=, advisory=, preference=, reviewed=SHA; the findings as the body) and writes no result, since results are keyed by task. Its last message is one line: VB-NNN review: pass, or VB-NNN review: revise <n> blocking;pass, the task merges. On revise, the orchestrator resumes the same implementer (SendMessage: its context is intact and likely still cached, which saves a boot of 45 to 60k tokens) with “Revise VB-NNN: the review note in the inbox”. If that implementer is past 90 of its 120 calls, a fresh vb-task goes on instead, by the existing continue path, which counts toward the task’s two continuations;.claude/agents/vb-task.md gains one line: a sub-agent skips the review step of AGENTS.md, Taking a task, since the orchestrator starts every review; on a revision prompt it makes the revision of the criterion above (at most 30 calls), merges the run’s branch, runs review.js confirm, and then reports its result. confirm leaves a task note (cause=VB-NNN, priority 1, one of the task’s reserved IDs) for each finding left unresolved; inbox.js apply creates the task, and inbox.js report lists it under “For Kim”. The merge then goes ahead as for any done, and the night’s PR gives the review’s verdict and outcomes in the task’s line.
tools/inbox.js gains the review note kind; calls --ceiling N, so that a reviewer counts against 40; and the arm and review fields in results --json and in status, where a task in review shows as such, so that an interrupted run knows where it stopped. tools/agent-usage.js --results joins them to the sub-agents, and the night’s summary gains a line: the weighted cost of reviews and revisions, and the orchestrator calls spent on review. The two agent definitions together stay within tests/context-size.js’s target. Tests in tests/inbox.js for the note kind, the ceiling and the join.tools/agent-usage.js tells a reviewer sub-agent from an implementer (its prompt begins Review VB-NNN, or by its agent type) and keeps a role for each. Reviewers are left out of firstPass, tasks and the implementing cost by size: today a reviewer would be joined to the implementer’s result by task and counted as a second attempt. --review work/review/VB-NNN.json keeps a review record in the run file: the arm and its rule, the verdict, the findings by grade and category with each one’s outcome, the reviewer’s calls and weighted cost, and the revision’s weighted cost and minutes (the session’s, after the reviewer returned). --arm control|ineligible does the same for a session with no review, so every measured session states its arm. tools/usage-page.js shows a task’s review and revision apart from its implementation. Tests on constructed transcripts, in tests/agent-usage.js and tests/usage-page.js.Cause: VB-NNN header line, after Status: and any Waits for:, names the task whose change introduced the defect a task mends, where that is known. tests/backlog.js checks that it names an existing task; tools/backlog.js new|set cause= and tools/inbox.js note ID task cause= write it; BACKLOG.md, How this backlog works, says so in one sentence. Older tasks are not back-filled.node tools/review.js eval [--dir docs/agents/usage] [--days 14] prints, per arm (review and control, with ineligible beside them for scale):
Cause: names one of them, created (the first commit of their file) within 14 days after its done date, and not opened by its own review’s confirm;Cause: line, against the total cost of reviews and revisions.
A test on constructed run files and task files. This task also opens the evaluation task (blocked, Waits for: Kim, its criteria the method below), so that the method is fixed before the data come in.Evaluation method (fixed now; the evaluation task copies it):
Cause: line without seeing the arm, which is in the run file and the PR, not in the task file. An implementer who knows a review is coming may work differently; the cost comparison by arm shows whether that happens.Notes:
Cause: is an optional header.vb-review definition on Opus. VB-255 at 0d25adfb (the commit the hand review of 16 Nov read): 4 blocking, 5 advisory; of the revision’s mends it found the heir’s plot held for ever (F1, the known blocker), the plot numbering (F2) and the surplus judged against the projection (F8), and missed the timber that vanished on a drop (a teleport), the cost index and the NaN asserts; F9 blocked on criterion 7’s measured bars, a false blocker by BACKLOG.md (measures do not block). 540k weighted, 36 calls, 6 min. VB-911 at 4908f7b2, taken as clean (no task names it as a cause): 2 blocking, both confirmed and still on main: shoes from nothing for every household formed later (sim/leather wearDay, Nothing teleports), and shoeDays 240 counted in game days of a week, so a pair lasts five years (the tuning row put the pile of hides on the hunt). 201k weighted, 13 calls, 2.7 min. Mended in the definition: a missed measure is advisory; each good is traced to its ends. Fixed in the packet: an owner given as a name; the test lists are not tests. The sub-agent’s meta file names its agentType, for agent-usage.js.claims, not the packet; a missed measure is advisory (the trial’s false blocker); Cause: and every header are read and written only in the header block (two notes began “Cause:”); a reviewer is told apart by the harness’s meta file (agentType), the prompt as fallback; a revision is the cost after the reviewer returned; a session whose only sub-agent is its reviewer stays its task’s on the usage page. VB-1619 itself is control by its own hash: not reviewed. The evaluation is VB-1618 (Waits for: Kim)..claude/agents/vb-review.md and tools/review.js (with its test); changes to docs/agents/worker.md (five lines), .claude/agents/vb-task.md (one line), tools/agent-usage.js, tools/usage-page.js, tools/backlog.js, tools/inbox.js, tests/backlog.js, tests/context-size.js, AGENTS.md (one step) and BACKLOG.md (one sentence). Nothing under src/, and no game state. Size L: the criteria are ordered so that each can land as a commit of its own (the reviewer and its grades; the packet; eligibility; the cycle; orchestrated runs; the instruments; Cause:; the evaluation).