from collections import Counter from pathlib import Path def run(load,check): text=(Path(__file__).resolve().parent.parent/'sources/AXIS_REPORT.md').read_text() check('both anchors supplied before this comparison','Exodus **1447t/1446n BC**' in text and 'Conquest **1407t/1406n BC**' in text) cum=load('C300_DATA.json')['cumulative_register'];reg=load('C286_DATA.json')['target_register'];cases=[] for Q in [1406,1446]: offset=12696-8464-(Q-6);hits=[] for c in cum: for t in reg: if c['BC']-t['center']==offset: hits.append({'cumulative':c,'regular':t,'gap':8464-t['center']-6}) pairs=[] for u in hits: if u['cumulative']['role']!='Shem':continue lower_role={'Noah birth':'Flood start','Shem birth':'Shem death'}.get(u['regular']['role']) for l in hits: if l['cumulative']['role']=='Flood' and all(u['cumulative'][k]==l['cumulative'][k] for k in ['profile','index']) and l['regular']['role']==lower_role and all(u['regular'].get(k)==l['regular'].get(k) for k in ['tradition','gear','rail','Cainan','Terah60','full430']):pairs.append({'upper':u,'lower':l}) group=Counter((h['regular']['tradition'],h['regular']['role'],h['regular']['Cainan'],h['regular']['Terah60'],h['regular']['full430']) for h in hits) cases.append({'cumulative_reflected_anchor':Q,'regular_reflected_anchor':6,'source_offset':offset,'comparison_count':len(cum)*len(reg),'matches':hits,'labeled_points':len(hits),'coordinate_points':len({(h['cumulative']['BC'],h['regular']['center']) for h in hits}),'complete600_segments':pairs,'labeled_segments':len(pairs),'coordinate_segments':len({(p['upper']['regular']['center'],p['lower']['regular']['center']) for p in pairs}),'families':[{'tradition':k[0],'role':k[1],'Cainan':k[2],'Terah60':k[3],'full430':k[4],'count':v} for k,v in sorted(group.items())]}) check('gap identity anchor'+str(Q),all(12696-h['cumulative']['BC']-Q==h['gap'] for h in hits)) cq,ex=cases check('same38016 comparisons peranchor',all(c['comparison_count']==38016 for c in cases)) check('Conquest reproduces28/18 points12/8segments',(cq['labeled_points'],cq['coordinate_points'],cq['labeled_segments'],cq['coordinate_segments'])==(28,18,12,8)) check('Conquest segmentcount bindsC302',cq['labeled_segments']==load('C302_DATA.json')['labeled_segments']) check('Exodus gives11/8points nosegments',(ex['labeled_points'],ex['coordinate_points'],ex['labeled_segments'],ex['coordinate_segments'])==(11,8,0,0)) check('Exodus onlySP_OFFShem',all(h['cumulative']['profile']=='SP_OFF' and h['cumulative']['role']=='Shem' for h in ex['matches'])) check('Exodus coversall eightannualindices',sorted({h['cumulative']['index'] for h in ex['matches']})==list(range(8))) check('Exodus familycounts4MT5SP2LXX',[sum(h['regular']['tradition']==t for h in ex['matches']) for t in ['MT','SP','LXX']]==[4,5,2]) check('offset shifts exactly40',cq['source_offset']-ex['source_offset']==40 and ex['source_offset']==2792) required_lower=[{'index':i,'required_regular_lower':4716-i-2792,'all_regular_matches':[t for t in reg if t['center']==4716-i-2792]} for i in range(8)] check('no lower1924through1917record',all(not r['all_regular_matches'] for r in required_lower)) return {'anchor_cases':cases,'Exodus_required_cumulative_Flood_partners':required_lower,'point_coverage_is_not_complete_segment_coverage':True,'new_anchor_or_bridge_introduced':False,'statistical_significance_claimed':False}