"""Normal-control implementation of the source-reviewed rock-loading puzzle. Stop on routing/dialogue/save mismatch; never force through a blocked climb. """ import json,os,sys,subprocess from pathlib import Path R=Path(__file__).resolve().parents[1] plan=json.loads((R/'work/193-nw-rail-guide-plan.json').read_text()) start=int(sys.argv[1])if len(sys.argv)>1 else 1 prefix=sys.argv[2]if len(sys.argv)>2 else 'NW193-rail' env=dict(os.environ,REBORN_FAST_KEYS='1',REBORN_COORD_CACHE='1',REBORN_ROUTE_CHUNK='112') def run(name,*args):subprocess.run([sys.executable,str(R/'scripts'/name),*map(str,args)],check=True,env=env) def state():return json.loads((R/'notes/navigation-state.json').read_text()) s=state() if start==1: for kind,values in plan['initial'].items(): for key,value in values.items():assert s[kind][key]==value,(kind,key,s[kind][key],value) for i,step in enumerate(plan['steps'],1): if i