from fractions import Fraction as F from pathlib import Path ROOT=Path(__file__).resolve().parent.parent def run(load,check): reg=load('C286_DATA.json')['target_register'];rows=[];ratio=F(300,299) text=(ROOT/'sources/File_02.md').read_text();check('source gap conversion','598\\times300/299=600' in text and 'converts a gap, not a date' in text) for x in load('C331_DATA.json')['rows']: i=x['i'];M,R=x['records']['M'],x['records']['R'];m,r=M['center'],R['center'];d=m-r;converted=ratio*d def matches(role,v):return [z for z in reg if z['tradition']=='MT' and z['role']==role and z['Cainan']==z['Terah60']==z['full430']==1 and z['center']==v] upper=matches('Noah birth',r+converted);lower=matches(R['role'],m-converted);primary=x['rail']=='primary' check(f'i{i} controlled input',d==(598 if primary else 599)) check(f'i{i} converted gap',converted==(600 if primary else F(179700,299))) check(f'i{i} existing endpoint matches',bool(upper)==bool(lower)==primary) if primary: check(f'i{i} same-Gear repairs',len(upper)==len(lower)==1 and upper[0]['gear']==R['gear'] and lower[0]['gear']==M['gear']) check(f'i{i} directions',upper[0]['center']==m+2 and lower[0]['center']==r-2) rows.append({'i':i,'rail':x['rail'],'M':M,'R':R,'input_gap':d,'converted_gap':str(converted),'hold_Flood_Noah_matches':upper,'hold_Noah_Flood_matches':lower,'diagnostic_requirements':{'Noah':str(r+converted),'Flood':str(m-converted)},'new_endpoint_adopted':False}) check('two primary realizations',sum(bool(x['hold_Flood_Noah_matches']) for x in rows)==2) return {'step':'C344','ratio':'300/299','rows':rows,'source_local_example':{'Noah598':2841,'Noah600':2843,'held_Flood':2243,'full430_T60_CainanON_translation':405},'source_scope':'File02 §6.2 holds Flood2243; §6.3 converts598 to600, not dates or ResidueProtocol. The alternate held-Noah repair uses independently admitted Flood Gear records.','companion_conversion':'599×300/299=601+1/299, not601','source_prescribed_global_map':False}