Skip to content

A fix closes its review finding only after a finished full review, and a security finding never closes this way (GST-3260) - #4700

Merged
capy-ai[bot] merged 3 commits into
mainfrom
findings-close-only-after-a-finished-review
Nov 22, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
findings-close-only-after-a-finished-review

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

A commit that says it fixes a review finding now closes that finding only after a full review that finished, made no fixes of its own, and read the fix. A security finding never closes this way, so its file and line can't reach the public PR body.
Why: three gaps on main let a finding close too easily: a review that was still fixing things, a security finding's location, and a follow-up check whose record of what it read was missing.
Nothing to do.

What changed
  • A Review-Finding: trailer closes its finding only after a later full review that converged, was bound as verified, and whose range holds the fix commit. A first pass reads the whole pull request, so it still closes the finding.
  • Security findings never close by trailer or by grant, with or without a line number in their fingerprint, so no closure line puts their location in the PR body.
  • A granted follow-up check whose record of its readers' findings can't be read closes nothing.
Why

These three gaps came from the second-model trail read of #4664, and #4696's last review found two more in the first fixes: a first pass's empty range was read as leaving the fix out, and a security fingerprint with no line slipped past the filter. Both are fixed here.

Blast radius

Only how /ship decides that a review finding is closed (lib/fix-check-clearing.ts). Every change makes closing stricter or keeps it the same, except a first pass with an empty range, which closes a committed fix the way it did before #4664's follow-up work.

Tests

test/fix-check-clearing.test.ts:

  • A round that hadn't converged, or whose binding was incomplete, closes nothing.
  • A range that starts after the fix closes nothing.
  • A pass 1 with range_base: null still closes.
  • A security fingerprint, with or without a line, closes nothing by trailer or by grant, while the same fingerprint with a plain category closes.
  • A missing findings record closes nothing.

All four changed tests fail on main's lib/fix-check-clearing.ts. CI's full free suite passed at this tree (run 45021799133).

Review notes

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

  • INFORMATIONAL sf-c3ba965832b8 security finding, details recorded privately
  • INFORMATIONAL sf-ef34bfd31835 security finding, details recorded privately
  • INFORMATIONAL sf-eb92cd996d77 security finding, details recorded privately
  • INFORMATIONAL lib/fix-check-clearing.ts:132 a row with no range_base field reads as a first pass, as gate-dispositions.ts:211 does (INVESTIGATE, Low, Blocks: no)
Agent notes

Split from #4696 by the owner's ruling (GSTA-36). #4696's routing of the final full review after a granted fix round waits for a design pass. grantFixChecked exists only on #4696's branch, so it is not in this PR. Evals: none affected (no prompt, template or judge changed). Coverage audit: 82% of paths (two below-floor gaps: an unresolvable range_base ref, a non-string range_base).

Documentation (Step 14.5 audit docs-4700a-1, inserted unchanged):

Status: current. The documentation already matches this change, so no edits were made.

Scope: base 9055979..635da77 (3 commits): lib/fix-check-clearing.ts, test/fix-check-clearing.test.ts, docs/review-policy.md, plus a changelog.d fragment. Nothing was staged, unstaged or untracked.

Documentation health

  • docs/review-policy.md: Current. The branch updated it, and it matches the new rules for closing a finding by its fix trailer (the review must finish and converge, its binding must be verified, the fix must be in range, a pass 1 covers the whole PR), the rule that security findings never close by grant or trailer, and the rule that an unreadable dispatch ledger closes nothing.
  • docs/pregate.md: Current. It only describes how the issue-reference check skips Review-Finding: trailers.
  • ship/sections/review-army.md.tmpl: Current. It only says how to write the trailer.
  • changelog.d/findings-close-only-after-a-finished-review.md: Current (reviewed only).

Coverage debt: none. There are no new commands, flags or settings, and the internal closing rules are documented in docs/review-policy.md.

Diagram drift: none.

Refs #4664

Approvals

Plan: exempt: bug fix (merge-check correctness, split from #4696 by GSTA-36)

{
  "schema_version": 1,
  "pr": 4700,
  "head": "635da770255d4ae3c9713560e7a37e3e1a8e38f7",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 35,
      "fail": 0,
      "skip": 0
    },
    "test": {
      "pass": 1759,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 45021799133,
      "attempt": 1,
      "tree": "7762079bfe3a570af68b8c72b1385779e252ebea"
    }
  ],
  "calls": 16,
  "session_kind": "unattended",
  "run": "ship-4700a",
  "head_tree": "7762079bfe3a570af68b8c72b1385779e252ebea",
  "product_patch_id": "65b838c00bf124828df2aa0f7a5161cf6dfb8684",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 21,
    "rules": "630fd3101899e28e",
    "base": "25bf93c4e29d80f520e415c65b0ae778867c9ded",
    "registry": "25bf93c4e29d80f520e415c65b0ae778867c9ded",
    "gate_scan": {
      "tagged": 0,
      "head": "635da770255d4ae3c9713560e7a37e3e1a8e38f7"
    },
    "reasons": [
      "runtime=21"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "pass @7762079bfe3a (8 checks, current for 635da770255d)",
  "issues": {
    "fixes": [],
    "refs": [
      4664
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (docs/review-policy.md, docs/pregate.md, ship/sections/review-army.md.tmpl read)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 4,
    "fixed": 1,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

garrytan and others added 2 commits November 22, 2026 11:54
…ed with the fix in range (GST-3260)

Fixes the three open notes from the cross-family trail read of #4664, as GStack Minder ruled: the trailer route now needs a converged, verified full review whose range holds the fix; a raw security fingerprint never closes by grant or trailer, so its location cannot reach the PR body; and a fix-check row whose dispatch ledger cannot be read closes nothing. Each has a test that fails on #4664 at ac9163d.

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

The trailer route read a range_base of null, which every pass 1 logs, as a range that leaves the fix out, so a committed fix read clean by a new run's first pass no longer closed. And the security filter only caught fingerprints with a line number. Both clearing routes now use isSecurityFinding.

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

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 63900b3 into main Nov 22, 2026
76 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