A granted follow-up check that confirmed its blockers fixed now counts once the rest are ruled (GST-3501) (#4691)

/ship's finish now accepts a granted follow-up check that confirmed its
blocking findings fixed (or auto-fixed), once the findings left over
have been ruled.

Why: gbrain#10036 stalled at the review limit with every finding either
fixed or ruled, because finish kept printing "FIX_CHECK: not counted".

Nothing to do. A stuck PR reruns finish at the same head after upgrading
gstack; no new review round is needed.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=red-team
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-22 09:31:55 +00:00
1 parent 540da9b5b1
commit 82cc62d829
5 files changed
+60 -5

No files matched your search

@@ -0,0 +1 @@
**A granted fix-check that confirmed its blockers fixed now counts once the remaining findings are ruled.** /ship's finish printed `FIX_CHECK: not counted (review has unresolved findings or did not finish clean)` whenever the fix-check row still listed the blockers it had just confirmed fixed: a finding the reviewer marked blocking held the row open even after it was fixed, and a fixed finding can't be ruled, so nothing could clear it (gbrain#10036). A blocking finding recorded as fixed or auto-fixed no longer needs a ruling; open, deferred, noted and skipped blockers still do. (GST-3501)
+5 -2
View File
@@ -1858,7 +1858,9 @@ counts. That includes the usual order, where the fix-check finds a new CRITICAL,
logs it `open` with `converged:false` and stops for the owner, and the owner rules
afterwards: the row's `incomplete` binding still names the one tree it read, so
once every blocking finding on it is ruled it binds at that tree as a clean read
(harness-evals#361, GST-2251). A CRITICAL with no ruling stays open, and while one
(harness-evals#361, GST-2251). A blocking finding the row records `fixed` or
`auto-fixed` needs no ruling, since a fixed finding cannot be ruled and already
reads resolved (gbrain#10036, GST-3501). A CRITICAL with no ruling stays open, and while one
does, finish prints `FIX_CHECK_OPEN: <fingerprints> on the fix-check at <commit12>`
naming the `gstack-approvals rule` command for each
([troubleshooting](troubleshooting.md#fix-check-open)). On any stopped review row,
@@ -1887,7 +1889,8 @@ file, not on the row, so `gstack-review-read` shows the file's findings on the r
(`findings_from` names the file) while the file still derives the counts the row
recorded. A Step 11 native row that lists no findings shows the findings of the
Step 9 row of the same pass, commit and bound tree, because Step 9 carries Step
11's queued findings; rulings must then cover every blocker of that pass. A file
11's queued findings; rulings must then cover every blocker of that pass that is not recorded `fixed` or
`auto-fixed`. A file
that is missing or changed attaches nothing, and any row that claims issues but
lists no findings reads `it lists no findings (fcount 0) but claims …` with the
cause (harness-evals#515, GST-3296).
+3 -1
View File
@@ -7649,7 +7649,9 @@ through land. See [gate dispositions](ship-policy.md#gate-dispositions).
**Meaning.** `gstack-ship-release finish` did not count a granted fix-check
because it still has findings no owner has ruled on that still hold it open. The line lists
their fingerprints and the fix-check's commit. A fix-check that found a new
their fingerprints and the fix-check's commit. A blocking finding the row
records `fixed` or `auto-fixed` never holds it open and needs no ruling
(GST-3501). A fix-check that found a new
CRITICAL logs it `open` with `converged:false`, so `FIX_CHECK: not counted`
reads `missing start capture or incomplete/nonconverged pass` until the
rulings exist. A `--review-loop-exception` does not help here: it accepts
+6 -2
View File
@@ -339,8 +339,12 @@ export const unresolvedFinding = (f: unknown) => record(f) && (f.action === 'ope
((f.action === 'deferred' || f.action === 'noted') && (f.blocking === true || isCriticalFinding(f))) ||
(!f.gate && isCriticalFinding(f) && isOpenByAction(f)));
export const RULABLE = new Set(['open', 'skipped', 'noted', 'deferred']);
/** What a ruling must cover before rulings can clear a row: every unresolved finding and every one the reader marked blocking, whatever its action. */
export const holdsOpen = (f: unknown) => !record(f) || unresolvedFinding(f) || f.blocking === true;
/**
* What a ruling must cover before rulings can clear a row: every unresolved finding and every one the reader marked blocking,
* unless the reader recorded it fixed or auto-fixed. A fixed finding cannot be ruled, and a row with no rulings already reads it as resolved,
* so holding it open left a fix-check that confirmed its blockers fixed uncountable (GST-3501, gbrain#10036).
*/
export const holdsOpen = (f: unknown) => !record(f) || unresolvedFinding(f) || (f.blocking === true && f.action !== 'fixed' && f.action !== 'auto-fixed');
/**
* GST-1537: the row (claimed, or derived with its file's findings shown, GST-3296) with each finding the owner ruled a disclosed note (`ruled`: fingerprints from approved
@@ -0,0 +1,45 @@
/**
* A fix-check row that read its granted fixes clean still read UNVERIFIED once the owner ruled its deferred findings
* (GST-3501, gbrain#10036 at 8e0159ab): the blockers it confirmed fixed (action fixed, blocking true) held the row open, and a
* fixed finding cannot be ruled, so finish printed FIX_CHECK: not counted forever. The row below is GBRA-732's own
* review-fix-check row, trimmed to the fields reviewFreshness reads.
*/
import { describe, expect, test } from 'bun:test';
import { holdsOpen, reviewFreshness } from '../lib/review-evidence';
const TREE = '2a5e2ee1807a5ef0d58716dd3a45c01297bd92ab';
const finding = (fingerprint: string, action: string, extra: Record<string, unknown> = {}) =>
({ fingerprint, severity: 'CRITICAL', blocking: true, kind: 'defect', action, ...extra });
const fixCheckRow = (findings: Record<string, unknown>[]) => ({
skill: 'review-fix-check', status: 'clean', issues_found: 0, critical: 0, informational: 0, status_source: 'claimed',
completed: true, converged: true, commit: 'fa9a4537', commit_full: 'fa9a4537df7ad5fb4f05daeb160dd930f7df33be',
range_base: '879d764c9e006c28e7799c99f7411a6a13939af0', grant: 'a-685e316454ff', tree: TREE, wtree: TREE,
review_binding: { state: 'verified', start_wtree: TREE, end_wtree: TREE },
findings,
});
const GBRA_732 = [
finding('src/core/telemetry/client.ts:547:consent-race', 'fixed', { ledger_id: 'p3/outside-voice#1' }),
finding('src/cli/main.ts:2864:telemetry-coverage', 'deferred', { ledger_id: 'p3/outside-voice#2' }),
finding('src/core/telemetry/client.ts:349:attribution', 'deferred', { ledger_id: 'p3/outside-voice#3' }),
finding('src/core/telemetry/endpoint.ts:18:env-trust', 'fixed', { ledger_id: 'p3/adversarial-native#2' }),
{ fingerprint: 'src/core/telemetry/client.ts:456:fix-check', severity: 'INFORMATIONAL', blocking: false, kind: 'defect', action: 'noted' },
];
const DEFERRED = new Set(['src/cli/main.ts:2864:telemetry-coverage', 'src/core/telemetry/client.ts:349:attribution']);
describe('a fixed blocker no longer holds a ruled fix-check row open (GST-3501)', () => {
// Value: protects=a granted fix-check that confirmed its blockers fixed counts once the owner rules the deferred ones;
// fails_when=holdsOpen keeps a fixed blocking finding open, so withoutRuledNotes never clears the row and it reads
// UNVERIFIED (gbrain#10036: FIX_CHECK: not counted after every finding was fixed or ruled); why_new=no ruled-row case
// mixed fixed and deferred blockers; seam=reviewFreshness -> withoutRuledNotes -> holdsOpen; no_claim=finish's chain walk
test("GBRA-732's fix-check row reads CURRENT once its two deferred blockers are ruled", () => {
expect(reviewFreshness(fixCheckRow(GBRA_732), TREE, DEFERRED)).toEqual({ status: 'CURRENT', reason: 'completed clean pass on unchanged content' });
});
// Value: protects=rulings still have to cover every blocker that is not fixed; fails_when=dropping the fixed exemption's
// action check lets an unruled deferred or open blocker clear with the rest; seam=holdsOpen; no_claim=gate findings
test('an unruled deferred blocker still holds the row open, and an open or skipped blocker still needs a ruling', () => {
expect(reviewFreshness(fixCheckRow(GBRA_732), TREE, new Set(['src/cli/main.ts:2864:telemetry-coverage']))?.status).toBe('UNVERIFIED');
for (const action of ['fixed', 'auto-fixed']) expect(holdsOpen(finding('a.ts:1:x', action))).toBe(false);
for (const action of ['open', 'deferred', 'noted', 'skipped']) expect(holdsOpen(finding('a.ts:1:x', action))).toBe(true);
});
});