UAT Batch Trains
When agents land merge-ready features faster than you can review and merge them one at a time, the bottleneck becomes the last-mile UAT. UAT batch trains fix that: Overdeck assembles ready features into one testable batch, so you can exercise the combined result and then land exactly what you tested in one merge.Batches run only while the Merge train switch on the Flywheel page header
(
merge_train_enabled, off by default) is on. With it on, normal-priority PRs in a GitHub single-repo project that
does not hold for UAT merge together automatically once the batch’s own CI run
is green: when batch_size PRs are ready (default 3) or the oldest has waited
batch_wait_minutes (default 30; both in Settings → Merge Train).
High-priority PRs (strikes, critical, blocks-main, P0, urgent, or
substrate-improvement plus bug) merge on their own. A PR only you may merge
(held for UAT, an auto-merge you cancelled, or a Deft human-merge policy) waits
in its own batch for you. With the switch off, nothing batches: every ready PR that is not held for UAT merges on its own five minutes after it is ready, and a held one waits for you to merge it from the issue page. GitLab and polyrepo projects never merge automatically: their batches wait for you to merge them, and with the switch off you merge each PR yourself.Automatic batches need batch CI: a GitHub Actions workflow named CI that runs
on pushes to uat/** branches. Without it, a batch waits at most 10 minutes for
a CI run, then dissolves, its PRs merge one at a time, and the activity feed
says batching needs a uat/** CI trigger. Batching is tried again a day later.
See CI integrations for a sample workflow.What you see
The merge train shows as one card per project: on the Flywheel page rail (all projects, with filter chips), on the Awaiting Merge page (all projects, under a global Merge train switch), and on each project’s Home (that project only). Each card has:- A mode chip and a Train switch. Auto-merge projects merge ready work on their own; Holds for UAT projects wait for you to test and merge a batch. The switch turns the train off for that project. When the train is off, a banner says no batches assemble. In a Holds for UAT project held features then wait until the train is on again; in an Auto-merge project each ready PR merges on its own after the cooldown.
- The current batch, when there is one. It names its members and any held-out features with the reason, offers Open UAT (a live stack serving that exact branch), a per-feature What to UAT checklist, and Merge batch (N) to main.
- After a merge, the merged batch sits at the top (“merged to main ·
<sha>·<time>”), and the rebuilds that merge voided are one line under it, with show. - Older batches, at most three lines, then show N more: “Older batch
uat/…· superseded” or ”· voided”, where show opens the full card and the reason it ended. Identical voided rebuilds are one line (“8 rebuilds voided, … same members”), and voided batches whose features all merged later sit behind one show line. Voided or merged batches older than a day are left off the card. - Strike PRs at the front of the train, with a pill for each: checks running, flagged by review (with the reviewer’s summary), waits for UAT, merging, or approved, and a Merge button where a merge can start.
- The queue: “Waiting to merge (N)” in an auto project, “Not in a batch
yet (N)” in a hold project. Each row has a status pill: cooling down with a
countdown and Cancel, merging with the step it is on, blocked (with the
first reason), last merge failed (with Retry), waiting for batch, or
ready (with Merge). In an auto project with the train on, a line says
when the next batch assembles. Expand a row for its branch, PR link, how
long it has been ready, its merge policy, every blocker, the reviewer’s UAT
notes, and a nine-step merge tracker. On a GitHub-tracked project the merge
policy is an Auto / Hold toggle: clicking one sets the issue’s
auto-mergeorhold-for-uatlabel, and clicking the pressed one removes it so the issue follows the project again. On other trackers the toggle is read-only and tells you to set the label in the tracker. - Recent merges: “Last merged: PAN-… · 22m ago · show 5”. The list says how each one landed: auto-merge, a batch, an Overdeck merge button, or outside the train. A PR merged outside the train is noted, never refused; when it beat its own scheduled auto-merge, the line says by how many minutes.
How it works
- Assemble. A 60-second reconciler builds a generation (a throwaway
uat/<label>-<codename>-<MMDD>branch offmain), merging each ready feature in order. When two features conflict, a timeboxed assembly agent resolves the conflict inside the batch; if it can’t, that feature is held out (never the whole batch). - Accumulate. New ready features trigger a new, larger generation in the background. Generations accumulate, so you can test and promote an earlier, smaller batch if the newest isn’t what you want. With the batch window on, a live batch keeps its members, and new ready features wait for the next batch.
- Test. Click Open UAT (Start & open when its stack is not running) to exercise the combined branch on a real running stack. The checklist pulls each feature’s acceptance criteria, plus an explicit “verify the touchpoint” item wherever a conflict was resolved.
- Promote. Merge batch (N) to main lands exactly the tree you tested, conflict resolutions included, in one merge. Each feature then closes out through the normal post-merge flow.
gh pr merge): a
one-member batch is the PR branch itself and its CI run a duplicate. A feature
held for UAT (its issue’s hold-for-uat label, else the project’s
auto_merge_default: hold, else the global Require UAT switch on the
Flywheel page header, which is on by default) keeps a batch when it is the
only one ready, because that batch is the stack you test on. The batch window
applies in a GitHub single-repo project that does not hold for UAT: there a
batch, even of one PR, assembles once its oldest PR has waited
batch_wait_minutes.
Each ready feature has one merge path. Overdeck decides it with one rule,
first match wins:
- A feature held for UAT (its
hold-for-uatlabel, else the project’s default, else the global setting) waits for a batch you test and merge. A hold always wins, even over priority. In a project that holds for UAT, that is every feature, so nothing reachesmainuntil you merge a batch. - With the merge train off, every other feature merges on its own (GitHub single-repo projects only), five minutes after it is ready.
- A high-priority PR (a strike, or
critical,blocks-main,P0,urgent, orsubstrate-improvementplusbug) merges on its own. - A feature dropped from a batch because the batch’s CI failed merges on its own.
- Everything else, with the train on, waits for the next batch.
Projects that span several repos
A polyrepo project, one where a single issue’s work lands across several member repositories, gets batch trains too. There is no separate setting: the merge-train flag is the only gate. Polyrepo batches never merge on their own: there is no batch window, no automatic batch merge and no per-PR auto-merge, so each batch waits for you to test and merge it. A feature is ready there when every pull or merge request it has open across the member repos is approved, has green checks and can merge. Each member repo is read through its own forge, so a project that mixes GitLab and GitHub repos works. One draft or unapproved request in any repo keeps the feature out of the batch. GitLab projects, single-repo or not, use the same rule: a merge request counts as approved only when someone is named as its approver. A batch there spans oneuat/… branch per member repo that a ready feature
actually touches. Repos no feature touches are left alone entirely. The batch
still behaves as one unit:
- A feature that conflicts anywhere is held out everywhere. You never test a feature that landed in the API repo but not the frontend one: if it can’t be merged cleanly in every repo it contributes to, it waits for the next batch.
- Merging is all-or-nothing. Overdeck first merges every repo locally, without publishing anything. Only once all of them succeed does it push. If any repo would fail, nothing is published at all and the batch stays exactly as it was.
- An interrupted merge resumes instead of unwinding. If a push fails after
some repos already landed, Overdeck tells you which landed and which are still
pending, and never rewrites a repo’s
mainto undo one. Clicking merge again skips what already landed and finishes the rest.
Live UAT stacks
Each generation can serve a live dashboard atuat-<label>-<codename>-<mmdd>.overdeck.localhost, spun on demand from the batch’s worktree.
Overdeck runs at most two UAT stacks at once (Docker’s network pool is
limited) and tears down the oldest when you start a third; promoting or
invalidating a batch always tears its stack down.
Honest controls
Every action names its exact effect and confirms before anything happens. “Merge batch (3) to main” lists the three issues and states that it lands the tree you tested. Merge alone… on a batch member merges that one feature now, which voids the batch; the confirmation names the batch, and its other members wait for the next one. Merging a strike before its bot review asks first too. There is no opaque “Ship batch” button: a batch builds itself, and nothing reachesmain until you say so.
Merge batch refuses when the batch needs UAT and its UAT stack is not
running. A batch needs UAT when its project holds for UAT, or when any member
is set to Hold. The card then says the stack’s state, for example “UAT
stack is degraded; start it and test, or merge anyway with a reason”. Start
the stack and test, or choose Merge anyway… and type why: the batch
merges, and each member’s history records your reason. A batch of an
auto-merge project with no Hold member never checks the stack.
The Auto / Hold policy toggle and the Merge anyway override are operator
controls. Agents cannot set the auto-merge or hold-for-uat labels: the
dashboard refuses a request that carries an agent’s token, and the agent gh
wrapper refuses the label change too.
Engineering reference
The route rule, batch statuses and reasons, the board read model, and the
routes live in
docs/MERGE-TRAIN.md.