diff --git a/CHANGELOG.md b/CHANGELOG.md index b6a41a02b..6333404d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ All notable changes to this project are documented here. Format follows ### Fixed +- The product-gap baseline now records private-runtime findings only as + aggregate synthetic-fixture contracts and identifies the existing + post-scoped lineage DAG without retaining post or organization identifiers. - The public ontology now states its OWL 2 Full/RDF-Based semantics for the ADR 0036 RDF-reified project evidence, and the PROV-O support profile uses its canonical lowercase deployed IRI. diff --git a/tests/test_documentation_hygiene.py b/tests/test_documentation_hygiene.py index 010bb5e5d..3b0f9829a 100644 --- a/tests/test_documentation_hygiene.py +++ b/tests/test_documentation_hygiene.py @@ -8,12 +8,19 @@ _ROOT = Path(__file__).resolve().parents[1] _ADR_DIRECTORY = _ROOT / "docs" / "adr" +_PRODUCT_GAP_BASELINE = _ROOT / "docs" / "product-technical-gap-baseline.md" _ROLE_CATALOG_COLUMNS = ( "cataloged_team_id", "cataloged_corporate_entity_id", "cataloged_person_id", ) _ADR_NAME = re.compile(r"^(?P[0-9]{4})-.+\.md$") +_PRIVATE_POST_IDENTIFIER = re.compile( + r"(?i)" + r"\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b" + r"|\bpost(?:_id)?\s*(?:=|:)\s*[`'\"]?[a-z0-9][a-z0-9-]{5,}" + r"|\bpost\s+[`'\"]?(?:[0-9][a-z0-9-]{5,}|[a-f][a-f0-9-]{7,})\b" +) _FORBIDDEN_MARKERS = ( "PLACEHOLDER_DO_NOT_WRITE", "TODO_WRITE_ADR", @@ -46,6 +53,23 @@ def test_adr_numbers_are_unique_and_documents_are_not_placeholders() -> None: assert duplicates == [], f"duplicate ADR numbers: {duplicates}" +def test_product_gap_baseline_contains_no_private_post_identifiers() -> None: + """Buyer-gap evidence stays aggregate and cannot identify private runtime posts.""" + baseline = _PRODUCT_GAP_BASELINE.read_text(encoding="utf-8") + + for private_reference in ( + "post=synthetic-12345", + "post: synthetic-12345", + "post 12345678", + "00000000-0000-4000-8000-000000000000", + ): + assert _PRIVATE_POST_IDENTIFIER.search(private_reference) + assert _PRIVATE_POST_IDENTIFIER.search("authorized post evidence remains aggregate") is None + + match = _PRIVATE_POST_IDENTIFIER.search(baseline) + assert match is None, f"private post identifier in product-gap baseline: {match.group(0)!r}" + + def test_fetch_persisted_summary_reads_stored_catalog_ids() -> None: """ADR 0019 / 0027: fetch must not rejoin the catalog by a non-unique name."""