test_registering_removes_the_legacy_row_it_supersedes

Tests › tests/test_registry_hygiene.py

passed Passed in the packaged run.

What this test is for

Why it exists

WRITE-SIDE, so the duplicate does not come back. Only the row for the SAME slug is dropped — a registry holding several repositories keeps them all.

Given

  1. home, repo, other = tmp_path / "state", tmp_path / "repo", tmp_path / "other"
  2. repo.mkdir()
6 more
  1. other.mkdir()
  2. _legacy_and_slug_rows(home, repo)
  3. registry = TargetRegistry(home)
  4. registry.register(other)
  5. registry.register(repo)
  6. stored = json.loads((home / REGISTRY_NAME).read_text())
→

When

  1. target_for(repo, home)
  2. target_for(other, home)
→

Then

  1. ✓ stored does not contain str(repo)
  2. ✓ stored contains target_for(repo, home).slug
  3. ✓ stored contains target_for(other, home).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.

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_registry_hygiene.py:88 · its file's page

What it checks (3)

  1. assert str(repo) not in stored, f"the legacy row survived: {sorted(stored)}" not attributed
  2. assert target_for(repo, home).slug in stored observes target_for
  3. assert target_for(other, home).slug in stored, "another repository's row must be untouched" observes target_for

Where the product reaches it

  • main → query_main → _locate → target_for (flow)

Call flow

test_registering_removes_the_legacy_row_it_supersedes→_legacy_and_slug_rows→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_registering_removes_the_legacy_row_it_supersedes · 3 checkstarget_forREQ-DDB-MCP-001 · measured
Also reaches 1 requirement

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