From 6f5782b5fddb53062eb6870864cee0b6fbeb2ca6 Mon Sep 17 00:00:00 2001 From: garrytan Date: Mon, 26 Oct 2026 15:30:51 +0000 Subject: [PATCH] test(ship): keep the Step 9 first-entry and Fix-First phrasing the skip/requeue contract asserts; fill the review record's pass, review_scope and range_base placeholders in the caller template test; narrow a test type Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- ship/sections/review-army.md | 9 +++++---- ship/sections/review-army.md.tmpl | 9 +++++---- test/qa-exploratory-callers.test.ts | 3 ++- test/review-scope.test.ts | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ship/sections/review-army.md b/ship/sections/review-army.md index 31586db71..b2b570435 100644 --- a/ship/sections/review-army.md +++ b/ship/sections/review-army.md @@ -2,9 +2,9 @@ ## Step 9: Pre-Landing Review -On first entry only: set CYCLES to 0 and PASS to 1, save -`REVIEW_SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)` and the `ship: review_scope` policy -line (Step 3). Every entry saves `PASS_HEAD=$(git rev-parse HEAD)`; from pass 2 on, +Set CYCLES to 0 on first entry only, with PASS set to 1, +`REVIEW_SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)` saved and the `ship: review_scope` +policy line (Step 3) kept. Every entry saves `PASS_HEAD=$(git rev-parse HEAD)`; from pass 2 on, `RANGE_BASE` is the previous pass's PASS_HEAD. Keep existing approvals; changed finding scope needs a new decision. Order: checklist/design, specialists (9.1), Red Team (9.2), QA (9.2.1), dedup (9.3), scope, fixes and logging (9.4). @@ -635,7 +635,8 @@ but missing dispatched output still blocks continuation, even with a QA exceptio code is `fix`, never `defer`; under `all` everything is `fix`. Save the `REVIEW_SCOPE:` line. A `REVIEW_SCOPE_INPUT` or `REVIEW_SCOPE_RANGE` refusal is a STOP until repaired. -1. **Classify only `scope: fix` findings as AUTO-FIX or ASK** per the Fix-First Heuristic in +1. **Classify only unmatched or reopened findings as AUTO-FIX or ASK** when the + classified output marks them `scope: fix`, per the Fix-First Heuristic in checklist.md. Critical findings lean toward ASK; informational lean toward AUTO-FIX. 2. **Auto-fix all AUTO-FIX items.** Apply each fix. Output one line per fix: diff --git a/ship/sections/review-army.md.tmpl b/ship/sections/review-army.md.tmpl index 259be2a13..a108b161a 100644 --- a/ship/sections/review-army.md.tmpl +++ b/ship/sections/review-army.md.tmpl @@ -1,8 +1,8 @@ ## Step 9: Pre-Landing Review -On first entry only: set CYCLES to 0 and PASS to 1, save -`REVIEW_SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)` and the `ship: review_scope` policy -line (Step 3). Every entry saves `PASS_HEAD=$(git rev-parse HEAD)`; from pass 2 on, +Set CYCLES to 0 on first entry only, with PASS set to 1, +`REVIEW_SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)` saved and the `ship: review_scope` +policy line (Step 3) kept. Every entry saves `PASS_HEAD=$(git rev-parse HEAD)`; from pass 2 on, `RANGE_BASE` is the previous pass's PASS_HEAD. Keep existing approvals; changed finding scope needs a new decision. Order: checklist/design, specialists (9.1), Red Team (9.2), QA (9.2.1), dedup (9.3), scope, fixes and logging (9.4). @@ -81,7 +81,8 @@ but missing dispatched output still blocks continuation, even with a QA exceptio code is `fix`, never `defer`; under `all` everything is `fix`. Save the `REVIEW_SCOPE:` line. A `REVIEW_SCOPE_INPUT` or `REVIEW_SCOPE_RANGE` refusal is a STOP until repaired. -1. **Classify only `scope: fix` findings as AUTO-FIX or ASK** per the Fix-First Heuristic in +1. **Classify only unmatched or reopened findings as AUTO-FIX or ASK** when the + classified output marks them `scope: fix`, per the Fix-First Heuristic in checklist.md. Critical findings lean toward ASK; informational lean toward AUTO-FIX. 2. **Auto-fix all AUTO-FIX items.** Apply each fix. Output one line per fix: diff --git a/test/qa-exploratory-callers.test.ts b/test/qa-exploratory-callers.test.ts index 82e8cb953..6381d7045 100644 --- a/test/qa-exploratory-callers.test.ts +++ b/test/qa-exploratory-callers.test.ts @@ -326,7 +326,8 @@ describe('caller native-event observer controls', () => { .replace('"commit":"COMMIT"', `"commit":"'"$(git rev-parse --short HEAD)"'"`) .replace('"STATUS"', '"issues_found"').replace(/"issues_found":N/, '"issues_found":1').replace('"critical":N', '"critical":1').replace('"informational":N', '"informational":0') .replace('SCORE', '10.0').replace('SPECIALISTS_JSON', '{}').replace('FINDINGS_JSON', '[{"fingerprint":"scale.ts:3:functional-contract","severity":"CRITICAL","action":"ask-pending"}]') - .replace('COMPLETED', 'false').replace('CONVERGED', 'false').replace('CYCLES', '0').replace('REVIEW_START', 'native-token'); + .replace('COMPLETED', 'false').replace('CONVERGED', 'false').replace('CYCLES', '0').replace('REVIEW_START', 'native-token') + .replace('"pass":PASS', '"pass":1').replace('"review_scope":"SCOPE"', '"review_scope":"frozen"').replace('RANGE_BASE_OR_NULL', 'null'); expect(errorsFor(filled)).toEqual([]); const fixture = createQaCallerFixture(caller === 'review' ? 'review-exploratory-small-cli' : 'ship-exploratory-small-cli', { installRuntime: false }); try { expect(qaCallerSessionOptions(fixture, 'free-control').prompt).toContain(callerReviewRecordTemplate(fixture)); } finally { fs.rmSync(fixture.root, { recursive: true, force: true }); } diff --git a/test/review-scope.test.ts b/test/review-scope.test.ts index db17abcb3..dce80c091 100644 --- a/test/review-scope.test.ts +++ b/test/review-scope.test.ts @@ -104,7 +104,7 @@ describe('scope decisions', () => { const p2 = by(scopeFindings(findings, { policy: 'diff-plus-blocking', pass: 2, diffHunks: diff, rangeHunks: range })); expect(p2['lib/legacy.ts:7:data-loss']).toBe('outside/defect/blocking/fix'); expect(p2['src/auth.ts:42:naming']).toBe('diff/defect/below/note'); - expect(Object.values(p2).some(v => v.endsWith('/defer'))).toBe(false); + expect(Object.values(p2).some(v => String(v).endsWith('/defer'))).toBe(false); }); test('frozen pass 2+: only blocking findings in the range or the diff are fixed; everything below the floor is a note', () => {