Repository navigation
v1.93.3.0 fix(ship-queue): refuse a head whose required targeted review is missing or failed (GST-966) - #3859
Merged
Merged
Conversation
…ing or failed (GST-966) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…l (typecheck:test ratchet) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan
added a commit
that referenced
this pull request
Nov 2, 2026
…hing after the read carries a class (gate scan run), a re-raised blocker is not fixed, verify always clears the stale record, carry names #3859 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot
added a commit
that referenced
this pull request
Nov 2, 2026
…ite/carry run the targeted verdict; fix-check ledgers count (GST-986) (#3887) * test: GST-986 failing-first cases for the targeted record, receipt write/carry and fix-check counters Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): GST-986 targeted record binds to the read commit; write/carry run the targeted verdict; fix-check ledgers count Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): GST-986 write/carry report fail-closed targeted classes; docs, changelog, adversarial repin (brief bodies unchanged) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: GST-986 review round 1 failing-first: a docs/TODOS commit after the targeted read binds; verify clears a stale --targeted-out Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): GST-986 review round 1: a record binds across class-free commits after the read; verify removes a stale targeted record Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: GST-986 fix-check failing-first: test skip after the read, re-raised blocker, verify early-return cleanup, carry wording Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): GST-986 scoped fix-check batch: record binds only when nothing after the read carries a class (gate scan run), a re-raised blocker is not fixed, verify always clears the stale record, carry names #3859 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: GST-986 carry case runs receiptDepthAtHead under the fixture's private HOME (pregate real-HOME tripwire) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: GST-986 classify .gstack/tmp/targeted.json as a /ship producer (gstack-clean, from the main merge) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: GST-986 bind a targeted record only to the product patch the reader read The targeted gate reader at 0715327 found that the classifier-only binding rule kept a stale record bound when a post-read edit removed an enforcing line with no money token. Restore main's equal-product-patch check and keep the gate-scan refusal on top of it. Docs-only binding moves to GST-1031. 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
gstack-ship-queue ready,train build,train landandlandnow refuse a head withQUEUE_RECEIPT_TARGETED_MISSINGwhen the head touches money, gate, auth or secret code and the PR body's /ship receipt has no done targeted pass covering every required class. That covers four cases: no pass recorded, a failed pass, a pass that did not run, or a pass on other classes. All of them sharebindShippedReceiptinlib/ship-receipt-depth.ts.receiptTargetedLinebecomesreceiptTargetedVerdict, which returns the sameREVIEW_TARGETED:line plus an ok flag and a message. The line also gainsverdict=failedfor a recorded failed pass.A receipt with neither
gstack_versionnorreview_depthpredates targeted receipts. It is still accepted as legacy, the same rulereceiptDepthVerdictuses, and its line says so. A head that needs no targeted class passes as before. The depth check still runs first and keeps its own code.The same commit adds the registry entry in
lib/result-codes-release.ts, thequeue-receipt-targeted-missingtroubleshooting anchor, the doctor mapping, updates todocs/ship-policy.mdanddocs/review-policy.md, and the changelog.d fragment.landandtrain buildprint theREVIEW_TARGETED:line with the refusal.Before and after:
readyon an auth head with gstack-evals#140's receipt shape (the new test, run on origin/main 0c84f4e and on this branch):Why
GST-966. On gstack-evals#140,
gstack-ship-queue readyexited 0 even though the receipt showedREVIEW_TARGETED: required=auth receipt=legacy verdict=missing. The queue only reported the targeted line (GST-257 PR 1 shipped it report-only), so a head whose required targeted reader never ran looked the same as a clean one and could join a train. This is part 1: the queue refuses. Part 2, making /ship always record the targeted pass in the receipt and binding that record to the reviewed patch, is GSTA-167's.Proof, failing first. The new
readytest, run against origin/main's code, printed the #140 line and exited 0. It expected 3 and received 0 (test/gstack-ship-queue.test.ts:377). On this branch it passes. Function-level smoke probes ofreceiptTargetedVerdict(the #140 shape, legacy, depth-only, failed, not-run, partial, covered and nothing required) all behave as described above.Blast radius
bindShippedReceiptandreceiptTargetedVerdictinlib/ship-receipt-depth.ts, plus one printed line each inlib/ship-queue-land.tsandlib/ship-queue-train.ts. Every caller ofbindShippedReceiptnow refuses an uncovered head:ready,train build,train land(direct and update),train ready --base-redandland.gstack_versionorreview_depthbut no done targeted pass covering the head's money, gate, auth or secret classes. That is the intended case. Older legacy receipts still pass. Pooled READYs today (v1.92.65.0 fix(review): every reviewer brief opens with the REVIEWED_TREE step (GST-897) #3830, v1.92.63.0 fix(ship): a slot restamp after the docs audit keeps finish's docs check fresh (GST-906) #3834) need no targeted class.test/gstack-ship-queue.test.ts(newreadycase: missing and failed refuse, done and unrequired pass),test/review-targeted.test.tsandtest/ship-receipt-depth.test.ts(expectations move from report-only to refusal).gstack-review-dispatch verify --targeted-out, thengstack-ship-receipt write --review-targeted @<file>).Approvals
Source: gstack-approvals record for gst-966-ready-targeted-missing (display only; not an approval citation).
Pre-Landing Review
REVIEW_LOOP: passes=2 blocking_found=1 deferred=1 noted=2 fixed=0 scope=frozen dispatches=8
Pre-Landing Review: 10 issues (5 in the core pass, 5 from the Step 11 voices): 0 auto-fixed, 0 asked, 3 deferred, 7 noted or listed.
Gate edits: none detected (6 listed, 5 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
The panel: specialist (testing, security, state-machines), Red Team, coverage audit, adversarial-native (claude-opus-5-5) and the outside voice (openai/gpt-6.1-sol). Round 1 ran the full panel (VERIFY: clean, 4 briefs, 4 outputs). CI's
typecheckthen failed on the new test (two TS2345 errors from the test-type ratchet: the fixture'sreview_depth.classwas a plain string). 2212c95 types it'code' as const. Round 2 (the R51 cap) reviewed that one-line range with the specialist and the Red Team: NO FINDINGS from both, VERIFY: clean.Open note: a stale targeted record passes (outside-voice#1, CRITICAL, moved to GSTA-167 part 2)
The outside voice reproduced this on a real CLI fixture:
gstack-review-dispatch verify --targeted-out targeted.jsonat head H1.gstack-ship-receipt write --review-targeted @targeted.jsonrebinds the H1 record to H2's product patch-id throughparseReviewTargeted(unchanged code).bindShippedReceipt, and soready, readsrequired=auth receipt=auth verdict=ok, although re-verifying the H1 ledger at H2 reportsstatus=failed.The fix is to carry the reviewed patch identity in the targeted record and check it, which is the recorder. The Captain moved it to GSTA-167 part 2 (#3855), together with #3853 (/ship's receipt-write commands never pass
--review-targeted) and #3854 (writeandcarryskip the targeted check). This PR is still strictly tighter than main: on main the queue refuses nothing on targeted coverage.Deferred findings
Blocking findings in code this PR did not change (review scope: frozen); filed as issues and not closed by this PR.
ship/sections/pr-body.md.tmpl:207The queue now enforces the targeted pass, but /ship's own receipt-write step never records one. The exactgstack-ship-receipt writecommands in ship/sections/pr-body.md.tmpl:207, ship/DRIVER.md.tmpl:120 and ship/sections/handoff.md.tmpl:12 pass --gate, --pregate, --issues, --review-loop and --docs, but not --review-targeted. adversarial.md.tmpl:6 only says in prose thatverify --targeted-outfeeds the receipt, and it names no file the write step reads. Also,write(bin/gstack-ship-receipt:222-226) does not fail when the head needs a targeted class and no --review-targeted is given. That is exactly how feat: Completeness Principle — Boil the Lake (v0.6.1) #140 ended up with gstack_version set andreceipt=legacy. With this diff, such a receipt is refused with QUEUE_RECEIPT_TARGETED_MISSING at ready, train build and land on every money, gate, auth or secret head. By the diff's own numbers that is about 40 of the last 100 commits. The documented fix (troubleshooting.md#queue-receipt-targeted-missing: 'Run /ship on the head') runs the same write command again and produces the same refused receipt. So lanes that follow /ship literally get stuck in a loop.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
bin/gstack-ship-receipt:729Carry checks again that the review depth has not risen, but it does not check targeted coverage. It keeps review_targeted from the old head as it was, while planCarry allows a test-only change (lib/ship-receipt.ts:253) and a scoped-review product change. Test hunks can carry gate-scan tags (review-targeted.ts targetedPatchId: 'a test-only fix that adds a gate hunk changes it'). So a test-only follow-up can makegatea required class while the receipt depth is already full: carry printsCARRY: carried, and thenreadyrefuses QUEUE_RECEIPT_TARGETED_MISSING. Before this diff that mismatch was only reported. The failure is fail-closed, but carry now reports success for a receipt the queue will refuse.lib/ship-queue-train-land.ts:195Upgrading the queue mid-train halts the train partway through landing. train land binds each slot's receipt again just before merging it (landDirect:172, landUpdate:195). A train built and gated on the previous release, whose pins carry receipts with gstack_version but no review_targeted (the normal output of current /ship, see finding 1), merges its earlier slots. Once the queue runs this release, it refuses the first targeted-class slot after the paid train gate has already passed. That leaves main with part of the train landed and the rest needing /ship again. The changelog has no note about upgrading.Informational findings, listed and not fixed (rule 23 floor, R51)
train land(lib/ship-queue-train-land.ts:173,195) andtrain ready --base-red(lib/ship-queue-train-ready.ts:198) refuse with the new code but print only the receipt and depth lines, notREVIEW_TARGETED:. The message still names the missing classes. (specialist, adversarial-native#3)train landafter earlier slots merged. Drain or check open trains before upgrading. (red-team#4, adversarial-native#3)targetedClassesfails closed to all four classes, and the refusal doesn't say the classes came from a fail-closed input. (red-team#3)carrychecks depth but not targeted coverage, so a test-only follow-up can carry a receipt the queue then refuses. This fails closed. (red-team#2, adversarial-native#2, deferred as Deferred review finding: bin/gstack-ship-receipt:729 — write and carry do not check targeted coverage (carry checks dept #3854)ship/sections/adversarial.md.tmplreaches "take decision 3" before it says to run the targeted reader. On a light head with tagged test hunks, an agent may skip the reader, and the queue then refuses the receipt. This fails closed. (adversarial-native#1)classes,statusandbrief_shakeep the depth check's trust model. (adversarial-native#4)train build,landor both-checks-fail precedence. (coverage audit)Documentation
Scope: I audited the diff
0c84f4ee1...HEADwith its staged and unstaged state. That covers the three updated docs (docs/review-policy.md,docs/ship-policy.md,docs/troubleshooting.md), the changelog fragment andlib/ship-receipt-depth.ts. I also searcheddocs/captain.md,docs/unattended.md,docs/pregate.md,CONTRIBUTING.md,captain/andcapy/forREVIEW_TARGETED, report-only wording and the receipt depth fields.Result: Current, with no edits. The updated docs match
receiptTargetedVerdictandbindShippedReceipt:verdict=ok|missing|failed.QUEUE_RECEIPT_TARGETED_MISSING, raised after the depth check.ready,train buildandland.queue-receipt-targeted-missinganchor exists.None of the other docs searched mention the report-only behavior. Other hits for "targeted" in
docs/(design plans, eval notes) are unrelated.Debt:
docs/ship-policy.mdanddocs/troubleshooting.mddo not say that a receipt with neithergstack_versionnorreview_depthis accepted as legacy. Only the code and its printed line say so. I did not add it because the brief calls for conservative edits, and it is a small follow-up if you want it. Recording the targeted pass in /ship's receipt write is out of scope.Test plan
readycase fails on origin/main 0c84f4e (expected 3, received 0) and passes here.test/gstack-ship-queue.test.ts,test/ship-queue-*.test.ts(13 files),test/ship-receipt-depth.test.ts,test/review-targeted.test.ts,test/doctor-components.test.ts,test/troubleshooting-anchors.test.ts.bun run typecheckandbun run typecheck:test(814 known diagnostics, none new): exit 0.--stage tests) at the frozen tree: 25,264 tests, 0 failed, tree 3d98b1160c5d (head 2212c95), $0.09 (PREGATE_REMOTE), VM destroyed. The macOS and Windows lanes are cleared from this PR's CI runs 41428898820 and 41428899012.PREGATE_VERIFY: ok.receiptTargetedVerdict, all as specified.