from pathlib import Path import hashlib ROOT=Path(__file__).resolve().parent.parent def run(load,check): summaries=[];main=auth=0 for n in range(374,383): 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='C373_CERTIFICATE.json' if n==374 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('C373 baseline binding',hashlib.sha256((ROOT/'sources/C373_DATA.json').read_bytes()).hexdigest()==load('C373_CERTIFICATE.json')['data_sha256']) audit=load('PRE_C383_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('full span change',load('C374_DATA.json')['cross_span_delta']==[[0,2,0],[2,4,2],[0,2,0]]) check('typed conjugacy and phases',load('C375_DATA.json')['counts']=={'paired_pivot_rows':4,'conjugate_operator_pairs':8,'source_supported_primary_rows':2,'companion_typed_source_failures':2,'opposite_phase_pairs':8,'same_phase_pairs':0}) check('fixed pivot graph census',load('C376_DATA.json')['totals']=={'nontrivial_operator_edges':16,'distinct_directed_edges':10,'fixed_operator_points':16,'common_edges':6,'continuations_from_candidate':0,'predecessors_into_input':0}) check('unit edge lifespan limits',load('C377_DATA.json')['counts']=={'J_only_death_edges':4,'source950_translation_lifts':4,'fixed_pivot_J_biography_lifts':0,'admitted_cumulative_reflections':0}) p=load('C378_DATA.json');c=next(f for f in p['fields'] if f['field']=='cumulative');r=next(f for f in p['fields'] if f['field']=='regular') check('cumulative exhaustive pivot census',c['counts']['ordered_distinct_pivot_pairs']==240 and len(c['integer_candidates'])==16 and len(c['hits'])==6 and c['source_supported_scales']=={'-2':6}) check('regular exhaustive pivot census',r['counts']['ordered_distinct_pivot_pairs']==9120 and len(r['integer_candidates'])==28 and len(r['hits'])==4 and r['source_supported_scales']=={'2':4}) check('context and original Mirror qualification',load('C379_DATA.json')['counts']=={'regular_coordinate_hits':4,'source_context_lifts':8,'local2K_sides':4,'cross_field_coordinate_trials':24,'original2K17K_rectangles':2,'translated_branch_rectangles':0}) check('finite common source paths',load('C380_DATA.json')['counts']=={'maximal_source_paths':4,'cumulative_max_edges':3,'regular_max_edges':2,'common_coordinate_edges':10,'consecutive_edge_pairs':6}) check('paired source closure obstruction',load('C381_DATA.json')['counts']=={'paired_source_configurations':24,'paired_two_step_paths':8,'original_rectangle_states':2,'two_step_paths_preserving17K':0,'continuations_from_original17K_state':1}) check('moving square and word census',load('C382_DATA.json')['counts']=={'source_mixed_squares':6,'finite_word_routes':24,'translated_frame_maps':20,'all_mixed_squares_commute':True}) secondary=load('ROOT_SECOND_METHOD_RESULTS.json');check('alternate root method',secondary['status']=='passed' and secondary['check_count']==179 and not secondary['new_independent_agent_review'] and secondary['original_Mirror_states']==['1:1:3','1:2:5'] and secondary['paired_two_step_paths_preserving17K']==0 and secondary['finite_word_routes']==24) 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('C373_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(374,384)] and not load('AUTHORIZATION.json')['C384_authorized']) summary='C374–C383 complete. The paired two-year repairs preserve the original2K/17K outer corners but change the internal cross-span17K+138 to17K+142. Existing corner exchange conjugates P/J at source Flood pivots; typed MT membership excludes companion rows and fixed-sum exchange reverses phase. The exhaustive frozen Flood-pivot census tests240 cumulative and9120 regular ordered coordinate pairs: only signed scale−2 cumulative and+2 regular has complete common source support, giving six and four coordinate quadruples. The two extra regular configurations are minus215 translations; SP/LXX aliases preserve source identity, and only the original full430 i3/i5 pair retains17K. J-only299→300 edges form one SP Noah-death family but do not carry whole950 biographies. Common P/J source paths have at most three cumulative or two regular edges, requiring pivots to move with the gain. Paired continuation preserves2K and corner sums but raises cross-spans by4, so the original17K states are not closed. A precise composition law survives: P_(B+h) after J_A equals J_(A+h) after P_B exactly when B−A=230h. In translated frames both are dilations about the same existing source point. Six source squares and24 finite word routes verify the law; fixed pivots have defect±20/897. No global529-preserving action or source-prescribed pairing is established.' restart='Latest completed C383; C384 is unexecuted and outside this completed authorization. Use the C383 compact kit as the active packet; read synthesis/checkpoint then locator. C378 is the complete frozen Flood-pivot census, C379 qualifies contexts and original17K pairing, C380 supplies finite source paths, C381 proves the paired cross-span drift, and C382 gives the moving-pivot mixed-square law. The primitive equal-gain relationD=230h simultaneously explains the sourced529m side and mixed-order equality. In the moving frame x0=A+299h=B+69h is an existing source input, not a new epoch anchor. Same operator counts give the same affine word map; different counts remain different slopes. Do not turn finite source paths into extra Gears, cumulative Gear transport or a global action. Keep unit J-only SP Noah-death edges distinct from common P/J edges and from biography transport. No unit-gain Flood-pivot pair exists in the frozen menus; signed scale-four candidates lack source endpoints. Full430 minus215 copies preserve local2K but not original17K against fixed cumulative sources. Prior C373 source repair, C367 nativeNoah950 translation by19K and C369 bridge remainders remain. Retain C353458+600 repairs, C343 Noah-held1058→1150→1250 E ladder and C363 source qualifications. K529,E25/23,P70/69; File02 J300/299 is a gap conversion, not ResidueProtocol. Global paired MirrorJanuaryAD1; local junctionJanuaryAD2; no civil yearzero. Regular Gears only Noah/Shem/Flood; SP minus-one person companions stay local; Flood close is separate. C287 completei2…5 differs from the wider cumulative six-edge and C319i3…7 menus. SP primary Noah death retains inclusive/harmonic qualification;500/100 and502/98 modes remain valid. No new source endpoints, phases, fitted anchors, global axes, primer reopening, canonical or graph edits. Corrected LXX8464 supplement remains awareness only:1564→1700,2484→2700,920→1000; AD3746/2300 stays superseded. Original unprefixed reports, Engine reports and C-series remain distinct. The old incompleteSeptember17 ZIP differs from the later verified intact original. Replays, replicas and coordinate aliases are not independent historical witnesses.' return {'step':'C383','completed_steps':[f'C{n}' for n in range(374,384)],'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_File_46_C365':'actual bytes match C373 frozen source manifest','C265':'checkpoint readable; certificate matches retained hash'},'new_independent_agent_review':False,'C384_executed':False,'canonical_or_graph_edits':False}