from fractions import Fraction as F def run(load,check): E=F(25,23);reg=load('C286_DATA.json')['target_register'];rows=[] def base(g,role):return [x for x in reg if x['tradition']=='MT' and x['gear']==g and x['role']==role and x['Cainan']==x['Terah60']==0 and x['full430']==1] for r in load('C337_DATA.json')['right_2K_pairs']: i,N,R=r['i'],r['N'],r['R'];g=N['gear'];hs=base(g,'Shem birth');fs=base(g,R['role']);check(f'i{i} source pair',len(hs)==len(fs)==1);H,Flood=hs[0],fs[0];n,rr,h,f=(z['center'] for z in [N,R,H,Flood]);widths=[n-rr,n-h,n-f];primary=N['rail']=='primary' check(f'i{i} scalar ladder',F(1058)*E==1150 and F(1058)*E*E==1250) check(f'i{i} observed source widths',widths==[1058,1150-int(not primary),1250]) check(f'i{i} doubleE sourced',(n-rr)*E*E==n-f) check(f'i{i} full sourced ladder',((n-rr)*E==n-h and (n-h)*E==n-f)==primary) intermediate=[x for x in reg if x['tradition']=='MT' and x['role']=='Shem birth' and x['full430']==1 and x['center']==n-1150] check(f'i{i} no imported companion',bool(intermediate)==primary) phases=[] for e in [F(-1,4),F(1,4)]: ne,re,he,fe=(F(v)+e for v in [n,rr,h,f]);check(f'i{i} phase{e}',ne-re==widths[0] and ne-he==widths[1] and ne-fe==widths[2]);phases.append({'phase':str(e),'N':str(ne),'R':str(re),'H':str(he),'F':str(fe)}) rows.append({'i':i,'N_SP_Noah':N,'R_MT_next_restored_Flood':R,'H_MT_sameGear_base_Shem':H,'F_MT_sameGear_base_Flood':Flood,'widths':widths,'full_source_ladder':primary,'doubleE_source_endpoints':True,'required_1150_intermediate_MT_Shem_matches':intermediate,'components':phases,'actual_R_H_F_gaps':[rr-h,h-f]}) check('two full ladders',[r['i'] for r in rows if r['full_source_ladder']]==[3,5]) return {'step':'C338','E':'25/23','scalar_ladder':[1058,1150,1250],'rows':rows,'full_source_ladder_i':[3,5],'doubleE_source_endpoints_i':[2,3,4,5],'primary_increment_ladder':[92,100],'prior_art':'C01/C09 already tabulated the scalar ladder; C89 established a different complete endpoint realization. Current realization holds SP Noah and uses three MT endpoints; no global novelty is claimed.','claim_class':'Exact duration identities with separately verified source endpoint matches, not an explicit source-prescribed map.','new_anchor_or_endpoint_adopted':False}