from pathlib import Path import hashlib,json ROOT=Path(__file__).resolve().parent.parent def run(load,check): summaries=[];main=auth=0 for n in range(334,343): cert=load(f'C{n}_CERTIFICATE.json');data=load(f'C{n}_DATA.json');res=load(f'C{n}_RESULTS.json');nxt=load(f'C{n}_NEXT_STEP.json') check(f'C{n} complete',cert['status']=='completed' and cert['step']==f'C{n}' and res['status']=='passed') for field,file 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'/file).read_bytes()).hexdigest()==cert[field]) check(f'C{n} reassessment',nxt['next_proposed_step']==f'C{n+1}' and nxt['executed']==False and bool(nxt['reason_selected_after_current_result'])) if n>334:check(f'C{n} predecessor',cert['previous_certificate_sha256']==hashlib.sha256((ROOT/'sources'/f'C{n-1}_CERTIFICATE.json').read_bytes()).hexdigest()) summaries.append({'step':f'C{n}','title':cert['title'],'main_result':cert['main_result'],'checks':res['assertions_passed'],'source_checks':res['source_checks_passed']});main+=res['assertions_passed'];auth+=res['source_checks_passed'] audit=load('PRE_C343_ARCHIVE_AUDIT.json');check('nine sealed packets',audit['status']=='passed' and audit['totals']['packets']==9 and audit['totals']['main_output_comparisons']==18 and audit['totals']['successful_publications']==27) check('common source origin retained',load('C334_DATA.json')['common_origin_rejected']==False) check('factorized source pairs',load('C337_DATA.json')['counts']['left2K']==6 and load('C337_DATA.json')['counts']['right2K']==4 and load('C337_DATA.json')['counts']['two17K']==4) check('primary source ladder',load('C338_DATA.json')['full_source_ladder_i']==[3,5] and load('C338_DATA.json')['doubleE_source_endpoints_i']==[2,3,4,5]) check('modal control',[x['widths'] for x in load('C339_DATA.json')['rows']]==[[1058,1150,1250],[1058,1152,1250]]) d=load('C340_DATA.json');check('primary refinement',d['primary_chain']==[460,490,108,92,100]);check('companion refinement',d['companion_chain']==[459,491,108,91,101]);check('named502 refinement',d['named502_chain']==[460,490,108,94,98]) check('phase control',load('C341_DATA.json')['counts']=={'phase_assignments':80,'complete_ladders':4,'doubleE_with_unconstrained_H_phase':20}) check('no new cumulative selector',load('C342_DATA.json')['cumulative_choice_selected_by_regular_ladder']==False and load('C342_DATA.json')['selector_equivalent_to_C332']) for name,want in [('File_18.md','68301ab760bfbe2e874aedc5c8d943ced7a6219d34bc2859332a70713f9630d5'),('File_09.md','45851004c5864229ebf6a896f9099819a08d8926715d3e97e4bc3985c4a3876e'),('C265_CERTIFICATE.json','112bdcdd23e7580512f6b6a1c4222f746e6552f71b92755932397dbd25dce2de'),('C89_REPORT.md','bee1dd4ba8c4b8ba0d1d79606d1c419037cd9fd5973626357e87ec4cf33ed8cc')]:check('actual verified bytes '+name,hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==want) check('C265 checkpoint readable','C265' in (ROOT/'sources/C265_CHECKPOINT.md').read_text()) summary='C334–C343 complete. Primary SP Noah paths support a source-qualified Noah-held duration ladder1058→1150→1250 under E=25/23, with refinement460+490+108+92+100. Companions retain the sourced double-E endpoints but their actual MT Shem span is1149; the valid502/98 control gives1152. The full regular ladder does not select cumulative a:02 and22 remain until the separate17K condition. Scalar/C89 prior art, source qualifications and phase/map limits are retained.' restart='Latest completed C343; C344 unexecuted and outside this authorization. Read C343 synthesis/checkpoint first; use the C343 compact restart kit as the active packet and prior archives selectively. Preserve C287 complete SP domaini2…5 and C319 control slicei3…7. Primary ladder holds on i3/i5 and matching inherited components only; no MT person companion or whole-biography dilation. C334 finds shared Shem±2 origin but no exact endpoint coupling prescription in reviewed passages. K=529,E=25/23,P=70/69. Global paired MirrorJanuaryAD1, local junctionJanuaryAD2, no civil yearzero. Regular GearsNoah/Shem/Flood only; SPminus-one persons local. No new source endpoint, phase, fitted anchor, global axis, primer, canonical or graph edit. Corrected LXX8464 supplement remains awareness only; AD3746/2300 superseded. Original unprefixed reports, Engine reports and C-series remain distinct. Earlier incompleteSeptember17 ZIP differs from the later verified intact original.' return {'step':'C343','completed_steps':[f'C{n}' for n in range(334,344)],'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':'readable; expected SHA256 verified','File_09':'readable; expected SHA256 verified','C265':'checkpoint readable and expected certificate SHA256 verified','C89':'locator-selected report hash matches archive record'},'new_independent_agent_review':False,'C344_executed':False,'canonical_or_graph_edits':False}