test(retrieval-gate): the eighth attack stays as a regression guard

PM ran eight cheating attacks and four were already refused. Three of those
four already had a test (a tampered sha is exit 2, a moved set is refused, a
tuned corpus now meets a pin as well as row 2's forced classes); the fourth --
a cut that delivers nothing, which came back as an error from `consume` rather
than as a quiet row -- did not. The table is 8 of 8 now, not 4 of 4.

64 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-19 21:48:46 +02:00
commit 1020a0ee0b
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q

View file

@ -1060,3 +1060,15 @@ def test_a_k2_set_of_another_size_is_another_set_and_is_refused(tmp_path: Path)
with pytest.raises(gate.GateUsage) as refusal:
gate._k2_set([str(path), sha, str(tmp_path)])
assert "K2's denominator" in str(refusal.value)
def test_j7_a_cut_that_delivers_nothing_is_exit_two_and_never_a_quiet_green_row(
tmp_path: Path,
) -> None:
"""PM's J7/J11, kept as a regression guard: a cut delivering nothing came
back as an error from `consume` and the gate exited 2. A row counting
nothing must never read as a row that found nothing wrong."""
cases, _ = gate.synthetic_cases(tmp_path / "bundles", FIXTURES)
with gate._wrap_cut(k=0), pytest.raises(Exception) as refusal:
[gate.measure_case(case.question_set, case.bundles) for case in cases]
assert not isinstance(refusal.value, AssertionError), refusal.value