Repository navigation
Make ship-queue ready refuse when its READY note doesn't reach origin (GST-2242) - #4254
Merged
Merged
Conversation
… (GST-2242) ready exited 0 and printed "notes pushed" even when the READY note never reached origin, so land refused the pin with QUEUE_NOT_READY (#4245). The notes writer now reads origin's ref back after each push, and train ready refuses with QUEUE_READY_NOTE_UNPUSHED when origin still lacks the note after three tries. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ST-2242) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…it with its gate flags (GST-2242) Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n (GST-2242) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
gstack-ship-queue readynow refuses when its READY note never reaches origin, so a pull request is no longer reported ready to merge when the merge step would refuse it. This keeps the merge queue's READY signal trustworthy, which is what lets PRs merge on green without a human checking each one.What changed
refs/notes/gstack-trains, the notes writer fetches origin's ref back. It reportsnotes pushedonly when origin's tip is the local tip or contains it. A push that exits 0 while origin still lacks the note now counts as a failure and goes through the same three tries.readyandready --base-redrefuse with the newQUEUE_READY_NOTE_UNPUSHED(exit 3) when the note isn't on origin after those tries. The local receipt is kept, so rerunningreadyonce the push works keepsready_atand pushes the receipt.#queue-ready-note-unpushed, a line in docs/ship-policy.md's train READY section, the regenerated doctor component list, and a changelog fragment.Why
readyused to exit 0 and printnotes pushedeven when the note never reached origin. The lane then sent READY, andland --pinrefused the pin withQUEUE_NOT_READYbecause origin had no note. That cost #4245 a land round. Now the failure shows up atready, where the lane can fix the push, instead of at land time.Blast radius
Every caller of
persist()in crew/lib now pays one extra fetch per write and can getpushed: falsefor a push that exited 0. Callers that already checkpushedget the stricter answer, and callers that ignore it behave as before; both reviewers checked everypersist()call site (file:line read). The non-trainreadypath in lib/ship-queue.ts is unchanged.Test Coverage
crew/test/ship-queue-ready-notes-push.test.tsdrives the realbin/gstack-ship-queue readyagainst a bare fixture origin. A pre-receive hook that rejectsrefs/notes/*makes ready refuse with the new code; that case failed on main (exit 0) before the fix. A post-receive hook that deletes the ref after accepting it makes ready refuse too. A normal push succeeds with origin's notes tip equal to the local tip, and a rerun after the hook is removed succeeds.Coverage: 70% of changed paths (7 of 10), audit-only. The gaps are the ancestor branch of the read-back (another writer moved origin past the local tip), a read-back fetch failure other than a missing ref, and the refusal on the base-red path.
Pre-Landing Review
Pre-Landing Review: 3 issues in pass 1, all below the blocking floor: 1 fixed in docs, 1 skipped, 1 noted. Pass 2 (full, on the fix range) found 2 more below-floor notes; the adversarial voice found 3 low or medium non-blocking notes, and the outside voice (openai/gpt-6.1-sol) returned CLEAN.
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=3 fixed=2 scope=frozen ledgers_read=3 dispatches=6
Gate edits: none detected
Review notes
Below the blocking floor. Pass-1 #1 and #2 are open notes; #3 was fixed in docs.
crew/lib/ship-queue-train-ready.ts:230No test drives the base-redconditionalReadyrefusal or its NEXT command. Open note: below the floor; the plain path's tests cover the sharedrecordReceipt.lib/ship-queue.ts:298The non-trainready()still ignoresp.pushedand exits 0 on an unpushed note, for repos withmerge: directand notrainblock. Open note, tracked in GSTA-486: Stop the merge queue from calling a head green while a check on it failed (GST-2167) #4235 owns lib/ship-queue.ts, so this is a Captain-owned follow-up after Stop the merge queue from calling a head green while a check on it failed (GST-2167) #4235 lands. The changelog fragment now says the fix covers train policies; commit 6a3fd04'sReview-Finding: p1/red-team#1trailer covers only that changelog half of the finding, not the code path.crew/lib/ship-queue-train-ready.ts:315The refusal's NEXT command drops--pregate,--gate-exitand--gate-log. Disposition: docs fix. The troubleshooting entry and the result code's fix text now say to add them back. Carrying them in the code is a follow-up after the tooling freeze.Issues
Refs #4245
Refs p1/red-team#1
Refs p1/red-team#2
TODOS
No TODO items completed in this PR.
Documentation
Status: current. The branch's docs already match the code, so this audit made no edits.
Scope: 8 committed files from base 01e3980 to head 6a3fd04 (nothing staged, unstaged or untracked): the
gstack-ship-queue readynotes read-back check and the newQUEUE_READY_NOTE_UNPUSHEDrefusal in crew/lib/ship-queue-train-ready.ts and crew/lib/ship-queue-train-record.ts, with its result code, doctor anchor, test, changelog fragment and docs.Documentation health:
notes pushedappears only afterreadyreads origin's notes ref back, and it links the new refusal.queue-ready-note-unpushedentry matches the code's three tries, ancestor check and rerun advice.Coverage debt:
QUEUE_READY_NOTE_UNPUSHEDhas reference coverage (the result-code registry and troubleshooting.md) and how-to coverage (the troubleshooting Fix paragraph). No critical gaps.Diagram drift: none. No diagrams refer to the changed modules.
Test plan
bun test crew/test/ship-queue-ready-notes-push.test.ts: 4 pass, 0 fail (failed on main before the fix)bun run typecheckexit 0;bun test crew/test/ship-queue-ready-notes-push.test.ts crew/test/ship-queue-train.test.ts29 pass, 0 failAgent notes
readyexit-0 path is a Captain-owned follow-up after Stop the merge queue from calling a head green while a check on it failed (GST-2167) #4235 lands.Review-Finding: p1/red-team#1trailer covers only the changelog half; Project-local .claude/skills/gstack install breaks /browse and setup can report false success #3 p1/red-team#2 (NEXT drops gate flags) disposition: docs fix at 6a3fd04.Review-loop exception: accepted by GStack Minder (GSTA-36) 2026-11-09 via approval a-abbafe2aba2e (CREW.md rule 11 standing grant): deterministic Windows failure in windows-scoped-shard run 42711409624; one windows-curation.ts exclusion, one scoped fix-check returned NO FINDINGS (fix-check at 377f5c1, 0 findings)
Approvals
No approvals recorded for branch capy/make-ship-queue-ready.
Plan: exempt: bug fix
Plan check: exempt bug fix
Refs GST-2242