from pathlib import Path import hashlib ROOT=Path(__file__).resolve().parent.parent def run(load,check): summaries=[];main=auth=0 for n in range(364,373): 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='C363_CERTIFICATE.json' if n==364 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('C363 baseline binding',hashlib.sha256((ROOT/'sources/C363_DATA.json').read_bytes()).hexdigest()==load('C363_CERTIFICATE.json')['data_sha256']) audit=load('PRE_C373_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('cumulative joined exclusion',load('C364_DATA.json')['counts']=={'cumulative_members':32,'joined_candidates':6,'admitted_internal':0,'admitted_terminal':0,'phase_trials':12,'complete_C287_candidates':4} and load('C364_DATA.json')['no_500_or_1100_interval_in_register']) check('Noah rectangle census',load('C365_DATA.json')['counts']=={'source_members':48,'cumulative_rectangles':8,'regular_rectangles':3,'shape_matches':24}) check('annual and phase controls',load('C366_DATA.json')['counts']=={'annual_controls':32,'matched_rectangles':4,'phase_controls':16,'opposite_phase_passes':8,'same_phase_passes':0}) check('19K source lift and interior exclusion',load('C367_DATA.json')['counts']=={'complete950_lifts':4,'same_phase_components':8,'OFF_interior_trials':32,'OFF_interior_hits':0}) select=['22:i3','22:i5'];check('19K joined intersection',load('C368_DATA.json')['survivors']['conjunction']==select) p=load('C369_DATA.json');check('source bridge matrix census',p['counts']=={'matrices':4,'source950_routes':16,'same_phase_route_components':32}) check('primary bridge matrix',p['primary_bridge_matrix']==[[10051,9591],[9591,9131]]) check('companion bridge matrix',p['companion_bridge_matrix']==[[10051,9592],[9592,9133]]) check('paired P/J source census',load('C370_DATA.json')['counts']=={'cumulative_source_repairs':6,'within_complete_C287':4,'regular_common_source_repairs':2,'regular_companion_failures':2}) p=load('C371_DATA.json');check('paired control intersection',p['survivors']['joint']==select) check('phase and boundary limits',p['counts']=={'C319_controls':20,'cumulative_source_agreements':6,'regular_source_agreements':4,'joint_source_agreements':2,'alternative_companion_boundaries':2,'same_offset_phase_agreements':12,'fixed_pivot_phase_agreements':0}) p=load('C372_DATA.json');check('primitive source scale',p['source_scale']==2 and p['source_counts']=={'complete_cumulative_rows':4,'primary_regular_rows':2,'companion_controls_rejected':2}) check('primitive source applications',all(r['whole_side']==1058 and r['first_source_segment']==r['source_pivot_separation']==460 and r['repaired_partition']==[458,600] for r in p['source_applications'])) secondary=load('ROOT_SECOND_METHOD_RESULTS.json');check('root alternate method passes',secondary['status']=='passed' and secondary['check_count']==341 and not secondary['new_independent_agent_review'] and secondary['C319_survivors']['joint']==select and secondary['primitive_scale']==2) 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']:check('retained ratio source '+name,hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==load('C370_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(364,374)] and not load('AUTHORIZATION.json')['C374_authorized']) summary='C364–C373 complete. The cumulative joined460/598→500/600 proposal has no source internal or terminal member in its frozen menu. Existing cumulative and regular Noah950 biographies instead share460/490/460 source shapes; companion shapes require the explicit annual-member shift j=k−1 and retain459/491/459. Fixed19K carries the native cumulative Noah lifespan to the reflected SP lifespan with birth/death roles exchanged and same-offset components preserved, but does not carry the OFF interior. The full bridge matrix has primary remainders69/138 and companion70/140 after division by529. At actual Flood pivots460 apart, P70/69 on138→140 and J300/299 on598→600 reach the same existing two-year repair: all four complete cumulative rows and the two regular primary rows pass; companion regular rows fail. The full C319 comparison again leaves22:i3/i5. Equal integer gains have primitive family69m→70m,299m→300m,separation230m. When the sourced first segment equals that separation, the side is529m; the actual460 fixesm2 and recovers1058=2K. This is a conditional source-supported arithmetic explanation, not a textual rule coupling the ratios or a global map. No canonical or graph edits.' restart='Latest completed C373; C374 unexecuted and outside the completed authorization. Use the C373 compact kit as active packet, starting with synthesis/checkpoint; earlier archives are selective references. C370 supplies paired P/J endpoint records; C371 contains uniqueness, twenty-control, boundary and phase tests; C372 gives the primitive integer proof. Retain C367 native950 transport by19K with exchanged birth/death roles. C369 bridge matrices use d460 primary and d459 companion, the latter explicitly including annual-index ancestry;69/70 remainders are not calendar residues. For D460, anchored P and J agree uniquely at outer gap598 with output600 and inner138→140; same-offset component comparisons pass, fixed-center pivot maps do not carry both inherited phases. The equal-gain integer family has pivot230m and source-qualified side529m; no primitive230 source endpoint is adopted. The regular companion alternative SP start allows a P-only hit while J still misses; never merge event boundaries. Prior C353458+600 repairs and their2K/17K outer endpoints remain. Prior C363 regular joined460/598→500/600 and Shem-held squared-E1058→1250 remain separately qualified; the cumulative joined counterpart has no source500 or1100 span in the declared menu. C343 Noah-held1058→1150→1250 ladder remains retained. C287 completei2…5 and C319 slicei3…7 differ. Source500/100 and502/98 modes remain valid. K529,E25/23,P70/69; File02 gapJ300/299 is not ResidueProtocol. Global paired MirrorJanuaryAD1, local junctionJanuaryAD2, no civil yearzero. Regular GearsNoah/Shem/Flood only; SP minus-one person companions local; primary Noah death retains inclusive/harmonic qualification. No new source endpoints, phases, fitted anchors, global axes, upstream Gears, primers, canonical or graph edits. Corrected LXX8464 supplement remains awareness only:1564→1700,2484→2700,920→1000; AD3746/2300 superseded. Original unprefixed reports, Engine reports and C-series remain distinct; the old incompleteSeptember17 ZIP differs from the later verified intact original. No independent witness count or source-prescribed selector follows from repeated algebra or coordinates.' return {'step':'C373','completed_steps':[f'C{n}' for n in range(364,374)],'predecessor_summaries':summaries,'predecessor_main_checks':main,'predecessor_authentication_checks':auth,'predecessor_sealed_audit_totals':audit['totals'],'root_second_method_checks':secondary['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_and_File_46':'actual bytes match C370 frozen sources','C265':'checkpoint readable; certificate hash matches retained control'},'new_independent_agent_review':False,'C374_executed':False,'canonical_or_graph_edits':False}