test_the_page_draws_the_tree_with_each_rows_evidence_state¶
Tests › tests/test_wiki_composite.py
What this test is for
Why it exists
UNKNOWN SAYS WHY AND WHERE: the note and the local checkout, and no evidence columns.
Given
def unknown(dep: Path, pin: str, sha: str | None): return ("unknown", f"not indexed at pin {pin[:12]}; checkout is at 0000", Path("/x.db"))tree, pins = _tree(tmp_path, probe=unknown)
When
html = product_html(tree, Audience())
Then
- ✓ html contains "REQ-PRD-001"
- ✓ html contains "lib:REQ-LIB-001"
- ✓ html contains "hal:REQ-HAL-001"
- ✓ html.index("REQ-PRD-001") < html.index("lib:REQ-LIB-001") < html.index("hal:REQ-HAL-001") holds
- ✓ html contains "not indexed at pin"
- ✓ html contains str((tmp_path / "lib").resolve())
- ✓ html contains "Bounded retry"
- ✓ html contains "REQ-PRD-999"
- ✓ html contains '<details class="unreached"'
- ✓ html contains "lib:REQ-LIB-002"
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
`main` (clew/guard/main.py) · 7 of 357 steps
… 62 earlier steps
… 280 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps
- Build this wiki from the index · 2 of 400 steps
- Build, refresh and check the index · 2 of 153 steps
- clew — `main` (clew/cli.py) · 2 of 400 steps
tests/test_wiki_composite.py:232 · its file's page
What it checks (6)
assert "REQ-PRD-001" in html and "lib:REQ-LIB-001" in html and "hal:REQ-HAL-001" in htmlobservesproduct_htmlviahtmlassert html.index("REQ-PRD-001") < html.index("lib:REQ-LIB-001") < html.index("hal:REQ-HAL-001")observesproduct_htmlviahtmlassert "not indexed at pin" in html and str((tmp_path / "lib").resolve()) in htmlobservesproduct_htmlviahtmlassert "Bounded retry" in htmlobservesproduct_htmlviahtmlassert "REQ-PRD-999" in html, "a dangling link is listed"observesproduct_htmlviahtmlassert '<details class="unreached"' in html and "lib:REQ-LIB-002" in htmlobservesproduct_htmlviahtml
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.
Also reaches 11 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-003 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-GUARD-024 inferred
- REQ-DDB-GUARD-027 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-SCHEMA-015 measured
- REQ-DDB-WIKI-015 measured
- REQ-DDB-WIKI-022 inferred
- REQ-DDB-WIKI-040 measured
- REQ-DDB-WIKI-054 inferred