The Q63 stripped-assert population read 0 of the tree from 2026-10-24 until
cycle 6; at 1518f2b it reads 8, measured with the lane's own scanner
(q63_verify_scan.py --repo . --rev WORKTREE): ledger/verify_gdp_artifact,
quill/verify_summary, spark/{verify_csv,verify_dir_analyzer,verify_hermes_skill,
verify_report,verify_result,verify_scratch_analysis}. Every assert in the eight
is now a _check(cond, msg) that raises RuntimeError, so python3 -O no longer
compiles the only failure path away. Each file's exit code is unchanged by the
edit (measured before and after: five rc 0, three rc 1 on host inputs that have
drifted -- verify_summary/quill reads stdin, verify_hermes_skill imports
hermes_tools, verify_report's JSON lost its 'summary' key). No assertion
weakened, no input repointed.
Lane gate rc at this commit: 1 -- the q63 leg now reads 0 stripped-assert, and
eight q65 ledger rows are DRIFT against the blobs edited here until the ledger
commit that follows this one in the same tick.
42 lines
1.0 KiB
Python
42 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
"""verify_summary.py — Assert csv_summary.py output matches expected values."""
|
|
import sys
|
|
import json
|
|
|
|
|
|
def _check(cond, msg):
|
|
"""A failure path `-O` cannot compile away (Q63: assert-only files exit 0 under -O)."""
|
|
if not cond:
|
|
raise RuntimeError(msg)
|
|
|
|
|
|
expected_rows = 5
|
|
expected_columns = ["name", "age", "salary", "active"]
|
|
expected_age = {
|
|
"count": 5,
|
|
"sum": 150.0,
|
|
"mean": 30.0,
|
|
"median": 30.0,
|
|
"min": 25.0,
|
|
"max": 35.0,
|
|
}
|
|
expected_salary = {
|
|
"count": 5,
|
|
"sum": 265000.0,
|
|
"mean": 53000.0,
|
|
"median": 50000.0,
|
|
"min": 45000.0,
|
|
"max": 70000.0,
|
|
}
|
|
|
|
data = json.load(sys.stdin)
|
|
_check(data["rows"] == expected_rows, f"rows: {data['rows']}")
|
|
_check(data["columns"] == expected_columns, f"columns: {data['columns']}")
|
|
age = data["numeric"]["age"]
|
|
for k, v in expected_age.items():
|
|
_check(age[k] == v, f"age.{k}: {age[k]} != {v}")
|
|
sal = data["numeric"]["salary"]
|
|
for k, v in expected_salary.items():
|
|
_check(sal[k] == v, f"salary.{k}: {sal[k]} != {v}")
|
|
print("VERIFIED")
|