from pathlib import Path import hashlib from fractions import Fraction ROOT=Path(__file__).resolve().parent.parent def run(load,check): summaries=[];main=auth=0 for n in range(344,353): c=load(f'C{n}_CERTIFICATE.json');r=load(f'C{n}_RESULTS.json');d=load(f'C{n}_DATA.json');nxt=load(f'C{n}_NEXT_STEP.json') check(f'C{n} complete',c['step']==f'C{n}' and c['status']=='completed' and r['status']=='passed') for field,name in [('data_sha256',f'C{n}_DATA.json'),('results_sha256',f'C{n}_RESULTS.json'),('next_step_decision_sha256',f'C{n}_NEXT_STEP.json')]:check(f'C{n}/{field}',hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==c[field]) check(f'C{n} reassessment',nxt['next_proposed_step']==f'C{n+1}' and not nxt['executed'] and bool(nxt['reason_selected_after_current_result'])) if n>344:check(f'C{n} predecessor',c['previous_certificate_sha256']==hashlib.sha256((ROOT/'sources'/f'C{n-1}_CERTIFICATE.json').read_bytes()).hexdigest()) main+=r['assertions_passed'];auth+=r['source_checks_passed'];summaries.append({'step':f'C{n}','title':c['title'],'main_result':c['main_result'],'checks':r['assertions_passed'],'source_checks':r['source_checks_passed']}) audit=load('PRE_C353_ARCHIVE_AUDIT.json');check('nine sealed predecessor packets',audit['status']=='passed' and audit['totals']['packets']==9 and audit['totals']['main_output_comparisons']==18 and audit['totals']['successful_publications']==27) a=load('C344_DATA.json');check('two primary repairs',sum(bool(x['hold_Flood_Noah_matches']) for x in a['rows'])==2 and all(bool(x['hold_Flood_Noah_matches'])==bool(x['hold_Noah_Flood_matches'])==(x['rail']=='primary') for x in a['rows'])) b=load('C345_DATA.json');check('six repairs and tradeoff',len(b['rows'])==6 and not any(x['keep2K'] and x['keep460_490'] for x in b['rows'])) check('two sourced650 image pairs',sum(x['both_images_source_matched'] for x in load('C346_DATA.json')['rows'])==2) check('Noah950 retained',all(x['lifespan']==950 and x['source_death_image_error']=='-950/299' for x in load('C347_DATA.json')['rows'])) check('phase result',load('C348_DATA.json')['counts']=={'phase_combinations':64,'exact_primary':8,'exact_companion':0}) fields=load('C349_DATA.json')['fields'];check('finite relation counts',len(fields)==2 and sum(len(mp) for f in fields for mp in f['maps'].values())==32 and sum(k!=v for f in fields for mp in f['maps'].values() for k,v in mp.items())==20) check('commutator values',{Fraction(x['first_after_second_minus_reverse']) for x in load('C350_DATA.json')['rows']}=={Fraction(92,299),Fraction(40,299),Fraction(-2,299)} and load('C350_DATA.json')['both_orders_source_supported_inputs']==0) c=load('C351_DATA.json');check('cumulative counterparts',c['cumulative_success_i']==[2,3,4,5] and c['simultaneous_primary_i']==[3,5]) s=load('C352_DATA.json');check('selector result',len(s['paired598_survivors'])==2 and len(s['both600_output_survivors'])==9 and not s['source_coupling_established']) for name,want in [('File_18.md','68301ab760bfbe2e874aedc5c8d943ced7a6219d34bc2859332a70713f9630d5'),('File_09.md','45851004c5864229ebf6a896f9099819a08d8926715d3e97e4bc3985c4a3876e'),('C265_CERTIFICATE.json','112bdcdd23e7580512f6b6a1c4222f746e6552f71b92755932397dbd25dce2de')]:check('actual source hash '+name,hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==want) check('File02 unchanged from C344',hashlib.sha256((ROOT/'sources/File_02.md').read_bytes()).hexdigest()==load('C344_SOURCE_MANIFEST.json')['File_02.md']['sha256']) check('C265 checkpoint accessible','C265' in (ROOT/'sources/C265_CHECKPOINT.md').read_text()) summary='C344–C353 complete. Primary598→600 has two source repairs: preserving2K gives458+492+108; preserving460/490 gives1060. The cumulative counterpart preserves1058 as458+600 at i2…5, and both primary sides can do so at i3/i5 with all2K/17K outer endpoints fixed. Noah-held E sends the original primary598 interval to an actual SP/MT Shem650 pair. The supported endpoint moves form bounded partial relations; whole-biography and single-physical-time dilation claims fail their stated tests. Both598 inputs select22 primary, but actual600 outcomes leave9 admitted primary controls across allfour choices. No new coupled source prescription.' restart='Latest completed C353; C354 unexecuted and outside the completed authorization. Read C353 synthesis/checkpoint first; compact C353 kit is the active packet and older archives are selective references. Preserve C343 primary1058→1150→1250 ladder and its companion1149/502-mode1152 controls. Preserve C287 full SP i2…5 and C319 i3…7 control slice. The retained MT-companion gap is599, so300/299 gives601+1/299; this finding is limited to those endpoint comparisons. Cumulative458 is a cross-index/Cainan-state leg, never a changed460 lifespan or cumulative Gear. Source gap conversion, Gear translation, center/phase comparison and physical-time affine map stay distinct. K=529,E=25/23,P=70/69;300/299 is the File02 gap ratio and not ResidueProtocol. Global paired MirrorJanuaryAD1; local junctionJanuaryAD2; no civil yearzero. Regular GearsNoah/Shem/Flood only; SP person companion local; SP primary death retains inclusive/harmonic qualification. Capture now; canonize later. No new source node, phase, fitted anchor, global axis, primer, canonical or graph edit. LXX8464 supplement remains awareness only; AD3746/2300 superseded. Earlier incompleteSeptember17 ZIP differs from the later verified intact original. C-series, original unprefixed reports and Engine reports remain distinct.' return {'step':'C353','completed_steps':[f'C{n}' for n in range(344,354)],'predecessor_summaries':summaries,'predecessor_main_checks':main,'predecessor_authentication_checks':auth,'predecessor_sealed_audit_totals':audit['totals'],'reading_index_summary':summary,'restart_checkpoint':restart,'source_access':{'File_18':'actual bytes match retained SHA256','File_09':'actual bytes match retained SHA256','File_02':'actual bytes match C344 frozen source','C265':'checkpoint readable; certificate hash matches retained control'},'new_independent_agent_review':False,'C354_executed':False,'canonical_or_graph_edits':False}