Skip to content

v1.91.205.0 feat(ship): Step 9 fix-range re-review, with a mandatory final full pass (#3339) - #3404

Merged
capy-ai[bot] merged 3 commits into
mainfrom
fix/3339-fix-range-rereview
Oct 25, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
fix/3339-fix-range-rereview

Conversation

@garrytan

@garrytan garrytan commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

What changed

narrowed pass before/after
Before: a repeat pass that reviewed only the fixes was logged as a full pass and came out CURRENT, so it could clear review. After: the record says fix-range, it is UNVERIFIED, Step 11.5 has nothing to bind, and the next start must be a full pass.

Step 9 repeat decisions before/after
Step 9's repeat decisions: a fixing pass may be followed by a fix-range pass, and Step 10 is reached only from a full pass. Nearby prose was tightened to pay for the new lines.

core checklist before/after
The core checklist explains the fix-range start and that FIX_BASE stands in for origin/<base> and <base> for that pass.

  • gstack-review-log --start review --fix-range prints the token and FIX_BASE=<sha>. The base is the commit of the latest pass, read from the review log. It is never taken from the caller and never written to the working tree, so gstack-wtree's fingerprint and Step 11.5's binding are untouched. That commit's tree must be exactly the content the pass started from, so git diff <FIX_BASE> holds every fix, committed or not. The start refuses (exit 1, "run a full pass") in each of these cases: there is no earlier pass, that pass didn't complete (restoring coverage always takes a full pass), it made no fixes, it has no captured start, it ran on another branch, a Step 11 review followed it, it started from uncommitted or untracked content, or its commit is gone or no longer an ancestor of HEAD. On the start-work-then-ship flow, where Step 9 first reviews uncommitted work, the first repeat therefore stays full.
  • lib/review-evidence.ts: a fix-range row gets scope and fix_base from the token only, and a token that names any fix base stays narrowed even if its scope is rewritten. Its binding is state: "fix-range" with range_start_wtree/range_end_wtree and no start_wtree/end_wtree/wtree. reviewFreshness never returns CURRENT for it.
  • gstack-specialist-stats skips fix-range rows, so narrowed dispatches don't push specialists toward [GATE_CANDIDATE].
  • ship/sections/review-army.md.tmpl: the fix-range start in the core checklist, the repeat permission in decision 3, and decision 4's full-pass-before-Step-10 rule. Ship's skeleton plus sections is 313,246 bytes against its 313,281 cap, 35 bytes below main, with no cap raised.

Why

#3339 (thanks @eoin-obrien): on large branches every fix cycle reran every specialist and the Red Team over the whole diff. A pass converges only with zero fixes, so long branches ran to the three-cycle stop. A prompt-only override can't do this safely, because it can't keep the base out of the working tree, mark a narrowed pass in the log, or keep narrowed dispatches out of gating stats. This PR does all three in gstack. Following Garry's call, it also makes sure a narrowed pass can never be the review that ships.

Fixes #3339

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-24 Ten triage calls; #3: may /ship re-review only the fixed range (#3339)? “do it” (Garry (via GStack Minder)) approved #3339: fix-range re-review only with a mandatory final full review pass before ship; ship through a train none
2026-10-24 Merge when green through a merge train; paid focused runs “standing (CREW 5, captain-approvals A)” (Garry) standing approval train merge by GStack Minder; focused paid cases none

Source: gstack-approvals record for fix/3339-fix-range-rereview (display only; not an approval citation).

Gate edits

Gate Change Verdict Negative controls
/ship Step 9 review loop, reviewFreshness, Step 11.5 binding fields A repeat pass may review only the fix range Not a weakening of what ships. A fix-range record is never CURRENT, has no start_wtree/end_wtree for Step 11.5, and decision 4 requires a full pass before Step 10. The start refuses every case the issue lists as needing a full pass. test/review-fix-range.test.ts: a caller claiming scope:"full" and a verified binding on a fix-range token is still recorded as fix-range, unbindable and UNVERIFIED. reviewFreshness rejects a fix-range row even with a verified-looking binding. A second fix-range start after a clean narrowed pass is refused. Shared-libs reuse rejects fix-range rows. A rewritten start token stays narrowed. Mutation checks, each caught: dropping the freshness check, giving a narrowed row the normal binding, allowing a start after a clean, incomplete or Step 11-followed pass, accepting a non-ancestor base, accepting a start from uncommitted content, trusting the token's scope alone, and counting fix-range rows in stats.

No threshold, budget, timeout, trial count or case kind changed.

Outside review

An outside voice (GPT-6 Astra, a separate model family) reviewed 4e54d98. I checked its findings against the code and fixed them in a0b7ca7:

  • Fixed (CRITICAL): Step 9.4 applies fixes before it logs, so a real fixing pass is logged changed, and the first version refused every real repeat. Its tests had reversed that order. They now follow Step 9.4's order.
  • Fixed (CRITICAL): when a pass started from uncommitted content, git diff <commit> could miss a reverted dirty hunk. The base must now be a commit whose tree equals the content the pass started from.
  • Hardened: a start token that names any fix base stays narrowed, and a malformed fix_base is dropped. Someone who can edit the token file can still forge a full start. That is the same local-state trust boundary every review token already has, and this PR doesn't change it.
  • Kept, by design: a qualifying row from an earlier run on the same branch can still serve as the base. The range is then wider than needed, which is safe, and the mandatory full pass still follows.
  • Fixed: the shared-libs reuse test now uses a real fingerprint and a positive control.

Evidence

  • gen:skill-docs and --host codex are fresh, and bun run typecheck is clean.
  • Focused free tests pass: 1,294 across 24 files at 4e54d98, then the changed files rechecked at a0b7ca7 (79 pass), including the 20-case test/review-fix-range.test.ts.
  • Free-tier pregate, remote on Ubicloud, at a0b7ca7: 16,898 tests, 0 failed, $0.06.
  • Paid, focused, all on the first attempt with no reruns:
    • Judges at 4e54d98: ship/SKILL.md workflow and review/SKILL.md workflow passed. The prompt files are unchanged since then, so I'm reusing this evidence.
    • At a0b7ca7, each rule case 1/1: shared-libs-review-lifecycle, -revalidation, -prior-coverage, -path-eligibility, -index-flags, review-army-json-findings, review-army-quality-score, review-dashboard-via, safety-ship-stale-evidence, ship-skipped-queued-finding, review-gate-integrity and ship-triage.
  • No flaky cases.

…ss (#3339)

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

trunk-io Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits October 25, 2026 02:55
… from; follow Step 9.4's real order (#3339 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…final full pass (#3339)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title feat(ship): Step 9 fix-range re-review, with a mandatory final full pass (#3339) v1.91.205.0 feat(ship): Step 9 fix-range re-review, with a mandatory final full pass (#3339) Oct 25, 2026
@capy-ai
capy-ai Bot merged commit 072d073 into main Oct 25, 2026
62 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.

/ship Step 9: re-review only the fix range on repeat passes, with records that say so

1 participant