Before merge — the required loop, and how a change reaches main
Every change lands through a pull request whose revi/review gate is green. The documented exceptions: the admin bypass (a direct push to main), the operator direct-landing lane and the admin merge a parked gate opens (§ below), and the release bot, whose chore: release commits land on main with no PR and no gate. So a change is reviewed through one of three doors: a green revi/review; a local loop at the parity bar (the parked-gate merge); or the direct-landing lane — local gate and train, CI as witness. The loop is:
local adversarial round → fix → re-attack the fix → push → /revi → green
- Run a local adversarial round on the diff BEFORE pushing. A subagent whose posture is to break the change, not to bless it; every finding and every fix it proposes verified before a line is written. Protocol: adversarial-review-loop.md. Measured on this repo: five consecutive gate verdicts at ≥ 1 medium on a fresh line (~6 h of queue) against one 15-minute local round followed by a first verdict at 0 findings. That page carries the round budget — a ceiling, never a target: what decides another round is whether the last one still returned verified high or critical findings.
- The gate closes the loop; the local round never does. A sterile local round means "time to push", not "done". Revi's
questionschannel is non-blocking, but each question gets a doc fix or a written refusal — never silence. Symmetrically: at the third verdict with findings on the same PR, stop pushing — what is left is local-round work. - The developer fixes the findings — by hand, or through another local round. Do not comment
/billy: see the pause. - Every commit that ships reviewed work says what the review cost.
Adversarial-Rounds:andAdversarial-Model:trailers,0 (trivial: …)written explicitly when nobody attacked the change — format, what survives the squash, and rationale in adversarial-review-loop.md.
Before pushing: task check; CI needs the ci:run label (on demand).
The operator direct-landing lane (decided 2026-10-22)
For operator-led chantiers where CI's wall clock is the bottleneck, the operator (admin) may land a change without a PR, by push to main. This amends the sentence above for that lane only — every existing PR keeps revi/review as its blocking gate, save where a parked gate opens the admin merge or a burst lands end to end (both § below). The lane's blocking proof replaces the PR's:
- The gate, locally reproduced. The full required-check set a workflow job can express — everything but
revi/review, which item 2 replaces — runs locally. Its definition istask ci:gate, over the checked-in map.github/ci-gate-map.yaml: one row pertests.ymljob, keyed by job id, read by the runner AND byinternal/ciguard'sTestTheCIGateMapIsTotalAndHonest. Exit codes are read per member, never piped, and the runner printsran N of Nagainst its own plan — two members of three cannot read as three. The map'spreparereadies the tree first, as CI does (the chart archives); a failed step refuses, exit 2 (#3892). Every required and staged context is COVERED — by a member, or, for the two pure aggregators, by every leg's — so exit 3 (green members, incomplete coverage) is no longer the standing answer. What a 0 does NOT claim: the verdict NAMES the reached rows that arepartial(brand, plus the four legstestandracespeak for), because a member is not an equivalence and each row'sresidualsays what it leaves to CI. A verdict of 0 satisfies this item and nothing else: items 2 to 5 are still owed, a gate short of 0 measures the distance, never a proof you may land, and a green gate reads "every member passed", never "CI can find nothing this did not run". - A converged local adversarial loop. Per the loop: rounds until no unassumed high/critical finding stands, the fixes re-attacked, the budget respected.
- The train. The branch rebases onto
origin/maininto an integration branch and the gate runs ON THE INTEGRATED TREE — the rebuild on currentmainno pull request gets. A red train is fixed on the train, never pushed. - The trailers, greppable.
Adversarial-Rounds:/Adversarial-Model:as everywhere, plusLanding-Train:naming the train and its evidence directory — a bypass that cannot be grepped is a bypass that did not happen. - The witnesses, post-hoc. CI fires on every push to
main; a cancelled or missing witness run is NOT success in the landing record; a redmainoutranks all other work. A push run is heavy unless a green heavy run landed inCI_HEAVY_EVERY_HOURS(6 h) (ADR-173). Never read your sha's own run: one concurrency group keeps the run in progress, a newer push replaces the pending one. The witness is the first run that completes on amaintip holding your commit (git merge-base --is-ancestor <sha> <tip>), a heavy one for the heavy legs.
A duty: before a wave's first push, warn the sessions with unpushed branches (each main advance costs a rebase).
One lane per burst (decided 2026-11-24): a burst of PRs picks ONE lane up front — each PR auto-merged on its own checks, or the extended train lane (train the exact set on current main, land each reviewed PR without its CI; a later Revi finding is fixed forward). Any admin landing runs task ci:gate, not task check alone: a light PR never ran race-shard or test-e2e.
How a pull request lands
main has no merge queue since 2026-12-01 (#3757). gh pr merge <n> --auto --squash arms auto-merge; GitHub squashes the PR once its OWN required checks are green — not strict, so nothing re-tests it on top of main. Required: test, vendor-check, golangci, brand, revi/review; race and mongo-conformance are held out by ADR-173 (test, race aggregate — the work runs in the gated legs). nats-conformance stays advisory until an admin adds it to ruleset 18857412; fmt-check reports but is not required yet (staged — internal/ciguard's requiredChecks). A chore(brew): update tap to … PR skips the heavy jobs; brand refuses it unless it moves only the tap's version and sha256 (the one verified skip). After the merge main's runs are the witness — light on each push, heavy debounced — and main-watch reruns, quarantines a flake, files a red and proposes a revert it never arms. Details: ../merge-policy.md.
The Revi merge gate
Revi (bots/review-pr) posts a deterministic revi/review commit status on a PR head — success when 0 findings meet gate_severity (default high), else failure. Add that context to another repository's required checks to make its verdict block the merge; it is already required here by ruleset 18857412. The verdict is a COUNT computed in the bot, never an LLM judgment; the review comments stay non-blocking advice. Pairs with the webhook review_on_sync opt-in (each push re-reviewed, so the status tracks the fixed head: it makes /revi a loop and stays on here) and Revi's falsifiability questions channel (non-blocking assumptions, never gate). The forge-agnostic write path is forge.CommitStatusClient (../../pkg/forge/status.go); the endpoint posts it after the review (../../pkg/server/forge_publish.go). See ../merge-gate.md — which also covers the two bots sharing one context on the same PR, and the per-repo opt-in zero-touch lane (auto_fix_on_gate_failure) where a red gate launches the repo's fixer once per head sha, off by default so the developer keeps the choice.
GitHub workflow delivery preflight — Billy checks the runtime token’s actual workflows:write proof before analyzing a workflow-changing diff; Vetty checks it before pushing an ALIGNMENT that touches that path, and holds hold_delivery_permission instead of pushing. The hold needs an ANSWERED refusal: FORGE_PERMISSION_DENIED is a credential configuration plus a new launch (approve the App's delivery permissions, or reissue a classic token with the workflow scope), while a preflight that did not answer ends the run FORGE_PREFLIGHT_UNAVAILABLE publishing no comment and no verdict — the cure is the one the run's reason names (a relaunch where the service went silent, the configuration gap where it names one), and what the PR carries is the server's reconciler closing the launch's own gate claim. Installation grants alone are not proof. See ../../revi-billy-loop.md.
A parked gate is a rerouting signal, not a wait
When revi/review parks on provider quota (a gate-paused comment carrying the retry instant and, when the provider said so, the window it hit), the pull request is fine — the credential is not. Waiting out the window is the last resort, never the plan:
- Identify the blocked credential.
iterion remote admin llm oauthanditerion remote admin llm api-keyslist what the deployment draws on. A stored dated reading stops being trusted at the earlier of its reset instant andITERION_USAGE_CAP_TRUST_WINDOW(three hours by default after it was observed); a refusal with no reset instant (auth, rate, spend) is trusted for its escalating rest instead — an hour at first, up to six (usage caps). Either way a provider that reopened a window early self-heals within that bound. To cut the wait when the provider's dashboard disagrees with the ledger, forget the credential's readings:iterion remote admin usage-readings clear <fingerprint>; the next run re-measures the windows itself. - Lend a live credential to the deployment — no redeploy needed. A forfait:
iterion remote admin llm oauth set <claude_code|codex> --rank <n> --from-file <credentials.json|auth.json>; a provider key:iterion remote admin llm api-keys create --provider <p> --name <n> --from-env <VAR>. Any credential write to a shared deployment waits for the operator's explicit go, with the exact command in the question. - Run the loop, and know what it buys. The local adversarial loop on a forfait you hold carries the gate's own weight once it reaches the bar that page states — a round on the diff, each finding AND its proposed fix verified independently, a bounded closing round on the corrections (operator arbitration, 2026-11-11). At the bar the merge does not wait for
revi/review; below it the residual is assumed explicitly, andAdversarial-Rounds:is where a reader sees which of the two happened.revi/reviewstays a required context either way, so the merge is still the admin one, owing the four other required checks green underci:fullandtask ci:gate: its conditions and what it gives up are in the parked gate. Steps 1 and 2 stay the first moves; this is for when they are unavailable or refused.
Billy, and the release path
Billy is paused — the zero-touch fixer lane, and its re-arm · Release and changelog.
