from research import *
s=begin(754,'Reconstruct the complete MT residual field','Do all 26 literal cumulative boundaries follow row rounding?',{'terminal':1406},['File51a §16.1–16.2'])
p=json.loads((ROOT/'model/rounding_inputs.json').read_text()); rows=p['native_rows']['MT_native_OFF'];q=lambda n:5*((n+2)//5)
e=[q(x['lifespan'])-x['lifespan'] for x in rows]; d=[sum(e[i:]) for i in range(len(e))]
a=[1406+sum(x['lifespan'] for x in rows[i:]) for i in range(len(rows))]
r=[x+y for x,y in zip(a,d)]
field={'names':[x['name'] for x in rows],'e':e,'D':d,'actual':a,'rounded':r,'terminal':1406}
art=artifact('model/MT_rounding_field.json',json.dumps(field,indent=2)+'\n')
finish(s,{'field':art,'D':d},'All 26 printed MT boundaries follow one suffix-sum residual field. Endpoint cancellation coexists with internal displacements from−4 to+5.','Recover the local residuals from the boundary field and identify unchanged intervals.',{'actual_literal':a==p['MT_literal_checks']['actual_cumulative_dates'],'rounded_literal':r==p['MT_literal_checks']['rounded_cumulative_dates'],'head_zero_internal_nonzero':d[0]==0 and any(d)})
