mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 08:31:44 +01:00
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:
1 parent
387a65c9a2
commit
b281effa07
18 files changed
+178
-38
No files matched your search
@@ -61,6 +61,8 @@ const HELP = `gstack-approvals — the per-thread approval record (capy/skill/gs
|
||||
dispositions the "Gate disposition: …" lines the Pre-Landing Review and the PR body carry
|
||||
round-grant --pr <n> --head <the head that needs the round> --kind extra-round|fix-check --reason <why, one line>
|
||||
--by <the lane or its Captain> [--words <their words; default the reason>]
|
||||
[--owner-ref <thread code>:<message id or timestamp>: relays the grant from the lane's or Captain's message, so it
|
||||
records while a stopped /ship run is still open on this checkout; needs --words]
|
||||
[--stop-run <run> --findings <ids>: fix-check only, the stop gstack-ship-receipt stop recorded and the findings
|
||||
its fix round is for; it buys one scoped fix-check of the PR's own change since that stop's head]
|
||||
a review round the PR's R51 count would not plan (docs/review-policy.md#rounds-per-pull-request): extra-round is
|
||||
@@ -180,12 +182,14 @@ function main(argv: string[]): number {
|
||||
const head = spawnSync('git', ['rev-parse', '--verify', '--quiet', `${flags['--head'] ?? ''}^{commit}`], { encoding: 'utf8', timeout: 10_000 });
|
||||
if (!flags['--head'] || head.status !== 0) return invalid('round-grant needs --head <the head that needs the round, a commit in this repository>');
|
||||
if (!by || isGstackActorName(by)) return invalid('round-grant needs --by <the lane or its Captain>: gstack never grants itself a round');
|
||||
const ownerRef = flags['--owner-ref']?.trim();
|
||||
if (ownerRef !== undefined && (!OWNER_REF.test(ownerRef) || !(flags['--words'] ?? '').trim())) return invalid('--owner-ref relays the lane\'s or Captain\'s grant: <thread code>:<message id or timestamp> (GSTA-36:2026-11-19T12:29:59Z), with --words <their exact words>');
|
||||
const open = openShipRun(process.cwd());
|
||||
if (open) return invalid(`/ship run ${open} is open on this checkout: a round grant is the lane's or its Captain's, never the run's own; record it from the lane after the run stops`);
|
||||
if (open && ownerRef === undefined) return invalid(`/ship run ${open} is open on this checkout: a round grant is the lane's or its Captain's, never the run's own; relay it with --owner-ref <thread code>:<message id or timestamp> --words <their exact words>, or record it from the lane after the run stops`);
|
||||
const stopRun = (flags['--stop-run'] ?? '').trim(), findings = [...new Set((flags['--findings'] ?? '').split(',').map(f => f.trim()).filter(Boolean))];
|
||||
if (kind === 'fix-check' && (!STOP_RUN.test(stopRun) || !findings.length || !findings.every(f => FINDING_ID.test(f)))) return invalid('round-grant --kind fix-check needs --stop-run <the run gstack-ship-receipt stop named> and --findings <the open finding ids it is for, comma-separated>: it buys the fix round of that one stop');
|
||||
if (kind !== 'fix-check' && (flags['--stop-run'] !== undefined || flags['--findings'] !== undefined)) return invalid('--stop-run and --findings belong to --kind fix-check: an extra-round grant names no stop');
|
||||
const built = buildRow({ ...reviewRoundGrantRow(head.stdout.trim().toLowerCase(), Number(pr), kind, reason, kind === 'fix-check' ? { run: stopRun, findings } : undefined), words: flags['--words'] ?? reason, by, date: flags['--date'] }, loc.branch);
|
||||
const built = buildRow({ ...reviewRoundGrantRow(head.stdout.trim().toLowerCase(), Number(pr), kind, reason, kind === 'fix-check' ? { run: stopRun, findings } : undefined), words: flags['--words'] ?? reason, by, date: flags['--date'], source: ruledNoteSource({ ownerRef }) }, loc.branch);
|
||||
if ('code' in built) return fail(cmd, built);
|
||||
rows = [built];
|
||||
} else if (cmd === 'lane-exception') {
|
||||
|
||||
@@ -100,7 +100,7 @@ const HELP = `gstack-review-plan — the review depth of the next /ship step (do
|
||||
when a docs claim needs the targeted read on a targeted-class diff (GST-1702)
|
||||
--pr <n> the PR whose platform review counts under review.platform on (default: this branch's PR); with
|
||||
--round-grant, the PR the grant must name
|
||||
--prior-rounds <n> R51 rounds earlier /ship runs on this PR already spent, fix-checks included (printed as pr_rounds=)
|
||||
--prior-rounds <n> R51 rounds earlier /ship runs on this PR already spent, fix-checks not included (printed as pr_rounds=)
|
||||
--prior-full <n> the full rounds among them: with this run's full passes they count against the cap of 2, so pass 1
|
||||
of a PR with 2 is one read-only full review (no fix round; a blocker is NEXT: stop (PR_ROUND_CAP)
|
||||
for the lane's Captain to decide, never the owner).
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
**/ship no longer stalls on review notes a reviewer already cleared, counts review rounds the way the review policy reads them, and keeps security findings out of the PR body.** When a reviewer reports no blocking findings, its summary bullets such as "noted P2 findings", "deferred P1" or "P0 or P1" become notes the lead lowers with a reason, instead of blockers with no way to clear them. A fix-check, the scoped re-read after the one fix round, no longer counts as a review round in the review loop, the PR history or the receipt. A round grant the owner gave in a message while a /ship run was stopped can be recorded with `gstack-approvals round-grant --owner-ref <thread>:<message>`, which marks it as relayed. The receipt's list of round grants now shows a security finding as its ruled public form, or as an opaque id when it has no ruling, with the grant's reason recorded privately in that case, so posting the PR body no longer stops on a finding the owner had already ruled not security class.
|
||||
+13
-6
@@ -91,7 +91,10 @@ incomplete coverage, which blocks until the reviewer is rerun.
|
||||
classifies with `--range-base`. Only a blocking finding in that range or in
|
||||
the diff is `fix`; every below-floor finding is a `note`.
|
||||
3. **Two rounds is the cap** (R51): a full pass, a scoped pass
|
||||
([below](#scoped-pass)) or a fix-check is a round. After round 2 the run
|
||||
([below](#scoped-pass)) or a fix-check is a round of this table. The counters
|
||||
(`review_loop.rounds`, `PR_REVIEW_HISTORY: rounds=`) count passes only: a
|
||||
fix-check reads only a round's fixes, and R51 counts a re-check of only what
|
||||
changed as no round, so it shows as `fix_checks=`. After round 2 the run
|
||||
finishes with its open notes listed in the PR body and receipt (an owner-ruled
|
||||
note is closed and listed: [ruled notes](ship-policy.md#ruled-notes)), or stops for
|
||||
the owner when a blocking finding is open, or was fixed in round 2 and is
|
||||
@@ -148,8 +151,8 @@ caught 22 of 24 planted faults but none of 8 real faults that full rounds had
|
||||
caught on another crew's PRs.
|
||||
|
||||
1. **Count.** `gstack-ship-receipt history --pr <n>` adds up the rounds the body
|
||||
records (full passes, scoped passes and fix-checks; a run listed twice counts
|
||||
once) and prints `PR_REVIEW_HISTORY:`, the flag line `PR_REVIEW_FLAGS:
|
||||
records (full and scoped passes; a fix-check is no round and shows as
|
||||
`fix_checks=`; a run listed twice counts once) and prints `PR_REVIEW_HISTORY:`, the flag line `PR_REVIEW_FLAGS:
|
||||
--prior-rounds <rounds> --prior-full <full rounds>` and `PR_REVIEW_ROUTE:`.
|
||||
`/ship` Step 1 prints all three. A re-check that carried a receipt before
|
||||
this rule adds no round. The count fails open when the history can't be
|
||||
@@ -185,7 +188,8 @@ caught on another crew's PRs.
|
||||
full rounds to this run's full passes; fix-checks stay the in-run table's
|
||||
call, and `--prior-rounds` is printed as `pr_rounds=`. The per-PR cap counts
|
||||
full passes only, by design (`lib/review-depth.ts` `prCapped`): earlier runs'
|
||||
fix-checks and scoped passes show in `pr_rounds=` but don't count against it,
|
||||
scoped passes show in `pr_rounds=` but don't count against it, fix-checks
|
||||
show in neither,
|
||||
because each run's own fix round is the in-run table's call. A full pass past two
|
||||
stops with `PR_ROUND_CAP` and says how to record the stop and its grant
|
||||
(item 6); a below-floor fix at the cap finishes with its notes listed. The stop is the lane's or Captain's call, never an owner ask
|
||||
@@ -232,7 +236,10 @@ caught on another crew's PRs.
|
||||
gstack writes for itself, `gstack` or `gstack no-stop default (K1)`, matched
|
||||
whole and case-insensitively, so "gstack-evals Captain" or "GStack Minder" can
|
||||
grant) and a grant from inside an open `/ship` run are refused, and `add`
|
||||
refuses the scope. `--by` is otherwise the caller's own text, recorded and
|
||||
refuses the scope. A stopped run's marker stays on its checkout, so the lane
|
||||
records its Captain's grant there as a relay: `--owner-ref <thread
|
||||
code>:<message id or timestamp> --words <their exact words>`, the same relay
|
||||
`gstack-approvals rule` takes, which the row keeps as `relayed:<ref>` (#4531). `--by` is otherwise the caller's own text, recorded and
|
||||
not checked: a lane that records a grant (or a ruling) from another checkout
|
||||
under its Captain's name can't be told apart from the Captain doing it, so the
|
||||
Captain's check of the receipt's `review_round_grants` and the PR body's lines
|
||||
@@ -849,7 +856,7 @@ Findings bind by id first (GST-1168). A row finding that came from a dispatched
|
||||
| `review_loop.fixed` | findings fixed in this PR |
|
||||
| `review_loop.scope` | the `review_scope` the loop ran under |
|
||||
| `review_loop.fix_checks` | fix-checks this ship ran (never passes): the larger of the `review-fix-check` rows and the ledgers holding a fix-check reader's review. When fix-checks ran without their rows, a blocker no row disposes counts as fixed once a later fix-check ledger followed it (decision 3.5 runs one only after the fixes) |
|
||||
| `review_loop.rounds` | passes plus fix-checks (R51 caps it at 2; the queue's `REVIEW_DEPTH:` line prints it) |
|
||||
| `review_loop.rounds` | full and scoped passes; a fix-check is no round under R51, so `fix_checks` counts it apart (the queue's `REVIEW_DEPTH:` line prints it) |
|
||||
| `review_loop.dispatches` | reviewer dispatches by role: `specialist`, `red-team`, `adversarial-native`, `outside-voice`, `fix-check`, `targeted` |
|
||||
| `review_loop.est_input_tokens` | prompt plus diff bytes the dispatches read, divided by 4: a relative estimate for comparing runs, not a bill |
|
||||
| `review_targeted` | the [targeted pass](#targeted-pass-on-money-gate-auth-and-secret-code): the `classes` it covered, `rules`, `brief_sha`, the receipt's own `product_patch_id`, `status` (`done` only with its brief sent verbatim and its output collected on a committed diff, else `failed`; `write` refuses a record when a change after its read commit carries a targeted class or the read commit is not an ancestor, or when its product patch differs and the change is more than release stamps and plain docs (no binary file and no numeric, results, prereg, eval, money, security, secret or auth claim; GST-1195, GST-1689), and refuses to write without a record when the head needs a class), `findings` and `raised_by`; a carry keeps it while the product patch is unchanged |
|
||||
|
||||
@@ -16,7 +16,7 @@ import type { ReviewRoundGrant } from './review-round-grant';
|
||||
export interface PrReviewHistory {
|
||||
/** /ship runs that reviewed (stubs and carries excluded). */
|
||||
runs: number;
|
||||
/** R51 rounds: full and scoped passes plus fix-checks, every run and started stub. */
|
||||
/** R51 rounds: full and scoped passes, every run and started stub; a fix-check is no round (fix_checks counts it). */
|
||||
rounds: number;
|
||||
full: number;
|
||||
scoped: number;
|
||||
@@ -31,7 +31,7 @@ export interface PrReviewHistory {
|
||||
source: 'pr-body';
|
||||
}
|
||||
|
||||
const roundsOf = (l: ReceiptRun['review_loop']) => (l ? (l.rounds ?? (l.passes ?? 0) + (l.fix_checks ?? 0)) : 0);
|
||||
const roundsOf = (l: ReceiptRun['review_loop']) => l?.passes ?? 0;
|
||||
|
||||
/** Every entry the body records, oldest first: the runs block, then the current receipt. */
|
||||
function entries(body: string): ReceiptRun[] {
|
||||
|
||||
@@ -329,7 +329,8 @@ export function parseFindings(reader: string, output: string, fixableRaises = tr
|
||||
|
||||
export interface VerdictCheck { state: 'valid' | 'missing' | 'malformed'; parsed: number; declared?: number; agrees?: boolean; why?: string }
|
||||
export interface ReplyFinding { label: string; raw: string; summary?: true; synthetic?: true }
|
||||
const FINDING_KIND = new RegExp(`(?<![A-Za-z0-9])${SEV_LIST}\\s+findings?(?![A-Za-z0-9])(?!\\s*:)`, 'g');
|
||||
const KIND_STATUS = '(?:noted|deferred|ruled|dismissed|lowered|downgraded|duplicate|folded)';
|
||||
const FINDING_KIND = new RegExp(`(?<![A-Za-z0-9])(?:${SEV_LIST}\\s+(?:findings?|duplicates?)|${KIND_STATUS}\\s+${SEV_LIST}|${SEV}(?:\\s*(?:,|/|\\bor\\b|\\band\\b|\\bnor\\b)\\s*${SEV})+)(?![A-Za-z0-9])(?!\\s*:)`, 'g');
|
||||
const blockingRow = (f: { label: string; raw: string }) => (rank(f.label) ?? 0) >= 4 && !statesNoBlocks(f.raw);
|
||||
|
||||
/**
|
||||
@@ -340,7 +341,8 @@ const blockingRow = (f: { label: string; raw: string }) => (rank(f.label) ?? 0)
|
||||
* is not one, and in a NO FINDINGS reply a list item is not one either, GST-2972) and no Blocks: yes a summary candidate, whether a CRITICAL or P0 word or the native voice's FIXABLE raise made it block. It still
|
||||
* blocks until lead judgment lowers it with a reason. A reply whose valid line declares blocking=0 marks the same way, at its own label,
|
||||
* each single-line bullet with no structure, no file:line and no label beyond severities naming findings as a kind (`- a HIGH finding still
|
||||
* refused;`, `- \`missing_verdict\` can't occur alongside P0 or P1 findings.`, #4518 and #4519): a scope list or passed check the lead
|
||||
* refused;`, `- \`missing_verdict\` can't occur alongside P0 or P1 findings.`, #4518 and #4519), a list of severities (`P0 or P1`), or a
|
||||
* status a finding already has (`noted CRITICAL duplicates`, `a deferred CRITICAL`, #4553): a scope list or passed check the lead
|
||||
* may lower with a reason, though `- Two P0 findings remain unfixed.` has the same shape, so it still blocks until judged.
|
||||
*/
|
||||
export function parseReply(reader: string, output: string, fixableRaises = true, asked = false): { findings: ReplyFinding[]; verdict?: VerdictCheck } {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
*/
|
||||
import { spawnSync } from './spawn-sync';
|
||||
import { locate, readRecord, type ApprovalRow, type Env } from './approval-record';
|
||||
import { isGstackActorName } from './ruled-notes';
|
||||
import { isGstackActorName, publicRuledNote, type RuledNote } from './ruled-notes';
|
||||
import { isSecurityFinding, opaqueFindingId, REDACTED_FINDING, REDACTED_REASON } from './security-findings';
|
||||
|
||||
export const ROUND_GRANT_KINDS = ['extra-round', 'fix-check'] as const;
|
||||
export type RoundGrantKind = (typeof ROUND_GRANT_KINDS)[number];
|
||||
@@ -38,6 +39,19 @@ export function reviewRoundGrants(rows: readonly ApprovalRow[]): ReviewRoundGran
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* A grant as the receipt in the PR body may carry it: a security-class finding it names leaves its fingerprint in the approval
|
||||
* record (lib/security-findings.ts). One the owner ruled not security class shows as that ruling's public text does, and any
|
||||
* other becomes an opaque id, so gstack-post never refuses the receipt over a grant's finding list (gbrain-evals#567). The grant's
|
||||
* reason is free text that can describe the finding, so it becomes REDACTED_REASON whenever a security finding stays hidden.
|
||||
*/
|
||||
export function publicRoundGrant(g: ReviewRoundGrant, ruled: readonly RuledNote[]): ReviewRoundGrant {
|
||||
if (!g.findings?.some(f => isSecurityFinding(f))) return g;
|
||||
const shown = (f: string) => { const n = ruled.find(r => r.finding === f && r.not_security); return n ? publicRuledNote(n).finding : undefined; };
|
||||
const hidden = g.findings.some(f => isSecurityFinding(f) && (shown(f) ?? REDACTED_FINDING) === REDACTED_FINDING);
|
||||
return { ...g, findings: g.findings.map(f => !isSecurityFinding(f) ? f : shown(f) ?? opaqueFindingId(f, `round grant ${g.approval}`)), ...(hidden ? { reason: REDACTED_REASON } : {}) };
|
||||
}
|
||||
|
||||
export function readReviewRoundGrants(cwd: string, env: Env = process.env): ReviewRoundGrant[] {
|
||||
const loc = locate({ cwd, env });
|
||||
return 'code' in loc ? [] : reviewRoundGrants(readRecord(loc).rows);
|
||||
|
||||
+2
-2
@@ -289,7 +289,7 @@ export interface ReviewLoopSummary {
|
||||
fix_checks?: number;
|
||||
/** Passes that were scoped repeats (`"scope":"scoped"` rows): rounds, not full rounds (GST-2673). */
|
||||
scoped?: number;
|
||||
/** Review rounds (R51): passes plus fix-checks; the loop caps them at 2. */
|
||||
/** Review rounds (R51): full and scoped passes. A fix-check reads only a round's fixes, so like any re-check of what changed it is no round; fix_checks counts it. */
|
||||
rounds?: number;
|
||||
/** Reviewer dispatches of this invocation by role (specialist, red-team, adversarial-native, outside-voice, fix-check, targeted). */
|
||||
dispatches?: Record<string, number>;
|
||||
@@ -504,7 +504,7 @@ export function summarizeReviewLoop(rows: readonly Record<string, any>[], since:
|
||||
if (voided.length) out.voided = voided;
|
||||
const fixChecks = Math.max(rowFixChecks, fixCheckStarts.length);
|
||||
if (fixChecks) out.fix_checks = fixChecks;
|
||||
out.rounds = passes.length + fixChecks;
|
||||
out.rounds = passes.length;
|
||||
const scopedPasses = passes.filter(r => r.scope === 'scoped').length;
|
||||
if (scopedPasses) out.scoped = scopedPasses;
|
||||
const byRole: Record<string, number> = {};
|
||||
|
||||
@@ -482,7 +482,7 @@ export function receiptDepthVerdict(root: string, baseRef: string, r: ShipReceip
|
||||
const need = depthOfCommitInput({ ...c, scope, gateTagged: tagged, ...riskPathsOf(review), ...(x.state === 'active' ? { excluded: x.excluded } : {}) });
|
||||
const have = rd?.depth;
|
||||
const inputs = `base@${short(baseSha.ok ? baseSha.out : null)},registry@${short(c.registry.sha)},gate_scan@${scanBound ? short(rd!.gate_scan.head) : 'missing'}`;
|
||||
const line = `REVIEW_DEPTH: receipt=${have ?? 'none'} required=${need.depth} runtime_lines=${need.runtimeLines} class=${need.class} reasons=${need.reasons.join(',')} inputs=${inputs} rounds=${r.review_loop?.rounds ?? (r.review_loop ? r.review_loop.passes + (r.review_loop.fix_checks ?? 0) : 'none')}`;
|
||||
const line = `REVIEW_DEPTH: receipt=${have ?? 'none'} required=${need.depth} runtime_lines=${need.runtimeLines} class=${need.class} reasons=${need.reasons.join(',')} inputs=${inputs} rounds=${r.review_loop?.rounds ?? r.review_loop?.passes ?? 'none'}`;
|
||||
if (have === 'platform') {
|
||||
const pr = rd!.platform_review;
|
||||
const fits = need.depth === 'light' && platformFits(need.class, c.paths, need.runtimeLines, scanNumbers(c.added));
|
||||
|
||||
@@ -348,7 +348,7 @@ describe('factory-scorecard: pieces', () => {
|
||||
|
||||
// Value: protects=a PR shipped three times at two rounds each reports 6 rounds, not the largest run's 2 (GST-2673); fails_when=the scorecard takes the max again; why_new=R51 counts per PR; seam=none; no_claim=bodies without a receipt, which keep the marker's max
|
||||
test('receiptRounds sums R51 rounds across the receipt and its runs', () => {
|
||||
const run = (c: string, id: string) => JSON.stringify({ head: c.repeat(40), run: id, review_loop: { passes: 1, blocking_found: 0, deferred: 0, fix_checks: 1, rounds: 2 } });
|
||||
const run = (c: string, id: string) => JSON.stringify({ head: c.repeat(40), run: id, review_loop: { passes: 2, blocking_found: 0, deferred: 0, fix_checks: 1, rounds: 2 } });
|
||||
const body = '```gstack-ship-receipt\n' + JSON.stringify({ schema_version: 1, ...JSON.parse(run('c', 'r3')) }) + '\n```\n\n```gstack-receipt-runs\n' + run('a', 'r1') + '\n' + run('b', 'r2') + '\n```\n';
|
||||
expect(receiptRounds(body)).toBe(6);
|
||||
expect(receiptRounds('passes=2')).toBeNull();
|
||||
|
||||
@@ -20,11 +20,11 @@ describe('prReviewHistory', () => {
|
||||
expect(prReviewHistory('## Summary\nprose\n')).toMatchObject({ rounds: 0, full: 0, runs: 0, first_full: null, source: 'pr-body' });
|
||||
});
|
||||
|
||||
test('rounds follow R51 (passes plus fix-checks) summed across /ship runs, not the largest run', () => {
|
||||
test('rounds follow R51 (passes, never fix-checks) summed across /ship runs, not the largest run', () => {
|
||||
let body = placeReceipt('', receipt(sha('a'), { passes: 1, fix_checks: 1, rounds: 2 }, { run: 'r1' }));
|
||||
body = placeReceipt(body, receipt(sha('b'), { passes: 1, fix_checks: 1, rounds: 2 }, { run: 'r2' }));
|
||||
const h = prReviewHistory(body);
|
||||
expect(h).toMatchObject({ runs: 2, rounds: 4, full: 2, fix_checks: 2, first_full: sha('a'), last_full: sha('b') });
|
||||
expect(h).toMatchObject({ runs: 2, rounds: 2, full: 2, fix_checks: 2, first_full: sha('a'), last_full: sha('b') });
|
||||
});
|
||||
|
||||
test('a scoped pass 2 is a round but not a full round', () => {
|
||||
@@ -54,10 +54,10 @@ describe('prReviewHistory', () => {
|
||||
expect(prReviewHistory(body)).toMatchObject({ rounds: 2, stubs: 1 });
|
||||
body = placeRunEntry(body, { head: sha('b'), run: 'r2', status: 'started', review_loop: loop({ passes: 1, fix_checks: 1, rounds: 2 }) });
|
||||
expect(receiptRuns(body).filter(r => r.status === 'started').length).toBe(1);
|
||||
expect(prReviewHistory(body).rounds).toBe(3);
|
||||
expect(prReviewHistory(body).rounds).toBe(2);
|
||||
body = placeReceipt(body, receipt(sha('c'), { passes: 1, fix_checks: 1, rounds: 2 }, { run: 'r2' }));
|
||||
expect(receiptRuns(body).some(r => r.status === 'started')).toBe(false);
|
||||
expect(prReviewHistory(body)).toMatchObject({ rounds: 3, stubs: 0, runs: 2 });
|
||||
expect(prReviewHistory(body)).toMatchObject({ rounds: 2, stubs: 0, runs: 2 });
|
||||
});
|
||||
|
||||
test('a voided stub (an infrastructure failure) counts nothing', () => {
|
||||
|
||||
@@ -121,9 +121,9 @@ describe('gstack-ship-receipt history and stub', () => {
|
||||
expect(h.stdout).toMatch(/^PR_REVIEW_ROUTE: final \(the PR had 1 full review round; this head gets a fresh full review/m);
|
||||
expect(h.stdout).not.toMatch(/drift|recheck_blocked/);
|
||||
const s = r.run('gstack-ship-receipt', ['stub', '--body', body, '--run', 'r2', '--review-loop', JSON.stringify({ ...loop, fix_checks: 1, rounds: 2 })]);
|
||||
expect(s.stdout).toContain('RUN_STUB: run=r2 status=started rounds=2');
|
||||
expect(s.stdout).toContain('RUN_STUB: run=r2 status=started rounds=1');
|
||||
const after = r.run('gstack-ship-receipt', ['history', '--body', body, '--pr', '5']).stdout;
|
||||
expect(after).toContain('PR_REVIEW_FLAGS: --prior-rounds 3 --prior-full 2\n');
|
||||
expect(after).toContain('PR_REVIEW_FLAGS: --prior-rounds 2 --prior-full 2\n');
|
||||
expect(after).toMatch(/^PR_REVIEW_ROUTE: read-only \(.*no fix round/m);
|
||||
expect(fs.readFileSync(body, 'utf8').startsWith('## Summary\nprose\n')).toBe(true);
|
||||
expect(r.run('gstack-ship-receipt', ['stub', '--body', body]).status).toBe(2);
|
||||
|
||||
@@ -90,3 +90,53 @@ describe('a reader\'s scope and passed-checks bullets under a blocking=0 verdict
|
||||
expect(lowered('red-team', reply(ZERO, '- P0: the gate drops a HIGH finding.'))).toMatchObject({ ok: false, downgraded: ['red-team#1'] });
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* #4553 (GSTA-666, 2026-11-20): the native reader's Scope bullets named findings the run already had by their status, "the 7 noted
|
||||
* CRITICAL duplicates" and "a deferred CRITICAL", and #4519's Red Team bullet named severities as a list with no "findings" after it.
|
||||
* Each collected as a blocker the lead could not lower, so two owner rulings cleared them. The captured output stayed on that run's
|
||||
* machine; this reply rebuilds its shape from the run's decision trail (rows 22-23) and the lane's report.
|
||||
*/
|
||||
const REBUILT_4553_P1_ADVERSARIAL = [
|
||||
'REVIEWED_TREE: f680df6d0000000000000000000000000000beef /workspace/gstack',
|
||||
'REVIEW_VERDICT: blocking=0',
|
||||
'',
|
||||
'I found no blocking findings.',
|
||||
'',
|
||||
'**Scope.** I read the full diff of gstack-review-read and its tests. The tests cover:',
|
||||
'- 22 rulings leave the 7 noted CRITICAL duplicates named;',
|
||||
'- a row listing fewer findings than it claims;',
|
||||
'- ruling every finding makes all three rows CURRENT;',
|
||||
'- a deferred CRITICAL and a gate finding.',
|
||||
'',
|
||||
'Recommendation: Ship as-is.',
|
||||
].join('\n');
|
||||
|
||||
describe('a scope bullet naming a finding by its status or a list of severities (#4553, #4519)', () => {
|
||||
// Value: protects=a bullet that names findings by a status they already have (noted, deferred) or names severities as a list, in a
|
||||
// reply declaring blocking=0, is a summary candidate the lead may lower with a reason; fails_when=#4553's Scope bullets or the
|
||||
// bare "P0 or P1" passed check need an owner ruling again, or a bullet stating a blocker loses its label; why_new=GSTA-666 needed two
|
||||
// Captain rulings for them; seam=parseReply with the verdict ask and judge, as collect and the lead use them; no_claim=-
|
||||
test('#4553: the noted and deferred CRITICAL bullets keep CRITICAL as summary candidates the lead can lower', () => {
|
||||
expect(rows('adversarial-native', REBUILT_4553_P1_ADVERSARIAL)).toEqual([
|
||||
['CRITICAL', '- 22 rulings leave the 7 noted CRITICAL ', true],
|
||||
['CRITICAL', '- a deferred CRITICAL and a gate finding', true],
|
||||
]);
|
||||
expect(lowered('adversarial-native', REBUILT_4553_P1_ADVERSARIAL)).toMatchObject({ ok: true, dismissed: ['adversarial-native#1', 'adversarial-native#2'], downgraded: [] });
|
||||
});
|
||||
|
||||
test('#4519: a passed check naming "P0 or P1" with no noun after it is a summary candidate too', () => {
|
||||
const line = '- `missing_verdict` cannot occur alongside P0 or P1';
|
||||
expect(rows('red-team', reply(ZERO, line))).toEqual([['P0', line.slice(0, 40), true]]);
|
||||
expect(lowered('red-team', reply(ZERO, line))).toMatchObject({ ok: true, dismissed: ['red-team#1'] });
|
||||
});
|
||||
|
||||
test('negative controls: a status or list that leads a claim, a located line and a reply with no blocking=0 still block', () => {
|
||||
expect(rows('red-team', reply(ZERO, '- a deferred CRITICAL: the gate drops rows.'))[0]![2]).toBe(false);
|
||||
expect(rows('red-team', reply(ZERO, '- a deferred CRITICAL in lib/gate.ts:12 drops rows.'))[0]![2]).toBe(false);
|
||||
expect(rows('red-team', reply(ZERO, '- the CRITICAL path drops rows.'))[0]![2]).toBe(false);
|
||||
expect(rows('red-team', reply('REVIEW_VERDICT: blocking=1', '- a deferred CRITICAL and a gate finding.'))[0]).toEqual(['CRITICAL', '- a deferred CRITICAL and a gate finding', false]);
|
||||
expect(parseReply('red-team', '- `missing_verdict` cannot occur alongside P0 or P1', true, false).findings.map(f => [f.label, !!f.summary])).toEqual([['P0', false]]);
|
||||
expect(lowered('red-team', reply(ZERO, '- a deferred CRITICAL: the gate drops rows.'))).toMatchObject({ ok: false, downgraded: ['red-team#1'] });
|
||||
});
|
||||
});
|
||||
@@ -110,9 +110,9 @@ describe('GST-951: the receipt counts every blocker the readers found', () => {
|
||||
pass(path.join(run, 'p1'), [['specialist/security', '- [INFORMATIONAL] lib/review-depth.ts:1a a CSS escape\n- [INFORMATIONAL] lib/review-depth.ts:1b a zero-padded reference\n- [INFORMATIONAL] lib/review-depth.ts:1c a split handler line'], ['red-team', CLEAN]]);
|
||||
pass(path.join(run, 'p2'), [['red-team', '[CRITICAL] lib/review-depth.ts:212 a stray quote hides an external href from the drawing check']]);
|
||||
pass(path.join(run, 'p2-voices'), [['outside-voice', OUTSIDE_CLEAN], ['adversarial-native', 'lib/review-depth.ts:300 CSS image-set() loads an outside image. FIXABLE\nRecommendation: fix because the drawing loads a remote URL']]);
|
||||
expect(loop(summary(repo, '--no-ledger'))).toMatchObject({ passes: 2, blocking_found: 1, noted: 8, fixed: 4, fix_checks: 3, rounds: 5 });
|
||||
expect(loop(summary(repo, '--no-ledger'))).toMatchObject({ passes: 2, blocking_found: 1, noted: 8, fixed: 4, fix_checks: 3, rounds: 2 });
|
||||
const s = loop(summary(repo, '--run', run));
|
||||
expect(s).toMatchObject({ passes: 2, blocking_found: 2, deferred: 0, noted: 8, fixed: 4, fix_checks: 3, rounds: 5, unrecorded: 1, ledgers_read: 3 });
|
||||
expect(s).toMatchObject({ passes: 2, blocking_found: 2, deferred: 0, noted: 8, fixed: 4, fix_checks: 3, rounds: 2, unrecorded: 1, ledgers_read: 3 });
|
||||
});
|
||||
|
||||
// #3837 (reconstruction): pass 1's row was logged before the outside voice's seven findings were classified, so they sit in the
|
||||
@@ -131,12 +131,12 @@ describe('GST-951: the receipt counts every blocker the readers found', () => {
|
||||
...seven.map((f, i) => `${i + 1}. ${f.fingerprint.split(':').slice(0, 2).join(':')} finding ${i + 1} Severity: High Blocks: yes`),
|
||||
'Recommendation: fix 1-6 because a self-grandfathered row skips every plan rule',
|
||||
].join('\n')]]);
|
||||
expect(loop(summary(repo, '--no-ledger'))).toMatchObject({ passes: 2, blocking_found: 0, noted: 11, fixed: 0, fix_checks: 3, rounds: 5 });
|
||||
expect(loop(summary(repo, '--no-ledger'))).toMatchObject({ passes: 2, blocking_found: 0, noted: 11, fixed: 0, fix_checks: 3, rounds: 2 });
|
||||
const s = loop(summary(repo, '--run', run));
|
||||
expect(s).toMatchObject({ passes: 2, blocking_found: 7, noted: 11, fixed: 0, unrecorded: 7, ledgers_read: 2, rounds: 5 });
|
||||
expect(s).toMatchObject({ passes: 2, blocking_found: 7, noted: 11, fixed: 0, unrecorded: 7, ledgers_read: 2, rounds: 2 });
|
||||
const line = runBin(repo, 'gstack-review-scope', ['summary', '--since', SINCE, '--run', run]);
|
||||
expect(line.out.trim()).toBe('REVIEW_LOOP: passes=2 blocking_found=7 deferred=0 noted=11 fixed=0 scope=frozen unrecorded=7 ledgers_read=2 fix_checks=3');
|
||||
expect(parseReviewLoop(s)).toMatchObject({ blocking_found: 7, unrecorded: 7, ledgers_read: 2, rounds: 5 });
|
||||
expect(parseReviewLoop(s)).toMatchObject({ blocking_found: 7, unrecorded: 7, ledgers_read: 2, rounds: 2 });
|
||||
});
|
||||
|
||||
test('a blocker both sources hold counts once, and a disposed one is not unrecorded', () => {
|
||||
@@ -266,7 +266,7 @@ describe('GST-986 item 5: fix-check passes and their findings count from the led
|
||||
step('fc2', [['fix-check', CLEAN]]);
|
||||
step('s11', [['targeted', '- [INFORMATIONAL] lib/stamp-only.ts:14 a comment names the old bound\n- [INFORMATIONAL] lib/stamp-only.ts:30 the side argument has no default test']]);
|
||||
const s = loop(summary(repo, '--run', run));
|
||||
expect(s).toMatchObject({ passes: 1, blocking_found: 2, fixed: 2, fix_checks: 2, rounds: 3, ledgers_read: 4 });
|
||||
expect(s).toMatchObject({ passes: 1, blocking_found: 2, fixed: 2, fix_checks: 2, rounds: 1, ledgers_read: 4 });
|
||||
expect(s.unrecorded).toBeUndefined();
|
||||
});
|
||||
|
||||
@@ -283,7 +283,7 @@ describe('GST-986 item 5: fix-check passes and their findings count from the led
|
||||
step('p1', [['red-team', '[CRITICAL] lib/a.ts:5 a deferred defect outside the diff\n[CRITICAL] lib/b.ts:9 a fixed defect']]);
|
||||
step('fc1', [['fix-check', '[CRITICAL] lib/c.ts:3 the fix broke the caller']]);
|
||||
const s = loop(summary(repo, '--run', run));
|
||||
expect(s).toMatchObject({ passes: 1, blocking_found: 3, deferred: 1, fixed: 0, fix_checks: 1, rounds: 2, unrecorded: 2 });
|
||||
expect(s).toMatchObject({ passes: 1, blocking_found: 3, deferred: 1, fixed: 0, fix_checks: 1, rounds: 1, unrecorded: 2 });
|
||||
});
|
||||
|
||||
// Value: protects=a blocker the last fix-check raises again is not fixed: only a fix-check after its last occurrence follows it
|
||||
@@ -317,7 +317,7 @@ describe('GST-986 item 5: fix-check passes and their findings count from the led
|
||||
const r = summary(repo, '--run', run);
|
||||
expect(r.err).not.toContain('REVIEW_SCOPE_UNBOUND');
|
||||
const s = loop(r);
|
||||
expect(s).toMatchObject({ passes: 2, blocking_found: 1, fixed: 1, fix_checks: 1, rounds: 3, ledgers_read: 3 });
|
||||
expect(s).toMatchObject({ passes: 2, blocking_found: 1, fixed: 1, fix_checks: 1, rounds: 2, ledgers_read: 3 });
|
||||
expect(s.unbound).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -160,6 +160,24 @@ describe('the CLI seams', () => {
|
||||
expect(r.run('gstack-approvals', ['round-grant', '--pr', '7', '--head', s, '--kind', 'fix-check', '--stop-run', 'ro', '--findings', 'f#1', '--reason', 'x', '--by', 'gstack']).status).toBe(2);
|
||||
});
|
||||
|
||||
// Value: protects=a Captain's fix-check grant can be recorded on the /ship machine while the stopped run's marker is still there,
|
||||
// as a relay naming the Captain's message, and never as an unrelayed row inside the run; fails_when=round-grant refuses the relay
|
||||
// (APPROVAL_RECORD_INVALID, #4531) or accepts an unrelayed grant inside an open run; why_new=#4531's fix-check grant could not be
|
||||
// recorded; seam=gstack-approvals round-grant; no_claim=-
|
||||
test('#4531: inside an open /ship run a grant records only as a relay with --owner-ref and --words', () => {
|
||||
const r = stopRepo();
|
||||
const s = r.head();
|
||||
fs.writeFileSync(path.resolve(r.f.work, r.f.git('rev-parse', '--git-path', 'gstack-ship-run').stdout.trim()), 'ro\n');
|
||||
const grant = (extra: string[]) => r.run('gstack-approvals', ['round-grant', '--pr', '7', '--head', s, '--kind', 'fix-check', '--stop-run', 'ro', '--findings', 'p1/red-team#2', '--reason', 'fixable blocker', '--by', 'Captain GStack Minder (GSTA-36)', ...extra]);
|
||||
const bare = grant([]);
|
||||
expect([bare.status, bare.stderr]).toEqual([2, expect.stringContaining('/ship run ro is open on this checkout')]);
|
||||
expect(grant(['--owner-ref', 'GSTA-36:2026-11-19T12:29:59Z']).status).toBe(2);
|
||||
expect(grant(['--owner-ref', 'not a ref', '--words', 'one fix-check']).status).toBe(2);
|
||||
const relayed = grant(['--owner-ref', 'GSTA-36:2026-11-19T12:29:59Z', '--words', 'one fix-check for red-team#2']);
|
||||
expect(relayed.status, relayed.stderr).toBe(0);
|
||||
expect(r.run('gstack-approvals', ['list', '--json']).stdout).toContain('relayed:GSTA-36:2026-11-19T12:29:59Z');
|
||||
});
|
||||
|
||||
// Value: protects=GST-2968's own shape end to end: the read-only run stops, the stop is recorded, a fix-check grant is recorded after
|
||||
// it, history (as preflight runs it) routes the fix-check and the plan plans it; fails_when=history prints read-only and the plan
|
||||
// prints next=full; seam=gstack-ship-receipt stop/history/claim, gstack-review-plan
|
||||
|
||||
@@ -14,7 +14,8 @@ import { gateDispositionText, type GateDisposition } from '../lib/gate-dispositi
|
||||
import { EXIT as POST_EXIT, runPost, type PostEnv } from '../lib/gstack-post';
|
||||
import { deferredRecord, renderDeferredSection } from '../lib/review-scope';
|
||||
import { ruledNoteRow, ruledNoteText, type RuledNote } from '../lib/ruled-notes';
|
||||
import { securityFingerprints } from '../lib/security-findings';
|
||||
import { publicRoundGrant, type ReviewRoundGrant } from '../lib/review-round-grant';
|
||||
import { REDACTED_REASON, securityFingerprints } from '../lib/security-findings';
|
||||
import { RELEASE, shipFixture, type ShipFx } from './helpers/ship-bin-fixture';
|
||||
|
||||
setDefaultTimeout(90_000);
|
||||
@@ -183,5 +184,48 @@ describe('a red-team finding the owner ruled not security class (gstack-evals #3
|
||||
expect(write.status, write.stderr).toBe(EXIT.ok);
|
||||
expect(fs.readFileSync(body, 'utf8')).toContain('"not_security": true');
|
||||
});
|
||||
|
||||
// Value: protects=a fix-check grant naming a red-team finding the owner ruled not security class, or another security finding, never
|
||||
// puts the raw fingerprint into the receipt, so gstack-post accepts the body; fails_when=the receipt's review_round_grants copies
|
||||
// README.md:515:red-team as gbrain-evals#567's did; why_new=GBEV-103 had to publish #567's body with another tool; seam=gstack-ship-receipt
|
||||
// write with the grant and ruling in the approval store, then gstack-post's own fingerprint check; no_claim=-
|
||||
test.skipIf(process.platform === 'win32')('a round grant\'s finding list carries the ruled public form or an opaque id, never the fingerprint (gbrain-evals#567)', () => {
|
||||
const f = shipFixture({ 'src/x.ts': 'export const x = 1;\n' }, { 'src/x.ts': 'export const x = 2;\n' });
|
||||
ships.push(f);
|
||||
fs.writeFileSync(path.join(f.root, 'stub', 'gh'), '#!/bin/sh\ncase "$*" in *visibility*) echo PUBLIC ;; *) exit 1 ;; esac\n', { mode: 0o755 });
|
||||
const run = (bin: string, args: string[]) => f.run(path.join(BIN, bin), args, { GSTACK_APPROVALS_MIRROR: '0' });
|
||||
const head = f.git('rev-parse', 'HEAD').stdout.trim();
|
||||
const ruled = run('gstack-approvals', ['rule', '--finding', 'README.md:515:red-team', '--head', head, '--reason', 'README wording about the power figure; not a security finding', '--words', 'not security', '--by', 'Fixture Owner', '--not-security']);
|
||||
expect(ruled.status, ruled.stderr).toBe(0);
|
||||
const grant = run('gstack-approvals', ['round-grant', '--pr', '7', '--head', head, '--kind', 'fix-check', '--stop-run', 'run1', '--findings', 'test/x.test.ts:70:functional-contract,README.md:515:red-team,src/net/retry.ts:42:security', '--reason', 'branch-caused failures', '--by', 'Fixture Captain']);
|
||||
expect(grant.status, grant.stderr).toBe(0);
|
||||
const body = path.join(f.root, 'body.md');
|
||||
fs.writeFileSync(body, `## Pre-Landing Review\n\n${run('gstack-approvals', ['rulings']).stdout.trim()}\n`);
|
||||
const write = run('gstack-ship-receipt', ['write', '--pr', '7', '--base', 'main', '--version', '1.0.0', '--session-kind', 'unattended', '--body', body]);
|
||||
expect(write.status, write.stderr).toBe(EXIT.ok);
|
||||
const text = fs.readFileSync(body, 'utf8');
|
||||
expect(securityFingerprints(text)).toEqual([]);
|
||||
expect(text).toContain('"README.md:515 (red-team, ruled not security class)"');
|
||||
expect(text).toContain('"test/x.test.ts:70:functional-contract"');
|
||||
expect(text).toMatch(/"sf-[0-9a-f]{12}"/);
|
||||
expect(leaks(text, 'src/net/retry.ts:42', 'retry.ts')).toEqual([false, false]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Value: protects=a round grant whose finding list names an unruled security finding publishes neither the fingerprint nor the grant's
|
||||
// free-text reason, which can describe the hole, while a grant whose only security finding the owner ruled not security class keeps
|
||||
// its reason; fails_when=publicRoundGrant redacts the findings and passes the reason through; seam=publicRoundGrant, the one mapping
|
||||
// gstack-ship-receipt write applies to review_round_grants; no_claim=the approval record's own private copy
|
||||
describe('round grants in the receipt', () => {
|
||||
const grant = (findings: string[]): ReviewRoundGrant => ({ kind: 'fix-check', head: HEAD, pr: 7, by: 'Fixture Captain', reason: SECRET_REASON, at: '2026-11-18T00:00:00Z', approval: 'a-0123456789ab', stop_run: 'run1', findings });
|
||||
test('an unruled security finding redacts the reason too; a ruled-not-security one and a plain grant keep it', () => {
|
||||
const hidden = JSON.stringify(publicRoundGrant(grant([SEC, 'test/x.test.ts:70:functional-contract']), []));
|
||||
expect(leaks(hidden, 'src/net/retry.ts', SECRET_REASON)).toEqual([false, false]);
|
||||
expect(hidden).toContain(REDACTED_REASON);
|
||||
expect(securityFingerprints(hidden)).toEqual([]);
|
||||
const ruled = publicRoundGrant(grant(['README.md:515:red-team']), [{ ...note('README.md:515:red-team', 'README wording'), not_security: true }]);
|
||||
expect(ruled).toMatchObject({ reason: SECRET_REASON, findings: ['README.md:515 (red-team, ruled not security class)'] });
|
||||
expect(publicRoundGrant(grant(['test/x.test.ts:70:functional-contract']), [])).toEqual(grant(['test/x.test.ts:70:functional-contract']));
|
||||
});
|
||||
});
|
||||
@@ -262,8 +262,8 @@ describe('gstack-ship-preflight', () => {
|
||||
fs.writeFileSync(path.join(f.root, 'body.json'), JSON.stringify({ body }));
|
||||
f.gh(`case "$*" in *"pr view"*) cat '${path.join(f.root, 'body.json')}';; *) echo 7;; esac`);
|
||||
const r = f.run(PREFLIGHT, ['--base', 'main']);
|
||||
expect(lineOf(r.stdout, 'PR_REVIEW_HISTORY')).toMatch(/^PR_REVIEW_HISTORY: pr=#7 rounds=4 cap=2 full=2 /);
|
||||
expect(lineOf(r.stdout, 'PR_REVIEW_FLAGS')).toBe('PR_REVIEW_FLAGS: --prior-rounds 4 --prior-full 2');
|
||||
expect(lineOf(r.stdout, 'PR_REVIEW_HISTORY')).toMatch(/^PR_REVIEW_HISTORY: pr=#7 rounds=2 cap=2 full=2 /);
|
||||
expect(lineOf(r.stdout, 'PR_REVIEW_FLAGS')).toBe('PR_REVIEW_FLAGS: --prior-rounds 2 --prior-full 2');
|
||||
expect(lineOf(r.stdout, 'PR_REVIEW_ROUTE')).toMatch(/^PR_REVIEW_ROUTE: read-only \(the PR had 2 full review rounds; this head gets one read-only full review/);
|
||||
expect(r.stdout).not.toMatch(/--recheck|drift_lines|recheck_blocked/);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user