from research import *
s=begin(792,'Reconstruct the complete BJ head/work index','Does the whole 22-row index have the stated ordered block structure?',{},['File53 §2 lines192–213'])
from collections import Counter
p=json.loads((ROOT/'model/jubilees_inputs.json').read_text());rows=p['tables']['works_heads']['rows']
out=[{'index':int(x['cells'][0]),'work':x['cells'][1],'day':int(x['cells'][2]),'name':x['cells'][3]} for x in rows]
counts=[sum(x['day']==d for x in out) for d in range(1,7)]
a=artifact('model/BJ_head_index.json',json.dumps(out,indent=2)+'\n')
finish(s,{'index':a,'day_counts':counts,'status':'File53 structural parallel; not independently verified ancient authorial intent'},'The entire22-row object has day-block counts7|1|4|3|3|4. It is a labelled index structure before any duration is assigned.','Insert the retained Kainan position and recover the deletion map.',{'consecutive':[x['index'] for x in out]==list(range(1,23)),'blocks':counts==[7,1,4,3,3,4]})
