from pathlib import Path import re ROOT=Path(__file__).resolve().parent.parent def run(load,check): texts={n:(ROOT/'sources'/n).read_text() for n in ['File_00.md','File_02.md','File_09.md','File_11.md','File_18.md']} specifications=[ ('File_00.md',1050,1117,'Do not normalize Noah and Shem by applying one uniform','Opposite father/son source directions; shared origin is explicit.'), ('File_02.md',646,808,'598','Local regular states, fixed Flood anchor, gap conversion and cumulative propagation are separately described.'), ('File_09.md',249,288,'2+3+2','Cumulative seven-year anatomy and no undeclared cumulative/regular substitution.'), ('File_11.md',331,353,'three discrete settings','Ordinary Gear register is separate from cumulative annual-member choice; only Noah/Shem/Flood scope is admitted here.'), ('File_18.md',755,772,'Noah-bound','500/100 and 502/98 are distinct valid bindings.'), ('File_18.md',1106,1116,'Ordinary coherent Gear transport','Local anomaly, coherent Gear transport, and cumulative propagation explicitly distinguished.'), ('File_18.md',1254,1285,'2841','Literal and alternative Noah/Shem directions, with SP one-year companion separate.'), ('File_18.md',1540,1552,'2460','Flood Gear boundaries exist independently of local binding mode.'), ('File_18.md',1870,1916,'Propagates','Cumulative lifespan chain and propagation rule.'), ('File_18.md',2048,2080,'5743','LXX cumulative Flood margin and source-marker distinctions.')] excerpts=[] for file,lo,hi,needle,finding in specifications: txt='\n'.join(texts[file].splitlines()[lo-1:hi]);check(f'{file}:{lo}-{hi} locator',needle in txt) excerpts.append({'file':file,'lines':[lo,hi],'text':txt,'interpretation':finding}) check('File18 common-origin and separate transport','same anomaly propagates' in texts['File_18.md'] and 'separately retained' in texts['File_18.md']) check('File00 opposing directions','Noah’s Ideal state moves later' in texts['File_00.md']) controls=load('C319_DATA.json');death=load('C332_DATA.json') check('finite controls retained',len(controls['rows'])==20 and controls['counts']['joint_source_admitted']==14) check('death leaves both a choices',{(r['a'],r['b']) for r in death['both_survivors']}=={(0,2),(2,2)}) patterns={'529':r'(?