from fractions import Fraction as F def run(load,check): reg=load('C286_DATA.json')['target_register'];base=next(x for x in load('C338_DATA.json')['rows'] if x['i']==5);N,R,Flood=(base[k] for k in ['N_SP_Noah','R_MT_next_restored_Flood','F_MT_sameGear_base_Flood']);rows=[];E=F(25,23) for mode in load('C329_DATA.json')['modes']: g=mode['Shem_gear'];label=mode['binding'];h=[z for z in reg if z['tradition']=='MT' and z['role']=='Shem birth' and z['gear']==g and z['Cainan']==z['Terah60']==0 and z['full430']==1];m=[z for z in reg if z['tradition']=='MT' and z['role']=='Noah birth' and z['gear']==2 and z['Cainan']==z['Terah60']==0 and z['full430']==1];check(label+' base counterparts',len(h)==len(m)==1 and mode['records']['MT']['Shem birth']['center']-h[0]['center']==190) H,M=h[0],m[0];n,r,h,f,m=(z['center'] for z in [N,R,H,Flood,M]);widths=[n-r,n-h,n-f];gaps=[r-h,h-f];noahbound=g==2 check(label+' source modal spans',[m-h,h-f]==([500,100] if noahbound else [502,98])) check(label+' ladder widths',widths==([1058,1150,1250] if noahbound else [1058,1152,1250])) check(label+' increments',gaps==([92,100] if noahbound else [94,98])) first=E*widths[0]==widths[1];second=E*widths[1]==widths[2];check(label+' modal ladder predicate',first==second==noahbound) check(label+' unchanged doubleE',E*E*widths[0]==widths[2]) rows.append({'binding':label,'Shem_gear':g,'N':N,'R':R,'H':H,'F':Flood,'MT_base_Noah':M,'widths':widths,'R_H_F_gaps':gaps,'firstE':first,'secondE':second,'doubleE':True,'first_step_residual':str(E*widths[0]-widths[1]),'second_step_residual':str(E*widths[1]-widths[2])}) check('one source chain among two valid bindings',sum(r['firstE'] and r['secondE'] for r in rows)==1) return {'step':'C339','rows':rows,'control_scope':'Named G2 Noah/Flood with G2 versusG1 Shem; no Gear0 manufactured for G1.','conclusion':'DoubleE1058→1250 survives both valid bindings; complete1150 intermediate requiresNoah-bound500/100 within this comparison.','valid_alternative_rejected':False,'source_prescription_established':False}