from research import *
s=begin(782,'Compare Cainan support across modes','Do regular130 and cumulative460 act on the same surviving rows?',{},['File18 §1.6; C738,C775'])
f=json.loads((ROOT/'model/native_mode_fields.json').read_text());out={}
for t,rows in f.items():
    common=[x for x in rows if x['name']!='Cainan2'];h=next(i for i,x in enumerate(common) if x['name']=='Arphaxad')
    out[t]=[{'name':x['name'],'delta_R':130*int(i<=h),'delta_C':460*int(i<=h),'delta_G':330*int(i<=h)} for i,x in enumerate(common)]
a=artifact('model/Cainan_support_modes.json',json.dumps(out,indent=2)+'\n')
finish(s,{'support_fields':a},'Cainan insertion has one upstream support and two mode weights. Its effect on the gap is330 on that prefix and0 downstream; the inserted node is represented separately.','Determine which regular state choices are forgotten by the raw lifespan projection.',{'same_support':all((x['delta_R']>0)==(x['delta_C']>0) for rows in out.values() for x in rows),'gap_identity':all(x['delta_C']-x['delta_R']==x['delta_G'] for rows in out.values() for x in rows)})
