fix(845): WITHDRAW the set -u retraction — the original claim was right and my probe used the wrong construct

Eighth cold review. It found that the correction shipped over the last two commits inverted a
TRUE statement into a false one, in live merge-gate code. Verified independently before acting,
and the reviewer is right.

WHAT I MEASURED WRONG. My probe used a PLAIN unset variable reference (`: "$UNSET"`) and I
generalised the result to `${#arr[@]}`, which is the expansion the validator actually uses.
Those shapes do not behave alike. Measured on bash 3.2.57 and 5.3.15, `if ! f` form, function
aborting on each shape:

  shape                      set -u              set -eu
  plain   $UNSET             rc=127 exits        rc=1 exits
  unset   ${#UNSET_ARR[@]}   rc=0  CONTINUES     rc=1 exits
  scalar  ${#SCALAR[@]}      rc=0  CONTINUES     rc=1 exits

For both `${#...[@]}` rows under `set -u` alone: continued-past-gate=1, a-branch-ran=0. So the
wording on `main` was correct as written — the abort takes neither branch of `if ! validate` and
execution continues past the gate — for exactly the shape the validator uses and exactly the
flag set its consumer runs: `check-review-verdict.sh` is `set -uo pipefail`, deliberately
without `-e`. The repo's own `test_MUTATION_with_the_array_assertion_disarmed_the_SENTINEL_still_refuses`
is the end-to-end proof: it asserts a message only emitted AFTER the gate, and it passes.

The concrete harm of the version being withdrawn: it had `review-verdict-vocabulary.sh` saying
"there is no skip to defend against" — an invitation to delete the sentinel and reopen the
measured fail-open that file exists to close.

WITHDRAWN WHOLESALE rather than patched a third time, per the budget-3-rounds-then-withdraw rule
this repo records for string/prose predicates. `scripts/lib/review-verdict-vocabulary.sh` and
`scripts/check-review-verdict.sh` are byte-identical to `main` again; the `docs/ci-cd.md`
paragraph and the `test_review_verdict_vocabulary.py` comment are restored verbatim. Kept from
those commits: the `docs/ci-cd.md` input-set fix (and its wrap repair), which is unrelated and
sound.

`scripts/lib/h10-reviewers.sh` keeps a note on the topic, now correctly scoped by BOTH flag set
and expansion shape: the route is real for `${#arr[@]}` under `set -u` without `-e`, which is the
vocabulary library's consumer, and is not reachable from `post-review-verdict.sh`, which runs
`set -euo pipefail` where the shell exits on every shape. So the sentinel here rests on the
data-dependency ground alone.

ersatztv#886 is CLOSED as invalid — it asked for a record to be "corrected" that is right — with
the measurement recorded on it.

CORRECTION to the two previous commit messages: their claims that the mechanism was refuted, and
that the retracted wording was "gone repo-wide" for code/tests/docs, are both withdrawn.

Reusable: a runtime claim needs a probe that exercises the SAME CONSTRUCT, not merely the same
flags. `set -u` is not one behaviour — it is one per expansion shape.

Full suite 1278 passed / 2 skipped; catalog in sync; decisions-validate OK.

fixes #845

Decisions-Edit: yes
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019zUmJZHhVP7kXg5DV237TW
This commit is contained in:
2026-08-30 03:38:47 +02:00
co-authored by Claude Opus 5
parent f7d6c737f1
commit dc09eceee9
5 changed files with 34 additions and 69 deletions
@@ -318,23 +318,18 @@ def test_the_write_side_maps_the_shipped_words_onto_the_same_states(sandbox, tok
assert sandbox.posted_status_state() == state
# --- The sentinel, not the `if`, is what holds. ---------------------------------------------------
# --- A control-flow gate can be SKIPPED; the sentinel is what actually holds. --------------------
#
# The fail-open is measured and real: with `.*` in the positive list and the negative list written as
# a scalar, unvalidated words reached the regex and an explicit `BLOCKED @ <head>` classified
# `positive`, exit 0. The calling hook discards stderr, so the only signal was invisible.
#
# THE MECHANISM ORIGINALLY RECORDED FOR IT WAS WRONG, corrected in ersatztv#845 and restated here
# rather than repeated: it held that under `set -u` an unbound-variable error inside a FUNCTION
# aborts the function but not the script, so an `if ! validate` form takes NEITHER branch and the
# `exit 2` never runs. Measured on bash 3.2.57 and 5.3.15, under `set -u` ALONE as well as `set -eu`
# — the case that matters, since `check-review-verdict.sh` deliberately runs without `set -e` — the
# shell EXITS outright, so nothing continues past the gate. That reading holds only inside a command
# substitution.
# Under `set -u`, an unbound-variable error inside a FUNCTION aborts the function but not the
# script, and in an `if ! validate` form NEITHER branch is then taken — so the `exit 2` never runs
# and execution continues past the gate. `check-review-verdict.sh` runs without `set -e`, so the
# words reached the regex unvalidated: with `.*` in the positive list and the negative list written
# as a scalar, an explicit `BLOCKED @ <head>` classified `positive`, exit 0. The calling hook
# discards stderr, so the only signal was invisible.
#
# The fix is a DATA dependency rather than a control-flow one: validation sets
# `ETV_VERDICT_VOCABULARY_OK=1` on its last line, and the derived views refuse without it. What that
# covers is the caller that never runs validation at all. These tests pin the malformation classes.
# `ETV_VERDICT_VOCABULARY_OK=1` on its last line, and the derived views refuse without it. These
# tests pin the malformation classes that produce the abort.
def test_a_SCALAR_word_list_cannot_reach_the_regex_unvalidated(sandbox):