from research import *
s=begin(833,'Freeze the complete File58 list objects','Which literal tables and declared orders are the inputs to the holdout?',{},['File58 §§3–5,7,13'])
p=ROOT/'evidence/sources/19-File_58.Numbers_28_29_Tishri_Sacrificial_Ledger-2-.md';lines=p.read_text().splitlines()
def table_after(anchor):
    start=next(i for i,z in enumerate(lines) if z.startswith(anchor));i=next(i for i in range(start+1,len(lines)) if lines[i].startswith('|'));j=i
    while j<len(lines) and lines[j].startswith('|'):j+=1
    return {'header':[x.strip() for x in lines[i].strip('|').split('|')],'rows':[{'line':k+1,'cells':[x.strip().strip('*').strip(chr(96)) for x in lines[k].strip('|').split('|')],'literal':lines[k]} for k in range(i+2,j)],'start_line':i+1,'end_line':j}
tables={k:table_after(a) for k,a in {'category':'### 3.1 Category table','leviticus':'### 4.3 Lunar comparison','feast_scale':'### 5.1 Sukkot','full_scale':'### 5.2 Full Tishri','forward':'### 7.1 Forward','reverse':'### 7.2 Reverse','esau':'### 13.1 Printed','clean_walk':'### 13.3 Male-first'}.items()}
packet={'source':p.name,'sha256':hashlib.sha256(p.read_bytes()).hexdigest(),'tables':tables,'orders':{'feast':[30,29,28,27,26,25,24,10],'drove':['Goats','Sheep','Camels','Cattle','Donkeys'],'clean_species':['Goats','Sheep','Cattle']},'guards':['printed numerals; no guessed camel young','three-Sabbath Enochian state controls280','Leviticus overlay separate','count-to-chronology is declared structural inference','no primer or appendix chronology opened']}
a=artifact('model/list_inputs.json',json.dumps(packet,indent=2)+'\n')
finish(s,{'packet':a,'literal_table_rows':{k:len(v['rows']) for k,v in tables.items()}},'The complete category, sequence and partition tables are frozen with source line locators. Subsequent tests can distinguish source inputs from generated consequences.','Reconstruct the whole seven-day Sukkot count matrix.',{'category_rows':len(tables['category']['rows'])==8,'esau_rows':len(tables['esau']['rows'])==9,'forward_reverse':len(tables['forward']['rows'])==len(tables['reverse']['rows'])==8})
