Run
rm_merge_queue_runRun a serialized merge queue for any git repository: gate candidate branches as merged, fast-forward the base, and prune landed worktrees and branches.
Instructions
Run (rm_merge_queue). Serialized merge queue for ANY git repository (CONCEPT:RM-MERGE-QUEUE).
The canonical driver of parallel development: lanes take worktrees, work,
then hand branches here, and the queue gates them as merged,
fast-forwards the base, and prunes the worktree and branch. Set push
false when a scheduler must leave publication to phased push.
The queue does not know what a gate is. Gates are declared in the
target repository's own .mergequeue.yaml — a command, a tier, a
timeout, and how to compare its result against the base ref.
agent-connector-sdk declares pytest + ruff + its contract scripts;
epistemic-graph declares cargo check --all-features + clippy; a docs
repo could declare only a link check. A repository with no declaration is
REFUSED rather than defaulted, because "declared no gates" and "has no
queue configured" must not be the same value.
Gating is differential: only a failure the base ref does not already produce blocks a candidate — the base is legitimately red here, and an absolute gate once deadlocked a queue and stranded 19 branches. A baseline that cannot be produced REFUSES the candidate; it never degrades to allow-all.
run holds that repository's reconciliation-merge LEASE. If another
runner holds it the call returns deferred: true with the holder —
defer, do not retry in a loop.
landed vs pushed (D-W3WPS-3). Each outcome carries both,
separately: landed means the declared base ref fast-forwarded in the
LOCAL canonical checkout (proven by re-reading it); when push is
true, pushed means that commit also reached the configured remote via
the repo's own gated push path (_gate_before_push + push_project
— the same pre-commit gates and GH013/divergent-remote handling a manual
push gets). With push false, publication is deliberately deferred to
the phased-push scheduler. A push failure never fails the landing —
landed: true, pushed: false is a legitimate, visible intermediate
state; check push_error on the outcome for why. The queue's own
run summary also reports pushed/landed_unpushed counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Branch to land onto. Defaults to the repo's declared base. | |
| push | No | Publish a landed base through the repository's gated push path. Set false for the fast queue timer; the phased-push scheduler then owns publication. | |
| prune | No | Remove each landed candidate's worktree and branch through the guarded prune (merge-base re-checked at delete time, a refs/lane-backup anchor written first, `git branch -d` never -D, and a worktree holding uncommitted work is refused). | |
| branch | No | Candidate branch for enqueue/withdraw. Defaults to that tree's HEAD. | |
| reason | No | Why a candidate is being withdrawn. | |
| repo_path | No | Any working tree of the target repository. This is what makes the queue cross-project: one server, N repositories, each with its own lease, candidate store, and gates. Defaults to the server's cwd. | |
| batch_size | No | Candidates gated together per run (0 = the repo's declared batch_size). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||