[FIX] Normalization tested at its single point; the dry run had bypassed it (PENDING-149)

The jurist's pre-25th condition: confirm lowercasing happens at exactly one
point and is unit-tested against a known uppercase input.

Single point confirmed at derive_fool.py:79 — the only .lower()/.upper()/
casefold in the file. Four checks added, including a negative control proving
the test can fail. Selftest 16/16.

Checking it found the defect the condition was aimed at, in my own work: the
2026-08-22 dry run lowercased the value OUTSIDE the code and passed it in
already normalized, so the single normalization point was never exercised on
uppercase input in the only end-to-end run. The test's subject was the
pipeline; it excluded the step under scrutiny.

Re-run with the raw uppercase value through the real path reproduces the same
seed. Binding procedure added: on the 25th the outputValue is passed exactly
as served.

Jurist ruling on the URL correction recorded verbatim — no veto, with the
reasoning, since it will be read later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQKeKY9T9d95KpvHwwok8T
This commit is contained in:
David F Glidden
2026-08-22 21:30:16 +02:00
co-authored by Claude Opus 5
parent acfbb9fc0e
commit 1e40b01d70
3 changed files with 118 additions and 1 deletions
@@ -122,6 +122,22 @@ def selftest() -> int:
("no floor: dump can reach the bottom of its range",
min(derive(f"{i:0128x}")["stats"][derive(f"{i:0128x}")["dump"]] for i in range(200)) <= DUMP_RANGE[0] + 1),
]
# --- normalization: the jurist's pre-25th condition. outputValue is served UPPERCASE. ---
UP = "A1B2C3D4E5F6" * 10 + "ABCDEFAB" # 128 chars, uppercase hex
LOW = UP.lower()
r_up, r_low = derive(UP), derive(LOW)
# independent expectation, computed here rather than read back from derive()
import hashlib as _h
expected_seed = _h.sha256((PROVENANCE_SHA256 + LOW).encode()).hexdigest()
wrong_seed = _h.sha256((PROVENANCE_SHA256 + UP ).encode()).hexdigest()
checks += [
("UPPERCASE input normalizes: bones identical to lowercase", r_up == r_low),
("UPPERCASE input matches independently computed seed", r_up["seed"] == expected_seed),
("recorded beacon field is stored lowercased", r_up["beacon_outputValue"] == LOW),
("NEGATIVE CONTROL: un-normalized input WOULD give a different seed "
"(so the check above can fail)", expected_seed != wrong_seed),
]
# positive control: the PRNG must actually move both peak and dump around the axes
peaks = {derive(f"{i:0128x}")["peak"] for i in range(200)}
dumps = {derive(f"{i:0128x}")["dump"] for i in range(200)}