Repository navigation
fix(ship-receipt): carry survives a base policy change that selects no PR file (GST-1415) - #4030
Merged
Merged
Conversation
…o PR file (GST-1415) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
3 tasks done
capy-ai Bot
added a commit
that referenced
this pull request
Nov 5, 2026
…lds a PR file; name scan greps consumers only (GST-1434, GST-1435) (#4036) * fix(review-exclude): ready binds an older digest when no selection holds a PR file; the name scan greps consumers only (GST-1434, GST-1435) GST-1434: gstack-ship-queue ready (and train build, land) refused any receipt whose recorded review_exclude digest differed from the base policy's, so a policy edit on main voided every receipted PR even when no PR file fell under a pattern (harness-evals #274, #276 after #278). excludeMismatch now uses carryExcludeBinds, the predicate carry uses since #4030: a digest change binds when neither the recorded selection nor HEAD's holds a file the PR changed; anything else still refuses. GST-1435: the named-by-code scan ran git grep over the whole tree, so on harness-evals #269 it searched 30 MB of receipts for 4,354 candidate paths, ran 278 s past its 120 s limit and kept every file. It now lists each tree, keeps the consumer files (code and tests outside the candidates) and greps only those through literal pathspecs in 24 KB chunks. A git failure or timeout still keeps every candidate. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes grepFixed keeps every candidate when a consumer's name does not survive UTF-8 decoding, since its literal pathspec would match nothing. Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/adversarial-native#1 reader=adversarial-native Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: the queue's review_exclude check follows carry's rule (GST-1434) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
What changed
docs/ship-policy.md: carry now binds when neither the recorded nor HEAD's review_exclude selection holds a PR file (GST-1415).
Before/after as text: docs/ship-policy.md: carry now binds when neither the recorded nor HEAD's review_exclude selection holds a PR file (GST-1415)
gstack-ship-receipt carryno longer refuses withreview_exclude changedjust because main'sreview_exclude_pathsdigest moved. When neither the receipt's recorded selection nor HEAD's holds a file the PR changed, every reviewer read the full diff and still would, so the receipt carries and records HEAD's digest (which the queue then binds exactly).lib/ship-receipt-depth.ts: the GST-1408 predicate ("no file the head changed matches any current pattern") is now one sharedselectsNoFile, used unchanged by the queue'sexcludeMismatchand by the newcarryExcludeBinds.lib/review-exclude.ts:recordSelectsNoFiledecides the recorded side from the receipt's hashes, not its counts: the list hash must be the empty selection's and the digest must be built from it.bin/gstack-ship-receiptcarry callscarryExcludeBinds; the refusal text, help and docs/ship-policy.md say what carry now compares.Why
HARN-1's harness-evals #263 was forced into a full five-reader re-review of an unchanged product after main's exclude patterns changed. GST-1408 (#4018) fixed the same thing for
ship-queue ready, but carry kept comparing digests. Now a pattern change on main that touches none of the PR's files no longer voids a carried receipt.Blast radius
Carry only. The queue's behavior is unchanged. Its GST-1408 tests, including "a recorded digest that differs still refuses", pass as before (CI Free Tests run 41984069461 at this tree). Still refused: a pattern change that selects a PR file (excluded or kept), in either direction, and an unreadable or malformed base policy (script ran: the GST-1415 refusal cases in test/review-exclude.test.ts).
Tests
Failing first in
test/review-exclude.test.ts("carry after a base policy change (GST-1415)"): on main the "selects no PR file" case refused withRECEIPT_CARRY_REFUSED review_exclude changed: recorded=none now=68bc66cf…; with the fix it carries for a pattern gained, added beside another, removed beside another and reverted, and the queue binds each carried receipt. The refusal cases (excluded and kept PR files, both directions; malformed and unparseable policy) pass before and after.Closes GST-1415.
Approvals
No approvals recorded for branch capy/gst-1415-carry-exclude-selection.
Summary
Receipt carry used to refuse whenever main's review_exclude digest moved, even when no PR file fell under any pattern, which forced full re-reviews of unchanged products. Carry now binds in that case and records HEAD's digest so the queue binds the carried receipt exactly.
Test Coverage
All new code paths have test coverage. Failing first in
test/review-exclude.test.ts("carry after a base policy change (GST-1415)"): on main the "selects no PR file" case refused withRECEIPT_CARRY_REFUSED review_exclude changed: recorded=none now=68bc66cf…; with the fix it carries for a pattern gained, added beside another, removed beside another and reverted, and the queue binds each carried receipt. The refusal cases (excluded and kept PR files, both directions; malformed and unparseable policy) pass before and after.Tests ran: free 1589 (files; carried from CI Free Tests run 41984069461/1 at tree e09936e2113d)
Pre-Landing Review
Pre-Landing Review: 2 issues — 0 auto-fixed, 1 asked (0 fixed, 1 skipped), 0 deferred, 1 noted
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=1 fixed=0 scope=frozen ledgers_read=2 dispatches=2
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Full panel (R51, gate class): batched specialist (testing, security, state-machines), red team, native adversarial, targeted (money) and an outside voice (openai/gpt-6.1-sol, completed: approve, no findings). No finding met the blocking floor.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/ship-receipt-depth.ts:280The new selectsNoFile and carryExcludeBinds were inserted between excludeMismatch's JSDoc and its function, so that doc block now sits above selectsNoFile (core and native adversarial).lib/ship-receipt-depth.ts:304(red team, skipped as below the floor and outside GST-1415's carry scope) The queue'sexcludeMismatchstill makes the no-file exception only for a receipt with noreview_exclude. A receipt whose recorded selection is the empty one, on a head that does not move, still refuses after a base pattern change that selects no PR file, because carry returnsCARRY: currentbefore it reachescarryExcludeBinds. Follow-up: letexcludeMismatchaccept(recorded none or recordSelectsNoFile) && selectsNoFile, with a queue test.lib/ship-receipt-depth.ts:289(native adversarial)exclusionAtreturns statenonewhen the base sha or merge base cannot be resolved, andselectsNoFilereadsnoneas "no PR file", so a future caller ofcarryExcludeBindscould carry without reading the base policy. Unreachable today:cmdCarryrefuses first whengit merge-base origin/<base> HEADfails (bin/gstack-ship-receipt:683). Follow-up: returnrefusedfromexclusionAtwhen the base or merge base is missing.Exploratory QA
Smoke (report-only):
bun test test/review-exclude.test.ts -t GST-1415ran the realgstack-ship-receipt carrybinary on fixture repositories: 3 pass, 0 fail (the success case and the two refusal edges). QA method sections were not loaded; no browser surface.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
TODOS
No TODO items completed in this PR.
Documentation
Scope: I audited the branch diff against base 549b9a8. It covers carry's handling of
review_excludeinbin/gstack-ship-receipt,lib/review-exclude.tsandlib/ship-receipt-depth.ts, plusdocs/ship-policy.mdand thechangelog.dfragment. I also grepped the docs tree, including nested docs and templates, for other mentions ofreview_excludewith carry.Result: The docs are current.
docs/ship-policy.mdalready describes the GST-1415 carry exception, which matches the code incarryExcludeBinds. The--review-excludehelp text inbin/gstack-ship-receiptis updated to match. The changelog fragment is present.docs/review-policy.mddescribes the digest only generically, which stays accurate.Debt: None found. The earlier sentence in
docs/ship-policy.mdthat says carry refuses on a different digest is qualified by the exception paragraph right after it, so I left it alone.Test plan
Closes GST-1415.