Skip to content

Stale-script self-exit drains running gates; explicit cancel file stops a train - #2070

Merged
remigiusz-antczak merged 1 commit into
mainfrom
land/wave-1027v2
Oct 27, 2026
Merged

remigiusz-antczak merged 1 commit into
mainfrom
land/wave-1027v2

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

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 each train_land.sh pass and before each merge_train.py union 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.cancel stops train_land.sh; it is checked at every tick and right before landing, so a cancelled train never lands. <run-id>.stop in the merge_train.py state directory stops that run; it is checked at every poll and gate. Both release locks and refs and exit 6.

merge-queue-worktrees.md gains 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.sh 16/16; merge_train.py selftest 83/83.
  • scripts/ci-tests.d/*.sh: all pass.
  • test-ci-gates.sh shard 1: only the failures that also occur locally on the base, where the sandbox denies network, pgrep and load probes.
  • land-release.sh --regen makes no diff.
  • One independent review pass: 0 red, 4 yellow, 1 blue, 1 question, all folded (cancel honored between the green gate and landing, .stop honored 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

…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
@remigiusz-antczak
remigiusz-antczak merged commit 459420d into main Oct 27, 2026
8 checks passed
@remigiusz-antczak
remigiusz-antczak deleted the land/wave-1027v2 branch October 27, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant