Skip to content

A granted fix round that a follow-up check reads clean now closes the findings it fixed (GST-3260) - #4664

Merged
capy-ai[bot] merged 14 commits into
mainfrom
confirmed-fix-round-closes-its-findings
Nov 22, 2026
Merged

capy-ai[bot] merged 14 commits into
mainfrom
confirmed-fix-round-closes-its-findings

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

/ship now closes a review finding when its fix round was granted and a follow-up check read the fix clean, or when the fix commit names the finding and a later full review reads it clean. Before, someone had to write a ruling by hand.
Why: since this was missing, PRs whose findings were already fixed and checked stalled at the round limit (#4537, harness-evals#508, #4597, harness-evals#504, #4612).
Nothing to do.

What changed
  • lib/fix-check-clearing.ts is now the only place that decides whether a granted follow-up check closes findings. Both finish and the PR's /ship record writer call it. A fix round closes only the findings its grant names, and only when all of these hold:
    • the grant belongs to this PR and this run, and the grant hasn't been used yet;
    • the PR body records the stop the grant answers;
    • the follow-up check's review-log row covers the same range and the same hunks digest;
    • nothing else is left open.
      When any of these is missing, it prints a FIX_CHECK_CLEAR: line saying why.
  • A finding whose fix commit carries its Review-Finding: trailer also closes once a later full review round reads it clean (Reader subagents on Capy stop sending telemetry, error runs report their error class, and test fixtures stop reading the owner's settings #4597).
  • finish counts a granted follow-up check from the stop its grant names, not from the newest reviewed tree (Codex skills no longer stop on temp-file cleanup, which Codex refuses as rm -f (GST-3364) #4612).
  • The review plan sends a follow-up check grant that answers a stop raised after an earlier follow-up check to its single follow-up check (harness-evals#504). Reviewer prompts, packets and review depth are unchanged: lib/review-depth.ts is byte-identical to the parent branch.
  • Copy installs on other hosts keep working, because the new code imports nothing from scripts/.
Tests

New file test/fix-check-clearing.test.ts with 23 tests. Of the first 21, 18 failed on the parent branch:

The only existing test files changed are fixtures: one exercised-map entry, one Windows curation entry and one module-size entry.

Issues

Refs #4591
Refs #4597
Refs #4612

Agent notes

Approvals

Approved: yes (record r-07c3938e7165). The full approval record stays private.
Plan: approved (record r-ecae907524f6)
Plan check: approved (record r-ecae907524f6)

Review-loop exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-22 via relayed to /ship run ship-4664 (GSTA-689) by its lane, from GStack Minder's ruling C on PR #4664 at 79a0671: Both fail closed: a granted fix round leaves a fixed finding needing a manual ruling, which is today's behaviour; neither closes a finding wrongly or fails a test. Fixed in PR 3 with its own full review and replay. (second full pass at 79a0671, deferred p2/red-team#1, p2/outside-voice#1)

{
  "schema_version": 1,
  "pr": 4664,
  "head": "ac9163d8eb00c304704a40a2c975aa10a737c357",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 271,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44992209844,
      "attempt": 1,
      "tree": "0d311cd92d64c00140cfc77d06f8b3aa59063507"
    }
  ],
  "calls": 66,
  "session_kind": "unattended",
  "run": "ship-4664",
  "head_tree": "0d311cd92d64c00140cfc77d06f8b3aa59063507",
  "product_patch_id": "dc25dd17757753fdc0e7011c4e87966b0c127025",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 306,
    "rules": "630fd3101899e28e",
    "base": "c2b4f0d2adfa66e11143b95d9a42023a09380212",
    "registry": "c2b4f0d2adfa66e11143b95d9a42023a09380212",
    "gate_scan": {
      "tagged": 0,
      "head": "ac9163d8eb00c304704a40a2c975aa10a737c357"
    },
    "reasons": [
      "gate-class",
      "runtime=306"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @0d311cd92d64 (8 checks, current for ac9163d8eb00)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44990678683/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44990678685/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=0d311cd92d64 tests=38834 skipped=89 runs=44992209844/1 profiles=ci-reuse/free-tests heads=ac9163d8eb00 verified=2026-11-22T06:22:00.374Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      4591,
      4597,
      4612
    ],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ and README.md against the e8e75547..942b581d diff; docs/review-policy.md receipt table updated"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 2,
    "noted": 8,
    "fixed": 3,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "Captain GStack Minder (GSTA-36)",
    "date": "2026-11-22",
    "via": "relayed to /ship run ship-4664 (GSTA-689) by its lane, from GStack Minder's ruling C on PR #4664 at 79a0671",
    "reason": "Both fail closed: a granted fix round leaves a fixed finding needing a manual ruling, which is today's behaviour; neither closes a finding wrongly or fails a test. Fixed in PR 3 with its own full review and replay.",
    "second_pass": {
      "head": "79a067155cd831be0639943d4ad2459154b5e4ba",
      "deferred": [
        "p2/red-team#1",
        "p2/outside-voice#1"
      ]
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "b2d3ab45fe45b88e0780d7dbaf8dd0279c1158c3",
      "pr": 4664,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "The fixture predates PR 1's one-self-grant rule; the code is unchanged.",
      "at": "2026-11-22T05:27:24.544Z",
      "approval": "a-3d9a27629e31",
      "stop_run": "ship-4664",
      "findings": [
        "p2/red-team#1",
        "p2/outside-voice#1"
      ]
    }
  ],
  "gate_dispositions": []
}
{"head":"79a067155cd831be0639943d4ad2459154b5e4ba","run":"ship-4664","mark":"stop","tree":"d34b3e2feb0e6bb2d863acd7566173aa2adc00ad"}
{"head":"b2d3ab45fe45b88e0780d7dbaf8dd0279c1158c3","run":"ship-4664","mark":"grant","grant":"a-3d9a27629e31"}

Open in Capy

garrytan and others added 11 commits November 22, 2026 00:39
…nd a live run past two hours stays open (GST-3260)

The bare run marker becomes a run record whose state only gstack commands change; gstack-ship-run status and abandon end a run that stopped working. Stops bind to the head their last reading row read (#4591), and a reused run id counts once per head (gstack-evals#406).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ip run record (GST-3260)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ts grant names (GST-3260)

gstack-review-log stamps a granted fix-check row from the run record's claim (the stop head it read from, the run, the grant and the PR) and records the digest of the hunks its reader was given. lib/fix-check-clearing.ts is the one owner of when such a row counts: finish counts it anchored on the stop its grant names rather than the newest reviewed tree (#4612), and receipt write closes exactly the open findings the grant names, recording cleared_by_grant and one Agent notes line, or says why on a FIX_CHECK_CLEAR line. Stop and claim entries in the PR body now carry when they were recorded. The review plan routes a fix-check grant that answers a stop raised after a fix-check to its one fix-check (harness-evals#504). Reviewer prompts and packets are unchanged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…later full review reads it clean (GST-3260, #4597)

A later full review that read the fix commit but left the finding out of its row could not close it, because review-log rows are never rewritten, so the receipt needed an owner ruling. Receipt write now closes an open blocker when a branch commit carries its trailer (its exact ledger id, or a fingerprint no other open blocker shares) and a later complete full review, bound to its committed tree and holding that commit, reports nothing open at that id or line. The receipt records cleared_by_trailer and the Agent notes section gets one line per closed finding. Gate findings never close this way.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nder a token cap refreshes the run's heartbeat (GST-3260)

Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: p1/specialist-batched#2 reader=testing
Review-Finding: p1/specialist-batched#3 reader=state-machines
Review-Finding: p1/specialist-batched#4 reader=state-machines
Review-Finding: lib/ship-run-record.ts:167:correctness reader=core
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ound (GST-3260)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…r a /ship run is open (GST-3260)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…leave review depth untouched (GST-3260)

gstack-review-log and gstack-ship-receipt now load nothing beyond lib/ unless
there is a finding to close: the fix-check hunks record moves into
lib/review-evidence.ts, and receipt write loads the clearing module only when
a blocker is open. The planner routes a still-unspent fix-check grant through
its existing granted-stop route, so lib/review-depth.ts keeps PR 1's bytes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… whole fix it read, and a trailer closes only after a fully clean later review (GST-3260)

Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Base-only: PR 1's final head c4a6af1 merged first, then main with c4a6af1 as the merge base; this PR's own added and removed lines are byte-identical to the reviewed head 79a0671.
@capy-ai
capy-ai Bot changed the base branch from ship-run-record-replaces-stale-marker to main November 22, 2026 04:39
@trunk-io

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 22, 2026 05:28
…reviewer's relayed grant, which the one-self-grant rule now requires (GST-3260)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s its fix list named (GST-3260)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…er fix can also clear an open blocker (GST-3260)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan added a commit that referenced this pull request Nov 22, 2026
…its granted check can close it (GST-3260)

fixListNames split on whitespace, quotes and parentheses only, so **p1/x#1** and [p1/x#1] kept their markup and never matched a grant id. It now strips leading [ and * and trailing ] and * from each token, keeping brackets inside a path such as app/[id]/page.tsx. Fixes the #4664 note p2/outside-voice#1.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan added a commit that referenced this pull request Nov 22, 2026
…asn't committed (GST-3260)

Decision 3.5 wrote the touched hunks as git diff $PASS_HEAD, which leaves out an untracked file the fix created. The clearing code then refused the closure, so it failed closed, but the reader never saw the new file. The instruction now runs git add -N on each file the fix created first; with no untracked file the bytes are unchanged. Fixes the #4664 note p2/red-team#1. The ship/sections/review-army.md pin moves in the replay commit, after its preregistered no-loss replay (docs/evals/r51-final-review-after-grant-prereg.md) passes.

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