diff --git a/scripts/verify_corpus.py b/scripts/verify_corpus.py index 9ac8550..af30fd6 100644 --- a/scripts/verify_corpus.py +++ b/scripts/verify_corpus.py @@ -444,10 +444,16 @@ def validate(root: Path) -> list[dict[str, str]]: problems.append( issue(CRITERIA[0], "giant_fixture_too_small", relative, str(len(content)), "regenerate a fixture of at least 1,000,000 bytes") ) - for label, pattern in SECRET_PATTERNS.items(): + for pattern in SECRET_PATTERNS.values(): if pattern.search(content): problems.append( - issue(CRITERIA[0], "possible_secret_in_fixture", relative, label, "replace the content with an unmistakably synthetic non-secret value") + issue( + CRITERIA[0], + "possible_secret_in_fixture", + relative, + "Sensitive pattern detected; fixture bytes and category withheld", + "replace the content with an unmistakably synthetic non-secret value", + ) ) for label, pattern in PII_PATTERNS.items(): if pattern.search(content): diff --git a/tests/test_corpus.py b/tests/test_corpus.py index db249b4..cb0f169 100644 --- a/tests/test_corpus.py +++ b/tests/test_corpus.py @@ -173,9 +173,19 @@ def test_secret_privacy_and_unsafe_content_scans_fail_closed(self) -> None: fixture["byte_count"] = path.stat().st_size fixture["sha256"] = hashlib.sha256(path.read_bytes()).hexdigest() self.write_manifest(root, manifest) - codes = self.codes(root) + problems = VERIFY.validate(root) + codes = {problem["code"] for problem in problems} self.assertIn("possible_secret_in_fixture", codes) self.assertIn("possible_pii_in_fixture", codes) + secret_messages = { + problem["message"] + for problem in problems + if problem["code"] == "possible_secret_in_fixture" + } + self.assertEqual( + {"Sensitive pattern detected; fixture bytes and category withheld"}, + secret_messages, + ) def test_giant_json_and_jsonl_are_both_present(self) -> None: manifest = self.load_manifest(ROOT)