fix(845): the invariant that replaced a drifting count was itself false, and two of the counts survived

Fifth cold review, on the previous fix commit. Every finding is prose, and three of them are
claims that commit's own message said it had fixed. On a branch whose stated thesis is "four
prose claims were falsifiable by grep", shipping four more is the finding. Each verified here
before acting.

  - "replaced in all four places" was wrong: there were FIVE occurrences of `31`. Two survived,
    one of them four lines below the sentence the same commit added saying the number drifts.
  - "the WHOLE writer suite reddens" is measurably false. Injecting a second anchored
    `H10_REVIEWERS=` gives 36 failed / 39 passed — a large part, not all. The commit invoked
    `state-the-invariant-not-the-measurement` and then wrote a claim STRONGER than the count it
    removed. Now stated without a count and without "whole".
  - The sentinel re-attribution retracted the environment-defeating ground in one paragraph and
    still asserted it seven lines below ("the two that were measured"). The sibling library
    corrected in the same commit got this right ("the ground that survives", singular). This is
    `stale-comments-sweep-by-subject`: after a retraction, grep the retracted words.
  - "spans THREE top-level directories" replaced a TRUE hedge with a false count, and did not
    match the workflow it was supposed to be synced with (which says "at least three"). The
    suite reads seven — `.claude`, `.gitea`, `.husky`, `docs`, `ErsatzTV`, `scripts`, `web` —
    so this PR's own doc edits are inputs to that job. Hedge restored, with the reason.

Also from that review: the `if [ "$state" = "success" ]` body was unindented at column 0, and
"Fails CLOSED on every branch" now means every branch OF THAT LOAD, since the load is itself
conditional. Both fixed; the indent change is whitespace-only (`git diff -w` empty).

The behaviour was attacked again and held. The reviewer traced a BLOCKED verdict end to end
with `scripts/lib/h10-reviewers.sh` DELETED — rc=0, status and comment both posted, no unbound
variable and no command-not-found, because `$state` is set by the `case` well before the guard
and every reference to the library sits inside one of the two `state = success` blocks. An
APPROVAL on the same tree still refuses before writing anything. Removing the guard reddens the
new rejection test; `if true` reddens 20 tests. The declared mutation still reddens its named
proof.

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 f54667cc5a
commit 0f4bb4244d
5 changed files with 36 additions and 33 deletions
+2 -1
View File
@@ -1254,7 +1254,8 @@ genuine pytest regression surface as precisely the red everyone is told to wave
name keeps a real failure unambiguous.
**Why it runs unconditionally** rather than behind a `scripts/**` path filter: the suite's true
input set spans THREE top-level directories — `test_post_review_verdict.py` and
input set spans AT LEAST three top-level directories — the hedge is deliberate, since the corpus
tests also read `docs/`, and an exact count here is the kind that goes stale — `test_post_review_verdict.py` and
`test_merge_consent_exemption.py` execute the real `scripts/post-review-verdict.sh` and
`.claude/hooks/pretooluse-merge-consent.sh`, and since ersatztv#845 the former also READS
`.gitea/workflows/review-verdict.yml`, because the writer derives the H10 allow-list from it and
@@ -252,13 +252,13 @@ same literal with the same anchors OVER THE SAME POPULATION — the whole file
reddens CI on the PR that makes it. The population is part of the rule, not an implementation
detail: that guard used to scope itself to the classify step's `run:` body, and a second anchored
assignment in any other `run:` block then left it green while making the writer refuse every verdict.
Measured before it was aligned: green guard, and the WHOLE writer suite red, with no diagnostic
naming a second assignment. Stated as the invariant rather than a count on purpose — the figure
written here first was 31 and had drifted to 40 within the same branch. Such an edit reaching `main` WOULD be a repo-wide merge outage — no verdict could be
Measured before it was aligned: the guard green, and the writer suite red with no diagnostic naming
a second assignment. Deliberately stated without a count — a count drifts as tests are added, and
"the whole suite" would be false, since a large part of it reddens rather than all of it. Such an edit reaching `main` WOULD be a repo-wide merge outage — no verdict could be
posted and `review-verdict/h10` is required — but the guard is not the only thing standing in the
way, and saying so would overstate it: the writer suite reddens too, in the ADVISORY `script-tests`
job (the required contexts, measured 2026-08-30, are `Build & test`, `EF migration integrity` and
`review-verdict/h10`). What alignment buys is a diagnostic naming the cause instead of 31 unrelated
`review-verdict/h10`). What alignment buys is a diagnostic naming the cause instead of unrelated
failures. The route by which the outage is actually reachable is the snapshot boundary below — a
verdict posted from a checkout predating the edit — which is why the two paragraphs belong together.
+6 -7
View File
@@ -39,10 +39,9 @@
#
# That guard used to scope itself to the classify step's `run:` body, which is NOT the same tree this
# file walks: a second anchored assignment in any other `run:` block left it green while making this
# refuse every verdict. Measured before the fix: green guard, and the WHOLE writer suite red — the invariant, deliberately not a count,
# because the number written here first was 31 and had drifted to 40 inside this branch as tests
# were added. Their diagnostics
# said nothing about a second assignment.
# refuse every verdict. Measured before the fix: the guard green, and the writer suite red with no
# diagnostic naming a second assignment. Stated without a count on purpose — a count drifts as tests
# are added, and "the whole suite" would be false (a large part of it reddens, not all of it).
#
# BE EXACT ABOUT THE CONSEQUENCE, because the obvious phrasing overstates it. Such an edit landing on
# `main` WOULD be a repo-wide merge outage — no verdict could be posted, and `review-verdict/h10` is
@@ -93,15 +92,15 @@ unset _etv_h10_root
# is real; the conclusion does not follow. Removing this reset produces a byte-identical refusal,
# because `etv_h10_reviewers_load` runs on that path and overwrites both variables anyway. What the
# reset actually covers is a caller that never reaches `load` at all — the data-dependency reason
# above, and what `etv_h10_reviewers_contains` returning 2 rests on.
# above, and what `etv_h10_reviewers_contains` returning 2 rests on. So the sentinel earns its place
# on that ground alone, which is the one that was measured.
#
# WHAT THIS DOES NOT REST ON, stated because the claim was inherited and is wrong. The vocabulary
# library argues that under `set -u` an unbound-variable error inside a function "aborts the function
# but not the script", so an `if ! f` gate takes NEITHER branch. Measured here (bash 5.3 and bash
# 3.2, `set -euo pipefail`): the shell EXITS outright, in both the `if ! f` shape and the
# `f; rc=$?` shape. So that particular skip-past-the-gate route does not exist, and no reasoning
# below depends on it. The sentinel earns its place on the environment-defeating and data-dependency
# grounds above, which are the two that were measured.
# below depends on it.
ETV_H10_REVIEWERS_OK=0
ETV_H10_REVIEWERS=''
+20 -18
View File
@@ -120,25 +120,27 @@ esac
#
# The list is NOT declared here. `.gitea/workflows/review-verdict.yml` owns it and this derives from
# that file; see `scripts/lib/h10-reviewers.sh` for why the derivation is a parse rather than a
# declaration both sides source. Fails CLOSED on every branch, exactly like the vocabulary above: a
# writer that cannot find out whether its own verdicts are inheritable must not post one and report
# success, because that combination is the ersatztv#845 stall itself.
# declaration both sides source. Every branch OF THIS LOAD fails CLOSED, exactly like the vocabulary
# above — scoped that way deliberately, since the load itself is now conditional: a writer that
# cannot find out whether its own POSITIVE verdict is inheritable must not post one and report
# success, because that combination is the ersatztv#845 stall itself. A negative verdict never
# reaches here and needs nothing from it.
if [ "$state" = "success" ]; then
H10_REVIEWERS_LIB="$_here/lib/h10-reviewers.sh"
[ -r "$H10_REVIEWERS_LIB" ] \
|| die "the reviewer allow-list derivation is missing or unreadable at $H10_REVIEWERS_LIB — no status was written"
# Probe-source in a subshell and require the end-of-file marker before trusting the file, for the
# same reason the vocabulary does: a top-level `exit` in a sourced library terminates THIS script at
# the `source` line, having posted neither a status nor a comment, with exit 0.
# shellcheck source=lib/h10-reviewers.sh
h10_probe=$( . "$H10_REVIEWERS_LIB" >/dev/null 2>&1 && etv_h10_reviewers_loaded 2>/dev/null ) || h10_probe=''
[ "$h10_probe" = 'etv-h10-reviewers-loaded' ] \
|| die "the reviewer allow-list derivation at $H10_REVIEWERS_LIB did not load to completion (syntax error, truncated, or it exits at top level) — no status was written"
# shellcheck source=lib/h10-reviewers.sh
. "$H10_REVIEWERS_LIB" \
|| die "the reviewer allow-list derivation at $H10_REVIEWERS_LIB could not be sourced — no status was written"
etv_h10_reviewers_load \
|| die "could not derive the gate's H10_REVIEWERS allow-list (see above) — no status was written. Until it can be read, this tool cannot tell whether the POSITIVE verdict it posts would be honoured or silently re-derived. A negative verdict does not need the allow-list and is unaffected."
H10_REVIEWERS_LIB="$_here/lib/h10-reviewers.sh"
[ -r "$H10_REVIEWERS_LIB" ] \
|| die "the reviewer allow-list derivation is missing or unreadable at $H10_REVIEWERS_LIB — no status was written"
# Probe-source in a subshell and require the end-of-file marker before trusting the file, for the
# same reason the vocabulary does: a top-level `exit` in a sourced library terminates THIS script at
# the `source` line, having posted neither a status nor a comment, with exit 0.
# shellcheck source=lib/h10-reviewers.sh
h10_probe=$( . "$H10_REVIEWERS_LIB" >/dev/null 2>&1 && etv_h10_reviewers_loaded 2>/dev/null ) || h10_probe=''
[ "$h10_probe" = 'etv-h10-reviewers-loaded' ] \
|| die "the reviewer allow-list derivation at $H10_REVIEWERS_LIB did not load to completion (syntax error, truncated, or it exits at top level) — no status was written"
# shellcheck source=lib/h10-reviewers.sh
. "$H10_REVIEWERS_LIB" \
|| die "the reviewer allow-list derivation at $H10_REVIEWERS_LIB could not be sourced — no status was written"
etv_h10_reviewers_load \
|| die "could not derive the gate's H10_REVIEWERS allow-list (see above) — no status was written. Until it can be read, this tool cannot tell whether the POSITIVE verdict it posts would be honoured or silently re-derived. A negative verdict does not need the allow-list and is unaffected."
fi
base_url="${ETV_GITEA_URL:-http://192.168.1.95:3000}/api/v1"
+4 -3
View File
@@ -2388,12 +2388,13 @@ def _h10_reviewers_literal():
# classify step therefore does not walk the same tree as its subject: a second anchored
# assignment in ANY OTHER `run:` block is invisible here while making the writer refuse every
# verdict. Measured on this file: injecting one into the last step left this test green and
# reddened the WHOLE writer suite, whose diagnostics say nothing about a second assignment (the
# invariant, not a count: the number here was 31 and drifted to 40 as tests were added). Such an edit
# reddened the writer suite, whose diagnostics say nothing about a second assignment. Stated
# without a count on purpose: a count drifts as tests are added, and "the whole suite" would be
# false — a large part of it reddens, not all of it. Such an edit
# reaching `main` would be a repo-wide merge outage — no verdict could be posted and
# `review-verdict/h10` is required — but the honest claim for THIS guard is narrower: the writer
# suite already reddens, in the ADVISORY `script-tests` job, so what aligning the populations
# buys is a diagnostic that names the cause rather than 31 unrelated failures.
# buys is a diagnostic that names the cause rather than unrelated failures.
# The classify step remains what the GATE runs, and
# `_classify_step()` is still the right scope for every other assertion about that body.
body = WORKFLOW.read_text()