from research import *
s=begin(1235,'Compare the complete generated field with the literal MT table','Do all source births agree, including the rounding displacement changes?',{},['C1234','File51a §3.1','prep/moses_centred_construction.json'])
d=json.loads((ROOT/'model/Moses_MT_complete_path.json').read_text());by={r['name']:r for r in d['rows']};p=json.loads((ROOT/'prep/moses_centred_construction.json').read_text());lines=(ROOT/'evidence/sources/39-File_51a.Rounded_Scaffold_Mod5_Architecture.md').read_text().splitlines();out=[]
for r in p['literal_MT_rounded_table_verification']:
 assert lines[r['source_line']-1]==r['raw'];got=by[r['name']];out.append({'name':r['name'],'line':r['source_line'],'generated_rounded':got['rounded_BC'],'literal_rounded':r['rounded_BC'],'generated_actual':got['actual_BC'],'literal_actual':r['actual_no_plus2_BC'],'shift':got['rounded_BC']-got['actual_BC']})
a=artifact('model/Moses_MT_literal_comparison.json',json.dumps(out,indent=2)+'\n')
finish(s,{'literal_comparison':a,'source_births':len(out)},'All23 source births agree in both the strictActual and Rounded columns. The complete displacement pattern is reproduced without fitting individual BC labels.','Partition the generated whole path at the source-appointed Adam, Seth, Enoch, Arphaxad andReu nodes.',{'all23':len(out)==23,'all_fields':all(x['generated_rounded']==x['literal_rounded'] and x['generated_actual']==x['literal_actual'] for x in out)})
