import hashlib, json from pathlib import Path ROOT = Path(__file__).resolve().parents[1] def test_registry_hashes_match_raw_files(): reg = json.loads((ROOT / "data/metadata/source_registry.json").read_text()) assert len(reg) >= 8 for k, rec in reg.items(): p = ROOT / rec["local_path"] if not p.exists(): # raw files are not committed; skip on a fresh clone continue h = hashlib.sha256(p.read_bytes()).hexdigest() assert h == rec["sha256"], k