back to table · edit · history · where entries came from · files · download
2056 bytes, as of the version from 2026-10-28 20:48 (current). Recorded here, not run.
"""Recheck T590's unchanged values after a presentation repair.
Download generate.py and checks.py from the same table revision, plus this file.
Save the API document as table.json, then run:
sage -python repair-checks.py table.json repair-skill-evidence.json
This re-executes the producer's checks; it is supplemental repair evidence,
not a fresh independent critique. No API writes or publication actions occur.
"""
import numberdb.sage as numberdb
import json,sys,hashlib
from pathlib import Path
from sage.env import SAGE_VERSION
import mpmath as mp
import generate
import checks
base=Path(__file__).resolve().parent
input_path=Path(sys.argv[1]) if len(sys.argv)>1 else base/'T590-before.json'
skill_path=Path(sys.argv[2]) if len(sys.argv)>2 else base/'repair-skill-evidence.json'
doc=json.loads(input_path.read_text())
rows=[{'params':{'n':n},'number':v} for n,v in doc['Numbers'].items()]
generator=generate.KelvinBeiZeros()
assert generator.digits==100
assert list(generator.enumerate())==[{'n':i} for i in range(1,21)]
assert [int(row['params']['n']) for row in rows]==list(range(1,21))
entry_checks=checks.check_rows(rows)
brackets,cells=generate.counted_brackets()
for row,(a,b) in zip(rows,brackets):
centre,ulp=checks.decimal_interval(row['number'])
assert a < centre-ulp < centre+ulp < b
result={'table':'T590','scope':'Supplemental re-execution of unchanged producer checks; not an independent critique',
'skill':json.loads(skill_path.read_text()),
'document_sha256':hashlib.sha256(input_path.read_bytes()).hexdigest(),
'versions':{'sage':SAGE_VERSION,'python':sys.version.split()[0],'numberdb':numberdb.__version__,'mpmath':mp.__version__},
'entries':len(rows),'generator_digits':generator.digits,'default_enumeration_matches':True,
'counted_cells':len(cells),'entry_checks':entry_checks,'all_passed':True,
'source_hashes':{name:hashlib.sha256((base/name).read_bytes()).hexdigest() for name in ['generate.py','checks.py','repair-checks.py']}}
print(json.dumps(result,indent=2))