Why is CI consistently jammed, and what can we do about it?
Summary
CI on main is consistently jammed: red streaks block every open PR, fixes get pushed straight to main during firefights and fail again, and contributors wait on reruns. We (downstream maintainers at maphew/mybd) classified 39 red-CI incidents from our maintenance logs (May–July 2026) and measured the current state of main to answer why — and found that most of the machinery to fix it already exists in this repo, unfinished.
engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md lays out an 8-step rollout to required aggregate checks and a merge queue. Steps 1–6 shipped months ago — PR / CI Gate / Required and PR Risk / CI Gate / Required exist, and pr.yml, pr-risk.yml, and conformance.yml all already handle merge_group events. Step 7 (require the gates in the default-branch ruleset) was never executed: the live ruleset enforces only deletion and non-fast-forward.
The data says that missing step is now the dominant source of red main, and that merge-queue batching answers the throughput concern that most plausibly stalled the flip.
Evidence
- Ungated lane. 17 of the last 60 first-parent commits on
mainare direct pushes that never ran PR CI. Both June direct-push breakages (#4391, #4392) and the July 25 macOS firefight came through this lane — including three consecutive direct-pushed fixes that each failedTest (macos-latest)again. - Saturation. Pushes land on
mainroughly every 54 minutes; a Main run takes 35–75 minutes wall-clock (critical path:Test (Embedded Dolt Storage)at ~24 min, conformance halves ~14 min each). Result: 19 of the last 40 Main runs were cancelled by the next push — nearly half of main's commits never received a completed CI verdict. - Compounding. The July 5–7 outage kept main red ~33 hours because "these failures are pre-existing" reasoning let four independent breakages stack. Semantic conflicts between individually-green PRs caused at least three more incidents; a merge queue tests the merged composition and closes that class too.
Proposal
- Execute steps 7–8 of the existing rollout doc: require the two aggregate gates via the default-branch ruleset; remove any direct job-name requirements.
- Enable GitHub merge queue on
mainwith batching (e.g. batch size 5, timeout tuned to one gate run). At the current cadence this amortizes the ~25-minute gate to ~5 minutes per change — higher effective throughput than today once rework from red main is counted. - Route the direct-push agent lane through the queue.
gh pr createplusgh pr merge --autois scriptable inside the existing agent gateway; changes keep flowing unattended, but through the gate. - Auto-revert/quarantine for whatever still lands red: a small workflow that, on a deterministic Main failure (one rerun to rule out flake), reverts the offending commit or quarantines the failing test and opens a tracking issue — bounded time-in-red instead of hours of firefight.
- (Parallel, not blocking) shrink the gate itself: shard
Test (Embedded Dolt Storage)the waytest-embedded-cmdalready is (~24 min → ~5–8 min), which lowers the cost of every queue run and weakens the incentive to bypass.
Why now
The gate plumbing is built and verified; only the ruleset flip is missing. Every week without it converts contributor PR reviews into archaeology over which failures are "pre-existing," and the fix-forward pushes during firefights are themselves ungated — the July 25 sequence shows that loop clearly.
cc @steveyegge @csells @julianknutsen
Full analysis session transcript: https://claude.ai/code/session_01HmGSvX14yJcKD8Ezw7qZwd
claude-fable-5-xhigh on behalf of maphew
Source: gastownhall/beads