"""Evaluator isolation: agent-visible documents contain no answers, facts or hidden tests; prompts never include key paths.""" import json, glob, re from pathlib import Path from wp30.util import ROOT def test_public_docs_have_no_keys(): for p in glob.glob(str(ROOT / "data/generated/docs/*/*.json")): d = json.load(open(p)) assert "facts" not in d and "hidden_tests" not in d for q in d["questions"]: assert "answer" not in q and "answers" not in q and "aliases" not in q def test_prompts_do_not_reference_keys(): src = (ROOT / "src/wp30/prompts.py").read_text() + (ROOT / "src/wp30/methods/text.py").read_text() assert "keys/" not in src and "hidden_tests" not in src def test_synthetic_answers_not_in_filenames(): for p in glob.glob(str(ROOT / "data/generated/docs/synthetic/*.json")): assert re.fullmatch(r"syn_\d{5}_\d+\.json", Path(p).name)