from research import *
s=begin(1354,'Verify the Covenant main table','Do all seven rows follow the same lifespan stack and clutch?',{},['draft/07_Covenant.md','model/reconstruction_Covenant.json'])
t=(ROOT/'draft/07_Covenant.md').read_text(); rows=[]
for line in t.splitlines():
 cells=[x.strip() for x in line.split('|')[1:-1]]
 if len(cells)==4 and all(x.isdigit() for x in cells[1:]): rows.append({'name':cells[0],'values':list(map(int,cells[1:]))})
lives=[175,180,147,137,133,137]; expected=[[1526+sum(lives[i:])-7*k for k in range(3)] for i in range(7)]
a=artifact('model/main_Covenant_table_check.json',json.dumps({'rows':rows,'expected':expected,'joins':{'Kohath_to_Levi_death':1782,'Levi_to_Levi_birth':1919,'Jacob_to_Isaac_birth':2066}},indent=2)+'\n')
finish(s,{'check':a},'All twenty-one main-table coordinates follow one source lifespan stack and a uniform seven/fourteen-year shift. The prose retains the separate exact phase.','Check counted-list reconstruction and its calendar state.',{'seven_rows':len(rows)==7,'all_values':[x['values'] for x in rows]==expected,'phase_kept':'3.5' in t and '1936.5' in t})
