Skip to content

v1.91.278.0 fix(ship-queue): readiness takes dispatched Free Tests, stamp paths accept tentative key versions, ready and train build read the base overlap, pr-wait --exclude, restamp prints the corrected order - #3514

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/ship-queue-backlog-3508-3513-3512
Oct 27, 2026

Conversation

@garrytan

@garrytan garrytan commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3514,
  "head": "89d173c036fd34e456df496f303c94c04edca758",
  "version": "1.91.273.0",
  "base": "main",
  "gate": {
    "remote-free-tier": {
      "pass": 10750,
      "fail": 0,
      "skip": 0
    },
    "focused": {
      "pass": 180,
      "fail": 0,
      "skip": 0
    },
    "guards": {
      "pass": 264,
      "fail": 0,
      "skip": 0
    },
    "anchors": {
      "pass": 10,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "pregate": "requires-remote cleared @215aaf431547 (1 checks, current for 89d173c036fd)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/40503098118",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/40503103094",
    "pregate.json/remote_gate: remote-gate tree=215aaf431547 tests=10750"
  ],
  "issues": {
    "fixes": [
      3508,
      3512,
      3513
    ],
    "refs": [
      3514
    ],
    "flakes": [],
    "related": [
      {
        "pr": 3510,
        "author": "shahinsamiur",
        "closes": [
          3508
        ]
      }
    ]
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md, CONTRIBUTING.md, captain/ against merge base a1934a14 (26 committed files); edited docs/ship-policy.md, docs/pregate.md, docs/troubleshooting.md"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 13,
    "fixed": 8,
    "scope": "frozen"
  }
}

Why

A merge-train lane kept getting refused for things the tooling itself could see. A head whose only conflict with main was the CHANGELOG got its Free Tests through the dispatch route and the paid screen still called it NOT-RUN (#3508). The receipt-versus-prose check read the canonical REVIEW_LOOP: line, with its key=value counters, as a false mismatch (#3513). A PR that writes a new *_KEY_VERSION constant as a tentative next-minor version, the convention #3511 introduces, could not clear the train's stamp-only receipt (#3512). A pooled pin learned that main had moved onto its files only when the train was built, and a filling train's QUEUE_TRAIN_WAITING proved nothing about conflicts (handoff GSTA-119, #3485). gstack-pr-wait had no way to leave a stuck non-required check out of its verdict (#3495 follow-up). And a lane that passed the slot call's remaining order to gstack-restamp without its own PR got the same stale list back as the fix.

Summary

Six fixes to the ship-queue and readiness tooling, each with a regression test. Readiness accepts a workflow_dispatch Free Tests run at the exact head when no pull_request run exists there. The prose check reads a key=value or key: value pair's number as that key's claim alone. The tree receipt, the carry and the train's tree-modulo-stamps digest accept a stamp-paths line whose stamp-form version moved to the released version from a tentative value of the same width not older than the gated head's. gstack-ship-queue ready and train build read the base-overlap fact from git and run the scratch merges before the fill rule; a git read that fails prints conflicts unknown and refuses nothing. gstack-pr-wait gains --exclude, inert while the required set cannot be read. The restamp's QUEUE_STALE refusal prints the corrected --expect-order, keeping a merged-not-in-base predecessor with fix: git fetch origin <base>.

#3512 design options

The issue asked the stamp-only receipt to accept a *_KEY_VERSION constant written tentatively. Three bounds were considered: (a) accept any stamp-form rewrite to the new version whatever the old value, which lets a hand-moved released key through the receipt; (b) accept only the exact gated version, which is what refused #3511's constant; (c) accept a rewrite whose old value is at least the gated head's version and of the repo's version width. (c) is what shipped: the stamp commit stays tool output, and a hand-moved released key or a 3-digit pin stays changed.

Blast radius

The train's verify path (sameModuloStamps, mergedIn) now accepts a stamp commit that moves a tentative key version; the bound that keeps a hand-moved released key changed is the gated head's version and the repo's version width (lib/restamp.ts stampOnlyLine), proven by the tree-receipt and train-gate fixtures (walked and run). train build writes the dry-run prefix commits into object storage on every call instead of only at dispatch; they are deterministic (fixed identity and date), so the same pins give the same objects. Readiness now lets a pull_request run at the head outrank a dispatched run, so a red pull_request run is no longer overridden by a green dispatch (scripts/eval-readiness.ts, test both ways).

Files touched

Commit 0ac5c6f (the six fixes): scripts/eval-readiness.ts, test/eval-readiness.test.ts, docs/TESTING_INTERNALS.md, lib/ship-receipt-prose.ts, test/ship-receipt-prose.test.ts, lib/restamp.ts, lib/tree-receipt.ts, lib/ship-receipt.ts, bin/gstack-ship-receipt, scripts/train-gate.ts, test/tree-receipt-stamp-sensitive.test.ts, test/train-gate.test.ts, test/gstack-ship-receipt-docs.test.ts, lib/ship-queue-train.ts, lib/ship-queue-train-ready.ts, test/ship-queue-train.test.ts, test/ship-queue-train-ops.test.ts, docs/ship-policy.md, lib/pr-wait.ts, bin/gstack-pr-wait, test/pr-wait.test.ts, docs/standalone-binaries.md, test/gstack-restamp-queue.test.ts, docs/troubleshooting.md, CHANGELOG.md.

Commit 957be63 (pass-1 review fixes): lib/pr-wait-github.ts (new in the diff) plus CHANGELOG.md, docs/TESTING_INTERNALS.md, docs/ship-policy.md, docs/troubleshooting.md, lib/pr-wait.ts, lib/restamp.ts, lib/ship-queue-train-ready.ts, lib/ship-queue-train.ts, lib/ship-receipt-prose.ts, scripts/eval-readiness.ts and the tests test/eval-readiness.test.ts, test/gstack-restamp-queue.test.ts, test/gstack-ship-receipt-docs.test.ts, test/pr-wait.test.ts, test/ship-queue-train-ops.test.ts, test/ship-queue-train.test.ts, test/ship-receipt-prose.test.ts, test/tree-receipt-stamp-sensitive.test.ts.

Commit 89d173c (docs audit): docs/ship-policy.md, docs/pregate.md, docs/troubleshooting.md.

The PR conflicts with main on CHANGELOG.md alone (main moved to d87eec9, v1.91.274.0); main was not merged (crew rule 19, no grant) and the train merges CHANGELOGs additively. GitHub schedules no pull_request run on the conflicted head, so Free Tests and Windows Free Tests were dispatched at the head (the dispatch route in docs/ship-policy.md) and clear the pregate's remote obligations.

What changed

gstack-pr-wait gains --exclude: a stuck non-required check can be left out of the verdict; a check the base requires is refused and still gates

gstack-pr-wait gains --exclude: a stuck non-required check can be left out of the verdict; a check the base requires is refused and still gates. The five other fixes are CLI-output and library changes without a visible surface; their before/after is the regression tests named under Test Coverage.

Before/after as text: gstack-pr-wait gains --exclude: a stuck non-required check can be left out of the verdict; a check the base requires is refused and still gates
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+gstack-pr-wait <pr> [--repo owner/name] [--until green|ready|any-change] [--interval SECONDS] [--timeout MINUTES] [--exclude CHECK,...]
+--exclude   check names (comma-separated, repeatable) left out of the verdict,
+            as gstack-ci-gate --exclude does: a named check neither holds green
+            while pending nor blocks when it fails. A check the base branch
+            requires cannot be excluded; the name is logged as refused and gates
+
-gstack-pr-wait <pr> [--repo owner/name] [--until green|ready|any-change] [--interval SECONDS] [--timeout MINUTES]
---until
-  green       every CI check on the current head passed, confirmed by two
-              identical polls; a check the base branch requires counts as
-              pending until it appears
 

Approvals

No approvals recorded for branch capy/ship-queue-backlog-3508-3513-3512.

Test Coverage

Each fix carries its regression test: test/eval-readiness.test.ts (dispatched run decides when no pull_request run exists; a pull_request run outranks a dispatch both ways), test/ship-receipt-prose.test.ts (the canonical REVIEW_LOOP line in its key=value and key: value spellings, a one-pass line with no blocking findings), test/tree-receipt-stamp-sensitive.test.ts and test/train-gate.test.ts (tentative key moved by the stamp is stamp-only; a hand-moved released key, an older version or another width stays changed), test/ship-queue-train.test.ts and test/ship-queue-train-ops.test.ts (BASE_OVERLAP and MERGE_CHECK lines at ready and train build, QUEUE_TRAIN_CONFLICT at slot 1 while the train fills, the unknown line on a failed git read), test/pr-wait.test.ts (--exclude parsing, an excluded failing check does not block, a required name is refused, an unreadable required set refuses every exclusion), test/gstack-restamp-queue.test.ts (QUEUE_STALE prints the corrected order; merged-not-in-base is kept with the fetch fix). The Step 7 coverage audit's numeric summary was not retained in this run's record, so no value-weighted percentage is claimed.

Tests ran: remote free tier 10750 (Ubicloud, tree 215aaf431547, 0 failed).

Pre-Landing Review

Two passes over the frozen in-diff scope. Pass 1 (whole branch, DIFF_BASE a1934a1): testing, maintainability, security, performance, simplification, state-machines and Red Team returned 12 informational findings, 8 fixed in commit 957be63 (the key: N whitespace skip in the prose check; correctedOrder keeps a merged-not-in-base predecessor and QUEUE_STALE names the fetch; stampOnlyLine refuses a moved mention of another version width; --exclude is inert while the required set is unknown; baseOverlap reports a failed git read as unknown and train build prints the files without a verdict; a pull_request run outranks a dispatched run; the READY fix text follows the crew template's rule 14; the "crew rule 25" wording replaced). Pass 2 over 0ac5c6f..957be63 returned 9 informational findings, none at the blocking floor, all recorded below. Adversarial pass (Claude subagent, same range): 1 Medium INVESTIGATE and 2 Low FIXABLE, below the floor, recorded below with the controller decision they need.

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=13 fixed=8 scope=frozen

Gate edits: none detected (listed=17 eligible=5 inspected=5 unread=0; every eligible hunk is this branch's own test edit, none a relaxation; coverage RH-1, RH-3, RH-4, RH-12, RH-13, RH-14, RH-15, RH-16)

Outside review: unavailable — Codex is not installed on this machine (codex_reviews unset), so outside coverage is missing; the native adversarial pass ran.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

Pass 1:

  • INFORMATIONAL [ADVISORY] scripts/train-gate.ts:150 stampFreeText collapses every stamp-form mention, so the backstop digest cannot tell a train stamp from a hand edit that only moves a version
  • INFORMATIONAL lib/pr-wait.ts:142 --exclude takes a comma list (and repeats) while gstack-ci-gate --exclude takes one name per flag, though the usage claims parity
  • INFORMATIONAL lib/pr-wait.ts:319 private excluded() has one caller and restates the dropped filter poll() computes inline
  • INFORMATIONAL [ADVISORY] lib/restamp.ts:310 tentativeMentions still runs its own scanner loops; stampMentions() below is that scan

Pass 2:

  • INFORMATIONAL lib/restamp.ts:139 the merged-not-in-base fetch hint and fix cover ahead PRs only; a behind PR in that state is kept in the corrected order with no hint
  • INFORMATIONAL docs/ship-policy.md:473 docs and CHANGELOG cite 'the crew template's sibling trial merge', which captain/templates/CREW.md does not hold
  • INFORMATIONAL lib/pr-wait-github.ts:213 a classic-protection 403 (non-admin token) sets known=false, so --exclude is inert for such tokens even when the rulesets read returned the complete set
  • INFORMATIONAL lib/ship-queue-train.ts:218 the unknown BASE_OVERLAP reason reads the failed git call's stdout (empty) so the parenthetical is always 'git read failed'
  • INFORMATIONAL test/tree-receipt-stamp-sensitive.test.ts:62 the extended Deferred review finding: lib/tree-receipt.ts:53 — stampOnlyHunks accepts a removed/added pair only as rewriteStamps(remo #3512 test overruns bun's default 5 s per-test timeout when run bare (8.1 s here; 6.6 s before the change); the shard runner's 30 s hides it in CI
  • INFORMATIONAL [ADVISORY] lib/ship-receipt-prose.ts:52 the pair-value skip could fold into the lookbehind and drop the Set and the exec loop
  • INFORMATIONAL lib/ship-queue-train.ts:226 mergeStep's own git failures come back as parenthesised conflicts entries, so ready --no-screen refuses QUEUE_TRAIN_CONFLICT for an environment failure
  • INFORMATIONAL lib/restamp.ts:141 a CLOSED or unknown predecessor is reported as 'must merge before this PR stamps' and kept in the corrected order, so the recompute repeats the refusal
  • INFORMATIONAL scripts/eval-readiness.ts:133 the runs listing is one page of 20 at the head across events; with 20+ dispatches the pull_request run falls off the page and a dispatched run decides

Adversarial pass (Claude subagent):

  • Medium INVESTIGATE lib/pr-wait-github.ts:212 any non-404 failure on either required-checks source sets known=false, and the classic-protection read returns 403 for a token without admin scope, so under the usual Actions token --exclude is refused on every run (fails safe, but gstack-ci-gate reads required-ness from gh pr checks --required and its overrides work for the same token). Controller decision: treat a classic 403 as "rulesets suffice", keep refusing and reword the docs, or fall back to gh pr checks --required.
  • Low FIXABLE lib/ship-queue-train.ts:225 mergeStep reports infrastructure failures ((git merge-tree failed: …), (cannot stage …)) as pseudo-conflicts, so ready --no-screen refuses QUEUE_TRAIN_CONFLICT with the error text as the file; mapping entries that start with ( to the unknown line would follow the rule this range adds.
  • Low FIXABLE lib/restamp.ts:146 for a merged-not-in-base predecessor the printed recompute pins --expect-base to the local base the fix tells the lane to fetch past, so the sequence converges in three refusals; omit --expect-base from that recompute.

Exploratory QA

Two passes of bun-native and CLI probes against the changed contracts, read-only on this checkout (.gstack/qa-reports/ship-3514-p1, ship-3514-p2, gitignored). Pass 1 (12 probes) reproduced three defects red before the pass-1 fixes and revalidated them green after: the key: N spelling produced false prose mismatches, correctedOrder dropped a merged-not-in-base predecessor, stampOnlyLine accepted a width-mismatched mention; the usage, the empty --exclude refusal, the dispatched-run precedence and the baseOverlap unknown line matched expectation. Pass 2 (6 probes at 957be63) covered the same contracts on the clean tree; every probe matched expectation. Verdict both passes: pass.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Greptile Review

No Greptile comments.

Plan Completion

No plan file was present for this branch; the lane's scope was the Captain's six-item list, all six delivered.

Issues

Fixes #3508
Fixes #3512
Fixes #3513
Refs #3514
Related: #3510 (@shahinsamiur)

Verification Results

No Step 8.1 obligations were recorded (no plan file). The focused suites, the guard suites, the typecheck and the typecheck:test ratchet were rerun at the final head and are listed under Test plan; the remote free tier ran on the final tree.

TODOS

TODOS.md does not exist in this repository; no TODO items completed in this PR.

Documentation

Status: updated — three docs corrected for the #3512 stamp rule and the #3513 prose rule, plus the QUEUE_STALE merged-not-in-base fix; no blockers.

Scope. The PR branch (#3514) against a1934a1 (26 committed files, no staged/unstaged/untracked content): gstack-pr-wait --exclude, the BASE_OVERLAP:/MERGE_CHECK: lines at ready and train build, QUEUE_TRAIN_CONFLICT at READY, the corrected gstack-restamp --expect-order recompute, readiness accepting workflow_dispatch Free Tests, the tentative-key stamp rule (stampOnlyLine, stampFreeTree, stampOnlyText) and key=value prose parsing. Each doc claim the branch added was checked against the source; gstack-banned-terms found no list.

Doc diff. docs/ship-policy.md: carry rule and tree-receipt hunk rule now say a stamp path's rewrite may also move a newer tentative same-width version (older or other-width versions stay hand edits, #3512); prose-against-the-receipt notes a key=/key: value is that key's claim alone (#3513). docs/pregate.md: the remote-receipt paragraph citing the tree receipt's version rule gets the same #3512 clause. docs/troubleshooting.md QUEUE_STALE: the Fix covers a merged-not-in-base predecessor and its fix: git fetch origin <base>.

Documentation health:
README.md Current
AGENTS.md / CLAUDE.md Current
ARCHITECTURE.md Current (no diagram names a touched module)
CONTRIBUTING.md Current
CHANGELOG.md Current (untouched; [Unreleased] covers every change)
docs/ship-policy.md Updated (stamp rules #3512, prose clause #3513)
docs/pregate.md Updated (tree-receipt version rule #3512)
docs/troubleshooting.md Updated (QUEUE_STALE merged-not-in-base fix)
docs/standalone-binaries.md Current (branch's --exclude row verified)
docs/TESTING_INTERNALS.md Current (branch's readiness paragraph verified)
TODOS.md Skipped (file does not exist)

Documentation coverage (reference / how-to / tutorial / explanation):
gstack-pr-wait --exclude ✅ ✅ ❌ ✅
BASE_OVERLAP / MERGE_CHECK / ready conflict ✅ ✅ ❌ ✅
gstack-restamp --expect-order recompute ✅ ✅ ❌ ✅
readiness workflow_dispatch ✅ ❌ ❌ ✅
tentative-key stamp rule ✅ ❌ ❌ ✅
key=value prose parsing ✅ ❌ ❌ ✅

Debt. No critical gaps. Common gap, pre-existing: no tutorial walks the ship queue end to end, and docs/ship-policy.md is not linked from README.md, CLAUDE.md or CONTRIBUTING.md directly. Diagram drift: none.

Test plan

  • bun run typecheck: clean (gstack-evidence label typecheck, exit 0, count unavailable)
  • bun test test/ship-queue-train.test.ts test/ship-queue-train-ops.test.ts test/train-gate.test.ts test/pr-wait.test.ts test/eval-readiness.test.ts test/ship-receipt-prose.test.ts test/gstack-ship-receipt-docs.test.ts test/tree-receipt-stamp-sensitive.test.ts test/gstack-restamp-queue.test.ts --timeout 60000: 180 pass, 0 fail (label focused)
  • bun test test/changelog-guards.test.ts test/troubleshooting-anchors.test.ts test/module-size-ratchet.test.ts test/testing-internals-anchors.test.ts --timeout 60000: 264 pass, 0 fail (label guards)
  • bun test test/testing-internals-anchors.test.ts test/typecheck-test-ratchet.test.ts --timeout 60000: 10 pass, 0 fail (label anchors)
  • bun run typecheck:test: 819 known diagnostics, none new (label typecheck-test)
  • gstack-prose-lint CHANGELOG.md docs/ship-policy.md docs/pregate.md docs/troubleshooting.md --base origin/main --gate: ok
  • gstack-pregate --allow-repo-commands then gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commands: remote free tier on Ubicloud, 10750 pass, 0 fail on tree 215aaf431547 ($0.05); secrets stage warns on 43 MEDIUM non-credential pii.phone.e164 / pii.ip_public matches, all 4-part version strings in test files
  • Dispatched at 89d173c (no pull_request run on the CHANGELOG-conflicted head): Free Tests and Windows Free Tests, both green; both clear the remote obligations (gstack-pregate clear --remote … --run-url, then gstack-pregate verify)

🤖 Generated with Claude Code

…eads key=value pairs, stamp paths accept tentative key versions, ready and train build read the base overlap, pr-wait --exclude, restamp prints the corrected order

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

trunk-io Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits October 27, 2026 11:44
Pass 1 of /ship's review on #3514: the prose check skips a key: value pair's value
whatever the whitespace, the restamp recompute keeps a merged-not-in-base
predecessor and says to fetch, stampOnlyLine applies the version-width bound,
pr-wait --exclude excludes nothing while the required checks are unreadable,
baseOverlap reports a failed git read as unknown and gives no verdict at train
build, readiness lets a pull_request run outrank a dispatched one, and the READY
conflict refusal follows the crew template's rule 14 instead of a crew-local rule.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…QUEUE_STALE merged-not-in-base fix

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
MERGE_CONDITION: sha=89d173c036fd34e456df496f303c94c04edca758
next: NEW_VERSION=1.91.278.0; commit and push only the stamp diff above (FILES), with no edit of your own: the train's verify accepts the CHANGELOG only as the base's plus this PR's entry re-headed; merge with the expected head 89d173c and recompute on a stale queue.
GSTACK_RESULT: skill=restamp status=complete run=/workspace/gstack/.gstack/tmp/restamp-journal.json

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(ship-queue): readiness takes dispatched Free Tests, stamp paths accept tentative key versions, ready and train build read the base overlap, pr-wait --exclude, restamp prints the corrected order v1.91.278.0 fix(ship-queue): readiness takes dispatched Free Tests, stamp paths accept tentative key versions, ready and train build read the base overlap, pr-wait --exclude, restamp prints the corrected order Oct 27, 2026
@capy-ai
capy-ai Bot merged commit 1f246e3 into main Oct 27, 2026
63 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

1 participant