[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75C08CZA02HRPRJ1TFJSS9H":3,"skill-same:01M75C08CZA02HRPRJ1TFJSS9H":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":45},"01M75C08CZA02HRPRJ1TFJSS9H","review-code",null,"Use when reviewing code changes on a local branch or an open pull request before merging — including when you want the review's findings auto-fixed locally. Gives a multi-specialist review with a fix-and-re-review loop. Not a whole-repo debt sweep (that is guardian).","zwrose\u002Fsuperheroes","zwrose","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4790575?v=4","01M75BY6XGBZAMPTCT9R25XXC6","Zach Rose","01M75BY6Y519H0CAD79EFWSW3N",1,"MIT","https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: review-code\ndescription: Use when reviewing code changes on a local branch or an open pull request before merging — including when you want the review's findings auto-fixed locally. Gives a multi-specialist review with a fix-and-re-review loop. Not a whole-repo debt sweep (that is guardian).\nuser-invocable: true\n---\n\nThis skill speaks in host-neutral actions. Resolve them to your runtime's tools by reading the host tool map at `${CLAUDE_PLUGIN_ROOT}\u002Fhosts\u002F\u003Cyour-host>-tools.md` (the leading variable is this plugin's root directory) — `claude-tools.md` on Claude Code, `codex-tools.md` on Codex.\n\n# Review Code\n\nRun a multi-dimensional code review on either an open pull request or a local branch (vs the default branch), then **autonomously fix what it finds**. The main context is an **orchestrator** — it fetches metadata, dispatches the panel's specialist agents in parallel, compiles their findings, triages each into auto-fixable vs needs-your-judgment, applies the fixes itself, and re-reviews — looping until a round leaves nothing blocking; a session stops at the first such round, and at 4 rounds at most it hands back with what is still open. Subagents do all heavy reading and write structured results to disk; it never loads the full diff or any agent's raw output into its own conversation.\n\nThe skill auto-detects whether you're reviewing a PR or a local branch, always dispatches the panel the seat map composes from the lane call (the code reviewer and the test role on every change; the security and premortem reviewers when a risk area is touched or risk is unclear) so coverage follows the change's risk (a change over the countable-lines bar is reviewed in [slices](..\u002F..\u002Frubric\u002Fglossary.md#slice), with one [seams check](..\u002F..\u002Frubric\u002Fglossary.md#seams-check); the details are in `reference\u002Fround-driver.md`), enforces the severity and verification rules in the base rubric at compile time (not just by hope), and — drives an auto-fix loop that commits fixes locally (never pushes).\n\nThere is one path: the auto-fix loop — review → triage → fix → re-review, committing locally until clean or halted. It runs on the project's own PR or branch and needs a verify command.\n\nThe specialist agents a panel may seat are bundled plugin agents (`architecture-reviewer`, `code-reviewer`, `security-reviewer`, `test-role`, `premortem-reviewer`); the orchestrator dispatches each reviewer by name (resolve dispatch via the host tool map). Each agent's review methodology lives in its own system prompt; the orchestrator's dispatch passes it the base rubric (severity\u002Fverification\u002Fformat), the project calibration (`core.md` for threat model + canonical patterns, `review-crew.md` layer for scope\u002Ffocus\u002Fconventions), `CLAUDE.md`, the diff, and the findings output path. Every finding they emit must cite a `file:line`, and a finding on the change targets a `+`\u002F`-` line in the diff — a finding on a context line or unchanged code is not compiled into the review; it goes to the record's \"Outside this PR\" list (at most 3 outside findings per reviewer, per the base rubric's diff-scope rule). Each specialist runs once per round; the orchestrator never re-runs a specialist or chains a second **finder** pass within a round, because a finder that has exhausted the real issues starts fabricating (base rubric, \"In-pass Chain-of-Verification & single-pass discipline\"). It does run a fail-closed **per-finding verification** pass over the *already-emitted* findings at compile time — 3-state CONFIRMED\u002FPLAUSIBLE\u002FREFUTED verdicts with quoted evidence that never searches for new issues, distinct from re-running a finder (see `## Compile + Dedupe`). The loop re-reviews from scratch each round on a fresh diff, which is different from re-running a specialist on its own output.\n\n## Invocation\n\n| Form                                       | Behavior                                                                                                                                                              |\n| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `\u002Fsuperheroes:review-code`                 | **Auto-fix loop (default).** Review → triage → fix → re-review until the loop ends converged, or hands back at the cap or earlier with what is still open. Commits locally; never pushes. |\n| `\u002Fsuperheroes:review-code branch` \u002F `pr \u003CN>` | Force branch or PR mode; runs the auto-fix loop.                                                                |\n| `\u002Fsuperheroes:review-code --focus \u003Cnotes>` | Pass focus notes to every finder order that carries them: the panel specialists and a returning round's scoped finder. A round that emits any other order while notes are set records `focusNotesNotCarried` and the receipt's `degraded` list says which seats did not see them. Combinable with any form. |\n| `\u002Fsuperheroes:review-code --result-file \u003Cpath>` | Write the terminal decision (`action`, `round`, `reason`) to `\u003Cpath>` as JSON on **every** terminal exit (`converged` writes `exit_clean`; `handed-back`, `halted`, `cannot-certify` and `uncertified-manual` write `halt`), for a programmatic caller (e.g. Workhorse step 2). Combinable with any form; absent → no file written (backward-compatible). |\n\n**Auto-detection rule.** Run `gh pr list --head \"$(git rev-parse --abbrev-ref HEAD)\" --json number,headRefOid,headRefName --limit 1`. If the result is non-empty, default to PR mode. Otherwise default to branch mode. If the user passed `branch` explicitly, skip the lookup. If the user passed `pr \u003CN>` explicitly, use `\u003CN>` and don't auto-detect.\n\n**Two flags were removed and are not flags:** `--review-only` (one review pass, then a written presentation) and `--post` (posted a review pass to GitHub), because code review runs only as its one review-and-fix loop. Run this block first on every invocation, before Setup, with `REVIEW_CODE_ARGS` set to the invocation's arguments. The block reads the arguments with their quoting kept, so a word inside the value of `--focus` or `--result-file` is never read as a flag. It prints nothing and exits 0 unless a removed flag is passed as an argument of its own; when it exits non-zero, stop: do nothing else, do not start the loop.\n\n```bash\nARG=$(python3 -B -c '\nimport shlex, sys\ntext = sys.argv[1]\ntry:\n    words = shlex.split(text)\nexcept ValueError:\n    words = text.split()  # unbalanced quote: plain whitespace split, still skipping the word after --focus or --result-file\nskip = False\nfor word in words:\n    if skip:\n        skip = False\n    elif word in (\"--focus\", \"--result-file\"):\n        skip = True\n    elif word in (\"--review-only\", \"--post\"):\n        print(word)\n        break\n' \"${REVIEW_CODE_ARGS:-}\")\nif [ -n \"$ARG\" ]; then\n  echo \"review-code: $ARG was removed. Code review runs only as its one review-and-fix loop, so nothing ran. Run \u002Fsuperheroes:review-code without $ARG.\"\n  exit 1\nfi\n```\n\nOpen no `AskUserQuestion` on any review-code path, for any purpose.\n\n## Session Directory\n\nAll review artifacts live in a per-invocation temp directory so parallel reviews don't collide:\n\n```bash\nSESSION_DIR=$(mktemp -d \u002Ftmp\u002Freview-XXXXXXXX)\n```\n\nFiles written during the review. **Per-round artifacts live under `$SESSION_DIR\u002Fround-\u003CN>\u002F`** in the auto-fix loop (round 1, 2, …). Only `meta.json` lives at the session-dir root.\n\nThe full artifact table — every path, the component that writes it, and its purpose — is in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fsetup.md` § Session artifacts.\n\n**CRITICAL:** The main context only ever runs `wc -l \u003C $SESSION_DIR\u002Fround-\u003CN>\u002Fdiff.txt` to size the diff. It never `cat`s the diff, never reads the full thing, never echoes it back. Subagents read the diff from disk and write structured findings; the orchestrator reads the findings JSON, not the diff.\n\n## Workflow\n\n### 1. Setup\n\nRun the removed-flags block from `## Invocation` first. Then decide mode (auto-detected or explicit, per `## Invocation`). Create the session directory.\n\n**Resolve the run's inputs before dispatching anything.** In order: the base rubric path, repo root, the calibration paths, the plugin and rubric versions, the model tiers, the per-role engine, then the staleness self-check, the profile bootstrap, the verify story, and the post-bootstrap refresh of the dispatch paths. The exact commands, the variable each one sets, and the tier→model dispatch mapping are in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fsetup.md` § Setup resolution — read it and run the blocks in the order given.\n\nEverything below depends on the variables that file sets: `$ROOT_DIR`, `$RUBRIC`, `$REPO_ROOT`, `$CORE`, `$LAYER`, `$PROFILE`, `$LOCATION`, `$EXISTS`, `$DECISIONS`, `$PLUGIN_VERSION`, `$RUBRIC_VERSION`, `$REVIEWER_MODEL`, `$DEEP_MODEL`, `$MECH_MODEL`, `$SYNTH_MODEL`, `$VERIFIER_MODEL`, `$EP`, `$REVIEWER_ENGINE`, `$IMPL_ENGINE`, `$CONFIGURED`, `$DOCTOR_JSON`, `$VERIFY_JSON`, `$VERIFY_CMD`, `$BREAK_IT_ARGS`, `$REFUSAL`, and `$SEAT_MAP` and `$AUTHOR_FAMILY`, which the seat-map compose step sets right after the base pin. A step below that reads one of these without that file having been run is a bug in the step; the shell default that does appear (`${VERIFY_CMD:-none}`) is a deliberate value fallback, not a licence to skip the setup file.\n\n**PR mode:**\n\n```bash\n# Resolve PR number — either provided or auto-detected from current branch\nBRANCH=$(git rev-parse --abbrev-ref HEAD); MODE=pr\nif [ -z \"$PR_NUMBER\" ]; then\n  PR_NUMBER=$(gh pr list --head \"$BRANCH\" --json number --jq '.[0].number')\nfi\n\n# Metadata: small JSON only — do NOT load the diff yet\ngh pr view \"$PR_NUMBER\" --json number,title,author,headRefName,headRefOid,baseRefName,url,body > \"$SESSION_DIR\u002Fpr.json\"\nHEAD_SHA=$(jq -r .headRefOid \"$SESSION_DIR\u002Fpr.json\")\nPR_BRANCH=$(jq -r .headRefName \"$SESSION_DIR\u002Fpr.json\")\nBASE_BRANCH=$(jq -r .baseRefName \"$SESSION_DIR\u002Fpr.json\")   # PR base branch NAME — pinned to a remote commit below\nREPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)\n\n# Prior review comments — used for author-justification handling\ngh api \"repos\u002F$REPO\u002Fpulls\u002F$PR_NUMBER\u002Fcomments\" \\\n  --jq '[.[] | {id, in_reply_to_id, path, line, position, body, user: .user.login}]' \\\n  > \"$SESSION_DIR\u002Fprior-comments.json\"\n```\n\n**Auto-fix branch guard (PR mode, default loop only).** Before entering the loop, the orchestrator must be in one of two accepted states so fix commits land where they belong: **standing on the PR's branch** (name match only — **no** `HEAD` freshness check, so a behind checkout still passes), or **an adopted build** (invoke `review-code pr \u003CN>` — auto-detection matches `--head` by branch name, so a renamed local branch never reaches this guard on a bare invocation) tracking remote `origin` with merge ref `refs\u002Fheads\u002F\u003CPR branch>` (read from `branch.\u003Cname>.remote` \u002F `branch.\u003Cname>.merge`, not `@{upstream}` — spoofable by a local-tracking ref) and `HEAD` exactly `$HEAD_SHA`. The fenced block below is extracted by `plugins\u002Fsuperheroes\u002Flib\u002Ftests\u002Ftest_review_code_branch_guard.py` (first `bash` fence after this paragraph). Adopted path only: the config leg proves tracking **`origin`'s** branch of that name with `HEAD` at the PR head — assuming the PR head lives in `origin`; a fork PR whose head name collides with an `origin` branch is not distinguished. The SHA leg refuses a stale adopted copy and does **not** apply to the name path.\n\n```bash\nCURRENT_BRANCH=$(git symbolic-ref --quiet HEAD); case \"$CURRENT_BRANCH\" in refs\u002Fheads\u002F?*) CURRENT_BRANCH=${CURRENT_BRANCH#refs\u002Fheads\u002F};; *) CURRENT_BRANCH=;; esac\nLOCAL_HEAD=$(git rev-parse HEAD); TRACK_REMOTE=$(git config --get \"branch.$CURRENT_BRANCH.remote\"); TRACK_MERGE=$(git config --get \"branch.$CURRENT_BRANCH.merge\")\ncase \"$PR_BRANCH\" in \"\"|null) echo \"Auto-fix: pr.json has no head branch — refusing (fail closed).\"; exit 1;; esac\ncase \"$HEAD_SHA\"   in \"\"|null) echo \"Auto-fix: pr.json has no head SHA — refusing (fail closed).\"; exit 1;; esac\nif [ \"$CURRENT_BRANCH\" != \"$PR_BRANCH\" ] && ! { [ -n \"$CURRENT_BRANCH\" ] && [ \"$TRACK_REMOTE\" = origin ] && [ \"$TRACK_MERGE\" = \"refs\u002Fheads\u002F$PR_BRANCH\" ] && [ \"$LOCAL_HEAD\" = \"$HEAD_SHA\" ]; }; then\n  echo \"Code review runs only on this project's own PR, from the PR's branch '$PR_BRANCH' (currently on '${CURRENT_BRANCH:-\u003Cdetached HEAD>}'). An ADOPTED build also qualifies, but only when ALL hold: this branch tracks remote 'origin' (found '${TRACK_REMOTE:-none}') and merge ref 'refs\u002Fheads\u002F$PR_BRANCH' (found '${TRACK_MERGE:-none}'), AND HEAD is the PR head '$HEAD_SHA' (found '$LOCAL_HEAD').\"\n  echo \"If this is your PR, check out its branch and run again. Reviewing a PR that was not built in this project is not supported.\"; exit 1\nfi\n```\n\nIf the guard fails (detached HEAD, an unrelated branch, or you're reviewing someone else's PR), STOP — do not enter the loop. Tell the user plainly that reviewing a PR not built in this project is not supported, and offer no other way to review it. A **stale** adopted branch — right tracking config, wrong `HEAD` — refuses; the name path has no freshness check. Missing `pr.json` metadata (`$PR_BRANCH` or `$HEAD_SHA` empty or `null`) refuses fail-closed. The auto-fix loop **never pushes**; an adopted build must push its fix commits itself with an explicit refspec — `git push origin HEAD:$PR_BRANCH` — because a bare `git push` from an adopted branch fails under git's default `push.default=simple` when the local branch name differs from its upstream (`fatal: The upstream branch of your current branch does not match the name of your current branch.`).\n\n**Branch mode:**\n\n```bash\nBRANCH=$(git rev-parse --abbrev-ref HEAD); MODE=branch\nHEAD_SHA=$(git rev-parse HEAD)\nBASE_BRANCH=$(git symbolic-ref --quiet refs\u002Fremotes\u002Forigin\u002FHEAD 2>\u002Fdev\u002Fnull | sed 's@^refs\u002Fremotes\u002Forigin\u002F@@'); BASE_BRANCH=${BASE_BRANCH:-main}   # branch mode: default branch NAME; the pipeline exits 0 even when symbolic-ref fails, so `|| echo main` inside it would be DEAD\nREPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner 2>\u002Fdev\u002Fnull || echo \"local\")\n\n# No worktree, no prior comments — subagents verify against the current working tree\n```\n\n**Resolve the diff base to a PINNED REMOTE commit — BOTH MODES, ONCE, at session setup.** This block runs in PR mode and branch mode alike (it is not part of the branch-mode snippet above); PR mode sets `$BASE_BRANCH` from `baseRefName`, branch mode from `origin\u002FHEAD`, and from here the two are identical. `$BASE_BRANCH` is only a branch *name*, and a worktree's local copy of that branch goes stale as a matter of course in multi-agent setups: three-dot diff walks back to `merge-base($BASE_BRANCH, HEAD)`, so a stale local base drags everyone else's already-merged work into the review as if this branch added it (#637 — observed live: ~6,600 contaminated lines against 2,931 real ones). Fetch through a **fully qualified refspec** (never the DWIM short name — a local branch or tag called `origin\u002F\u003Cbase>` would shadow it, and a nonstandard remote refspec can leave the fresh object only at `FETCH_HEAD`) and **pin the result to an immutable commit**. Run this block **exactly once per session**, never per round: remote-tracking refs are shared by every worktree of the repo, so re-running it mid-session would re-pin to whatever another agent has since pushed — the very drift the pin exists to prevent. In the fetch refspec, `${BASE_BRANCH}` is braced deliberately because an unbraced `$VAR` immediately before `:` is read by zsh as a history-style modifier (`:r`), which silently corrupts the refspec so fetch fails and the pin falls back to a stale remote-tracking ref—the same #637 class this block exists to prevent.\n\n```bash\nBASE_FETCH=fetched; git fetch --quiet origin \"+refs\u002Fheads\u002F${BASE_BRANCH}:refs\u002Fremotes\u002Forigin\u002F${BASE_BRANCH}\" \\\n  || BASE_FETCH=\"fetch-failed ($(git remote get-url origin >\u002Fdev\u002Fnull 2>&1 && echo 'origin configured; fetch failed — unreachable, auth, or base branch absent on the remote' || echo 'no origin remote')); local-vs-last-fetched base divergence behind\u002Fahead $(git rev-list --left-right --count \"$BASE_BRANCH...refs\u002Fremotes\u002Forigin\u002F$BASE_BRANCH\" 2>\u002Fdev\u002Fnull | tr '\\t' '\u002F' | grep . || echo unknown)\"\nBASE_REF=$(git rev-parse --verify --quiet \"refs\u002Fremotes\u002Forigin\u002F$BASE_BRANCH^{commit}\") \\\n  || { BASE_REF=$(git rev-parse --verify --quiet \"$BASE_BRANCH^{commit}\"); BASE_FETCH=\"$BASE_FETCH; no-remote-ref — diffing the LOCAL base\"; }\nBASE_REF=$(git rev-parse --verify --quiet \"$BASE_REF^{commit}\") || { echo \"review-code: base '${BASE_BRANCH:-\u003Cempty>}' did not resolve to a commit (BASE_FETCH=${BASE_FETCH}) — refusing to review (#637)\" >&2; exit 1; }\nprintf '%s' \"$BASE_REF\" | grep -Eq '^([0-9a-f]{40}|[0-9a-f]{64})$' && VERIFY_CMD=\"${VERIFY_CMD\u002F\u002F\\{baseRef\\}\u002F$BASE_REF}\"   # bind the verify command's {baseRef} token (§ The verify command)\n```\n\n**Compose the panel seat map — right after the base is pinned.** Run the compose block in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fsetup.md` § Compose the panel seat map now, from here, once `$BASE_REF` and `$HEAD_SHA` are both set: the roster follows the lane call over the change between `$BASE_REF` and the head the review diff reads (the block derives it: local HEAD on every path), and the seat pins come from core.md, which compose reads itself. It sets `$SEAT_MAP` and `$AUTHOR_FAMILY`.\n\n**The base must RESOLVE TO A COMMIT — validated once at Setup, and every consumer uses the guarded command.** This is the only validation, and it is deliberately not a non-emptiness test: `$BASE_REF` reaching `git diff` as an empty string makes argv `...HEAD`, which git reads as `HEAD...HEAD` — a **zero-line diff at exit 0** the loop would certify clean — and reaching it as the literal string `null` (what `jq -r` prints for an absent key) passes any `[ -n … ]` check while `git diff null...HEAD` exits 128 and *still* leaves an empty `diff.txt`. `git rev-parse --verify --quiet \"$BASE_REF^{commit}\"` rejects both, plus a deleted branch and a non-commit tag. **Every** producer of `$BASE_REF` — the fetch\u002Fpin above, the local fallback, the `meta.json` restore below — routes through it; never add a second, weaker guard beside it, and never let a caller \"recover\" by substituting a branch name. On every auto-fix `next`, `round_driver.py` independently re-checks in code that the base is a *pinned commit id* and that the pin has not moved mid-session, refusing with `base-not-pinned`, `base-unresolved`, or `base-pin-moved` if not (see `reference\u002Fround-driver.md` § Base guard).\n\n**Never diff a stale base silently.** Any `$BASE_FETCH` other than `fetched` is a **degradation** — name it in the dispatch summary, and record it in `meta.json`. Both modes assume `origin` is the base branch's repository; in PR mode the driver now refuses a fork whose PR base repository differs from `origin` with `base-repo-mismatch` (full fork *support* — resolving or fetching the base by URL — is still deliberately not built).\n\n**A stacked PR's session reads the layer against the base commit it pinned.** When the PR's base is not the default branch, the session reads the layer against the base commit pinned at Setup for its whole run, and a move of the lower layer never stops it. The layer catches up at handback (`rubric\u002Fnative-stacks.md` § How a stack stays current), and its catch-up is reviewed as a returning PR (the returning-round paragraph of the Auto-Fix Loop Bootstrap step, which starts \"A fresh PR-mode session whose earlier record makes the returning-review decider\").\n\n**Per-round diff — every round, against the pin.** This is the ONLY command that runs per round. Do NOT use `gh pr diff` (rounds 2+ have local fix commits that are not on the remote), and do NOT re-run the setup block above. On fresh state the round-1 artifact passed to the driver is refused in code (`round-diff-unreadable`, `round-diff-empty`, `round-diff-malformed`, `round-diff-required`); rounds 2+ rely on the shell halt above.\n\n```bash\ngit diff --no-ext-diff --no-textconv --no-color -M -U3 --src-prefix=a\u002F --dst-prefix=b\u002F \"$BASE_REF\"...HEAD > \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt.tmp\" || { echo \"review-code: git diff against $BASE_REF FAILED — refusing to review the artifact it left behind (#637)\" >&2; exit 1; }\nmv \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt.tmp\" \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt\" || { echo \"review-code: git diff against $BASE_REF FAILED — refusing to review the artifact it left behind (#637)\" >&2; exit 1; }\n[ -s \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt\" ] || { echo \"review-code: round diff against $BASE_REF is EMPTY — an empty review surface is never certifiable-clean; halt and investigate (#637)\" >&2; exit 1; }\n```\n\nThe flags are the review diff's fixed shape (`REVIEW_DIFF_ARGS` in `lib\u002Freview_diff_bytes.py`), so a user's git settings (copy detection, context lines, prefixes, an external diff) never change what the loop reads. Each step halts on its own failure, and no delete rides a compound command (the delete rule, `DELETE_RULE` in `lib\u002Fcommand_refusals.py`, and the stop-and-delete rule, `STOP_AND_DELETE_RULE`, same home, bind these recipes): a `.tmp` file a failed step leaves is never read.\n\n**If `$BASE_REF` is not in scope** — a resumed or compacted orchestrator, or a fresh shell — restore the pin from the session record rather than re-deriving it: `BASE_REF=$(jq -r '.baseRef \u002F\u002F empty' \"$SESSION_DIR\u002Fmeta.json\")`, then **re-run the resolve-to-a-commit check from the setup block** (`BASE_REF=$(git rev-parse --verify --quiet \"$BASE_REF^{commit}\") || exit 1`) before any diff. Use `\u002F\u002F empty`, never a bare `.baseRef`: `jq -r` prints the literal string `null` for an absent key, which is non-empty and would sail past a naive check. Re-running the setup block instead would silently re-pin to a moved `origin\u002F\u003Cbase>`.\n\nThen write `meta.json` in both modes:\n\n```bash\n# The orchestrator sets FOCUS_JSON from the `--focus` argument (if any) before this block runs.\nFOCUS_ARG=$(printf '%s' \"${FOCUS_JSON:-}\" | jq -cs 'if length == 1 and ((.[0]|type) == \"object\" or (.[0]|type) == \"array\") then .[0] else empty end' 2>\u002Fdev\u002Fnull); [ -n \"$FOCUS_ARG\" ] || { [ -n \"${FOCUS_JSON:-}\" ] && FOCUS_ARG=$(printf '%s' \"$FOCUS_JSON\" | jq -Rs .) || FOCUS_ARG=null; }   # -s SLURPS, so the encoder can only ever emit ONE document: a lone JSON object\u002Farray rides through as JSON, and everything else (free text, a bare scalar, several documents, malformed JSON) becomes one JSON string via stdin — never a multi-document value --argjson would reject, and never a silently truncated note\nPR_ARG=$(printf '%s' \"${PR_NUMBER:-null}\" | jq -cs 'if length == 1 and (.[0]|type) == \"number\" then .[0] else null end' 2>\u002Fdev\u002Fnull); [ -n \"$PR_ARG\" ] || PR_ARG=null\nSTORAGE_MODE_ARG=$(printf '%s' \"${LOC:-}\" | jq -Rsc 'if type == \"string\" and length > 0 then . else null end' 2>\u002Fdev\u002Fnull); [ -n \"$STORAGE_MODE_ARG\" ] || STORAGE_MODE_ARG=null\nSTORAGE_SOURCE_ARG=$(printf '%s' \"${SOURCE:-}\" | jq -Rsc 'if type == \"string\" and length > 0 then . else null end' 2>\u002Fdev\u002Fnull); [ -n \"$STORAGE_SOURCE_ARG\" ] || STORAGE_SOURCE_ARG=null\nSTORAGE_PROVISIONAL_ARG=$(printf '%s' \"${PROVISIONAL:-}\" | jq -cs 'if length == 1 and .[0] == true then true elif length == 1 and .[0] == false then false else null end' 2>\u002Fdev\u002Fnull); [ -n \"$STORAGE_PROVISIONAL_ARG\" ] || STORAGE_PROVISIONAL_ARG=null\njq -n --arg mode \"$MODE\" --arg path loop --arg repo \"$REPO\" --arg branch \"$BRANCH\" \\\n  --arg headSha \"$HEAD_SHA\" --arg baseRef \"$BASE_REF\" --arg baseBranch \"$BASE_BRANCH\" --arg repoRoot \"$REPO_ROOT\" \\\n  --arg baseFetch \"$BASE_FETCH\" --arg sessionDir \"$SESSION_DIR\" --arg verify \"$VERIFY_CMD\" \\\n  --argjson pr \"$PR_ARG\" --argjson focusNotes \"$FOCUS_ARG\" \\\n  --argjson storageMode \"$STORAGE_MODE_ARG\" --argjson storageSource \"$STORAGE_SOURCE_ARG\" --argjson storageProvisional \"$STORAGE_PROVISIONAL_ARG\" \\\n  '{mode:$mode,path:$path,pr:$pr,repo:$repo,branch:$branch,headSha:$headSha,baseRef:$baseRef,baseBranch:$baseBranch,baseFetch:$baseFetch,repoRoot:$repoRoot,sessionDir:$sessionDir,verify:$verify,focusNotes:$focusNotes,storageMode:$storageMode,storageSource:$storageSource,storageProvisional:$storageProvisional}' \\\n  > \"$SESSION_DIR\u002Fmeta.json.tmp\" || { echo \"review-code: could not write meta.json — halting rather than continuing without the session record (#637)\" >&2; exit 1; }\nmv \"$SESSION_DIR\u002Fmeta.json.tmp\" \"$SESSION_DIR\u002Fmeta.json\" || { echo \"review-code: could not write meta.json — halting rather than continuing without the session record (#637)\" >&2; exit 1; }\n```\n\nThe `path` field is always `loop`. `post` was once a value and was removed with its mode — never re-add it; `review-only` was removed the same way. A resumed run carrying either has no flow left to continue. The `verify` field is the verify command string, so a cold-resumed orchestrator recovers the verify story. `storageMode`, `storageSource`, and `storageProvisional` record storage-bootstrap disclosure when bootstrap ran (`$LOC`, `$SOURCE`, `$PROVISIONAL`); when bootstrap did not run they are JSON `null` — not empty strings — so a reader can tell no storage decision was taken this run.\n\nSize the round-1 diff for the dispatch summary (after writing it to `round-1\u002Fdiff.txt` per the command above):\n\n```bash\nDIFF_LINES=$(wc -l \u003C \"$SESSION_DIR\u002Fround-1\u002Fdiff.txt\")\n```\n\n**CRITICAL:** The line count is the only thing the orchestrator needs to know about `diff.txt`'s contents — do not `cat`, `head`, `tail`, or otherwise read it from the main context.\n\n### 2. Dispatch Summary\n\nPrint this dispatch summary as a plain status message, then dispatch the specialists immediately (no approval gate):\n\n- **Skill:** `review-code`\n- **Mode:** PR or branch\n- **Target:** `PR #\u003CN> \"\u003Ctitle>\"` (PR mode) or `\u003Cbranch> vs \u003CbaseRef>` (branch mode) — `\u003CbaseRef>` is the **pinned base commit**; when `$BASE_FETCH` is not `fetched`, state that degradation here\n- **Repo:** `\u003Cowner>\u002F\u003Crepo>`\n- **Head SHA:** short hash\n- **Diff size:** `\u003CDIFF_LINES>` lines\n- **Verify:** `VERIFY_CMD` (the command string)\n- **Specialists to dispatch (round 1: the seat map's roster at `reviewer-deep`, in parallel; later rounds: obey `round_driver.py` `next` — delta audits + scoped finder only, never a panel):** A change over the countable-lines bar is reviewed in round 1 in [slices](..\u002F..\u002Frubric\u002Fglossary.md#slice), each with its own seats, plus one [seams check](..\u002F..\u002Frubric\u002Fglossary.md#seams-check); dispatch the seats `payload.dimensions` names and see `reference\u002Fround-driver.md` § Big changes for the rest.\n  - `code-reviewer` → `findings-code.json`\n  - `test-role` → `findings-test.json`\n  - `security-reviewer` → `findings-security.json` (when the roster seats it)\n  - `premortem-reviewer` → `findings-premortem.json` (when the roster seats it)\n  - `architecture-reviewer` → `findings-architecture.json` (only when a roster names it)\n- **Session directory:** `$SESSION_DIR` (round 1 artifacts under `round-1\u002F`)\n- **Focus notes:** the `--focus` argument, if any\n- **Path:** the auto-fix loop (`round_driver.py` next\u002Fsubmit until terminal)\n- **What happens after dispatch (default loop):** obey `next`\u002F`submit` — panel\u002Fverify\u002Fsynthesis → apply-fixes → verify gate → delta audits\u002Fscoped finder → terminal with certification + receipt. The build session applies the fixes itself at `apply-fixes`; no fixer agent or external engine writes a review fix.\n\nPer-round dispatch is **driver-owned** — round 1 is the full `reviewer-deep` baseline; rounds 2+ are **delta rounds** (fix audits + scoped finder), and no later round runs a panel; a changed surface the driver cannot work out hands the PR back. A review that needed fixes ends on a round's audit and scoped finder. When an audit finds a break-it test missing, changed without a reason or weakened, the driver first sets a restore-only `apply-fixes` step that puts the test role's version back, then offers the test role one correction of a weakened test; the weakened version is never kept. Obey `round_driver.py` `next`\u002F`submit`; never tier, skip, or exit by eye. Full contract: `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fround-driver.md`.\n\n### 3. Dispatch Specialists in Parallel\n\nOn every `next` whose `phase` starts with `dispatch-`, `round_driver.py` **emits** each roster seat's complete order before you dispatch anything: one markdown file per slot, an envelope stub carrying the full known header for the session's seat-result schema (`seat-result\u002F1` at state v2–v4; `seat-result\u002F2` at state v5, including `provenance: dispatch-observed`), and a manifest hashed into the session anchor. **Dispatch the emitted order text** — do not hand-compose prompts from templates. Per-seat engine\u002Fchannel mechanics (stdout vs file, `dispatch-review` runner) live in `reference\u002Fauto-fix-loop.md`; the prompt bodies live in `rubric\u002Forders\u002F\u003Cphase>.md` and are rendered into the session by the driver.\n\n**Where the files are (round `\u003CN>`, phase `\u003Cphase>`, attempt `\u003CK>`, storage key `\u003Cskey>` — the filename-safe key the manifest uses, not the bare reviewer name):**\n\n| Artifact | Path |\n| --- | --- |\n| Order (dispatch this) | `$SESSION_DIR\u002Fround-\u003CN>\u002Forders\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.md` |\n| Envelope stub (header fields the seat must copy verbatim) | `$SESSION_DIR\u002Fround-\u003CN>\u002Forders\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.envelope.json` |\n| Orders manifest (every slot's `orderPath`, `envelopeStubPath`, hashes) | `$SESSION_DIR\u002Fround-\u003CN>\u002Forders\u002F\u003Cphase>\u002Fmanifest.a\u003CK>.json` |\n| Landing — **engine** seat (`codex`\u002F`cursor`) | `$SESSION_DIR\u002Fround-\u003CN>\u002Flanding\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.json` — **orchestrator** writes the **full envelope** (stub header + payload; schema from state version) from the folded `dispatch-review` stdout result, copying the result's `readParts`, when it carries one, into the landed payload beside `findings`; the engine seat emits JSON on stdout only (read-only sandbox). At state v5, pass a completed `dispatch-review` run directory to `record-result --evidence-run-dir` so the driver can stamp `executionEvidence` and `envelopeSha256` before ingest. For a fix auditor's `ruling` result, the orchestrator may land the stub envelope with `payload: null`, and `record-result --evidence-run-dir` fills it from the runner's graded record. |\n| Landing — **host** seat (`claude` native subagent) | `$SESSION_DIR\u002Fround-\u003CN>\u002Flanding\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.payload.json` — write **only** the payload; the driver wraps with the emitted stub at ingest. At state v5 the ingested envelope is `seat-result\u002F2`; when execution evidence is stamped the bare-payload landing stays single-file and the stamped envelope is written to the durable store copy only. The driver seats a fix auditor on a runner-backed vendor (`codex`\u002F`cursor`) whenever one is live; on a durable-record session with none live, or when an independent-family vendor is live only as a host seat, `next` refuses `auditor-unseatable` rather than emit the audit order, and the remedy is a fresh session seeded with a runner vendor in `--vendors`, or hand `next`\u002F`submit` for the whole session. |\n\nNo seat is ever asked to transcribe an `orderSha256`, `manifestSha256`, or storage path — those ride in the stub the driver emitted. After landings exist, either **`record-result` (or `record-missing`) + `advance`**, or a hand **`submit`** — **mutually exclusive, per SESSION** (the first path used is the path the session keeps; see `reference\u002Fround-driver.md` § Durable-record path).\n\nFor the full `dispatch-review` argument surface, read `skills\u002Fworkhorse\u002Freference\u002Fdispatch-entry.md`.\nLaunch the round's scheduled specialists (round 1: the seat map's roster) **by channel** — see `reference\u002Fround-driver.md` § Batch concurrency. **Native-subagent** seats (a `claude` seat) go out as **parallel dispatches in one message**; the harness runs them concurrently and owns their lifecycle. **External-engine** seats (`codex`\u002F`cursor`, through `dispatch-review`) each get their own `--run-dir` (**the runner creates it** on first `dispatch-review`; a leaf `--run-dir` symlink is refused `run-dir-is-symlink`; keep `--progress-file` and result JSON **outside** the run dir or get `run-dir-not-empty-unopened`; continuation reuses the same dir), are launched with a short positive slice, then the originating verb is re-invoked on every non-terminal run in rotation until each is terminal — issuing those calls together in one message does not make them concurrent. Dispatch each seat through **its seat-map-assigned engine+model** (`$SEAT_MAP.seats[\u003Creviewer>]` → `.vendor`\u002F`.model`): a `claude` seat runs the named subagent at its tier model with the **order file contents** as the prompt; a `codex`\u002F`cursor` seat dispatches through `engine_dispatch.py dispatch-review` (read-only sandbox) with that seat's resolved `.model`. An unreadable or missing slot is the same `cannot-certify` signal: the orchestrator re-runs a forfeited panel seat on another live vendor from the seat map's `liveVendors` whose family is outside every maker family, recording which vendor ran it in its dispatch record (the driver does not reseat a panel seat), and when no such vendor is live the seat is recorded missing (`record-missing`) and counts as not run; it is never re-run on the host model when the host's family is a maker. A seat the seat map records as `unfilled` (`source: \"unfilled\"`, no vendor or model) is never dispatched and never re-run on the host model; it stays in the record as a planned reviewer that did not run. The same holds on the hand-submit path. On the hand path, submit the panel with `ranManifest: {\u003Cdim>: \u003Cvendor>}` built from your OWN dispatch records **and** the composed `$SEAT_MAP` JSON as `seatMap`. Per-seat dispatch detail: `reference\u002Fauto-fix-loop.md`.\n\n**Per-agent substitutions** (reviewer name → findings filename stem → dimension label):\n\n| reviewer | `\u003Cagent>` (findings filename) | `\u003Cdimension>` |\n| ---------------------------- | ----------------------------- | ------------- |\n| architecture-reviewer        | architecture                  | Architecture  |\n| code-reviewer                | code                          | Code          |\n| security-reviewer            | security                      | Security      |\n| test-role                    | test                          | Test          |\n| premortem-reviewer           | premortem                     | Failure-Mode  |\n\nAfter dispatch, wait for every roster agent to return. **Codex\u002Fcursor seats** run the native `dispatch-review` `--run-dir` + `--max-wait 540` continuation loop until terminal; **claude seats** are native subagents with their own lifecycle (the `await-dispatches` ruling's native-subagent exemption — the runner cannot dispatch them). The **hand-rolled engine fallback** (`auto-fix-loop.md`) does not follow that native shape and still owes the limitation disclosure when used. No native-shape limitation disclosure is owed for seats dispatched through the runner or as claude native subagents under this skill. This skill owns the **bounds** of its own dispatches; the builder's `await-dispatches` rule owns the **channel** for what the builder launches. Full contract: `reference\u002Fauto-fix-loop.md` (Settled dispatch contract).\nA file-channel seat's findings are read from `$SESSION_DIR\u002Fround-\u003Cround>\u002Ffindings-\u003Cagent>.json`; a stdout-channel seat's findings come from the terminal `dispatch-review` result, which the orchestrator folds. The orchestrator reads only those structured outputs, never agent transcripts.\n\n### 4. Compile + Dedupe (main context)\n\nCompile is driver-owned on the loop — obey `next`\u002F`submit` instead of reimplementing compile by hand. The numbered steps below are the compile contract the driver applies to the findings it collects from the file-channel seats at `$SESSION_DIR\u002Fround-\u003Cround>\u002Ffindings-*.json` and from the stdout-channel seats' folded `dispatch-review` results. In order:\n\n1. **Citation check.** Drop any finding with `file == null` or `line == null`.\n2. **Diff-scope verification.** Parse `$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt` for `+`\u002F`-` anchor lines (same hunk-walking as `diff_scope.py`). A finding outside the lines the PR touched is not dropped: it goes to the record's \"Outside this PR\" list with the reviewer that raised it, and is not compiled into the review. Then drop any finding that states no consequence: it is recorded as a compile drop with the reason `no stated consequence` and is not taken into the review.\n3. **Dedupe by `(file, line)`.** Merge same-anchor findings: higher severity wins, dimensions unioned, stable `file::normalized-title` identity, `tradeoff: true` if either input is. The absorbed duplicate is recorded as a compile drop with its merge reason.\n4. **Nit cap.** After dedupe, keep at most 5 Nits whose `consequenceKind` is `code-quality`; the overflow collapses to one summary entry and each collapsed Nit is recorded as `craft` at once. A Nit with a real consequence is never collapsed.\n5. **Per-finding verification + synthesis merge** (never the session model). Stage ids, cluster, dispatch one verifier per cluster (`model: $VERIFIER_MODEL`, reviewer engine; #230 immunity), apply `verification.apply_verdicts`, then one synthesis judge (`model: $SYNTH_MODEL`) groups root causes and `verification.merge_and_rank` merges under a coverage guarantee — synthesis drops nothing. Full contract: `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fverification-pass.md`.\n6. **Author-justification post-filter (PR mode only, after verification).** Cross-reference `prior-comments.json`. May drop **only** a finding whose verifier `verdict` is present and not **CONFIRMED**, recording the prior justification quoted. A **CONFIRMED** finding with a prior justification **survives**, stamped `challenge: \"author-justified\"` (ledger-visible). A finding with no verdict is never dropped here. Rules: `round-driver.md`.\n7. **PR-body honesty check (PR mode only).** From `pr.json`'s `body`, the review seat verifies the PR body carries a valid **DoD disposition table** (the `superheroes:dod-table` marker) against the issue\u002Fspec — one row per Definition-of-Done bullet, each `done` (with an evidence pointer) or `deferred` (with a filed issue `#NNN` and a one-line reason). Append an **Important** finding (cited at the PR body, `tradeoff: true`, author-resolved — it is a judgment call the author closes by writing the table, not a mechanical fix) when the table is missing, or a row's evidence or deferral is empty or hollow. A **missing** `\u003C!-- superheroes:build-record -->` boundary marker or a **missing** `\u003C!-- superheroes:degradations -->` section is the same finding shape — not a silent pass; an empty degradation list is only clean when that section says the literal **None** (absence and **None** differ). The seat also checks the owner half (above `\u003C!-- superheroes:build-record -->`) under `## What we're accepting` carries the **omission floor** (CONVENTIONS §10.7): enumerate (1) each deferred DoD row, (2) each blocking or important dispositions-table finding not fixed (by severity, not disposition label), and (3) each costly disclosed degradation under `\u003C!-- superheroes:degradations -->` (bullets, or **None** when empty) — each must have a matching consequence line in that section; same **Important** \u002F `tradeoff: true` \u002F author-resolved finding when one is missing. A bullet labelled [harmless] needs none; an unlabelled one reads costly. Branch mode has no PR body — skip. Contract: CONVENTIONS `§10.7`, `${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Freview-discipline.md`.\n\nDetermine the verdict per the base rubric's \"Verdict labels & mapping\" (count post-dedupe, post-synthesis findings). For `\u002Fsuperheroes:review-code` the labels are **READY FOR PR** \u002F **FIX BEFORE PR** \u002F **MAJOR FIXES NEEDED**:\n\n- 0 Critical, 0 Important → **READY FOR PR**\n- 0 Critical, 1+ Important → **FIX BEFORE PR**\n- 1+ Critical → **MAJOR FIXES NEEDED**\n- Only Minor and\u002For Nit → **READY FOR PR** (Minor\u002FNit are informational)\n\nA finding's outcome is settled when the loop ends, by its consequence and never its severity: a code-quality-only finding is a craft call, and a [leftover](${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Fglossary.md#leftover) comes to the owner unless an on-record decision settles it. Where this is written and read is in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Freview-record.md`.\n\nWrite the result to `$SESSION_DIR\u002Fround-\u003Cround>\u002Fcompiled.json` (preserve each finding's `tradeoff` field through dedupe so triage can read it):\n\n```json\n{\n  \"summary\": \"\u003C1-2 sentence overall summary>\",\n  \"verdict\": \"READY FOR PR\" | \"FIX BEFORE PR\" | \"MAJOR FIXES NEEDED\",\n  \"findings\": [\u003Cverified survivors, each stamped verdict: \"CONFIRMED\"|\"PLAUSIBLE\">],\n  \"drops\": [\u003Cverification REFUTED drops: {id, file, title, reason, was_blocking_tagged}>],\n  \"downgrades\": [\u003Cblocking→non-blocking re-tiers: {id, file, title, from, to, reason?}>],\n  \"unmatched\": [\u003Cverifier verdict ids that matched NO finding — the id-transport fidelity signal>],\n  \"unverified\": [\u003Cfinding ids that got no verdict this round — verifier silence; they survive PLAUSIBLE>],\n  \"ambiguous\": [\u003Cfinding ids carried by >1 verdict — honored as none (keep-on-uncertain), disclosed not silently dropped>]\n}\n```\n\nOrder findings: Critical → Important → Minor → Nit, then by file path, then by line.\n\n## Auto-Fix Loop (default path)\n\nThe loop is the only path. It is **driver-owned**: every per-round step is a `round_driver.py` call, `python3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py next --session-dir \u003Csession dir>` or `python3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py submit --session-dir \u003Csession dir>` (plus the fold flags shown below) — the old `code_loop_plan` plan\u002Frecord\u002Fdecide, the manual `circuit_breaker.py` call, and the head-diff step all collapse into obeying `next`. Full contract: `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fround-driver.md`.\n\n**Call form.** Call `round_driver.py`, `break_it.py`, `review_store.py`, `mode_reconcile.py`, `calibration_resolve.py`, `size_count.py`, `order_lint.py` and `dispatch_guard.py` as one plain line, `python3 -B \u003Cplugin root>\u002Flib\u002F\u003Cscript>.py \u003Cverb> \u003Cargs>`, with the resolved plugin root (the session bootstrap prints it as \"Plugin root (absolute)\") and the literal session folder written out. Substitute the real paths; never set shell variables that feed these calls (`ROOT_DIR=…`, `SESSION_DIR=…`) or continue the call over lines (assignments that only parse a call's printed output, as in `reference\u002Fsetup.md`, are not covered). The plugin's approval hook approves only that one form and sends every other form to the normal permission check.\n\n**If context was compacted mid-loop**, re-read `$SESSION_DIR\u002Fmeta.json`, `$SESSION_DIR\u002Floop-state.json`, and `$SESSION_DIR\u002Fdriver-journal.jsonl`. Resume by calling `next` — a pending step is returned again idempotently.\n\nAn unfinished session of generation 6 at state version 5 is continued: it finishes under the round cap it recorded at its start, and one waiting at a retired gate hands back. When any driver command answers `session-from-earlier-version`, the session is of generation 5 or older, or of generation 6 at an older state version, and is not continued: it restarts in a fresh session. The current generation is 7. Run Setup again into a fresh `$SESSION_DIR` and start the loop from Bootstrap there. In PR mode, Setup reads the PR's head from the remote, so the fix commits the interrupted loop made must be pushed to the PR branch under this skill's existing push rule (an adopted build with its explicit refspec) before Setup runs again; until they are, a stale adopted head is refused by Setup's own guard rather than reviewed. A branch-mode review has no PR and restarts from its local head, with nothing to push. Do this once, leave the old directory as it is, and do not stop or report the review as failed; the rest is in `reference\u002Fround-driver.md` § Transition — plugin versions under a live session.\n\n**Bootstrap.** `mkdir -p $SESSION_DIR\u002Fround-1`. Regenerate the diff **with the guarded per-round command from Setup** — the same `git diff \"$BASE_REF\"...HEAD` plus its failed-diff and empty-diff halts, never a bare copy; if `$BASE_REF` is not in this shell, restore and re-validate it first (Setup, \"If `$BASE_REF` is not in scope\"). Size it with `wc -l` only. First `next` seeds state. Pass **`--vendors`** — the live reviewer vendors, either a JSON list (`[\"codex\",\"cursor\"]`) or a comma-separated string (`codex,cursor`) — so the driver can seat a **different** auditor vendor for each fix (independent audit). An unparseable value, an unknown vendor, or the flag on non-fresh state **fails loud** (nonzero exit + `{\"ok\": false, \"reason\": ...}`) — never a silent default. **Omitting `--vendors` degrades every run to the single vendor `[\"claude\"]`:** the audit still runs but independence is **lost** and every terminal is stamped `-degraded` (e.g. `audited-chain-degraded`) — reserve that only for an environment that genuinely has one usable vendor. In PR mode also pass **`--prior-comments`** (the author-justification post-filter reads it; ignored when the file is absent) and **`--earlier-findings`** (the PR's earlier findings, so synthesis can mark repeats; see `reference\u002Fsynthesis-pass.md` § Repeats; the same record lets a returning PR's round 1 read only what changed, below). Write `\u003Csession dir>\u002Fearlier-findings.json` first: run `python3 -B \u003Cplugin root>\u002Flib\u002Freview_record.py read --pr \u003CPR number>` as one plain line and save the JSON it prints, whatever its exit; a `review-record-missing` refusal means the PR has no earlier record:\n\nTake the vendors list from the seat map's `liveVendors`, sorted (family-aware; #510) — the pool the driver seats independent fix-auditors from — and fall back to the reviewer and implementation engines when the seat map is unreadable. Write the seat map to `\u003Csession dir>\u002Fseat-map.json` only when `$SEAT_MAP` is a non-empty JSON object, and append `--seat-map \u003Csession dir>\u002Fseat-map.json` to the line below only then. Append `--break-it-interpreter=\u003Cvalue>` only when calibration sets `breakItInterpreter` (Setup's `BREAK_IT_ARGS`), shell-quoting the value so it stays one argument (a multiword launcher is written `--break-it-interpreter='uv run python'`; an empty configured value is `--break-it-interpreter=''`). Append `--copy-proof \u003Cpath>` to this first `next` only when the caller supplies a copy proof. This first `next` carries `--verify-command`, so the hook leaves it to the normal permission check by design:\n\n```bash\npython3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py next --session-dir \u003Csession dir> --diff-path \u003Csession dir>\u002Fround-1\u002Fdiff.txt --verify-command '\u003Cverify command, or none>' --vendors '\u003Cvendors JSON list>' --prior-comments \u003Csession dir>\u002Fprior-comments.json --earlier-findings \u003Csession dir>\u002Fearlier-findings.json --max-rounds 4\n```\n\nA fresh PR-mode session whose earlier record makes the returning-review decider (`lib\u002Freturning_review.py`) answer `changed` runs round 1 as a **returning round**: no panel, the scoped finder over what changed since the last reviewed commit, and `returning` recorded on round 1; every other session runs round 1 as before, and `next` tells you which by its first action. Round 1 is otherwise the round that dispatches the panel, and without the seat map no round-1 seat's vendor resolves, so every seat falls back to the safe stdout contract and the orchestrator must land each payload itself; passing the map keeps native seats on the direct-write path and records real vendor provenance (#1035). `--seat-map` is passed only when `$SEAT_MAP` is non-empty and parses as a JSON object, so a genuinely empty\u002Funset `$SEAT_MAP` never gets written to a file and handed to the driver.\n\n**The loop.** Until `action` is `terminal`:\n\n1. Parse `next` JSON: `{action, round, phase, attempt, expectedStateHash, payload}`.\n2. **Dispatch exactly one action** (panel, verifiers, synthesis, seams-check, second-test, audits, scoped-finder, verify, or apply-fixes) — one **driver phase**; `run-verify` and `apply-fixes` are fulfilled by this session itself; when that phase is panel, verifiers, or audits, fan its members out per `reference\u002Fround-driver.md` § Batch concurrency — every other phase is fulfilled once. Round 1 = full `reviewer-deep` panel (a returning PR's round 1 is a scoped-finder round, no panel); rounds 2+ = delta rounds (fix audits + scoped finder), never a panel; an unknown fix surface hands the PR back (`fix-surface-unknown`). Degraded\u002Fsingle-vendor: same driver, same journal, `independence: \"degraded\"` stamps — stay on the path. **Fold path:** roster-bearing `dispatch-*` phases may use the durable-record path (`record-result` \u002F `record-missing` + `advance` per `reference\u002Fround-driver.md` § Durable-record path) **or** the hand path (compile artifact + `submit`). The two fold paths are mutually exclusive per session (see §3 above).\n3. **Durable-record path:** write each seat's landing (orchestrator writes engine-seat landings from folded `dispatch-review` stdout), then `record-result` \u002F `record-missing` with echoed `round` and `phase` from step 1 — every runner-dispatched seat's `record-result` carries `--evidence-run-dir \u003Cthe completed dispatch-review run directory>`; omitting it leaves the seat's execution evidence absent — then `advance` — no hand `submit`. **Hand path:** write the artifact JSON, then `submit` with echoed `phase`, `attempt`, and `expectedStateHash`. **Rule before the call that sets `apply-fixes`:** record every ruling you will make on a round's findings (out of scope, or guidance) with `rule` (`reference\u002Fround-driver.md` § Owner and advisor rulings) before the call that sets the step. A finding can be ruled on from the fold that staged it, by the `findingKey` the verifiers and synthesis orders carry (a bare staged id does not resolve). On the durable-record path the `advance` whose fold queues a fix batch returns the `apply-fixes` payload itself, so record rulings before any `advance` that folds synthesis, the seams check, or the scoped finder. On the hand path a `submit` sets nothing, so record them before the `next` that follows that fold's `submit`. A ruling accepted while `apply-fixes` is pending rewrites that step's batch and guidance files; one recorded after you folded the step reaches the next round.\n4. **Nothing is presented to the owner mid-review.** A blocking finding only the owner's choice can settle (`tradeoff: true`) is held out of the fix batch; the build session does not make that choice, and the finding is handed back open. A `rule` decision (guidance, or out of scope) recorded on it is the in-session way to settle it. If it is still unsettled when nothing else is left to fix, the session ends `handed-back` \u002F `owner-choice-open` and the finding reaches the owner as a leftover at the vet.\n5. On `terminal`, read `payload.certification` and `round-receipt.json`; map `verdict` to `$ACTION`\u002F`$REASON` for `--result-file` (`converged` → `exit_clean`; every other verdict → `halt`).\n\n```bash\npython3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py submit --session-dir \u003Csession dir> --phase \"\u003Cphase>\" --attempt \u003Cattempt> --state-hash \"\u003CexpectedStateHash>\" --artifact \"\u003Csession dir>\u002Fround-\u003CN>\u002F\u003Cphase>-artifact.json\"\n```\n\n**Terminals to surface honestly:** scoped certifying finish (`audited-chain` \u002F `audited-chain-degraded` — say so, never imply a pristine fresh pass); the one recovery attempt when the same fix fails its audit in two rounds in a row (journaled; the fix step is set again, and none runs when the second failure is in the cap round); the handback at the cap (`handed-back` \u002F `round-cap` — every open finding, Important and Critical alike, with its outcome); the `handed-back` \u002F `fix-keeps-failing` handback (the fix still fails after the recovery attempt); the `handed-back` \u002F `owner-choice-open` handback (a finding only the owner's choice settles is still open; it reaches the owner as a leftover at the vet).\n\n**The extra audit round.** When a session hands the PR back at the cap with a fix the cap round applied and no audit checked, the advisor may order one [extra audit round](${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Fglossary.md#extra-audit-round) at the vet. The build session that holds the handed-back session directory orders it with `python3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py extra-audit --session-dir \u003Csession dir> --order-file \u003Cthe order file> --by \u003Cwho> --pr \u003CN>`, then continues the `next` loop to the terminal and writes the review record as usual. It is allowed once per PR; the refusals, the round and its record fields are in `reference\u002Fround-driver.md` § The extra audit round.\n\n**Red flags** — if you catch yourself thinking \"trivial fix \u002F obviously clean \u002F save tokens \u002F offer another round as optional\", call `next` and obey the driver instead.\n\n### Applying the fixes\n\nAt `apply-fixes` you fix the batch yourself, in your own working tree; no fixer agent is dispatched. The steps, the report and what to do on each refusal are in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fauto-fix-loop.md` § Applying the fixes. The driver derives the post-fix diff from git itself; a submitted `headDiff` or `headDiffPath` (from the **guarded** per-round command in Setup: `git diff \"$BASE_REF\"...HEAD` against the pinned base commit, with its failed-diff and empty-diff halts) is a cross-check against that derivation, a mismatch stops the round with `head-diff-mismatch`, and submitting none is allowed. `changedSubjects` is derived from git via that same guarded command, never from your report.\n\n### End-of-Loop Summary\n\n**If `--result-file` was passed**, write the terminal loop_state decision before printing the summary (atomic write via temp file):\n\n```bash\nROOT_DIR=\"${CLAUDE_PLUGIN_ROOT}\"\npython3 -B \"$ROOT_DIR\u002Flib\u002Freview_result.py\" write \\\n  --path \"$RESULT_FILE\" \\\n  --action \"$ACTION\" \\\n  --round \"$ROUND\" \\\n  --reason \"$REASON\"\n```\n\n(`$ACTION`, `$ROUND`, and `$REASON` are set on **every** terminal exit from the driver (`converged` → `exit_clean`; other terminal verdicts → `halt` with the receipt reason). `$RESULT_FILE` is the path supplied via `--result-file`. When absent, skip this step.)\n\nPrint: final verdict, rounds run, commits created, findings fixed by severity, **the driver receipt's `certification` block** (shape, `fullPanel`, `independence`, any `note` — `audited-chain` for a review that needed fixes vs `full-panel-confirmed` for a round-1 panel that found nothing to fix, degraded disclosures), **the seat map** (`$SEAT_MAP` — per-seat tiers + resolved models + any pin\u002Fdegradation disclosures), **`scriptRan` from the journal** (`round-receipt.json` → `scriptRan.invocations` and `byPhase` — the vet that the driver actually ran), **findings verification dropped (REFUTED)** as unsubstantiated, `was_blocking_tagged` drops, **findings downgraded from blocking to non-blocking** (`downgrades`; show `from → to`), **PLAUSIBLE-Critical `advisory: true` skips** (disclosed unproven blockers), auto-handled Minor\u002FNit, `unmatched`\u002F`unverified`\u002F`ambiguous`, and the findings the fix steps listed `unfixed`. Offer to push locally; do not push without confirmation.\n\nIn PR mode, after a `converged` terminal and before writing the review record, run `python3 -B \"$ROOT_DIR\u002Flib\u002Fpr_body_stage.py\" publish --session-dir \"$SESSION_DIR\" --pr \"$PR_NUMBER\"` (any other terminal skips it; the contract is in `reference\u002Fround-driver.md` § PR-body findings). In PR mode, on every terminal verdict, the loop ends by writing the review record from the session: `python3 -B \"$ROOT_DIR\u002Flib\u002Freview_record_session.py\" write --session-dir \"$SESSION_DIR\" --extras \u003Cextras file> --repo-root \u003Crepo root>`, per the full-lane section of `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Freview-record.md`. A PR-mode session abandoned before a terminal writes its record the same way with `--abandoned \"\u003Cwhy>\"`, per the same reference. Branch mode writes none. Put the record's URL in the summary.\n\n**Then, after the summary**, run the non-blocking end-of-run steps from `## Learning Loop & Staleness Nudge`: (1) the **staleness nudge** (print the doctor `message` only when non-null and `nudge_acked` is false). The **learning-loop proposal** and the **provisional-profile confirmation** are not run — the learning loop learns from choices the owner made, and a review session has no owner gate, so it asks the owner for none.\n\n## The verify command\n\nThe orchestrator's verify gate (loop step 12, run through `round_driver.py run-verify`, which runs the command and lands the result itself) runs the project's own verify command, read from the resolved profile (`$PROFILE`)'s `## Verify` section during Setup; the `apply-fixes` step runs only scoped checks, never this command. There is one branch: **`command: \u003Ccmd>` →** `VERIFY_CMD=\"\u003Ccmd>\"`. The gate runs `VERIFY_CMD` from the user's own working tree (never the PR head), non-interactively, with a timeout. A first `fail` runs the gate once more (a re-run that passes at a different head, or on changed working-tree contents such as a new file that is not ignored, halts); a second `fail`, or any other non-pass result, is a **HALT \u002F `CHECK_FAILED`** — the orchestrator surfaces the failing output and does not re-review on a broken tree.\n\nWhen no verify command resolves, review-code refuses at Setup before any dispatch and prints the refusal's message (`reference\u002Fsetup.md`).\n\n`meta.json` records only the command string (`verify`) so a cold-resumed orchestrator recovers it without re-reading the profile. A `{baseRef}` token in the command is bound to the pinned base commit at Setup and in the driver's `run-verify` payload (`reference\u002Fsetup.md`), so a touched-tests gate on a stacked branch diffs against the PR base, not main; with no full-hex pin the token stays and the gate refuses loudly.\n\nTest-receipt evidence policy: `rubric\u002Ftest-receipt-evidence.md`.\n\n## Learning Loop & Staleness Nudge\n\nFor recurrence handling, coverage decisions, dimension skipping, tier cascade, final confirmation, and telemetry, use `plugins\u002Fsuperheroes\u002Freference\u002Freview-loop.md` as the shared loop contract. This skill owns only its leg-specific setup, reviewer framing, and gate-write rules. The triage subagent prompt template, verification rules, and common mistakes for this skill are in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fauto-fix-loop.md`; other subagent prompt bodies live in `${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Forders\u002F\u003Cphase>.md` and are rendered by the driver.\n","This skill speaks in host-neutral actions. Resolve them to your runtime's tools by reading the host tool map at `${CLAUDE_PLUGIN_ROOT}\u002Fhosts\u002F\u003Cyour-host>-tools.md` (the leading variable is this plugin's root directory) — `claude-tools.md` on Claude Code, `codex-tools.md` on Codex.\n\n# Review Code\n\nRun a multi-dimensional code review on either an open pull request or a local branch (vs the default branch), then **autonomously fix what it finds**. The main context is an **orchestrator** — it fetches metadata, dispatches the panel's specialist agents in parallel, compiles their findings, triages each into auto-fixable vs needs-your-judgment, applies the fixes itself, and re-reviews — looping until a round leaves nothing blocking; a session stops at the first such round, and at 4 rounds at most it hands back with what is still open. Subagents do all heavy reading and write structured results to disk; it never loads the full diff or any agent's raw output into its own conversation.\n\nThe skill auto-detects whether you're reviewing a PR or a local branch, always dispatches the panel the seat map composes from the lane call (the code reviewer and the test role on every change; the security and premortem reviewers when a risk area is touched or risk is unclear) so coverage follows the change's risk (a change over the countable-lines bar is reviewed in [slices](..\u002F..\u002Frubric\u002Fglossary.md#slice), with one [seams check](..\u002F..\u002Frubric\u002Fglossary.md#seams-check); the details are in `reference\u002Fround-driver.md`), enforces the severity and verification rules in the base rubric at compile time (not just by hope), and — drives an auto-fix loop that commits fixes locally (never pushes).\n\nThere is one path: the auto-fix loop — review → triage → fix → re-review, committing locally until clean or halted. It runs on the project's own PR or branch and needs a verify command.\n\nThe specialist agents a panel may seat are bundled plugin agents (`architecture-reviewer`, `code-reviewer`, `security-reviewer`, `test-role`, `premortem-reviewer`); the orchestrator dispatches each reviewer by name (resolve dispatch via the host tool map). Each agent's review methodology lives in its own system prompt; the orchestrator's dispatch passes it the base rubric (severity\u002Fverification\u002Fformat), the project calibration (`core.md` for threat model + canonical patterns, `review-crew.md` layer for scope\u002Ffocus\u002Fconventions), `CLAUDE.md`, the diff, and the findings output path. Every finding they emit must cite a `file:line`, and a finding on the change targets a `+`\u002F`-` line in the diff — a finding on a context line or unchanged code is not compiled into the review; it goes to the record's \"Outside this PR\" list (at most 3 outside findings per reviewer, per the base rubric's diff-scope rule). Each specialist runs once per round; the orchestrator never re-runs a specialist or chains a second **finder** pass within a round, because a finder that has exhausted the real issues starts fabricating (base rubric, \"In-pass Chain-of-Verification & single-pass discipline\"). It does run a fail-closed **per-finding verification** pass over the *already-emitted* findings at compile time — 3-state CONFIRMED\u002FPLAUSIBLE\u002FREFUTED verdicts with quoted evidence that never searches for new issues, distinct from re-running a finder (see `## Compile + Dedupe`). The loop re-reviews from scratch each round on a fresh diff, which is different from re-running a specialist on its own output.\n\n## Invocation\n\n| Form                                       | Behavior                                                                                                                                                              |\n| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `\u002Fsuperheroes:review-code`                 | **Auto-fix loop (default).** Review → triage → fix → re-review until the loop ends converged, or hands back at the cap or earlier with what is still open. Commits locally; never pushes. |\n| `\u002Fsuperheroes:review-code branch` \u002F `pr \u003CN>` | Force branch or PR mode; runs the auto-fix loop.                                                                |\n| `\u002Fsuperheroes:review-code --focus \u003Cnotes>` | Pass focus notes to every finder order that carries them: the panel specialists and a returning round's scoped finder. A round that emits any other order while notes are set records `focusNotesNotCarried` and the receipt's `degraded` list says which seats did not see them. Combinable with any form. |\n| `\u002Fsuperheroes:review-code --result-file \u003Cpath>` | Write the terminal decision (`action`, `round`, `reason`) to `\u003Cpath>` as JSON on **every** terminal exit (`converged` writes `exit_clean`; `handed-back`, `halted`, `cannot-certify` and `uncertified-manual` write `halt`), for a programmatic caller (e.g. Workhorse step 2). Combinable with any form; absent → no file written (backward-compatible). |\n\n**Auto-detection rule.** Run `gh pr list --head \"$(git rev-parse --abbrev-ref HEAD)\" --json number,headRefOid,headRefName --limit 1`. If the result is non-empty, default to PR mode. Otherwise default to branch mode. If the user passed `branch` explicitly, skip the lookup. If the user passed `pr \u003CN>` explicitly, use `\u003CN>` and don't auto-detect.\n\n**Two flags were removed and are not flags:** `--review-only` (one review pass, then a written presentation) and `--post` (posted a review pass to GitHub), because code review runs only as its one review-and-fix loop. Run this block first on every invocation, before Setup, with `REVIEW_CODE_ARGS` set to the invocation's arguments. The block reads the arguments with their quoting kept, so a word inside the value of `--focus` or `--result-file` is never read as a flag. It prints nothing and exits 0 unless a removed flag is passed as an argument of its own; when it exits non-zero, stop: do nothing else, do not start the loop.\n\n```bash\nARG=$(python3 -B -c '\nimport shlex, sys\ntext = sys.argv[1]\ntry:\n    words = shlex.split(text)\nexcept ValueError:\n    words = text.split()  # unbalanced quote: plain whitespace split, still skipping the word after --focus or --result-file\nskip = False\nfor word in words:\n    if skip:\n        skip = False\n    elif word in (\"--focus\", \"--result-file\"):\n        skip = True\n    elif word in (\"--review-only\", \"--post\"):\n        print(word)\n        break\n' \"${REVIEW_CODE_ARGS:-}\")\nif [ -n \"$ARG\" ]; then\n  echo \"review-code: $ARG was removed. Code review runs only as its one review-and-fix loop, so nothing ran. Run \u002Fsuperheroes:review-code without $ARG.\"\n  exit 1\nfi\n```\n\nOpen no `AskUserQuestion` on any review-code path, for any purpose.\n\n## Session Directory\n\nAll review artifacts live in a per-invocation temp directory so parallel reviews don't collide:\n\n```bash\nSESSION_DIR=$(mktemp -d \u002Ftmp\u002Freview-XXXXXXXX)\n```\n\nFiles written during the review. **Per-round artifacts live under `$SESSION_DIR\u002Fround-\u003CN>\u002F`** in the auto-fix loop (round 1, 2, …). Only `meta.json` lives at the session-dir root.\n\nThe full artifact table — every path, the component that writes it, and its purpose — is in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fsetup.md` § Session artifacts.\n\n**CRITICAL:** The main context only ever runs `wc -l \u003C $SESSION_DIR\u002Fround-\u003CN>\u002Fdiff.txt` to size the diff. It never `cat`s the diff, never reads the full thing, never echoes it back. Subagents read the diff from disk and write structured findings; the orchestrator reads the findings JSON, not the diff.\n\n## Workflow\n\n### 1. Setup\n\nRun the removed-flags block from `## Invocation` first. Then decide mode (auto-detected or explicit, per `## Invocation`). Create the session directory.\n\n**Resolve the run's inputs before dispatching anything.** In order: the base rubric path, repo root, the calibration paths, the plugin and rubric versions, the model tiers, the per-role engine, then the staleness self-check, the profile bootstrap, the verify story, and the post-bootstrap refresh of the dispatch paths. The exact commands, the variable each one sets, and the tier→model dispatch mapping are in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fsetup.md` § Setup resolution — read it and run the blocks in the order given.\n\nEverything below depends on the variables that file sets: `$ROOT_DIR`, `$RUBRIC`, `$REPO_ROOT`, `$CORE`, `$LAYER`, `$PROFILE`, `$LOCATION`, `$EXISTS`, `$DECISIONS`, `$PLUGIN_VERSION`, `$RUBRIC_VERSION`, `$REVIEWER_MODEL`, `$DEEP_MODEL`, `$MECH_MODEL`, `$SYNTH_MODEL`, `$VERIFIER_MODEL`, `$EP`, `$REVIEWER_ENGINE`, `$IMPL_ENGINE`, `$CONFIGURED`, `$DOCTOR_JSON`, `$VERIFY_JSON`, `$VERIFY_CMD`, `$BREAK_IT_ARGS`, `$REFUSAL`, and `$SEAT_MAP` and `$AUTHOR_FAMILY`, which the seat-map compose step sets right after the base pin. A step below that reads one of these without that file having been run is a bug in the step; the shell default that does appear (`${VERIFY_CMD:-none}`) is a deliberate value fallback, not a licence to skip the setup file.\n\n**PR mode:**\n\n```bash\n# Resolve PR number — either provided or auto-detected from current branch\nBRANCH=$(git rev-parse --abbrev-ref HEAD); MODE=pr\nif [ -z \"$PR_NUMBER\" ]; then\n  PR_NUMBER=$(gh pr list --head \"$BRANCH\" --json number --jq '.[0].number')\nfi\n\n# Metadata: small JSON only — do NOT load the diff yet\ngh pr view \"$PR_NUMBER\" --json number,title,author,headRefName,headRefOid,baseRefName,url,body > \"$SESSION_DIR\u002Fpr.json\"\nHEAD_SHA=$(jq -r .headRefOid \"$SESSION_DIR\u002Fpr.json\")\nPR_BRANCH=$(jq -r .headRefName \"$SESSION_DIR\u002Fpr.json\")\nBASE_BRANCH=$(jq -r .baseRefName \"$SESSION_DIR\u002Fpr.json\")   # PR base branch NAME — pinned to a remote commit below\nREPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)\n\n# Prior review comments — used for author-justification handling\ngh api \"repos\u002F$REPO\u002Fpulls\u002F$PR_NUMBER\u002Fcomments\" \\\n  --jq '[.[] | {id, in_reply_to_id, path, line, position, body, user: .user.login}]' \\\n  > \"$SESSION_DIR\u002Fprior-comments.json\"\n```\n\n**Auto-fix branch guard (PR mode, default loop only).** Before entering the loop, the orchestrator must be in one of two accepted states so fix commits land where they belong: **standing on the PR's branch** (name match only — **no** `HEAD` freshness check, so a behind checkout still passes), or **an adopted build** (invoke `review-code pr \u003CN>` — auto-detection matches `--head` by branch name, so a renamed local branch never reaches this guard on a bare invocation) tracking remote `origin` with merge ref `refs\u002Fheads\u002F\u003CPR branch>` (read from `branch.\u003Cname>.remote` \u002F `branch.\u003Cname>.merge`, not `@{upstream}` — spoofable by a local-tracking ref) and `HEAD` exactly `$HEAD_SHA`. The fenced block below is extracted by `plugins\u002Fsuperheroes\u002Flib\u002Ftests\u002Ftest_review_code_branch_guard.py` (first `bash` fence after this paragraph). Adopted path only: the config leg proves tracking **`origin`'s** branch of that name with `HEAD` at the PR head — assuming the PR head lives in `origin`; a fork PR whose head name collides with an `origin` branch is not distinguished. The SHA leg refuses a stale adopted copy and does **not** apply to the name path.\n\n```bash\nCURRENT_BRANCH=$(git symbolic-ref --quiet HEAD); case \"$CURRENT_BRANCH\" in refs\u002Fheads\u002F?*) CURRENT_BRANCH=${CURRENT_BRANCH#refs\u002Fheads\u002F};; *) CURRENT_BRANCH=;; esac\nLOCAL_HEAD=$(git rev-parse HEAD); TRACK_REMOTE=$(git config --get \"branch.$CURRENT_BRANCH.remote\"); TRACK_MERGE=$(git config --get \"branch.$CURRENT_BRANCH.merge\")\ncase \"$PR_BRANCH\" in \"\"|null) echo \"Auto-fix: pr.json has no head branch — refusing (fail closed).\"; exit 1;; esac\ncase \"$HEAD_SHA\"   in \"\"|null) echo \"Auto-fix: pr.json has no head SHA — refusing (fail closed).\"; exit 1;; esac\nif [ \"$CURRENT_BRANCH\" != \"$PR_BRANCH\" ] && ! { [ -n \"$CURRENT_BRANCH\" ] && [ \"$TRACK_REMOTE\" = origin ] && [ \"$TRACK_MERGE\" = \"refs\u002Fheads\u002F$PR_BRANCH\" ] && [ \"$LOCAL_HEAD\" = \"$HEAD_SHA\" ]; }; then\n  echo \"Code review runs only on this project's own PR, from the PR's branch '$PR_BRANCH' (currently on '${CURRENT_BRANCH:-\u003Cdetached HEAD>}'). An ADOPTED build also qualifies, but only when ALL hold: this branch tracks remote 'origin' (found '${TRACK_REMOTE:-none}') and merge ref 'refs\u002Fheads\u002F$PR_BRANCH' (found '${TRACK_MERGE:-none}'), AND HEAD is the PR head '$HEAD_SHA' (found '$LOCAL_HEAD').\"\n  echo \"If this is your PR, check out its branch and run again. Reviewing a PR that was not built in this project is not supported.\"; exit 1\nfi\n```\n\nIf the guard fails (detached HEAD, an unrelated branch, or you're reviewing someone else's PR), STOP — do not enter the loop. Tell the user plainly that reviewing a PR not built in this project is not supported, and offer no other way to review it. A **stale** adopted branch — right tracking config, wrong `HEAD` — refuses; the name path has no freshness check. Missing `pr.json` metadata (`$PR_BRANCH` or `$HEAD_SHA` empty or `null`) refuses fail-closed. The auto-fix loop **never pushes**; an adopted build must push its fix commits itself with an explicit refspec — `git push origin HEAD:$PR_BRANCH` — because a bare `git push` from an adopted branch fails under git's default `push.default=simple` when the local branch name differs from its upstream (`fatal: The upstream branch of your current branch does not match the name of your current branch.`).\n\n**Branch mode:**\n\n```bash\nBRANCH=$(git rev-parse --abbrev-ref HEAD); MODE=branch\nHEAD_SHA=$(git rev-parse HEAD)\nBASE_BRANCH=$(git symbolic-ref --quiet refs\u002Fremotes\u002Forigin\u002FHEAD 2>\u002Fdev\u002Fnull | sed 's@^refs\u002Fremotes\u002Forigin\u002F@@'); BASE_BRANCH=${BASE_BRANCH:-main}   # branch mode: default branch NAME; the pipeline exits 0 even when symbolic-ref fails, so `|| echo main` inside it would be DEAD\nREPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner 2>\u002Fdev\u002Fnull || echo \"local\")\n\n# No worktree, no prior comments — subagents verify against the current working tree\n```\n\n**Resolve the diff base to a PINNED REMOTE commit — BOTH MODES, ONCE, at session setup.** This block runs in PR mode and branch mode alike (it is not part of the branch-mode snippet above); PR mode sets `$BASE_BRANCH` from `baseRefName`, branch mode from `origin\u002FHEAD`, and from here the two are identical. `$BASE_BRANCH` is only a branch *name*, and a worktree's local copy of that branch goes stale as a matter of course in multi-agent setups: three-dot diff walks back to `merge-base($BASE_BRANCH, HEAD)`, so a stale local base drags everyone else's already-merged work into the review as if this branch added it (#637 — observed live: ~6,600 contaminated lines against 2,931 real ones). Fetch through a **fully qualified refspec** (never the DWIM short name — a local branch or tag called `origin\u002F\u003Cbase>` would shadow it, and a nonstandard remote refspec can leave the fresh object only at `FETCH_HEAD`) and **pin the result to an immutable commit**. Run this block **exactly once per session**, never per round: remote-tracking refs are shared by every worktree of the repo, so re-running it mid-session would re-pin to whatever another agent has since pushed — the very drift the pin exists to prevent. In the fetch refspec, `${BASE_BRANCH}` is braced deliberately because an unbraced `$VAR` immediately before `:` is read by zsh as a history-style modifier (`:r`), which silently corrupts the refspec so fetch fails and the pin falls back to a stale remote-tracking ref—the same #637 class this block exists to prevent.\n\n```bash\nBASE_FETCH=fetched; git fetch --quiet origin \"+refs\u002Fheads\u002F${BASE_BRANCH}:refs\u002Fremotes\u002Forigin\u002F${BASE_BRANCH}\" \\\n  || BASE_FETCH=\"fetch-failed ($(git remote get-url origin >\u002Fdev\u002Fnull 2>&1 && echo 'origin configured; fetch failed — unreachable, auth, or base branch absent on the remote' || echo 'no origin remote')); local-vs-last-fetched base divergence behind\u002Fahead $(git rev-list --left-right --count \"$BASE_BRANCH...refs\u002Fremotes\u002Forigin\u002F$BASE_BRANCH\" 2>\u002Fdev\u002Fnull | tr '\\t' '\u002F' | grep . || echo unknown)\"\nBASE_REF=$(git rev-parse --verify --quiet \"refs\u002Fremotes\u002Forigin\u002F$BASE_BRANCH^{commit}\") \\\n  || { BASE_REF=$(git rev-parse --verify --quiet \"$BASE_BRANCH^{commit}\"); BASE_FETCH=\"$BASE_FETCH; no-remote-ref — diffing the LOCAL base\"; }\nBASE_REF=$(git rev-parse --verify --quiet \"$BASE_REF^{commit}\") || { echo \"review-code: base '${BASE_BRANCH:-\u003Cempty>}' did not resolve to a commit (BASE_FETCH=${BASE_FETCH}) — refusing to review (#637)\" >&2; exit 1; }\nprintf '%s' \"$BASE_REF\" | grep -Eq '^([0-9a-f]{40}|[0-9a-f]{64})$' && VERIFY_CMD=\"${VERIFY_CMD\u002F\u002F\\{baseRef\\}\u002F$BASE_REF}\"   # bind the verify command's {baseRef} token (§ The verify command)\n```\n\n**Compose the panel seat map — right after the base is pinned.** Run the compose block in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fsetup.md` § Compose the panel seat map now, from here, once `$BASE_REF` and `$HEAD_SHA` are both set: the roster follows the lane call over the change between `$BASE_REF` and the head the review diff reads (the block derives it: local HEAD on every path), and the seat pins come from core.md, which compose reads itself. It sets `$SEAT_MAP` and `$AUTHOR_FAMILY`.\n\n**The base must RESOLVE TO A COMMIT — validated once at Setup, and every consumer uses the guarded command.** This is the only validation, and it is deliberately not a non-emptiness test: `$BASE_REF` reaching `git diff` as an empty string makes argv `...HEAD`, which git reads as `HEAD...HEAD` — a **zero-line diff at exit 0** the loop would certify clean — and reaching it as the literal string `null` (what `jq -r` prints for an absent key) passes any `[ -n … ]` check while `git diff null...HEAD` exits 128 and *still* leaves an empty `diff.txt`. `git rev-parse --verify --quiet \"$BASE_REF^{commit}\"` rejects both, plus a deleted branch and a non-commit tag. **Every** producer of `$BASE_REF` — the fetch\u002Fpin above, the local fallback, the `meta.json` restore below — routes through it; never add a second, weaker guard beside it, and never let a caller \"recover\" by substituting a branch name. On every auto-fix `next`, `round_driver.py` independently re-checks in code that the base is a *pinned commit id* and that the pin has not moved mid-session, refusing with `base-not-pinned`, `base-unresolved`, or `base-pin-moved` if not (see `reference\u002Fround-driver.md` § Base guard).\n\n**Never diff a stale base silently.** Any `$BASE_FETCH` other than `fetched` is a **degradation** — name it in the dispatch summary, and record it in `meta.json`. Both modes assume `origin` is the base branch's repository; in PR mode the driver now refuses a fork whose PR base repository differs from `origin` with `base-repo-mismatch` (full fork *support* — resolving or fetching the base by URL — is still deliberately not built).\n\n**A stacked PR's session reads the layer against the base commit it pinned.** When the PR's base is not the default branch, the session reads the layer against the base commit pinned at Setup for its whole run, and a move of the lower layer never stops it. The layer catches up at handback (`rubric\u002Fnative-stacks.md` § How a stack stays current), and its catch-up is reviewed as a returning PR (the returning-round paragraph of the Auto-Fix Loop Bootstrap step, which starts \"A fresh PR-mode session whose earlier record makes the returning-review decider\").\n\n**Per-round diff — every round, against the pin.** This is the ONLY command that runs per round. Do NOT use `gh pr diff` (rounds 2+ have local fix commits that are not on the remote), and do NOT re-run the setup block above. On fresh state the round-1 artifact passed to the driver is refused in code (`round-diff-unreadable`, `round-diff-empty`, `round-diff-malformed`, `round-diff-required`); rounds 2+ rely on the shell halt above.\n\n```bash\ngit diff --no-ext-diff --no-textconv --no-color -M -U3 --src-prefix=a\u002F --dst-prefix=b\u002F \"$BASE_REF\"...HEAD > \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt.tmp\" || { echo \"review-code: git diff against $BASE_REF FAILED — refusing to review the artifact it left behind (#637)\" >&2; exit 1; }\nmv \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt.tmp\" \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt\" || { echo \"review-code: git diff against $BASE_REF FAILED — refusing to review the artifact it left behind (#637)\" >&2; exit 1; }\n[ -s \"$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt\" ] || { echo \"review-code: round diff against $BASE_REF is EMPTY — an empty review surface is never certifiable-clean; halt and investigate (#637)\" >&2; exit 1; }\n```\n\nThe flags are the review diff's fixed shape (`REVIEW_DIFF_ARGS` in `lib\u002Freview_diff_bytes.py`), so a user's git settings (copy detection, context lines, prefixes, an external diff) never change what the loop reads. Each step halts on its own failure, and no delete rides a compound command (the delete rule, `DELETE_RULE` in `lib\u002Fcommand_refusals.py`, and the stop-and-delete rule, `STOP_AND_DELETE_RULE`, same home, bind these recipes): a `.tmp` file a failed step leaves is never read.\n\n**If `$BASE_REF` is not in scope** — a resumed or compacted orchestrator, or a fresh shell — restore the pin from the session record rather than re-deriving it: `BASE_REF=$(jq -r '.baseRef \u002F\u002F empty' \"$SESSION_DIR\u002Fmeta.json\")`, then **re-run the resolve-to-a-commit check from the setup block** (`BASE_REF=$(git rev-parse --verify --quiet \"$BASE_REF^{commit}\") || exit 1`) before any diff. Use `\u002F\u002F empty`, never a bare `.baseRef`: `jq -r` prints the literal string `null` for an absent key, which is non-empty and would sail past a naive check. Re-running the setup block instead would silently re-pin to a moved `origin\u002F\u003Cbase>`.\n\nThen write `meta.json` in both modes:\n\n```bash\n# The orchestrator sets FOCUS_JSON from the `--focus` argument (if any) before this block runs.\nFOCUS_ARG=$(printf '%s' \"${FOCUS_JSON:-}\" | jq -cs 'if length == 1 and ((.[0]|type) == \"object\" or (.[0]|type) == \"array\") then .[0] else empty end' 2>\u002Fdev\u002Fnull); [ -n \"$FOCUS_ARG\" ] || { [ -n \"${FOCUS_JSON:-}\" ] && FOCUS_ARG=$(printf '%s' \"$FOCUS_JSON\" | jq -Rs .) || FOCUS_ARG=null; }   # -s SLURPS, so the encoder can only ever emit ONE document: a lone JSON object\u002Farray rides through as JSON, and everything else (free text, a bare scalar, several documents, malformed JSON) becomes one JSON string via stdin — never a multi-document value --argjson would reject, and never a silently truncated note\nPR_ARG=$(printf '%s' \"${PR_NUMBER:-null}\" | jq -cs 'if length == 1 and (.[0]|type) == \"number\" then .[0] else null end' 2>\u002Fdev\u002Fnull); [ -n \"$PR_ARG\" ] || PR_ARG=null\nSTORAGE_MODE_ARG=$(printf '%s' \"${LOC:-}\" | jq -Rsc 'if type == \"string\" and length > 0 then . else null end' 2>\u002Fdev\u002Fnull); [ -n \"$STORAGE_MODE_ARG\" ] || STORAGE_MODE_ARG=null\nSTORAGE_SOURCE_ARG=$(printf '%s' \"${SOURCE:-}\" | jq -Rsc 'if type == \"string\" and length > 0 then . else null end' 2>\u002Fdev\u002Fnull); [ -n \"$STORAGE_SOURCE_ARG\" ] || STORAGE_SOURCE_ARG=null\nSTORAGE_PROVISIONAL_ARG=$(printf '%s' \"${PROVISIONAL:-}\" | jq -cs 'if length == 1 and .[0] == true then true elif length == 1 and .[0] == false then false else null end' 2>\u002Fdev\u002Fnull); [ -n \"$STORAGE_PROVISIONAL_ARG\" ] || STORAGE_PROVISIONAL_ARG=null\njq -n --arg mode \"$MODE\" --arg path loop --arg repo \"$REPO\" --arg branch \"$BRANCH\" \\\n  --arg headSha \"$HEAD_SHA\" --arg baseRef \"$BASE_REF\" --arg baseBranch \"$BASE_BRANCH\" --arg repoRoot \"$REPO_ROOT\" \\\n  --arg baseFetch \"$BASE_FETCH\" --arg sessionDir \"$SESSION_DIR\" --arg verify \"$VERIFY_CMD\" \\\n  --argjson pr \"$PR_ARG\" --argjson focusNotes \"$FOCUS_ARG\" \\\n  --argjson storageMode \"$STORAGE_MODE_ARG\" --argjson storageSource \"$STORAGE_SOURCE_ARG\" --argjson storageProvisional \"$STORAGE_PROVISIONAL_ARG\" \\\n  '{mode:$mode,path:$path,pr:$pr,repo:$repo,branch:$branch,headSha:$headSha,baseRef:$baseRef,baseBranch:$baseBranch,baseFetch:$baseFetch,repoRoot:$repoRoot,sessionDir:$sessionDir,verify:$verify,focusNotes:$focusNotes,storageMode:$storageMode,storageSource:$storageSource,storageProvisional:$storageProvisional}' \\\n  > \"$SESSION_DIR\u002Fmeta.json.tmp\" || { echo \"review-code: could not write meta.json — halting rather than continuing without the session record (#637)\" >&2; exit 1; }\nmv \"$SESSION_DIR\u002Fmeta.json.tmp\" \"$SESSION_DIR\u002Fmeta.json\" || { echo \"review-code: could not write meta.json — halting rather than continuing without the session record (#637)\" >&2; exit 1; }\n```\n\nThe `path` field is always `loop`. `post` was once a value and was removed with its mode — never re-add it; `review-only` was removed the same way. A resumed run carrying either has no flow left to continue. The `verify` field is the verify command string, so a cold-resumed orchestrator recovers the verify story. `storageMode`, `storageSource`, and `storageProvisional` record storage-bootstrap disclosure when bootstrap ran (`$LOC`, `$SOURCE`, `$PROVISIONAL`); when bootstrap did not run they are JSON `null` — not empty strings — so a reader can tell no storage decision was taken this run.\n\nSize the round-1 diff for the dispatch summary (after writing it to `round-1\u002Fdiff.txt` per the command above):\n\n```bash\nDIFF_LINES=$(wc -l \u003C \"$SESSION_DIR\u002Fround-1\u002Fdiff.txt\")\n```\n\n**CRITICAL:** The line count is the only thing the orchestrator needs to know about `diff.txt`'s contents — do not `cat`, `head`, `tail`, or otherwise read it from the main context.\n\n### 2. Dispatch Summary\n\nPrint this dispatch summary as a plain status message, then dispatch the specialists immediately (no approval gate):\n\n- **Skill:** `review-code`\n- **Mode:** PR or branch\n- **Target:** `PR #\u003CN> \"\u003Ctitle>\"` (PR mode) or `\u003Cbranch> vs \u003CbaseRef>` (branch mode) — `\u003CbaseRef>` is the **pinned base commit**; when `$BASE_FETCH` is not `fetched`, state that degradation here\n- **Repo:** `\u003Cowner>\u002F\u003Crepo>`\n- **Head SHA:** short hash\n- **Diff size:** `\u003CDIFF_LINES>` lines\n- **Verify:** `VERIFY_CMD` (the command string)\n- **Specialists to dispatch (round 1: the seat map's roster at `reviewer-deep`, in parallel; later rounds: obey `round_driver.py` `next` — delta audits + scoped finder only, never a panel):** A change over the countable-lines bar is reviewed in round 1 in [slices](..\u002F..\u002Frubric\u002Fglossary.md#slice), each with its own seats, plus one [seams check](..\u002F..\u002Frubric\u002Fglossary.md#seams-check); dispatch the seats `payload.dimensions` names and see `reference\u002Fround-driver.md` § Big changes for the rest.\n  - `code-reviewer` → `findings-code.json`\n  - `test-role` → `findings-test.json`\n  - `security-reviewer` → `findings-security.json` (when the roster seats it)\n  - `premortem-reviewer` → `findings-premortem.json` (when the roster seats it)\n  - `architecture-reviewer` → `findings-architecture.json` (only when a roster names it)\n- **Session directory:** `$SESSION_DIR` (round 1 artifacts under `round-1\u002F`)\n- **Focus notes:** the `--focus` argument, if any\n- **Path:** the auto-fix loop (`round_driver.py` next\u002Fsubmit until terminal)\n- **What happens after dispatch (default loop):** obey `next`\u002F`submit` — panel\u002Fverify\u002Fsynthesis → apply-fixes → verify gate → delta audits\u002Fscoped finder → terminal with certification + receipt. The build session applies the fixes itself at `apply-fixes`; no fixer agent or external engine writes a review fix.\n\nPer-round dispatch is **driver-owned** — round 1 is the full `reviewer-deep` baseline; rounds 2+ are **delta rounds** (fix audits + scoped finder), and no later round runs a panel; a changed surface the driver cannot work out hands the PR back. A review that needed fixes ends on a round's audit and scoped finder. When an audit finds a break-it test missing, changed without a reason or weakened, the driver first sets a restore-only `apply-fixes` step that puts the test role's version back, then offers the test role one correction of a weakened test; the weakened version is never kept. Obey `round_driver.py` `next`\u002F`submit`; never tier, skip, or exit by eye. Full contract: `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fround-driver.md`.\n\n### 3. Dispatch Specialists in Parallel\n\nOn every `next` whose `phase` starts with `dispatch-`, `round_driver.py` **emits** each roster seat's complete order before you dispatch anything: one markdown file per slot, an envelope stub carrying the full known header for the session's seat-result schema (`seat-result\u002F1` at state v2–v4; `seat-result\u002F2` at state v5, including `provenance: dispatch-observed`), and a manifest hashed into the session anchor. **Dispatch the emitted order text** — do not hand-compose prompts from templates. Per-seat engine\u002Fchannel mechanics (stdout vs file, `dispatch-review` runner) live in `reference\u002Fauto-fix-loop.md`; the prompt bodies live in `rubric\u002Forders\u002F\u003Cphase>.md` and are rendered into the session by the driver.\n\n**Where the files are (round `\u003CN>`, phase `\u003Cphase>`, attempt `\u003CK>`, storage key `\u003Cskey>` — the filename-safe key the manifest uses, not the bare reviewer name):**\n\n| Artifact | Path |\n| --- | --- |\n| Order (dispatch this) | `$SESSION_DIR\u002Fround-\u003CN>\u002Forders\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.md` |\n| Envelope stub (header fields the seat must copy verbatim) | `$SESSION_DIR\u002Fround-\u003CN>\u002Forders\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.envelope.json` |\n| Orders manifest (every slot's `orderPath`, `envelopeStubPath`, hashes) | `$SESSION_DIR\u002Fround-\u003CN>\u002Forders\u002F\u003Cphase>\u002Fmanifest.a\u003CK>.json` |\n| Landing — **engine** seat (`codex`\u002F`cursor`) | `$SESSION_DIR\u002Fround-\u003CN>\u002Flanding\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.json` — **orchestrator** writes the **full envelope** (stub header + payload; schema from state version) from the folded `dispatch-review` stdout result, copying the result's `readParts`, when it carries one, into the landed payload beside `findings`; the engine seat emits JSON on stdout only (read-only sandbox). At state v5, pass a completed `dispatch-review` run directory to `record-result --evidence-run-dir` so the driver can stamp `executionEvidence` and `envelopeSha256` before ingest. For a fix auditor's `ruling` result, the orchestrator may land the stub envelope with `payload: null`, and `record-result --evidence-run-dir` fills it from the runner's graded record. |\n| Landing — **host** seat (`claude` native subagent) | `$SESSION_DIR\u002Fround-\u003CN>\u002Flanding\u002F\u003Cphase>\u002F\u003Cskey>.a\u003CK>.payload.json` — write **only** the payload; the driver wraps with the emitted stub at ingest. At state v5 the ingested envelope is `seat-result\u002F2`; when execution evidence is stamped the bare-payload landing stays single-file and the stamped envelope is written to the durable store copy only. The driver seats a fix auditor on a runner-backed vendor (`codex`\u002F`cursor`) whenever one is live; on a durable-record session with none live, or when an independent-family vendor is live only as a host seat, `next` refuses `auditor-unseatable` rather than emit the audit order, and the remedy is a fresh session seeded with a runner vendor in `--vendors`, or hand `next`\u002F`submit` for the whole session. |\n\nNo seat is ever asked to transcribe an `orderSha256`, `manifestSha256`, or storage path — those ride in the stub the driver emitted. After landings exist, either **`record-result` (or `record-missing`) + `advance`**, or a hand **`submit`** — **mutually exclusive, per SESSION** (the first path used is the path the session keeps; see `reference\u002Fround-driver.md` § Durable-record path).\n\nFor the full `dispatch-review` argument surface, read `skills\u002Fworkhorse\u002Freference\u002Fdispatch-entry.md`.\nLaunch the round's scheduled specialists (round 1: the seat map's roster) **by channel** — see `reference\u002Fround-driver.md` § Batch concurrency. **Native-subagent** seats (a `claude` seat) go out as **parallel dispatches in one message**; the harness runs them concurrently and owns their lifecycle. **External-engine** seats (`codex`\u002F`cursor`, through `dispatch-review`) each get their own `--run-dir` (**the runner creates it** on first `dispatch-review`; a leaf `--run-dir` symlink is refused `run-dir-is-symlink`; keep `--progress-file` and result JSON **outside** the run dir or get `run-dir-not-empty-unopened`; continuation reuses the same dir), are launched with a short positive slice, then the originating verb is re-invoked on every non-terminal run in rotation until each is terminal — issuing those calls together in one message does not make them concurrent. Dispatch each seat through **its seat-map-assigned engine+model** (`$SEAT_MAP.seats[\u003Creviewer>]` → `.vendor`\u002F`.model`): a `claude` seat runs the named subagent at its tier model with the **order file contents** as the prompt; a `codex`\u002F`cursor` seat dispatches through `engine_dispatch.py dispatch-review` (read-only sandbox) with that seat's resolved `.model`. An unreadable or missing slot is the same `cannot-certify` signal: the orchestrator re-runs a forfeited panel seat on another live vendor from the seat map's `liveVendors` whose family is outside every maker family, recording which vendor ran it in its dispatch record (the driver does not reseat a panel seat), and when no such vendor is live the seat is recorded missing (`record-missing`) and counts as not run; it is never re-run on the host model when the host's family is a maker. A seat the seat map records as `unfilled` (`source: \"unfilled\"`, no vendor or model) is never dispatched and never re-run on the host model; it stays in the record as a planned reviewer that did not run. The same holds on the hand-submit path. On the hand path, submit the panel with `ranManifest: {\u003Cdim>: \u003Cvendor>}` built from your OWN dispatch records **and** the composed `$SEAT_MAP` JSON as `seatMap`. Per-seat dispatch detail: `reference\u002Fauto-fix-loop.md`.\n\n**Per-agent substitutions** (reviewer name → findings filename stem → dimension label):\n\n| reviewer | `\u003Cagent>` (findings filename) | `\u003Cdimension>` |\n| ---------------------------- | ----------------------------- | ------------- |\n| architecture-reviewer        | architecture                  | Architecture  |\n| code-reviewer                | code                          | Code          |\n| security-reviewer            | security                      | Security      |\n| test-role                    | test                          | Test          |\n| premortem-reviewer           | premortem                     | Failure-Mode  |\n\nAfter dispatch, wait for every roster agent to return. **Codex\u002Fcursor seats** run the native `dispatch-review` `--run-dir` + `--max-wait 540` continuation loop until terminal; **claude seats** are native subagents with their own lifecycle (the `await-dispatches` ruling's native-subagent exemption — the runner cannot dispatch them). The **hand-rolled engine fallback** (`auto-fix-loop.md`) does not follow that native shape and still owes the limitation disclosure when used. No native-shape limitation disclosure is owed for seats dispatched through the runner or as claude native subagents under this skill. This skill owns the **bounds** of its own dispatches; the builder's `await-dispatches` rule owns the **channel** for what the builder launches. Full contract: `reference\u002Fauto-fix-loop.md` (Settled dispatch contract).\nA file-channel seat's findings are read from `$SESSION_DIR\u002Fround-\u003Cround>\u002Ffindings-\u003Cagent>.json`; a stdout-channel seat's findings come from the terminal `dispatch-review` result, which the orchestrator folds. The orchestrator reads only those structured outputs, never agent transcripts.\n\n### 4. Compile + Dedupe (main context)\n\nCompile is driver-owned on the loop — obey `next`\u002F`submit` instead of reimplementing compile by hand. The numbered steps below are the compile contract the driver applies to the findings it collects from the file-channel seats at `$SESSION_DIR\u002Fround-\u003Cround>\u002Ffindings-*.json` and from the stdout-channel seats' folded `dispatch-review` results. In order:\n\n1. **Citation check.** Drop any finding with `file == null` or `line == null`.\n2. **Diff-scope verification.** Parse `$SESSION_DIR\u002Fround-\u003Cround>\u002Fdiff.txt` for `+`\u002F`-` anchor lines (same hunk-walking as `diff_scope.py`). A finding outside the lines the PR touched is not dropped: it goes to the record's \"Outside this PR\" list with the reviewer that raised it, and is not compiled into the review. Then drop any finding that states no consequence: it is recorded as a compile drop with the reason `no stated consequence` and is not taken into the review.\n3. **Dedupe by `(file, line)`.** Merge same-anchor findings: higher severity wins, dimensions unioned, stable `file::normalized-title` identity, `tradeoff: true` if either input is. The absorbed duplicate is recorded as a compile drop with its merge reason.\n4. **Nit cap.** After dedupe, keep at most 5 Nits whose `consequenceKind` is `code-quality`; the overflow collapses to one summary entry and each collapsed Nit is recorded as `craft` at once. A Nit with a real consequence is never collapsed.\n5. **Per-finding verification + synthesis merge** (never the session model). Stage ids, cluster, dispatch one verifier per cluster (`model: $VERIFIER_MODEL`, reviewer engine; #230 immunity), apply `verification.apply_verdicts`, then one synthesis judge (`model: $SYNTH_MODEL`) groups root causes and `verification.merge_and_rank` merges under a coverage guarantee — synthesis drops nothing. Full contract: `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fverification-pass.md`.\n6. **Author-justification post-filter (PR mode only, after verification).** Cross-reference `prior-comments.json`. May drop **only** a finding whose verifier `verdict` is present and not **CONFIRMED**, recording the prior justification quoted. A **CONFIRMED** finding with a prior justification **survives**, stamped `challenge: \"author-justified\"` (ledger-visible). A finding with no verdict is never dropped here. Rules: `round-driver.md`.\n7. **PR-body honesty check (PR mode only).** From `pr.json`'s `body`, the review seat verifies the PR body carries a valid **DoD disposition table** (the `superheroes:dod-table` marker) against the issue\u002Fspec — one row per Definition-of-Done bullet, each `done` (with an evidence pointer) or `deferred` (with a filed issue `#NNN` and a one-line reason). Append an **Important** finding (cited at the PR body, `tradeoff: true`, author-resolved — it is a judgment call the author closes by writing the table, not a mechanical fix) when the table is missing, or a row's evidence or deferral is empty or hollow. A **missing** `\u003C!-- superheroes:build-record -->` boundary marker or a **missing** `\u003C!-- superheroes:degradations -->` section is the same finding shape — not a silent pass; an empty degradation list is only clean when that section says the literal **None** (absence and **None** differ). The seat also checks the owner half (above `\u003C!-- superheroes:build-record -->`) under `## What we're accepting` carries the **omission floor** (CONVENTIONS §10.7): enumerate (1) each deferred DoD row, (2) each blocking or important dispositions-table finding not fixed (by severity, not disposition label), and (3) each costly disclosed degradation under `\u003C!-- superheroes:degradations -->` (bullets, or **None** when empty) — each must have a matching consequence line in that section; same **Important** \u002F `tradeoff: true` \u002F author-resolved finding when one is missing. A bullet labelled [harmless] needs none; an unlabelled one reads costly. Branch mode has no PR body — skip. Contract: CONVENTIONS `§10.7`, `${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Freview-discipline.md`.\n\nDetermine the verdict per the base rubric's \"Verdict labels & mapping\" (count post-dedupe, post-synthesis findings). For `\u002Fsuperheroes:review-code` the labels are **READY FOR PR** \u002F **FIX BEFORE PR** \u002F **MAJOR FIXES NEEDED**:\n\n- 0 Critical, 0 Important → **READY FOR PR**\n- 0 Critical, 1+ Important → **FIX BEFORE PR**\n- 1+ Critical → **MAJOR FIXES NEEDED**\n- Only Minor and\u002For Nit → **READY FOR PR** (Minor\u002FNit are informational)\n\nA finding's outcome is settled when the loop ends, by its consequence and never its severity: a code-quality-only finding is a craft call, and a [leftover](${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Fglossary.md#leftover) comes to the owner unless an on-record decision settles it. Where this is written and read is in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Freview-record.md`.\n\nWrite the result to `$SESSION_DIR\u002Fround-\u003Cround>\u002Fcompiled.json` (preserve each finding's `tradeoff` field through dedupe so triage can read it):\n\n```json\n{\n  \"summary\": \"\u003C1-2 sentence overall summary>\",\n  \"verdict\": \"READY FOR PR\" | \"FIX BEFORE PR\" | \"MAJOR FIXES NEEDED\",\n  \"findings\": [\u003Cverified survivors, each stamped verdict: \"CONFIRMED\"|\"PLAUSIBLE\">],\n  \"drops\": [\u003Cverification REFUTED drops: {id, file, title, reason, was_blocking_tagged}>],\n  \"downgrades\": [\u003Cblocking→non-blocking re-tiers: {id, file, title, from, to, reason?}>],\n  \"unmatched\": [\u003Cverifier verdict ids that matched NO finding — the id-transport fidelity signal>],\n  \"unverified\": [\u003Cfinding ids that got no verdict this round — verifier silence; they survive PLAUSIBLE>],\n  \"ambiguous\": [\u003Cfinding ids carried by >1 verdict — honored as none (keep-on-uncertain), disclosed not silently dropped>]\n}\n```\n\nOrder findings: Critical → Important → Minor → Nit, then by file path, then by line.\n\n## Auto-Fix Loop (default path)\n\nThe loop is the only path. It is **driver-owned**: every per-round step is a `round_driver.py` call, `python3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py next --session-dir \u003Csession dir>` or `python3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py submit --session-dir \u003Csession dir>` (plus the fold flags shown below) — the old `code_loop_plan` plan\u002Frecord\u002Fdecide, the manual `circuit_breaker.py` call, and the head-diff step all collapse into obeying `next`. Full contract: `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fround-driver.md`.\n\n**Call form.** Call `round_driver.py`, `break_it.py`, `review_store.py`, `mode_reconcile.py`, `calibration_resolve.py`, `size_count.py`, `order_lint.py` and `dispatch_guard.py` as one plain line, `python3 -B \u003Cplugin root>\u002Flib\u002F\u003Cscript>.py \u003Cverb> \u003Cargs>`, with the resolved plugin root (the session bootstrap prints it as \"Plugin root (absolute)\") and the literal session folder written out. Substitute the real paths; never set shell variables that feed these calls (`ROOT_DIR=…`, `SESSION_DIR=…`) or continue the call over lines (assignments that only parse a call's printed output, as in `reference\u002Fsetup.md`, are not covered). The plugin's approval hook approves only that one form and sends every other form to the normal permission check.\n\n**If context was compacted mid-loop**, re-read `$SESSION_DIR\u002Fmeta.json`, `$SESSION_DIR\u002Floop-state.json`, and `$SESSION_DIR\u002Fdriver-journal.jsonl`. Resume by calling `next` — a pending step is returned again idempotently.\n\nAn unfinished session of generation 6 at state version 5 is continued: it finishes under the round cap it recorded at its start, and one waiting at a retired gate hands back. When any driver command answers `session-from-earlier-version`, the session is of generation 5 or older, or of generation 6 at an older state version, and is not continued: it restarts in a fresh session. The current generation is 7. Run Setup again into a fresh `$SESSION_DIR` and start the loop from Bootstrap there. In PR mode, Setup reads the PR's head from the remote, so the fix commits the interrupted loop made must be pushed to the PR branch under this skill's existing push rule (an adopted build with its explicit refspec) before Setup runs again; until they are, a stale adopted head is refused by Setup's own guard rather than reviewed. A branch-mode review has no PR and restarts from its local head, with nothing to push. Do this once, leave the old directory as it is, and do not stop or report the review as failed; the rest is in `reference\u002Fround-driver.md` § Transition — plugin versions under a live session.\n\n**Bootstrap.** `mkdir -p $SESSION_DIR\u002Fround-1`. Regenerate the diff **with the guarded per-round command from Setup** — the same `git diff \"$BASE_REF\"...HEAD` plus its failed-diff and empty-diff halts, never a bare copy; if `$BASE_REF` is not in this shell, restore and re-validate it first (Setup, \"If `$BASE_REF` is not in scope\"). Size it with `wc -l` only. First `next` seeds state. Pass **`--vendors`** — the live reviewer vendors, either a JSON list (`[\"codex\",\"cursor\"]`) or a comma-separated string (`codex,cursor`) — so the driver can seat a **different** auditor vendor for each fix (independent audit). An unparseable value, an unknown vendor, or the flag on non-fresh state **fails loud** (nonzero exit + `{\"ok\": false, \"reason\": ...}`) — never a silent default. **Omitting `--vendors` degrades every run to the single vendor `[\"claude\"]`:** the audit still runs but independence is **lost** and every terminal is stamped `-degraded` (e.g. `audited-chain-degraded`) — reserve that only for an environment that genuinely has one usable vendor. In PR mode also pass **`--prior-comments`** (the author-justification post-filter reads it; ignored when the file is absent) and **`--earlier-findings`** (the PR's earlier findings, so synthesis can mark repeats; see `reference\u002Fsynthesis-pass.md` § Repeats; the same record lets a returning PR's round 1 read only what changed, below). Write `\u003Csession dir>\u002Fearlier-findings.json` first: run `python3 -B \u003Cplugin root>\u002Flib\u002Freview_record.py read --pr \u003CPR number>` as one plain line and save the JSON it prints, whatever its exit; a `review-record-missing` refusal means the PR has no earlier record:\n\nTake the vendors list from the seat map's `liveVendors`, sorted (family-aware; #510) — the pool the driver seats independent fix-auditors from — and fall back to the reviewer and implementation engines when the seat map is unreadable. Write the seat map to `\u003Csession dir>\u002Fseat-map.json` only when `$SEAT_MAP` is a non-empty JSON object, and append `--seat-map \u003Csession dir>\u002Fseat-map.json` to the line below only then. Append `--break-it-interpreter=\u003Cvalue>` only when calibration sets `breakItInterpreter` (Setup's `BREAK_IT_ARGS`), shell-quoting the value so it stays one argument (a multiword launcher is written `--break-it-interpreter='uv run python'`; an empty configured value is `--break-it-interpreter=''`). Append `--copy-proof \u003Cpath>` to this first `next` only when the caller supplies a copy proof. This first `next` carries `--verify-command`, so the hook leaves it to the normal permission check by design:\n\n```bash\npython3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py next --session-dir \u003Csession dir> --diff-path \u003Csession dir>\u002Fround-1\u002Fdiff.txt --verify-command '\u003Cverify command, or none>' --vendors '\u003Cvendors JSON list>' --prior-comments \u003Csession dir>\u002Fprior-comments.json --earlier-findings \u003Csession dir>\u002Fearlier-findings.json --max-rounds 4\n```\n\nA fresh PR-mode session whose earlier record makes the returning-review decider (`lib\u002Freturning_review.py`) answer `changed` runs round 1 as a **returning round**: no panel, the scoped finder over what changed since the last reviewed commit, and `returning` recorded on round 1; every other session runs round 1 as before, and `next` tells you which by its first action. Round 1 is otherwise the round that dispatches the panel, and without the seat map no round-1 seat's vendor resolves, so every seat falls back to the safe stdout contract and the orchestrator must land each payload itself; passing the map keeps native seats on the direct-write path and records real vendor provenance (#1035). `--seat-map` is passed only when `$SEAT_MAP` is non-empty and parses as a JSON object, so a genuinely empty\u002Funset `$SEAT_MAP` never gets written to a file and handed to the driver.\n\n**The loop.** Until `action` is `terminal`:\n\n1. Parse `next` JSON: `{action, round, phase, attempt, expectedStateHash, payload}`.\n2. **Dispatch exactly one action** (panel, verifiers, synthesis, seams-check, second-test, audits, scoped-finder, verify, or apply-fixes) — one **driver phase**; `run-verify` and `apply-fixes` are fulfilled by this session itself; when that phase is panel, verifiers, or audits, fan its members out per `reference\u002Fround-driver.md` § Batch concurrency — every other phase is fulfilled once. Round 1 = full `reviewer-deep` panel (a returning PR's round 1 is a scoped-finder round, no panel); rounds 2+ = delta rounds (fix audits + scoped finder), never a panel; an unknown fix surface hands the PR back (`fix-surface-unknown`). Degraded\u002Fsingle-vendor: same driver, same journal, `independence: \"degraded\"` stamps — stay on the path. **Fold path:** roster-bearing `dispatch-*` phases may use the durable-record path (`record-result` \u002F `record-missing` + `advance` per `reference\u002Fround-driver.md` § Durable-record path) **or** the hand path (compile artifact + `submit`). The two fold paths are mutually exclusive per session (see §3 above).\n3. **Durable-record path:** write each seat's landing (orchestrator writes engine-seat landings from folded `dispatch-review` stdout), then `record-result` \u002F `record-missing` with echoed `round` and `phase` from step 1 — every runner-dispatched seat's `record-result` carries `--evidence-run-dir \u003Cthe completed dispatch-review run directory>`; omitting it leaves the seat's execution evidence absent — then `advance` — no hand `submit`. **Hand path:** write the artifact JSON, then `submit` with echoed `phase`, `attempt`, and `expectedStateHash`. **Rule before the call that sets `apply-fixes`:** record every ruling you will make on a round's findings (out of scope, or guidance) with `rule` (`reference\u002Fround-driver.md` § Owner and advisor rulings) before the call that sets the step. A finding can be ruled on from the fold that staged it, by the `findingKey` the verifiers and synthesis orders carry (a bare staged id does not resolve). On the durable-record path the `advance` whose fold queues a fix batch returns the `apply-fixes` payload itself, so record rulings before any `advance` that folds synthesis, the seams check, or the scoped finder. On the hand path a `submit` sets nothing, so record them before the `next` that follows that fold's `submit`. A ruling accepted while `apply-fixes` is pending rewrites that step's batch and guidance files; one recorded after you folded the step reaches the next round.\n4. **Nothing is presented to the owner mid-review.** A blocking finding only the owner's choice can settle (`tradeoff: true`) is held out of the fix batch; the build session does not make that choice, and the finding is handed back open. A `rule` decision (guidance, or out of scope) recorded on it is the in-session way to settle it. If it is still unsettled when nothing else is left to fix, the session ends `handed-back` \u002F `owner-choice-open` and the finding reaches the owner as a leftover at the vet.\n5. On `terminal`, read `payload.certification` and `round-receipt.json`; map `verdict` to `$ACTION`\u002F`$REASON` for `--result-file` (`converged` → `exit_clean`; every other verdict → `halt`).\n\n```bash\npython3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py submit --session-dir \u003Csession dir> --phase \"\u003Cphase>\" --attempt \u003Cattempt> --state-hash \"\u003CexpectedStateHash>\" --artifact \"\u003Csession dir>\u002Fround-\u003CN>\u002F\u003Cphase>-artifact.json\"\n```\n\n**Terminals to surface honestly:** scoped certifying finish (`audited-chain` \u002F `audited-chain-degraded` — say so, never imply a pristine fresh pass); the one recovery attempt when the same fix fails its audit in two rounds in a row (journaled; the fix step is set again, and none runs when the second failure is in the cap round); the handback at the cap (`handed-back` \u002F `round-cap` — every open finding, Important and Critical alike, with its outcome); the `handed-back` \u002F `fix-keeps-failing` handback (the fix still fails after the recovery attempt); the `handed-back` \u002F `owner-choice-open` handback (a finding only the owner's choice settles is still open; it reaches the owner as a leftover at the vet).\n\n**The extra audit round.** When a session hands the PR back at the cap with a fix the cap round applied and no audit checked, the advisor may order one [extra audit round](${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Fglossary.md#extra-audit-round) at the vet. The build session that holds the handed-back session directory orders it with `python3 -B \u003Cplugin root>\u002Flib\u002Fround_driver.py extra-audit --session-dir \u003Csession dir> --order-file \u003Cthe order file> --by \u003Cwho> --pr \u003CN>`, then continues the `next` loop to the terminal and writes the review record as usual. It is allowed once per PR; the refusals, the round and its record fields are in `reference\u002Fround-driver.md` § The extra audit round.\n\n**Red flags** — if you catch yourself thinking \"trivial fix \u002F obviously clean \u002F save tokens \u002F offer another round as optional\", call `next` and obey the driver instead.\n\n### Applying the fixes\n\nAt `apply-fixes` you fix the batch yourself, in your own working tree; no fixer agent is dispatched. The steps, the report and what to do on each refusal are in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fauto-fix-loop.md` § Applying the fixes. The driver derives the post-fix diff from git itself; a submitted `headDiff` or `headDiffPath` (from the **guarded** per-round command in Setup: `git diff \"$BASE_REF\"...HEAD` against the pinned base commit, with its failed-diff and empty-diff halts) is a cross-check against that derivation, a mismatch stops the round with `head-diff-mismatch`, and submitting none is allowed. `changedSubjects` is derived from git via that same guarded command, never from your report.\n\n### End-of-Loop Summary\n\n**If `--result-file` was passed**, write the terminal loop_state decision before printing the summary (atomic write via temp file):\n\n```bash\nROOT_DIR=\"${CLAUDE_PLUGIN_ROOT}\"\npython3 -B \"$ROOT_DIR\u002Flib\u002Freview_result.py\" write \\\n  --path \"$RESULT_FILE\" \\\n  --action \"$ACTION\" \\\n  --round \"$ROUND\" \\\n  --reason \"$REASON\"\n```\n\n(`$ACTION`, `$ROUND`, and `$REASON` are set on **every** terminal exit from the driver (`converged` → `exit_clean`; other terminal verdicts → `halt` with the receipt reason). `$RESULT_FILE` is the path supplied via `--result-file`. When absent, skip this step.)\n\nPrint: final verdict, rounds run, commits created, findings fixed by severity, **the driver receipt's `certification` block** (shape, `fullPanel`, `independence`, any `note` — `audited-chain` for a review that needed fixes vs `full-panel-confirmed` for a round-1 panel that found nothing to fix, degraded disclosures), **the seat map** (`$SEAT_MAP` — per-seat tiers + resolved models + any pin\u002Fdegradation disclosures), **`scriptRan` from the journal** (`round-receipt.json` → `scriptRan.invocations` and `byPhase` — the vet that the driver actually ran), **findings verification dropped (REFUTED)** as unsubstantiated, `was_blocking_tagged` drops, **findings downgraded from blocking to non-blocking** (`downgrades`; show `from → to`), **PLAUSIBLE-Critical `advisory: true` skips** (disclosed unproven blockers), auto-handled Minor\u002FNit, `unmatched`\u002F`unverified`\u002F`ambiguous`, and the findings the fix steps listed `unfixed`. Offer to push locally; do not push without confirmation.\n\nIn PR mode, after a `converged` terminal and before writing the review record, run `python3 -B \"$ROOT_DIR\u002Flib\u002Fpr_body_stage.py\" publish --session-dir \"$SESSION_DIR\" --pr \"$PR_NUMBER\"` (any other terminal skips it; the contract is in `reference\u002Fround-driver.md` § PR-body findings). In PR mode, on every terminal verdict, the loop ends by writing the review record from the session: `python3 -B \"$ROOT_DIR\u002Flib\u002Freview_record_session.py\" write --session-dir \"$SESSION_DIR\" --extras \u003Cextras file> --repo-root \u003Crepo root>`, per the full-lane section of `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Freview-record.md`. A PR-mode session abandoned before a terminal writes its record the same way with `--abandoned \"\u003Cwhy>\"`, per the same reference. Branch mode writes none. Put the record's URL in the summary.\n\n**Then, after the summary**, run the non-blocking end-of-run steps from `## Learning Loop & Staleness Nudge`: (1) the **staleness nudge** (print the doctor `message` only when non-null and `nudge_acked` is false). The **learning-loop proposal** and the **provisional-profile confirmation** are not run — the learning loop learns from choices the owner made, and a review session has no owner gate, so it asks the owner for none.\n\n## The verify command\n\nThe orchestrator's verify gate (loop step 12, run through `round_driver.py run-verify`, which runs the command and lands the result itself) runs the project's own verify command, read from the resolved profile (`$PROFILE`)'s `## Verify` section during Setup; the `apply-fixes` step runs only scoped checks, never this command. There is one branch: **`command: \u003Ccmd>` →** `VERIFY_CMD=\"\u003Ccmd>\"`. The gate runs `VERIFY_CMD` from the user's own working tree (never the PR head), non-interactively, with a timeout. A first `fail` runs the gate once more (a re-run that passes at a different head, or on changed working-tree contents such as a new file that is not ignored, halts); a second `fail`, or any other non-pass result, is a **HALT \u002F `CHECK_FAILED`** — the orchestrator surfaces the failing output and does not re-review on a broken tree.\n\nWhen no verify command resolves, review-code refuses at Setup before any dispatch and prints the refusal's message (`reference\u002Fsetup.md`).\n\n`meta.json` records only the command string (`verify`) so a cold-resumed orchestrator recovers it without re-reading the profile. A `{baseRef}` token in the command is bound to the pinned base commit at Setup and in the driver's `run-verify` payload (`reference\u002Fsetup.md`), so a touched-tests gate on a stacked branch diffs against the PR base, not main; with no full-hex pin the token stays and the gate refuses loudly.\n\nTest-receipt evidence policy: `rubric\u002Ftest-receipt-evidence.md`.\n\n## Learning Loop & Staleness Nudge\n\nFor recurrence handling, coverage decisions, dimension skipping, tier cascade, final confirmation, and telemetry, use `plugins\u002Fsuperheroes\u002Freference\u002Freview-loop.md` as the shared loop contract. This skill owns only its leg-specific setup, reviewer framing, and gate-write rules. The triage subagent prompt template, verification rules, and common mistakes for this skill are in `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Freview-code\u002Freference\u002Fauto-fix-loop.md`; other subagent prompt bodies live in `${CLAUDE_PLUGIN_ROOT}\u002Frubric\u002Forders\u002F\u003Cphase>.md` and are rendered by the driver.\n",{"name":5,"description":7,"user-invocable":24},true,"main","29c87a13937804687577d3b71e3005f63883f35c","plugins\u002Fsuperheroes\u002Fskills\u002Freview-code",0,"https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes","https:\u002F\u002Fgithub.com\u002Fzwrose","Learning, tinkering, and other such stuff. ","2026-11-15 04:46:57",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":24},[35,38,41],{"tool":36,"command":37},"npx","npx skills add zwrose\u002Fsuperheroes --skill review-code",{"tool":39,"command":40},"bunx","bunx skills add zwrose\u002Fsuperheroes --skill review-code",{"tool":42,"command":43},"pnpm","pnpm dlx skills add zwrose\u002Fsuperheroes --skill review-code","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002FSKILL.md",[46,52,56,60,64,68],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"reference\u002Fauto-fix-loop.md","REFERENCE","参考文档",78705,"https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002Freference\u002Fauto-fix-loop.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"reference\u002Freview-record.md",59944,"https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002Freference\u002Freview-record.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"reference\u002Fround-driver.md",157491,"https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002Freference\u002Fround-driver.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"reference\u002Fsetup.md",23684,"https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002Freference\u002Fsetup.md",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"reference\u002Fsynthesis-pass.md",14207,"https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002Freference\u002Fsynthesis-pass.md",{"path":69,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":70,"sourceHtmlUrl":71},"reference\u002Fverification-pass.md",20853,"https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-code\u002Freference\u002Fverification-pass.md",[73,80,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M75C14YXJ1W26N03VHRDP38K","test-pilot-plan","Use when a PR\u002Fbranch needs a manual test plan with seeded data — \"write a test plan\", \"seed test data for this PR\", \"set up manual testing\". Seeds scenarios via the test-pilot engine and posts a checkbox plan to the PR. Does NOT execute the plan (that is test-pilot-execute).","https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Ftest-pilot-plan\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M75C11VXVBT356RSPSYFHM2W","test-pilot-init","Internal helper reached from `superheroes:configure` to refresh test-pilot's profile, seeding blocks, and browser tooling layer. Not a front door; owners run `superheroes:configure` instead.","https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Ftest-pilot-init\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M75C0YKSEDN9TQCSA2MY01WQ","test-pilot-execute","Use when a test-pilot plan should be exercised before human spot-check — \"run the test plan\", \"pilot this PR\", \"verify the branch in the browser\". Drives the app via a browser MCP, or the lane's simulated iPhone, and posts a results comment. Observe-and-report only — a bug it finds is a finding, never an edit.","https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Ftest-pilot-execute\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M75C0FC2AADQP6HR4XC94NV0","showrunner-handoff","Use in the showrunner advisor seat you are leaving while it is still alive — deliberate handover before the seat goes dark. Leaves durable state for the incoming seat. Emits no paste block. Not checkpoint (`\u002Fcompact`); not showrunner-resume (incoming seat).","https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Fshowrunner-handoff\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M75C0C5908SMD71067S8JJGR","review-init","Internal helper reached from `superheroes:configure` to refresh review-crew's calibration layer for a project. Not a front door; owners run `superheroes:configure` instead.","https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Freview-init\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M75C03Q2TVB7N66V95WXCHHR","guardian","Use to run the Guardian sweep — a periodic read-only sweep of repo health (duplication, complexity, coupling, dependency and doc freshness, dead code). Reports maintainability drift since the last sweep as plain-language consequences; it never edits code or files issues. Not code review of a change (that is review-code).","https:\u002F\u002Fgithub.com\u002Fzwrose\u002Fsuperheroes\u002Fblob\u002Fmain\u002Fplugins\u002Fsuperheroes\u002Fskills\u002Fguardian\u002FSKILL.md",[],[]]