passed Passed in the packaged run.
What this test is for Why it exists
#134. The taper halves the neighbour budget per level and floors it at 1 — which is what stops a deep trace exploding — but it applied that with a bare slice and recorded NOTHING. A node with 131 callers and a cap of 8 reported 8 and looked exhausted, and the gap was not derivable from the payload: the dropped neighbours leave no trace in `nodes` or `hops`, so "is this all of them?" had no answer.
Verifies REQ-DDB-QUERY-002
Given
db = tmp_path / "taper.db"conn = sqlite3.connect(str(db))7 more callees = 12cap = 4rows = ", ".join( f"({10 + i}, 'function', 'callee_{i:02d}', 'void callee_{i:02d}()')" for i in range(callees) )edges = ", ".join(f"(1, {10 + i}, 'ast', 'resolved')" for i in range(callees))conn.executescript( "CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, kind TEXT, name TEXT, " "definition TEXT, file_id INTEGER, bodyfile_id INTEGER, bodystart INTEGER, " "bodyend INTEGER);" "CREATE TABLE path (rowid INTEGER PRIMARY KEY, type INTEGER, name TEXT);" "CREATE TABLE call_edges (caller_rowid INTEGER, callee_rowid INTEGER, source TEXT, " "confidence TEXT);" "INSERT INTO memberdef (rowid, kind, name, definition) VALUES " f"(1, 'function', 'root', 'void root()'), {rows};" f"INSERT INTO call_edges VALUES {edges};" )conn.commit()conn.close()→ When
chain = q.chain_trace(db, "root", direction="forward", max_depth=2, max_neighbors=cap)root = next(n for n in chain.nodes if n.name == "root")leaves = [n for n in chain.nodes if n.name != "root"]2 more all(n.omitted == 0 for n in leaves)roomy = q.chain_trace(db, "root", direction="forward", max_depth=2, max_neighbors=99)→ Then
✓ root.omitted equals callees - cap✓ len([h for h in chain.hops if h.from_name == "root"]) equals cap✓ root.omitted + cap equals callees✓ leaves holds✓ all(n.omitted == 0 for n in leaves) holds✓ next(n for n in roomy.nodes if n.name == "root").omitted equals 0What 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.
… 45 earlier steps
callercaller callercaller clew/query/_common.pyclew/query/_common.py clew/query/_common.pyclew/query/_common.py other filesother files other filesother files dossier 46. _ambiguity_counts → table_exists 46 table_exists 47. _ambiguity_counts → function_candidates 47 function_candidates 48–51. function_candidates → table_exists 48 table_exists +3 more 52–53. matching_identity → qualified_name_of 52 qualified_name_of +1 more … 111 steps between
callercaller callercaller clew/query/subject.pyclew/query/subject.py clew/query/subject.pyclew/query/subject.py clew/query/_common.pyclew/query/_common.py clew/query/_common.pyclew/query/_common.py clew/query/traversal.pyclew/query/traversal.py clew/query/traversal.pyclew/query/traversal.py opt (line 547) opt dossier 165. dossier → _chain_for 165 _chain_for 166. _chain_for → chain_trace 166 chain_trace 167. chain_trace → _normalize_direction 167 _normalize_direction ▶ test enters 168. chain_trace → _identity_chain 168 _identity_chain 169. _identity_chain → connect 169 connect … 2 steps between
callercaller callercaller clew/query/_common.pyclew/query/_common.py clew/query/_common.pyclew/query/_common.py clew/query/traversal.pyclew/query/traversal.py clew/query/traversal.pyclew/query/traversal.py loop (line 429) loop dossier 172. _identity_walk → qualified_name_of 172 qualified_name_of 173. _identity_walk → _make_node 173 _make_node 174. _make_node → termini_for 174 termini_for 175. termini_for → table_exists 175 table_exists 176. _make_node → _reqs_for 176 _reqs_for 177. _reqs_for → table_exists 177 table_exists 178. _identity_walk → _identity_call_hops 178 _identity_call_hops 179. _identity_call_hops → table_exists 179 table_exists … 1 step between
callercaller callercaller caller clew/query/_common.pyclew/query/_common.py clew/query/_common.pyclew/query/_common.py clew/query/_common.py clew/query/traversal.pyclew/query/traversal.py clew/query/traversal.pyclew/query/traversal.py clew/query/traversal.py other filesother files other filesother files other files loop (line 362) loop loop (line 368) loop loop (line 429) loop loop (line 156) loop loop (line 191) loop dossier 181. _identity_call_hops → qualified_name_of 181 qualified_name_of 182. _identity_call_hops → _collapse_variants 182 _collapse_variants 183. _collapse_variants → _variant_rank 183 _variant_rank 184. _identity_walk → identity_rowids 184 identity_rowids 185–187. _identity_walk → _cap_at_depth 185 _cap_at_depth +2 more 188. chain_trace → connect 188 connect ▶ test enters 189. chain_trace → function_candidates 189 function_candidates 190. chain_trace → candidate_rows 190 candidate_rows 191–193. candidate_rows → symbol_provenance 191 symbol_provenance +2 more 194. chain_trace → is_overloaded 194 is_overloaded 195–198. chain_trace → _make_node 195 _make_node +3 more 199. _call_hops → table_exists 199 table_exists 200. _call_hops → _collapse_variants 200 _collapse_variants 201. _neighbors → _key_hops 201 _key_hops 202. _key_hops → _key_edge_rows 202 _key_edge_rows 203. _key_edge_rows → table_exists 203 table_exists 204. _key_edge_rows → _key_r1_projection 204 _key_r1_projection 205. _key_r1_projection → has_columns 205 has_columns … 1 step between
callercaller callercaller clew/mcp_server/tools_query.pyclew/mcp_server/tools_query.py clew/mcp_server/tools_query.pyclew/mcp_server/tools_query.py clew/query/payload.pyclew/query/payload.py clew/query/payload.pyclew/query/payload.py clew/query/_common.pyclew/query/_common.py clew/query/_common.pyclew/query/_common.py clew/query/traversal.pyclew/query/traversal.py clew/query/traversal.pyclew/query/traversal.py other filesother files other filesother files loop (line 191) loop loop (line 558) loop loop (line 570) loop opt (line 239) opt opt (line 285) opt loop ×2 (line 208) loop ×2 dossier 207–208. _key_hops → to_bool 207 to_bool ×2 209. chain_trace → _expand_neighbor 209 _expand_neighbor ▶ test enters 210. _expand_neighbor → resolve_rowid 210 resolve_rowid 211. resolve_rowid → table_exists 211 table_exists 212. resolve_rowid → function_candidates 212 function_candidates 213. resolve_rowid → _test_scope_term 213 _test_scope_term 214. _expand_neighbor → _make_node 214 _make_node 215. subject_payload → _flatten_subject 215 _flatten_subject 216. dossier → db 216 db … 10 later steps
1 more tests/test_query.py:470 · its file's page
What it checks (6) assert root.omitted == callees - cap not attributed assert len([h for h in chain.hops if h.from_name == "root"]) == cap observes chain_trace via chain assert root.omitted + cap == callees not attributed assert leaves, "the fixture must reach the callees" not attributed assert all(n.omitted == 0 for n in leaves) observes all assert next(n for n in roomy.nodes if n.name == "root").omitted == 0 observes chain_trace via roomy Where the product reaches it dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all (flow) dossier → _chain_for → chain_trace (flow) Call flow test_chain_trace_records_what_the_fanout_taper_dropped→ chain_trace → all 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 (1) requirement linked by implementers exercised REQ-DDB-QUERY-002 tag 6 of 9: _call_hops, _cap_at_depth, _key_hops, _neighbors and 2 more
Also reaches 6 requirements Its run touches their code; that is reach, not proof.