Repository navigation
A crashed merge no longer blocks every other merge, and a one-call count of PRs waiting to merge (GST-3549) - #4712
Merged
Merged
Conversation
…queue count for the finished-PR queue (GST-3549) The land lock a direct land writes records its process and expires 90 minutes after its last phase; the next land takes over a lock whose land exited, whose machine restarted or that expired, logs the takeover, and never takes over a running land. gstack-ship-queue count reads the finished-PR queue in one gh call and prints DRAIN past R119 bounds. Docs: the drain lanes (crew/docs/captain.md, factory.md) and the revert drill (docs/ship-policy.md). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/specialist-batched#2 reader=testing Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#3 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p2/outside-voice#1 reader=outside-voice Review-Finding: p2/outside-voice#3 reader=outside-voice Review-Finding: p2/outside-voice#4 reader=outside-voice Review-Finding: p2/red-team#1 reader=red-team Review-Finding: p2/adversarial-native#1 reader=adversarial-native Review-Finding: p2/outside-voice#5 reader=outside-voice Review-Finding: p2/outside-voice#6 reader=outside-voice Review-Finding: p2/specialist-batched#2 reader=testing 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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot
added a commit
that referenced
this pull request
Nov 22, 2026
…ow leads to a /ship sign-off (GST-3546) (#4717) After a pull request's two review rounds, an approved extra check of the fixes now ends in a /ship sign-off instead of a dead end. Why: three projects (gbrain #10068, gskills #23–#25, gstack #4712) had no way to finish after a ruling at the round limit and skipped the sign-off or bent their records. Nothing to do: the next /ship uses it. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/specialist-batched#2 reader=state-machines Review-Finding: p1/specialist-batched#3 reader=state-machines Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p2/outside-voice#1 reader=outside-voice Review-Finding: p2/outside-voice#2 reader=outside-voice Review-Finding: p2/outside-voice#3 reader=outside-voice Review-Finding: p2/adversarial-native#1 reader=adversarial-native
This was referenced Nov 23, 2026
Merged
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.
When
gstack-ship-queue land --pindies in the middle of a merge, the next merge now takes over its lock by itself (the process has exited, its machine restarted, or 90 minutes passed) and logs it; a merge that is still running is never interrupted.New
gstack-ship-queue countsays how many finished PRs are waiting to merge, and the docs now say how to drain that queue and how to time a revert drill.Nothing to do: the next
land --pinuses the new lock on its own.What changed
On 2026-11-22 one merge died while it held the land lock, and every later merge refused for hours while about 15 green PRs waited. The lock had no way to tell a dead merge from a live one, so the only way out was a person passing
--break-lock.A direct merge's lock now records the process holding it (machine boot, process namespace, process group, start time) and an expiry 90 minutes after its last step. The next merge refuses a lock whose merge still runs,
--break-lockincluded, and takes over one whose merge is gone or that expired, printingLOCK_TAKEOVER:. If a merge stops while the repository's own post-merge checks run (they can outlive it), it leaves a deliberate hold on that machine, which a person releases with the command the refusal prints. Takeovers write under an exact lease on the lock they judged, so a slow takeover never replaces a newer lock.gstack-ship-queue countreads open PRs with one GitHub call and counts the finished ones (ours, on the base, not draft, not conflicting, green at the head). It prints aDRAINline when more than 6 wait or one has waited a day. The coordinator docs (crew/docs/captain.md#drain-the-queue, factory.md point 16) say to run it at every wake and how to merge a backlog, anddocs/ship-policy.mdgains#land-lockand#revert-drill.Blast radius
Only
land --pinwrites these process-scoped locks; locks from the older per-PRlandand fromtrain landkeep their rules, and an older lock with no process record expires 90 minutes after its last step (crew/lib/ship-queue-land-lock.ts, read and covered by crew/test/ship-queue-land-lock.test.ts). A reproduction against the stuck lock from 2026-11-22 refuses forever on main and is taken over after expiry with this change.Why
Finished PRs that sit unmerged go stale, because the base moves under them and conflicts appear. A merge lock that can go stale turns one crashed process into a stopped queue, so the lock has to clear itself, and the queue has to be counted before it piles up.
Pre-Landing Review
Two full review rounds and one owner-granted check of the second round's fixes. The second-model review found six problems in how the post-merge hold was set and judged; five were fixed in this PR and the check of those fixes found nothing blocking. The sixth is in code this PR did not change and is listed under Deferred findings. Remaining notes are below the blocking floor.
Deferred findings
lib/ship-queue-land-direct.ts:187: a rerun of an already-merged PR runs the post-merge checks before it reads the lock. This code predates this PR; left for a follow-up.Review notes
Below the blocking floor; recorded here and not fixed in this PR.
lib/ship-queue-land-direct.ts:277: no land-direct test drives the post-merge hold end to end.crew/lib/ship-queue-land-lock.ts:84: a rerun wrapped in a command substitution from the dead merge's own script now reads its wrapper as a running merge and refuses (the safe direction).lib/ship-queue-land-direct.ts:142: when the post-merge hold cannot be written, the suggested rerun takes the already-merged path, which runs the checks unheld (the deferred finding above).lib/ship-queue-land-direct.ts:195: an already-merged rerun with--allow-repo-commandsagainst a deliberate hold refuses each time without naming the release command.crew/lib/ship-queue-land-lock.ts:246:--break-lockcan still take a hold whose checks changed the checkout's git directory; only the advice changed.crew/lib/ship-queue-land-lock.ts:248: releasing a deliberate hold prints the generic takeover line, not that a hold was released.Documentation
Status: updated — one factual fix; the branch already documents its own changes.
Scope: 4 commits from 5962f0d to d732e9c (12 files: land-lock takeover in crew/lib/ship-queue-land-lock.ts and lib/ship-queue-land-direct.ts, new
gstack-ship-queue count); no staged, unstaged or new files.Documentation health:
Coverage debt:
gstack-ship-queue counthas reference docs (help text, captain.md) and a how-to (Drain the queue) but no tutorial; land-lock takeover has reference and explanation docs (ship-policy.md#land-lock). No critical gaps. Diagram drift: none.Tests
bun test crew/test/ship-queue-land-lock.test.ts test/ship-queue-count.test.ts test/ship-queue-land-direct.test.ts: 105 pass, 0 failbun test test/captain-skill.test.ts: 11 pass;test/captain-brief.test.ts test/ship-queue-count.test.ts test/docs-only-policy.test.ts: 103 passbun run typecheck: cleanAgent notes
Refs GST-3549
REVIEW_LOOP: passes=2 blocking_found=6 deferred=0 noted=13 fixed=12 scope=frozen open=6 fix_checks=1 dispatches=6
Fix-check: one owner-granted scoped fix-check (GSTA-36, approval a-a0622b71e145 with range correction a-49757303aec7, #4712's first review-loop exception) over 59412e9..d732e9c, reviewed tree 30977cf4dae1, blocking=0, 5 informational notes.
Ruled note: crew/lib/ship-queue-land-lock.ts:238:outside-voice at e8ad7d3 ruled by GSTA-36 (relayed from GSTA-810:01M8283BPEMWB83T5Y4TXQZGVQ) at 2026-11-22T18:25:57.147Z: closes on the clean fix-check over 59412e9..d732e9c (GSTA-36 confirmed) (approval a-56c1401b87ba)
Ruled note: crew/lib/ship-queue-land-lock.ts:295:outside-voice at e8ad7d3 ruled by GSTA-36 (relayed from GSTA-810:01M8283BPEMWB83T5Y4TXQZGVQ) at 2026-11-22T18:25:57.316Z: closes on the clean fix-check over 59412e9..d732e9c (GSTA-36 confirmed) (approval a-ab9ba41bc9d7)
Ruled note: lib/ship-queue-land-direct.ts:318:outside-voice at e8ad7d3 ruled by GSTA-36 (relayed from GSTA-810:01M8283BPEMWB83T5Y4TXQZGVQ) at 2026-11-22T18:25:57.508Z: closes on the clean fix-check over 59412e9..d732e9c (GSTA-36 confirmed) (approval a-e6419a33e8f0)
Ruled note: crew/lib/ship-queue-land-lock.ts:125:outside-voice at e8ad7d3 ruled by GSTA-36 (relayed from GSTA-810:01M8283BPEMWB83T5Y4TXQZGVQ) at 2026-11-22T18:25:57.693Z: closes on the clean fix-check over 59412e9..d732e9c (GSTA-36 confirmed) (approval a-adadba19ee66)
Ruled note: crew/lib/ship-queue-land-lock.ts:90:outside-voice at e8ad7d3 ruled by GSTA-36 (relayed from GSTA-810:01M8283BPEMWB83T5Y4TXQZGVQ) at 2026-11-22T18:25:57.893Z: closes on the clean fix-check over 59412e9..d732e9c (GSTA-36 confirmed) (approval a-d92b88c9230b)
Ruled note: lib/ship-queue-land-direct.ts:187:outside-voice at e8ad7d3 ruled by GSTA-36 (relayed from GSTA-810:01M8283BPEMWB83T5Y4TXQZGVQ) at 2026-11-22T18:25:58.090Z: ships as a disclosed note on pre-existing code (approval a-c95a949033fc)
Also approved under R119: the factory.md byte budget raised to 5,300 for point 16 (approval a-889893c6937f).
Approvals:
Approved: yes (record r-d2f9d8ffee06). The full approval record stays private.
Plan: exempt: bug fix with a repro on current main (a stale land lock held gstack merges for hours); owner go-ahead 2026-11-22
Plan check: exempt bug fix