Merge policy and dark mode
By default a person merges every pull request. The merge policy says when the factory may merge on its own, and it belongs to the connected repository: connecting another repository starts at pr-only again.
The three policies
/merge-policy shows the policy and recent automatic merges. A maintainer sets it with /merge-policy settings: followed by one of:
pr-only
The default. The independently reviewed pull request waits for a person.
allow label:…|path:…
A pull request a rule covers may merge once review and CI pass. Separate up to 30 rules with |, for example allow label:docs|path:docs/.
- A label rule counts only for a label currently applied whose latest application was by a person other than the bot, so the agent cannot give itself an allowed label. Labels are case-sensitive. A label rule covers the whole pull request. Do not allow labels that untrusted people can apply.
- A path rule ending in
/is a directory prefix; otherwise it is an exact file. No globs. One path rule must cover every changed file, including the old name of a renamed file.
dark
Authorizes the end-to-end dark workflow for this repository: reviewed pull requests merge without a press.
When the factory merges by itself
Under allow or dark, a merge without a person needs three things at once: each run worked in its own sandbox, the reviewer was the built-in agent, and that reviewer's own report and its review on GitHub both say Looks good for the commit being merged. The built-in agent's loop runs outside the sandbox, so the code under review cannot write its verdict. When the reviewer is Claude Code, Codex, or OpenCode, which run inside the sandbox beside that code, the reviewed pull request is left for a person whatever the policy says, and the job's note says why.
Dark mode
/dark on builds new issues without anyone pressing Build: issues opened by the repository's owner, members, and collaborators, and issues filed from feedback that only the workspace's maintainers gave. Anyone else's issues get a Build card instead. Turning dark mode on does not change the merge policy: with pr-only, those builds stop at the reviewed pull request.
/dark off stops new builds and lets running jobs finish under the current policy. /dark stop stops them too. /dark status lists the jobs. Setting pr-only revokes merge authorization for running jobs at once.
The triage gate
With triage on, a new job waits as queued until a maintainer approves it, and a dismissed one never starts. Use it when you want dark mode's pickups, or work asked for in busy channels, to pass a person first. /triage turns it on and off. A workspace also runs at most three jobs at once; more wait as queued.
What every automatic merge needs
- A pull request the factory opened from this repository, on a factory branch, into the default branch.
- Mergeable, CI passed on its newest commit, nobody requesting changes, and the newest review on that commit starts with Looks good.
- Your branch protection and permissions. Do not give the GitHub App bypass rights.
- One merge at a time. Missing or incomplete GitHub data, malformed settings, or facts that changed fail closed.
Before each merge the Worker records an audit entry with the repository, pull request, head and base, and the exact rule that allowed it (or policy:dark), and it records the result afterwards. These appear as decisions in the job's trace.
After a merge
- Watch. The merged commit's CI and deploy are watched, and your health URL if one is set (three failed checks in a row fail it).
- Fix once. A failed deploy gets one fix, built and reviewed the same way, and merged only if the policy allows it.
- Revert. If no fix lands within two hours, or the fix fails too, the job opens reverts of what it merged and pings the owner.
A build with no merge after four hours is given up.