Fix /ship review counting, cleared reviewer notes and security findings in the posted PR description (GST-3343) (#4595)

/ship no longer stalls on summary notes a reviewer already cleared,
counts only full review passes as rounds, records a round approval
relayed during a stopped run, and keeps security findings out of the
ship record it posts in the PR description.

These four bugs each stopped a real /ship run until someone edited a
record by hand; the goal is unattended shipping that finishes on its
own.

Nothing to do as a reader.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: s11/outside-voice#1 reader=outside-voice
Review-Finding: s11/adversarial-native#2 reader=adversarial-native
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-21 08:51:13 +00:00
1 parent 387a65c9a2
commit b281effa07
18 files changed
+178 -38

No files matched your search

+3 -3
View File
@@ -67,7 +67,7 @@ import { appliedGateDispositions, gateDispositionText, publicGateDisposition } f
import { securityFingerprints } from '../lib/security-findings';
import { laneExceptionBodyLines } from '../lib/test-lane-exception';
import { grantedStop, grantMarker, historyLine, placeRunEntry, prReviewHistory, reviewRoute, runStub, stopFrom, stopMarker } from '../lib/pr-review-history';
import { grantFor, readReviewRoundGrants, type ReviewRoundGrant } from '../lib/review-round-grant';
import { grantFor, publicRoundGrant, readReviewRoundGrants, type ReviewRoundGrant } from '../lib/review-round-grant';
import { readMechanicalLines } from '../lib/ship-mechanical';
import { patchId, productPatchAgainstBase, productRules, productSpec, verifiedOutputs } from '../lib/ship-receipt-patch';
import { runCalls } from '../lib/ship-clock';
@@ -386,7 +386,7 @@ function cmdWrite(rest: string[], json: boolean): number {
policy: flag(rest, '--policy') ?? tree?.policy, queue_mode: flag(rest, '--queue-mode'), preregistration: flag(rest, '--preregistration'), history: flag(rest, '--history'),
...pregate, issues: issuesFile ? receiptIssuesFrom(issuesFile) : undefined, approval: approval.kind === 'ok' ? approval.approval : undefined,
review_loop: reviewLoop, ...(docs?.ok ? { docs: docs.docs } : {}), ...product,
gstack_version: installedGstackVersion(), review_depth: reviewDepth, review_loop_exception: loopException?.ok ? loopException.exception : undefined, review_round_grants: roundGrantsFor(repoRoot, flag(rest, '--pr')), ruled_notes: ruledNotes.length ? ruledNotes.map(publicRuledNote) : undefined, gate_dispositions: gateDispositions.map(publicGateDisposition), mechanical: mechanical.length ? mechanical : undefined, review_targeted: targeted?.ok ? targeted.targeted : undefined,
gstack_version: installedGstackVersion(), review_depth: reviewDepth, review_loop_exception: loopException?.ok ? loopException.exception : undefined, review_round_grants: roundGrantsFor(repoRoot, flag(rest, '--pr'))?.map(g => publicRoundGrant(g, ruledNotes)), ruled_notes: ruledNotes.length ? ruledNotes.map(publicRuledNote) : undefined, gate_dispositions: gateDispositions.map(publicGateDisposition), mechanical: mechanical.length ? mechanical : undefined, review_targeted: targeted?.ok ? targeted.targeted : undefined,
design: review.frontend ? { mode: 'static', reason: 'no preview declared' } : undefined,
base_red: pause ? receiptBaseRed(pause) : undefined,
review_exclude: receiptExclude(review.exclude),
@@ -1044,7 +1044,7 @@ function cmdStub(rest: string[]): number {
const status = rest.includes('--void') ? 'voided' : 'started';
const err = postBody(rest, read.pr, placeRunEntry(read.body, runStub({ head, run, status, loop })));
if (err) { process.stderr.write(`gstack-ship-receipt stub: ${err}; the run is not recorded\n`); return EXIT.fail; }
process.stdout.write(`RUN_STUB: run=${run} status=${status} rounds=${loop.rounds ?? loop.passes + (loop.fix_checks ?? 0)} head=${head.slice(0, 12)}\n`);
process.stdout.write(`RUN_STUB: run=${run} status=${status} rounds=${loop.passes} head=${head.slice(0, 12)}\n`);
return EXIT.ok;
}