docs/ops/MERGE_TRAIN.md
Since v3.8.49 (WS3.2/WS3.4 of the quality/velocity plan) the default merge path for
reviewed PRs into release/vX.Y.Z is the Mergify merge queue (.mergify.yml);
the manual merge-train documented below is the FALLBACK — used during incidents,
release freezes, or if the Mergify Open Source plan ever changes.
/merge-prs Step 0.75).queue
label. The label IS the merge approval; Mergify only executes it.Guardrails (mirror CLAUDE.md Hard Rules #21/#22):
release/vX+1 first.hotfix-labeled PRs already run reduced CI (see
RELEASE_CHECKLIST.md → Hotfix Fast-Lane); the queue conditions accept whatever
check set actually ran (#check-failure=0 + #check-pending=0).Used when the queue is unavailable. This codifies the practice that drained 33 PRs in one day during the v3.8.47 cycle:
linked: collisions
(same tap.testFiles, same CHANGELOG hunks) and serialize those.npm run check:release-green, add --with-build before a release).
scripts/release/merge-train.sh <base> <PR#>… automates steps 1–2 (conflicting
PRs eject, the train continues). Full mode runs npm run test:unit — the
box-tuned runner (--test-concurrency=20), not the two sequential 4-core CI
shards, which drove the dominant phase at ~25% of a 16-core box (fixed
2026-07-18). --fast (intra-day mega-train drains, owner-approved 2026-07-18)
keeps every static gate + vitest but runs only the node:test files changed by the
boarded PRs; the FULL suite must still run at least once per day on the
accumulated tip (one train without --fast).state,headRefOid before each —
a PR whose head moved re-enters review). Prove the net diff of each merge is the
PR's own change (no auto-resolve reverts: audit git diff --stat for
out-of-scope deletions).git stash anywhere;
blanket-rerun CI hoping a red goes away (rule: a red is information).--quick HARD gates on every push to
the release branch; full --with-build --full-ci sweeps 3×/day.Nothing is validated less than before — the heavy surface just runs per batch/tip instead of per PR, which is what removes the O(N) round-trips.