from pathlib import Path from itertools import product from collections import Counter def run(load,check): prior=load('C285_DATA.json');targets=list(prior['target_register']) base=[e for e in load('C01_RESULTS.json')['events'] if not e['role'].startswith('Flood')] text=(Path(__file__).resolve().parent.parent/'sources/FILE_18.md').read_text() check('LXX Noah anchor read','| Noah | 3623 | 2673 | 950 | 500 |' in text) check('LXX Shem anchor read','| Shem | 3121 | 2521 | 600 | 100 |' in text) lxx=[dict(e,tradition='LXX',BC_Nisan=e['BC_Nisan']+780) for e in base if e['tradition']=='MT'] check('LXX G2 Noah anchor',next(e['BC_Nisan'] for e in lxx if e['role']=='Noah birth' and e['gear']==2)==3623+215) check('LXX G1 Shem anchor',next(e['BC_Nisan'] for e in lxx if e['role']=='Shem birth' and e['gear']==1)==3121+215) for e in base+lxx: for c,t,z in product(range(2),repeat=3): y=e['BC_Nisan']+130*(c-int(e['tradition']=='LXX'))+60*t-215*(1-z) targets.append({'tradition':e['tradition'],'gear':e['gear'],'role':e['role'],'rail':e['rail'],'Cainan':c,'Terah60':t,'full430':z,'center':y}) check('528 qualified target records',len(targets)==528) check('no nonSP companion',all(t.get('rail')!='companion' or t['tradition']=='SP' for t in targets)) hits=[];hist=Counter();tested=0 for a in prior['source_pairs']: for t in targets: tested+=1;b=t['center']-a['F'];good=a['first']%529==b%529==0 if good:hits.append(dict(a,target=t,second=b,total=a['first']+b)) hist['bothK' if good else 'not_bothK']+=1 check('complete135168 domain',tested==135168) check('all first legs2K',all(h['first']==1058 for h in hits)) check('every hit remains source-bound',all(h['Shem_Cainan']==1 and h['Flood_Cainan']==0 and h['Flood_index']==h['Shem_index']-2 for h in hits)) check('twelve labeled hits',len(hits)==12) check('only17K and19K totals',{h['total']//529 for h in hits}=={17,19}) check('no Shem or death endpoint',{h['target']['role'] for h in hits}=={'Flood start','Flood close','Noah birth'}) families=Counter((h['target']['tradition'],h['target']['role'],h['second']//529,h['total']//529) for h in hits) return {'source_pairs':prior['source_pairs'],'target_register':targets,'comparison_count':tested,'counts':dict(hist),'all_K_hits':hits,'families':[{'tradition':k[0],'role':k[1],'second_K':k[2],'total_K':k[3],'count':v} for k,v in sorted(families.items())],'LXX_generation':'MT counterpart+780 with native Cainan ON; two canonical anchors checked; no companion copied'}