test_adopt_still_derives_the_whole_repo_when_unsplit¶
Tests › tests/test_mcp_routing.py
What this test is for
Why it exists
THE COUNTER-CASE, guarding against an over-broad fix. A repository that has never been split — the overwhelming common case, and the shape every pre-existing `adopt` test already covers — must keep resolving to the whole-repo target exactly as before; nothing about preferring first-party should touch a repo with no sub-indexes at all.
Given
reg = st.TargetRegistry(tmp_path / "state")
When
_mcp, state = build_server(reg)repo = tmp_path / "adopt_whole"repo.mkdir()active = state.adopt(str(repo), st.TARGET_SOURCE_FLAG)
Then
- ✓ active.name is None
- ✓ active.repo_path equals str(repo.resolve())
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 · 38 of 153 steps
… 14 earlier steps
… 84 later steps
5 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 24 of 142 steps
- `main` (scripts/stage_probe.py) · 23 of 37 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 9 of 17 steps
- clew — `main` (clew/cli.py) · 1 of 400 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/test_mcp_routing.py:1010 · its file's page
What it checks (2)
assert active.name is None, f"an unsplit repo must adopt the whole-repo target, got {active}"not attributedassert active.repo_path == str(repo.resolve())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 7 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- 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