test_the_catalog_precedence_is_declaration_then_convention¶
Tests › tests/test_build_docs_db.py
What this test is for
Why it exists
TWO RESOLVERS DISAGREED, AND ONLY ONE DOOR SHOWED IT. `cli` resolved `--requirements or declared_catalog_path(...)` and never looked for a conventional file. The MCP server COMPOSED `repo/"requirements.yaml"` and passed it in the EXPLICIT-FLAG slot — so through MCP the convention outranked a repo's DECLARED `impact.requirements.file`, and through the CLI the convention did not exist at all.
Verifies REQ-DDB-PIPE-001 REQ-DDB-PIPE-010
Given
declared = tmp_path / "docs" / "reqs.yaml"declared.parent.mkdir()
4 more
declared.write_text("requirements: {}\n", encoding="utf-8")conventional = tmp_path / "requirements.yaml"conventional.write_text("requirements: {}\n", encoding="utf-8")cfg = {"requirements": {"file": "docs/reqs.yaml"}}
When
resolve_catalog_path(cfg, tmp_path)resolve_catalog_path({}, tmp_path)conventional.unlink()
Then
- ✓ resolve_catalog_path(cfg, tmp_path) equals declared.resolve()
- ✓ resolve_catalog_path({}, tmp_path) equals conventional
- ✓ resolve_catalog_path({}, tmp_path) is None
tests/test_build_docs_db.py:2139 · its file's page
What it checks (3)
assert resolve_catalog_path(cfg, tmp_path) == declared.resolve()observesresolve_catalog_pathassert resolve_catalog_path({}, tmp_path) == conventionalobservesresolve_catalog_pathassert resolve_catalog_path({}, tmp_path) is Noneobservesresolve_catalog_path
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Requirements it verifies (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-001 | catalog | unknown |
| REQ-DDB-PIPE-010 | catalog | unknown |
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-SCHEMA-006 measured