1import hashlib, json2from pathlib import Path3ROOT = Path(__file__).resolve().parents[1]45def test_registry_hashes_match_raw_files():6 reg = json.loads((ROOT / "data/metadata/source_registry.json").read_text())7 assert len(reg) >= 88 for k, rec in reg.items():9 p = ROOT / rec["local_path"]10 if not p.exists(): # raw files are not committed; skip on a fresh clone11 continue12 h = hashlib.sha256(p.read_bytes()).hexdigest()13 assert h == rec["sha256"], k14