from research import *
import re
s=begin(1349,'Verify the printed Regular staircase and variant cube','Does the displayed field preserve the complete located comparison?',{},['draft/03_regular_kernel.md','model/regular_kernel_complete_staircase.json'])
t=(ROOT/'draft/03_regular_kernel.md').read_text();d=json.loads((ROOT/'model/regular_kernel_complete_staircase.json').read_text())
line=next(x for x in t.splitlines() if x.startswith('1250,'))
field=[int(x) for x in re.findall(r'\d+',line)]
offsets=[int(x.split('|')[2].strip()) for x in t.splitlines() if x.startswith('| ') and x.split('|')[2].strip().isdigit()]
r={'printed_field':field,'expected_field':d['field'],'printed_offsets':offsets,'expected_offsets':sorted(t+c+h for t in [0,60] for c in [0,130] for h in [0,215])}
a=artifact('model/main_kernel_table_check.json',json.dumps(r,indent=2)+'\n')
finish(s,{'check':a},'The complete twenty-level field and all eight offsets agree with the bound models. The chapter states matched and native levels separately.','Verify the SP cap and rectangle tables.',{'field':field==d['field'],'offsets':offsets==r['expected_offsets'],'matched_scope':'Cainan-OFF' in t and 'Native Cainan' in t})
