Skip to content

v1.92.54.0 ship-queue: train land takes the shared land lock; verify proves the stamp; restamp stages its writes (#3599, #3531) - #3737

Merged
capy-ai[bot] merged 26 commits into
mainfrom
capy/ship-queue-train-land
Nov 2, 2026
Merged

capy-ai[bot] merged 26 commits into
mainfrom
capy/ship-queue-train-land

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3737,
  "head": "2f9fe4aa5a06b0bc18f44915dd9f08f699d31790",
  "version": "1.92.0.0",
  "base": "main",
  "session_kind": "unattended",
  "head_tree": "a0a935027b7463dc56caff893b41556452a46d90",
  "product_patch_id": "16ae702b3e85ae2e484d3766755cf72f2b6a0063",
  "gstack_version": "1.91.377.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 559,
    "rules": "150435b0a543019a",
    "base": "5225e35cc60312ae1b675704e7f2ffdac1ccf40e",
    "registry": "5225e35cc60312ae1b675704e7f2ffdac1ccf40e",
    "gate_scan": {
      "tagged": 0,
      "head": "2f9fe4aa5a06b0bc18f44915dd9f08f699d31790"
    },
    "reasons": [
      "gate-class",
      "runtime=559>50"
    ]
  },
  "pregate": "requires-remote cleared @a0a935027b74 (1 checks, current for 2f9fe4aa5a06)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/41353860597",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41353860597",
    "free-tests.yml/cso-windows-launcher: https://github.com/garrytan/gstack/actions/runs/41353860597",
    "platform-qualification.yml/ios-swift-build: https://github.com/garrytan/gstack/actions/runs/41354694219",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41353860546",
    "windows-setup-e2e.yml/windows-setup: https://github.com/garrytan/gstack/actions/runs/41353860540",
    "pregate.json/remote_gate: remote-gate tree=a0a935027b74 tests=29564"
  ],
  "issues": {
    "fixes": [
      3531,
      3599
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, captain/templates/, changelog.d/, README.md"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 2,
    "fixed": 5,
    "scope": "frozen",
    "fix_checks": 1,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "carry": {
    "from": "1539cb1d77896f67bbbb25469333b05b1a1b964b",
    "reason": "base merge + base context moved (scoped review by anthropic/claude-opus-5-5: lib/ship-queue-train-record.ts) + test-only change + release metadata",
    "product_patch_id": "16ae702b3e85ae2e484d3766755cf72f2b6a0063",
    "changed_paths": [
      "product:.github/docker/Dockerfile.ci",
      "product:.github/scripts/history-read.sh",
      "product:.github/workflows/evals-main-backstop.yml",
      "product:.github/workflows/evals.yml",
      "product:.github/workflows/free-durations-record.yml",
      "product:.github/workflows/free-tests.yml",
      "product:.github/workflows/version-gate.yml",
      "product:.github/workflows/windows-free-tests.yml",
      "product:.gitignore",
      "product:.gstack/pregate.json",
      "product:.gstack/ship-policy.json",
      "metadata:CHANGELOG.md",
      "product:CLAUDE.md",
      "product:CONTRIBUTING.md",
      "product:README.md",
      "product:TODOS.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:autoplan/SKILL.md.tmpl",
      "product:bin/dev-setup",
      "product:bin/gstack-brain-sync",
      "product:bin/gstack-capy-install",
      "product:bin/gstack-config",
      "product:bin/gstack-docs-candidate",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-eval-plan",
      "product:bin/gstack-ff-update",
      "product:bin/gstack-global-discover.ts",
      "product:bin/gstack-harness",
      "product:bin/gstack-harness-ledger.sh",
      "product:bin/gstack-host-renders.sh",
      "product:bin/gstack-install-registry.sh",
      "product:bin/gstack-office-hours-review",
      "product:bin/gstack-plan-reality",
      "product:bin/gstack-pregate",
      "product:bin/gstack-redact-prepush",
      "product:bin/gstack-repo-mode",
      "product:bin/gstack-retro-metrics",
      "product:bin/gstack-review-dispatch",
      "product:bin/gstack-review-log",
      "product:bin/gstack-review-plan",
      "product:bin/gstack-review-read",
      "product:bin/gstack-session-update",
      "product:bin/gstack-ship-budget",
      "product:bin/gstack-ship-parts",
      "product:bin/gstack-ship-queue",
      "product:bin/gstack-ship-receipt",
      "product:bin/gstack-skill-start",
      "product:bin/gstack-slug",
      "product:bin/gstack-tasks"
    ],
    "merge_commits": 1,
    "range_diff": "1:  703b0049e =  1:  703b0049e v1.91.280.0 fix(flaky): ubi-runner quota wait counts down; pregate TERM teardown and design-lint linearity measure what they mean (GSTA-128) (#3517)\n 2:  392f50d47 =  2:  392f50d47 v1.91.281.0 fix(flaky): repair four paid gate detectors, the design-floor focus picker and the judged review/plan-review prose (GSTA-128) (#3516)\n 3:  9ccb5233f =  3:  9ccb5233f v1.91.282.0 fix(ship-queue): one CHANGELOG rule before and after the merge, base keys stay in slot stamps, a stacked child carries past its released parent (#3518)\n 4:  215c76e33 =  4:  215c76e33 v1.91.283.0 fix(benchmark): reconcile the collection, comparison, budget and trend phases with the vet-the-number section (GSTA-128) (#3520)\n 5:  10b77de4f =  5:  10b77de4f v1.91.284.0 feat(absorb-tstack): /modernize skill, per-skill Codex default prompts, gstack-post --attribute, the unattended grant and a CONTRIBUTING porting section (#3497)\n 6:  737e5a239 =  6:  737e5a239 v1.91.285.0 docs(captain): plan before build — a sized /autoplan is a building lane's first act, the owner's word gates the build (#3521)\n 7:  398618259 =  7:  398618259 v1.91.286.0 feat(ship-queue): the ship size cap composes across a merge train; verify refuses a stale all-merged train (#3519) (#3522)\n 8:  7204a39a2 =  8:  7204a39a2 v1.91.287.0 feat(write-skill): write, change and diet skills; /learn at half its template size (#3524)\n 9:  cd4fc4be7 =  9:  cd4fc4be7 v1.91.288.0 feat(release): stable moves at most every 72 hours, with a verified security exception and Monday/Thursday cuts (#3523)\n10:  a14c28aca = 10:  a14c28aca v1.91.289.0 feat: skill diet pilots for plan-design-review, office-hours and design-review (GSTA-134) (#3525)\n11:  44f19d010 = 11:  44f19d010 v1.91.290.0 feat(harness): gstack registers its skills in whatever agent harness it is installed into (GSTA-135) (#3526)\n12:  148d28ea8 = 12:  148d28ea8 feat(ship): /ship and /autoplan size their review to the diff (GSTA-131) (#3527)\n13:  6f27f0c26 = 13:  6f27f0c26 v1.91.291.0 release: stamp #3527 (/ship and /autoplan size their review to the diff) (#3530)\n14:  219f7488b = 14:  219f7488b v1.91.292.0 Stable channel: a regression exception beside the security one, and the stale weekly wording (#3533)\n15:  9e3308f65 = 15:  9e3308f65 v1.91.293.0 fix(harness): error lines print again; register qm stops at QM's pack cap instead of claiming QM works (GSTA-135) (#3532)\n16:  4b8c03bea = 16:  4b8c03bea v1.91.294.0 fix(doctor): cut Git Bash process starts so the doctor tests fit Windows CI (GSTA-138) (#3540)\n17:  61e201ec0 = 17:  61e201ec0 v1.91.295.0 fix(pregate): deleting or renaming a test no longer fails lanes (#3534)\n18:  98dd72ffc = 18:  98dd72ffc v1.91.296.0 fix(flaky): ship-docsync gates accept the docs helper's --help and git tag listings in a line of reads (GSTA-139 S1) (#3542)\n19:  fb30ed104 = 19:  fb30ed104 v1.91.297.0 fix(browse): read Windows process start times in-process so the terminal agent boots without PowerShell (GSTA-139 flaky pass) (#3545)\n20:  415e343b5 = 20:  415e343b5 v1.91.298.0 chore: remove Dia from gstack (cookie source and qualification harness) (#3551)",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "7c220b04c49c801da05287cdbc1aad3fc76540b1"
    ]
  }
}

Fixes #3599 and #3531. It was stacked on #3692, which merged as v1.92.0.0; it now targets main, with one merge of main (no product change). The plan is an eng-only autoplan run, run-20261031175057, approved by GStack Minder at gate_rev 3.

What changed

  • Shared land lock for trains (ship-queue: train land should take the shared land lock (refs/notes/gstack-land) #3599): train land takes the same remote lock as land (refs/notes/gstack-land, moved into lib/ship-queue-land-lock.ts with no change to how land uses it). The lock records an owner kind, standalone or train/slot, so a same-PR land can't take over a train's lock. Once a slot has merged, the train keeps the lock in a between phase until its last slot lands, even through a refusal on the next slot. A freeze moves it to a freeze phase that only the admitted repair train takes over while the freeze lasts. Once the freeze is cleared, the next land or train land takes over a freeze lock whose release push failed. --break-lock prints the holder and refuses a live train's lock unless --break-train-lock is also passed. A lock ref deleted on origin now reads as no lock on every clone.
  • Verify proves the stamp (ship-queue: verify --train says 'may merge' for a slot head with 0 stamp files and no VERSION bump over main (train 33 / #3527) #3531): for plain (hand-stamped) trains, verify --train refuses with QUEUE_TRAIN_UNSTAMPED when the head's version isn't above main's, when the CHANGELOG's top section isn't that version, or when an [Unreleased] section is left over. "Merged" now requires GitHub to report MERGED. An open or unreadable PR refuses with QUEUE_PROOF_MISSING and never freezes the queue; the release-only shape takes the pre-merge path. A verify that couldn't read the PR's current head (--no-fetch or a failed fetch) also refuses with QUEUE_PROOF_MISSING instead of judging the unstamped pin.
  • Restamp stages its writes: gstack-restamp --next runs git add -A -- <FILES> and prints STAGED:, or RESTAMP_NOT_STAGED. A stale staging marker no longer breaks the noop rerun: files that still match are staged, and changed ones are named on a NOTE: line. The change is in the bin; lib/restamp.ts is unchanged.
  • Docs: ship-policy, troubleshooting, captain.md and the slot-call template now describe the lock phases and restamp staging. The slot call says git restore --staged --worktree for a file it doesn't name.
  • Comment fix: the cap comments in lib/ship-queue-train-gate.ts now say there's one cap per command gate.

Why

train land took no lock, so it and land could both read the same main and publish a combined tree neither had tested. In train 33, verify --train said "may merge" for #3527's head after a bare commit dropped the stamp restamp had written but not staged, so #3527 shipped under #3526's version.

Blast radius

Only the ship-queue merge path: land, train land, verify --train and gstack-restamp. Plain trains still merge through verify --train and gh pr merge, outside the lock. gbrain gets a handoff note for the new lock behavior.

Proof (each test was written first and failed at base 93fc5dc)

  1. Train land vs held lock: train land pushed its stamp while a standalone land held the lock.
  2. Same-PR takeover race: a standalone land of Project-local .claude/skills/gstack install breaks /browse and setup can report false success #3 stamped the same version as train slot 1's waiting stamp, so two PRs ended up with one version.
  3. feat(ship): /ship and /autoplan size their review to the diff (GSTA-131) #3527 shape: verify --train exited 0 ("may merge") on an unstamped slot head. This is how feat(ship): /ship and /autoplan size their review to the diff (GSTA-131) #3527 shipped under v1.91.290.0 feat(harness): gstack registers its skills in whatever agent harness it is installed into (GSTA-135) #3526's version.
  4. v1.91.291.0 v1.91.291.0: release stamp for #3527 #3530 shape: verify printed "VERIFY_TRAIN: fix: harden /browse lifecycle and ref safety #5 merged" for an open PR.
  5. Restamp: it left 5 FILES unstaged, so a bare commit after a --no-commit merge dropped the stamp.
  6. Freeze: a land stamped and pushed onto a main frozen by a lock-backed freeze. A standalone land still doesn't check a freeze that no lock records (listed below; this predates the PR).

Review fixes, each red-first against the commit before the fix:

  • A refusal partway through a train released the lock between slots.
  • A freeze lock was taken over when no freeze record could be read.
  • A stale restamp staging marker made every noop restamp fail.
  • A freeze lock whose release push failed blocked every standalone land after the freeze cleared.
  • verify --train --no-fetch judged the unstamped pin.

Also fixed in review, with a regression assertion but no recorded failing run before the fix: a lock ref deleted on origin now reads as no lock.

Test changes to note

  • Nine existing verify tests now stamp their slot heads and mark merged PRs MERGED, because that's what the new rules require.
  • In "a failed stamp push", the hook rejects only pr-1. The reject-everything hook is still asserted first, and it now fails the lock write.
  • Three restamp-queue tests get 30 s timeouts. At base they already took up to 4.86 s of their 5 s limit, and the staging step pushes them over.

A fix-check reviewer read all three: each still proves what it proved before.

Pre-Landing Review

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=2 fixed=5 scope=frozen fix_checks=1

Gate edits: the three test changes listed above. No threshold, skip or budget changed.

Informational findings, not fixed here:

  • If landSlot throws, the lock stays in stamping. Rerunning the slot, or --break-lock --break-train-lock, recovers. No fixture can force the throw, and land had the same gap before this PR.
  • An abandoned train's between lock needs --break-lock --break-train-lock after 10 minutes.
  • A gitignored file in restamp's FILES fails git add.
  • Two concurrent runs of one slot share a journal.
  • A standalone land doesn't check for an active freeze that no lock records. This predates the PR.
  • No test reaches the synced.fetched guard on its own.

Paid evals: none run for this PR. The selector picks about 120 probes and 25 judges, because the ship-queue bins are derived references to every case. The train's full gate runs them.

Security read

  • No new network endpoints, dependencies or workflow edits.
  • The lock write uses the existing git push to the notes ref under an exact lease. readLock adds one git ls-remote of that ref.
  • Restamp's git add covers only the paths restamp itself reported.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Approve the eng-only autoplan plan for #3599/#3531 (train land lock, unstamped verify), run-20261031175057, gate_rev 3, rec_hash a97505c03984 “do it” (GStack Minder) approved the reviewed plan at gate_rev 3, every recommendation (rec_hash a97505c03984) none

Source: gstack-approvals record for capy/ship-queue-train-land (display only; not an approval citation).

Fixes #3531
Fixes #3599

garrytan and others added 19 commits January 1, 2000 00:00
…-red, conditional receipts) (GSTA-157 PR 1)

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>
…, readPause, wait unconfigured)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ers an invalid base policy

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ify usage before fetch, unresolved-head detail)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… 2026-10-31); CHANGELOG entry moved to changelog.d fragment

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…command), every prefix gated, generalized train land (direct/update, merge method), base-red trains, train init/doctor, watch --land (GSTA-157 PR 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…base, post-merge checks, output tail, caps)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…merge checks are green

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

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>
…m resolves gh.exe there)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…py/ship-queue-merge-trains (rule 19 grant, GStack Minder 2026-10-31)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…queue-merge-trains (rule 19 grant, GStack Minder 2026-10-31)

main's tree at 1b46f37 equals the base stamp 4bc8d9c already merged in 94fa21c, so every add/add hunk resolves to the same bytes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… freeze-owned), verify --train proves the stamp and needs GitHub MERGED, restamp stages its writes (#3599, #3531)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…d-train refusal; freeze takeover reads the notes ref; a refused lock push is not reported as a taken lock)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…r it (pre-landing review pass 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ed dry run refuses before the real run; settleLock names the real lock-write failure (Step 11 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan and others added 3 commits October 31, 2026 21:14
…ref reads absent; unread verify head refuses QUEUE_PROOF_MISSING

Step 11 adversarial findings on PR #3737: a freeze lock whose release push failed
blocked every standalone land after its freeze cleared (freezeLockCleared shared by
land and train land takeover); readLock kept a cached ref deleted on origin; verify
--train --no-fetch judged the unstamped pin; the slot call now restores the worktree
for an unrequested fifth file.

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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot changed the base branch from capy/ship-queue-merge-trains to main October 31, 2026 21:47
@trunk-io

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits October 31, 2026 21:48
…-land

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

# Conflicts:
#	lib/ship-queue-train-cli.ts
#	lib/ship-queue-train-gate.ts
#	lib/ship-queue-train-land.ts
#	lib/ship-queue-train-verify.ts
…read head

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

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

# Conflicts:
#	test/ship-queue-train.test.ts
@github-actions github-actions Bot changed the title ship-queue: train land takes the shared land lock; verify proves the stamp; restamp stages its writes (#3599, #3531) v1.92.54.0 ship-queue: train land takes the shared land lock; verify proves the stamp; restamp stages its writes (#3599, #3531) Nov 2, 2026
@capy-ai
capy-ai Bot merged commit e259975 into main Nov 2, 2026
56 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