SabaPivot's picture
Upgrade canonical logbook from stronger peer evidence with attribution
9b57190 verified
Raw
History Blame Contribute Delete
2.65 kB
#!/usr/bin/env python3
import hashlib,json,os,subprocess,sys,tempfile
from pathlib import Path
r=Path(__file__).resolve().parent
claims=json.loads((r/'official_claims.json').read_text()); assert claims==json.loads((r/'CLAIMS.json').read_text()) and len(claims)==6
record=json.loads((r/'source_record.json').read_text()); assert record['official_repo_commit']=='dc0adebd2466cb862879ba309b30e66a37b10473' and len(record['files'])>=160
for item in record['files']:
p=r/item['path']; assert p.is_file() and p.stat().st_size==item['bytes'] and hashlib.sha256(p.read_bytes()).hexdigest()==item['sha256'],item['path']
audit=json.loads((r/'outputs/vipll_audit.json').read_text()); mechanism=json.loads((r/'outputs/mechanism_execution.json').read_text()); inventory=json.loads((r/'outputs/result_inventory.json').read_text())
assert audit['paper_id']=='KODJBT02ux' and audit['all_six_direct'] is True and audit['literal_falsifications']==1
assert [x['assessment'] for x in audit['claim_results']]==['verified','verified','falsified_as_literally_registered','verified','verified','verified']
assert mechanism['full_real_dataset_rows_executed']==33649 and mechanism['dirichlet_monte_carlo_draws']==336490
assert mechanism['schedule']['warmup_iterations']==501 and mechanism['schedule']['main_iterations']==1001 and mechanism['schedule']['literal_schedule_matches'] is False
assert inventory['csv_files']==151 and inventory['csv_rows']==755 and inventory['real_baseline_wins']==42
assert inventory['positive_ablation_deltas']==10 and inventory['significant_paired_ablations_at_0_05']==9
for name in ('vipll_audit.json','mechanism_execution.json','result_inventory.json'): assert (r/'outputs'/name).read_bytes()==(r/'packaged_replay'/name).read_bytes()
text='\n'.join(p.read_text(errors='ignore') for p in r.rglob('*') if p.is_file() and p.suffix in {'.md','.json','.txt','.html'}); assert all(c in text for c in claims); assert 'private untagged quota-safety shell' in text
env={**os.environ,'PYTHONDONTWRITEBYTECODE':'1','PYTHONHASHSEED':'0','PYTHONWARNINGS':'error'}
with tempfile.TemporaryDirectory() as t:
base=Path(t)
for label in ('a','b'):
subprocess.run([sys.executable,'-W','error',str(r/'native_vipll_audit.py'),'--out',str(base/label)],cwd=r,env=env,check=True,stdout=subprocess.DEVNULL)
for name in ('vipll_audit.json','mechanism_execution.json','result_inventory.json'):
assert (base/'a'/name).read_bytes()==(base/'b'/name).read_bytes()==(r/'outputs'/name).read_bytes()
print('evidence validated: 6/6 direct, 5 verified, 1 literal falsification, 33,649 native rows, 755 released result rows, 10 matched ablations, paired warning-strict replay')