1"""Every public bundle must be free of oracle material; every oracle must exist with the required files."""2import os, glob, json, sys3sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "src"))4from pgar.isolation import FORBIDDEN_NAME_FRAGMENTS5REPO = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))67def test_bundles_clean_and_oracles_present():8 for b in sorted(glob.glob(os.path.join(REPO, "tasks", "public_bundles", "*"))):9 tid = os.path.basename(b)10 for root, _, fs in os.walk(b):11 for f in fs:12 assert not any(x.lower() in f.lower() for x in FORBIDDEN_NAME_FRAGMENTS), (tid, f)13 if f.endswith((".md", ".json", ".csv", ".txt")):14 txt = open(os.path.join(root, f), errors="replace").read().lower()15 assert "wp29-oracles" not in txt and "reference value" not in txt, (tid, f)16 od = os.path.expanduser(f"~/wp29-oracles/{tid}")17 assert os.path.isfile(os.path.join(od, "oracle.json")) and os.path.isfile(os.path.join(od, "evaluate.py")), tid18 assert os.path.isfile(os.path.join(b, "bundle.json")) and os.path.isfile(os.path.join(b, "gate_spec.json")) and os.path.isfile(os.path.join(b, "TASK.md"))19