Trailside Docs
DocsAutomatic merges All docsMenu
DocsAutomatic merges

Automatic merges

An Admin chooses, for each risk tier, whether a reviewed pull request waits for a person’s Merge or merges on its own. Checks, review and Holds still apply.

Sample. Trailside is in development. These docs describe how the product is meant to work. The Sample Board uses fictional data and runs nothing.

Presets and tier choices

Autonomy is a Workspace setting in Settings › Autonomy. For each risk tier from T0 to T4, an Admin chooses Ask me before merging or Merge when checks and review pass. Only an Admin saves it, and every change is recorded.

PresetWhat each tier does
CarefulEvery tier: Ask me before merging. Careful keeps every merge a click.
BalancedT0 to T3: Merge when checks and review pass. T4: Ask me before merging. New Workspaces start on Balanced.
Fully autonomousEvery tier: Merge when checks and review pass. T4 still gets its red team and independent review, and both must pass before it merges.

Any other mix of choices shows as Custom. Autonomy decides only whether a reviewed pull request merges without a click. It never changes a card’s tier, its review Steps, Automation, Holds or GitHub’s branch protection. No Preset turns Holds off.

Under every Preset, required checks and review still run at every tier. While Holds are on, a change to a protected path still waits until a person approves its Hold.

Holds are a separate choice on each Computer, and choosing a Preset alone keeps them unchanged. At that Computer’s terminal, trailside holds off turns them off after you type holds off. In Settings › Autonomy, an Admin who is that Computer’s Account Holder may turn them off after reading the Holds disclosure and confirming. With Holds off, that Computer merges protected changes without an approved Hold, including on its own once their review passes and Autonomy allows their tier. An Admin’s risk-tier proposal from Skills › Risk tiers may then merge on its own too, after its T4 review, but only as that Admin signed it: the pull request changes nothing but .trailside/risk-tiers.json, on its card’s own branch, with exactly the proposed file at its head and the edited one on the base branch, while the proposal is still open and its Admin still an Admin. Any other change to the risk-tier rules still needs an approved Hold and a person’s Merge. Holds can be turned back on at any time.

Confirm on an Admin’s Computer

Saving Autonomy on the website merges nothing by itself. An Admin confirms it on their own Connected Computer, which then holds that version as its standing instruction. Until an Admin confirms, nothing merges on its own.

In Settings › Autonomy, use the Confirm button for your Computer, such as Confirm on studio-mac. The browser signs the saved version and the linked repositories with its key approved on that Computer, and seals them so only that Computer can open them. A browser not yet approved there asks you to approve it first.

Automatic merges need Board actions on that Computer. Board actions are the changes your Computer makes on GitHub when you act on the Board. With your own GitHub sign-in on that Computer, it posts your answers to Needs you questions as comments on the GitHub issue, posts the reviews you choose on the pull request, retries stopped runs, creates, moves and edits issues, and merges pull requests in the Merge queue, including the automatic merges its confirmed instruction allows. The Trailside service never writes to GitHub itself.

To turn Board actions on, run trailside connect --advanced in that Computer’s terminal and confirm its Connect disclosure, which then lists Board actions. Then you turn them on or off for that Computer in Settings › Computers. Or start that Computer with trailside up --post-answers: while its Connect disclosure does not list Board actions, as after the starter agreement, the flag turns them on for as long as that trailside up runs. Once the disclosure lists them, the Settings › Computers switch decides and the flag changes nothing.

Confirm separately on each Computer. The Workspace Preset alone does not give every Computer an instruction. Confirm again after a change or a newly linked repository.

A browser request never grants Connect consent. Connect consent is your agreement to a Computer’s Connect disclosure, the list of what Trailside may ask that Computer to do: you give it by typing connect in its terminal, or by running an Add Computer command you confirmed. See First run and Type connect on the server. Only an Admin’s own Connected Computer, with Board actions enabled and its confirmed instruction, can merge automatically. The merge is made by that Computer; the Trailside service never writes to GitHub.

To stop, use Stop automatic merges on your Computer in Settings › Autonomy. That Computer ends its instruction when it next connects.

Pause and Resume

Pause autonomy on the Board makes every tier ask before merging. Anyone who may start Runs can pause it from the Board; only an Admin resumes.

Runs carry on and their pull requests wait for a person. Unlike choosing Careful, a pause keeps the saved choices, and they come back when an Admin uses Resume autonomy on the Board. In the Merge queue, an automatic pull request keeps its place while Autonomy is paused. Settings › Autonomy lists every Pause and Resume.

The Merge queue

Every merge a Connected Computer makes from the Board, whether a person’s Merge, Merge when ready or an automatic merge, takes its turn in the Workspace’s Merge queue: one merge at a time for each linked repository’s default branch.

Merge when ready is a button on the Board, not GitHub’s auto-merge or a setting. An In review card offers it where a card ready to merge now offers Merge PR #<n>: its pull request passed review at its current head and either has checks still running with no known conflict, or has passed every check while its branch is behind its base. Open the card, press Merge when ready and confirm the head it names. Your own Connected Computer, with Board actions on, then watches that exact head with your GitHub sign-in and merges it once every check passes and its turn in the Merge queue comes; every merge check still applies. If the branch is behind its base, the Computer updates it with the base once and the request ends at the new head it reports, which may include that update. Review that new head and confirm a fresh request before anything merges. While it watches, the card offers Cancel Merge when ready. A new push, a failed check or six hours end the request without merging.

At its turn, the Computer reads GitHub again and checks every merge condition at the exact head. It waits for every check to finish, and merges nothing while the base branch is red, except a requested pull request a person marks as fixing the base. Only the pull request holding the turn is brought up to date with its base, once for each head.

When an automatic pull request’s new head is only a merge of the base branch’s tip at that moment, bringing nothing but the base branch’s own files and none of the files the pull request changed, its passed review carries over to the new head. Its checks must pass again at the new head, and every merge check, its tier and, while Holds are on, its Holds apply again at the head that merges. When the Computer cannot prove this from GitHub, the new head needs its own review before it merges. A person’s Merge when ready ends when the head changes, and nothing merges. The new request is a fresh merge request for the new head, made on the same card on the Board, confirming the head it names. After the new head the Computer reports following its base update, which may include that update, review that head, then confirm a fresh request. After any other push, the card offers Merge when ready, or Merge PR #<n> when that head is ready to merge now, once that head’s own review passes.

A check run that timed out is run once more. A numbered file, such as a migration or a decision record, whose number the base already uses, or a migration that leaves a gap, waits until it is renumbered; the queue never renames files. A turn passes on after 60 minutes and the pull request keeps its place. The Board shows each queue, each pull request’s place and why it waits, and a Merge queue stalled alarm when nothing has merged for two hours.

The queue showsNext
Turn runningRe-check every merge condition at the exact head.
Waiting for a turnWait for earlier turns to finish or pass on.
Base checks failedFix the base, or mark your requested pull request as fixing the base.
Waiting for base checksWait for a base commit’s checks to finish; if none runs, run the base checks on its tip.
Checks runningWait for the checks to finish at this head.
Checks failedFix the failed checks and push a new head for checks and review.
Checks cancelledA person must inspect the checks and decide what to run next.
Behind the baseWait for the new head, its checks and review; a requested item needs a new request.
Reviewing the new headWait for review and checks to pass at this exact head.
Number is takenRenumber the file and push a new head; the queue never renames files.
Migration numbers leave a gapRenumber the migration and push a new head.
Number ledger unavailableWait for a complete folder listing before the number check can pass.
Protected pathsA person must read the whole protected diff and approve its Hold.
Asks youInspect this head and request Merge when you are ready; all merge checks still apply.
Computer offlineReconnect the Computer; the next eligible item may take a turn meanwhile.
Turn passed after 60 minutesWait for another turn, then re-check every merge condition at the exact head.
Autonomy pausedAn Admin may resume Autonomy, or a person may request Merge.
Cannot mergeResolve conflicts or branch rules; a changed head or base allows another turn.
Conflicts with the baseResolve the conflicts on the card’s branch and push a new head, then merge it again; every merge check applies at the new head.
Issue link missingMake the first paragraph only closing references, or exactly Part of #<issue> for a partial delivery.
GitHub rate limitAfter the reset, read GitHub again before taking any action.
Call budget usedWhen the call budget resets, read GitHub again before taking any action.

Why an automatic merge stops

The Admin’s Computer watches each pull request it may merge on its own. When the watch ends without merging, nothing is merged, and the In review card says that Computer stopped watching it because of one of these reasons.

What changedThe card says it stopped because
The pull request or its issue changeda new head was pushed; it became a draft; the pull request closed; its issue closed; its issue left In review; it targets another base branch; its repository now has another name; its description does not close its issue; it is not the card’s own branch; another Computer holds this pull request
Checks or GitHuba check failed; no check passed at this head; GitHub cannot merge it cleanly; it conflicts with its base branch; its changed files could not be read; GitHub kept failing
Reviewthe new head needs its own review; a newer review failure at this head supersedes its pass; GitHub does not show the review-pass comment of the review Trailside recorded
It needs a personit changes a decision record, an AGENTS.md or the protected-paths rule, which waits for a person’s Merge; it changes a Workflow or the Recipe, which never merge on their own; it changes risk-tier rules other than exactly as an Admin’s open proposal, which never merges on its own; its tier, recomputed from its change, asks before merging; it waits at an owner gate; its tier is below the card’s tier floor here
The repositoryit comes from a fork; the repository is public; the base branch has no risk-tier rules
Autonomy or the ComputerAutonomy was paused; that Computer no longer holds an Autonomy instruction; its Autonomy instruction no longer covers this card; the service no longer names this card to that Computer; that Computer stopped reporting; the browser key that signed its instruction is no longer approved there; its accepted merge expired before it merged

A person can still inspect the pull request and request Merge; every merge check still applies. A pull request merged on its own shows in Done as merged automatically, with the Preset’s name, such as merged automatically (Balanced).

Risk tiers and agents The Board and Workflows