test_a_sub_index_resolves_by_name¶
Tests › tests/test_mcp_routing.py
What this test is for
Why it exists
TWO SPELLINGS, NOT THREE. `sub_index` is its own parameter rather than a suffix folded into `target` — a composite string a caller has to construct has no schema of its own for a model to read, while a second named parameter does, and `index(action='targets')` reports the legal values without anyone building a string. So a sub-index resolves by (`target`, `sub_index`) together, or by its bare slug alone.
Given
reg = st.TargetRegistry(tmp_path / "state")
When
_mcp, state = build_server(reg)repo = tmp_path / "split"repo.mkdir()
2 more
whole = reg.register(repo)vendor = reg.register(repo, name="llama-cpp")
Then
- ✓ state.resolve_target(str(repo.resolve()), "llama-cpp").slug equals vendor.slug
- ✓ state.resolve_target(vendor.slug).slug equals vendor.slug
- ✓ state.resolve_target(str(repo.resolve())).slug equals whole.slug
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.
Build, refresh and check the index · 15 of 153 steps
… 15 earlier steps
… 31 steps between
… 79 later steps
4 more
- clew-mcp — `main` (clew/mcp_server/server.py) · 10 of 17 steps
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps
- clew — `main` (clew/cli.py) · 2 of 400 steps
- `main` (scripts/incremental_probe.py) · 2 of 3 steps
tests/test_mcp_routing.py:602 · its file's page
What it checks (3)
assert state.resolve_target(str(repo.resolve()), "llama-cpp").slug == vendor.slugnot attributedassert state.resolve_target(vendor.slug).slug == vendor.slugnot attributedassert state.resolve_target(str(repo.resolve())).slug == whole.slug, ( "a bare repository path must resolve to the whole-repository index, not a sub-index" )not attributed
Where the product reaches it
main→build_server(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.
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-003 measured
- REQ-DDB-MCP-004 measured
- REQ-DDB-WIKI-034 measured
- REQ-DDB-WIKI-054 measured