Skip to content

/review now always runs its Codex second-model review and the Red Team on large diffs (GST-4097) - #4870

Merged
capy-ai[bot] merged 8 commits into
mainfrom
review-requires-second-model-review
Nov 28, 2026
Merged

capy-ai[bot] merged 8 commits into
mainfrom
review-requires-second-model-review

Conversation

@garrytan

@garrytan garrytan commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

/review now always runs its Codex second-model review when Codex is ready, runs the Red Team on diffs over 200 lines, and a headless session can no longer end while its background reviewers are still running.
Why: in a recent headless eval, Claude Opus skipped both steps in every run because /review called the Codex pass optional and its end-of-skill check never looked for either.
Nothing to do: Codex users get the extra review automatically; a missing or disabled Codex is still a recorded skip.

What changed
  • Codex runs through one command. Both Codex passes in standalone /review now run through gstack-outside-voice run --pass adversarial|structured, which prints the review and always ends with its own OUTSIDE_STATUS: line (also on refusal, timeout, an unavailable CLI or a crash). The line is printed first too when --show is on, so a host that keeps only the head of a long result still sees it. The same reasoning-effort order as before applies (GSTACK_CODEX_EFFORT, then codex_effort, then the gate default) through the new --effort flag, and the harness check still runs right before Codex starts.
  • The end-of-skill check requires it. /review's contract gains an outside-voice item, met only by that command's own status line for the adversarial pass, or by the latest preflight printing a non-ready CODEX_MODE: (not installed, disabled, not signed in); a later unverified (rate_limited) preflight still requires the run. Assistant prose, a hand-written codex exec, an echoed status line or another pass's line does not count.
  • Red Team on large diffs. When Bash prints DIFF_LINES: over 200, the specialist item also requires a red-team dispatch; /review names it on its selection line.
  • Headless sessions wait for reviewers. In a headless or unattended session the Stop hook blocks every stop while Agent dispatches the run started are still running (until they report or stall for 10 minutes), and that hold no longer uses up the one contract block. It reads the completion record Claude Code itself writes, so a finished reviewer releases the hold at once.
  • Wording. Standalone /review no longer calls the Codex pass optional. /gstack-ship is unchanged.
Blast radius

/review on Claude Code (its Codex step, its contract and the Stop hook), bin/gstack-outside-voice (new flags; existing flags unchanged) and lib/outside-voice-runner.ts (effort precedence, one end-to-end deadline). Codex-hosted /review and /gstack-ship render the same as before. Reviewer briefs are byte-identical to main (replay GST-4097).

Documentation

Status: current. The read-only audit of review-requires-second-model-review (base 260a505, head 63c8d68) found that the docs match the code.

Scope: 36 changed files, including the authored docs docs/skill-routing-and-contracts.md and docs/unattended.md, the changelog.d fragment, the review/SKILL.md.tmpl template and review/sections/review-army.md. I checked them against lib/skill-contract.ts, the Claude Stop hook and bin/gstack-outside-voice. The worktree has no staged, unstaged or new files.

Documentation health

  • docs/skill-routing-and-contracts.md: Current. The large_diff option, the outside_voice item kind and the headless agents-running block match the code.
  • docs/unattended.md: Current. The --pass, --effort, --append-diff and --show flags and the OUTSIDE_STATUS rule match the code.
  • changelog.d/review-requires-second-model-review.md: Current. The wording is accurate.
  • review/SKILL.md.tmpl and review/sections/review-army.md: Current.
  • docs/skills.md and docs/model-policy.md: Current. Nothing in them contradicts the change.

Coverage debt: The /review section of docs/skills.md doesn't say that the Codex second-model review is required when Codex is ready, or that the Red Team pass runs on diffs over 200 lines.

Diagram drift: None found.

Testing

Keyless tests only, no paid runs: test/outside-voice-status-line.test.ts (a status line on every outcome, --show, --append-diff, --effort, cleanup on crash), test/skill-contract-review-voice.test.ts (the captured Opus-like transcript now reads UNMET; forgery, pass mix-up, stale-preflight and Red Team cases), and new headless cases in test/skill-contract-stop-hook.test.ts, including a native Claude Code completion record that releases the hold for its own agent only. Existing Codex invocation, effort, hardening and routing tests now assert the new command for /review and keep their /gstack-ship coverage.

Agent notes

Thread GSTA-888, issue GST-4097, diagnosis from GSTA-886 (Option B).

Review: 4 passes. Passes 1 and 2 fixed every blocker; pass 3 and the final read-only review of 32a36c3 found no blocker from the specialist, Red Team or native adversarial readers. The second-model review (GPT-6.2 Sol) raised 5; findings 1 and 2 were fixed in 63c8d68 as ruled edits (a scoped reader checked the two test edits, clean), and 3 to 5 ship as ruled notes. Docs re-audit gsta888-docs-2: current. Paid evals: none run (keyless brief); the release gate on main runs the census.

REVIEW_LOOP: passes=4 blocking_found=10 deferred=0 noted=22 fixed=20 scope=frozen open=3 dispatches=16
Ruled note: lib/outside-voice-runner.ts:157:outside-voice at 32a36c3 ruled by GStack Minder (relayed from GSTA-36:2026-11-28T10:07Z) at 2026-11-28T10:11:03.180Z: Windows minimal support (R50): the Codex probe launch failing on native Windows ends the second-model review as failed, not the run; windows-smoke passed (approval a-14cb95e3cca1)
Ruled note: lib/outside-voice-runner.ts:182:outside-voice at 32a36c3 ruled by GStack Minder (relayed from GSTA-36:2026-11-28T10:07Z) at 2026-11-28T10:11:03.520Z: below the R12 floor: on timeout only the direct Codex child is killed, and its descendants run in a read-only sandbox (approval a-7bcb8fbc3efc)
Ruled note: test/helpers/outside-voice-evidence.ts:217:outside-voice at 32a36c3 ruled by GStack Minder (relayed from GSTA-36:2026-11-28T10:07Z) at 2026-11-28T10:11:03.877Z: below the R12 floor: a paid-eval helper counts an unverified status as a review; no test fails and no production path uses it (approval a-397b6170f0fe)
Ruled note: edit:lib/skill-contract.ts at 63c8d68 ruled by GStack Minder (relayed from GSTA-36:2026-11-28T10:07Z) at 2026-11-28T10:11:04.230Z: fixes for findings 1 and 2 after the read-only final review, shipped as ruled edits with no new review round; CI checks them (approval a-b60d42a7b3c6)
Ruled note: edit:test/skill-contract-stop-hook.test.ts at 63c8d68 ruled by GStack Minder (relayed from GSTA-36:2026-11-28T10:07Z) at 2026-11-28T10:11:04.566Z: regression test for finding 1 (native task-notification attachment releases the headless hold), failing without the fix (approval a-711560022b2a)
Ruled note: edit:test/skill-contract-review-voice.test.ts at 63c8d68 ruled by GStack Minder (relayed from GSTA-36:2026-11-28T10:07Z) at 2026-11-28T10:11:04.923Z: regression test for finding 2 (a later unverified (rate_limited) preflight replaces an earlier not_authed skip), failing without the fix (approval a-62bdffb31c1a)
Plan: exempt: bug fix to /review's contract (GST-4097, Option B diagnosis in GSTA-886)

{
  "schema_version": 1,
  "pr": 4870,
  "head": "63c8d680f4197720a2d2092a3d907264dc207ad7",
  "version": "1.104.2.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 346,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 51,
  "session_kind": "unattended",
  "run": "ship-GSTA-888",
  "head_tree": "c5f3fd298524539a6213ca5462257ad55a9d823c",
  "product_patch_id": "f94b00b3f6f70b1e6ce7067624a57dc4163389ea",
  "gstack_version": "1.104.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 330,
    "rules": "33831f8248a814fd",
    "base": "bbe63d1de3541162005afad40450860e791a0d61",
    "registry": "bbe63d1de3541162005afad40450860e791a0d61",
    "gate_scan": {
      "tagged": 0,
      "head": "63c8d680f4197720a2d2092a3d907264dc207ad7"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=330"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @c5f3fd298524 (8 checks, current for 63c8d680f419)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/46133772648/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/46133772679/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=c5f3fd298524 tests=38656 skipped=103 runs=46133772648/1 profiles=ci-reuse/free-tests heads=63c8d680f419 base_moved=bbe63d1de354 verified=2026-11-28T10:14:49.360Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "README.md, CONTRIBUTING.md and docs/*.md (except docs/troubleshooting.md, owned by another lane); edited docs/unattended.md"
  },
  "review_loop": {
    "passes": 4,
    "blocking_found": 10,
    "deferred": 0,
    "noted": 22,
    "fixed": 20,
    "scope": "frozen",
    "rounds": 4,
    "dispatches": {
      "specialist": 12,
      "red-team": 4
    }
  },
  "ruled_notes": [
    {
      "finding": "lib/outside-voice-runner.ts:157:outside-voice",
      "head": "32a36c33d01bd6a6b46cd3c1c4bf2d5f0934d629",
      "by": "GStack Minder",
      "reason": "Windows minimal support (R50): the Codex probe launch failing on native Windows ends the second-model review as failed, not the run; windows-smoke passed",
      "at": "2026-11-28T10:11:03.180Z",
      "approval": "a-14cb95e3cca1",
      "relayed": "GSTA-36:2026-11-28T10:07Z"
    },
    {
      "finding": "lib/outside-voice-runner.ts:182:outside-voice",
      "head": "32a36c33d01bd6a6b46cd3c1c4bf2d5f0934d629",
      "by": "GStack Minder",
      "reason": "below the R12 floor: on timeout only the direct Codex child is killed, and its descendants run in a read-only sandbox",
      "at": "2026-11-28T10:11:03.520Z",
      "approval": "a-7bcb8fbc3efc",
      "relayed": "GSTA-36:2026-11-28T10:07Z"
    },
    {
      "finding": "test/helpers/outside-voice-evidence.ts:217:outside-voice",
      "head": "32a36c33d01bd6a6b46cd3c1c4bf2d5f0934d629",
      "by": "GStack Minder",
      "reason": "below the R12 floor: a paid-eval helper counts an unverified status as a review; no test fails and no production path uses it",
      "at": "2026-11-28T10:11:03.877Z",
      "approval": "a-397b6170f0fe",
      "relayed": "GSTA-36:2026-11-28T10:07Z"
    },
    {
      "finding": "edit:lib/skill-contract.ts",
      "head": "63c8d680f4197720a2d2092a3d907264dc207ad7",
      "by": "GStack Minder",
      "reason": "fixes for findings 1 and 2 after the read-only final review, shipped as ruled edits with no new review round; CI checks them",
      "at": "2026-11-28T10:11:04.230Z",
      "approval": "a-b60d42a7b3c6",
      "relayed": "GSTA-36:2026-11-28T10:07Z"
    },
    {
      "finding": "edit:test/skill-contract-stop-hook.test.ts",
      "head": "63c8d680f4197720a2d2092a3d907264dc207ad7",
      "by": "GStack Minder",
      "reason": "regression test for finding 1 (native task-notification attachment releases the headless hold), failing without the fix",
      "at": "2026-11-28T10:11:04.566Z",
      "approval": "a-711560022b2a",
      "relayed": "GSTA-36:2026-11-28T10:07Z"
    },
    {
      "finding": "edit:test/skill-contract-review-voice.test.ts",
      "head": "63c8d680f4197720a2d2092a3d907264dc207ad7",
      "by": "GStack Minder",
      "reason": "regression test for finding 2 (a later unverified (rate_limited) preflight replaces an earlier not_authed skip), failing without the fix",
      "at": "2026-11-28T10:11:04.923Z",
      "approval": "a-62bdffb31c1a",
      "relayed": "GSTA-36:2026-11-28T10:07Z"
    }
  ],
  "gate_dispositions": []
}

Open in Capy

garrytan and others added 6 commits November 28, 2026 08:51
… diffs, and wait for background agents

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p2/outside-voice#1 reader=outside-voice
Review-Finding: p2/outside-voice#2 reader=outside-voice
Review-Finding: p2/outside-voice#3 reader=outside-voice
Review-Finding: p2/outside-voice#4 reader=outside-voice
Review-Finding: p2/outside-voice#5 reader=outside-voice
Review-Finding: p2/adversarial-native#1 reader=adversarial-native
Review-Finding: p2/adversarial-native#3 reader=adversarial-native
Review-Finding: p2/adversarial-native#4 reader=adversarial-native
Review-Finding: p2/adversarial-native#5 reader=adversarial-native
Review-Finding: p2/adversarial-native#6 reader=adversarial-native
Review-Finding: p2/specialist-batched#1 reader=security
Review-Finding: p2/specialist-batched#2 reader=testing
Review-Finding: p2/red-team#1 reader=red-team
Review-Finding: p2/red-team#2 reader=red-team
Review-Finding: p2/red-team#3 reader=red-team
Review-Finding: p2/red-team#4 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 28, 2026 09:43
…s, and update review invocation tests

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…rds, and let a later rate-limited preflight require the Codex pass

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 3af268b into main Nov 28, 2026
58 checks passed
@garrytan garrytan mentioned this pull request Nov 28, 2026
capy-ai Bot added a commit that referenced this pull request Nov 28, 2026
- Dependency and CI action updates, each checked against its publisher. (#4873)
- The PR body check no longer loses the closing Agent notes section when the text quotes a `<!--` comment opener in inline code or a code block, (#4874)
- `/gstack-ship` stops mistaking ordinary text for Capy ids, and checks every part of a public PR body it posts. (#4872)
- `/gstack-ship` no longer puts home folder paths or Capy thread and message ids into PR bodies on public repositories. (#4868)
- `/gstack-ship` no longer stops or blocks because of time and tokens that belong to something else. (#4877)
- /gstack-ship keeps its token cap and clock when its budget start reruns mid-run. (#4882)
- `/gstack-ship` stops reopening findings that were already settled, and a missing run folder no longer costs a docs-audit attempt. (#4875)
- `/gstack-ship` closes five gaps in how it records reviews, and `--for gstack-ship` now installs the ship skill on Capy. (#4867)
- The stable release no longer skips a fully tested commit because a report-only workflow failed on it. (#4865)
- A test that copies its own `bun` binary no longer stops `/gstack-ship` with a fetch violation. (#4876)
- The secrets check no longer reports an 11-digit GitHub Actions run id as a phone number when code names it with a camelCase run identifier (#4881)
- `/review` now always runs its Codex second-model review when Codex is ready, and runs the Red Team on diffs over 200 lines. (#4870)
- The factory scorecard's red-train rate now counts each train (one batch of PRs tested together) once per report, by its branch, so re-testing the same batch inside the report's window no longer moves the rate. (#4880)
- The secrets check catches more Google API keys in encoded text, reads each JavaScript and TypeScript declaration under its own name, reports a provider key once, and stops matching look-alike values against your environment's secrets. (#4871)
- The secrets check now catches keys in JavaScript, TypeScript and Go declarations, and stops flagging JSON key paths, run folders and base64 noise. (#4869)
- The paid shared-code review test no longer fails a correct review that printed a caller file with `cat -A`. (#4878)
- The weekly benchmark line in the stable release plan now also strips C1 control characters and the Unicode line and paragraph separators (U+2028, U+2029) from record text, (#4866)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
stackpt-agent added a commit to dtoelke/gstack that referenced this pull request Nov 28, 2026
Upstream now covers two of the fork's patches, so the merge takes
upstream's code for both and drops the fork's copies:

- supervise: the stall guard counting CPU across the runner's process
  tree landed upstream in garrytan#4533 (50cc282). That change is also where the
  sync first conflicted, on 2026-11-19.
- oversize approval: upstream reviews a diff over the 2,000,000-byte
  ceiling in up to 8 slices (garrytan#4853, e3f916b; garrytan#4870). The fork's
  owner-approved oversize route, its receipt field, ship steps, docs and
  test are removed.

Re-applied on upstream, which still lacks them:

- literals: for an uppercase constant, a JS/TS test of a JS/TS module
  counts through the module only where it quotes the module's path whole
  outside a comment. That keeps upstream's run-by-path consumers
  (garrytan#4312) and its shared-name resolution (garrytan#4723), and still drops a
  comment or a shell command that mentions the path.
- the removed-path lane waiver.
- the per-config vitest split, the vitest_scripts key and the runnerless
  package deferral.

fork/README.md lists only these and the fork wiring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant