test_repo_flag_sets_the_target_and_does_NOT_pin_it¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
`--repo` keeps working as an override and STOPS being a pin.
Verifies REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
reg = st.TargetRegistry(tmp_path / "state")repo, other = tmp_path / "mine", tmp_path / "theirs"
2 more
repo.mkdir()other.mkdir()
When
_mcp, state = build_server(reg)state.resolve_startup_target(str(repo))state.adopt(str(other), st.TARGET_SOURCE_FLAG)
Then
- ✓ Path(state.active.repo_path) equals repo
- ✓ state.target_source equals st.TARGET_SOURCE_FLAG
- ✓ state.tier1_active is True
- ✓ Path(state.active.repo_path) equals other
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_server.py:2509 · its file's page
What it checks (4)
assert Path(state.active.repo_path) == reponot attributedassert state.target_source == st.TARGET_SOURCE_FLAGnot attributedassert state.tier1_active is True, "an explicit target exposes its tools immediately"not attributedassert Path(state.active.repo_path) == other, "--repo must not refuse a retarget"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.
Requirements it verifies (3)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-QUERY-006 | catalog | unknown |
| REQ-DDB-QUERY-008 | catalog | unknown |
| REQ-DDB-QUERY-009 | catalog | unknown |
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