test_thread_roster_answers_with_an_envelope_carrying_its_split

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE GAP THAT LET THE SHAPE CHANGE PASS UNNOTICED. gh#346 moved this tool from `_many` to `wire.one`, and the whole suite stayed green: the two tests that drive every tier-1 tool check JSON round-tripping and target attribution, and both hold under either shape. Nothing pinned the payload, so nothing would have caught the reverse either — a later edit routing it back through `_many` would silently drop `origin` and `row_meaning`.

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

Given

  1. reply = tools.search(corpus="threads")
→

When

  1. —
→

Then

  1. ✓ reply contains "threads"
  2. ✓ reply contains "origin"
  3. ✓ reply contains "row_meaning"
  4. ✓ reply["origin"]["total"] equals 0
  5. ✓ reply["origin"]["first_party"] equals 0
  6. ✓ json.dumps(reply) does not contain "records none"

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.

clew — `main` (clew/cli.py) · 23 of 400 steps

… 209 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesopt (line 118)optmain210–211. _payload → export_search210export_search +1 more212. corpus_payload → _symbol_corpus212_symbol_corpus▶ test enters213. _symbol_corpus → search_counted213search_counted214. search_counted → connect214connect

… 1 step between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyloop (line 1576)loopmain216. _memberdef_corpora → _expansion_sql216_expansion_sql217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists

… 40 steps between

command-line usercommand-line usercommand-line usercommand-line userother filesother filesother filesother filesmain261–262. search_emptiness → _scope_payload261_scope_payload +1 more263–267. one → _listed263_listed +4 more268–269. _pruned_row → _absent268_absent +1 more

… 22 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyother filesother filesother filesother filesmain292. search_emptiness → _scope_sentence292_scope_sentence293. _symbol_corpus → with_limit_disclosure293with_limit_disclosure294. corpus_payload → _prose_corpus294_prose_corpus▶ test enters295. _prose_corpus → search_prose_graded295search_prose_graded296. search_prose_graded → _query_tokens296_query_tokens

… 14 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyother filesother filesother filesother filesopt (line 474)optmain311. prose_emptiness → token_hit_counts311token_hit_counts312. prose_emptiness → _render_counts312_render_counts313. corpus_payload → _code_corpus313_code_corpus▶ test enters314–315. _code_corpus → search_code314search_code +1 more

… 10 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyother filesother filesother filesother filesmain326. count_code → _has_table326_has_table327. _code_corpus → with_limit_disclosure327with_limit_disclosure328. corpus_payload → _files_corpus328_files_corpus▶ test enters329. _files_corpus → files_context329files_context330. files_context → directory_rollup330directory_rollup

… 14 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyother filesother filesother filesother filesmain345. list_files → _matches345_matches346. _files_corpus → files_miss346files_miss347. corpus_payload → lock_roster347lock_roster▶ test enters348. lock_roster → connect348connect349. lock_roster → table_exists349table_exists

… 9 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesother filesloop ×2 (line 944)loop ×2main359–360. lock_roster → _object_route359_object_route +1 more361. corpus_payload → one361one▶ test enters362. corpus_payload → one362one363. corpus_payload → thread_roster363thread_roster364. thread_roster → connect364connect365. thread_roster → table_exists365table_exists366. thread_roster → has_columns366has_columns367. thread_roster → _thread_columns367_thread_columns368. _thread_columns → has_columns368has_columns369–370. _thread_columns → has_columns369has_columns ×2371. thread_roster → _build_thread371_build_thread372. _build_thread → name_of372name_of373. _build_thread → table_exists373table_exists374. _build_thread → _spawn_attribution374_spawn_attribution375. _spawn_attribution → has_columns375has_columns376–377. thread_roster → _thread_origins376_thread_origins +1 more378. corpus_payload → _config_found_on_the_wire378_config_found_on_the_wire379. _config_found_on_the_wire → _compact_gate_panel379_compact_gate_panel380. corpus_payload → kconfig_space380kconfig_space

… 20 later steps

2 more

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

What it checks (4)

  1. assert "threads" in reply and "origin" in reply and "row_meaning" in reply, ( "routed through `_many` this would be a bare list under `results` with no split" ) not attributed
  2. assert reply["origin"]["total"] == 0 not attributed
  3. assert reply["origin"]["first_party"] == 0 not attributed
  4. assert "records none" not in json.dumps(reply), ( "an empty roster must not claim the DATABASE records none — the fixture's build is what " "found no spawns, and the two are different facts" ) not attributed

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

requirementlinked byimplementers exercised
REQ-DDB-MCP-001catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown
Also reaches 5 requirements

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