Files
ersatztv/scripts/tests
timothyandClaude Opus 5 80818aa294
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 33s
PR Gates / Docs update reminder (pull_request) Successful in 31s
PR Gates / decisions lifecycle (pull_request) Successful in 41s
Review verdict / Set review-verdict status (pull_request_target) Successful in 12s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 1m14s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 1m32s
PR Gates / Script tests (pytest) (pull_request) Successful in 2m8s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m53s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 20m30s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 23m19s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
fix(674,688): address independent review — restore the coarse bound's teeth
Two independent cold reviews (one cross-family) agreed on the top two findings.

1. The #688 fix was defeated by its own complement test. test_main_is_QUIET_about_
   drift asserted the drift notice was ABSENT while running main() over the LIVE
   corpus — whose failure condition is bit-for-bit v4's assertion, in the same
   blocking job, three functions down. p90 sat exactly on 60, so one over-ceiling
   record would have reddened it. Replaced with an IFF test that uses
   ceiling_calibration as its oracle, so it asserts the WIRING rather than the
   corpus's current state, plus a guard that at least one branch fires.

2. The coarse bound was nearly unfalsifiable. `0 < fraction_over < 1/3` accepted
   EVERY ceiling from 39 to 229 on the real corpus — including the ceiling of 200
   my own docstring offered as the case it catches, because one 230-line record
   keeps the count nonzero. That claim was simply false and is corrected. The floor
   is now a FRACTION (2%) and the cap 25%, which rejects 200/229/230 and 20, and
   accepts roughly 45..150. Headroom measured, not estimated: 37 consecutive
   over-ceiling additions, against ONE record to break v4.

3. yaml.safe_load raises a bare ValueError, not a YAMLError, on a well-shaped but
   impossible date (stale-after: 2026-06-31), which escaped as a traceback and
   killed the validator on any machine with PyYAML. The except is now deliberately
   broad, with a test.

4. PyYAML returns TYPED mapping keys, so a stray `1: x` made sorted(set|set) raise
   TypeError. Sorted with key=str.

5. The headroom prose was arithmetically wrong (~42/~40 where the real values are
   63/64; each addition moves numerator AND denominator) and the record counts were
   stale. Corrected against measurement.

6. test_adding_ordinary_records passed identically with its two additions removed.
   It now asserts the additions were counted, and that they break the v4 property
   while leaving v5 satisfied — guarded by `if`, never asserted, since whether v4
   currently holds is a fact about the live distribution and asserting it would
   rebuild the ratchet.

Also recorded honestly in docs.frontmatter-pyyaml-crosscheck: decisions-guard
installs no PyYAML, so in CI the cross-check always skips and script-tests already
caught both hazards — the CI delta is close to zero and the real fix is the local
loop plus the tool/suite agreement. And the new record was trimmed 64 -> 58 prose
lines: at 64 it moved p90 to 64 by itself, i.e. this PR would have reddened the old
blocking job. That is now cited in the test as the live demonstration.

Verification: 426 scripts/tests pass; ruff at baseline parity (47); validator exits
0; corpus back to p90=60, 18/183 over the ceiling, marks_tail and flags_minority
both true.

Decisions-Edit: yes
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 20:37:27 +02:00
..