test_target_slug_disambiguates_same_named_checkouts

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

Two checkouts with the same directory name get distinct db paths.

Verifies REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009

Given

  1. a = tmp_path / "one" / "firmware"
  2. b = tmp_path / "two" / "firmware"
2 more
  1. a.mkdir(parents=True)
  2. b.mkdir(parents=True)
→

When

  1. ta = st.target_for(a, tmp_path / "state")
  2. tb = st.target_for(b, tmp_path / "state")
→

Then

  1. ✓ ta.slug.startswith("firmware-") holds
  2. ✓ ta.slug differs from tb.slug
  3. ✓ ta.db_path differs from tb.db_path

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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 1 of 142 steps

… 32 earlier steps

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pytry (line 1664)tryopt (line 1666)optopt (line 352)opt_first_build_worker33. _first_build_worker → target_for33target_for34. target_for → _safe_index_name34_safe_index_name35. target_for → state_home35state_home▶ test enters36. _first_build_worker → _run_build36_run_build37. _run_build → nested_tree_cache37nested_tree_cache

… 105 later steps

4 more

tests/test_mcp_server.py:2080 · its file's page

What it checks (3)

  1. assert ta.slug.startswith("firmware-") observes target_for via ta
  2. assert ta.slug != tb.slug observes target_for via ta
  3. assert ta.db_path != tb.db_path observes target_for via ta

Where the product reaches it

  • main → query_main → _locate → target_for (flow)

Call flow

test_target_slug_disambiguates_same_named_checkouts→target_for

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.

test_target_slug_disambiguates_same_named_checkouts · 3 checkstarget_forREQ-DDB-MCP-001 · measured

Requirements it verifies (4)

requirementlinked byimplementers exercised
REQ-DDB-MCP-003catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.