test_chain_trace_overloaded_seed_surfaces_candidates

Tests › tests/test_query.py

passed Passed in the packaged run.

What this test is for

Why it exists

An overloaded seed traces from the definition-preferring pick but lists the alternatives, so a bare ambiguous seed never silently traces the wrong function. (No edge tables here: the trace is empty, but the seed-ambiguity signal must still fire.)

Given

  1. db = _overload_db( tmp_path, [ (30, "publish", "bool A::publish", "src/a.cpp", True), (31, "publish", "bool B::publish", "src/b.cpp", True), ], )
→

When

  1. chain = q.chain_trace(db, "publish")
→

Then

  1. ✓ chain.seed equals "publish"
  2. ✓ {c.signature for c in chain.candidates} equals {"bool A::publish", "bool B::publish"}

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.

Look up one name: everything the index holds about it · 27 of 226 steps

… 17 earlier steps

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pydossier18. _documentation_mentions → table_exists18table_exists19. _documentation_mentions → has_columns19has_columns20. has_columns → table_exists20table_exists21–22. _hint_from → _name_exists21_name_exists +1 more

… 23 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesdossier46. _ambiguity_counts → table_exists46table_exists47. _ambiguity_counts → function_candidates47function_candidates48–51. function_candidates → table_exists48table_exists +3 more52–53. matching_identity → qualified_name_of52qualified_name_of +1 more

… 24 steps between

callercallercallercallerclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesdossier78. _referenced_by → table_exists78table_exists79. _macro_def → symbol_provenance79symbol_provenance80–81. symbol_provenance → records_provenance80records_provenance +1 more82. _gate_definitions → _gate_definition_gaps82_gate_definition_gaps83. _flatten_subject → _empty_callers_note83_empty_callers_note

… 81 steps between

callercallercallercallerclew/query/subject.pyclew/query/subject.pyclew/query/subject.pyclew/query/subject.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyopt (line 547)optdossier165. dossier → _chain_for165_chain_for166. _chain_for → chain_trace166chain_trace167. chain_trace → _normalize_direction167_normalize_direction▶ test enters168. chain_trace → _identity_chain168_identity_chain169. _identity_chain → connect169connect

… 2 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyloop (line 429)loopdossier172. _identity_walk → qualified_name_of172qualified_name_of173. _identity_walk → _make_node173_make_node174. _make_node → termini_for174termini_for175. termini_for → table_exists175table_exists176. _make_node → _reqs_for176_reqs_for177. _reqs_for → table_exists177table_exists178. _identity_walk → _identity_call_hops178_identity_call_hops179. _identity_call_hops → table_exists179table_exists

… 6 steps between

callercallercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyother filesother filesother filesother filesother filesloop (line 429)looploop (line 437)looploop (line 156)looploop (line 191)loopdossier186–187. _identity_walk → _record_identity186_record_identity +1 more188. chain_trace → connect188connect▶ test enters189. chain_trace → function_candidates189function_candidates190. chain_trace → candidate_rows190candidate_rows191–193. candidate_rows → symbol_provenance191symbol_provenance +2 more194. chain_trace → is_overloaded194is_overloaded195–198. chain_trace → _make_node195_make_node +3 more199. _call_hops → table_exists199table_exists200. _call_hops → _collapse_variants200_collapse_variants201. _neighbors → _key_hops201_key_hops202. _key_hops → _key_edge_rows202_key_edge_rows203. _key_edge_rows → table_exists203table_exists204. _key_edge_rows → _key_r1_projection204_key_r1_projection205. _key_r1_projection → has_columns205has_columns

… 21 later steps

3 more

tests/test_query.py:532 · its file's page

What it checks (2)

  1. assert chain.seed == "publish" observes chain_trace via chain
  2. assert {c.signature for c in chain.candidates} == {"bool A::publish", "bool B::publish"} observes chain_trace via chain

Where the product reaches it

  • dossier → _chain_for → chain_trace (flow)

Call flow

test_chain_trace_overloaded_seed_surfaces_candidates→_overload_db→chain_trace

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_chain_trace_overloaded_seed_surfaces_candidates · 2 checkschain_tracecandidate_rowssymbol_provenanceREQ-DDB-INDEX-004 · measuredchain_traceconnectREQ-DDB-QUERY-001 · measuredchain_traceREQ-DDB-QUERY-002 · measuredchain_tracefunction_candidatesREQ-DDB-QUERY-003 · measuredchain_trace_make_nodeREQ-DDB-QUERY-005 · measuredchain_tracefunction_candidatesREQ-DDB-QUERY-010 · measured
Also reaches 6 requirements

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