test_a_shared_path_prefix_does_not_misattribute_a_sibling_tree¶
Tests › tests/test_external_provenance.py
What this test is for
Why it exists
`vendor/lib` and `vendor/lib-utils` share a prefix, and a bare `startswith` would tag the second repo's files as belonging to the first — a WRONG attribution, which is worse than an absent one because it reads as a confident measurement rather than as missing knowledge.
Verifies REQ-DDB-PIPE-014
Given
db_path, root = _indexed( tmp_path, [("vendor/lib/a.c", 3), ("vendor/lib-utils/b.c", 3)], nested=("vendor/lib", "vendor/lib-utils"), )
When
stamp_external_provenance(db_path, root)owners = {entry.path: entry.external_root for entry in q.list_files(db_path)}
Then
- ✓ owners["vendor/lib/a.c"] equals "vendor/lib"
- ✓ owners["vendor/lib-utils/b.c"] equals "vendor/lib-utils"
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) · 11 of 400 steps
… 45 earlier steps
… 157 steps between
… 119 steps between
… 53 later steps
6 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 6 of 142 steps
- Build, refresh and check the index · 6 of 153 steps
- `main` (scripts/export_parity.py) · 5 of 203 steps
- Build this wiki from the index · 2 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
- Look up one name: everything the index holds about it · 1 of 226 steps
tests/test_external_provenance.py:431 · its file's page
What it checks (2)
assert owners["vendor/lib/a.c"] == "vendor/lib"observeslist_filesviaownersassert owners["vendor/lib-utils/b.c"] == "vendor/lib-utils"observeslist_filesviaowners
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→_files_corpus→list_files(flow)
Call flow
test_a_shared_path_prefix_does_not_misattribute_a_sibling_tree→_indexed→stamp_external_provenance→list_filesWhat 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-PIPE-014 | catalog | unknown |
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured