Merge policy — how a change reaches main
main is guarded by ruleset 18857412, enforcement active: no deletion, no force push, changes through a pull request merged by squash only, and five required checks. Its name, "main protected — merge queue", predates 2026-12-01, when its merge queue was removed (#3757): a pull request now merges as soon as its own required checks are green on its head. The checks are not strict (strict_required_status_checks_policy: false): a pull request need not be up to date with main, and nothing re-tests it on top of main before it lands.
So the semantic inter-PR conflict class — two PRs each green against main-at-branch-time that break main combined (observed 2026-07-12: #120×#121 did not compile combined) — is no longer stopped before the merge. It is caught after it: every push to main runs the light layer, a debounced push runs the heavy one (light runs, heavy main), and main-watch reruns, quarantines, files the red and proposes the revert. Before the merge, only the operator's admin landings — the train above all — run the gate on the integrated tree.
How it works
Arm auto-merge:
gh pr merge <n> --auto --squash(or "Enable auto-merge"). GitHub squash-merges the pull request once every required check is green on its head;--squashwithout--automerges at once if they already are. A session's pull request runs CI only when it carriesci:run(orci:full): without it, the requiredtestis red by policy (on demand).Three doors to a reviewed merge (review-and-merge): a green
revi/review; a local adversarial loop at the parity bar its page states, with the parked-gate admin merge; or the operator's direct-landing lane — local gate and train, CI as witness.The dormant queue machinery.
.github/workflows/merge-queue-gate.yml,merge-queue-churn.yml, themerge_groupbranches oftests.ymland the queue tests ofinternal/ciguardare dormant since 2026-12-01, removed after a clean week (#3757 step 9);task ci:queue-statsreadsmerge_groupruns, so it measures the queue's history only. The queue waitedcheck_response_timeout_minutes(60) for a required check before ejecting its entry; the dormant files still carry that number.A stalled runner pool stalls merges. Measured 2026-10-15 (SocialGouv/iterion#2377): a required job sat 70 minutes
queuedonarc-runnerswith no runner while its siblings ran. The pool had capacity — the Actions service was holding the job on a phantom runner, the ghost class.github/workflows/arc-canary.ymlexists to detect. Without a queue nothing ejects the pull request; its auto-merge waits for the check.How late the canary pages. The canary pages on a probe nothing picked up within
STALL_SECONDS(1500 s, 25 min,scripts/ci/arc-canary-verdict.sh), it probes every 30 minutes, and its watchdog gives the period it judges a 5-minute head start — so dispatch can stop being trustworthy up to 30 + 25 + 5 = 60 minutes before anyone is paged, and a human can then setCI_SELF_HOSTEDtooff(below).internal/ciguardholds the three numbers above to the ceiling this file claims.One probe per pool (#3701). Since the runners split into the small, large and heavy pools of #3694, the canary runs one probe job per pool, routed through that pool's
CI_*_RUNNERvariable, and judges each pool on its own job: a pool still waiting no longer reddens the others, and the heavy pool, saturated by design while the post-merge witness runs, pages after 90 minutes instead of 25 (CANARY_STALL_SECONDS; it carries no required check).scripts/ci/arc-canary-aggregate.shfolds the verdicts: any red pool pages. Once a pool's variable is set, its probe also checks that the pool runs the imageci/arc-runner/defines (scripts/ci/arc-runner-freshness.sh), since that pin lives outside this repository.Required checks (the fast, reliable ones):
test,vendor-check,golangci,brand,revi/review— andnats-conformanceonce an admin adds it to ruleset 18857412.raceandmongo-conformanceare held out of the ruleset while the experimental delivery mode lasts (below), and return to it when the mode ends.testandraceare AGGREGATOR CONTEXTS, not test-running jobs: the work lives in the gated legs (thetest-unitmatrix, thetest-e2ematrix,studio,test-native-exec, therace-shardmatrix) behind them, and each aggregator re-verifies every leg's conclusion underif: ${{ !cancelled() && <tap skip> }}— the run-state clause combined with the one verified skip (below), so an aggregator skips exactly the runs its legs skip and runs on every other one. The required NAMES stay stable — a PR that renamed one could never satisfy the ruleset — while work scales sideways (shards, new legs).test-e2epartitions Go's discovered top-level Test, Example and Fuzz corpus names into four shards; subtests follow their parent, and each shard runs under-racewith a 2400-second test timeout — the package's only run, sorace-shardleaves it out of its partition andtestspeaks for e2e under the detector (#3664). Reproduce one withpattern=$(CGO_ENABLED=1 GOFLAGS=-race go run -mod=vendor ./scripts/ci/testshards -tests ./e2e -n 4 -i 0)thenCGO_ENABLED=1 go test -race -mod=vendor -count=1 -run "$pattern" -timeout 2400s ./e2e, in the same devbox and build environment, underset -euo pipefail. Discovery has its own configurable-list-timeout(five minutes by default; CI passes ten minutes, the cold-racecompile on an ARC pod; zero disables it); its failure stops execution. Discovery owns a Unix process group through cancellation and output drainage, using the sharedITERION_PROC_WAIT_DELAYoverride; a descendant starting another session escapes that group. This new test-discovery mode refuses Windows, whose process helper cannot provide group ownership. Package sharding is unchanged.test-native-execis the one leg off the scale set:pkg/sandbox/kubernetes's native witnesses need a Bubblewrap mount ARC pods refuse, sotest-unitandrace-shardleave that package out and this job proves it, plain and under-race, onvars.CI_NATIVE_EXEC_RUNNER || 'ubuntu-latest'behind the same fork, dependency-bot andCI_SELF_HOSTEDguards; both aggregatorsneeds:it (#3662). Every gatinggo testskips the flake quarantine (scripts/ci/test-quarantine.tsv, one open ticket per row), which the nightlytest-quarantineworkflow runs instead (#3663). The legs themselves carry the tap skip and nothing else, a contractinternal/ciguard'sgatedJobsenforces: a leg any other condition skips reports Success while its work never ran, and a leg without the skip spends the heavy minutes the skip exists to save. The one exception is the heavy legs, which also skip a light run (below).fmt-checkis STAGED: it reports on the pull request and onmain, so the context is already there the day the ruleset names it, andinternal/ciguard'srequiredCheckscarries it. Editing that ruleset from the API needsPUT /repos/{owner}/{repo}/rulesets/{id}with the complete representation (name,target,enforcement,bypass_actors,conditions,rules); aPATCH, or aPUTmissing any of those, answers404— which reads exactly like a permission ceiling and is not one. Read the ruleset first and send it back with the one field changed. Thenats-conformancejob runs the JetStream schema-rollout integration tests (#481); until it is required, a regression there merges green. The slow container-image build is intentionally NOT required — it builds on merge tomainand would hold every PR 12 min. A required check carries noif:, with one verified exception: the Homebrew tap update (below) — which the two aggregators carry combined with their!cancelled()clause.Promoting a check to required is a two-file change. The seven advisory jobs —
nats-conformance,helm-lint,govulncheck,desktop-vet-linux,desktop-vet-cross,docs-links,docs-build— carryif: github.event_name != 'merge_group'in.github/workflows/tests.yml(dormant: nomerge_groupevent fires since 2026-12-01), and the heavycloud-e2eandmongo-conformancethe heavy literal, which skips a light pull request. (fmt-checkcarries neither: it is STAGED to become required — named ininternal/ciguard'srequiredChecks, not yet in the ruleset.) Adding a job to this ruleset without deleting its skip is worse than a stalled merge: a job skipped by a job-levelif:reports Success, so the required check is satisfied by a job that never ran — every pull request merges green on a check that did not execute. (A workflow-level filter is the opposite: the check never reports and the pull request never merges. Same word, opposite failure, and the silent one is the one this file's skips produce.) Nothing in the repository can catch it — the required list lives in the ruleset — so the two edits go together, by hand.An advisory check that nobody reads is not a check.
docsis deliberately not required — blocking a hotfix on a documentation build would be the wrong trade — but the consequence is that a broken publish ridesmainin silence: no merge waits on it, so every following merge inherits a redmainwithout having caused it. Measured 2026-09-10: one wrong file extension in a doc link (monaco.tsformonaco.tsx) kept the site from building across six consecutive commits and ~100 minutes, found only by reading the run list by hand..github/workflows/docs.ymlnow reports on itself — a failed publish onmainopens ONE issue labelledci:docs-build(later failures comment on it rather than pile up), and the next successful build closes it. The alert is a state, not a stream. Any other advisory job whose failure nobody would notice wants the same treatment rather than promotion to required.Every required check from
tests.ymlruns on self-hosted runners —test,vendor-check,golangciandbrandroute to the organisation'sarc-runnersscale set on a session pull request and onmain, and the heavyraceshards andmongo-conformanceroute there on a heavy push, the nightly, a dispatch andci:full, because the organisation's cap of 20 concurrent GitHub-hosted jobs, shared across every repository, is what makes a cycle slow. That scale set is outside this repository, and it was dead and unnoticed for over a year before 2026-09-08.Three runner classes route it (#3694), and every self-hosted job of
tests.ymlandmerge-queue-gate.ymlis classified into one by its measured peak. Each class ends itsruns-onexpression on its own repository variable,vars.CI_<CLASS>_RUNNER || 'arc-runners':class variable jobs small CI_SMALL_RUNNERthe testandraceaggregators,fmt-check,vendor-check,govulncheck,docs-build,desktop-vet-cross,brand,helm-lint, the dormant merge-queue-gate mirrorlarge CI_LARGE_RUNNERthe heavy jobs the required checks wait on: test-unit,golangci,studio; andnats-conformance, whose JetStream suite does not fit 500m under its 5-minute package boundheavy CI_HEAVY_RUNNERthe heavy layer no required check of a light pull request waits on, run after the merge (a ci:fullpull request'stestandracestill wait on it):race-shard,test-e2e,mongo-conformance,cloud-e2eThe variable names the class's scale set (the small one is
arc-runners-small, 500m / 1 Gi). Unset meansarc-runners: with a variable empty, its jobs route exactly as before, so setting it is the switch and clearing it is the rollback. The three spellings keep every clause — theCI_SELF_HOSTEDlever, the fork guard and the dependency-bot guard — andinternal/ciguard'sTestSelfHostedRoutingExpressionsAgreepins them byte for byte, one base with only the tail swapped, and which job carries which: a new job in those two files whoseruns-onnamesarc-runnersor a class variable is classified in that test, never silently accepted.test-native-execis pinned bynative_exec_runner_test.goto the same base with its ownCI_NATIVE_EXEC_RUNNERtail, whatever class its neighbours take: no class variable can send its Bubblewrap mount to an ARC pod. The other workflows onarc-runners(test-quarantine) are outside this guard and stay onarc-runners.arc-canaryprobesarc-runnersonly: once a class variable is set, a dead scale set behind it stalls that class unpaged — forCI_SMALL_RUNNER, the requiredtest,vendor-checkandbrand(and the unrequiredfmt-check), and withbrandthegolangciandfmt-checkthat wait behind it (#3738); forCI_LARGE_RUNNER, the requiredgolangciand, through its legs,test— and every merge waits on them; forCI_HEAVY_RUNNERno check of a light pull request, but aci:fullpull request's requiredtest(throughtest-e2e) and itsrace(throughrace-shard) wait too, and with them the admin-merge lane that requires them; so do the heavy jobs of a heavy push run and the nightly, and with them the next push run. Set a variable only once the canary (or a probe) covers its scale set (#3694). The repair is clearing that variable, orCI_SELF_HOSTED=off.If nobody can merge and the checks never report, this is the first thing to try. Set the repository variable
CI_SELF_HOSTEDtooff(Settings → Secrets and variables → Actions → Variables) and every job goes back to GitHub-hosted runners on the next run. A variable rather than an edit totests.yml, deliberately: repairing by merging does not work when merging is what is broken. Unset means on. Alerting on the scale set itself is still missing — SocialGouv/iterion#983. Since the mega-job split, one heavy run holds ~12 concurrent GitHub-hosted jobs on this lane (the gated legs plus the race-shard matrix): the escape hatch still works, but it now spends 12 of the org's 20 shared slots per run — one fork PR from another repository can starve it, so expect slowness, not silence.No required human approval (
required_approving_review_count: 0) — the bot factory's own adversarial review + the checks are the gate; a reviewer still merges deliberately.
Light runs, heavy main
Decided 2026-11-25, in two steps. Every pull request used to pay the whole suite twice — on its own run, then on its merge_group run — about 25 ARC jobs each on a scale set of ~40 concurrent pods; queue latency reached 4-14 hours and 8 of 12 merge-group runs were cancelled. #3683 took the heavy legs off the light pull request; the experimental delivery mode (#3691) took them out of the merge queue too, and runs them after the merge, on a debounced push (#3737); since 2026-12-01 there is no queue (#3757). So each layer gates where it pays:
| layer | pull request | light push to main | heavy push, nightly, dispatch |
|---|---|---|---|
test-unit, studio, test-native-exec, vendor-check, golangci, fmt-check | on demand: runs when labelled ci:run or ci:full, or opened by a bot or from a fork | runs | runs |
brand | runs | runs | runs |
race-shard, test-e2e (heavy legs) | skipped, unless labelled ci:full | skipped | runs |
mongo-conformance, cloud-e2e (heavy, no aggregator) | skipped, unless labelled ci:full | skipped | runs |
| other advisory jobs | on demand, like the light layer | runs | runs |
revi/review | runs | — | — |
A push to main is light only behind a green heavy run on main inside the last CI_HEAVY_EVERY_HOURS hours (a repository variable, 6 by default, at most 720), and heavy otherwise. The heavy-gate job, on push only, decides it from the run history (scripts/ci/heavy-gate.sh), and the newest run whose heavy legs ran decides: green means a push, schedule or dispatch run of this repository, created inside the window plus two hours (a rerun of an old run proves an old sha), whose latest attempt concluded success with every race-shard (N) job a success. A red heavy run keeps every push heavy until a green heavy run lands: it never buys a light window. Neither does a rerun (#3797). A green heavy run whose latest attempt is not its first makes the push heavy: a full rerun of an old light push runs heavy and proves that old sha, not the pushes after it. A rerun still in flight inside the window makes it heavy too. A flake rerun therefore costs one extra heavy run. When the gate cannot read the history or the window it warns and decides heavy; a gate that fails leaves no answer, and the push runs heavy too. CI_HEAVY_EVERY_HOURS=0 makes every push heavy. The heavy layer thus runs about as often as a nightly would, and only when main moved: GitHub delays this repository's crons by hours or drops them, so the cadence cannot rest on a schedule.
The nightly is tests.yml's own schedule (47 1 * * *), a backstop: when it fires, the full suite runs on main in a concurrency group of its own so no merge cancels it, and it counts as the window's heavy run. Every push to main shares one concurrency group that never cancels the run in progress: at most one push run is in flight and one pending, a newer push replacing the pending run, so each run judges every pull request merged since the last run started. A red light push run names a batch; a red heavy job names every batch since the last green heavy run. main-watch tells a heavy run from a light one by the same predicate: a green light run says nothing about the heavy layer (main-watch).
An automatic release tags only a commit a green heavy run proved, at most once a day (releases): a heavy regression is caught by the heavy run before any tag carries it. Both decisions read the same predicate, scripts/ci/heavy-gate.sh: a red heavy run keeps every push heavy and releases nothing, until a green heavy run lands.
test-unit stays on the pull request: it is the fast signal (sharded three ways, a 40-minute ceiling against the heavy legs' 50) and carries the freshness gate, gofmt and vet — the checks behind the queue's most frequent ejection, two pull requests regenerating the same artefact — a break now caught on main, where main-watch files it. test-native-exec stays too: one small job on a GitHub-hosted VM.
The aggregators stay honest. test and race read LIGHT_RUN, the negation of the heavy legs' own condition, evaluated by GitHub, and accept skipped from a heavy leg only when it is true — on a pull request without ci:full and on a light push; on a heavy push, the nightly, a dispatch and a ci:full pull request it is false, and a skipped heavy leg is as red as a failed one. internal/ciguard pins the condition byte for byte on the heavy legs, mongo-conformance, cloud-e2e and both aggregators, evaluates it per event, and runs each aggregator's step under the result.
To run the heavy jobs on a pull request — race-shard and test-e2e for a change to concurrency, the race-sensitive engine, or e2e itself; mongo-conformance for a change to anything Mongo-backed; cloud-e2e for a change to charts/ or the cloud stack — add the ci:full label: labelling it starts the run (on demand). A light pull request's green test and race never ran the heavy legs, so it is not admin-mergeable: an admin merge bypasses a required check, so it owes the heavy legs on the pull request (the parked gate and the fast lane say what they owe). Every admin landing — those two, the direct-landing lane and the extended train lane — also runs task ci:gate on the integrated tree: its members test:race, test:e2e and ci:mongo-conformance do the work of the heavy jobs a light pull request skips, and task check alone runs nothing under -race and no Mongo conformance.
A red main is owned, not waited out. The heavy layer finds its regressions after the merge, on a heavy push run or the nightly, and the light layer finds the combined-tree breaks no queue rebuilds any more. main-watch reruns the failed jobs once, quarantines a proven flake, files a regression with its suspects and, after four hours, proposes a revert a person merges or closes; the session that owns the culprit reverts or fixes forward. The mode's exit criteria (a regression rate, a flake count, an untriaged red main) are in the ADR; ending it puts race and mongo-conformance back in the ruleset — the ADR's other half, the heavy legs back in the queue, has no queue to return to.
Pull request CI on demand
Decided 2026-11-26 (#3738). A pull request run cost 105 runner-minutes and 19 jobs, about 33 times a day, and for a pull request the train lands it duplicated the local gate. So a session's pull request runs no CI unless it asks:
- The
ci:runlabel runs the light layer;ci:fullruns it with the heavy layer, as before. Both are repository labels:ci:runwas created for this policy, andci:full's description, which still asks for a push after labelling, changes when it lands. Labelling starts the run (labeledis a trigger oftests.yml): no push needed. Re-running an older run does not help — a rerun reads the labels of the event that started it. - A bot's pull request — its author's account is of type
Bot, which every GitHub App's is (renovate, tokenbureau, dependabot) — and a fork's run it automatically. - Everything else is red, on purpose. On an unlabelled session pull request every job but
brandskips, and the requiredtest(and the heldrace) fail with a message naming this policy and both ways out: addci:run, or land the pull request through the train (task ci:train,scripts/ci/train), which runs the gate locally. The train refuses a pull request that touches.github/,scripts/ci/,Taskfile.ymlordevbox.*(its own judge): for those, only the label serves. Never a silent skip: a skipped required check counts as a success, and a pull request nothing tested would be green — that red is what letsmainrun without a merge queue (#3757) without anything landing ungated by accident.
A label is a synchronize. labeled fires for every label (epic:…, renovate's dependencies a second after it opens), and its payload already carries the new label. Every pull request event — opened, synchronize, reopened, labeled — is judged the same way, on the labels the pull request carries, the author and the fork: an unrelated label reruns the light layer of a pull request that asked for CI and refuses again one that did not, and like any pull request run it cancels the run in progress on that head, which it redoes. Labels are rare (7 labeled events on the last 40 pull requests, none more than a minute after the first). Removing ci:run starts nothing: the last verdict stands until the next event on the pull request.
Label before pushing. A push followed by a label — or gh pr create --label, whose label lands beside its opened event — creates two runs on one head in no guaranteed order, each judging the labels of its own snapshot, and the later one cancels the other: if the unlabelled snapshot comes last, a pull request that asked for CI ends refused. So add ci:run BEFORE pushing, and the synchronize payload already carries it; open a new pull request first and label it once its opened run exists.
A stale refusal heals itself (#3807). When the refusal completes, the pr-ci-heal workflow (scripts/ci/prciheal) reruns the labelled run it cancelled. It acts only when all of the following hold:
- the run is a refusal by the policy;
- the pull request still carries
ci:runorci:full, on the same head; - nothing newer runs on that head;
- an older first attempt of that head was cancelled after its legs had started.
A rerun replays the labelled event, so it runs the light layer. It never reruns a second attempt. Every check run the rerun creates is newer than the refusal's, which has completed by then. So the newest check of each name, the one GitHub reads, is the rerun's, and the order the refusal relies on (below) holds. The refusal says so. If no rerun starts within minutes, push, or remove and re-add the label. To judge a run by hand, dispatch pr-ci-heal with its run_id; a dispatch is a dry run unless dry_run is off.
vendor-check, golangci and fmt-check wait for brand. On a refused pull request they skip, and a skipped job reports success the moment it is created; created at the run's start, before test — which is created only once its legs concluded — they would for that instant be the newest, green, checks of their names over the run before. Behind brand, whose check is pending from the run's start, they are created after test. "Re-run failed jobs" on a red brand therefore reruns the three jobs behind it too.
A push to main, the nightly and a dispatch keep their layers. What a requested run runs is the whole light layer. task ci:affected (#3739) selects the tests a diff can reach, but as an advisory local tool, not a gate: it picks which tests a session runs first, before the full gate (task check). Its static scan cannot see every way a test finds the repository root, so a selection is no proof that the tests it leaves out are unaffected, and CI does not use it. One blind spot is kept on purpose (#3891): a read whose path is a lone ../ outside a filepath.Join, such as os.ReadDir("../") or "../" + name, is unseen. Counting those literals failed the scan's guard on pull requests that read nothing there. Wiring it into CI needs a dynamic read audit first — every test binary traced against the declarations (#3739).
Before pushing, a session runs task check (the review-and-merge discipline), adds ci:run when it wants CI's witness — before the push, so the push's run carries it — or hands the pull request to the train.
main-watch: a red main is rerun, quarantined or reverted
Decided 2026-11-25 (#3692). A pull request reaches main without the heavy layer and without a rebuild on top of main, so main's own runs are the witness, and a deterministic workflow, .github/workflows/main-watch.yml (no agent), acts on every run of 🧪 Tests on main, push or schedule:
| what the run shows | what main-watch does |
|---|---|
| red on attempt 1 | reruns the failed jobs, once, only if it is main's newest run (push or nightly): a rerun joins the concurrency group and could cancel a newer run, so an older red run is left to the newer one, which main-watch names |
green on the rerun, every job that failed on attempt 1 a success on it: a flake | a flaky: ticket per failing test under epic #1410, or a comment on the open one (a person's flaky: ticket naming the package and the test counts), and one pull request adding the rows to scripts/ci/test-quarantine.tsv, auto-merge armed once with the squash method — never again once it lost its arming (disabled by a person or GitHub) |
red on the rerun, or green with a job that failed on attempt 1 not a success on it (skipped, absent, or anything else): a regression | one main red ticket naming the failing tests (attempt 1's, for a green rerun that did not pass them) and the pull requests merged since the last green run — for a heavy red, the last green heavy run; such a green rerun is no green verdict either, so it closes nothing, and its ticket is never revertable: no change is known to have turned main red |
| still red 4 h after the red run started | when the range since that green run is exactly one commit, the squash merge of one pull request: a revert proposal — a pull request reverting it that main-watch never arms, a person merges or closes it — and a comment on the original (never for a ticket a green rerun opened, a ticket with no recorded weight, nor a light episode a heavy run kept red); an open or merged proposal on the suspect's revert branch is recorded as it stands — open (the original told the ticket records it), merged by a person (the step done, the original told), closed unmerged (refused) — whether this ticket's earlier pass opened it and failed to record it, or an earlier ticket naming the same suspect did (its record says it was opened on an earlier pass, never that this pass opened it); that happens before any refusal reason is read (a heavy run that kept the light episode red since included), so no refusal is written beside it; only a ticket of one suspect, the only kind the step opens a proposal for, reads its suspect's revert branch that early, and an open proposal carrying main-watch's closing marker of a ticket's green run is never taken as the ticket's own (the revert step refuses, naming it) |
green, every job that failed on attempt 1 a success (a flake pass that fails still lets it close the episode); for a heavy episode, a green heavy run | every revert proposal of the episode still open closes (named on the ticket, or found by its suspect's main-watch/revert-N branch), then the main red ticket closes. main-watch closes a proposal only there, on the green run that closes a ticket: its own, or a later main red ticket naming its suspect among its suspects — so a proposal whose ticket a person closed first stays open until a person closes it, or until main-watch closes it on the green run that closes such a later ticket. Its closing comment, posted before the close, carries a marker naming the ticket, so an open proposal carrying the marker of another ticket (a person reopened it, or the close failed and that ticket was closed by hand) is left to a person. A marker of the same ticket is an earlier pass that commented: when the proposal's timeline shows no reopening after it, the close failed and the next pass closes it without a new comment; when it does, a person reopened what main-watch closed, and the proposal stays open, as its closing comment says, while the ticket's comment names it |
Failing tests are read from the failed jobs' logs (--- FAIL lines, and the tests a -timeout panic lists). A job that failed with no FAIL line is infrastructure: rerun only, never quarantined, never reverted. A job past its timeout-minutes concludes cancelled: the ticket names it as a hang (and the <pkg>.test the runner killed), never quarantined, never reverted. A failed job a rerun did not conclude success passed nothing: a rerun that comes back on the light layer skips the heavy legs (a skipped matrix is listed once, under its bare name), and the aggregators forgive a skipped leg there, so the run concludes green with the failure never run again. main-watch arms its quarantine pull requests with the squash method (a revert proposal is never armed): without a merge queue GitHub falls back to the merge method, which the squash-only ruleset refuses. A rerun cancelled by a newer push leaves no verdict: main-watch says so and lets the newer run judge main. A row is added only for a test of a job that skips the list (test-unit, test-e2e, race-shard, test-native-exec, read from tests.yml itself); a flake in another job gets its ticket and no row, and so does a flake in a skipping job whose runs-on never names the scale set (test-native-exec, on a VM for its Bubblewrap mount): the nightly witness runs on the scale set with checkout and Go only, so the row would redden it instead.
Heavy and light. A run is heavy when one of its race-shard (N) legs ran, scripts/ci/heavy-gate.sh's predicate (a light run lists race-shard once, skipped). A red episode is heavy when its red run was (for a green rerun that did not pass its failures, the attempt that failed), when a heavy run stayed red in it since, or when its ticket predates the weight. A heavy run stayed red when its rerun did, or when its green rerun left a failure unproven; a run red on its first attempt only, never rerun because a newer run judges main, is not confirmed and does not count. main-watch reads it from the marker it writes on the ticket, and from main's runs themselves while its run listing still holds that run, so a marker whose comment failed to post still counts. Only a green heavy run closes a heavy episode: a light green run skipped the legs that failed. Its suspects start from the last green heavy run, and the revert clock reads the newest heavy run, passing over the light runs since and over a red run whose jobs it cannot read (said in its log); a green run it cannot read stops the clock for that pass. A green run counts as a green verdict only when its rerun passed every job its first attempt failed. A green workflow_dispatch run of main counts too, as heavy-gate counts it a green heavy run (internal/ciguard ties the shard predicate and the events both read; heavy-gate does not check a rerun's proof); main-watch never judges a dispatch run, and a red one is no verdict.
Propose a revert, never arm it, and only on an unambiguous blame. One commit in the range does not prove it the culprit: an environment red, a date or an external service also turns main red — on 2026-12-01 a date bomb fell on a range holding only a Homebrew formula bump. So main-watch opens a revert pull request and never arms it: a person checks that the change can affect the failing tests, then merges or closes it. Suspects come from the (#N) squash subjects between the two runs' commits. main-watch proposes a revert only when that range holds exactly one pull request and no commit naming none (a release, a direct push), and when git, read again at the revert step, shows the range is exactly one commit, that pull request's merge commit — a (#N) is a claim any push can write. Otherwise it names every suspect on the ticket, says why, and hands the episode to a person — it never ranks suspects, since the last merge is not the likeliest culprit once a train lands several pull requests together. So a heavy red, whose range spans every merge since the last heavy run, almost never gets a proposal, while a light red, usually one pull request, can. A light episode a heavy run kept red gets none either (its ticket names the light failure's suspects, not the heavy one's), nor does a ticket that records no weight (its range may start from a light green run). A (#N) naming an issue (a commit landed outside a pull request) hands the revert to a person. main-watch never proposes reverting a revert or one of its own main-watch/* changes, proposes once per red episode, and hands a revert that does not apply to a person on the ticket.
Every judgement of a run ticks the revert clock, so each push or schedule run of 🧪 Tests completing on main moves it (main-watch's workflow_run admits those two; a dispatched 🧪 Tests run starts no main-watch run); the half-hour schedule, which GitHub delays or drops here, is a backstop that also judges main's newest run, so a missed event is caught. With no such run completing and no schedule firing, the clock waits for the next event or a dispatch of main-watch; markers in the tickets and branch names keyed by run and by pull request make a second judgement a no-op, and a flake pass that failed half-way is finished by the next, its sub-issue filing included; a quarantine pull request merged or closed gets nothing pushed. The schedule also reads every open main-watch/quarantine-run-* pull request of this repository: one never armed (its arming failed, and no later pass of its run comes) is armed. A quarantine pull request, or the open revert proposal a still-red main red ticket records once a person armed it, that lost its arming afterwards — a person or GitHub disables it — is told once per loss on the open tickets of the rows it adds — or, when it adds no row under an open ticket, on the pull request itself — or on the main red ticket, and never armed again. A marker counts only in an issue or comment written by github-actions[bot], and a person's flaky: ticket only when its author is an owner, member or collaborator: anyone can open an issue here. The job's GITHUB_TOKEN reruns, writes the tickets and comments on the pull requests; the token-bureau App token pushes the branches and opens the pull requests, whose checks a GITHUB_TOKEN pull request would never start. The job runs only for push and schedule runs of main from this repository, checks out main, interpolates nothing into a shell, and scripts/ci/mainwatch refuses any other run again; internal/ciguard/main_watch_test.go pins each line.
To see a decision without acting, dispatch main-watch with dry_run (the default) and a run_id — everything is read, every write printed. To stop it, disable the workflow (gh workflow disable main-watch.yml); to keep a reverted change, close its revert pull request and fix main.
The one verified skip: the Homebrew tap update
brew-update.yml opens one pull request a night, chore(brew): update tap to vX, that moves the version and sha256 values of Formula/iterion.rb and Cask/iterion-desktop.rb and nothing else. No heavy check's verdict depends on those values (internal/ciguard's tap tests rewrite them), and running the checks anyway cost ~57 minutes of compute per pass — on the pull request, then again in the queue, where the entry held one of the three build slots for ~25 minutes (test 24.1, race 22.3, mongo-conformance 4.0, golangci 3.2, fmt-check 1.8, vendor-check 1.0 min, measured on #2314).
So the gated legs (test-unit, test-e2e, studio, test-native-exec, race-shard; the heavy two combine it with the light-run clause), the aggregators test and race that speak for them (combined with their !cancelled() clause), golangci, vendor-check and fmt-check carry one condition, the only if: a required check may carry here: they skip a pull request whose title starts with chore(brew): update tap to (brew-tap-pr.sh puts the prefix in its commit subject too; the predicate's other half, a queue entry's commit message, is dormant with merge_group). A title is only a claim and a skipped job reports Success, so the claim is verified where nothing can skip the verification:
brand— required, never skipped, and already a reader of both tap files — runsscripts/ci/tap-entry-check.shwith the same predicate, evaluated (never re-matched: GitHub'sstartsWithignores case). It fails unless the diff touches the two tap files alone, matched exactly and with rename detection off, and moves only theirversionandsha256values, each from one valueupdate-brew-tap.shwrites to another (a dotted numeric version, a 64-hex digest) — a line added, a comment, adesc, a Ruby interpolation or an empty digest is refused: the pull request's test merge against its base. Itsmerge_groupbranch, which also required anALLGREENqueue, is dormant since 2026-12-01.internal/ciguardholds the pieces together: the expression byte for byte on each job,brandwithout it and withoutneeds:(a job whose dependency is skipped is skipped too, and passes), the verifier step unconditional (noif:,continue-on-error,shell:ordefaults:) and fed the same predicate, the tap pull request's title and commit subject starting with it.
The verdict that counts is the pull request's: the verifier judges the test merge against the base it was built on, and retargeting a pull request (an edited event) re-runs nothing — nothing judges it again before it merges, and an admin merge bypasses every check anyway. The workflow file is the pull request's own, so a pull request that also edits tests.yml can drop the verifier with the rest — the class every check here shares, which review and revi/review answer, not this check.
A code pull request titled like a tap update does not merge: its heavy checks skip and brand refuses it. A push to main evaluates the predicate false, so main still runs everything.
The tap pull request opens at most once a day, like the release it follows. brew-update.yml runs when release.yml (📦 Release) completes green for a tag — the moment that tag's CLI binaries are attached — so a release is tapped as soon as it can be. It taps the newest tag whose CLI artefacts are complete, so a tag whose build failed is passed over; a cask left behind is caught up once its release holds the desktop ZIP; and nothing walks the tap back — update-brew-tap.sh never writes a version below the one a file carries, and brew-tap-pr.sh opens a pull request only for what main does not carry yet, never from a branch whose files sit below main's (tap branches outlive their merged pull request here). A desktop-only release (its CLI build red) reaches the cask only through a dispatch of brew-update.yml with its tag, as long as the formula has not moved past that tag.
Direct pushes (admin bypass)
Repository admins bypass the ruleset (bypass_mode: always) — a hotfix can be pushed straight to main (e.g. un-break a red main fast), or a pull request merged with --admin before its required checks are green. Use it sparingly; a pull request with its checks green is the default path. Non-admins go through a pull request. For reviewed chantier work, the operator direct-landing lane generalises this bypass — and owes it what a hotfix does not: the train, the locally reproduced gate and the greppable trailers.
A parked gate (decided 2026-11-10)
revi/review can stay PENDING for days with nothing wrong with the pull request: iterion-forge-core[bot] posts a <!-- iterion:gate-paused --> comment naming a dated automatic resume and the upstream error. Measured on 2026-11-10 (#3132): a 429 [1310] Weekly/Monthly Limit Exhausted on the reviewer node parked the run for ~103 h while the other six required checks were green. Read that comment before concluding anything about the PR, and before pushing again — a push restarts the review sooner but lands on the same exhausted quota.
The first move is not this bypass. It is the one review-and-merge.md names: identify the blocked credential and lend a live one at runtime (iterion remote admin llm oauth set …, no redeploy), which needs the operator's explicit go. This bypass is for when that is unavailable or refused. Re-shaping the pools under pressure is a different act — deployment configuration (sovereign pools), decided outside an incident.
Then the operator (admin) may merge that pull request, bypassing the parked gate. What it owes:
- The other required checks green, read as a SET —
gh pr checks, not the one you are waiting on. The required set is exactlytest,vendor-check,golangci,brandandrevi/review(ruleset 18857412), and the bypass owes the heldraceandmongo-conformancegreen too, as it did before the experimental delivery mode held them out; the legs behind the two aggregators (test-unit (n),test-e2e (n),studio,test-native-exec,race-shard (n)) are deliberately not required and are where the work is. Queued, cancelled, missing or skipped is not success: a job skipped by a job-levelif:reports SUCCESS, so a required check that never ran satisfies the gate (tests.yml says so of the Homebrew-tap skip, whichtest,race,vendor-check,golangciandfmt-checkcarry). On a light pull requesttestandraceturn green with the heavy legs skipped andmongo-conformanceskipped: before the admin merge the pull request carries theci:fulllabel — labelling it starts the heavy run, no push needed (on demand) — and everyrace-shard (n),test-e2e (n)andmongo-conformancereadssuccesson its head, notskipped. - A local adversarial loop, and the trailer says which kind. At the bar the loop states — a round on the diff, each finding AND its proposed fix verified independently, a bounded closing round on the corrections — it carries the gate's own weight (operator arbitration, 2026-11-11), and nothing is being traded away. Below the bar it stands in with a measured residual: of 8 logged gate verdicts, 4 found a class the converged internal rounds had skirted, and those rounds were below it. That residual is assumed explicitly in the merge, and it is not assumable on a wide diff — there, reach the bar, wait for the window, or lend a credential, as the incident lane scopes itself the same way ("a wide refactor reckless", below).
- The checks belong to the head AND to the base being merged. A commit pushed after they ran invalidates them. Less obvious and more dangerous:
strict_required_status_checks_policyis false on this ruleset, so a green set computed against an oldermainstays green and GitHub neither re-runs nor flags it. Re-pushing refreshes the merge ref, but it does not converge here:mainadvances every 20–40 minutes on a busy day — the release bot pushes with no PR at all — so a CI cycle finishes behind the tip it was chasing. So build the integrated tree locally and run the gate on it: a fresh worktree onorigin/main,git merge --no-ffeach branch going in, thentask ci:gateon that tree — nottask checkalone, which runs nothing under-race. The gate prepares that tree before its first member — the map'sprepare, which fetches the chart's untracked sub-chart archives as CI does before its Go suites — and a step that fails is a refusal (exit 2), never a red member (#3892). That tests the merge ref, which the non-strict policy never does. Measured on 2026-11-10 with four branches:mainhad re-pinneddocs/merge-gate.mdin the reading golden and one branch changed the adjacent line (docs/merge-policy.md), so the hunks overlapped — green apart, conflicting combined. Since #3932 the golden pins by content and a doc edit no longer moves it; it conflicts only between two re-pins (a reader change against a release cut). Resolve such a conflict by taking main's golden (git checkout --oursin a rebase onto main,--theirsin a merge of main), thentask corpus:reading: content pins need no regeneration for the branch's doc edits. A branch that is itself a reader change re-pins its moved readings withcorpus-reading --write --accept-movedand checks they are its own; a--writeover the conflicted file judges the readings against HEAD's golden and refuses a moved one without that flag. Noterererewill offer a replay from the train merge that is not valid for a rebase. - The trailers, greppable —
Adversarial-Rounds:/Adversarial-Model:(the reviewer marked self when the loop was a self-review), plusGate-Bypass: revi/review parked (quota) — #<pr>in the squash body, since an ungreppable bypass is a bypass that did not happen. - Verify what landed, and stop a reviver. As for any admin merge:
git diff --statthe landed tree against what you reviewed, and checkiterion remote runs listfor a parked review run that a redelivery re-claimed after the close (the known gap).
What this bypass gives up, stated plainly. The required set ran on real CI, on the merge ref as of its run, the heavy legs included through ci:full — that is its strength over a locally reproduced gate. What it gives up is the reviewer's verdict, which the loop stands in for. Against current main it is no weaker than any pull request: none is rebuilt on main before it lands, and item 3's local gate gives this one more than most — the semantic inter-PR conflict class (regenerated artefacts such as the reading golden being the most frequent shape) is otherwise caught on main after the merge.
What it does not license: merging while another required check is red, skipped or unresolved; skipping the loop because the diff looks small; or reading the pause as a verdict. And bots/review-pr is the gate the tenant repositories that require its context lean on — a parked gate is a reason to lend it a credential, never to quietly lower what it guards.
The fast lane for an incident fix, and its exact procedure
Without a queue an incident fix waits behind nothing: once its required checks are green, gh pr merge <n> --squash merges it at once (--auto arms it to merge the moment they turn green). Under the queue, measured on 2026-09-06, a fix that closed a production incident class waited 4 h 42 behind the pull requests enqueued before it — the reason this lane existed; its procedure, a dequeue then --admin, is gone with the queue.
What an incident fix owes has not changed. It is opened with the ci:full label: labelling starts the heavy run on its head, no push needed (on demand). A light pull request's test and race are green with the heavy legs skipped, and an incident fix does not wait for the heavy run on main to prove it: every race-shard (n), test-e2e (n) and mongo-conformance reads success on the head, not skipped, beside every required check (test, vendor-check, golangci, brand, revi/review) and the held race. And the operator runs task ci:gate on the fix rebased onto current main, the integrated tree no pull request run tested: without it, a small fix is still reasonable, a wide refactor reckless, since nothing rebuilds it on main before it lands.
There is no automatic fast lane, by decision: a label-driven merge would skip the checks this list exists for. An admin merge (--admin) stays the hatch the parked gate opens, and a direct push the hotfix one. After any admin merge, verify what actually landed: no check ran on the merged tree.
git fetch origin main
git diff --stat <pr-head-sha> origin/main -- $(git diff --name-only "$(git merge-base <pr-head-sha> origin/main)" <pr-head-sha>)An empty diff means the merge carries the head you reviewed.
The autonomous pilot cannot use the hatch. An agent has no admin rights and must not be given them; an incident fix launched by a bot waits for its checks like everything else, or a human takes it through the hatch above.
Releases
A release is cut only after a green heavy run of 🧪 Tests on main, at most once a day, and only for the commit that run proved (#3741, decided 2026-11-26). Every tag is therefore proven by the heavy layer — race, e2e, mongo and cloud-e2e — and none is cut after each merge.
version.yml runs on workflow_run of 🧪 Tests completing on main. The job starts for a Tests run of this repository's main that succeeded and came from a push, the schedule or a dispatch — never a pull request's run. Then, in order, each step gating the next:
- The run was a green heavy run. The step asks
scripts/ci/heavy-gate.sh --judge-run <run> <attempt>about the very attempt that completed: green when it concludedsuccesswith everyrace-shard (N)job a success. A light run skips them (see light runs, heavy main), and a skipped leg proves nothing: the run skips with a notice naming the reason. Whatever triggered the heavy layer — a push, the schedule or a dispatch — the jobs say whether it ran. An attempt the script cannot read fails the step: no release on a guess. - At most one release a day. The newest
v*tag younger than 20 hours (MIN_TAG_AGE_HOURS) skips the run with a notice; the next green heavy run past the mark releases. 20 rather than 24, so a heavy run that comes a few hours earlier the next day still releases. - The proven commit only. The run moves to
main's tip and releases only when that tip is the run'shead_sha. A commit merged since was never judged by the heavy layer: the run skips with a notice naming both commits, and the next green heavy run releases. - Something to release since the last tag, then the major hold, then release-it.
"A green heavy run" has one definition, one jq function in scripts/ci/heavy-gate.sh read by both the heavy layer's debounce (#3737) and the release's judge mode: this repository's push, schedule or dispatch run, concluded success, every race-shard (N) job a success (the debounce also requires them inside its window).
A red heavy run releases nothing, and the release waits for the next green heavy run of main — after the fix lands and the heavy layer runs again, which can be hours later. Nothing retries on its own.
A workflow_dispatch is the operator's explicit request, for a fix that cannot wait: it releases main's tip as it finds it, without the heavy-run proof or the daily cap. The major hold still answers it. To release now: gh workflow run version.yml --repo SocialGouv/iterion --ref main (the version input defaults to minor; pass -f version=patch or an explicit X.Y.Z). A dispatch tags a commit no heavy run may have judged — dispatch only when waiting costs more than that. internal/ciguard/release_test.go pins the rule and runs each step's own text over crafted job listings, tag ages and moved tips.
The release is a direct push to main — release-it commits chore: release vX.Y.Z and its tag, the token-bureau App bypassing the ruleset. Under the queue each one discarded every merge group in flight (over 2026-09-01..28, 242 of 1096 queue builds); now it only moves main, and a release that lands during a train is the advance the extended train lane rules on.
Two release runs never overlap, whatever triggered them: version.yml has one concurrency group for every trigger, with queue: max and cancel-in-progress: false, and each run that releases moves to main's tip before release-it — a run queued behind a release finds the daily cap reached, or nothing new since the tag (every run checks for new commits first, since a dispatch's explicit increment would otherwise cut an empty release). Overlap is what must never happen — when a push is rejected, release-it rolls back by deleting the remote tag of the version it computed, and if the other run had just pushed that same version, that is the other run's tag. queue: max is there because a group otherwise keeps a single pending run and silently replaces it with the next one: the run following an ordinary Tests completion could replace a pending heavy-run release or dispatch.
The major hold
release-it cuts a major from a single feat!: commit, and an explicit dispatch increment overrides the bump its changelog recommends — so the first breaking change after a v7 tag would auto-cut v8, and a dispatched minor would ship the breaking changes under a 7.x minor. version.yml therefore asks a major hold before release-it; the decision lives in scripts/ci/release-major-hold.sh, exercised by internal/ciguard/release_major_hold_test.go:
- an automatic run — the release that follows a green heavy run — whose recommended version is the next major ends green with a notice naming the version: no tag is cut, main keeps carrying the breaking change;
- a dispatch of
patch,minor, an explicit same-major version or a blank input onmainis refused (red) while a major is pending; - only the dispatch of the exact
N+1.0.0cuts the major; the wordmajorand any higher version are refused with that message; - on a
release/vNmaintenance line, no major is ever cut. A dispatch releasespatch,minoror an explicitvN.x.y. It is refused when it asks for a major, when the line itself recommends one, or when the line's last release is not avN. An automatic run never releases a line (release line); - any other ref is refused.
On every ref, the hold also refuses two inputs:
- before any rule reads it, an input that is not blank,
patch,minor,majoror an explicitX.Y.Zwith at most eight digits per number and no leading zero; - an explicit version that is not above the branch's last release, because release-it would make it the base of every later bump.
Beyond those refusals, a run with no breaking change pending releases exactly as before. The release hold decides whether this run may tag. How the major is cut, and when, is a separate decision, not this hold's.
A hold also stops the reading golden's periodic re-pin: each cut re-pins internal/mdcode's committed-reading golden (cmd/corpus-reading --cut), and after about ten days without one the witness falls under its 75 % floor on every pull request. During a long hold, one pull request running task corpus:reading -- --write re-pins the corpus; a reading that moved on unchanged content still needs --accept-moved, and its review.
A rebuilt group's older runs are cancelled
Dormant since 2026-12-01 with the queue, removed after a clean week (#3757 step 9). GitHub rebuilds a queue group whenever its base moves — a push to main, an entry ahead failing or leaving — and leaves the discarded group's runs to finish. They hold arc-runners pods for a verdict nobody reads, which is the churn half of the queue's cost: over 2026-10-21/22, 14 of 38 completed merge_group runs were red and the five pull requests involved were rebuilt repeatedly, each rebuild leaving a full Tests run behind it.
.github/workflows/merge-queue-churn.yml cancels them, and only them. The branch of a queue entry is gh-readonly-queue/<base>/pr-<n>-<base sha>: the pr-<n> prefix survives a rebuild, the base sha is the generation. A run is cancelled when it carries the same prefix as the run doing the cancelling, on a different branch, is not completed, and was created strictly before it. So the newest generation kills the ones it replaced; every job of one generation shares its branch and cannot touch its siblings (the three race shards included); an equal timestamp cancels nothing, since a tie is not an order and the cost of guessing is a required check reported cancelled — a red entry.
Required check NAMES are untouched: the janitor is its own workflow, nothing requires it, and the ruleset never waits for it. It runs on ubuntu-latest on purpose — queued behind the pod shortage it exists to relieve, it would arrive after the runs it was meant to kill — with actions: write as its only scope and no checkout. internal/ciguard/queue_churn_test.go runs the shipped jq filter against crafted run listings, in both list orders.
Measuring the queue
It measures the queue's history: no merge_group run exists since 2026-12-01. devbox run -- task ci:queue-stats -- --since 2026-09-22 --until 2026-09-28 (scripts/diagnostics/queue-stats.sh, read-only, needs an authenticated gh) answers the three questions a queue change has to be judged on, over a fixed window in UTC so two periods compare:
- how long a merge takes — minutes from a pull request's first enqueue to its merge, p50/p75/p90/max, per author (the brew-tap bot's PRs are counted apart), for the pull requests the queue merged; the ones merged directly — the admin bypass, a dequeue followed by an admin merge included — are counted apart, since each is a push to
main. Also the removals from the queue that were not a merge (failed_checks,merge_conflict,manual), among the pull requests merged in the window; - what the window paid for — the Tests runs on
merge_group, and for every rebuild, its cause, read from the new group's base — the shagh-readonly-queue/main/pr-<n>-<base sha>carries: a base that moved to a direct push tomain(a release, a direct merge, any other push) IS that push, whatever the delay, while an unchanged base, a queue merge or a speculative queue branch is the queue itself (an entry ahead failed or left, a dequeue and a re-enqueue) — and the state of the build it replaced: for a push, whether it was already green or still running when the push hit (GitHub does not cancel the run of a group it discards — the janitor below does, so a discarded build now reads ascancelledrather than as a full run nobody waited for; a build that had already finished red had ejected its pull request, so its rebuild is a re-enqueue, counted as the queue's). Queue builds discarded by a direct push is the line the once-a-day release above exists to shrink. The attribution isqueue-rebuild-cause.awk, its own program so a harness can run it:internal/ciguard/queue_stats_test.goholds each of its rules to a crafted table — the previous rule blamed a push only within 90 seconds of the rebuild, and GitHub rebuilt #1967's group 114 seconds after v3.217.0's commit, so the discarded build was counted as the queue's own churn. Runs are read day by day and checked against the count the API announces: a query answers at most 1000 runs, and paging has returned a run twice; - what failed the queue — for each failed build, the failing jobs and steps and, unless
--no-logs, the--- FAIL:tests in their logs, ranked. A build is named after the pull request at the tail of its group, so a failure that an entry ahead caused repeats in every group behind it. A test that fails the queue once and never again is a flake candidate; one that fails it with a generated-file freshness message is two PRs editing the same generated artefact.
For the bot factory
A bot opens a PR → the operator/agent reviews (the adversarial in-loop review already ran during the bot loop) → gh pr merge <n> --auto --squash arms it, and GitHub squash-merges it once its own required checks are green. Overlapping bot PRs (e.g. two per-run store features) are not rebuilt combined: two that break main together turn it red after the second merge, and main-watch files it.
scripts/merge-guard.sh <n> is a local pre-flight: it rebases the PR onto current main, runs the deterministic gates on that combined tree and merges only if green (--no-merge only reports) — the rebuild the queue used to automate.
Prerequisite that made the queue viable
The race job was flaky (timing ceilings too tight under the CI -race full-parallel load). A flaky required check stalled the whole queue, so the dispatcher test deadlines were raised to generous ceilings (commit 5368500f5) before enabling the queue in 2026-07.
Reverting
Restoring the merge queue is a PUT of ruleset 18857412 with its merge_queue rule back, in the complete representation (above); the dormant machinery answers it until #3757 step 9 removes it. gh api -X DELETE repos/SocialGouv/iterion/rulesets/18857412 drops the whole ruleset.
A job reports inotify “too many open files” (#1198)
inotify_init can report EMFILE for the process descriptor limit or the real user's inotify-instance limit. The latter can be shared by several runner containers with the same host UID. Read the job's Watcher resource limits step and the failing process's watcher resources error before choosing a remedy. The error retains its original errno and reports the real UID, descriptor ceilings, visible process descriptors, an ordinary file-open observation and the inotify sysctls. It neither changes a limit nor skips the watcher test. Counts are observations at failure time, not an atomic inventory of every container on the node.
An ordinary file opening successfully while inotify initialization returns EMFILE, with descriptors well below nofile_soft, points toward the per-user instance ceiling. A failed ordinary open and a reached descriptor ceiling point toward process FD exhaustion. Confirm with the runner/node operator before changing shared limits or concurrency. The configuration in SocialGouv/infra-apps/arc-runners/values.yaml controls the shared scale set; the repository's CI_SELF_HOSTED=off switch remains the emergency fallback, not a silent automatic response to this error.
Bounded reproduction on the ARC worker
On 2026-09-13 an ARC CI job reported real UID 1001, an identity UID map, RLIMIT_NOFILE=1048576, max_user_instances=128 and max_user_watches=228254. A separate diagnostic Job on worker-nodepool-node-e6dab0 (Linux 5.15.0-134-generic) reproduced that 128-instance boundary under the previously checked unused UID 2147480000:
{"uid":2147480000,"max_user_instances":128,"nofile":[1048576,1048576],"child":{"held":128,"errno":24},"other_process_inotify_errno":24,"ordinary_fd":"open_ok"}One process held all 128 instances; the next call in it and a second process failed with EMFILE, while /dev/null still opened. Closing the descriptors immediately restored capacity. The Job added no watches, changed no sysctl and was deleted after completion. No runner remained during inspection, so this is a reproduction of the shared resource boundary, not a measurement of the historical CI peak.
The exact Job manifest is retained for operators. Before an approved repeat, choose the node explicitly and verify the dedicated UID has no processes/inotify instances on that node; never substitute the runner UID. The script refuses ceilings above 512, has no retries, and is bounded by a 120-second deadline and 128 MiB memory limit. It requires Linux and the pinned image's Python 3. It is an operator diagnostic, not a CI step or an automatically deployed resource.
A proposed configurable floor is tracked separately in the infrastructure PR linked from #1198. Keep the ticket open until approved activation and representative concurrent CI runs demonstrate the result.
The operator direct-landing lane (decided 2026-10-22)
Operator-led chantiers may land without a pull request: a train (the branch rebased onto origin/main, the full required-check set reproduced locally ON THE INTEGRATED TREE), then a direct push to main. The lane's contract — the exhaustive local gate (task ci:gate), the converged adversarial loop, the Adversarial-Rounds: / Adversarial-Model: / Landing-Train: trailers, the post-hoc CI witness, the red-main priority and the duty to warn sessions with unpushed branches — lives in the review-and-merge page. Every existing PR keeps its revi/review blocking gate — save where a parked gate opens the narrower admin merge, or a burst lands end to end; the lane is the admin bypass generalised from hotfixes to reviewed chantier work, and its bypass is greppable in the trailers by design.
One lane per burst (decided 2026-11-24)
A burst — several pull requests landing in the same stretch — takes one lane, chosen up front, and keeps it to the end:
- each pull request on its own checks: auto-merge armed (
gh pr merge <n> --auto --squash), each merging when its own required checks are green, none admin-merged while the burst lasts; or - the train end to end: one train of the exact set on the current
main, then land that set;landdisarms the set's auto-merge before it pushes, and refuses a pull request without review (greenrevi/review, or a loop in its description).
Mixing them moves main under the train: a pull request of the burst that auto-merges meanwhile is an advance of main, and the train runs again. Under the queue the cost was worse — measured on 2026-11-24, 22 in-flight merge_group builds discarded by direct merges in a day, 18 of them from one burst's 17 direct merges.
The extended train lane (decided 2026-11-25)
For the operator's bursts, the direct-landing lane end to end takes this shape, and lands the pull requests without waiting for their CI:
- Auto-merge disarmed.
landdisarms an armed auto-merge of the set before it pushes, since GitHub would otherwise merge that pull request mid-landing. - One train of the exact burst on current
main. A fresh worktree onorigin/main, each pull request merged in, andtask ci:gateon that tree — nottask checkalone: a pull request's own run is light since #3683, so its green never ranrace-shardortest-e2e, and the gate'stest:raceandtest:e2emembers are where that work runs. A red train is fixed on the train. - Admin landing of the set exactly as trained; an advance of
mainmeanwhile means a new train. Achore: releasecommit the release bot pushes during the landing is not such an advance only whengit show --statlistsCHANGELOG.md,charts/iterion/Chart.yaml,package.jsonand the reading golden alone (the cut may move any of its reading-golden lines: it re-pins the whole corpus). A cut that realigns a"next"floor — a Go pin underpkg/, or a bot or example manifest; see release — moves code, and the pull requests not yet landed are trained again on it. The landing carries the lane's trailers (Adversarial-Rounds:,Adversarial-Model:,Landing-Train:). - CI on
mainis the witness, read as for the direct-landing lane: a red witness outranks other work, and main-watch handles it as any red push run.
A pull request lands reviewed: task ci:train -- land refuses, before it pushes or disarms anything, one whose gated head has neither a green revi/review (its newest status there) nor a recorded local loop at the parity bar (Adversarial-Rounds: of 2 or more with Adversarial-Model:, in its description: a commit trailer does not count, and a single round is below the bar). The evidence is read again, always on the gated head, before the train pushes its resolution onto a branch and right before each merge: evidence that no longer holds stops the landing there — the record gone with no Revi green, or Revi no longer green with no record. A Revi failure does not stop a pull request whose description still records a loop. The pull request itself is read again at both points — open, not a draft, on main, at the head the landing expects, auto-merge off — so the train never writes a branch for a pull request that no longer lands. A push of the resolution that git reports failed is read back: a branch that carries it is recorded as updated. -override-review "<reason>", given once, lands it anyway and writes review: OVERRIDE (<reason>) into its Landing-Train: line and the comment on the pull request; a recorded loop writes its rounds and model there. A Revi finding that arrives after the landing is fixed forward, in a new pull request.
