from research import *
s=begin(794,'Reconstruct the BJ deletion path','Does deleting the57-year edge preserve the supplied upstream and downstream relations?',{},['File53 §3A.1–2'])
p=json.loads((ROOT/'model/jubilees_inputs.json').read_text())['literal_inputs']['deletion']
old=[p['creation_original'],p['flood_original'],p['kainan_original'],p['shelah_fixed']]
new=[p['creation_expunged'],p['flood_expunged'],p['shelah_fixed']]
gaps=lambda a:[a[i]-a[i+1] for i in range(len(a)-1)]
out={'original':old,'secondary_expunged':new,'original_gaps':gaps(old),'expunged_gaps':gaps(new),'total_before_after':[old[0]-old[-1],new[0]-new[-1]]}
a=artifact('model/BJ_deletion_path.json',json.dumps(out,indent=2)+'\n')
finish(s,{'path':a,**out},'The secondary contraction removes57 while holding Shelah fixed and shifting both upstream Creation and Flood by57. The1307 Creation–Flood interval is retained as inherited source structure.','Compare the index and duration weights across BJ, regular, and cumulative Cainan operations.',{'preserved_1307':gaps(old)[0]==gaps(new)[0]==1307,'removed57':old[0]-old[-1]-(new[0]-new[-1])==57,'remaining67':gaps(new)[1]==67})
