from pathlib import Path import hashlib,json def run(load,check): root=Path(__file__).resolve().parent.parent d={n:load(f'C{n}_DATA.json') for n in range(314,323)};steps=[] def digest(name):return hashlib.sha256((root/'sources'/name).read_bytes()).hexdigest() for n in range(314,323): cert=load(f'C{n}_CERTIFICATE.json');results=load(f'C{n}_RESULTS.json');nextq=load(f'C{n}_NEXT_STEP.json') check(f'C{n} certificate completed',cert['step']==f'C{n}' and cert['status']=='completed' and not cert['canonical_or_graph_edits']) check(f'C{n} predecessor chain',cert['previous_certificate_sha256']==digest(f'C{n-1}_CERTIFICATE.json')) for key,suffix in [('data','DATA'),('results','RESULTS'),('next_step_decision','NEXT_STEP')]:check(f'C{n} bound {key}',cert[key+'_sha256']==digest(f'C{n}_{suffix}.json')) check(f'C{n} honest forward decision',nextq['completed_step']==f'C{n}' and nextq['next_proposed_step']==f'C{n+1}' and nextq['executed'] is False) steps.append({'step':f'C{n}','title':cert['title'],'assertions':results['assertions_passed'],'source_checks':results['source_checks_passed'],'result':cert['main_result'],'certificate_sha256':digest(f'C{n}_CERTIFICATE.json')}) check('C314 finitecorrespondence',d[314]['counts']['biographies']==5 and d[314]['counts']['phase_biographies']==10 and d[314]['counts']['C287_at_both']==1) check('C315 commonancestor failure',d[315]['counts']['fixed8395_samebiography_success']==0 and d[315]['fixed_residual']==2) check('C316 ancestrydistinction',d[316]['counts']['derived_8395_routes']==5 and all(r['inherited_ancestry_role']=='Shem' and r['derived_ancestry_role']=='Flood' and r['i']-r['h']==2 for r in d[316]['rows'])) check('C317 dependentrectangle',d[317]['duration_rank']==3 and d[317]['counts']['source_rectangles']==5) check('C318 typedcomposition',d[318]['cumulative_operations']==[-460,2] and d[318]['regular_operations']==[-650,130,60,2] and d[318]['counts']['paired_final_admitted']==3) check('C319 control defeats17K uniqueness',[(r['a'],r['b'],r['two17K_admitted'],r['allK_admitted']) for r in d[319]['groups']]==[(0,0,5,0),(0,2,0,0),(2,0,0,0),(2,2,3,3)]) check('C320 fullOFFcensus',d[320]['counts']['coordinate_rectangles']==6 and d[320]['counts']['context_rectangles']==9 and d[320]['counts']['SP_rectangles']==6 and d[320]['counts']['LXX_rectangles']==3) check('C320 G1companion boundary',d[320]['omitted_G1_companion']['required_j']==8 and d[320]['omitted_G1_companion']['C287_complete']) check('C321 nativeONcensus',d[321]['counts']['context_rectangles']==3 and d[321]['counts']['Flood_only_rows']==3) check('C322 fullbioqualification',d[322]['counts']['uniform460_full_biography_success']==3 and d[322]['MT_binding_control']['Noah_G2_to_Shem_G1']==502) joint=d[322]['joint_support'];sets={k:[r['i'] for r in joint if r[k]] for k in ['OFF600','ON600','reversed_SP500','C287_at_i','C287_at_reversed_j','OFF_ON_reversed_and_C287_i','with_partner_C287']} check('supportsets exact',list(sets.values())==[[2,3,4,5,6,7],[3,5,7],[3,4,5,6,7],[2,3,4,5],[5,6,7],[3,5],[5]]) check('K factorization',598+8395==17*529 and 598+460==2*529 and 8395-460==15*529) check('rectangle fourthedge dependent',8993+600-600==8993) check('460 sourceingredients',650-130-60==460) check('458 sourceingredients',-460+2==-650+130+60+2==-458) claims=[{'claim':'Five reversed500 biographies','status':'verified conditional correspondence','conditions':'indicesi+j10, oppositecumulativephases; fivefinitesourcecases','steps':['C314']},{'claim':'Commonancestor8395matches600biography','status':'fails by2','conditions':'fixedsamecumulativeancestor; allfivecases','steps':['C315']},{'claim':'Distinctantecedentscanretaintwofixedpaths','status':'verified derivedalternative','conditions':'Floodh=i−2 distinctfromrecordedShemi ancestry','steps':['C316']},{'claim':'Two17K paths are independent confirmations','status':'not supported','conditions':'equal600sidesmakethesecondpathdependent','steps':['C317','C319']},{'claim':'AllK requirescoupledtwo-yearchoices','status':'verifiedinheld2x2domain','conditions':'22selectedbyallKcriterion,notbytwo17Kalone','steps':['C318','C319']},{'claim':'OFF andnativeONwhole600families','status':'verifiedfinitecensuses','conditions':'6OFFcoordinate/9labels;3ONMTcoordinates; companionboundary','steps':['C320','C321']},{'claim':'Uniform460wholeNoahShembiography','status':'verifiedstatequalified','conditions':'3primarysameGearNoah-bound500biographies; textual502moderetained','steps':['C322']},{'claim':'Centraljointrowisuniquelyprescribed','status':'notestablished','conditions':'i5uniqueonlyafterallfivechosenpredicates','steps':['C322']}] return {'step':'C323','steps_consolidated':steps,'support_sets':sets,'claims':claims,'minimal_dependency_ledger':[{'premise':'fixedK529andadmittedsourcecoordinates/roles','kind':'retainedinputs'},{'premise':'both17Kpathsplus600sides','kind':'rank3durationgeometry; oneedgeconsequence'},{'premise':'pairedannual/Gear+2','kind':'twodistinctchoices; equalbridgesonlyconstrainscoupling'},{'premise':'C314 index/phase reversal','kind':'forcedconditionalonselected500targetandendpointformulas'},{'premise':'460sourcecomparison','kind':'typedcomposition; Cainanoperatorsremaindistinct'},{'premise':'bothi/jC287admission','kind':'additionaloptionaljointsupportcriterion'}],'verification_inventory_prior_steps':{'main_assertions':sum(s['assertions'] for s in steps),'authentication_checks':sum(s['source_checks'] for s in steps),'scientific_independent_witness_count':None},'scope':'Consolidation of completed results only; no newendpoint/anchor orC324research.','latest_complete_after_publication':'C323','next_step':'C324 unexecuted'}