from pathlib import Path import hashlib ROOT=Path(__file__).resolve().parent.parent def digest(name):return hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest() def run(load,check): d={n:load(f'C{n}_DATA.json') for n in range(324,333)};chain=[] for n in range(324,333): c=load(f'C{n}_CERTIFICATE.json');r=load(f'C{n}_RESULTS.json');decision=load(f'C{n}_NEXT_STEP.json') check(f'C{n} completed',c['status']=='completed' and r['status']=='passed' and not c['canonical_or_graph_edits']) check(f'C{n} bounddata',c['data_sha256']==digest(f'C{n}_DATA.json')) check(f'C{n} boundresults',c['results_sha256']==digest(f'C{n}_RESULTS.json')) check(f'C{n} predecessor',c['previous_certificate_sha256']==digest(f'C{n-1}_CERTIFICATE.json')) check(f'C{n} nextdecision',c['next_step_decision_sha256']==digest(f'C{n}_NEXT_STEP.json') and decision['completed_step']==f'C{n}' and decision['next_proposed_step']==f'C{n+1}' and not decision['executed']) chain.append({'step':f'C{n}','title':c['title'],'main_result':c['main_result'],'checks':r['assertions_passed'],'auth_checks':r['source_checks_passed'],'certificate_sha256':digest(f'C{n}_CERTIFICATE.json')}) check('C324positive localrules retained',len(d[324]['positive_findings'])==4 and not d[324]['local_source_completion_reclassified'] and not d[324]['new_dilation_anchor_adopted']) check('C324no commonbiographymap',all(not x['same_whole_biography_map'] for x in d[324]['biography_operation_test'])) check('C325sourceendpointfamilies',d[325]['counts']['admitted_annual_triples']==6 and d[325]['counts']['admitted_exact_components']==12 and not d[325]['source_prescription_established']) check('C326metricdistinction',all(x['ordered_gaps']==[460,40,460] for x in d[326]['rows']) and d[326]['File09_comparison']['gaps']==[40,460,40] and not d[326]['uniform_labelled_affine_equivalence']) check('C327completepositiveledger',d[327]['counts']['positive_residuals']==18 and set(d[327]['families'])=={'40','140','490','640'}) check('C328contextdependence',[x['Noah_lifespan_residual'] for x in d[328]['context_summaries']]==[300,360,430,490]) check('C329bindingstability',d[329]['invariant_residuals']['Noah_life']==490 and [x['durations']['SP']['Noah_to_Shem'] for x in d[329]['modes']]==[500,502]) check('C330rankdependence',d[330]['counts']['rank_per_mode']==9 and d[330]['counts']['residual_rank_increment']==0 and all(x['transport_vector']==[600]*4 for x in d[330]['modes'])) check('C331allfour2Kdeathpaths',len(d[331]['rows'])==4 and all(x['Noah_life']==950 and x['death_to_MT_Flood']==108 and x['total_2K']==1058 for x in d[331]['rows'])) check('C331primaryandcompanion',all(x['adjacent_legs']==([460,490,108] if x['rail']=='primary' else [459,491,108]) for x in d[331]['rows'])) check('C331noMTcompanion',all(bool(x['N_minus460_MT_Noah_matches'])==(x['rail']=='primary') for x in d[331]['rows'])) check('C332two survivingchoices',{(x['a'],x['b']) for x in d[332]['both_survivors']}=={(0,2),(2,2)}) check('C332combinedconditional22',{(x['a'],x['b'],x['i']) for x in d[332]['both_plus_two17K_survivors']}=={(2,2,3),(2,2,5)} and not d[332]['source_selector_established']) audit=load('ARCHIVE_AUDIT.json');check('nine sealedpacketgate',audit['status']=='passed' and len(audit['packets'])==9 and not audit['issues']) check('replaygate',audit['totals']['main_output_comparisons']==18 and audit['totals']['independent_output_comparisons']==9 and audit['totals']['successful_publications']==27) for n in range(324,333):check(f'C{n} auditedidentity',next(x for x in audit['packets'] if x['step']==f'C{n}')['certificate_sha256']==digest(f'C{n}_CERTIFICATE.json')) summary='The batch adds a source-qualified Noah-lifespan dissection to the existing 529 structure: all four complete C287 SP paths have 2K = 1058 = 950 + 108. Primary paths use 460 + 490 + 108; companion paths with actual MT Noah use 459 + 491 + 108. Noah’s 490 remainder survives the explicit 500/502 binding change but depends on the restored MT context. The new death criteria leave 02 and 22; adding the two 17K condition selects 22 at primary i3/5 conditionally. No new source prescription or independent witness count is established.' checkpoint='Latest completed: C333. C334 is unexecuted; authorization exhausted. Retain the C323 synthesis and C324–C332 source, geometry, context, modal and dependency controls. Full C287 domain remains i2…5; C332 tests only the inherited C319 i3…7 slice. Primary 950 = 460 + 490 and all-four 2K = 950 + 108 are source-qualified consequences; companion uses 459/491. Global paired Mirror: January AD1. Local junction: January AD2. No civil year zero. K = 529, E = 25/23, P = 70/69; AXIS source K = 25/23 translates to current E. Regular Gears: Noah/Shem/Flood only. SP person companion remains local; Flood close is separate. No new endpoint, phase, fitted anchor, global axis, primer, canonical or graph edit. Preserve source, modal and ancestry distinctions and the SP primary-death qualification. Corrected LXX8464 supplement remains awareness only: 1564→1700, 2484→2700, 920→1000; AD3746/2300 is superseded. Current decisions override stale next-step paragraphs. Do not rerun completed research.' return {'step':'C333','status':'synthesis_complete','completed_predecessor_steps':chain,'inherited_main_checks':sum(x['checks'] for x in chain),'inherited_auth_checks':sum(x['auth_checks'] for x in chain),'source_operation_verdict':d[324]['bounded_source_verdict'],'residual_families':d[327]['families'],'context_sensitivity':d[328]['context_summaries'],'Noah_2K_paths':d[331]['rows'],'conditional_survivors':d[332]['both_plus_two17K_survivors'],'new_criteria_survivors':d[332]['both_survivors'],'archive_gate_totals':audit['totals'],'reading_index_summary':summary,'restart_checkpoint':checkpoint,'C334_executed':False,'canonical_or_graph_edits':False,'new_independent_witness_claim':False}