test_the_catalog_precedence_is_declaration_then_convention

Tests › tests/test_build_docs_db.py

passed Passed in the packaged run.

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

  1. declared = tmp_path / "docs" / "reqs.yaml"
  2. declared.parent.mkdir()
4 more
  1. declared.write_text("requirements: {}\n", encoding="utf-8")
  2. conventional = tmp_path / "requirements.yaml"
  3. conventional.write_text("requirements: {}\n", encoding="utf-8")
  4. cfg = {"requirements": {"file": "docs/reqs.yaml"}}
→

When

  1. resolve_catalog_path(cfg, tmp_path)
  2. resolve_catalog_path({}, tmp_path)
  3. conventional.unlink()
→

Then

  1. ✓ resolve_catalog_path(cfg, tmp_path) equals declared.resolve()
  2. ✓ resolve_catalog_path({}, tmp_path) equals conventional
  3. ✓ resolve_catalog_path({}, tmp_path) is None

tests/test_build_docs_db.py:2139 · its file's page

What it checks (3)

  1. assert resolve_catalog_path(cfg, tmp_path) == declared.resolve() observes resolve_catalog_path
  2. assert resolve_catalog_path({}, tmp_path) == conventional observes resolve_catalog_path
  3. assert resolve_catalog_path({}, tmp_path) is None observes resolve_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

test_the_catalog_precedence_is_declaration_then_convention→resolve_catalog_path

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.

test_the_catalog_precedence_is_declaration_then_convention · 3 checksresolve_catalog_pathREQ-DDB-SCHEMA-006 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-001catalogunknown
REQ-DDB-PIPE-010catalogunknown
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.