This repository has been archived on 2026-08-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
el-retired/docs/v2/experiments/evidence/cycles/02-seven-tables-and-a-shipped-defect/instruments/verify-hashes.py
T
will d3495476f4
El SDK Release / build-and-release (push) Failing after 13m0s
kill: purge old-paradigm dist/platform binaries from tree
The generated C, amalgams, vendored runtime pins, and compiled binaries
from the Claude Code era are removed from the worktree. The El sources
survive; this tree is now source-only for the first-principles rebuild.

Per Principal direction 2026-08-19.
2026-08-19 19:46:15 -05:00

32 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python3
"""Independent oracle for cycle 02.
Reads the 20-literal probe's stdout and checks every reported SHA-256 against
Python's hashlib. The El runtime is the system under test; hashlib is the
reference. Also counts how many literals hashed as the EMPTY STRING, which is
the signature of el_input_len returning 0.
"""
import sys, hashlib
EMPTY = hashlib.sha256(b"").hexdigest()
ok = bad = empty = n = 0
for line in sys.stdin:
line = line.strip()
if not line:
continue
parts = dict(p.split("=", 1) for p in line.split(" ") if "=" in p)
lit, got = parts["lit"], parts["sha"]
n += 1
if got == EMPTY:
empty += 1
exp = hashlib.sha256(lit.encode()).hexdigest()
if got == exp:
ok += 1
else:
bad += 1
print("MISMATCH lit=%s got=%s expected=%s" % (lit, got, exp))
print("literals tested = %d" % n)
print("correct vs hashlib.sha256 = %d" % ok)
print("incorrect = %d" % bad)
print("hashed as the EMPTY STRING = %d" % empty)
print("failure rate = %.0f%%" % (100.0 * empty / n if n else 0))