Spaces:
Running
Running
| #!/usr/bin/env python3 | |
| import json,os,subprocess,sys,tempfile | |
| from pathlib import Path | |
| r=Path(__file__).resolve().parent | |
| a=json.loads((r/'outputs/results.json').read_text());b=json.loads((r/'replay_a/results.json').read_text());c=json.loads((r/'replay_b/results.json').read_text());e=json.loads((r/'EVIDENCE_MATRIX.json').read_text()) | |
| assert a==b==c and a['all_gates_pass'] and a['summary']=={'passed':33,'total':33} | |
| assert len(e['claims'])==6 and [x['assessment'] for x in e['claims']]==['verified','verified','verified','verified','falsified','verified'] | |
| assert all(x['registered_system_executed'] and x['destructive_control_executed'] for x in e['claims']) | |
| with tempfile.TemporaryDirectory() as t: | |
| q=Path(t)/'fresh';subprocess.run([sys.executable,'-W','error',str(r/'reproduce.py'),'--bundle-root',str(r),'--output-dir',str(q)],check=True,env={**os.environ,'PYTHONDONTWRITEBYTECODE':'1','PYTHONHASHSEED':'0','PYTHONWARNINGS':'error'},stdout=subprocess.DEVNULL) | |
| assert {p.name for p in q.iterdir()}=={p.name for p in (r/'outputs').iterdir()} | |
| assert all((q/p.name).read_bytes()==p.read_bytes() for p in (r/'outputs').iterdir()) | |
| print('evidence validated: 6 exact claims, 33 gates, native estimator, exhaustive MCAR factor, complete tables, biclique, controls, and four byte-identical runs') | |