test_index_refuses_stats_and_cull_and_names_their_cli

Tests › tests/test_surface_2_0.py

passed Passed in the packaged run.

What this test is for

Why it exists

A RETIRED ACTION IS REFUSED BY NAME with the route that replaced it — never a silent fall-through, never a bare "unknown action".

Given

  1. —
→

When

  1. mcp, state = build_server(st.TargetRegistry(tmp_path / "state"))
  2. for action, route in (("stats", "clew query stats"), ("cull", "clew cull")): with pytest.raises(ValueError) as exc: await state.index(None, action=action) assert route in str(exc.value), action
  3. index = next(t for t in await mcp.list_tools() if t.name == "index")
→

Then

  1. ✓ index.input_schema["properties"] does not contain "max_age_days"
  2. ✓ json.dumps(index.model_dump()) does not contain "stats"
  3. ✓ json.dumps( index.model_dump() ) does not contain "cull"

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 · 9 of 153 steps

… 21 earlier steps

callercallercallercallerclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyopt (line 2070)optloop (line 662)loopcatch (line 562)catchindex22. adopt → target_for22target_for23. adopt → _sync_tier123_sync_tier124. _sync_tier1 → register_query_tools24register_query_tools▶ test enters25–29. register_query_tools → _add_tool25_add_tool +4 more30. _answering_with_refresh → refused30refused31. _answering_with_refresh → _take_context31_take_context32. _take_context → list32list33. register_query_tools → list33list34. adopt → db_status34db_status35. db_status → _options_meta35_options_meta

… 118 later steps

1 more

tests/test_surface_2_0.py:50 · its file's page

What it checks (3)

  1. assert route in str(exc.value), action not attributed
  2. assert "max_age_days" not in index.input_schema["properties"] not attributed
  3. assert "stats" not in json.dumps(index.model_dump()) and "cull" not in json.dumps( index.model_dump() ) not attributed

Where the product reaches it

Call flow

test_index_refuses_stats_and_cull_and_names_their_cli→build_server

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_index_refuses_stats_and_cull_and_names_their_cli · 3 checksbuild_serverREQ-DDB-MCP-001 · measuredbuild_server_refusal_as_tool_errorREQ-DDB-MCP-004 · measuredbuild_server_register_promptsREQ-DDB-WIKI-034 · measured
Also reaches 6 requirements

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