test_prose_search_reaches_documentation_attached_to_a_member¶
Tests › tests/test_query.py
What this test is for
Why it exists
gh#404 — THE TEXT WAS ALWAYS STORED AND NEVER SEARCHED. The prose corpus read markdown and file-level doc comments; a doc comment on a MEMBER went nowhere. Measured on mbedtls: `search_prose("MBEDTLS_ALLOW_PRIVATE_ACCESS")` returned zero while `memberdef.detaileddescription` held the paragraph that answers the question — and the graded cell was told the miss was definitive and ran three greps to find what the index was holding.
Verifies REQ-DDB-QUERY-002
Given
db = _member_doc_db(tmp_path)
When
found = q.search_prose_graded(db, "private members", limit=5)hit = found.hits[0]
Then
- ✓ found.hits holds
- ✓ hit.file_path equals "library/common.h"
- ✓ hit.heading contains "member documentation"
- ✓ hit.snippet does not contain "<para>"
- ✓ hit.snippet contains "their members are private"
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.
clew — `main` (clew/cli.py) · 12 of 400 steps
… 215 earlier steps
… 73 steps between
… 92 later steps
2 more
- `main` (scripts/export_parity.py) · 12 of 203 steps
- Look up one name: everything the index holds about it · 1 of 226 steps
tests/test_query.py:1907 · its file's page
What it checks (5)
assert found.hits, "the member's documentation is the only prose here and must be found"observessearch_prose_gradedviafoundassert hit.file_path == "library/common.h"not attributedassert "member documentation" in hit.heading, "the heading must say where the prose came from"not attributedassert "<para>" not in hit.snippet, f"doxygen's XML must be stripped: {hit.snippet!r}"not attributedassert "their members are private" in hit.snippetnot attributed
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→_prose_corpus→search_prose_graded(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 (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-QUERY-002 | catalog | unknown |
Also reaches 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-007 measured