Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@ make gate # = no-scratch + no-secrets + design-refs
# + self-driving-test (the shell harness)
```

That is twenty-four steps, and the list is not maintained by hand: it is
`GATE_STEPS` in the `Makefile`, and `gate-parity` (`scripts/check-gate-parity.sh`)
fails if this block or CONTRIBUTING.md's stops matching it. The block had
already drifted twice before that guard existed, both times by under-reporting
a newly added guard, which is the direction that misleads — a reader runs the
short list, sees green, and believes the gate is green (#1437).
That list is not maintained by hand: it is `GATE_STEPS` in the `Makefile`, and
`gate-parity` (`scripts/check-gate-parity.sh`) fails if this block or
CONTRIBUTING.md's stops matching it. The block had already drifted twice before
that guard existed, both times by under-reporting a newly added guard, which is
the direction that misleads — a reader runs the short list, sees green, and
believes the gate is green (#1437).

Deliberately no total: the guard checks each step by name, so two PRs adding
different guards merge cleanly, while a spelled-out count is one shared cell
both must write — and two of them collided on it twice in a day, each time
leaving `main` red for everyone (#1883).

CI enforces the same steps split across three workflows:
`/.github/workflows/ci.yml`'s required job runs everything except `invariants`
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ cargo build -p stella-cli --bin stella && \
STELLA_BIN="$PWD/target/debug/stella" ./scripts/test-self-driving.sh
```

Or just `make gate`, which is the twenty-four of them in order.
Or just `make gate`, which runs all of them in order.

Do not maintain that list by hand. It is `GATE_STEPS` in the `Makefile`, and
`./scripts/check-gate-parity.sh` — itself one of the steps — fails if this fence
Expand Down
48 changes: 21 additions & 27 deletions scripts/check-gate-parity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,25 @@ if [ "$count" -eq 0 ]; then
exit 1
fi

# Spelled-out numbers, because both documents spell the count in prose ("the
# fifteen of them in order") and a digit would read wrong there. Covers a range
# no plausible gate will leave.
number_word() {
case "$1" in
10) echo ten ;; 11) echo eleven ;; 12) echo twelve ;; 13) echo thirteen ;;
14) echo fourteen ;; 15) echo fifteen ;; 16) echo sixteen ;;
17) echo seventeen ;; 18) echo eighteen ;; 19) echo nineteen ;;
20) echo twenty ;; 21) echo twenty-one ;; 22) echo twenty-two ;;
23) echo twenty-three ;; 24) echo twenty-four ;; 25) echo twenty-five ;;
*) echo "" ;;
esac
}

word="$(number_word "$count")"
if [ -z "$word" ]; then
note "FAIL — $count gate steps is outside the range number_word() spells."
note " Extend the table in this script; the documents spell the count."
exit 1
fi
# ── The count is deliberately NOT checked any more ───────────────────────────
#
# Both documents used to spell the total in prose ("the fifteen of them in
# order") and this guard held them to it. That check is gone, and its removal
# is the fix for a failure it caused rather than caught (#1883).
#
# The step NAMES are checked one at a time, so two PRs that each add a
# different guard produce diffs that merge cleanly. The TOTAL is a single
# shared cell both branches must write — and each writes its own correct
# answer. On 2026-08-06 `module-reachability` and `self-driving-test` landed
# within an hour of each other, each having dutifully updated both documents
# to "twenty-four". The second merge left GATE_STEPS at 25 with the prose
# saying 24, `docs guards` went red on `main`, and every open PR inherited it.
# Twice in one day.
#
# Nothing was lost by dropping it. The count told a reader no fact the checked
# list does not already carry: if every step is named, the number of them is
# not independently knowable-wrong. It was a derived value maintained by hand,
# which is the same defect this guard exists to prevent one level up.

# CONTRIBUTING.md lists raw commands rather than make targets. Every guard is
# `scripts/check-<target>.sh` except the ones named here, and the four compile
Expand Down Expand Up @@ -130,11 +129,6 @@ for doc in "$agents" "$contributing"; do
fi
done

if ! grep -qF -- "$word" "$doc"; then
note "FAIL — $doc does not spell the gate's step count as '$word'."
note " The gate runs $count steps. Find the stale count and fix it."
fail=1
fi
done

# ── Ghosts ───────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -176,5 +170,5 @@ if [ "$fail" -ne 0 ]; then
exit 1
fi

printf 'check-gate-parity: OK — %s (%s) gate steps, named in %s and %s.\n' \
"$count" "$word" "$agents" "$contributing"
printf 'check-gate-parity: OK — all %s gate steps are named in %s and %s.\n' \
"$count" "$agents" "$contributing"
Loading