test_a_miss_also_carries_the_staleness

Tests › tests/test_freshness.py

passed Passed in the packaged run.

What this test is for

Why it exists

The reply where it matters MOST. "Not in this index" and "not in this index YET, because the index predates the function you just wrote" are the same payload today, and the second is the commoner one for an agent querying code it is editing.

Given

  1. drift = [{"axis": fr.AXIS_DATA, "message": "5 files changed; call build_or_refresh()"}]
  2. tools = QueryTools(lambda: rich_db, lambda: rich_db.parent, lambda: drift)
  3. payload = tools.dossier("a_function_this_index_has_never_heard_of")
→

When

  1. —
→

Then

  1. ✓ payload["found"] is False
  2. ✓ payload["staleness"] equals drift

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

… 6 earlier steps

callercallercallercallercallerclew/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 filestry (line 266)tryopt (line 296)optloop (line 154)loopdossier7. _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 → one29one

… 16 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. function_candidates → table_exists48table_exists▶ test enters49–51. function_candidates → _test_scope_term49_test_scope_term +2 more52–53. matching_identity → qualified_name_of52qualified_name_of +1 more

… 4 steps 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. macro_definitions_conn → _macro_def61_macro_def62. _macro_def → gates_covering62gates_covering63. gates_covering → table_exists63table_exists

… 29 steps between

callercallercallercallerclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pyclew/mcp_server/tools_query.pytry (line 1219)tryopt (line 1181)optdossier93. db → 93… 1 call not run94. _batched_dossiers → _repo_or_none94_repo_or_none95. _repo_or_none → repo95repo96. repo → _route96_route97. _batched_dossiers → _budget_batch97_budget_batch

… 14 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/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 filesloop (line 827)loopopt (line 829)opttry (line 1301)trytry (line 1274)tryopt (line 1407)optopt (line 1409)optopt (line 1419)optopt (line 1421)optopt (line 1715)optopt (line 1012)optdossier112. compact_neighbours → _grouped112_grouped113. _batched_dossiers → _answered113_answered114–115. _answered → _default114_default +1 more116. _answered → _kind_limitation_clause116_kind_limitation_clause117–118. _answered → _unresolved_for117_unresolved_for +1 more119. _unresolved_for → unresolved_kinds119unresolved_kinds120–121. _answered → _recovery_for120_recovery_for +1 more122. _recovery_for → recovery_hint122recovery_hint123. _answered → _target_name123_target_name124. _answered → _bounded_names124_bounded_names125. _bounded_names → list125list126–128. _answered → _staleness126_staleness +2 more129–130. _answered → _scope_definitive129_scope_definitive +1 more131. _answered → 131… 2 calls not run132. dossier → disclose_overflow132disclose_overflow133. dossier → subject_payload133subject_payload▶ test enters134. subject_payload → dossier134dossier135. dossier → connect135connect136. dossier → identity_rowids136identity_rowids

… 5 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.pyopt (line 1012)optopt (line 1014)optdossier142. dossier → _selector_from_signature142_selector_from_signature143. _selector_from_signature → qualified_name_of143qualified_name_of144. dossier → _rank_enum_over_mirror144_rank_enum_over_mirror145. _rank_enum_over_mirror → connect145connect146. _rank_enum_over_mirror → _class_side_is_only_enum_mirrors146_class_side_is_only_enum_mirrors

… 2 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/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyother filesother filesother filesother filesopt (line 1021)optdossier149. _derives_from_py_enum → all149all150. _class_side_is_only_enum_mirrors → all150all151. dossier → resolve_subject151resolve_subject152. resolve_subject → connect152connect153–154. dossier → _qualified_reread153_qualified_reread +1 more155. _split_qualified → bare_tail155bare_tail156. _split_qualified → connect156connect157. _split_qualified → identity_rowids157identity_rowids

… 3 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.pyopt (line 1078)optdossier161–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

… 47 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.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyother filesother filesother filesother filesopt (line 285)optloop (line 620)loopdossier213. resolve_rowid → _test_scope_term213_test_scope_term214. _expand_neighbor → _make_node214_make_node215. subject_payload → _flatten_subject215_flatten_subject216. dossier → db216db▶ test enters217–219. dossier → _repo_or_none217_repo_or_none +2 more220. _budgeted_dossier → _shrink_to_budget220_shrink_to_budget221. _budgeted_dossier → prune_absent_keys221prune_absent_keys222. _budgeted_dossier → 222… 1 call not run223. dossier → _capped_neighbors223_capped_neighbors224. _capped_neighbors → _limited_block224_limited_block225–226. dossier → _wire_shape225_wire_shape +1 more
3 more

tests/test_freshness.py:579 · its file's page

What it checks (2)

  1. assert payload["found"] is False not attributed
  2. assert payload["staleness"] == drift 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 9 requirements

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