test_the_query_tools_take_the_session_without_changing_their_schema

Tests › tests/test_wiki_channel.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE SCHEMA IS THE ONE SURFACE A CLIENT CANNOT TRUNCATE, so the session is taken through the SDK's own context injection — a `ctx` the SDK fills and leaves out of the JSON Schema.

Given

  1. def dossier(subject: str, target: str | None = None) -> dict: return {"subject": subject}
  2. async def before(target, sub_index): # noqa: ANN001, ANN202 return None
→

When

  1. wrapped = _answering_with_refresh(dossier, before)
  2. seen = SimpleNamespace(session=object())
  3. channel.CHANNEL.session = None
→

Then

  1. ✓ find_context_parameter(wrapped) equals "ctx"
  2. ✓ anyio.run(lambda: wrapped(subject="x", ctx=seen)) equals {"subject": "x"}
  3. ✓ channel.CHANNEL.session is seen.session

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

… 28 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.pyloop (line 662)loopcatch (line 562)catchindex29. register_query_tools → _answering_with_refresh29_answering_with_refresh30. _answering_with_refresh → refused30refused31. _answering_with_refresh → _take_context31_take_context▶ test enters32. _take_context → list32list33. register_query_tools → list33list34. adopt → db_status34db_status

… 119 later steps

tests/test_wiki_channel.py:24 · its file's page

What it checks (3)

  1. assert find_context_parameter(wrapped) == "ctx" observes _answering_with_refresh via wrapped
  2. assert anyio.run(lambda: wrapped(subject="x", ctx=seen)) == {"subject": "x"} observes _answering_with_refresh via wrapped
  3. assert channel.CHANNEL.session is seen.session not attributed

Where the product reaches it

  • index → _index_action → build_or_refresh → _activate_tier1 → register_query_tools → _answering_with_refresh (flow)

Call flow

test_the_query_tools_take_the_session_without_changing_their_schema→_answering_with_refresh

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_the_query_tools_take_the_session_without_changing_their_schema · 3 checks_answering_with_refreshREQ-DDB-MCP-004 · measured_answering_with_refresh_take_contextREQ-DDB-WIKI-054 · measured
Also reaches 2 requirements

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