from research import *
s=begin(846,'Regenerate the complete clean category-order walk','Do declared category keys determine every source landing without selecting targets?',{'anchor':1896,'sort_keys':['male before female','goats sheep cattle']},['File58 §13.3'])
p=json.loads((ROOT/'model/list_inputs.json').read_text());data=json.loads((ROOT/'model/Esau_joint_measurements.json').read_text())['rows'];order=p['orders']['clean_species']
rr=sorted([x for x in data if x['purity']=='clean'],key=lambda x:(x['sex']!='male',order.index(x['species'])))
v=[x['count'] for x in rr];coords=[1896-sum(v[:i]) for i in range(1,7)]
finish(s,{'ordered_counts':v,'landings':coords,'source_rows_used':[(x['species'],x['sex']) for x in rr]},'The predeclared male-first/species order yields all six source landings, including its intermediate boundaries. The result depends on category order in addition to the conserved490 total.','Explain the female cumulative register without turning it into one date walk.',{'counts':v==[20,20,10,200,200,40],'all_literal':coords==[int(x['cells'][2].split()[0]) for x in p['tables']['clean_walk']['rows']],'once_each':len(set((x['species'],x['sex']) for x in rr))==6})
