Repository navigation
v1.91.236.0 feat(ship-queue): require a current /ship receipt before READY, train build and train merge - #3438
Merged
Merged
Conversation
… build and train merge Garry, 2026-10-25: use the gstack ship skill before merging PRs. ready printed SHIP_RECEIPT: none as information and returned ok, so the pool was READY'd without /ship. Now ready, train build (dry run included) and verify --train refuse with QUEUE_RECEIPT_MISSING or QUEUE_RECEIPT_STALE from the PR body alone; verify accepts the receipt written for the pinned head when the current head is its stamp commit. gstack-ship-receipt result is /ship's terminal step (GSTACK_RESULT: skill=ship, run dir with the head and receipt), unattended /ship may update an existing PR's body, and INSTALL_UNVERIFIED with no verdict names the project directory to install from (GSTA-85). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…ip skeleton Gate edit: test/fixtures/workflow-required-steps.json pins the new "## Step 22: Terminal line (every run)" heading (strengthens: a later edit that drops the terminal line turns the required-steps test red). Steps 14, 16, 18, 20 and 22 prose tightened so the carve-guards raise shrinks to 81,600 / 1.6740 (measured skeleton 81,535, union 314,027). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… stale merge ref, ship-run.json) - ready accepts the pin's receipt at a slot's stamp commit (plus the slot-2 merge of main), as verify --train already did; a real edit stays STALE - ready --screen refuses QUEUE_SCREEN_STALE_REF when refs/pull/<n>/merge is missing or merges an older head; a finished screen that planned 0 cases is never followed, and train build seats that slot unscreened (GSTA-95 on #3431) - gstack-ship-receipt result writes ship-run.json (a /ship record, not a run v1 manifest), validates --head, and prints status=incomplete on gh failures - bindReceipt takes an optional pr and renders one-line SHIP_RECEIPT lines - tests for every state-matrix cell the review named; the train fixture's merge ref is a real merge commit Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ipt reuse, 12-hex --head, one receipt scrub) and align the unattended hook text with the GSTACK_RESULT writers (GSTA-91) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ves --out and reports unwritable records; ready names a failed merge-ref fetch; unattended /ship never runs gh pr ready) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…t requires a full --head and fails closed without headRefOid, digits-only --pr) with tests for every cycle-3 branch Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ipwire) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tifact or nothing planned), correct two troubleshooting facts, and normalise result --pr Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e, say when the plan is unreadable; lowercase result --head Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…d; docs name every SCREEN: literal Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…of counting the screen silently Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…with --body, cap echoed receipt errors, tell an unreadable install verdict from a missing one Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…eadable slug and verdict (both twins); docs name the new literals Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…dable --body as incomplete, refuse unsupported verdict schemas in the bash twin Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
5 tasks done
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan
added a commit
that referenced
this pull request
Oct 26, 2026
…3438; Captain-approved) 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
Before (gstack main): READY succeeds with no /ship receipt in the PR body.
After: the same command refuses (exit 3,
QUEUE_RECEIPT_MISSING) because /ship never ran on this head. There is no flag around it.After, once /ship wrote the receipt for this head: READY as before, with
SHIP_RECEIPT: pr=42 head=<pin> …in the block.Before:
train build --dry-runadmitted the unshipped pin.After:
train buildrefuses the pin, naming the PR, before anything is written, pushed or dispatched.Why
Garry, 2026-10-25: "we should really be using the gstack ship skill before merging PRs, can you make sure we do that?" The queue had the information (the receipt /ship writes into the PR body) but never acted on it. Now the receipt is a precondition at every queue step, read from the PR body alone, so a lane cannot READY, a coordinator cannot build a train with, and a slot cannot merge, a PR that /ship did not run on at that head.
gstack-ship-queue readyrefuses withQUEUE_RECEIPT_MISSING(no validgstack-ship-receiptblock) orQUEUE_RECEIPT_STALE(the receipt'sheadis not the head being READY'd, or itspris another PR). The informationalSHIP_RECEIPT:line still prints. Both codes are inlib/result-codes-release.ts(where the otherQUEUE_*codes live) withdocs/troubleshooting.mdanchors andfix:clauses. The re-READY after a slot's stamp push accepts the receipt written for the pinned head when HEAD is the pin plus stamp files, or (from slot 2 on) the pin with main merged in plus a stamp commit that changes at least one stamp file; a bare merge of main, an empty commit over it, or a pin-side edit after /ship is stale (docs/ship-policy.md#ship-before-ready).train buildrefuses a pin whose PR has no current receipt with the same codes, naming the PR, before any write, push or dispatch,--dry-runincluded (prInfonow reads the body).verify --trainrefuses the slot the same way beforeMERGE_CONDITION, and accepts a receipt written for the slot's pinned head when the current head is its stamp commit.gstack-ship-receipt result(new, for GBRA-108's merge check) is /ship's terminal step (new Step 22): it binds the posted receipt to HEAD, writes<state root>/ship/runs/<utc>-<head12>/{ship-run.json,ship-receipt.md}(a /ship record, not arunv1 manifest) and printsGSTACK_RESULT: skill=ship status=complete run=<dir>;status=refused run=-with the receipt code when the receipt is missing, stale, or HEAD is not the PR's pushed head (exit 3);status=incomplete run=-when gh cannot read the PR or its head, or the record cannot be written (exit 1).--headmust be a full commit id;--pra PR number.ready --screenrefuses a stale merge ref with the newQUEUE_SCREEN_STALE_REF(GSTA-95 on v1.91.227.0 fix(windows): shell bins pass NUL as Bun's empty config when MSYS path conversion is off (#3415) #3431): GitHub stops recomputingrefs/pull/<n>/mergewhile the PR conflicts with the base (CHANGELOG-only conflicts included), so a screen dispatched there planned 0 cases, reported success andreadyprintedSCREEN_DISPATCH:as if a screen ran.readynow fetches the merge ref and requires its second parent to be the PR head (a missing ref or a failed fetch carries the same code with its own message), and never follows a finished screen that planned no cases: a superseded run skipsplan-slicesand uploads nopaid-planartifact, and a manifest with nothing planned counts the same.train buildprintsSCREEN: #<n> run <id> planned no cases …; counted as not-runand seats that slot unscreened; a plan it cannot read prints… counted as screened, unverified. Consequence for lanes: a PR that conflicts with main (even on CHANGELOG alone, rule 14) can READY only with--no-screenuntil the conflict is resolved.gstack-skill-start's unattended block andUNATTENDED_SHIP:line, Step 18 anddocs/unattended.mdsay that when an open PR for the branch exists and HEAD is its pushed head, Step 18 takes the pr-body section's existing-PR path (body with the receipt first, and title) throughgstack-post; it never runspr-create, never pushes, never runsgh pr ready. Anything else takes the handoff section.INSTALL_UNVERIFIEDwith no verdict names the directory to install from (GSTA-85 a): both twins now sayrun … scripts/install.sh --for ship from <project>: the verdict is keyed by the project directory the installer runs in;docs/troubleshooting.md#install-unverifiedshows the project-keyed verdict path.hosts/claude/hooks/auq-error-fallback-hook.ts,docs/unattended.mdandgstack-skill-start's per-skill block agree on which skills printGSTACK_RESULT: /autoplan and /eval-plan (gate_pending), /ship (Step 22), and nobody else except a refused install check.SHIP_RECEIPT:, the stale message, thereceipt is invalid (…)reason, capped at 200 characters) goes through one scrub that collapses C0/C1 controls and the Unicode line separators, so the summary is one physical line.resultrefuses--prtogether with--body(usage), rejects a--prwith leading zeros, lowercases--head, and reports an unreadable--bodyfile asstatus=incomplete.ready --screennames a failedls-remote(could not list <remote>'s refs: …) and a failed merge-ref fetch (could not fetch refs/pull/<n>/merge from <remote>: …) underQUEUE_SCREEN_STALE_REF, never blaming the conflict for a transport error;train buildprintsSCREEN: #<n> the repository slug is unreadable; counted as screened, unverifiedinstead of staying silent.lib/install-verdict.ts,bin/gstack-install-verdict.sh):the install verdict at <file> is unreadable or has an unsupported schema_version; rerun the installer.Not changed:
gstack-ship-queue stampand the per-PRverifyhave no GitHub access today; the stamped head is checked byverify --train. Hand-typed receipts are not detected: this is a process gate, asdocs/ship-policy.mdsays.Refs #3431
Approvals
The size-budget raise above is a test-budget edit, not an eval threshold; listed here for the reviewer.
Gate edits
This strengthens. Every edit to a test, fixture or budget, listed:
test/helpers/ship-queue-train-fixture.ts:openPrwrites a valid receipt for the head it opens (shipped: falseleaves the body empty); newshippedBody,setPrBody,mergeRefCommit(refs/pull//merge is now a real merge commit, as GitHub keeps it); the gh shim gainedplanrules (apaid-planmanifest per dispatched run,nullfor none, as a superseded screen), an artifacts listing that honours?name=, and writesmanifest.jsonbeside agate-reuse.json. Existing train tests keep passing because their PRs are now "shipped"; no assertion was weakened.test/gstack-ship-queue.test.ts: the READY-block test's shim bodies carry a receipt for the head; the test gains the missing, invalid and stale refusals;readyat a stamp commit (slot 1, slot 2 with main merged in) accepts the pin's receipt, while a bare merge, an empty commit over it, and a pin-side edit areQUEUE_RECEIPT_STALE.test/ship-queue-train.test.ts: rule-22 tests for ready, train build (dry run and live) and verify --train;--screenrefuses a lagging, missing or unfetchable merge ref (an fsck-rejected merge commit stands in for the failed fetch) and dispatches nothing; a hollow screen (nopaid-plan, or an empty manifest) is never followed and rides unscreened in train build, a live or in-progress screen stays screened, an unreadable manifest, an expired artifact or an unreadable slug prints the unverified line; a failedls-remoteis refused by name.test/gstack-ship-receipt.test.ts: thebindReceipthead-matching table (12-character floor, other PR, one-lineSHIP_RECEIPT:),resultfrom a PR and from the handoff file, refusals for a missing/stale receipt and an unpushed HEAD,status=incompletefor a gh failure, a missingheadRefOidand an unwritable--out, a relative--out, an unreadable--body,--prwith--body, the capped invalid-receipt reason, and--headvalidation (full lowercase id).test/install-verdict.test.ts: the GSTA-85 case, a corrupt verdict file and an unsupportedschema_versionin both twins.test/gstack-skill-start.test.ts: theUNATTENDED_SHIP:line and the ship record rule (result line, existing-PR body update, nevergh pr ready).test/auq-error-fallback-hook.test.ts: the unattended directive names the sameGSTACK_RESULTwriters as docs/unattended.md.test/helpers/carve-guards.ts(size budget, raised): shipmaxSkeletonBytes81,000 → 81,600 andmaxSizeRatio1.6690 → 1.6740, with measured notes (skeleton 81,535; union 314,027 / 187,706 = 1.6730). Steps 14, 16, 18 and 20 prose were tightened to offset most of Step 22 and the Step 18 routing. No eval threshold, trial count or case kind changed.test/fixtures/workflow-required-steps.json(strengthens): pins## Step 22: Terminal line (every run).ship/SKILL.md,ship/sections/{pr-body,handoff}.md,test/fixtures/golden/*-ship-SKILL.md,bin/gstack-doctor-components.sh(gstack-regen checkfresh).Summary
Three themes over 14 commits on
capy/require-a-current-ship(37 files, +1152/−149):gstack-ship-queue ready,train buildandverify --trainread thegstack-ship-receiptblock from the PR body and refuseQUEUE_RECEIPT_MISSING/QUEUE_RECEIPT_STALEbefore any write, push or dispatch; stamp commits over a pin (slot 1 stamp files only; slot 2+ the pin with main merged in plus a stamp that changes a stamp file) keep the pin's receipt.gstack-ship-receipt resultand ship Step 22 printGSTACK_RESULT: skill=ship status=complete|refused|incomplete run=<dir>and writeship-run.json; the unattended lane may update an existing PR's body throughgstack-postand never runspr-create, a push orgh pr ready(GSTA-85 b, GSTA-91 doc item).ready --screenrefuses a stale, missing or unfetchable merge ref withQUEUE_SCREEN_STALE_REF, a hollow screen (nopaid-planartifact or an empty plan) is never counted as a screen, and the install-verdict twins name the project directory to install from and tell an unreadable verdict from a missing one.Test Coverage
All new code paths have test coverage (Step 7's coverage diagram did not run in this unattended lane; the rows are listed under Gate edits above).
Tests ran: remote free tier 21564 (tree 00f89bb256db, 752 files, 0 failed, $0.06)
Tests ran: focused
test/gstack-ship-queue.test.tstest/ship-queue-train.test.tstest/ship-queue-train-logic.test.tstest/gstack-ship-receipt.test.tstest/install-verdict.test.tstest/troubleshooting-anchors.test.tstest/auq-error-fallback-hook.test.tstest/gstack-skill-start.test.tstest/parity-suite.test.ts(308)test/module-size-ratchet.test.tstest/spawnsync-timeout-tripwire.test.ts: all pass at HEADTests ran: paid ship rule cases
safety-ship-stale-evidence($0.11),ship-local-workflow($0.05),ship-triage($0.09): PASS 1/1 each at 4afaa98 (no ship prose,bin/gstack-skill-startorhosts/change since)Pre-Landing Review
Eleven review cycles (Step 9.4 /review with the Review Army specialists: testing, maintainability, security, performance, simplification, state-machines, red-team in cycle 1) and seven native adversarial passes, all records finished against their start tokens; the final pair is bound at tree
00f89bb256db(review_binding: verified, freshness CURRENT). Fixed along the way: a missing import inlib/ship-queue-train-github.ts, the slot-2 stamp rule (bare merge, empty commit and pin-side edit are stale),resultrefusing an unpushed HEAD andstatus=incompleteon gh or record failures, the hollow-screen detector keyed on thepaid-planartifact with a validated run id and a named artifact listing, theSCREEN:lines for hollow and unverified screens,--head/--pr/--outvalidation, the ls-remote refusal, the capped one-line receipt errors, and the unreadable-verdict branch in both twins. Accepted as design, with reasons on the records: the receipt is a process gate (forgeable;proptional for the handoff receipt);readyat a stamp commit is looser thanverify --train'smergedIncheck, which is the authority; the merge-ref check compares the second parent to the PR head (GSTA-95's ask), not the first parent to base; the bash verdict twin is a sed scrape that accepts a quotedschema_versionthe installer never writes; bidi and zero-width characters survive the one-line scrub (the JSON receipt, not the summary line, is the contract).Gate edits: 30 listed, 30 read, 0 findings — 0 kept, 0 restored, 0 open (gstack-gate-diff tags none of them; each hunk is cited under Gate edits above).
Outside review: Codex unavailable (
codex_reviewsunset,codexnot installed) — listed as missing coverage. Claude Code second opinion: covered by the seven native adversarial passes above.Exploratory QA
Surfaces:
gstack-ship-queue ready(with and without a receipt, at a stamp commit,--screenagainst a lagging, missing and unfetchable merge ref),train build --dry-runand live (hollow, live, in-progress, unreadable and expired screens),verify --train(pin receipt at slot 1 and slot 2 stamps),gstack-ship-receipt result(from a PR, from the handoff file, unpushed HEAD, missingheadRefOid, unwritable and relative--out, unreadable--body), both install-verdict twins (missing, corrupt, unsupported schema). Every reproducer lives in the test files named under Gate edits with red/green proof (the rows fail on main's code). Not run: a live GitHub screen dispatch (this PR conflicts with main on CHANGELOG, so--screenisQUEUE_SCREEN_STALE_REFby design and READY uses--no-screen).Design Review
No frontend files changed — design review skipped.
Eval Results
Ship prose changed (ship sections,
bin/gstack-skill-start, the Claude hook), so the three skill-level paid rule cases ran focused:safety-ship-stale-evidencePASS,ship-local-workflowPASS,ship-triagePASS (1 trial each, $0.25 total). No case kind, threshold or trial count changed. The full gate runs at the train.Greptile Review
No Greptile comments.
Issues
Refs #3431
Verification Results
Step 8.1 obligations executed at Step 9: 6 PASS (
bun run typecheck;bun run typecheck:test819 known, none new;gstack-regen checkfresh; focused tests; remote free tier 21564/0; paid ship cases 3/3), 0 FAIL, 0 BLOCKED, 1 NOT RUN (a live--screendispatch; not applicable while the PR conflicts with main). Pregate: localgstack-pregate runexit 0 andPREGATE_REMOTE: tree=00f89bb256db… tests=21564 failed=0; the macOS and Windows requires-remote lanes cleared with this branch's CI runs 40265151564 and 40265154141 (all green at 672e969).TODOS
No TODO items completed in this PR.
Documentation
Scope. The /document-release read-only audit (ship-20261026T034014Z-672e969) read the user-facing literals from hollowScreen, admitSlots, the QUEUE_SCREEN_STALE_REF refusals,
gstack-ship-receipt result, QUEUE_RECEIPT_* and the install-verdict twins, and checked each against docs/troubleshooting.md, docs/ship-policy.md, docs/unattended.md and CHANGELOG [Unreleased]; it also checked the three GSTACK_RESULT sources (the Claude hook directive, docs/unattended.md,gstack-skill-start's per-skill block) against each other.Result. Current.
gstack-regen checkis fresh,test/troubleshooting-anchors.test.tspasses (237), and nothing contradicts anything else. Earlier audits in this run (ship-20261026T025849Z-95cf833, ship-20261026T031102Z-da8bdb4 and two scoped checks) were blocked on literal mismatches that were fixed before this one.Debt (not blocking). (1) docs/unattended.md and the CHANGELOG say
status=incompleteonly for "gh cannot read the PR"; the code also prints it for an unreadable body file, a missingheadRefOid, a gh reply with no JSON, and an unwritable run record. (2) The CHANGELOG mentions the unreadable-verdict repair only in its tests line. (3)#queue-receipt-staleparaphrases rather than quotesHEAD <sha> is not PR #<n>'s pushed head ….Test plan
bun run typecheck: zero errorsbun run typecheck:test: 819 known diagnostics, none newbin/gstack-regen check --base main --allow-repo-commands: fresh (2 entries)bun test test/gstack-ship-queue.test.ts test/ship-queue-train.test.ts test/ship-queue-train-logic.test.ts test/gstack-ship-receipt.test.ts test/install-verdict.test.ts test/troubleshooting-anchors.test.ts test/auq-error-fallback-hook.test.ts test/gstack-skill-start.test.ts test/parity-suite.test.ts test/module-size-ratchet.test.ts test/spawnsync-timeout-tripwire.test.ts: all passgstack-pregate run --allow-repo-commands+gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commands: 21564 tests, 0 failed on tree 00f89bb256db ($0.06)bun run scripts/test-paid-shards.ts --tier gate --case <safety-ship-stale-evidence|ship-local-workflow|ship-triage>: PASS 1/1 each🤖 Generated with Claude Code