Repository navigation
Stale-script self-exit drains running gates; explicit cancel file stops a train - #2070
Merged
Merged
Conversation
…ps a train STALE_SELF_EXIT=enforce used to run inside every gate wait (train_land.sh tick) and every gate round (merge_train.py fails), so one pipeline-script merge killed every parallel train mid-gate with nothing failing. The stale check now runs only at stage boundaries before a gate starts: the top of each train_land.sh pass and before each merge_train.py union gate. A running gate drains and lands on the version it started with; the pre-land check is dropped for the same reason. Urgent stop is explicit: touch <LOG>.cancel (train_land.sh, honored at every tick and right before landing) or <run-id>.stop in the merge_train.py state dir (every poll and gate); both release locks and refs and exit 6. The merge-queue reference gains a paragraph on what is pinned and who may stop a train. size-budget-raise: .claude/skills/agentic-delivery/references/merge-queue-worktrees.md 41568→42382 one paragraph on draining pipeline-script updates, what is pinned, and the explicit stop files Tests: test-train-stale-self.sh 16/16, merge_train selftest 83/83, ci-tests.d all pass (re-run on the P–U base), test-ci-gates shards 1-3 only base-identical sandbox/network failures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hi1ChtXVVrE8YEA2Ano93i
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.
Summary
One merge of a pipeline script no longer kills every running merge train. With
STALE_SELF_EXIT=enforce, the stale-script check used to run inside every gate wait, so a train mid-gate exited although nothing had failed. The check now runs only at stage boundaries, before a gate starts: at the top of eachtrain_land.shpass and before eachmerge_train.pyunion gate. A gate that is already running drains and lands on the script version it started with.Stopping a train urgently is now explicit.
touch <LOG_DIR>/train<tag>.log.cancelstopstrain_land.sh; it is checked at every tick and right before landing, so a cancelled train never lands.<run-id>.stopin themerge_train.pystate directory stops that run; it is checked at every poll and gate. Both release locks and refs and exit 6.merge-queue-worktrees.mdgains one paragraph on what is pinned during a run and who may stop a train (41568 → 42382 bytes; marker in the commit).Verification
Run on
5bb1757e3(same tree as the commit tested on the previous main):scripts/test-train-stale-self.sh16/16;merge_train.pyselftest 83/83.scripts/ci-tests.d/*.sh: all pass.test-ci-gates.shshard 1: only the failures that also occur locally on the base, where the sandbox denies network,pgrepand load probes.land-release.sh --regenmakes no diff..stophonored in the merge phase, doc wording on what is pinned, test gaps, who may touch the stop files).🤖 Generated with Claude Code
https://claude.ai/code/session_01Hi1ChtXVVrE8YEA2Ano93i