|
| 1 | +# ADR-0185 — One gate configuration, everywhere |
| 2 | + |
| 3 | +- **Status**: Proposed → **Accepted** (2026-08-12) |
| 4 | +- **Supersedes**: the tiering half of [ADR-0107](0107_pipeline_gate_smoke_authorized.md) |
| 5 | + (revision 2026-07-21) and the nightly leg of |
| 6 | + [ADR-0049](0049_orbstack_linux_gate_retired.md)'s batched-Linux arrangement. |
| 7 | + ADR-0107's *local* smoke tier is untouched. |
| 8 | +- **Affected files**: `.github/workflows/ci.yml`, `scripts/ci_gate.sh`, |
| 9 | + `scripts/check_gate_parity.sh`, `scripts/check_vm_parity.sh`, |
| 10 | + `scripts/run_remote_ubuntu.sh`, `.claude/rules/gate_cadence.md`, |
| 11 | + `test/e2e/phase14_nrepl*.sh`, `test/e2e/entrypoint_eval_parity.sh` |
| 12 | + |
| 13 | +## Context |
| 14 | + |
| 15 | +CI ran three configurations and called all three "the gate": |
| 16 | + |
| 17 | +| trigger | what ran | |
| 18 | +|--------------|-------------------------------------------------------------------------------------------------| |
| 19 | +| pull_request | `test/run_all.sh --smoke` (no e2e shell suite) | |
| 20 | +| push to main | `test/run_all.sh --serial-e2e` (== the local full gate) | |
| 21 | +| nightly cron | the above **plus** `check_vm_parity.sh` (corpus + every e2e on a `-Dbackend=tree_walk` rebuild) | |
| 22 | + |
| 23 | +`scripts/check_gate_parity.sh` already existed because this class had bitten |
| 24 | +before: for months `ci_gate.sh` passed `--serial-e2e` while `run_gate.sh` passed |
| 25 | +nothing, so "the local gate is green" and "CI is green" were statements about |
| 26 | +two different runs, and an e2e that died on SIGPIPE under serial passed under |
| 27 | +parallel — green locally, red on every push. That check fixed the flag; the |
| 28 | +tiers stayed. |
| 29 | + |
| 30 | +The nightly then produced the argument against itself. Its last run |
| 31 | +(2026-08-12, `376f81c8`) failed on **`phase14_nrepl`: `.nrepl-port` not created |
| 32 | +within 5s**, on the tree_walk build, on a loaded shared runner. The six nightlies |
| 33 | +before it passed. Measured locally on that same tree_walk ReleaseSafe build, the |
| 34 | +bind takes **0.08 / 0.14 / 0.08 s** — 35-60x under the bound. So the failure was |
| 35 | +a fact about the runner, reported a day late, in a configuration no ordinary gate |
| 36 | +run reproduces. `.claude/rules/test_taxonomy.md` had already written down why |
| 37 | +("a RATIO upper bound is a flake generator … it eventually fails for the one |
| 38 | +reason it was not written to detect"); the nightly was the only place positioned |
| 39 | +to collect on it. |
| 40 | + |
| 41 | +The project is also no longer maintained (README, 2026-08-12), so a schedule that |
| 42 | +wakes up daily to re-run a config nobody will triage is pure liability. |
| 43 | + |
| 44 | +## Decision |
| 45 | + |
| 46 | +**One configuration. PR, push, dispatch and `scripts/run_gate.sh` all run |
| 47 | +`zig fmt --check src/` + `test/run_all.sh --serial-e2e`.** |
| 48 | + |
| 49 | +1. `ci.yml` loses the `schedule:` trigger and both `CLJW_CI_*` env switches. |
| 50 | +2. `ci_gate.sh` loses its tier branches — one unconditional `run_all.sh` call. |
| 51 | +3. `check_gate_parity.sh` is extended from "both pass `--serial-e2e`" to |
| 52 | + "there is exactly ONE configuration": exactly one `run_all.sh` invocation in |
| 53 | + `ci_gate.sh`, no `CLJW_CI_FULL`/`CLJW_CI_PARITY` in the script or the |
| 54 | + workflow, no `check_vm_parity.sh` wired into a launcher. The greps read code, |
| 55 | + not comments, so the headers can still name the retired switches to explain |
| 56 | + them. |
| 57 | +4. `check_vm_parity.sh` survives as an **on-demand** tool, its header saying so. |
| 58 | +5. The nREPL port-file bounds go 5 s / 10 s / 15 s → **30 s**, with the reason |
| 59 | + in the comment: an order-of-magnitude bound still separates "never came up" |
| 60 | + from "busy runner", which is all the assertion is for. |
| 61 | + |
| 62 | +## Consequences |
| 63 | + |
| 64 | +- "Green" means one run, wherever it is said. A tier cannot return without |
| 65 | + failing `gate_parity`. |
| 66 | +- PR CI gets slower (smoke → full). Irrelevant here: PRs are disabled on this |
| 67 | + repo, and the project is not taking new work. |
| 68 | +- **The e2e shell suite no longer runs on the non-default backend in CI.** This |
| 69 | + is the one real loss, and it is smaller than the sweep's name suggests: the |
| 70 | + F-012 dual-backend differential oracle — the thing that actually pins |
| 71 | + tree_walk ≡ vm semantics — runs inside `zig build test` on **both** backends |
| 72 | + in every gate (`zig_build_test_vm` + `zig_build_test_tree_walk`). What is gone |
| 73 | + is e2e *shell* coverage of the non-default backend, recoverable on demand with |
| 74 | + `bash scripts/check_vm_parity.sh` (or `run_remote_ubuntu.sh --parity` for |
| 75 | + Linux × tree_walk, the slowest combination and where timing bounds break |
| 76 | + first). |
| 77 | +- A genuine tree_walk-only e2e regression would now be found by a person running |
| 78 | + that script, not by a schedule. Accepted: for an unmaintained project, a |
| 79 | + finding nobody triages is not coverage. |
| 80 | + |
| 81 | +## What the unification turned up on its way in |
| 82 | + |
| 83 | +Removing the tier did not make the first full gate green — `entrypoint_eval_parity` |
| 84 | +died with exit 137 and no explanation. Two real defects were behind it, both |
| 85 | +found because the oracle was made to survive a dying entry point instead of |
| 86 | +inheriting its status: |
| 87 | + |
| 88 | +1. **The oracle aborted instead of reporting.** `got=$(run_$ep …)` under |
| 89 | + `set -e` propagates a killed child's 137 and takes the step with it — in the |
| 90 | + one test whose entire job is to notice that an entry point behaved |
| 91 | + differently. It now captures status and raw output per entry point, so a |
| 92 | + death is a named divergence with the last 20 lines attached. That change is |
| 93 | + what produced the diagnosis in one run. |
| 94 | +2. **Every nREPL e2e leaked its server.** `( cd "$WORK" && "$BIN" nrepl … ) &` |
| 95 | + makes `$!` the subshell, not the runtime, so `kill $!` orphaned one `cljw` |
| 96 | + per start: 3 left behind by `phase14_nrepl_classpath`, 4 by |
| 97 | + `phase14_nrepl_toplevel_do`, plus one per case in the new oracle. Enough |
| 98 | + accumulated memory that macOS SIGKILLed an unrelated freshly-built binary — |
| 99 | + a leak presenting as a crash. All three now reap by scoped port pattern, and |
| 100 | + all four nREPL e2e end with zero surviving processes. |
| 101 | + `.claude/rules/orphan_prevention.md` carries the pattern as rule 4. |
| 102 | + |
| 103 | +The CI runner had been reporting this leak all along, as a "Terminate orphan |
| 104 | +process: pid (…) (cljw)" flood at job cleanup. Nobody read it as a finding. |
| 105 | + |
| 106 | +## Alternatives considered |
| 107 | + |
| 108 | +1. **Keep the nightly, raise the bound only** (smallest diff). Fixes this |
| 109 | + symptom, keeps the class: CI still verifies something the local gate does not, |
| 110 | + so the next divergence is again found a day late by a config nobody runs. It |
| 111 | + also leaves a daily job on a repo that is winding down. |
| 112 | +2. **Keep the nightly, run it in the local gate too** (parity by addition). |
| 113 | + Genuinely closes the divergence and keeps the coverage — at a second |
| 114 | + ReleaseSafe rebuild plus a full serial e2e pass (~5 min) on *every* gate, |
| 115 | + local included. Rejected on the coverage/cost ratio given the diff oracle |
| 116 | + already covers dual-backend semantics, and doubly so for a project that has |
| 117 | + stopped. |
| 118 | +3. **Delete `check_vm_parity.sh` outright.** Simplest final state, but it throws |
| 119 | + away a diagnostic that costs nothing to keep and that a forker may want. The |
| 120 | + divergence was the schedule, not the script. |
0 commit comments