repair-checks.py

back to table · edit · history · where entries came from · files · download

1427 bytes, as of the version from 2026-10-28 19:40 (current). Recorded here, not run.

"""Rerun T588's unchanged checks.py against the repair snapshot or live table.

sage -python repair-checks.py

Keep checks.py beside this file. If T588-before.json is present, check that
snapshot; otherwise read the live table using NUMBERDB_API_KEY for the draft.
This script never writes to NumberDB.
"""
import contextlib,hashlib,io,json
from pathlib import Path
import numberdb.sage as numberdb
import checks

base=Path(__file__).resolve().parent
snapshot=base/'T588-before.json'
doc=json.loads(snapshot.read_text()) if snapshot.exists() else numberdb.table('T588')
rows=[{'n':n,'number':r['number'] if isinstance(r,dict) else r} for n,r in doc['Numbers'].items()]
with contextlib.redirect_stdout(io.StringIO()):
    result=checks.check_records(rows)
print(json.dumps({
    'table':'T588','repair_run':'20261028T193331Z',
    'skill_manifest':'agents/runs/20261028T193331Z-repair-skills/manifest.json',
    'skill_sha256_local':'e37efb7e2ededf6c1d7134c673f152f648f26e0267c556aebdf3ec65765d8b4c',
    'skill_sha256_live':'e37efb7e2ededf6c1d7134c673f152f648f26e0267c556aebdf3ec65765d8b4c',
    'checks_source_sha256':hashlib.sha256((base/'checks.py').read_bytes()).hexdigest(),
    'scope':'Rerun of the attached checks, not a new independent critique. No values changed.',
    'snapshot_sha256':hashlib.sha256(snapshot.read_bytes()).hexdigest() if snapshot.exists() else None,
    'attached_check_result':result},indent=2))