Repository navigation
v1.91.256.0 feat(ship): review loop converges (frozen scope, 3-pass cap, NO FINDINGS) and receipts carry across conflict-only merges - #3481
Merged
Conversation
…NO FINDINGS first-class) and receipts carry across conflict-only merges Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…ip/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>
…ding Two blocking findings from /ship's own pass 1, both reproduced in the QA smoke before the fix: gstack-ship-receipt carry hashed the product diff with git patch-id --stable, which strips whitespace, so a space moved in a reviewed shell line carried as "no product change"; and it classed package.json and every lockfile as release metadata, so a dependency swap carried too. The patch-id is now --verbatim, package.json and VERSION are metadata only while the change is a version stamp (lib/pregate/stamp-only.ts), lockfiles are product unless the policy names them, the test globs name code extensions, a dirty working tree refuses before anything is compared, and a receipt carried twice keeps the reviewed head as carry.from. gstack-review-scope: an unresolvable base is POLICY_SOURCE_UNAVAILABLE instead of a silent working-tree read; --range-base is validated; git runs with core.quotePath=false; range_base is null on pass 1; a blocking finding with no path is fix; category "testing" is a test finding below the floor; defer searches once, files nothing on a failed search and exits 0 unfiled; summary refuses zero matching passes and the receipt write is chained to it with &&; a finding the diff causes elsewhere names the changed line in `cause` and classify follows it. Review-loop budget wording (ideas from tstack's sol-loop and pstack's interrogate, rewritten; NOTICE.md): the blocker / should / nit glossary and two stop rules in Step 9.4, the checklist and docs/review-policy.md; a lead-judgment stage in the finding merge both /review and /ship render. The core read diffs $RANGE_BASE from pass 2 on. Caps and pins re-measured with reasons. Step 7 coverage audit: four tests added in existing files, the --review-loop case moved to its own test (the shared test tripped bun's 5 s default). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… at product code CI at c3e27fc failed three free-tier tests, all this branch's own: the workflow-required-steps fixture and shared-libs-rendering still pinned the pre-Lead-judgment stage numbers, and test-of-test-ratchet counted review-loop-budget-wording.test.ts as test-only code because it read only generated markdown. The fixture and rendering test now pin stages 1-8, and the wording test renders both armies through generateReviewArmy and reads the authored ship template as well as the generated sections. Pass-2 maintainability notes folded in: docs/troubleshooting.md names the two new RECEIPT_CARRY_REFUSED causes (dirty tree, unreadable status) and the two new REVIEW_SCOPE_INPUT causes (non-hex --range-base, summary with no matching pass); gstack-review-scope's help states that classify reads the base branch's policy and refuses an unresolvable base unless --policy is passed. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…stamp The Step 9.4 template asks the writer to fill `timestamp`; the logger stamps `review_binding.started_at` but never `timestamp`. `gstack-review-scope summary` dropped such a row silently, so this PR's own pass 2 was missing from REVIEW_LOOP (passes=1 for a two-pass loop). A row now dates from `timestamp`, else from its binding start; a row with neither is still not counted. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ed defer, diff prefixes, row time) Five findings at the blocking floor from the Step 11 outside voice (gpt-6.1-sol) and the native adversarial pass, fixed as a fourth pass approved by GStack Minder under the three-pass policy: - carry: a path the policy names under stamp_files, stamp_paths or release_outputs is metadata only while its change is a stamp (versionStampOnly for a manifest kind, stampOnlyText otherwise), the rule the tree receipt applies; a logic change in a stamped source file is product. Every metadata-listed path is read at both heads and a non-stamp change drops its globs from the product exclusion. - review-scope: parseHunks keeps a deleted file as a whole changed location, so a cause anchored in a removed export is the diff's to fix, not deferred. - defer: issues are filed through lib/gstack-post's publication scan; a HIGH finding in the title or body refuses and a MEDIUM one needs a human, both recorded as unfiled with the reason; --repo names the destination. - classify: both diffs pin --src-prefix=a/ --dst-prefix=b/ --no-textconv, so diff.mnemonicPrefix cannot send every finding outside. - summary: a row dates from review_binding.started_at before the writer-typed timestamp, so a date-only value cannot drop a real pass. Docs: ship-policy.md#receipt-carry, review-policy.md, the Step 9.4 template and the CHANGELOG gate-integrity note record the rule and the pass. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… case Under the blocking floor the Performance specialist rates a 12-line N+1 INFORMATIONAL, so the conditional Red Team does not activate; the case encoded the old severity (N+1 is CRITICAL, a Red Team always follows). It now asserts the branch the run took: a Red Team that ran must follow the Performance specialist; no Red Team is correct only when the report's own count says 0 critical and its Red Team line names that reason. The N+1 detection assertion is unchanged. The free contract test gains the informational-not-activated and informational-claimed controls and the budget test's synthetic report carries the count line. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Oct 26, 2026
…eview-convergence Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan
added a commit
that referenced
this pull request
Oct 26, 2026
…ded) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Oct 26, 2026
v1.91.276.0 feat(preamble): tier 2+ skills load the shared preamble once per session (GSTA-96)
#3434
Merged
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five Captains' /ship runs hit the review cap on the same PR shape: every pass re-reviewed the whole diff, a reviewer answered an empty range with an invented advisory, and each advisory earned another full pass. Four more re-ran /ship on product code they had not changed because a conflict-only main merge or a test fix moved the head the receipt named. This PR makes the loop converge by construction and lets a receipt follow a head whose product diff is unchanged.
docs/review-policy.mdis the canonical statement of the policy, so a crew rule can be one line pointing at it.The review loop (
review_scope: frozen, the default)scripts/resolvers/review-army.ts) carries that definition; everything else is INFORMATIONAL and ships as a named note in the PR body.NO FINDINGSis a result. The prompts say it is the expected, complete answer for a clean diff and never a reason to invent an item; collection treats it as a clean result, never a failed reviewer.PASS_HEADeach entry and setsRANGE_BASEfrom pass 2, so every prompt that diffs from the merge base readsRANGE_BASE..HEAD; the gate scan and the QA probes keep the whole candidate. Newgstack-review-scope classifystamps each finding withlocus(diff/fix-range/outside, following acauseanchor when a defect the diff causes is reported at an unchanged caller, a deleted file included),kind,blockingandscope(fix/defer/note);deferfiles a blocking finding in unchanged code as a GitHub issue throughlib/gstack-post's publication scan (reused through a<!-- gstack-deferred-finding: <fingerprint> -->marker;unfiled (<reason>)withoutghor when the scan refuses the text) andrenderwrites the body's## Deferred findingsand## Review notessections.NO FINDINGSstands until a traced defect says otherwise. Ideas from tstack's sol-loop and pstack's interrogate, written in gstack's words (NOTICE.md).fixscope on pass 3 stops the run and names the finding for the owner instead of a fourth pass (Step 9.4 decision 2).gstack-review-scope summary --since <REVIEW_SINCE>writesreview_loop { passes, blocking_found, deferred, noted, fixed, scope }from this branch's review log (a row dates from the logger'sreview_binding.started_atbefore the writer'stimestamp), whichgstack-ship-receipt write --review-looprecords and the summary line prints aspasses=<n> blocking_found=<k> deferred=<m>..gstack/ship-policy.jsonreview_scope:frozen(default) |diff-plus-blocking(the documented fallback: a blocking finding in unchanged code is fixed here instead of filed) |all(the earlier loop). A non-default value needsmin_gstack_versionat or above the release that adds the key (REVIEW_SCOPE_KEY_VERSIONinlib/ship-policy.ts).Receipt carry
gstack-ship-receipt carry (--pr <n> | --body <file>) --base <base> [--dry-run] [--json]moves the receipt to HEAD when the working tree is clean, the receipt head is an ancestor of HEAD and the product diff against the base has the samegit patch-id --verbatimat both heads (whitespace counts, hunk line numbers do not). Tests, release metadata and the base merge's own commits may differ. Release metadata is the changelog, the agents digest, andVERSIONorpackage.jsononly while the change is a version stamp and nothing else; a path the policy names understamp_files,stamp_pathsorrelease_outputsis metadata only while its change is a stamp, the rule the tree receipt applies to the same paths; lockfiles are product unless the policy names them. The carried receipt recordscarry { from, reason, product_patch_id, changed_paths, merge_commits, range_diff, covers, reruns }(a second carry keeps the reviewed head asfrom), printsCARRY: carried from <old> to <new> (<reason>)and theGSTACK_RESULTline. A product change isRECEIPT_CARRY_PRODUCT_CHANGED(exit 3, naming the paths); a rebased or missing receipt, or a dirty working tree, isRECEIPT_CARRY_REFUSED./shipStep 1 item 4 runs the check when the branch has an open PR.Docs
docs/review-policy.md(new, canonical),docs/ship-policy.md#review-scopeand#receipt-carry,docs/unattended.md(thereview_loopcounters andCARRY:lines), the troubleshooting anchors for the four new result codes, NOTICE.md (tstack, pstack) and the## [Unreleased]CHANGELOG entry.Test Coverage
Step 7 ran twice. Pass 1 (whole diff): 30 code paths, 93% any / 80% value-weighted; 4 tests written, 0 rejected by the authoring gate, 2 existing tests extended. Repeat on the pass-1 fix range: 22 changed paths, 73% any / 90% value-weighted (5 weak, 1 wiring gap in
pr-body.md.tmpl, since covered bytest/ship-workflow-clarity.test.ts). Passes 2 to 4 added the tests their fixes needed: deleted-file locus, thecauseanchor,diff.mnemonicPrefixin the bin test, the publication-scan refusal of a credential-bearing finding, the date-only timestamp row,stampOnlyTextand the policy stamp-path cases.Tests:
test/review-scope.test.ts12 → 16,test/gstack-ship-receipt.test.ts13 → 17,test/review-loop-budget-wording.test.tsnew (4),test/gstack-ship-policy.test.ts,test/review-fix-range.test.ts,test/review-workflow-clarity.test.ts,test/shared-libs-rendering.test.ts,test/fixtures/workflow-required-steps.jsonupdated to the new contract.Remaining gaps (proposed, PR 2): "reviewers emit NO FINDINGS on a clean range" needs a paid behaviour case (the frozen-scope e2e case);
defer's MEDIUM branch and the gh stdin body are not asserted by the shim.Tests ran: remote_gate 21751 (Ubicloud, unit + e2e tiers, 0 failed, tree 68924421); focused free suite 538 (at b288a1b) plus the review-army contract, budget and ratchet files at 8eae4db (31); Free Tests run 40377131265 and Windows Free Tests run 40377137528 (workflow_dispatch at 8eae4db, both success); own paid cases 51.
Pre-Landing Review
Four passes under
review_scope: frozen(REVIEW_LOOP: passes=4 blocking_found=9 deferred=0 noted=14 fixed=34). The last commit, 8eae4db, is test-only (gstack-ship-receipt carry --dry-run: "test-only change + release metadata", product patch-id unchanged), so the four passes stand for this head.patch-id --stableignored whitespace (now--verbatim);package.jsonand lockfiles carried as metadata (now a version stamp only; lockfiles product); carry never checked the working tree (now refused when dirty);locusconflated an unplaced finding with unchanged code (now thecauseanchor, and an unplaced blocker isfix). 19 informational items fixed in the same commit.NO FINDINGS, maintainability 5 informational (3 doc fixes in 5bace0f, 2 notes), Red Team 2 informational (notes), QA smoke PASS (8 probes, 11 variants).summarytimestamp fallback, core read clean, binding verified.VERDICT: findings, score 6) 4 P1 + 2 P2. Five findings at the floor were verified and fixed as pass 4, approved by GStack Minder as the policy's exception (see Approvals): policy-named stamp paths carried without a content check; acausein a deleted file deferred;deferpublishing unscanned text;diff.mnemonicPrefixsending every finding outside;summarytrusting a writer-typed timestamp. Pass 4 range review: security 1 informational, testing 2 informational, core read clean.Gate edits: 36 listed, 28 read, 28 findings — 28 kept (reasons below), 0 restored, 0 open; plus one gate edit after the focused paid run (8eae4db):
review-army-perf-n-plus-oneencoded the old severity (N+1 is CRITICAL, a Red Team always follows); under the blocking floor the specialist rates the 12-line N+1 INFORMATIONAL (two runs, both0 critical), so the case asserts the branch the run took (a Red Team that ran must follow Performance; none is correct only when the report says0 criticaland names the reason), the N+1 detection assertion unchanged, two new free controls intest/review-n-plus-one-contract.test.ts. Kept: goldens (regenerated from the templates);skill-md-size-allowlist.jsongstack-review pins +1,396 on cursor, factory, kiro, opencode, slate (measured, lead-judgment stage);workflow-required-steps.jsonstages 1–8 with Lead judgment pinned;carve-guards.tsshipmaxSizeRatio1.7010 → 1.7150 (measured 1.7135), review 1.2960 → 1.3100 (measured 1.3080); test expectations moved to the new contract (RANGE_BASEread, stage numbers,deferexit 0,summaryrefusal, deleted filewhole, a real stamp in the stamp-paths e2e case). No assertion weakened.Outside review: completed (gpt-6.1-sol, structured, findings fixed in pass 4); native adversarial completed (claude-sonnet-5-5). Codex CLI is not installed on this runner; the different-family subagent is the outside voice.
Review notes
Below the floor, named here and queued for PR 2:
bin/gstack-ship-receipt:390andlib/ship-receipt.ts:192: the per-path cap20is a bare literal in two places; and the per-path patch-id walk runs over every from..head product path (a large base merge included) before the cap.bin/gstack-review-scope:137:--limit 200is unnamed and an exactly-200 result is not treated as truncated.bin/gstack-ship-receipt:294:git patch-id --verbatimneeds git ≥ 2.39; older git makes every carry refuse with the generic patch-id message (safe, but the stderr is discarded and the requirement is undocumented).lib/ship-receipt.ts:205: a carry'scoversclaims gate integrity even when the test patch-id differs (gate fixtures live undertest/).bin/gstack-ship-receipt:334:carryrewrites the PR body from a snapshot read before its patch-id work; a concurrent edit in that window is lost.bin/gstack-ship-receipt:291:patchIddoes not pin--ignore-submodules=none.bin/gstack-review-scope:deferandrenderaccept an empty or unclassified findings file;gh repo viewrejects--repo, so with--repothe scan's recorded visibility isunknown(no tier change); the MEDIUM branch is untested.lib/ship-receipt.ts:196: apolicy.changelogat a non-default path, or a stamp glob overlapping the test globs, now classes product (a safe refusal).lib/ship-receipt.ts stampOnlyText: the version replacement has no digit boundary; a false stamp needs the old text to already hold the corrupted form.scripts/resolvers/outside-voice-steps.ts: Step 11's late defers are not in the review log, so the receipt'sdeferredcan under-count them; the outside backends still read the whole branch on pass 2+.ship/sections/review-army.md.tmpl: the pass-cap check sits after Fix-First has applied edits; the scratch-file locations in Step 9.4 are unnamed (write them under.gstack/tmp/).scripts/resolvers/review-army.ts:198: the lead-judgment stage has no exemption for forced-CRITICAL classes.lib/review-scope.ts: issue text is not neutralized for closing keywords or mentions; a CRITICALtestingfinding is a test gap by category.bin/gstack-review-scope:143:deferpublishes reviewer output as maintainer-authored issues on contributor PRs (pass 1 note).Deferred findings
None: every blocking finding was in the diff.
Exploratory QA
Step 9.2.1 ran twice on a fixture repository (never on this checkout). Pass 1: 12 captures; ISSUE-001 (whitespace-only edit carried) and ISSUE-002 (dependency swap carried) reproduced, fixed, revalidated (captures 007–009). Pass 2 on the fixed tree: PASS, 8 probes and 11 variants (
--verbatim, manifest stamp vs dependency, dirty tree tracked and untracked, double carry, unplaced and caused findings, policy refusal, non-hex range base, zero-pass summary, dry-run defer). Not probed: livegh issue create,render,carry --pr.Design Review
No frontend files changed — design review skipped.
Eval Results
No paid case ran. The paid frozen-scope behaviour case (reusing the ship e2e harness) is PR 2's; Step 6 selected 112 of 251 tests (82 of 82 shards) for this diff because NOTICE.md is an unknown dependency, so a READY screen is the honest choice.
Greptile Review
No Greptile comments.
Issues
ISSUE_LINKS: none
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. Reviewed scope: the four new result codes and their troubleshooting anchors (
REVIEW_SCOPE_INPUT,REVIEW_SCOPE_RANGE,RECEIPT_CARRY_REFUSED,RECEIPT_CARRY_PRODUCT_CHANGED, including the dirty-tree, non-hex range base and zero-pass causes),docs/review-policy.md(new),docs/ship-policy.md#review-scopeand#receipt-carry(the stamp-only rule for policy-named paths, the scanned issue text),docs/unattended.md(terminal lines),bin/gstack-review-scope --help, NOTICE.md, CHANGELOG## [Unreleased]. Known gap for PR 2: the git ≥ 2.39 requirement ofpatch-id --verbatimis not yet stated under#receipt-carry.Gate integrity
No threshold, timeout, trial count or case kind changed. Caps and pins, each with its measurement, are listed in the CHANGELOG's Gate integrity bullets and under "Gate edits" above. The four new result codes live in
lib/result-codes-release.tssolib/result-codes.tsstays under the module-size ratchet.Approvals
docs/review-policy.mdas the canonical statement, the policy paragraphs inship/SKILL.mdandreview/SKILL.md, and the gstack-review pin raise that carries themTest plan
gstack-pregate --stage tests --remote(Ubicloud, unit + e2e tiers): 21,749 pass / 0 fail at b288a1b ($0.08) and 21,751 pass / 0 fail at 8eae4db ($0.11)bun run typecheck: clean;bun run typecheck:test: 819 known diagnostics, none newbrowse/test/cookie-import-native.test.ts's Playwright pipe smoke, a file this PR does not touch, which passed at b288a1b in run 40368911422); Windows Free Tests (run 40377137528): success; both recorded as the requires-remote lane receipts inpregate.json(PREGATE_VERIFY: okfor tree 68924421903d)review-army-perf-n-plus-onefailed twice there (real, not flaky: the N+1 is INFORMATIONAL under the blocking floor, so no Red Team ran), repaired in 8eae4db and passing ($0.23); 51 of 51 at this head, $14.26 total