from fractions import Fraction as Q def run(load,check): rows=[];events=load('C01_RESULTS.json')['events'] for old in load('C279_DATA.json')['triangles']: j=old['index_j'];g=j//2;c=j%2==0;role='Flood close' if c else 'Flood start' mt=[e for e in events if e['tradition']=='MT' and e['gear']==g and e['role']==role] check(f'MT baseline unique j{j}',len(mt)==1) A=old['Flood_partner_signed']-460;B=old['Shem_signed']-460;R=mt[0]['BC_Nisan']+130+60 check(f'documented counterpart j{j}',R==old['bilateral_MT_R'] and -A==old['bilateral_ON_C']) check(f'different460 operations j{j}',old['regular_reflected']-R==650-130-60==460) check(f'triangle invariant j{j}',A-B==598 and R-A==8395 and R-B==8993) for e in [Q(-1,4),Q(1,4)]:check(f'phase j{j} {e}',B+e+598+8395==R+e) rows.append({'index':j,'Shem_LXX_ON':B,'Flood_LXX_ON':A,'MT_baseline':mt[0],'regular_MT_ON_Terah60_full430':R,'state_shift_signed':-460}) check('native field bases',rows[0]['Shem_LXX_ON']==-6348 and rows[0]['Flood_LXX_ON']==-5750) return {'rows':rows,'complete_triangles':len(rows),'source_operation_cumulative':'Cainan OFF to ON: BC numeral+460, signed center-460','source_operation_regular':'SP OFF to MT ON+60: BC numeral-650+130+60=-460','same_signed_coordinate_change':-460,'same_historical_operation':False}