from pathlib import Path ROOT=Path(__file__).resolve().parent.parent def run(load,check): old=load('C300_DATA.json')['cumulative_register'];reg=load('C286_DATA.json')['target_register'];cum=load('C364_DATA.json')['register'];noahs=[];rects=[] def member(role,c,k):return next(r for r in cum if r['role']==role and r['Cainan']==c and r['annual_index']==k) text=(ROOT/'sources/Engine_III.md').read_text();table=(ROOT/'sources/File_18.md').read_text() check('source role seam supplied','Shem birth / Noah death' in text and '6350–6343' in text and '5890–5883' in text) check('native Noah source derivation supplied','8053–8046' in table and '| Lamech, chain | 753 | 8048 BC |' in table and 8053-753==7300 and 8046-753==7293) for k in range(8): off=next(x for x in old if x['profile']=='LXX_OFF' and x['role']=='Noah' and x['index']==k) soff=member('Shem',0,k);son=member('Shem',1,k);offc=-off['BC'];onc=son['coordinate']-950 check('Noah source lineage '+str(k),offc==soff['coordinate']-950 and onc==offc-460 and onc==-7300+k) nn=[{'mode':'cumulative','tradition':'LXX','role':'Noah birth','Cainan':c,'annual_index':k,'coordinate':v,'provenance':('C300 derived OFF Noah' if c==0 else 'File18 LXX Lamech753 predecessor and native Shem minus950; consistent with OFF minus460'),'regular_Gear':None} for c,v in [(1,onc),(0,offc)]];noahs+=nn vals=[onc,offc,son['coordinate'],soff['coordinate']] check('cumulative950 rectangle '+str(k),[vals[j+1]-vals[j] for j in range(3)]==[460,490,460] and vals[2]-vals[0]==vals[3]-vals[1]==950) rects.append({'annual_index':k,'records':[nn[0],nn[1],son,soff],'ordered_coordinates':vals,'partition':[460,490,460],'lifespans':[950,950]}) rr=[] for g in [1,2,3]: def one(t,role,c,terah,rail=None):return next(x for x in reg if x['tradition']==t and x['role']==role and x['gear']==g and x['Cainan']==c and x['Terah60']==terah and x['full430']==1 and x.get('rail')==rail) src=[one('SP','Noah birth',0,0,'primary'),one('MT','Noah birth',1,1),one('SP','Noah death',0,0,'primary'),one('MT','Noah death',1,1)] v=[x['center'] for x in src];check('regular rectangle '+str(g),[v[j]-v[j+1] for j in range(3)]==[460,490,460] and v[0]-v[2]==v[1]-v[3]==950) rr.append({'gear':g,'records':src,'ordered_coordinates':v,'partition':[460,490,460]}) matches=[] for cr in rects: for tr in rr: sums=[u+v for u,v in zip(cr['ordered_coordinates'],tr['ordered_coordinates'])] check('complete interval shape '+str((cr['annual_index'],tr['gear'])),len(set(sums))==1) matches.append({'annual_index':cr['annual_index'],'gear':tr['gear'],'common_coordinate_sum_diagnostic':sums[0],'source_role_correspondence':['native cumulative Noah birth -> SP Noah birth','OFF cumulative Noah birth -> restored-MT Noah birth','native cumulative Noah death/Shem seam -> SP Noah death','OFF cumulative Noah death/Shem seam -> restored-MT Noah death'],'new_axis_adopted':False}) return {'step':'C365','cumulative_register':cum+noahs,'cumulative_rectangles':rects,'regular_rectangles':rr,'shape_matches':matches,'counts':{'source_members':48,'cumulative_rectangles':8,'regular_rectangles':3,'shape_matches':24},'interpretation':'Matched950 biographies and460 Cainan/context intervals give the same460/490/460 shape with opposite coordinate orientation. This is source-derived interval structure, not a newly adopted reflection axis or coupled annual/Gear selector.'}