test_the_descriptions_name_every_subject_kind_the_tools_accept

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

A tool description is the only thing a model reads before choosing a tool, so a stale one is a live defect. WHAT THIS REPLACES: the `callers`/`callees` descriptions used to be checked field by field against the neighbour key set. Both tools are gone and their rows are `dossier` fields, so the equivalent live risk moved with them — and it got bigger, because a caller can no longer discover a capability by seeing a tool named after it.

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

Given

  1. def described(fn: object, param: str) -> str: hint = typing.get_type_hints(fn, include_extras=True)[param] return next(m.description for m in hint.__metadata__ if getattr(m, "description", None))
  2. subject = described(QueryTools.dossier, "subject")
4 more
  1. for kind in SUBJECT_KINDS: assert kind in subject or kind in TIER1_TOOLS["dossier"], ( f"dossier accepts subject kind {kind!r} and neither its schema nor its description " f"says so, which makes that kind unreachable in practice" )
  2. corpus = described(QueryTools.search, "corpus")
  3. for name in CORPORA: assert name in corpus or name in TIER1_TOOLS["search"], ( f"search reads corpus {name!r} and neither its schema nor its description says so" )
  4. surface = TIER1_TOOLS["dossier"] + " " + described(QueryTools.dossier, "depth")
→

When

  1. —
→

Then

  1. ✓ surface does not contain "returns strictly less"
  2. ✓ surface does not contain "direct CALL edges only"
  3. ✓ surface.lower() contains "depth"
  4. ✓ surface contains str(q_max_depth())

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

What it checks (6)

  1. assert kind in subject or kind in TIER1_TOOLS["dossier"], ( f"dossier accepts subject kind {kind!r} and neither its schema nor its description " f"says so, which makes that kind unreachable in practice" ) not attributed
  2. assert name in corpus or name in TIER1_TOOLS["search"], ( f"search reads corpus {name!r} and neither its schema nor its description says so" ) not attributed
  3. assert "returns strictly less" not in surface not attributed
  4. assert "direct CALL edges only" not in surface not attributed
  5. assert "depth" in surface.lower() not attributed
  6. assert str(q_max_depth()) in surface, "the depth BOUND must be disclosed, not implied" observes q_max_depth

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_the_descriptions_name_every_subject_kind_the_tools_accept→q_max_depth

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 (5)

requirementlinked byimplementers exercised
REQ-DDB-MCP-001catalogunknown
REQ-DDB-MCP-003catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown