from pathlib import Path import subprocess,json,re,hashlib ROOT=Path(__file__).resolve().parents[5];P=ROOT/'agents/rocko/work/queue-219';OUT=P/'r5' files=sorted(ROOT.glob('packages/*/tests/**/*'))+sorted(ROOT.glob('scripts/test-*.sh')) files=[f for f in files if f.is_file()] texts={f:f.read_text(errors='replace') for f in files} rows=[] for path in (P/'changed-paths.txt').read_text().splitlines()+['packages/webui/src/public/bus.js']: base=Path(path).name;hits=[] for f,text in texts.items(): for n,line in enumerate(text.splitlines(),1): if path in line or base in line:hits.append(dict(file=str(f.relative_to(ROOT)),line=n,text=line)) rows.append(dict(path=path,hits=hits)) pins=[] for f,text in texts.items(): for n,line in enumerate(text.splitlines(),1): if re.search(r'(?