from pathlib import Path import hashlib ROOT=Path(__file__).resolve().parent.parent def run(load,check): summaries=[];main=auth=0 for n in range(384,393): 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='C383_CERTIFICATE.json' if n==384 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('C383 baseline binding',hashlib.sha256((ROOT/'sources/C383_DATA.json').read_bytes()).hexdigest()==load('C383_CERTIFICATE.json')['data_sha256']) audit=load('PRE_C393_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('direct mixed square distinction',load('C384_DATA.json')['counts']=={'primary_ladders':2,'adjacent_source_translation_squares':1,'direct_E_PJ_mixed_squares':2,'commuting_direct_E_PJ_squares':0,'matched_phase_translation_squares':2}) check('J pivot source P pivot absence',load('C385_DATA.json')['counts']=={'original_common_repairs':4,'Shem_coordinate_edges':4,'SP_LXX_context_lifts':8,'required_pivot_slots':8,'admitted_required_pivot_slots':4,'source_closed_E_J_transported_squares':4,'source_closed_E_P_transported_squares':0}) check('whole affine and phase result',load('C386_DATA.json')['counts']=={'whole_affine_source_squares':4,'context_lifts':8,'phase_assignments':1024,'source_exact_component_squares':8}) check('valid alternative source modes retained',load('C387_DATA.json')['counts']=={'available_labelled_mode_trials':18,'unavailable_Gear0_trials':6,'complete_E_J_squares':8,'valid_horizontal_Shem_J_edges':18,'vertical_E_failures':10}) check('finite source strips',load('C388_DATA.json')['counts']=={'two_edge_coordinate_strips':2,'SP_LXX_labelled_strips':4,'P_J_bottom_word_trials':8,'same_endpoint_trials':8,'whole_affine_JJ_intertwiners':2,'admitted_second_E_images':0,'admitted_next_MT_Noah_endpoints':0}) check('cumulative source obstruction',load('C389_DATA.json')['counts']=={'original17K_exchanges':2,'reflected_point_slots':16,'admitted_reflected_point_slots':10,'missing_reflected_point_slots':6,'source_complete_cumulative_squares':0}) check('unconditioned finite family census',load('C390_DATA.json')['counts']=={'source_families':32,'target_families':32,'Gear_transitions':2,'Flood_boundaries':2,'labelled_trials':4096,'two_vertical_E_edges_pass':16,'complete_E_J_squares':8,'complete_coordinate_squares':4,'all_upper_Shem_J_edges_pass':True}) check('finite529 equivalence',load('C391_DATA.json')['counts']=={'E_J_contexts':8,'matched_original_P_J_contexts':8,'coordinate_configurations':4,'contexts_outside_correspondence':0}) check('held Noah E graph census',load('C392_DATA.json')['counts']=={'held_Noah_pivots':4,'distinct_input_coordinates':373,'E_evaluations':1492,'nontrivial_coordinate_edges':29,'fixed_coordinate_points':4,'maximal_paths':25,'maximum_path_edges':2,'additional_edges_beyond_expected':13}) units=[] for g in load('C392_DATA.json')['graphs']: for e in g['edges']: if e['input_distance_from_Noah']==23 and e['output_distance_from_Noah']==25:units.append([g['Noah_pivot'],e['input'],e['output']]) check('two source23 to25 edges',units==[[3706,3683,3681],[3708,3685,3683]]) sec=load('ROOT_SECOND_METHOD_RESULTS.json');check('alternate root verification',sec['status']=='passed' and sec['check_count']==118 and not sec['new_independent_agent_review'] and sec['complete_labelled_E_J_squares']==8 and sec['held_Noah_E_edges']==29 and sec['source23_to25_edges']==units) 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','C365_DATA.json']:check('retained source unchanged '+name,hashlib.sha256((ROOT/'sources'/name).read_bytes()).hexdigest()==load('C383_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(384,394)] and not load('AUTHORIZATION.json')['C394_authorized']) summary='C384–C393 complete. A source-qualified E/J affine square connects the existing MT Noah two-year repair to SP primary/LXX Cainan-OFF Shem births, using the next-Gear Shem death as the transported J pivot. Four coordinate squares have eight labelled context lifts and compose into two two-edge coordinate strips over G1–G3. Direct E/PJ squares with the old next Flood pivots fail by42/69 or42/299; transported P pivots are absent. The positive E/J square is exact as an affine map, but matched seasonal components require phase-specific source pivots and are not one physical-time action. SP companions and502/98 remain valid source modes: their horizontal Shem J edges pass but this vertical E comparison fails. Both original17K corner exchanges preserve the algebra yet leave three cumulative image points absent in each square. A4096-trial coherent-family census, without529 or prior-PJ filtering, recovers precisely the original eight context lifts. Source500/600 and E/J forceh2,460=230h and598=299h, hence1058=529h; the existing target Flood recovers69h→70h underP. This is a conditional source equivalence, not an independent529 datum. The target side1100 exceeds2K by42. A1492-evaluation fixed-Noah E census has29 nontrivial coordinate edges, four fixed points and25 maximal paths; only the four retained double-E ladders have two edges. Thirteen extra edges include sourced23→25 reverse-Gear Noah comparisons3683→3681 about3706 and3685→3683 about3708. Their context displacement is−215+130+60=−25 with the input Gear increment2. Their P/J or Mirror interpretation has not been executed.' restart='Latest completed C393; C394 is unexecuted and outside this completed authorization. Use the C393 compact restart kit as the active packet; read synthesis/checkpoint then locator. C385 gives sourced E/J pivots, C386 the exact affine square and phase limits, C387 companion/modal controls, C388 finite strip composition, C389 cumulative source obstruction, C390 the unconditioned coherent-family census, C391 the conditional529 equivalence, and C392 the complete E graph at four selected existing Noah pivots. Example: J_2648 carries MT Noah3246→3248; E_3706 carries3246→SP/LXX Shem3206; E_3708 carries3248→3208; J_2608 carries3206→3208 with2608 the sourced next-Gear Shem death. Thus E_(N+2) after J_A equals J_(A−40) after E_N, with slope7500/6877. The required analogous P pivot3068 is absent (as are2853,2855,3070 in the other rows). Source500/600 fixes the230h+299h=529h geometry ath2; next-Noah to Shem death550h changes the outer side by21h42. No global2K/17K-preserving E/P/J action is established. The two sourced E23→25 reverse-Gear edges use full4301/CainanOFF/Terah0 held Noah versus full4300/CainanON/Terah60 input/output Noah; SP primary and LXX records stay separate. Do not promote the13 extra E edges into a common source biography or new protocol. Retain C383 moving P/J lawD=230h, finite path bounds and17K+4 paired drift; C373 commonP/J source repair; C367 nativeNoah950 translation by19K; C343 Noah-held1058→1150→1250 and C363 source500/600 qualifications. K529,E25/23,P70/69; File02 J300/299 is gap conversion, not Residue Protocol. Global paired MirrorJanuaryAD1; local junctionJanuaryAD2; no civil yearzero. Regular Gears Noah/Shem/Flood only; SP minus-one person companions local; Flood close separate. SP primary Noah death retains inclusive/harmonic qualification;500/100 and502/98 both valid. No new source endpoint, phase, fitted anchor, global axis, cumulative Gear, primer reopening, canonical or graph edit. Corrected LXX8464 supplement awareness only:1564→1700,2484→2700,920→1000; AD3746/2300 superseded. Original unprefixed reports, Engine reports and C-series distinct. The earlier incompleteSeptember17 ZIP differs from the later verified intact original. Replays, context aliases and repeated coordinates are not independent historical witnesses.' return {'step':'C393','completed_steps':[f'C{n}' for n in range(384,394)],'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,'source23_to25_edges':units,'source_access':{'File_18':'actual bytes match retained SHA256','File_09':'actual bytes match retained SHA256','File_02_File_46_C365':'actual bytes match C383 frozen source manifest','C265':'checkpoint readable; certificate matches retained hash'},'new_independent_agent_review':False,'C394_executed':False,'canonical_or_graph_edits':False}