import hashlib,json,pathlib,re p=pathlib.Path(__file__).parent checks=[] for path in p.glob('*jobs.json'): v=json.loads(path.read_text());x=v['x'];kind='fibre-factorisation-check' if 'factorcheck' in path.name else ('fibre-lag-diagnostic' if 'diag' in path.name else 'fibre-sign-lag') other=next(p.glob('*-'+kind+'.x'+str(x)+'.json'));w=json.loads(other.read_text()) checks.append({'artifact':path.name,'same_parsed_content_as':other.name,'exact_object_equal':v==w,'contains_execution_accounting':any(k in v for k in ('assigned_to_job','accounting','enforcement','exit_code','peak'))}) rows=[json.loads(s) for s in (p/'public-transcript-636.jsonl').read_text().splitlines() if s.strip()] history=[];prereg=[] for i,r in enumerate(rows): if r.get('role')!='tool':continue inp=r.get('input','');out=r.get('output','') if 'prereg-1403.md' in inp and 'File id:' in inp:prereg.append(i+1) if r.get('name')=='run_terminal_command' and 'sahx.py' in inp and ' jobs ' in inp and any(n in inp for n in ('fibre-sign-lag.py','fibre-lag-diagnostic.py','fibre-factorisation-check.py')): history.append({'record':i+1,'producer':next(n for n in ('fibre-sign-lag.py','fibre-lag-diagnostic.py','fibre-factorisation-check.py') if n in inp),'mentions_job_wrapper':True,'output_shows_assigned_true':'"assigned_to_job": true' in out,'output_shows_exit_zero':'"exit_code": 0' in out,'output_shows_zero_active':'"active_processes": 0' in out,'output_shows_accounting':'"accounting"' in out,'output_length':len(out)}) result={'jobs_artifacts':checks,'public_transcript_sha256':hashlib.sha256((p/'public-transcript-636.jsonl').read_bytes()).hexdigest(),'public_transcript_records':len(rows),'prereg_write_records':prereg,'scientific_wrapper_calls':history,'scope':'Only scientific record metadata, not copied setup/user turns. A command requesting a limit is weaker evidence than a receipt confirming enforcement.'} (p/'record-checks.json').write_text(json.dumps(result,indent=2),encoding='utf-8');print(json.dumps(result,indent=2))