Land non-conflicting worktrees together via a maximum independent set.

Merge-train MIS batching

Intent — A merge-train that lands the largest set of non-conflicting agent worktrees per tick by computing a Maximum Independent Set over their file footprints, so many agents' work merges in one conflict-free pass instead of thrashing sequentially.

SummaryLand non-conflicting worktrees together via a maximum independent set.
TargetAgent · Gates & merge-train
Formquality-gate
EnforcementHard (deterministic) — the batch is selected by a graph predicate, not by hope-and-retry

Motivation — the failure it kills

With 6–8 agents committing concurrently, a naïve sequential merge serializes all of them and conflicts thrash: each merge risks colliding with the last, and the throughput of the whole fleet collapses toward one-at-a-time. Hot-spot files that many agents touch (the merge tool itself, CLAUDE.md, shared config) become bottlenecks that stall everything behind them. The failure recurs every merge tick and worsens as the fleet grows: more agents, more collisions.

Why it's not just "merge them one by one" (or "let git sort the conflicts")

Sequential merge is O(n) wall-clock and conflict-prone; "let git sort it" turns every tick into a manual conflict-resolution session. MIS batching instead builds a conflict graph (worktrees are nodes, a shared file is an edge) and computes the largest set of worktrees with disjoint file footprints, landing that set together. The batch is non-conflicting by construction: because no two members touch the same file, they cannot collide. Graph independence proves the batch conflict-free before it lands; sequential merge only hopes each merge misses the last one's files, and retries when it doesn't.

Mechanism

Each tick: build the conflict graph from per-worktree file footprints, compute an independent set, land that set this tick, defer the rest to the next. Throughput is maximized upstream, at dispatch: the scheduling discipline launches waves with disjoint footprints so the MIS is large, and warns that hot-spot files (touched by many agents) cap the MIS to size 1 no matter how many agents are ready. Landed commits are checked by patch-id / ancestry reachability.

Prerequisites

Consequences & costs

Known uses

Related mechanisms