Skip to content

fix: queued PRs keep their ship receipts when main starts excluding paths they never touched (GST-1408) - #4018

Merged
capy-ai[bot] merged 4 commits into
mainfrom
garrytan/gst-1408-review-exclude-older-receipts
Nov 5, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
garrytan/gst-1408-review-exclude-older-receipts

Conversation

@garrytan

@garrytan garrytan commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4018,
  "head": "a0b73148b0a3d8a1e0bac856b8ffe6da025e6808",
  "version": "1.95.5.0",
  "base": "main",
  "ci_carried": [
    {
      "lane": "free",
      "run": 41964578160,
      "attempt": 1,
      "tree": "74d7fcebd0e0042d5f7ffb9f69cfd876924c9420"
    }
  ],
  "session_kind": "unattended",
  "thread": "GSTA-295",
  "head_tree": "74d7fcebd0e0042d5f7ffb9f69cfd876924c9420",
  "product_patch_id": "20bc342535269c5d69aa9f5a37a1af4beba089a2",
  "gstack_version": "1.95.5.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 6,
    "rules": "0d7af83f8b45e574",
    "base": "33d7352a7f7b01e2e301efbf88110ad37e38ff31",
    "registry": "33d7352a7f7b01e2e301efbf88110ad37e38ff31",
    "gate_scan": {
      "tagged": 0,
      "head": "a0b73148b0a3d8a1e0bac856b8ffe6da025e6808"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "runtime=6"
    ],
    "risk": [
      "money"
    ],
    "mode": "panel"
  },
  "pregate": "pass @74d7fcebd0e0 (7 checks, current for a0b73148b0a3)",
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ and README.md against the GST-1408 diff (ship-policy.md, troubleshooting.md, the changelog fragment)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "30e6bce187be0d59",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "20bc342535269c5d69aa9f5a37a1af4beba089a2",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

What changed

GST-1408 tests at main 6bdafb2 (before) and this branch (after): a receipt with no review_exclude digest now binds when the PR touches none of the new patterns; the three refusals stay

GST-1408 tests at main 6bdafb2 (before) and this branch (after): a receipt with no review_exclude digest now binds when the PR touches none of the new patterns, and the three refusals stay.

Before/after as text: GST-1408 tests at main 6bdafb2 (before) and this branch (after): a receipt with no review_exclude digest now binds when the PR touches none of the new patterns; the three refusals stay
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+(pass) a receipt with no digest binds when the PR touches none of the new patterns
-ready refuses: field=review_exclude expected=a97f57a5508d9ef0d837845052888564f310d9c01a788c7fee8e314a9f9b5b15 recorded=none source=origin/main@724e0c8b1752 …
-(fail) a receipt with no digest binds when the PR touches none of the new patterns
 (pass) a receipt with no digest still refuses when the PR touches a new pattern, excluded or kept
 (pass) a recorded digest that differs from the current one still refuses, though the PR touches no pattern
 (pass) an unreadable base policy still refuses a receipt with no digest
+ 4 pass
+ 0 fail
- 3 pass
- 1 fail
 

Why

"One config PR stopped 9 queued receipted PRs" (HARN-1 on harness-evals, #264 merged as 4cb48b0fb). When main's .gstack/ship-policy.json gained review_exclude_paths, gstack-ship-queue ready refused every older receipt with field=review_exclude expected=<digest> recorded=none, even for PRs that touch none of the new patterns, and the only fix was to rerun review on each unchanged head. Those receipts now bind, because excluding paths a PR never touched can't change what its reviewers read.

Blast radius

One added line in excludeMismatch (lib/ship-receipt-depth.ts), which bindShippedReceipt calls for ready, train build, land and land-direct. It returns early only when the receipt records no digest and every current pattern matched no changed file (record.unmatched.length === record.patterns.length, from git's own diff --raw over the same merge-base range the review read). With nothing matched, the excluded set is empty, so the depth and targeted verdicts are unchanged. An unreadable or invalid base policy still returns refused before this check (walked: bindShippedReceipt checks at.x.state === 'refused' first; test proves it). Carry (bin/gstack-ship-receipt carry) is untouched and still compares digests.

Approvals

APPROVALS_RENDER: redacted (repository visibility public); gstack-approvals list shows the full record

No approvals recorded for branch garrytan/gst-1408-review-exclude-older-receipts.

Summary

Reported by HARN-1 against gstack 1.95.5: adding review_exclude_paths to main's ship policy made the merge queue refuse every receipt written before it. The queue now accepts a receipt with no recorded review_exclude digest exactly when no file the PR changes matches any current pattern, whether that file would be excluded or kept. It keeps refusing a recorded digest that differs from the current one, a PR that touches a pattern, and a base policy it can't read. docs/ship-policy.md and docs/troubleshooting.md say so, and the changelog fragment notes that carry still compares digests.

Other receipt-bound policy checks were audited for the same flaw: review_depth and review_targeted already accept legacy receipts and recompute their requirement from the diff (a new review.risk_paths only raises depth for PRs that touch those paths), and review.platform off refusing a platform-depth receipt is a deliberate tightening. The only other instance is carry's own digest comparison, left for the carry owner.

Test Coverage

Four new cases in test/review-exclude.test.ts, on receipts that gstack-ship-receipt write produced and the queue's bindShippedReceipt:

  • a receipt with no digest binds when the base later gains patterns the PR doesn't touch. Regression proof: fails at main 6bdafb2 with field=review_exclude expected=a97f57a5… recorded=none, passes after the fix;
  • it still refuses when the PR touches a pattern, for an excluded data file and for a kept code file;
  • a recorded digest that differs from the current one still refuses;
  • an unreadable base policy still refuses (POLICY_INVALID).

Tests ran: focused 97

Pre-Landing Review

No blocking issues found. Full panel (review depth full: gate class, money risk line), two rounds.

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2 dispatches=4

Gate edits: none detected (the diff edits no test assertion or gate path outside the four added cases)

Outside review: openai/gpt-6.1-sol, completed, no actionable findings.

Review notes

  • Carry and the queue now disagree on a digest-less receipt: an affected PR that merges main is refused by carry (RECEIPT_CARRY_REFUSED review_exclude changed: recorded=none now=<digest>) and needs /ship once. Carry belongs to the GST-1399 lane, so this PR leaves it alone; a follow-up can share one predicate with excludeMismatch.
  • A receipt that recorded a digest is still refused when a later policy edit changes the patterns, even if the PR touches none of them. That is the brief's choice (a differing recorded digest keeps refusing).
  • The ship-policy line describes the common case ("written before the base gained the key"); the code accepts any digest-less receipt under the same no-match rule, which is equally safe.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Bug fix under the fix-lane exemption; the failing test came first.

TODOS

No TODO items completed in this PR.

Documentation

Scope: the GST-1408 diff against main (base 6bdafb2), covering the excludeMismatch change, the ship-policy paragraph, the changelog fragment and the field=review_exclude entry in troubleshooting. Result: ship-policy.md and the fragment are accurate. I added a short note to the field=review_exclude entry in troubleshooting.md explaining that the queue now skips receipts recorded as none when no file the PR changes matches a current pattern. Debt: none found in the reviewed files.

Test plan

  • bun test test/review-exclude.test.ts test/ship-receipt-depth.test.ts test/gstack-ship-queue.test.ts test/ship-queue-land.test.ts: 97 tests ran, exit 0
  • bun run typecheck and bun run typecheck:test: clean, no new diagnostics
  • Free suite: carried from CI at the pushed head (the local run on this 4-core machine failed only in Chromium-launch, CSO native-helper and timing tests that this diff doesn't touch; ship-receipt-carry-large-diff and model-policy-cli fail the same way on main 6bdafb2 here)

…he PR touches no new pattern (GST-1408)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 5, 2026 03:32
…eck ratchet

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>
… no pattern matches (GST-1408)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot changed the title fix(ship-queue): older receipts bind when the PR touches none of the newly excluded paths (GST-1408) fix: queued PRs keep their ship receipts when main starts excluding paths they never touched (GST-1408) Nov 5, 2026
@capy-ai
capy-ai Bot marked this pull request as ready for review November 5, 2026 04:02
@capy-ai
capy-ai Bot merged commit 3b66745 into main Nov 5, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant