test_the_hint_reaches_each_entry_of_a_batched_miss

Tests › tests/test_recovery_hint.py

passed Passed in the packaged run.

What this test is for

Why it exists

A BATCH NEEDS IT MORE THAN A SINGLE CALL: the model receives up to eight negatives at once with no indication which were near misses.

Given

  1. tools = QueryTools(lambda: index, lambda: tmp_path)
  2. near = "Nonexistent::execute"
2 more
  1. reply = tools.dossier([near, "no_such_symbol_anywhere"])
  2. entries = {entry["name"]: entry for entry in reply["results"]}
→

When

  1. —
→

Then

  1. ✓ entries[near]["found"] is False
  2. ✓ entries[near]["note"] contains 'subject="execute"'
  3. ✓ entries["no_such_symbol_anywhere"]["note"] does not contain "execute"

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 · 62 of 226 steps

callercallercallercallercallerclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/subject.pyclew/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/_common.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyother filesother filesother filesother filesother filesopt (line 1715)opttry (line 266)tryopt (line 296)optloop (line 154)loopdossier1. dossier → _accepted_batch1_accepted_batch▶ test enters2. dossier → _batched_dossiers2_batched_dossiers3. _batched_dossiers → batch_payload3batch_payload4. batch_payload → dossiers4dossiers5. dossiers → connect5connect6. batch_payload → _batch_miss6_batch_miss7. _batch_miss → _kind_limitation_clause7_kind_limitation_clause8. batch_payload → recovery_hint8recovery_hint9. recovery_hint → connect9connect10–11. recovery_hint → _hint_from10_hint_from +1 more12. _hint_from → _indexed_path12_indexed_path13. _indexed_path → table_exists13table_exists14–15. _hint_from → bare_tail14bare_tail +1 more16. _name_exists → table_exists16table_exists17. _hint_from → _documentation_mentions17_documentation_mentions18. _documentation_mentions → table_exists18table_exists19. _documentation_mentions → has_columns19has_columns20. has_columns → table_exists20table_exists21–22. _hint_from → _name_exists21_name_exists +1 more23. _qualified_forms → table_exists23table_exists24. _qualified_forms → qualified_name_of24qualified_name_of25. batch_payload → unresolved_kinds25unresolved_kinds26. unresolved_kinds → connect26connect27. unresolved_kinds → table_exists27table_exists28. batch_payload → _flatten_subject28_flatten_subject29. _flatten_subject → one29one30. one → _listed30_listed

… 15 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 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 more54. resolve_selector → _ends_at_boundary54_ends_at_boundary55. matching_identity → qualified_name_of55qualified_name_of56. _flatten_subject → _gate_definitions56_gate_definitions

… 1 step between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesdossier58. macro_definitions → connect58connect59. macro_definitions → macro_definitions_conn59macro_definitions_conn60. macro_definitions_conn → has_columns60has_columns▶ test enters61–62. macro_definitions_conn → _macro_def61_macro_def +1 more

… 25 steps between

callercallercallercallercallerclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesother filestry (line 224)tryopt (line 1145)optopt (line 1181)optloop (line 578)looploop (line 1539)looploop (line 198)loopdossier88. _distinct_identities → connect88connect89. _distinct_identities → table_exists89table_exists90. batch_payload → _hoist_build_wide90_hoist_build_wide91. _batched_dossiers → db91db92. db → _route92_route93. db → 93… 1 call not run94–95. _batched_dossiers → _repo_or_none94_repo_or_none +1 more96. repo → _route96_route97–99. _batched_dossiers → _budget_batch97_budget_batch +2 more100. _shrink_to_budget → _step_chain_depth100_step_chain_depth101. _batched_dossiers → prune_absent_keys101prune_absent_keys102. prune_absent_keys → _absent102_absent103. _batched_dossiers → _wire_shape103_wire_shape104. _wire_shape → compact_docs104compact_docs105. compact_docs → _uncarried_sentences105_uncarried_sentences

… 5 steps between

callercallercallercallerclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyother filesother filesother filesother filesloop (line 827)loopopt (line 829)optdossier111. all → list111list112. compact_neighbours → _grouped112_grouped113–115. _batched_dossiers → _answered113_answered +2 more116. _answered → _kind_limitation_clause116_kind_limitation_clause117. _answered → _unresolved_for117_unresolved_for

… 3 steps between

callercallercallercallerclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyother filesother filesother filesother filestry (line 1274)tryopt (line 1407)optopt (line 1409)optopt (line 1414)optdossier121. _recovery_for → db121db122. _recovery_for → recovery_hint122recovery_hint123. _answered → _target_name123_target_name124. _answered → _bounded_names124_bounded_names125. _bounded_names → list125list126. _answered → _staleness126_staleness127. _staleness → _staleness_within_budget127_staleness_within_budget128. _answered → _withdraw_definitive128_withdraw_definitive

… 1 step between

callercallercallercallercallerclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/subject.pyclew/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/_common.pyother filesother filesother filesother filesother filesopt (line 1419)optopt (line 1421)optopt (line 1715)optopt (line 1012)optalt (line 780)altopt (line 1014)optdossier130. _answered → _scope_hit130_scope_hit131. _answered → 131… 2 calls not run132. dossier → disclose_overflow132disclose_overflow▶ test enters133. dossier → subject_payload133subject_payload134. subject_payload → dossier134dossier135. dossier → connect135connect136. dossier → identity_rowids136identity_rowids137–139. identity_rowids → function_candidates137function_candidates +2 more140–141. identity_rowids → qualified_name_of140qualified_name_of +1 more142. dossier → _selector_from_signature142_selector_from_signature143. _selector_from_signature → qualified_name_of143qualified_name_of144. dossier → _rank_enum_over_mirror144_rank_enum_over_mirror▶ test enters145. _rank_enum_over_mirror → connect145connect146. _rank_enum_over_mirror → _class_side_is_only_enum_mirrors146_class_side_is_only_enum_mirrors

… 2 steps between

callercallercallercallercallerclew/query/subject.pyclew/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/_common.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyother filesother filesother filesother filesother filesopt (line 1021)optloop (line 1218)loopopt (line 1078)optdossier149. _derives_from_py_enum → all149all150. _class_side_is_only_enum_mirrors → all150all151. dossier → resolve_subject151resolve_subject▶ test enters152. resolve_subject → connect152connect153–154. dossier → _qualified_reread153_qualified_reread +1 more155. _split_qualified → bare_tail155bare_tail156. _split_qualified → connect156connect157. _split_qualified → identity_rowids157identity_rowids158. _split_qualified → _qualified_suffix_matches158_qualified_suffix_matches159. _qualified_suffix_matches → table_exists159table_exists160. _qualified_suffix_matches → qualified_name_of160qualified_name_of161–162. _qualified_reread → _rank_enum_over_mirror161_rank_enum_over_mirror +1 more163. dossier → _chosen_kind163_chosen_kind164. dossier → connect164connect165. dossier → _chain_for165_chain_for

… 61 later steps

3 more

tests/test_recovery_hint.py:442 · its file's page

What it checks (3)

  1. assert entries[near]["found"] is False not attributed
  2. assert 'subject="execute"' in entries[near]["note"], ( f"a batched miss carried no hint: {entries[near]['note']!r}" ) not attributed
  3. assert "execute" not in entries["no_such_symbol_anywhere"]["note"], ( "a name with no neighbour was given another subject's hint" ) 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.

Also reaches 8 requirements

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