Skip to content

Count an outside review as clean only when it ends with a VERDICT line - #4140

Merged
capy-ai[bot] merged 11 commits into
mainfrom
outside-reviews-end-with-a-verdict-line
Nov 7, 2026
Merged

capy-ai[bot] merged 11 commits into
mainfrom
outside-reviews-end-with-a-verdict-line

Conversation

@garrytan

@garrytan garrytan commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

An outside review (Codex or Claude Code giving a second opinion in /ship, /review, /codex, /autoplan and the plan reviews) now counts as clean only when its last line is exactly VERDICT: CLEAN or VERDICT: FINDINGS. This serves the README's promise of a reviewer who finds production bugs: a review that names a problem can no longer pass the merge check because its prose also says "no issues".

{
  "schema_version": 1,
  "pr": 4140,
  "head": "40c1de4e2aa8f191b84dcb30f1d9fa146bb48747",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1632,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42418150943,
      "attempt": 1,
      "tree": "ca027c9242addba3867502eb73629203be5bca80"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "ca027c9242addba3867502eb73629203be5bca80",
  "product_patch_id": "04c6f33d7b7f58db13ec139dfaf77885529b0a66",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 385,
    "rules": "c6a079fdf812f479",
    "base": "5f9b7ef2090757dbe5dcd3a3d57eff1ee5f6ed6f",
    "registry": "5f9b7ef2090757dbe5dcd3a3d57eff1ee5f6ed6f",
    "gate_scan": {
      "tagged": 0,
      "head": "40c1de4e2aa8f191b84dcb30f1d9fa146bb48747"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=385"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @ca027c9242ad (8 checks, current for 40c1de4e2aa8)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42418150943/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42418151014/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=ca027c9242ad tests=36225 skipped=105 runs=42418150943/1 profiles=ci-reuse/free-tests heads=40c1de4e2aa8 verified=2026-11-07T22:05:22.036Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md and the two changelog.d fragments at base 5f9b7ef"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 4,
    "deferred": 0,
    "noted": 8,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 3,
    "rounds": 4,
    "unrecorded": 4,
    "ledgers_read": 6,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  }
}

An outside reviewer's reply now counts as clean only when its last line is exactly VERDICT: CLEAN. Prose such as "No issues found in the diff." can no longer pass /ship's and /review's merge check. This serves the README goal of reviews you can trust before a merge.

What changed

How /ship reads four outside-review replies on main (before) and on this branch (after): prose no longer passes, only a last-line VERDICT: CLEAN does

How /ship reads four outside-review replies on main (before) and on this branch (after). Prose no longer passes; only a last-line VERDICT: CLEAN does.

Before/after as text: How /ship reads four outside-review replies on main (before) and on this branch (after): prose no longer passes, only a last-line VERDICT: CLEAN does
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+prose only, no verdict line                        -> unverified
+problem written before the no-issues sentence      -> unverified
-prose only, no verdict line                        -> clean
-problem written before the no-issues sentence      -> clean
 untagged numbered problems above VERDICT: CLEAN    -> unverified
+reviewer ends with VERDICT: CLEAN                  -> clean
-reviewer ends with VERDICT: CLEAN                  -> unverified
 

Why

Every rule gstack had for reading a "no issues" sentence let some reply that named a problem pass the merge check. One example is "The fallback swallows ENOENT; no issues in the diff." Now the reviewer has to end with VERDICT: CLEAN or VERDICT: FINDINGS. A reply without that line is missing coverage, never a pass.

Blast radius

Every outside-review prompt now asks for the verdict line: /ship, /review, /codex, /claude-code, /autoplan, the plan reviews, /office-hours, /design-review and /document-release. Codex's structured review and the default /codex review move from codex review --base to codex exec with the same base diff. A reply without the line reads unverified. The replay of 681 captured parser inputs found 0 moving toward clean, so the change can only fail closed (script ran: ~/.capy/work/gst1821/replay.json).

Approvals

Approved: yes (record r-979f6e9379ea). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: exempt: bug fix (Captain ruling on GST-1821, no /autoplan)
Plan check: exempt bug fix

Summary

Outside reviews used to pass when their prose said there were no issues, even when the same reply named one. The reviewer now ends with a fixed verdict line, and the parser reads the token from the raw last line, outside any code fence. P0/P1 findings and a last Verdict: not ready still block whatever the line says. VERDICT: CLEAN beside numbered items with no severity reads unverified. /codex review stops before calling Codex when it can't write the diff into the prompt. Codex's structured review appends the base diff to its prompt in one guarded write. The changelog has the entry plus a correction to #4136's earlier claim. A failing-first commit (dae2464) came before the fix: 29 of 37 cases failed on main f97c0dd, including all four forms named in the issue.

Test Coverage

All changed runtime paths have a changed test. The Step 7 audit read the one flagged file (office-hours/sections/visual-design.md, a one-blank-line re-render of the shared outside-voice block) and found it covered by the resolver tests and the generated-docs freshness guard.
Tests: 1751 → 1751 (+0)
Coverage: 100% value-weighted (100% including 0 weakly covered paths)
Test value: 0 tests written, 1 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered.
Tests ran: free carried from CI (see the receipt)

Pre-Landing Review

Pass 1 (full, gate class) found 2 red-team items: red-team#2 was fixed (e595e45, 215e240) and red-team#1 is a note. The first fix-check noted 1 item. Step 11's voices raised 3 blocking findings at the round cap. The Captain granted one extra fix round, which landed in 248da98 and covered outside-voice#1, outside-voice#2, adversarial#3 and adversarial#2. Its fix-check (grant a-9320694eef7f) found no blocking issue. A CI-only test repair after review (40c1de4) got one more scoped fix-check (grant a-41e827ff0b0d), which also found no blocking issue.

REVIEW_LOOP: passes=1 blocking_found=4 deferred=0 noted=8 fixed=1 scope=frozen unrecorded=4 ledgers_read=6 fix_checks=3 dispatches=2

Gate edits: partial (50 of 61 eligible read by the scan; all 66 listed hunks summarized from the artifact), 0 findings

Outside review: openai/gpt-6.1-sol ran at Step 11 (v1) and raised 2 findings, both fixed in 248da98.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL lib/outside-review-result.ts:280 VERDICT: CLEAN beside numbered advisory steps (e.g. '[P2] ... Suggested fix: 1. ... 2. ...' or a plan review's '1. Premises are valid.') now reads unverified/untagged_review instead of clean; fails closed; frequency on real review-gate replies unmeasured.
  • INFORMATIONAL lib/outside-review-result.ts:251 Only numbered items count as unlabeled findings, so a bulleted or 'Finding N:' unlabeled finding beside VERDICT: CLEAN still reads clean on the structured gate (same before and after the fix).
  • INFORMATIONAL scripts/resolvers/outside-voice.ts:138 The structured gate inlines the whole base diff into codex exec's prompt with no size limit; a very large diff can exceed context and return MISSING COVERAGE (fails closed).
  • INFORMATIONAL test/fixtures/review-pins/replays/GST-1821.json:1 The no-loss evidence (54 probe replies, 681-input replay) was rerun only through the new parser; no run exercised the changed Codex structured prompt shape (diff inlined as REPOSITORY CONTEXT, host scope sentence dropped), so rule-15 no-loss for that prompt change is unproven.
  • INFORMATIONAL changelog.d/outside-reviews-end-with-a-verdict-line.md:1 The changelog says VERDICT: CLEAN beside untagged numbered items reads unverified in /ship and /review; /codex review (structured gate) reads it unverified too and is not named.
  • INFORMATIONAL changelog.d/outside-reviews-end-with-a-verdict-line.md:1 The changelog's consult/challenge FINDINGS: unspecified claim holds only when the numbered items carry no severity tag; a tagged item prints its severity (e.g. FINDINGS: P2).
  • INFORMATIONAL docs/skills.md:1359 The /codex Review sentence still says PASS/FAIL; the codex exec review gate can also read UNVERIFIED when the reply lacks a last VERDICT: line.

Agent notes

  • Ruled note (Captain, "Grant, note"): fix-check p4#4. The Codex structured prompt now pastes the base diff as REPOSITORY CONTEXT, and no paid no-loss run used that prompt shape. The Captain ruled that this ships as a note: the prompt carries the same diff the old prompt told Codex to fetch, and the finding instructions are unchanged.
  • Other fix-check notes (p4): CLEAN beside numbered advisory steps now reads unverified, which fails closed. Bulleted or "Finding N:" untagged items beside CLEAN still read clean. The structured prompt's inlined diff has no size limit, which fails closed. Notes from the last check (p5): the changelog doesn't name /codex review for the untagged-CLEAN case, its FINDINGS: unspecified claim covers only untagged items, and docs/skills.md's Review sentence doesn't mention UNVERIFIED.
  • Earlier notes, not fixed: red-team#1: VERDICT: FINDINGS versus the validator's VERDICT: findings differ in case. adversarial#5: users who set only review_model now get the default model, and CODEX_REVIEW_MODEL_CONFIG_FLAG and its resolver are now unused (left in place, out of scope). adversarial#6: other plan reviews rely on the host to request the line, so they fail closed. p2 fix-check#1: the changelog correction says "above" but folds below. Docs audit: the review_model note in docs/hosts.md may be stale.
  • No-loss probe (CREW rule 15), preregistered in ~/.capy/work/gst1821/probe/PREREG.md and scored in scored.json. Setup: gpt-6-astra at high effort, 9 seeded repos x 3 arms x 2 trials = 54 runs, plus 2 unscored calibration runs, $11.73 total. Every arm caught the seeded bug 12/12: codex review --base, codex exec with the verdict prompt, and a plain prompt with no gstack. All three arms are saturated, so the probe can't rule out a loss on subtler bugs. On the exec arm, 18/18 replies carried the verdict line. Its 6 clean-case replies all read clean (the old classifier read all 6 as unverified), and its 6 pagination replies (advisory P2) read clean with FINDINGS: P2. Every codex review --base reply lacks the line, so all 18 read unverified or findings under the new parser. After the fix round, all 54 scored replies kept their verdicts (0 changed).
  • Free replay (~/.capy/work/gst1821/replay.json): 681 distinct parser inputs, captured from 20 consumer test files at main plus 22 fixture replies. 0 moved toward clean. 146 moved from clean to unverified: every review or structured input that read clean on main, since none carries the line. The counts were identical after the fix round.
  • Paid evals: the owner chose "A. No screen" (--no-screen). The earlier selection was 35 paid behavioral probes at about $67.66. Paid coverage is deferred to the release gate, which gates main every 8 hours before anything reaches stable.
  • Base: main was merged into the branch at f8914e9 before Step 9 under the Captain's brief, and the merge was clean.
  • Captain decisions: the verdict-line design (2026-11-07 ruling); routing Codex's structured review and the default /codex review through codex exec ("A", 2026-11-07); and approval of the probe run ("Run. The $18 cap is hard."). The extra fix round and the cap raise to $55 are grant a-aec3882c9d48, re-recorded as a-9320694eef7f. The post-review fix-check is grant a-41e827ff0b0d.
  • Local test note: test/outside-consent.test.ts fails 2 cases only when GSTACK_CAPY=1 leaks into the test environment (same on main). test/design-lint-app-profile.test.ts times out on this machine (a browser environment issue from Let the design lint check one section of a running app for crowded rows, cramped help text, loud notes and small tap targets #4138, untouched by this PR). CI is the judge for both.

Exploratory QA

Pass at 1de52b0: 3 smoke probes on the classifier CLI. A clean reply with the line read clean (exit 0), a reply with no line read unverified (exit 4), and [P1] under CLEAN read findings (exit 3).

Eval Results

Prompts changed. Paid evals were not run, by the owner's choice (A. No screen); paid coverage is deferred to the release gate.

Scope Drift

Scope Check: CLEAN. The fix round touched only the four granted findings and the size pins they moved. Later commits are the changelog, the docs audit and the CI test repair.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The plan is exempt as a bug fix by Captain ruling on GST-1821.

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. One factual correction to docs/skills.md.

Scope: base 5f9b7ef..7973696 on outside-reviews-end-with-a-verdict-line: 56 files across 9 commits, with no staged, unstaged or new files. The diff makes outside reviews count as clean only from a last-line VERDICT: CLEAN or VERDICT: FINDINGS, and moves /codex review onto codex exec.

Documentation health:

  • docs/skills.md: updated. The /codex Review mode description now says the review runs through codex exec with gstack's prompt, not the built-in codex review.
  • docs/troubleshooting.md: current. The verdict-line rules and the outside-review-missing-verdict anchor are already in this diff.
  • docs/hosts.md: current. The note that native codex review reads review_model first is flagged for a check.
  • AGENTS.md, README.md, CLAUDE.md, CONTRIBUTING.md: current.

Coverage debt: the missing_verdict reason has reference coverage only, in docs/troubleshooting.md and lib/gate-outcomes.ts. docs/skills.md does not describe the VERDICT line in the Review mode text.

Diagram drift: none.

Test plan

  • bun run test (free suite): carried from CI at the final head (see receipt)
  • Focused at 248da98/40c1de4: outside-review parser tests 161 pass; prose-voice-floor 16 pass

🤖 Generated with Claude Code

Open in Capy

garrytan and others added 3 commits November 7, 2026 19:57
…erdict

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Every outside-review prompt now asks the reviewer to end with exactly
VERDICT: CLEAN or VERDICT: FINDINGS, and the parser reads a pass only from
that line. Prose no-findings sentences are no longer evidence for clean.
Codex's structured review and /codex review run through codex exec, since
codex review --base takes no prompt and could never give the line.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits November 7, 2026 20:30
…broke (GST-1821)

The outside brief, both adversarial sections and the review-army prompt-file line now carry the last-line VERDICT request; their pins move under the preregistered no-loss replay GST-1821. Test fakes that wrote a clean reply now end it with VERDICT: CLEAN, the review carve marker follows the codex exec sentence, size pins drop where skills shrank, and the plan-review prompt-file line is shortened so /plan-eng-review stays at its pin.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… it now needs

CI's free-suite shard 5 failed at 1de52b0 with 18 cases in test/model-role-invocation.test.ts: the fake Codex reply had no VERDICT line, so it read unverified (exit 4), and the review-mode template now has one codex exec dispatch block instead of two. The fake reply now ends with VERDICT: FINDINGS and the block count expects one.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…very false-clean case

Review-Finding: p1/red-team#2 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>
garrytan and others added 4 commits November 7, 2026 21:30
A /codex review whose git diff fails now stops before Codex runs instead of sending an empty diff. The verdict is read from the raw last line, so inline code after VERDICT: CLEAN no longer reads clean, and VERDICT: CLEAN beside numbered items with no severity reads unverified. Codex structured review gets the base-branch diff appended to its prompt, the way the Claude path does, so the scope no longer depends on the prompt the host writes.

Fix round granted by the Captain (a-aec3882c9d48). Review-section pins move under replay GST-1821: the free 681-input replay and the 54 scored probe replies are unchanged through the fixed parser.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… and that /codex review stops without its diff

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… codex exec

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… to its prompt

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 7cb151b into main Nov 7, 2026
46 checks passed
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