--- name: implement-review description: Review loop (/vet) for staged changes or a plan. Detects the content type, sends a review request to Codex, Agy, Claude, or Grok, categorizes the feedback, revises, and iterates. Works for code, papers, proposals, or any text-based output. --- # Implement-Review On `/vet` or `$implement-review`, run the review loop for the requested target. A subagent of the coordinator, or the coordinator's own checks, cannot fill a reviewer slot. An Auto-terminal round reports the reviewer, its review file, and the Phase 2 health-check result, or says that intake is pending or failed. ## Overview The coordinator sends the changes to one or more reviewers, categorizes the feedback, revises, and iterates. Codex is the default reviewer, through terminal relay (manual copy-paste, default on every platform) or Auto-terminal (opt-in subprocess dispatch), which also drives the Agy, Claude, and Grok backends. A reviewer driven by hand only needs the `Review-.md` save contract in Phase 1c. Reviewer defaults and coordinator rewrites follow Path selection. ## Reference Index Open a reference only when its condition holds, because reading one never by itself authorizes an action this file withholds: reading `failover-and-recovery.md` does not authorize failover, a stopped harness or a watcher `REAP-UNKNOWN` is resolved through `await-review.py` first, a checkpoint keeps its documented behavior while death is unproven, and Grok keeps its no-failover exception. | File | Read when | |---|---| | [references/review-lenses.md](references/review-lenses.md) | every round, to pick the lens for item 4 of section 1b | | [references/plan-review.md](references/plan-review.md) | the user asks for a plan review, or a plan-first signal holds | | [references/codex-backend.md](references/codex-backend.md) | before raising `CODEX_DISPATCH_REASONING` or the timeout, or overriding `CODEX_DISPATCH_MODEL`, `CODEX_DISPATCH_SANDBOX`, or `CODEX_DISPATCH_ISOLATE_MCP`; a Codex probe fails, stderr shows a `MODEL-*` line, or a fresh Codex review or `FAIL check-10` shows it could not run `git diff` | | [references/agy-backend.md](references/agy-backend.md) | before overriding `ANTIGRAVITY_DISPATCH_MODEL`, `ANTIGRAVITY_DISPATCH_EFFORT`, or `ANTIGRAVITY_PREFLIGHT`, or running `--print-model`; an Agy dispatch exits 2, 70, or 124, stderr shows a `MODEL-*` line, or Check 8's `breakdown=` includes `recovered:` | | [references/claude-backend.md](references/claude-backend.md) | before overriding `CLAUDE_DISPATCH_BARE` or the Claude model or effort; `dispatch-claude` fails preflight or exits nonzero, stderr shows a `MODEL-*` line, the dispatcher handle is lost, or the user asks for scheduled heartbeat monitoring | | [references/grok-backend.md](references/grok-backend.md) | Grok reviews (`/vet grok`, `/vet all`, or a default reviewer that includes Grok), before overriding a `GROK_DISPATCH_*`, `GROK_BIN`, or `GROK_HOME` setting, or when stderr shows a `MODEL-*` line or `dispatch-grok.py` exits 70 | | [references/failover-and-recovery.md](references/failover-and-recovery.md) | a confirmed failure under Phase 1c, a missing-backend probe, or `STREAM-DEAD`, `TIMEOUT`, `REAP-UNKNOWN`, or a harness-stopped notice | | [references/health-check.md](references/health-check.md) | `health-check` prints any `FAIL`, or a `WARN` marker the coordinator does not recognize, or a Phase 2.5 claim needs a method | ## Round checklist Two standing rules come first, then the steps of a round in order. Each step states its decision once and links the section with its procedure. A. **Claude slot when Codex coordinates.** This rule covers the Claude slot only when Codex coordinates; other pairs keep their usual dispatch, waiting, and failover, and its verdict list serves every `await-review.py` call (steps 6 and 8). Start `dispatch-claude` on a resumable exec tool and keep its handle and `STATE-DIR`. Claude's text can stay empty until its final response, so an empty tail, `ALIVE`, or a pre-publication `STALL` leaves the review pending, even after 15 minutes. Before the first wait, run ` /await-review.py --state-dir --round --review-file Review-Claude-Code.md --timeout 0` to establish the original deadline. The script has no shell wrapper, `--review-file` defaults to `Review-Codex.md`, `` comes from `/python-interpreter` when the dispatcher wrote one (`dispatch-claude` writes none; then resolve one as section 1c says), and `` follows the lookup order of the other scripts. A custom `--round-budget` goes on that first call, before the deadline is stamped, and a new deadline is never stamped. Wait on the retained handle with empty-input `write_stdin` (a confirmed native completion notification also serves), requesting `yield_time_ms=180000` when supported, capped by the remaining round budget and any smaller host limit, as a maximum window and not a fixed delay. After each completed wait, and before marking the slot complete, read the dispatcher exit status first: nonzero is a confirmed failure that wins over `ALIVE` and goes through [1c. Send to reviewer](#1c-send-to-reviewer), and exit 0 still needs the report and step 7. While the dispatcher is pending, make one `--timeout 0` check for publication or the deadline, then continue the same handle unless a documented checkpoint is reached. Resume an outer execution cell that yields early and never terminate it. If the handle is lost ([references/claude-backend.md](references/claude-backend.md)), run the step 6 command with the original deadline, and never wait only on a long-running resolver, which cannot see a dispatcher exit without publication. A tool yield or an expired wait is not failure. Do not conclude the review, drop the slot, or cancel the dispatcher or reviewer to end the turn (`terminate: true`, Ctrl-C, or `kill`): cancellation by the coordinator is not a backend failure and does not allow Single-source completion. Add no fixed sleep, log rereads, or repeated progress messages. Keep the original 60-minute deadline unless the user names another budget, arm no shorter harness kill timer, and keep the deadline across yields and scheduled wakeups. A user-requested stop pauses monitoring and does not make silence a failure. Publication alone is not proof the worker exited, and sequential mode waits on that proof ([Path selection](#path-selection)). A published report alone is not a conclusion: run step 7, reading a saved `stall-warning` as the Check 9 inspection, because a pre-publication silence warning is no permission to abandon the reviewer. Verdicts: `DONE` or `REVIEW-READY` means read the report and run step 7 (a `REVIEW-READY` review can still fail Checks 4 to 10); `ALIVE` means the round is unproven, so check again until a verdict or the deadline; `STALL`, `TIMEOUT`, and `REAP-UNKNOWN` stay checkpoints: `STALL` surfaces the silence warning and leaves the review pending (step 6), and `TIMEOUT` and `REAP-UNKNOWN` report the specific incomplete state and pause monitoring, never killing the reviewer or inventing a deadline; of these verdicts only `DEAD` and `STREAM-DEAD` confirm a failure, and they go through section 1c ([references/failover-and-recovery.md](references/failover-and-recovery.md)). Stop monitoring the slot once its result reaches intake. B. **When the loop stops.** Stop when the user says the review is done or approved, when the user decides to stop iterating, or when no new or still-open finding meets the Will fix bar. A reviewer that still blocks on a `Deferred` item does not hold the loop open; name those items in the summary. Then present a short summary: total rounds, key changes made, and unresolved points from the last review. Procedure: [Phase 4: Conclude](#phase-4-conclude). 1. **Prerequisites.** Follow [Prerequisites](#prerequisites): the usage snapshot, staged changes and drift, and the `Review-*.md` exclusion. When the user asks for a plan review or a plan-first signal holds, start at [When to plan-review first](#when-to-plan-review-first) and read [references/plan-review.md](references/plan-review.md); only the staged-change and drift checks wait until the plan passes. 2. **Pre-review checks.** Run the content-type checks in [Pre-Review Checks (optional)](#pre-review-checks-optional) before building the request. 3. **Channel and reviewers.** Choose both by [Path selection](#path-selection), and before dispatching emit one channel line per reviewer, naming what selected the channel and the reviewer set. Dispatch exactly that set. Only the user's words for this review, or a rewrite or failure path this file defines, change it, and the line then names that reviewer and why. Reasoning effort is a one-way ratchet: the registry's effort is the floor, not a target. The dispatching agent may raise one round above it with a higher `CODEX_DISPATCH_REASONING` when the change is hard enough to earn deeper reasoning (mirrored copies of one file, caching or state lifetime, or a risk of failing silently rather than loudly), and must never pass a lower one, so the worst case is a round not deepened, never one weakened. A higher tier lengthens wall-clock, so raise the dispatch timeout in the same step or the round is killed before it writes anything. When the budget buys one deeper round or two at the floor, prefer another round while the artifact is still changing (their relative yield is unmeasured, so treat this as a default), and raise the tier for the closing round or when the change is subtle enough that a first read is unlikely to reach it. See [references/codex-backend.md](references/codex-backend.md) before raising the tier or timeout. 4. **Build the request.** Assemble it from [1b. Build the review context](#1b-build-the-review-context), choosing the lens with [references/review-lenses.md](references/review-lenses.md). A snapshot backend such as Agy reviews the exported index, so a gitignored `PLAN-*.md`, an untracked evidence note, or an untracked local override never reaches it, and its review would be silently ungrounded. Paste each such input into the request once under a `--- SUPPLIED INPUT: ---` heading (plan-review step 3). The relay tells the reviewer to read those copies and never the original worktree, and supplied policy stays distinct from repository material, which the relay treats as untrusted. 5. **Dispatch.** Send the request by [1c. Send to reviewer](#1c-send-to-reviewer), which sets up the failure definition and the failover queue at round start. Dispatchers take `--expected-review-file Review-.md`, and `health-check` and `await-review.py` take `--review-file Review-.md`, where `` is the backend's own name: `Codex`, `Claude-Code`, `Antigravity`, or `Grok`. 6. **Watch.** Run one watcher per reviewer under [1d. Auto-watch (Terminal-relay and Auto-terminal channels)](#1d-auto-watch-terminal-relay-and-auto-terminal-channels). A `STALL` exit 3 is not a death: surface the silence warning and inspect or keep monitoring, and do not terminate the dispatch or set sticky downgrade from silence alone. Silence is never terminal: `DEAD` needs `stream-death` paired with a completed `stream-reap-complete`, and neither a quiet tail nor a review published under the wrong round marker is that evidence, so no shorter idle window may be promoted to a death certificate. If a reviewer dies without writing a marker, `await-review.py` keeps returning `ALIVE` and the round's own timeout ends it. A harness notice that the dispatch or watcher was stopped (`killed` in a background-task notification) concerns the harness's task wrapper, not the reviewer, which runs detached: do not conclude failure, redispatch, or set sticky downgrade from it, and a lost watcher is no corroboration. Resolve it in the foreground, since a background probe would be exposed to the same stop, with ` /await-review.py --state-dir --round --review-file Review-.md` (interpreter and `` as in rule A). It replaces the watcher for the rest of the round, and rule A gives its verdicts. A watcher `REAP-UNKNOWN` is resolved with the same command, and only the resolver's own checkpoint verdicts pause monitoring. 7. **Health check.** For Auto-terminal, run `health-check --state-dir --round --review-file Review-.md` with the `STATE-DIR` the dispatcher printed. Read its stdout, never only the exit code: a `WARN` exits 0, and it exits non-zero only for a `FAIL` of Checks 1 to 5 or 10 or missing or stale `/pre-mtime` or `/timestamp`. Any `FAIL` refuses that review and routes it through section 1c while the other slots stay active. A `WARN` from Check 6, 7, 8, or 9 or a Substance heuristic is inspected and is not by itself a refusal: read what the check flags, record the reading in the round summary, and advance. Read for `check-6` whether the review covers the named files under other words; for `check-7` the `lines=` it names in `Review-.md`; for `check-8` the matching failure lines in `/tail` and, when present, `/tail.stderr-tmp` (where the Claude and Agy dispatchers write stderr), and when `breakdown=` includes `recovered:` also `/backend-failure` and whether the review ends cleanly, accepting that review's verdict only after checking it for placeholders, narration, and truncated findings; for `check-9` `/stall-warning` and whether the review ended cleanly; for `substance-1` the `elapsed=` and `prompt=` pair; for `substance-2` the file:line anchors (`0-anchors`); for `substance-3` the scope-challenge axes in `missing-axes=`. Ask the user only when an inspection finds a defect: a tool failure that blocked verification, a truncated or placeholder review, a review of something other than the named scope, a missing verification, or `WARN check-8 1 missing-dispatch-tail`, which leaves dispatch health unconfirmed and is never read as Check 8 hit 0. When the review file is missing, Check 1 hard-fails while Checks 8 and 9 still run on the tail and stall warning. Every saved review needs one standalone `Verification status: VERIFIED` or `UNVERIFIED` line: `VERIFIED` only after at least one relevant verification command completed, with the exact commands and outcomes in Verification notes, and a run with none says `UNVERIFIED` with `Commit verdict: UNVERIFIED` and cannot issue `PASS` or `BLOCK`. Check 10 rejects an `UNVERIFIED` status or verdict, a `PASS` or `BLOCK` without `VERIFIED`, conflicting markers, and `VERIFIED` beside notes that report no execution, so a `BLOCK` with `VERIFIED` and concrete outcomes passes, and `FAIL check-10` is a hard intake failure. Only after a fresh review says Codex could not run `git diff` (dispatch exit 0, fresh `Review-Codex.md`), retry Auto-terminal once with an embedded-diff prompt before the failure is routed through section 1c; with the default `--sandbox danger-full-access` this should never fire. Its findings are diff-scoped and prone to false positives on claims that depend on non-diff code, so a Medium finding from it needs step 10 before it is applied, and a retry that fails or records only blocked verification is a confirmed failure routed through section 1c. Procedure: [Phase 2.0: Health check (Auto-terminal only)](#phase-20-health-check-auto-terminal-only); see [references/health-check.md](references/health-check.md) when its read condition holds. 8. **Intake.** For Terminal-relay, auto-watch `DONE` is enough to start intake. For Auto-terminal it is necessary but not sufficient: advance a reviewer with no inspection only when all nine hold: `DONE ` or a resolver `REVIEW-READY ` for a file with the current round marker; the dispatch subprocess exited 0, or the harness reported the task stopped and `await-review.py` then returned `REVIEW-READY`; Checks 1 to 5 pass; Check 10 passes; Check 6 reports PASS; Check 7 hits 0 phrases; Check 8 hits 0 markers; Check 9 finds no `stall-warning` file; the Substance heuristics flag 0 signals. If the exit evidence, Checks 1 to 5, or Check 10 fails, refuse that review and route its dispatch through section 1c while the other slots continue. A hit on Check 6, 7, 8, or 9 or a Substance heuristic is inspected under step 7 and is not by itself a refusal. `TIMEOUT` and `REAP-UNKNOWN` also stop at a human checkpoint; a `STALL` leaves the review pending under step 6 and never starts intake by itself. Consolidate only after every expected reviewer has a ready report or a confirmed failure (or the user says the reviewers are done), and keep a slot pending while its dispatch is active. Read only `Review-*.md` files that are current-round (first line ``) and from an expected reviewer, and report every ignored file by filename and reason (stale-round, empty, unreadable, unexpected) before presenting findings. Flag a current-round unexpected file to the user before including or excluding it: mtime against the Phase 1c emission time is a noisy secondary signal only, a corroborating signal is required before including it, and it is never included or excluded silently. When the expected set is unknown, use mtime only to rank candidates and ask the user which current-round files belong to this review. For an expected reviewer whose file is missing, stale, or empty with no confirmed dispatch failure, send a follow-up prompt naming that reviewer, then ask the user to paste its feedback directly if the file is still missing, empty, or stale. Procedure: [Phase 1d coordination (Auto-terminal-specific silent-intake rule)](#phase-1d-coordination-auto-terminal-specific-silent-intake-rule); the partition is in Phase 2.1. 9. **Classify and act.** With two or more current-round sources, classify each new finding as Convergent (two or more reviewers raise substantially the same point), Convergent with differences (same problem, different severity, scope, or remedy: keep each reviewer's severity and fix, and use the highest severity until the user or implementer resolves it), Single-source (label the source), or Divergent (opposite positions: flag it, show both positions, and classify it like any other finding). If only one current-round source remains after step 8 although more were expected, label every finding Single-source; a single-reviewer round's one source is complete intake. Acknowledge each point, and check the reviewer's New and Previously raised split, making it yourself from the round history when the reviewer did not. Mark a new finding Will fix (clear, actionable, correct, and worth a revision), Decline (correct but not worth a revision, and never a risk to user data), Needs discussion (ambiguous or potentially wrong), or Disagree (explain why). Mark a previously raised finding Fixed (no action), Still open (the fix did not land or was incomplete: treat as Will fix unless the user overrides), Reopened (flag it to the user: it needs a decision and is never re-argued silently), or Deferred (no action unless the user reconsiders). Fold in the outcomes of step 10 and record the categorized list in the round summary. Do not ask before applying Will fix and Still open items (step 11 applies them after step 10), and record each Decline as Deferred with a one-line reason, also without asking. Ask the user only about Needs discussion, Disagree, and Reopened items, and act on them only after the answer, so a Divergent finding asks only when it lands in Needs discussion or Disagree. If no new or still-open finding meets the Will fix bar, skip step 11 and apply rule B. Procedure: [Phase 2.1: Partition and classify (all channels)](#phase-21-partition-and-classify-all-channels). 10. **Verify claims.** After classifying and before applying, verify a finding that makes an objectively checkable factual claim (a citation, code behavior, a link, a count, a compile error) when it is High priority, or Medium and from the embedded-diff retry channel, or the user asks for verification of a Medium or Low one. Skip it when the reviewer's Verification notes already cover that claim with a method that resolves it (trust that check unless contradicting evidence appears), when the fix is trivially correct or the cheapest verification takes longer than the user can wait, and for stylistic, opinion-based, or structural findings. Verified means the Will fix bar decides. Refuted means do not apply the fix whatever its category: push back through a follow-up reviewer prompt that cites the evidence (command run, output, URL fetched, file inspected), which the user may override by asking to apply anyway. Inconclusive means surface the ambiguity and let the user decide. Add each Refuted or Inconclusive finding, with its evidence or reason, to the next round's `Prior findings` block. Procedure: [Phase 2.5: Verify Factual Claims (when triggered)](#phase-25-verify-factual-claims-when-triggered); methods are in [references/health-check.md](references/health-check.md). 11. **Revise.** Apply Will fix items and the Needs discussion points the user approved in place: rewrite, move, or cut the named passage, and add material only for an identified gap. For a paper, proposal, or plan, record its size each round in the same unit, and after two consecutive rounds of growth with no new result or step, consolidate before the next dispatch. Cut unneeded defenses and move process history that supports no retained claim to the records. Update the round history (Resolved, Still open, Deferred, and the Refuted and Inconclusive findings of step 10), stage the revised changes, and return to Phase 1 with the next round number. Procedure: [Phase 3: Revise](#phase-3-revise). 12. **Conclude.** Apply standing rule B to decide whether the loop stops; [Phase 4: Conclude](#phase-4-conclude) holds the procedure. ## When to plan-review first **Any complex task benefits from a plan review BEFORE execution**, because plan-first catches architectural holes while they are still cheap to fix, wherever the shape of the work precedes and constrains the execution: system design, refactors, paper outlines, proposal structure, migration plans, and multi-stage debugging. **Plan-review is a Phase 0 before the staged-change loop below.** If the user asks for a plan review, or if the task clearly meets the signals below, do not apply the staged-change and drift checks under Prerequisites yet. Tell the reviewer to read the plan file directly (or paste the plan contents via the terminal path when the reviewer cannot access the file) and critique the design, not `git diff --cached`. The process is in [references/plan-review.md](references/plan-review.md). After the plan has no High findings and no new design blockers, execute the work and resume the normal staged-output review flow at Prerequisites / Phase 1. ### When to plan-first Signals that the round-trip pays off: - **Blast radius is large** -- multiple files, cross-cutting concerns, shared state, multiple stakeholders, or the organizing structure of a deliverable. - **Irreversible once executed** -- publishes, submissions, deployments, immutable packages, paper submissions, external commitments. - **History shows a pattern** -- "got the structure wrong, redo next cycle" has happened on this track before. - **Uncertainty in the approach** -- the user is weighing alternatives and wants the design validated, not the execution reviewed. - **Context is unfamiliar** -- new codebase, domain, audience, agency, collaborator workflow, or external constraint set, where a wrong assumption can shape the rest of the work. ### When to skip plan-first - Change is small, local, reversible. - The design is already worked out and only execution feedback is wanted. - Plan and execution would be the same artifact (three-line bug fix, one-sentence footnote). ## Prerequisites Begin each run by showing the cross-agent usage snapshot, so the quota situation is visible at this run. In Bash, run `"$HOME/.claude/hooks/_python" "$HOME/.claude/agent-quota.py"`, or run the repo copy with the project's Python (`scripts/agent-quota.py`, or `.agent-config/repo/scripts/agent-quota.py` in a consumer). Show its Claude, Codex, Agy Gemini, and Agy Claude/GPT rows. Read all percentages as **remaining** quota (headroom left), not consumed: a high value such as `93% left` is not a reason to downgrade the channel or stop the review; only a figure near `0% left` signals real quota pressure. If neither the script nor a Python runner is available, skip silently and never block the review on it. At skill start, check for staged changes (`git diff --cached`). If nothing is staged but unstaged or untracked changes exist, list them and ask the user whether to stage all (`git add -A`), stage specific files, or abort. Do not auto-stage without confirmation; untracked files may be sensitive or unrelated. With no changes at all there is nothing to review; inform the user and stop. Then check the other direction: a path that is staged **and** changed again since staging. Intersect `git diff --cached --name-only --no-renames` with what `git diff --name-only` and `git ls-files --others --exclude-standard` report together. A non-empty result means the reviewer would receive that path as it stood at `git add`, so its findings would read as findings about the current file. List those paths and resolve them before dispatching. Paths changed but never staged are ordinary and not this case. The untracked list catches a staged deletion whose file came back, and `--no-renames` a path recreated after a staged `git mv`. `dispatch-gemini` refuses the drifted case itself, because its reviewer is handed an export of the index and cannot see the drift. `IMPLEMENT_REVIEW_ALLOW_STAGED_DRIFT=1` overrides that refusal for a deliberate review of the index as it stands. The other dispatchers do not enforce it yet, so this check is the only cover there. See anywhere-agents#57. Do not stage, commit, or move `Review-*.md` files unless the user explicitly asks. Before the first review round, check whether `Review-*.md` is excluded from git, in `.gitignore` and `.git/info/exclude`. If the pattern is not excluded anywhere, append `Review-*.md` to `.git/info/exclude` so that `git add -A` during the revision flow does not accidentally stage scratch files. A committed `.gitignore` entry for `Review-*.md` satisfies this without a local edit. ## Pre-Review Checks (optional) Before sending staged changes for review, run automated checks that catch mechanical issues locally. This lets reviewers focus on content and judgment calls instead of issues a script could find. Skip this phase if the user says to proceed directly, or if the project has no relevant tooling. | Content type | Checks | |---|---| | LaTeX paper or proposal | Compile. Scan the log for overfull/underfull box warnings and undefined references. Report counts. | | Anonymized submission | Grep staged files for author names, GitHub/lab URLs, institutional names, and tool names. Source these from the project's de-anonymization checklist if one exists; otherwise use the git user name, institution domain, and any names in the paper's author metadata or `\author{}` block. | | Code | Run the project linter and type checker if configured. | | Prose (`.md` / `.rst` / `.txt` / `.tex`, or prose-heavy diff) | Run ` /style-audit.py --repo `, resolving `` through the same lookup order as the other scripts. It finds the staged prose itself, reports `file:line:col RULE detail` for each deterministic rule, and names the rules it covers only in part or not at all, so a partial audit does not read as a clean pass. Audit the unreached rules by reading the rule pack (RULE-07 antithesis is one). Read each finding in context and fix the ones that read badly; a departure that reads well can stay. | Report any findings to the user before Phase 1. Findings here do not go to the reviewer; fix the ones that read badly locally first. **The style audit runs on content, and never gates the round.** Run `style-audit.py` whenever the staged diff carries prose, so skipping it is a decision someone made rather than a default. The script always exits 0, including when it finds violations and when `agent_style` is absent, so no step in the loop can fail on it. Style findings stay out of the reviewer's prompt, out of the Round history `Still open` list, and out of the verdict. ## Codex Channels Two paths to Codex are supported. Default is Terminal-relay (manual copy-paste). Auto-terminal (`codex exec` subprocess) is opt-in via the trigger rules in Path selection below. Phase 1c dispatches it; the Codex mechanics are in [references/codex-backend.md](references/codex-backend.md), read under its Reference Index condition. ### Terminal path (default) The user has a Codex interactive terminal window open alongside Claude Code. Claude Code prepares a copy-pasteable review prompt (summary, diff, lens, round number) and presents it as a fenced text block. The user copies it into the Codex terminal, then relays the feedback back to Claude Code. ### Path selection 1. **Default**: Terminal-relay (manual copy-paste) on every platform. Users who do not opt into another channel get the current Terminal-relay flow without modification. - **User-scoped default override**: when the environment variable `IMPLEMENT_REVIEW_DEFAULT_CHANNEL` is set (case-insensitive) to `auto`, `cli`, or `auto-terminal`, the synonyms the slash args accept, Auto-terminal becomes that user's default and no per-invocation opt-in token is needed, including beside a reviewer token such as `agy` or `grok`. Read the variable once at Phase 1c entry. Claude Code reads it from the `env` block of `~/.claude/settings.json`, and Codex from `[shell_environment_policy] set` in `~/.codex/config.toml`. Agy has no such setting and sees only the environment it was started in. - When the variable is unset, empty, or holds an unrecognized value, the shipped Terminal-relay default applies, so a typo degrades to today's behavior. Unset and empty also leave the channel line unchanged. An unrecognized value adds one clause to the channel line naming the ignored value and saying the shipped default applied, so the user does not go on believing Auto-terminal is their default. - **User-scoped reviewer default**: `IMPLEMENT_REVIEW_DEFAULT_REVIEWER`, read and set the same way, supplies the reviewer tokens when the invocation names none: `both`, `all`, or any of `codex`, `claude`, `agy`, and `grok`, space-separated and case-insensitive. The item 2 rules then apply as if it had been typed, so `both` resolves against the coordinator. A reviewer token in the invocation wins. Unset, empty, or unrecognized keeps Codex, and an unrecognized value adds a clause to the channel line. 2. **Auto-terminal opt-in triggers**, evaluated in detection order at Phase 1c entry: - Mid-flow override toward manual: "back to manual" / "next round manual" / "use terminal-relay" in the user's most recent message forces Terminal-relay. - Mid-flow opt-in toward auto: "next round use cli" / "next round auto codex" forces Auto-terminal. - Slash-arg opt-in: `/implement-review cli`, `/implement-review auto`, and `/implement-review auto-terminal` are equivalent synonyms; `auto` is the most natural keyword and is accepted. When `.claude/commands/implement-review.md` forwards slash arguments through `Command arguments from the slash invocation: $ARGUMENTS`, evaluate that forwarded argument string the same way as the original slash invocation. Manual override tokens still win before Auto-terminal opt-in tokens. - Plain-phrase opt-in in the invoking message: case-insensitive substring match on any of `cli mode`, `use cli`, `auto codex`, `use codex exec`, AND no negation word (`do not`, `don't`, `no`, `not`, `avoid`, `manual`) within 4 words before the matched phrase. - **Reviewer-backend selection (Agy, Gemini through Antigravity CLI, opt-in)**: when the selected channel is Auto-terminal and the slash arguments contain `agy`, `gemini`, or `antigravity`, use `dispatch-gemini.py` and expect `Review-Antigravity.md`. The canonical invocation is `/vet agy`; `/vet gemini`, `/vet antigravity`, the compatible `/implement-review` forms with `auto` or `cli`, and plain phrases such as `use agy as reviewer`, `use gemini as reviewer`, or `review with antigravity` are aliases under the same negation guard. If the orchestrator is Agy, Gemini, or Antigravity, rewrite to Codex before dispatch and state why. - **Reviewer-backend selection (two reviewers in one invocation)**: reviewer tokens are a set rather than a single choice. When the invocation names more than one, dispatch each named backend for the same round. `both` selects the two backends from `claude`, `codex`, and `agy` that are not coordinating. Under Claude Code it is `codex agy`, under Codex `claude agy`, and under Agy `codex claude`. Any other coordinator gets `codex agy`. Resolve `both` and `all` using the coordinator identity passed to dispatchers in Phase 1c step 5. Do this before the self-review rewrites in the other reviewer-backend items. The resolved set excludes the coordinator, so those rewrites leave it unchanged. When the set includes Claude, Auto-terminal requires every staged path to be in scope; see Phase 1b. `both` means that pair specifically rather than every backend that exists, so Grok is never part of it; name the tokens explicitly for any other combination. `all`, as a leading reviewer token (`/vet all`, `vet all`), selects the three of `claude`, `codex`, `agy`, and `grok` that are not coordinating. An invocation or plain phrase naming the resolved pair is equivalent to `/vet both` under the same negation guard. The channel lines name the coordinator and the resolved pair, for example `both → claude agy (coordinator: codex)`. For `both`, the expected reviewer set is the comma-separated normalized list: `Codex,Antigravity` under Claude Code, `Claude-Code,Antigravity` under Codex, and `Codex,Claude-Code` under Agy. For `all`, add `Grok`, or `Claude-Code` under Grok. Each reviewer gets its own watcher on its exact `Review-.md`. With a single reviewer, nothing here changes. **Dispatch them in parallel when memory allows, one after another otherwise.** Before each further concurrent dispatch, check available memory. On macOS, multiply the system-wide free percentage from `memory_pressure -Q` by `sysctl -n hw.memsize`; Linux reports `MemAvailable` in `/proc/meminfo`. With at least 16 GB available, dispatch the reviewers in parallel. Below that, or when the check fails, dispatch them sequentially. In both modes the watcher is a wait-for-any helper. `auto-watch` exits as soon as one file matching its glob appears, so a single watcher over `Review-*.md` would report the round finished while the second reviewer was still working. Run **one dispatch, one watcher and one health check per reviewer**, each with that reviewer's own `STATE-DIR` and its exact `Review-.md` rather than the wildcard. Where a later step names a single reviewer, a single `DONE`, or a whole-round fallback, apply it per reviewer in a multi-reviewer round. A failing reviewer other than Grok goes through the failover queue while the other slots continue. In such a round, a Grok slot that is absent or failed is a confirmed failure: no failover and no round downgrade. Consolidation waits for every expected reviewer. In sequential mode, before launching the next reviewer, require that the previous dispatcher returned, or identity-checked evidence that its worker exited. `DONE`, `REVIEW-READY` and a clean health check authorize **intake only**: all three are computed from the review file's freshness and quietness, and each was reproduced while the worker was still alive, so none of them is a statement about the process. Where the harness has been lost and termination cannot be established, hold the existing bounded checkpoint and ask, rather than reading `REVIEW-READY` as permission to launch: a file appearing is not proof the previous worker exited, and launching on that signal alone would defeat the memory sequencing this mode exists for. Keep the full expected set for consolidation, so Phase 2 still classifies findings across reviewers (round checklist, step 9). If a reviewer fails, still run the rest; when every missing expected reviewer is confirmed failed, the healthy current-round reviews are complete intake (Single-source if one remains), and Phase 2's missing-reviewer follow-up and direct-paste steps do not apply. - **Reviewer-backend selection (explicit Codex)**: when the selected channel is Auto-terminal and the invocation contains the reviewer token `codex`, keep the normal `dispatch-codex` backend and expect `Review-Codex.md`. When Codex coordinates this skill, a `codex` token or the Codex no-token default is rewritten to the Claude backend before dispatch. If the Claude probe fails, try Agy. One user-visible line states why. Phase 1c step 5 then sets `IMPLEMENT_REVIEW_ORCHESTRATOR=codex` on every dispatcher call, so the script-level guards apply. - **Reviewer-backend selection (Grok cross-vendor backend, opt-in)**: when the selected channel is Auto-terminal and the invocation names Grok, dispatch uses ` dispatch-grok.py` and expects `Review-Grok.md`. Triggers: slash args `/vet grok`, `/implement-review grok`, `/implement-review auto grok`, or `/implement-review grok auto`; plain phrases `use grok as reviewer`, `grok as reviewer`, `auto grok`, or `review with grok`, under the same negation guard. If the orchestrator is Grok (`IMPLEMENT_REVIEW_ORCHESTRATOR=grok`), rewrite to Codex before dispatch and state why. See [references/grok-backend.md](references/grok-backend.md) for the backend's flags, isolation, supplied-input rules, limits, and launch route. - **Reviewer-backend selection (Claude, with mechanical self-review guard)**: select `dispatch-claude` only when BOTH of the following hold: (1) the selected channel is Auto-terminal and the slash args include `claude` (e.g., `/implement-review claude`, `/implement-review auto claude`, or `/vet claude`), OR a plain phrase matches the patterns `use claude as reviewer`, `claude as reviewer`, `review with claude`, or role-reversal wording naming Codex as implementer and Claude as reviewer, all under the same negation guard as the plain-phrase opt-in above; AND (2) the orchestrator running this skill is NOT Claude Code. **Orchestrator detection**: under Claude Code the orchestrator is `claude` by definition. When orchestrator is `claude` and the slash args / phrase ask for the Claude backend, rewrite the selection to Codex (or Agy if Codex is unavailable on PATH) BEFORE any dispatch script is launched, and emit one user-visible line: `Claude backend skipped: Claude Code cannot review its own implementation; using instead.` The dispatcher repeats this guard for direct callers (see [references/claude-backend.md](references/claude-backend.md)). Dispatch uses `dispatch-claude` and the expected review file is `Review-Claude-Code.md`. The channel line goes out at Phase 1c entry so the user can override a wrong pick, e.g. `Channel: Auto-terminal (triggered by "/implement-review auto"; codex on PATH)`. A user-scoped default is named as the reason: `Channel: Auto-terminal (IMPLEMENT_REVIEW_DEFAULT_CHANNEL=auto; codex on PATH)`, and for reviewers `both → codex agy (coordinator: claude; IMPLEMENT_REVIEW_DEFAULT_REVIEWER=both)`. ## Phase 1: Prepare and Send Review ### 1a. Detect content type Inspect the file extensions in the staged diff to classify the change: | Extensions | Content type | |---|---| | `.py`, `.js`, `.ts`, `.go`, `.rs`, `.java`, `.c`, `.cpp`, `.h`, `.sh`, `.yaml`, `.json`, `.toml` | `code` | | `.tex`, `.bib` (in a paper or manuscript directory) | `paper` | | `.tex`, `.bib` (in a proposal or grant directory) | `proposal` | | `.md`, `.rst`, `.txt` (in a proposal or grant directory) | `proposal` | | Everything else or mixed | `general` | If the diff spans multiple types, pick the dominant one. The user can override by saying, e.g., "review this as a proposal." For proposals, also ask which agency lens to apply (NSF or NIH) since they use different evaluation frameworks. ### 1b. Build the review context Prepare a review request with: 1. **Request and summary** -- the user's words that asked for this work and any later message that changed it, quoted verbatim, with a proposal those words point to quoted separately as the coordinator's; then one to three sentences on what changed and why, naming any departure from the request. 2. **Diff scope** -- choose the exact diff command before assembling the prompt, and list the changed files. If every staged path is in scope, use `git diff --cached`. If staging is broader than the review scope, use `git diff --cached -- ` and list the staged paths that are explicitly out of scope, so the reviewer is not left inferring the boundary. The Claude Auto-terminal backend embeds a bare `git diff --cached` in its relay prompt and has no scope argument, so use that backend only when every staged path is in scope. Do not paste the diff inline in the primary prompt, which keeps it compact across rounds. The one exception is the Auto-terminal embedded-diff retry, which embeds this same in-scope diff (decision: round checklist, step 7; procedure: [references/codex-backend.md](references/codex-backend.md)). 3. **Splitting the round** -- use a single pass by default. Split only when no shared contract crosses the boundary; keep mirrored platform files, a script and its tests, and a source and its generated or vendored copies inside one reviewer's scope. Independence is a judgement made before the split, so verify it afterwards rather than assuming it held: re-read the boundary you drew, and run the mechanical checks that apply, such as `scripts/check-parity.sh`. See anywhere-agents#41. 4. **Review lens** -- the content-type-specific criteria from [references/review-lenses.md](references/review-lenses.md). If a focused sub-lens or agency-specific lens fits better than the full lens, use it (e.g., `paper/formatting` for a layout-only change, `proposal/nsf` when the agency is known). See the lens tables in that file. 5. **Additional focus** -- specific concerns beyond the generic lens, often the highest-value part of the prompt because it catches real bugs that generic criteria miss. **Always ask the user explicitly rather than guessing.** Recurring project concerns belong here (for example anonymization checks, page-limit compliance, or terminology drift). If there are none this round, write "none" rather than padding the line. When a focus names the writing rules, paste the banned-word list from `AGENTS.md` § Writing Defaults and the four checks (a sentence whose point arrives late, repeated sentence openers, casual dashes, contractions) into the focus item itself, using the wording of the General lens item 7 in [references/review-lenses.md](references/review-lenses.md); never send the reviewer to `AGENTS.md` for them. 6. **Round number** -- which iteration this is (starting at 1). 7. **Variant targets (multi-target reviews)** -- if the staged files cover two or more variant targets that should be reviewed separately (long + short paper version, narrative + appendix tracker, internal + external report, primary + supplement), list each target by directory or file pattern. Tell the reviewer to review each target in its own top-level section and then add a cross-variant drift check at the end (tables that should match, claims that should be consistent, terminology that should align). 8. **Round history** (rounds 2+ only) -- a one-line-per-finding summary of what prior rounds raised and how each was resolved. Tag each finding as `Resolved`, `Still open`, `Deferred`, `Refuted`, or `Inconclusive`. The last two come from the Phase 2.5 verification step (see below); they let the reviewer see when a prior factual claim did not hold up under verification, with a pointer to the evidence so the reviewer can either retract or sharpen the claim. Example: ``` Prior findings: - DMP listed wrong project name (Resolved — fixed in round 1) - Budget table exceeds page width (Still open) - Consider reordering Section 3 (Deferred — user decision) - Citation [Smith2023] does not exist (Refuted in round 2 — arxiv.org/abs/2023.XXXXX confirms paper) - Compile error in section 4 (Inconclusive in round 2 — could not run latexmk in this env) ``` ### 1c. Send to reviewer All review prompts sent to the reviewer (regardless of channel) must include a save instruction **at the very top of the prompt, before the summary or diff**, so the reviewer sees it first. The template below opens with that instruction and carries the whole save contract (statuses, Round 1 behavior, required sections); every channel sends it unchanged. **Recording the expected reviewer set**: Before presenting the prompt, record two pieces of Claude-side state that Phase 2 will use: - **Expected reviewer set**: the set step 3 resolved, carried into later rounds until the user changes it for this review or a failure path replaces a reviewer. If that leaves the set unclear, ask the user which reviewers they plan to invoke before presenting the prompt. - **Phase 1c emission time**: the timestamp when the prompt is shown to the user. Used as an mtime tiebreaker in Phase 2 for files that cannot be classified by expected set alone. **Terminal path**: Present a compact, copy-pasteable review prompt as a fenced text block. Keep the prompt to about 20 lines. Tell the reviewer to run the exact diff command chosen in Phase 1b rather than pasting the diff inline. ```` IMPORTANT: Save your complete review to Review-.md in the repo root. Normalize your name: pick the stable product name, whitespace → one dash, keep only ASCII letters/digits/dashes, collapse repeated dashes, trim edge dashes. Examples: Codex → Review-Codex.md, Antigravity → Review-Antigravity.md, Claude Code → Review-Claude-Code.md, Grok or Grok Build → Review-Grok.md. Use Review-Unknown.md if the result is empty or you cannot identify yourself, and note the uncertainty at the top of the file. Write the complete review to a temporary file in the same directory, then rename it over that filename rather than clearing the target first. Use plain Markdown. Start with . Begin with Verification notes listing exact commands and outcomes. Add one standalone Verification status: VERIFIED or Verification status: UNVERIFIED line. Use VERIFIED only after at least one relevant verification command completed. With no completed verification, write Verification notes: none., Verification status: UNVERIFIED, and Commit verdict: UNVERIFIED; do not issue PASS or BLOCK. Include file/diff scope and review lens. Separate findings into New and Previously raised (Fixed / Still open / Reopened / Deferred) sections; on Round 1, Previously raised may be omitted or shown as "None." For High-priority findings, include an exact rewrite with file:line, in a fenced code block when it spans several lines. The response format is fixed by this paragraph; do not look for example reviews or the coordinator's skill documentation to learn it. Review staged changes in . Round . Run `` to see the diff. Files changed: . Staged but out of scope: . Reading contract: your task, lens, and response format are supplied here, and the project rules already supplied to you apply, including local overrides. Skip router dispatch and coordinator-workflow discovery at all skill lookup locations (skills/implement-review/, .claude/skills/implement-review/, .agent-config/repo/skills/implement-review/, .agents/skills/implement-review/). Do not load coordinator skill files or example reviews to discover the workflow or response format. Files under review remain readable. A targeted read outside the review scope is permitted when it supplies missing context, resolves truncation, or answers a concrete verification question. Read an applicable instruction file that was not supplied (for example AGENTS.local.md) once. Obtain the selected diff once with the command above; if this request embeds that diff, use it and do not obtain another copy. Do not read the same content twice. Request (the user's words, verbatim; a proposal they point to, marked as the coordinator's): Summary: Lens: — Focus: Working method (optional, only if your runtime supports it): for a large or multi-file diff, you may parallelize across scopes only where no shared contract crosses the boundary (mirrored platform files, a script and its tests, and a source and its generated or vendored copies stay in one scope), keeping every shared-contract pair in one reviewer's context and re-reading that boundary while consolidating; for any finding that rests on a checkable external fact (citation, link, library or API behavior, version), use web search to verify it before asserting, and record what you checked in Verification notes. Scope-challenge focus (mandatory; reviewer must take an explicit position): (a) Why exactly this scope — what user pain or opportunity does it close, could a smaller scope close most of it, could a marginally larger scope close all of it for low cost? (b) Is each "out of scope / deferred to vNext" worth its process tax (extra plan-review + implement + execution-review + CI + publish cycle) versus inclusion now? (c) Is this plan the simplest path? Be adversarial about purpose and shape. Request fidelity (mandatory): Does the change do what the quoted request asks? Flag a departure the user has not approved, named in the summary or not (another method, a narrower scope, a changed parameter, sample, data source, tool, or model, a skipped step) and any guard, fallback, special case, retry, or caveat that neither the request nor an observed failure calls for. Propose none yourself: a finding about a failure names the input that triggers it or where it was seen. Check each number from a run against the file or command that produced it. Variant targets: - TARGET A: - TARGET B: (Review each target in its own top-level section and add a Cross-variant drift check at the end.) Prior findings: - (Resolved | Still open | Deferred | Refuted | Inconclusive) ```` Then wait for the user to relay the reviewer's feedback or confirm that the reviewer has finished (see Phase 2 for how Claude Code picks up the review). **Auto-terminal path (opt-in)**: When the user has opted in per the trigger rules in Codex Channels > Path selection, **first check whether the required Auto-terminal scripts exist**, looking in this order: repo-local `skills/implement-review/scripts/`, then pack-deployed `.claude/skills/implement-review/scripts/`, then bootstrapped `.agent-config/repo/skills/implement-review/scripts/`. The required scripts are the selected dispatcher (`dispatch-codex.{ps1,sh}`, `dispatch-claude.{ps1,sh}`, `dispatch-gemini.py`, or `dispatch-grok.py`), `health-check.{ps1,sh}`, `stall-watch.{ps1,sh}`, and `await-review.py`, and the Python-only scripts also need a resolvable `python-interpreter` (read `/python-interpreter` when a dispatch wrote one, otherwise try `ANYWHERE_AGENTS_PYTHON`, the project `.venv` or `venv`, `VIRTUAL_ENV`, conda or Miniforge environments, then `python3` and `python` on `PATH`). If anything is missing, say in one user-visible line that Auto-terminal is unavailable and Terminal-relay is used for this round, and downgrade **without** setting sticky downgrade: a missing script or interpreter is design state, not a runtime failure. If the scripts are present, Claude Code does NOT present a copy-paste prompt block. Instead, the skill: 1. Probes the selected backend: `codex`, `claude`, `agy`, or `grok` (via `GROK_BIN`, `PATH`, or `~/.grok/bin/grok`). If absent: warn the user, and take the next entry of the Phase 1c failover queue if one probes clean, otherwise downgrade to Terminal-relay for this round. In a multi-reviewer round, an absent `grok` instead leaves its slot confirmed failed, with no failover and no downgrade. A preflight absence never sets sticky downgrade. 2. Probes session sticky-downgrade state. If active: downgrade to Terminal-relay, and keep it for later rounds until the user re-opts-in explicitly (silent unless the user asks why). 3. Assembles the prompt: byte-identical to the fenced Terminal-relay block above (same save contract, lens, focus, scope-challenge focus, prior findings). 4. Writes the prompt to `/agent-io/round--prompt.txt` under `$TMPDIR`, and a captured round output to `/agent-io/round-.txt`. 5. Invokes the selected dispatcher from the same lookup root: `dispatch-codex.{ps1,sh}`, `dispatch-claude.{ps1,sh}`, ` dispatch-gemini.py`, or ` dispatch-grok.py`, with `--prompt-file `, `--round `, and `--expected-review-file Review-.md`, where the file is `Review-Codex.md`, `Review-Claude-Code.md`, `Review-Antigravity.md`, or `Review-Grok.md`. Set `IMPLEMENT_REVIEW_ORCHESTRATOR` in the dispatcher's environment to the coordinator's own identity (`claude` for Claude Code, `codex` for Codex, `agy` for Agy, `grok` for Grok) on every dispatch, including retries and failover, so an inherited runtime marker never decides who the coordinator is. Run it in the background with a timeout sized to the backend and reasoning tier: about 20 minutes (`1200000`) for Codex at the registry's effort and about 45 minutes (`2700000`) for a raised Codex round or any Agy round, whose `--print-timeout` defaults to 45 minutes. Run the dispatcher from the reviewed repository's root, which is the session's working directory. 6. Reads the dispatch script's stdout: it emits exactly one line `STATE-DIR ` (the only stdout line). Capture this path for the Phase 2 health check (round checklist, step 7); all other dispatch diagnostics plus the last 80 backend lines go to the script's stderr. 7. Phase 1d auto-watch runs once per reviewer; each watcher polls for that backend's exact review file with the current round marker. Phase 2.0 then runs the health check, and a `WARN` there follows the inspection rule (round checklist, step 7). **This paragraph is the single authority for where a confirmed Auto-terminal runtime failure goes.** A confirmed failure is a non-zero exit, a dispatcher timeout (an `await-review` or watcher `TIMEOUT` is a checkpoint), a missing fresh review file, a failed Health check, or an `await-review` `DEAD` verdict. Every other passage that names Terminal-relay as a destination for a dispatched-then-failed backend defers here; the preflight absences above are a different case and keep their own wording. Maintain a **failover queue** for the round from these normalized backend identities, in order: `Codex`, `Antigravity`, `Claude-Code` (`Grok` is opt-in only and is never in the failover queue, and a failed Grok run never fails over to another backend). Include only backends whose backend-specific probe passes. Remove the implementing agent, since no agent reviews its own implementation, and any backend that already published a healthy review this round. The queue is fixed when the round starts, and each attempt consumes its entry, so failover never retries a backend that has failed. Failover does not affect the separate bounded same-backend stream retry, which runs first where it applies. The bounded embedded-diff retry, where it applies, also runs before failover moves to the next entry. Failover execution and the bounded stream-death retry are in [references/failover-and-recovery.md](references/failover-and-recovery.md), read on a confirmed failure. ### 1d. Auto-watch (Terminal-relay and Auto-terminal channels) After Phase 1c emits the Terminal-relay prompt or dispatches Auto-terminal (and records the expected reviewer set + emission/dispatch time), the skill **automatically** launches one background watcher per expected reviewer. Each watcher detects when its reviewer writes its `Review-.md`, eliminating the manual "done" relay. The watcher runs by default for both channels; the user does not need to confirm. To opt out, the user can say so explicitly (e.g., "stop auto-watch", "manual mode this round") and the skill terminates the background process and falls through to the wait-for-user path. Launch the platform-appropriate watcher script immediately after emitting the prompt, using positional arguments `(FILE_GLOB, ROUND_NUMBER, EXPECTED_REVIEWERS)`. Look up `auto-watch.{sh,ps1}` through the same three roots as the Auto-terminal scripts. `FILE_GLOB` is the reviewer's exact `Review-.md` and `EXPECTED_REVIEWERS` its normalized name (e.g., `Codex`). A multi-reviewer round launches one watcher per reviewer, each with its own state directory, never one watcher over `Review-*.md`. Run the watcher in the background so the skill can keep accepting user input while it polls. On the Auto-terminal path, set `IMPLEMENT_REVIEW_STATE_DIR` to the absolute path from the dispatcher's `STATE-DIR` line when launching the watcher. That hands the directory over instead of leaving the watcher to find it. When the watcher emits `DONE `, resume Phase 2 immediately for a single-reviewer round. In a multi-reviewer round, that reviewer is ready for intake; begin consolidation only after every reviewer has a ready report or a confirmed failure. The watcher's path output is informational; Phase 2 still re-lists `Review-*.md` itself and applies the freshness + scope partition described below. A reviewer whose watcher ends without a report is handled by Phase 2's missing-reviewer steps once every other reviewer is resolved. When the watcher emits `AUTO-REDISPATCH ...`, the bounded retry has started; keep watching the same logical dispatch and state directory. No user action is required. When the watcher emits `STALL `, surface the silence warning and inspect or continue monitoring the dispatch (round checklist, step 6). When the watcher emits `TIMEOUT`, print `Auto-watch timed out after 60 min; reply 'done' when the reviewer finishes.` and wait for the user; an opt-out, a user interrupt, or a failed watcher launch fall through to the same wait-for-user path, and no Phase 2 logic depends on whether auto-watch ran. A watcher `REAP-UNKNOWN` is resolved in the foreground as round checklist, step 6, says. Recovery after `TIMEOUT` and the watcher's `STREAM-DEAD` line are in [references/failover-and-recovery.md](references/failover-and-recovery.md). **When the harness reports the dispatch or the watcher as stopped** (a background-task notification carrying `killed`, whose summary reads `Background command "..." was stopped`): handled by round checklist, step 6. `await-review` replaces the watcher for the rest of that round. **What counts as a death** is set by round checklist, step 6. A reviewer can publish twice in one round and the second write is the one worth having, so a review under the wrong round marker is no evidence that the round ended. ## Phase 2: Intake Feedback ### Phase 2.0: Health check (Auto-terminal only) The Auto-terminal channel runs 10 structural health checks and 3 Substance heuristics on each reviewer's review file; Terminal-relay skips them. Run them once per reviewer, with that reviewer's state directory (from its dispatcher's `STATE-DIR ` line) and exact review file, using the command in round checklist, step 7. [references/health-check.md](references/health-check.md) holds the check table, the Substance heuristics, and false-positive tuning; open it when `health-check` prints any `FAIL`, or a `WARN` marker you do not recognize. **Outcomes**: round checklist, step 7, decides each outcome (advance with no inspection, inspect a `WARN`, or refuse on a `FAIL` while the other slots stay active), and step 8 lists the conditions for advancing with no inspection. **Required dispatch state contract**: Missing or stale `/pre-mtime` or `/timestamp` is `FAIL`, because Health check 2 and the time-floor heuristic cannot be trusted without them. A missing `/tail` and a missing review file are covered in round checklist, step 7. **Exit codes**: `health-check` exit codes are in round checklist, step 7. `stall-watch` exits 0 whatever it detected, and a `REVIEW-READY` from `await-review.py` says nothing about Checks 4 to 10, which that review can still fail. #### Phase 1d coordination (Auto-terminal-specific silent-intake rule) For Terminal-relay, auto-watch `DONE` is sufficient signal to advance that reviewer into intake. For Auto-terminal, check the nine conditions of round checklist, step 8, for each reviewer on its own evidence (its `DONE` line, dispatcher exit, health-check output, and state directory). `STREAM-DEAD` is an Auto-terminal runtime failure handled by Phase 1c failover ([references/failover-and-recovery.md](references/failover-and-recovery.md)). ### Phase 2.1: Partition and classify (all channels) When every expected reviewer has a ready report or a confirmed failure, or the user says the reviewers are done, list the files matching `Review-*.md` at the repo root and partition them along two axes before trusting any of them; round checklist, step 8, says which to read, what to report, and when to ask. **Freshness axis**: **current-round** (first line is `` with N the current round number), **stale-round** (a different round marker), **empty**, or **unreadable** (cannot be read, or has a malformed or missing round marker). **Scope axis** (if the expected reviewer set from Phase 1c is known): **expected** (the reviewer name extracted from the filename is in the expected set) or **unexpected** (the name is not in the set, possibly a leftover artifact from an earlier task that happens to share the round number). A current-round unexpected file may be a leftover from another task or a reviewer the user invoked without announcing. A corroborating signal is, for example, that its scope matches the current staged files or that the reviewer was named in the conversation; an mtime clearly older than the Phase 1c emission time weakly suggests a prior-task artifact. For an expected reviewer that is missing from the current-round, expected bucket (absent, or its file stale, empty, unreadable, or unexpected) and whose dispatch is neither active nor confirmed failed, build the follow-up prompt from the save contract that opens the Terminal path template in Phase 1c, with the current round number, and name the reviewer so the user knows where to paste it. Classify and categorize the findings by round checklist, step 9, labelling a Single-source finding with its file (for example "from Review-Codex.md"). Will fix typically covers a main-path bug, a wrong fact or unsupported claim, a step a reader cannot follow, a risk to user data, a departure from the quoted request the summary does not name, or an added guard that neither the request nor an observed failure calls for. A named departure the user has not approved goes to Needs discussion. Decline a request to add a guard for a failure nobody has seen or reproduced, such as a corner case that needs two failures at once, a hand-edited internal file, or an unusual environment. Verify factual claims first (round checklist, step 10); a Refuted finding is not applied whatever its category. For follow-up questions within the same review round, prepare a short prompt the user can paste into the reviewer. ## Phase 2.5: Verify Factual Claims (when triggered) After Phase 2 categorization and before applying the categorized list, verify the findings the trigger below selects (round checklist, step 10), so a wrong finding is not applied and a refutation leaves an evidence trail. [references/health-check.md](references/health-check.md) lists a method per claim type, with an example; open it when a claim needs one. ### Trigger Round checklist, step 10, states when verification fires and when it is skipped. A checkable claim is, for example, citation existence, code behavior, link reachability, a page-limit or word-count assertion, a compile or type error, or an anonymization leak. Stylistic, opinion-based, and structural findings (term choice, paragraph order, tone, organization) have no factual ground truth to verify against. The embedded-diff retry procedure is in [references/codex-backend.md](references/codex-backend.md). **Why Medium-from-retry-channel is mandatory-verify**: the retry sees only the diff hunks, so a claim of the form "X is missing" can be wrong when X sits in a non-diff line. One dogfooding case: a Medium claim that a regex set was case-sensitive was Refuted because the scanner applied `re.IGNORECASE` at compile time in a non-diff line. ### Outcome Record Verified, Refuted, or Inconclusive for each verified claim and act on it as round checklist, step 10, says. Refuted also covers an issue that does not reproduce, and Inconclusive a verification that could not run (no internet, no test runner, a claim under-specified) or returned ambiguous results. ### Round history integration Findings flagged Refuted or Inconclusive enter the next round's `Prior findings` block (see Phase 1b item 8) so the reviewer sees the evidence and can either retract the claim or sharpen it. Refuted findings appear as `(Refuted in round N — )`. Inconclusive findings appear as `(Inconclusive in round N — )`, prompting the reviewer to supply a more specific or pre-verified check. ## Phase 3: Revise Apply the fixes, update the round history, stage, and start the next round as round checklist, step 11, says. This history carries forward into the next round's prompt (Phase 1b, item 8). ## Phase 4: Conclude Stop when rule B of the round checklist says to, and present the summary it names. ## When Not To Use - Trivial changes where review adds no value (typo fixes, config tweaks). - Changes that require running tests or builds to validate -- run those first, then review. - When the user wants a single-shot review with no revision loop; just ask a reviewer directly.