from pathlib import Path import hashlib ROOT=Path(__file__).resolve().parent.parent def run(load,check): summaries=[];main=auth=0 for n in range(404,413): c=load(f'C{n}_CERTIFICATE.json');d=load(f'C{n}_DATA.json');r=load(f'C{n}_RESULTS.json');nxt=load(f'C{n}_NEXT_STEP.json') check(f'C{n} completed',c['step']==d['step']==f'C{n}' and c['status']=='completed' and r['status']=='passed') for key,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} '+key,hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==c[key]) check(f'C{n} next decision',nxt['next_proposed_step']==f'C{n+1}' and not nxt['executed'] and bool(nxt['reason_selected_after_current_result'])) prev='C403_CERTIFICATE.json' if n==404 else f'C{n-1}_CERTIFICATE.json' check(f'C{n} predecessor certificate',c['previous_certificate_sha256']==hashlib.sha256((ROOT/'sources'/prev).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']}) check('C403 baseline binding',hashlib.sha256((ROOT/'sources/C403_DATA.json').read_bytes()).hexdigest()==load('C403_CERTIFICATE.json')['data_sha256']) audit=load('PRE_C413_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) check('E-chart return obstruction',load('C404_DATA.json')['counts']=={'primitive_arrows':6,'sourced_transported_arrows':2,'missing_E_pivots':2,'missing_P_pivots':2,'matched_phase_arrow_trials':12,'paths_checked':402,'source_admitted_transported_paths':6,'nonempty_source_admitted_closed_paths':0}) check('complete500 source translation',load('C405_DATA.json')['counts']=={'labelled_loop_translations':12,'coordinate_loop_translations':6,'labelled_source_slots':52,'complete_E_P_J_graphs':2,'whole_path_maps_checked':402,'new_source_endpoints':0}) check('independent Shem census',load('C406_DATA.json')['counts']=={'moving_families':32,'held_families':32,'adjacent_Gear_transitions':2,'labelled_trials':2048,'labelled_E_J_loops':12,'coordinate_E_J_loops':6,'complete_labelled_E_P_J_loops':2,'loops_outside_C405_correspondence':0}) check('502 domain retained',load('C407_DATA.json')['counts']=={'labelled_binding_trials':24,'admitted500_labelled_loops':12,'admitted502_labelled_loops':6,'admitted502_coordinate_loops':3,'complete502_E_P_J_graphs':1,'new_coordinate_loops_from502':0,'unavailable502_Gear0_cases':6}) check('squared E replacement exclusion',load('C408_DATA.json')['counts']=={'candidate_two_E_paths':3,'target_squared_E_ladders':2,'whole_map_comparisons':6,'exact_whole_map_matches':0,'phase_comparisons':48,'phase_exact_matches':0}) check('fixed Mirror source boundary',load('C409_DATA.json')['counts']=={'existing_corner_exchanges':2,'labelled_reflected_loop_slots':104,'admitted_reflected_loop_slots':0,'phase_trials':208,'admitted_reflected_components':0,'source_complete_cumulative_loop_diagrams':0}) check('entire500 coordinate domain',load('C410_DATA.json')['counts']=={'source_records':528,'distinct_coordinates':373,'coordinate_trials':373,'source_coordinate_arrows':169,'source_labelled_arrows':392,'maximal_nontrivial_paths':141,'maximum_path_edges':4,'isolated_source_coordinates':63}) check('bridge and continuous record lifts',load('C411_DATA.json')['counts']=={'role_defined_labelled_arrows':240,'additional_bridge_labels':2,'maximal_record_paths_before_bridge':192,'maximum_before_edges':2,'maximal_record_paths_with_bridge':191,'continuous_four_step_record_paths':2,'phase_assignments':32,'exact_phase_assignments':2}) check('full direct source reconstruction',load('C412_DATA.json')['counts']=={'source_excerpt_cards':12,'regular_records_reconstructed':528,'new_loop_record_slots_checked':52,'long_chain_record_slots_checked':10,'new_source_endpoints':0,'new_protocol_prescriptions_established':0}) sec=load('ROOT_SECOND_METHOD_RESULTS.json');check('alternate root verification',sec['status']=='passed' and sec['check_count']==1041 and not sec['new_independent_agent_review'] and sec['source_Shem_labelled_loops']==12 and sec['complete_Shem_E_P_J_graphs']==2 and sec['translation_coordinate_arrows']==169 and sec['maximal_coordinate_chains']==141 and sec['continuous_four_step_record_paths']==2 and sec['source_records_reconstructed']==528 and not sec['C414_executed']) for name,want in [('File_18.md','68301ab760bfbe2e874aedc5c8d943ced7a6219d34bc2859332a70713f9630d5'),('File_09.md','45851004c5864229ebf6a896f9099819a08d8926715d3e97e4bc3985c4a3876e'),('C265_CERTIFICATE.json','112bdcdd23e7580512f6b6a1c4222f746e6552f71b92755932397dbd25dce2de')]:check('source bytes '+name,hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==want) for name in ['File_02.md','File_46.md','File_11.md','C365_DATA.json']:check('retained source unchanged '+name,hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==load('C403_SOURCE_MANIFEST.json')[name]['sha256']) check('C265 checkpoint readable','C265' in (ROOT/'sources/C265_CHECKPOINT.md').read_text()) check('authorization boundary',load('AUTHORIZATION.json')['authorized_steps']==[f'C{n}' for n in range(404,414)] and not load('AUTHORIZATION.json')['C414_authorized']) summary='C404–C413 complete. The existing Noah-to-Shem E charts retain only the two sourced J arrows; required Shem E pivots3016/3018 and P pivots2853/2855 are absent. The fixed source500 correspondence succeeds: all12 labelled/six coordinate Noah E/J loops translate to Shem births/deaths, including both complete E/P/J graphs. The complete target graph has MT Shem2531,2533,2535, E pivots2556/2558, J death pivots1933/1935 and P death pivots2393/2395. Every path is conjugated byT(t)=t−500 with unchanged slope and circuit multipliers1750/(3K),7500/(13K). A direct2048-case Shem-family census recovers exactly those loops. The valid502/98 binding maps only originalG2–G3 to targetG1–G2; the other six labelled cases would require unavailableGear0. The older translated squared-E endpoints were already established inC361/C363; the new return paths cannot replace their missing2056/2058 intermediate. Three slope-compatible EE paths fail all six whole-map comparisons and48 phase comparisons; the closest discrepancy is−4/529. The existing Mirror corner exchanges admit none of104 reflected loop-record slots or208 inherited components. Translating the original regular2K side−500 preserves1058 but changes both17K cross-spans to8493. The full fixed−500 source-domain census has169 coordinate arrows,392 labelled pairings and141 maximal coordinate chains. A single extra coordinate bridge3395→2895 produces3895→3395→2895→2395→1895. Its formula100+405−4−1=500 forces all three variant differences, SP companionG1 and FloodG3. It has two continuous record lifts, choosing SP or LXX CainanOFF for the Flood/death pair; the sequence is not one biography. All528 regular records reconstruct from twelve current source excerpts. The new graphs and bridge remain derived comparisons; no new source endpoint, protocol prescription, canonical edit or global529/Mirror action is established.' restart='Latest completed C413; C414 is unexecuted and outside this completed authorization. Use the C413 compact restart kit as the active packet; read synthesis/checkpoint then locator. C404 separates failed E-chart closure from C405 positive−500 role correspondence. C406 gives the independent target-family census; C407 the500/502 Gear boundary; C408 the all-positive-word obstruction to substituting a new return path for C361 squared-E map; C409 the fixed Mirror source obstruction; C410 the complete−500 coordinate domain; C411 the bridge formula and record-path lifts; C412 the direct528-record source reconstruction and warrant matrix. The complete Shem graphs are2531↔2533↔2535, with E return pivots2556/2558, J forward death pivots1933/1935 and P forward death pivots2393/2395. Their source correspondence with the C400 Noah graph isT_-500, not the earlier E charts toSP/LXX Shem2991/2993/2995. Preserve source labels even when affine maps agree. The four-step500 chain3895→3395→2895→2395→1895 begins with SP companionG1 CainanON/Terah60/full430 Noah and Shem births, crosses toSP or LXX OFF G3/base-Terah/half430 Flood start and Shem death, then ends atMT Noah death. Its opening own deaths remain2945 and2795, giving950/600. The bridge alone is a derived cross-context comparison; no2000-year biography is adopted. C361/C363 already recorded the−500 squared-E endpoints; newC408 is the replacement-path obstruction, not a new discovery of that translation. Retain C403/C393/C383 finite source normal forms, conditional529 equivalences and missing Mirror/pivot members. No global2K/17K-preserving action is established. K529,E25/23,P70/69; File02 J300/299 is gap conversion, not Residue Protocol or permission to transform dates globally. Global paired MirrorJanuaryAD1; local junctionJanuaryAD2; no civil yearzero; signed cumulative coordinates are not civil dates. Regular Gears Noah/Shem/Flood only. SP person companions remain local, Flood close independent, primary Noah death inclusive/harmonic; both500/100 and502/98 valid. LXX nativeCainanON is not given a second insertion; OFF is theoretical removal. No new source endpoint, phase, fitted anchor, global axis, upstream/cumulative Gear, primer reopening or canonical graph edit. Corrected LXX8464 supplement awareness only:1564→1700,2484→2700,920→1000; AD3746/2300 superseded. C-series, original unprefixed reports and Engine reports remain distinct. The earlier incompleteSeptember17 ZIP differs from the later verified intact original. Counts, aliases, repeated paths and second implementations are not independent historical witnesses. Proposed C414 tests existing2K regular source pairs under one and two applications of the fixed−500 comparison; no such new pair census has been executed.' return {'step':'C413','completed_steps':[f'C{n}' for n in range(404,414)],'predecessor_summaries':summaries,'predecessor_main_checks':main,'predecessor_authentication_checks':auth,'predecessor_sealed_audit_totals':audit['totals'],'root_second_method_checks':sec['check_count'],'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_File_46_File_11_C365':'actual bytes match C403 frozen manifest','C265':'checkpoint readable; certificate matches retained hash'},'new_independent_agent_review':False,'C414_executed':False,'canonical_or_graph_edits':False}