test_status_reports_WHAT_THE_BUILD_DID_NOT_FIND¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
gh#320, and the reader half of it. `collect` and `write_build_signature` are covered in tests/test_diagnostics.py; nothing there notices if `db_status` stops reporting the section, which would leave the rows on disk and invisible to every consumer — the same shape as the scope provenance that was computed, logged and discarded.
Verifies REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
db = tmp_path / "clew.db"sqlite3.connect(str(db)).close()
When
write_build_signature( db, diagnostics={ "accessor_families": "Store_Set_* (5 keys)", "accessor_families_count": "1", "accessor_names_examined": "2196", "unclaimed_event_aliases_count": "0", "event_vocabulary_source": "built-in", }, )status = db_status(Target(repo_path=str(tmp_path), slug="t", db_path=str(db)))diagnostics = status["diagnostics"]
Then
- ✓ diagnostics["accessor_families"] equals "Store_Set_* (5 keys)"
- ✓ diagnostics["accessor_names_examined"] equals "2196"
- ✓ diagnostics["unclaimed_event_aliases_count"] equals "0"
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.
thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 30 of 142 steps
… 63 earlier steps
… 42 later steps
2 more
- Build, refresh and check the index · 30 of 153 steps
- `main` (scripts/stage_probe.py) · 30 of 37 steps
tests/test_mcp_server.py:3010 · its file's page
What it checks (3)
assert diagnostics["accessor_families"] == "Store_Set_* (5 keys)"not attributedassert diagnostics["accessor_names_examined"] == "2196", "a zero needs its denominator"not attributedassert diagnostics["unclaimed_event_aliases_count"] == "0", "the zero must survive"not attributed
Where the product reaches it
index→_index_action→build_or_refresh→db_status(flow)
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 (4)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-MCP-003 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
| REQ-DDB-QUERY-008 | catalog | unknown |
| REQ-DDB-QUERY-009 | catalog | unknown |
Also reaches 6 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-004 measured
- REQ-DDB-PIPE-005 measured