Skip to content

Merge policies

By the end of this chapter you will know how to inspect a repository’s merge policies, adjust a policy safely in Git, and promote a shadow policy to live.

A MergePolicy defines a class of change the factory’s merge gate can evaluate, and each Repository binds the policies it uses with a mode (live, shadow, or disabled). Every served repository starts with Maku’s shipped catalog (docs-links, deps-patch, and docs) in shadow mode, so humans review every pull request until a maintainer explicitly promotes a policy.

Full field schemas, guardrails, and worked YAML recipes live in Merge policies reference and Reference › Web UI reference and settings.

Inspect policies on the Policies page

Open Policies (/policies) in the rooms web UI to see every policy bound to your repositories, its current mode, its conditions, and the shadow evidence it has collected.

Policies page showing, per repository, pull requests merged on their own, would-have-merged shadow verdicts, and the policy catalog, in Day and Night themes. Policies page showing, per repository, pull requests merged on their own, would-have-merged shadow verdicts, and the policy catalog, in Day and Night themes.
The Policies page: compare shadow evidence per repository and the catalog’s conditions before promoting a policy.

Change a policy safely

Policies are managed as code — either in your cluster’s Repository / MergePolicy manifests or, once policyManagement.stage: manage is active, in .github/agent-factory.yaml inside the target repository:

  1. Edit the binding or policy. Narrow allowedFiles, tighten line/file caps, or disable a catalog policy (mode: disabled). Central mergeGuardrails always cap what a repository binding can ask for.
  2. Validate before pushing. Use the Policies editor’s check button or run maku config validate --config FILE MANIFEST... or maku policy validate locally so typos or guardrail violations fail fast before review. maku policy explain owner/name POLICY then shows what a live policy merges and what blocks its promotion.
  3. Simulate against past pull requests. Check how the edited policy would have classified recent pull requests before switching it on.
  4. Open a pull request. A maintainer reviews and merges the policy change; agents are forbidden from modifying policy files or protected paths.

Promote a policy

A shadow policy becomes live through a pull request that changes its binding’s mode from shadow to live.

  1. Check evidence on the Policies page. A policy is eligible once it has enough agreed shadow decisions (pull requests the gate would have merged that a maintainer merged unchanged at the same head) and the repository has passed a rollback drill.
  2. Use Promote to live (or open the PR by hand). When eligible and Factory.spec.gitops points at the repository’s manifest, the Policies page offers Promote to live, which opens a pull request containing the one-line mode: live diff.
  3. Review and merge the pull request. Nothing merges a promotion automatically. Once merged, unattended merges under that policy are guarded by the daily cap, required CI checks, the post-merge monitor, and the regression breaker.

See Merge policies reference › Promotion for every eligibility threshold and rollback step.

Holds, agreed, signal-checked

A policy decides one thing: whether a pull request holds, meaning every row of the gate passes on one head and the change stays inside the policy. Holding does not mean the change is right. What can check that is a correctness signal: something independent of the author that checks what the change means. After a merge, the monitor hears only loud trouble: a merge it watched to the end with no revert, no regression and no follow-up is quiet, not right. Every count on the Policies pages, in maku policy and in the comments names who judged it: a signal, a maintainer, or nobody.

WordMeansDoes not meanWire name, unchanged
holdsEvery row of the gate passes on one head: the change is inside the policyThe change is rightdecision=arm, shadow_would_arm
correctness signalSomething independent of the author that checks what the change means, from the closed list belowA green checksignal=
signal-checkedA decision a correctness signal judged, and passedProven correctsignal=<kind>:ok
uncheckedA decision nothing judged for meaning. Also a policy with no correctness signalWrongsignal=none
agreedA maintainer merged a shadow decision unchanged, at the judged headThe maintainer read every lineclean, mergedUnchanged
quietThe monitor’s window ended with no revert, no regression, no follow-upRightverdict=healthy
regressionA monitor signal turned bad inside the windowEvery bad mergeverdict=regression
wrong callA merge under a policy later found wrongA drillbad

“Verified” is never shown alone: merged_verified reads “main stayed green”, and the monitor’s verified reads “RunLore: resolved”.

    flowchart TD
  PR["Pull request, head reported"] --> BASE{"Fixed base<br/>CI, fence"}
  BASE -- red --> H["Waits for a maintainer"]
  BASE -- ok --> HOLDS{"A policy holds?<br/>files, caps, reviewer, holdouts"}
  HOLDS -- no --> H
  HOLDS -- yes --> SIG{"Correctness signal?"}
  SIG -- "shape, oracle<br/>or contract: ok" --> CHK["signal-checked"]
  SIG -- none --> UNC["unchecked"]
  CHK --> MODE{"Mode"}
  UNC --> MODE
  MODE -- shadow --> REC["Would-merge record"]
  MODE -- live --> MERGE["Merged by the policy"]
  REC --> HUM{"Maintainer merges it unchanged?"}
  HUM -- yes --> AGREED["agreed"]
  MERGE --> MON{"Monitor window"}
  MON -- "revert, regression, follow-up" --> WRONG["wrong call"]
  MON -- nothing --> QUIET["quiet"]
  AGREED --> EV["Evidence"]
  QUIET --> EV
  WRONG --> EV
  WRONG --> BRK["Breaker: the policy goes back to a maintainer"]
  EV --> PROMO["Promotion, by a maintainer's merge"]
  

The correctness-signals design also describes rules this page does not: an unchecked policy kept in shadow, an audit of live prose, the factory/wrong label and sensitive kinds. The gate does not enforce them yet, and no page or comment promises them.

What checks the meaning

The signal comes from fields the policy already has. Nobody declares it twice.

SignalDerived fromEstablishesLeaves open
Determining shapediffShape: links-only, semver-patch, semver-minor (and docs-links’ built-in shape)Every changed line has one mechanical meaningThe target: the new page’s words, the upstream release
OracleoracleA detector outside the pull request named the defect, and the diff removes exactly thatThe detector’s own errors
Contractrequires holds both plan and tests, and the task ran under a test contractA test written before the change, from a plan a maintainer approved, is red at the base and green at the headBehaviour the plan did not name

These are bounds or supporting evidence, never a signal:

WhatWhy not
allowedFiles, caps, modifyOnly, protectedFilesThey say where and how much, not what
diffShape: added-entryStructure only: the entry’s words are free
holdoutChecks, required CIThey say something still works, and can pass without reading the changed lines
A reviewer’s verdictA veto, not an approval
Monitor: main’s CI, Flux, RunLore’s resolvedLoud breakage only; a silenced alert also resolves

A policy whose every allowedFiles pattern ends in \.md$, \.mdx?$, \.rst$, \.txt$ or \.adoc$ is prose: nothing checks its meaning, and the pages say so.

Each decision that holds records its signal: signal=links-only:ok, signal=contract:ok, or signal=none. A refusal records none. The same one sentence about a policy, built by one function, appears on its Policies page, in maku policy explain, in the promotion pull request and in the decision comments. For docs-links bound live with a holdout, under the repository’s default verifyFor and revertWindow:

Merges without you when an agent changes only link targets in Markdown, at most 20 lines, and Check the documentation links 🔗 passes. Meaning checked by the links-only shape: every changed line is a link target on the same host. Not checked: what the new page says. After the merge Maku watches main for 30 minutes and opens a revert on red. Undo: factory/revert within 7 days.

Reference and recipes

  • Merge policies reference: catalog definitions, field tiers, worked examples, repository binding recipes, CLI simulation/promotion workflows, decision reasons, rollback, and troubleshooting.
  • The merge gate: fixed base, decision records, adopted classes, and post-merge monitoring.