from itertools import product def run(load,check): reg=load('C286_DATA.json')['target_register'];nds=[i for i,r in enumerate(reg) if r['tradition']=='MT' and r['role']=='Noah death'];fcs=[i for i,r in enumerate(reg) if r['tradition']=='MT' and r['role']=='Flood close'];trials=[];hits=[];cs={r['center'] for r in reg};keys=['tradition','gear','Cainan','Terah60','full430'] for i,j in product(nds,fcs): a,z=reg[i],reg[j];diff=a['center']-z['center'];terms=[-349,130*(a['Cainan']-z['Cainan']),60*(a['Terah60']-z['Terah60']),215*(a['full430']-z['full430']),2*(a['gear']-z['gear'])];check('coincidence equation '+str((i,j)),sum(terms)==diff);trials.append({'Noah_death_record_index':i,'Flood_close_record_index':j,'difference':diff}) if diff==0: contexts=[] for seed in [a,z]:contexts.append({'context':{k:seed[k] for k in keys},'records':[{**r,'record_index':k} for k,r in enumerate(reg) if all(r[q]==seed[q] for q in keys)]}) upper=a['center']+1058;matches=[k for k,r in enumerate(reg) if r['center']==upper];hits.append({'record_indices':[i,j],'coordinate':a['center'],'source_terms':terms,'contexts':contexts,'required_2K_upper':upper,'upper_source_record_indices':matches}) for num,c in enumerate(contexts): rs={r['role']:r['center'] for r in c['records']};check('own Noah950 '+str((i,j,num)),rs['Noah birth']-rs['Noah death']==950);check('own Floodyear '+str((i,j,num)),rs['Flood start']-rs['Flood close']==1) overlap=load('PREVIOUS_DATA.json')['coordinate_template_overlaps'];check('C426 overlap recovered',len(overlap)==1 and overlap[0]['coordinate_pair']==[3298,2240] and any(x['coordinate']==2240 and x['upper_source_record_indices'] for x in hits)) return {'step':'C427','coincidence_trials':trials,'coincidences':hits,'counts':{'MT_Noah_death_records':len(nds),'MT_Flood_close_records':len(fcs),'record_pair_trials':len(trials),'coordinate_coincidences':len(hits),'coincidences_with_existing_2K_upper':sum(bool(x['upper_source_record_indices']) for x in hits)},'interpretation':'The coincidence equation is349=130+215+4, with matching Terah flag. It changes source context and role. Each record retains its own Noah950 biography and Flood event interval; numerical equality does not identify those source histories. No new upper coordinate is introduced when one is absent.'}