## What forced this
An intentional red `merge-gate` and stale failed attempts were diagnosed
as current systemic outages, spawning 15 duplicate alerts and cancelling
15 doctor runs in 45 minutes.
## The call
Define a jam as the same active, unexpected failure across PRs: reduce
each check context to its latest attempt, and count `merge-gate` only
when its labels require green.
## What we deliberately did not do
Do not raise the two-PR threshold; that delays real alarms while
preserving the misclassification.
## Evidence
[Detector run
29993708661](https://github.com/bugabinga/smith/actions/runs/29993708661)
reported `merge-gate` red on three PRs after PR #65 had a newer green
attempt; replaying the corrected rule leaves only two different
single-PR reviewer failures.
## Surface touched
Three ADW jam-definition surfaces, anchored at
`.github/workflows/adw-jam-detector.yml`.
## If this ages badly
If a proven active cross-PR failure is hidden by normalization, replace
the latest-attempt selector while retaining the expected-red filter.
---------
Co-authored-by: agent-smith-bugabinga-adc[bot] <agent-smith-bugabinga-adc[bot]@users.noreply.github.com>
Co-authored-by: Oliver Jan Krylow <oliver@bugabinga.net>
Co-authored-by: Claude <noreply@anthropic.com>
8-# Deterministic, no LLM: a shell/jq scan tallies, per required-check name, how
9-# many distinct open non-draft PRs it is FAILING on. Same check red on >= 2 PRs =
10-# a systemic jam, not one bad branch. The LLM (adw-doctor) is dispatched only
7+# Deterministic, no LLM: a shell/jq scan reduces each check name to its latest
8+# run, then tallies how many distinct open non-draft PRs carry an active
9+# `merge-gate` failure. Red is its normal waiting/held state, so it counts only
10+# when the verdict/blocking labels say it should be green and the gate attempt
11+# started after the last gate-relevant label transition. Same unexpected failure
12+# on >= 2 PRs = a systemic jam, not one bad branch. It is the only check tallied,
13+# because the ruleset makes it the sole required one — anything that genuinely
14+# blocks a merge lands as a red gate. The LLM (adw-doctor) is dispatched only
1115# AFTER a jam is confirmed, and only on the transition into jam — never on a# AFTER a jam is confirmed, and only on the transition into jam — never on a
1216# steady-state re-scan, so it can't spam.# steady-state re-scan, so it can't spam.
1620# idempotent (one open `pipeline-jammed` issue at a time) and auto-closes the# idempotent (one open `pipeline-jammed` issue at a time) and auto-closes the
1721# instant a scan comes back clean.# instant a scan comes back clean.
19-# Triggers: failure-completions of the gating workflows and check-suites give a
23+# Triggers: failure-completions of the gate workflow and check-suites give a
2024# fast edge (seconds after the break), and a 30-minute schedule is the# fast edge (seconds after the break), and a 30-minute schedule is the
2125# deterministic floor — GitHub suppresses some self-triggered check events, so# deterministic floor — GitHub suppresses some self-triggered check events, so
2226# the cron is what guarantees the jam is caught even if every edge is missed.# the cron is what guarantees the jam is caught even if every edge is missed.
287287| a spec claim is unproven | `planner` / `surveyor` | `/pioneer` | `needs:prototype`; a prototype proves or disproves it || a spec claim is unproven | `planner` / `surveyor` | `/pioneer` | `needs:prototype`; a prototype proves or disproves it |
288288| a Dependabot bump is semver-incompatible / MSRV-raising | `dependency-manager` | owner | escalate as its own issue; the bump waits || a Dependabot bump is semver-incompatible / MSRV-raising | `dependency-manager` | owner | escalate as its own issue; the bump waits |
289289| the cycle floods (WIP exceeded) or an agent loops | schedule | `sweeper` | enforce WIP, brake the runaway — the circuit-breaker || the cycle floods (WIP exceeded) or an agent loops | schedule | `sweeper` | enforce WIP, brake the runaway — the circuit-breaker |
290-| a required check breaks systemically — same check red on ≥2 PRs, every lane wedged | `adw-jam-detector` (failure-events + 30-min floor) | owner + `adw-doctor` | un-gated `pipeline-jammed` issue; doctor dispatched once |
290+| the merge gate breaks systemically — unexpected active `merge-gate` red on ≥2 PRs | `adw-jam-detector` (failure-events + 30-min floor) | owner + `adw-doctor` | un-gated `pipeline-jammed` issue; doctor dispatched once |
292292Two invariants hold across every row: an agent never fakes a green gate to move aTwo invariants hold across every row: an agent never fakes a green gate to move a
293293PR (PROJECT-INVARIANTS §5), and an agent never resolves ambiguity by guessing — itPR (PROJECT-INVARIANTS §5), and an agent never resolves ambiguity by guessing — it
294294routes to the human via one of `needs:spec`, `risk:high`, or `needs:info`.routes to the human via one of `needs:spec`, `risk:high`, or `needs:info`.