Repository navigation
Stop the merge queue from landing a stacked PR's unreviewed parent commits (GST-2153) - #4229
Merged
Merged
Conversation
…viewed against its open parent branch Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…at ready, land and train build (GST-2153) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…h code Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Train build now has a test that refuses a receipt reviewed against a parent branch. Review-Finding: p1/specialist-batched#1 reader=specialist-batched Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Keep the base-contains-head diagnostic ahead of the receipt base check, normalize any remote's refs, and tell callers to merge the base in before the carry. Review-Finding: v1/outside-voice#3 reader=outside-voice Review-Finding: v1/outside-voice#1 reader=outside-voice Review-Finding: v1/outside-voice#2 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ore the carry 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>
…es no agent instructions after review Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
1 task 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.
The merge queue now refuses to land a stacked pull request whose parent is still open, so a parent's commits can't reach main without their own review. This keeps gstack's promise that nothing merges without a /ship review of the exact change being landed.
What changed
A stacked child's receipt reviewed against its open parent: accepted on main, refused with QUEUE_RECEIPT_BASE_MISMATCH on this branch.
Before/after as text: A stacked child's receipt reviewed against its open parent: accepted on main, refused with QUEUE_RECEIPT_BASE_MISMATCH on this branch
Why
A child PR shipped against its parent branch has a review that covers only the child's own change. If someone pointed that child at main while the parent was still open,
readyandland --pinaccepted it, and the parent's commits landed with no review of their own. The new tests showed it on main at b51925e:readyexited 0 andland --pinmerged the child. Now the queue refuses it and tells you to land the parent, merge main into the child and push, then carry the review over.Blast radius
ready,land --pinand train build all bind throughbindShippedReceipt, which now passes the queue's base; a review written against main, including a stacked child reviewed against main, binds exactly as before, and a PR that already merged skips the check (read at lib/ship-receipt-depth.ts:503, walked with 116 passing targeted tests). Callers that pass no base, the receipt tool's own terminal line and train verify, are unchanged.Summary
Stacked PRs could carry their parent's commits past the queue on the child's review. The queue now compares the base a review was written against with the base it is landing onto, and refuses a mismatch with a fix that tells you the next three steps. Along the way the review added a train build test, kept the older "base contains head" diagnostic ahead of the new check so its test still passes, made the base comparison work for any git remote name, and listed the new refusal in the land refusal tables in docs/ship-policy.md.
Test Coverage
Step 7 audit (non-blocking): the core behavior is covered.
readyandland --pineach have a test where a mismatched base refuses and a matching base proceeds, and train build now has one too (crew/test/ship-queue-train.test.ts, red without the fix, green with it). Remaining gaps, proposed as follow-up tests: therefs/remotes/<remote>/normalization, a merged resume skipping the check, the doctor anchor row for the new code, and a receipt that is both conditional and mismatched.Coverage: 50% value-weighted at the audit (5 of 10 paths), before the train test was added.
Test value: 1 existing test extended (train build), 0 tests written by the audit.
Tests ran: targeted 116
Tests ran: free carried from CI at the pushed head (see Agent notes)
Pre-Landing Review
Pre-Landing Review: 8 issues — 1 auto-fixed, 3 fixed under the owner's grant of one scoped fix-check, 0 deferred, 4 noted.
originremote; and the printed fix left out merging main into the child, so following it looped.Outside review: openai/gpt-6.1-sol at medium (certified configuration), 3 blocking findings, all fixed and checked.
Review notes
Below the blocking floor; recorded here and not fixed in this PR.
lib/ship-queue-land.ts:347: the refusal call sites print a generic "rerun /ship" NEXT for this code instead of land, merge, carry; the crew captain refusal table (crew/docs/captain.md) also has no row for it yet.lib/ship-receipt.ts:112: the check trusts the base field the receipt reports about itself; a hand-edited body could still claim main. Enforcing it needs the carry's patch-id comparison, a tooling change outside this fix.crew/lib/ship-queue-train-verify.ts:274: train verify's pre-merge read passes no base; train land rechecks it.lib/ship-receipt.ts:114: the message assumes the other branch is a stack parent; a review written against an unrelated branch by mistake needs /ship against main instead.lib/ship-receipt-depth.ts:503: a receipt that is both paused on a red base and reviewed against a parent now reports the red-base pause first; it is still refused.Exploratory QA
Functional smoke, 6 captures against
bindReceiptwith synthetic receipts (no network, no repo state), verdict pass: a main review binds under main; a parent review is refused with QUEUE_RECEIPT_BASE_MISMATCH; the train'srefs/remotes/origin/mainandorigin/mainforms bind; callers that pass no base bind as before; a non-origin remote ref was refused at the time of the probe (fail closed), and the later fix now normalizes it. Limits: the CLI paths are covered by the targeted lane and CI, not these captures; a merged resume was not probed.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
TODOS
No TODO items completed in this PR.
Documentation
Scope: this audit covered the change from b51925e to b5d8411 (the new
QUEUE_RECEIPT_BASE_MISMATCHrefusal inready,land --pinand train build). It revieweddocs/ship-policy.md,docs/troubleshooting.md,lib/result-codes-release.tsandlib/ship-receipt.ts, pluscrew/docs/captain.md, which was read-only.Result: the docs are current. The ship-policy carry paragraph, the land refusal list and the land table row describe the new code and link to the new troubleshooting anchor, and they match the code's result-code entry and receipt-binding message. This audit made no edits.
Debt: the result-code table in
crew/docs/captain.mdhas noQUEUE_RECEIPT_BASE_MISMATCHrow. That file holds agent instructions, so the row needs a follow-up PR with its own review.Test plan
Agent notes
Refs GST-2153
Approvals
Approved: yes (record r-9a5ac01f48c2). The full approval record stays private.
Plan: exempt: bug fix
Plan check: exempt bug fix
Review-loop exception: one scoped fix-check granted by the Captain (GStack Minder, GSTA-36) after round 2 for the three Step 11 outside-voice blockers (approval a-cc62ed148a51).
Gate edits: none detected (3 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review loop record: the three Step 11 outside-voice findings fixed in cf035b2 were logged on the adversarial-review row, which the loop summary does not read, so REVIEW_LOOP shows them as unbound=3 and blocking_found=0; they were blocking and are fixed.
Known pre-existing failure, not this change: test/gstack-ship-receipt.test.ts "a release-metadata-only change ... carries as release metadata" hits Bun's 5 s timeout on 2-core machines and fails identically on clean main b51925e.