"""C273 dependency synthesis: certify retained inputs and check core equations only. This does not rerun the C266–C272 campaigns or claim machine proof of editorial judgments. """ from pathlib import Path from fractions import Fraction as Q import argparse, csv, hashlib, json ROOT=Path(__file__).resolve().parents[1] parser=argparse.ArgumentParser() parser.add_argument('--output',type=Path,default=ROOT/'evidence') OUT=parser.parse_args().output OUT.mkdir(parents=True,exist_ok=True) checks=[] def check(name,condition): if not condition: raise AssertionError(name) checks.append(name) def sha(path): return hashlib.sha256(path.read_bytes()).hexdigest() def read(name): return json.loads((ROOT/'sources'/name).read_text()) def dump(name,value): (OUT/name).write_text(json.dumps(value,indent=2,ensure_ascii=False,default=str)+'\n') manifest=json.loads((ROOT/'SOURCE_MANIFEST.json').read_text()) for name,row in manifest.items(): p=ROOT/'sources'/name check('frozen '+name,sha(p)==row['sha256'] and p.stat().st_size==row['bytes']) check('C265 chain root',sha(ROOT/'sources/C265_CERTIFICATE.json')=='112bdcdd23e7580512f6b6a1c4222f746e6552f71b92755932397dbd25dce2de') check('C272 current head',sha(ROOT/'sources/C272_CERTIFICATE.json')=='9947d90e99cb8f010076cea2795c3138ab9d7d3e393b469db83f6332fc36fdd0') retained=[] for step in range(266,273): cert=read(f'C{step}_CERTIFICATE.json') result=read(f'C{step}_RESULTS.json') check(f'C{step} previous certificate',cert['previous_certificate_sha256']==sha(ROOT/'sources'/f'C{step-1}_CERTIFICATE.json')) check(f'C{step} report binding',cert['report_sha256']==sha(ROOT/'sources'/f'C{step}_REPORT.md')) check(f'C{step} results binding',cert['results_sha256']==sha(ROOT/'sources'/f'C{step}_RESULTS.json')) check(f'C{step} retained passing status',result['status']=='passed') retained.append({'step':f'C{step}','certificate_sha256':sha(ROOT/'sources'/f'C{step}_CERTIFICATE.json'),'historical_assertions':result['check_count'],'historical_campaign_rerun':False}) check('latest checkpoint binding',sha(ROOT/'sources/C272_CHECKPOINT.md')==read('C272_CERTIFICATE.json')['checkpoint_sha256']) for name,expected in [('FILE_18.md','68301ab760bfbe2e874aedc5c8d943ced7a6219d34bc2859332a70713f9630d5'),('FILE_09.md','45851004c5864229ebf6a896f9099819a08d8926715d3e97e4bc3985c4a3876e')]: check('controller '+name,sha(ROOT/'sources'/name)==expected) spec=json.loads((ROOT/'CLAIMS_SPEC.json').read_text()) claims=spec['claims'];seen=set();edges=[] for claim in claims: check('dependency order '+claim['id'],claim['id'] not in seen and all(p in seen for p in claim['requires'])) check('source references '+claim['id'],all(s in manifest for s in claim['sources'])) edges.extend({'from':p,'to':claim['id'],'meaning':'declared dependency, not independent-witness support'} for p in claim['requires']) seen.add(claim['id']) check('declared claim groups',len(claims)==18 and sum(c['id'].startswith('I') for c in claims)==7 and sum(c['id'].startswith('D') for c in claims)==10) # Targeted rearrangement of the inherited joining conditions, not a new normalization search. f=Q(5889+5289-598,2);h=f+598 check('conditional MT closing equation',f-5289==5889-h==1 and f==5290 and h==5888) sp_f=Q(4716)-(f-5289);sp_h=sp_f+598 check('conditional SP reflected interval',sp_f==4715 and sp_h==5313 and [sp_f-4716,sp_f-4709]==[-1,6]) check('local residual and junction',600-598==2 and Q(600-598,2)==1) check('K difference identities',f==10*529 and 8993==17*529 and 8993-f==7*529==3703) check('cross-profile shifted difference',f-sp_f==575==Q(25,23)*529 and 580-575==5 and 575-574==1) endpoints=read('C266_ENDPOINTS.json') fields=[] for profile,expected in [('MT_ON',([-6,1],[1,8])),('SP_OFF',([-1,6],[-4,3])),('LXX_OFF',([0,7],[-5,2]))]: F=[r for r in endpoints if r['profile']==profile and r['source_role']=='Flood'] RH=[r for r in endpoints if r['profile']==profile and r['source_role']=='Shem' and r['reflection_after_translation']] fs=sorted(r['pair_center'] for r in F);rs=sorted(r['pair_center'] for r in RH) check(profile+' inherited field limits',[fs[0],fs[-1]]==expected[0] and [rs[0],rs[-1]]==expected[1]) check(profile+' local reflection',rs==sorted(2-x for x in fs)) fields.append({'profile':profile,'Flood_centers':[fs[0],fs[-1]],'reflected_Shem_centers':[rs[0],rs[-1]]}) sequence=[-6,-1,0,1,6,7,8] check('central chronological completion',[b-a for a,b in zip(sequence,sequence[1:])]==[5,1,1,5,1,1] and sequence[-1]-sequence[0]==14) check('selected outer radii',[1-(-4),7-1,8-1]==[5,6,7]) check('LXX midpoint roles',1000*(Q(7,2)-1)==2500 and 1000*(Q(-3,2)-1)==-2500) check('LXX component radii',Q(27,4)-1==Q(23,4) and Q(29,4)-1==Q(25,4) and Q(25,4)/Q(23,4)==Q(25,23)) check('phase width under E changes',Q(25,23)*Q(1,2)==Q(25,46) and Q(25,46)!=Q(1,2)) envelopes=read('C267_ENVELOPES.json') check('retained envelope sum versus union',envelopes['sum']==15000 and envelopes['overlap']==500 and envelopes['union']==14500 and envelopes['core_eta_hull']==['-7250','7250']) rectangle=read('C269_RECTANGLE.json');centers=rectangle['source_centers'] check('closing rectangle identities',centers=={'Shem_close':-5883,'Flood_close':-5283,'SP_G3_Flood_start':3110,'SP_G3_primary_Noah_birth':3710}) check('closing rectangle spans',3110+5883==3710+5283==8993 and 3710-3110==5883-5283==600) check('retained598plus2 subdivision',-5285-(-5883)==3708-3110==598 and -5283-(-5285)==3710-3708==2) paths=read('C269_PATHS.json') closing=paths['inherited_C254_closing_route'] check('inherited C254 closing path',closing['centers']==[-5283,-4415,1404,2460,3710] and closing['widths']==[868,5819,1056,1250] and sum(closing['widths'])==8993) check('closing prefix remains6875',5819+1056==6875 and 6875!=6877 and paths['C09_closing_translation_limit']['MT_Flood_source_match'] is False) graph=read('C269_GRAPH_INCIDENCE.json') check('graph status preserved',graph['Flood_closing_stored_node'] is None and graph['Shem_closing_node']['signed_center']==-5883 and graph['graph_modified'] is False) maps=read('C270_MAPS.json') check('induced maps retained',tuple(map(Q,maps['regular_reflected_Noah_map']))==(1,-3703) and tuple(map(Q,maps['regular_reflected_Flood_map']))==(-1,3105)) check('compositions with inverse source translation',-8993+5290==-3703 and 8993-5888==3105) families=read('C271_FAMILIES.json') check('six radius families retained',sorted(Q(r['radius']) for r in families)==list(range(1,7))) for family in families: rho=Q(family['radius']);c=int(family['binding']=='companion/close');g=family['gear'] check('retained selector rho'+str(rho),rho==2*g-c and family['cumulative_index']==rho+1 and list(map(Q,family['local_centers']))==[rho+1,1-rho]) check('retained pair counts',read('C271_RESULTS.json')['exact_J1_pairs']==6 and read('C271_RESULTS.json')['nonmatching_pairs']==30) coverage=read('C271_COVERAGE.json') check('source coverage limits',all(c['covered_indices']==list(range(2,8)) and [r['cumulative_source']['source_index'] for r in c['missing']]==[0,1] for c in coverage)) check('calibrated scales',Q(6877)/Q(23,4)==1196 and Q(7475)/Q(23,4)==1300) check('macro chain and midpoint widths',6877==13*529 and 7475==13*575 and 8125==13*625 and 7475-6877==598 and 8125-7475==650 and (6877+7475)/2==7176 and (7475+8125)/2==7800) check('equivalent radius six conditions',Q(25,23)==Q(4*6+1,4*6-1) and Q(1196+1300,4*(1300-1196))==6) correspondence=read('C268_CORRESPONDENCE.json') check('target midpoint qualification',sorted(Q(r['target_center']) for r in correspondence if r['local_role']=='pair center' and r['target_source'] is None)==[3381,3383] and sorted(Q(r['target_center']) for r in correspondence if r['local_role']=='pair center' and r['target_source'] is not None)==[2757,2759]) operators=read('C269_OPERATORS.json') check('chart anchor differs from source attachment',all(r['original_source_anchor']==-5289 and r['retained_attachment_source']!=-5289 and r['image_minus_attachment_target']!=0 for r in operators['C268_source_charts'])) check('attachment discrepancies retained',[r['image_minus_attachment_target'] for r in operators['C268_source_charts']]==[2392,2600,4784,5200]) classification=read('C272_CLASSIFICATION.json') check('retained chart audit counts',classification['hit_instances']==10 and classification['distinct_target_records']==8 and classification['generated_instances']==62 and classification['distinct_image_centers']==70) check('retained outer-only hits',all(Q(r['radius'])==6 for r in classification['source_hits']) and classification['all_hits_inherited_from_C268'] is True) check('stage gap formula retained',read('C272_STAGES.json')['endpoint_gap_formula']=='104(rho−6)') equations={'coordinate_controls':{'Mirror':'M(x)=−x','local_reflection':'J1(x)=2−x','eta':'1000(x−1)','pair_components':'x±1/4; inherited physical-phase convention'},'conditional_placement_recovery':{'premises':['MT Shem translation h=f+598','translated MT Flood closing equals reflected translated MT Shem closing','LXX uses the same Flood translation as MT','SP translated Flood interval equals global Mirror of MT translated Flood interval'],'MT_equation':'f−5289=5889−(f+598)','solution':{'MT_LXX_Flood':f,'MT_LXX_Shem':h,'SP_Flood':sp_f,'SP_Shem':sp_h},'status':'conditional algebraic determination, not independent justification of premises'},'fields':fields,'central_sequence':sequence,'source_rectangle':centers,'induced_maps':{'Noah':'y−3703','Flood':'3105−y','Noah_shift':'3703=17K−10K=7K'},'six_radius_rule':{'index':'j=2g+1−c','radius':'rho=2g−c','binding_residual':'2(gN−gF)−cN+cF'},'equivalent_outer_conditions':['(4rho+1)/(4rho−1)=25/23','104(rho−6)=0','rho=6'],'chart_scales':[1196,1300],'target_midpoints':{'sourced':[2757,2759],'generated':[3381,3383]},'attachment_chart_discrepancies':[2392,2600,4784,5200]} limits={'strongest_unresolved':'Whether the chronology independently requires the declared placement and calibration conditions that connect source paths to the local/macro display. Conditional equations do not establish that requirement.','connected_source_paths':'Established for the selected closing members; do not describe source connectivity as still missing.','operator_nonidentity':'Source translations preserve half-year spacing;1196/1300 charts rescale it and fail to reproduce the retained868 attachment at its defining source point.','finite_coverage':'C271 covers source indices2–7;indices0/1 remain absent in the admitted regular register.','midpoints':'325 midpoints remain generated in the held48-record register.','geometry_roles':'2500 midpoint,5750/6250 components,5000/6000/7000 center radii,7500 envelope length; center14, envelope sum15, union14.5.','macro_scope':'No common historical event-path realization of every converted macro radius or z-law is established.','independence':'Seven reports and their checks are not independent witness counts; the dependency groups are not proved to form a minimal independent axiom basis.','review':'Single-agent C273 synthesis and targeted consistency checks; prior campaign reviews remain prior work.','next_step':'C274 proposed constraint-omission audit; not executed'} dump('CLAIM_LEDGER.json',spec) dump('DEPENDENCY_DAG.json',{'nodes':[{'id':c['id'],'kind':c['kind'],'title':c['title']} for c in claims],'edges':edges,'topological_order':[c['id'] for c in claims],'acyclic':True,'semantic_truth_not_machine_proved':True}) dump('CORE_EQUATIONS.json',equations) dump('LIMITS_REGISTER.json',limits) dump('RESULTS.json',{'step':'C273','status':'passed','check_count':len(checks),'checks':checks,'retained_certificates':retained,'frozen_inputs':len(manifest),'claim_groups':18,'historical_campaigns_rerun':False,'new_event_search':False,'canonical_sources_modified':False,'graph_modified':False,'new_independent_review':False,'assessment_status':'source-qualified authored synthesis; machine checks cover integrity, references, dependency order and explicit arithmetic'}) with (OUT/'CLAIM_LEDGER.csv').open('w',newline='') as handle: writer=csv.writer(handle);writer.writerow(['id','kind','title','claim','requires','sources']) for c in claims:writer.writerow([c[k] for k in ['id','kind','title','claim']]+['; '.join(c['requires']),'; '.join(c['sources'])]) print(json.dumps({'step':'C273','status':'passed','checks':len(checks),'frozen_inputs':len(manifest),'claim_groups':18,'outputs':6,'old_campaigns_rerun':False}))