Files
ersatztv/scripts/tests
timothy f754ad65e6 fix(803,664): round 5 — the guard I added in round 4 was a substring match
Self-caught while pre-empting the round-4 review, which is still in flight.

Round 4 added `test_count_pr_mutations_uses_NO_jq_e` to pin a rule I had broken in round 2:
the timeline walk must read jq output as values, never through `jq -e`'s exit status,
because jq 1.6 (which the runner ships) diverges from >= 1.7 over empty input. The guard
tested `"jq -e" in line`.

That is a substring match standing in for a predicate, and it misses four spellings of the
same request: `jq -re`, `jq -er`, `jq  -e` (two spaces) and `jq --exit-status`. A guard a
rename of the flag walks straight through is not a guard — it is a comment that runs. Worse,
this one would have read GREEN on the exact reintroduction it exists to prevent.

The detector now parses the OPTION TOKENS after each `jq` occurrence: a short bundle
containing `e`, or the long `--exit-status`, and it stops at the first non-option token
because everything from there on is the jq PROGRAM, where an `e` is not a flag. The
false-positive direction matters as much as the false-negative one — a detector that
reddens on `select(.type != "e")` would make the rule unusable and get waived.

The detector is itself a string-matching predicate, so it now has its own parameterised
cases: five spellings that must trip it and four that must not, including a jq program
containing `e` and a `--arg e x` binding.

Mutation-proved on the evasion rather than only on the obvious case: reintroducing the guard
as `jq --exit-status` — which round 4's version accepted silently — reddens it.

Verification: 1127 passed, 2 skipped; ruff clean; decisions-validate OK; YAML parses and
the mutant parsed too (a mutant that does not parse is not a measurement).
2026-08-28 23:22:08 +02:00
..