REQ-DDB-QUERY-007: An empty result is graded, and names the scope that produced it

← Requirements

What it requires

  1. An empty search or list_files reply states which corpora were searched, carries the indexed scope (source, reason, file count, covered top-level directories and extensions), and claims only the confidence it has earned.
  2. THREE cases are distinguished — a single token matching nothing anywhere keeps the full definitive wording; a list_files pattern whose extension appears in NO indexed file is definitive about the index with the reason stated, and explicitly not a claim about the working tree; a multi-token search miss is NOT definitive and reports per-token hit counts naming the token that emptied the conjunction.
  3. The per-token diagnosis is computed only on a zero result and only up to MAX_DIAGNOSED_TOKENS.
  4. The extension certainty is derived from the UNCAPPED extension list, so a truncated display list cannot manufacture a false negative.
  5. A CORPUS MISS NAMES ITS OWN BOUNDARY AND ROUTES ONWARD rather than asserting the index is exhausted — the files corpus holds indexed SOURCE files, so a build script or a Doxyfile is absent there by construction, and its miss note says so and names doc_scope and the directory inventory — both of which accompany EVERY files reply, hit or miss, so the route is data the caller already has rather than another call.
  6. doc_scope returns the repository's DECLARED doxyfile and vendored roots, and returns empty when nothing is declared, which is a different fact from no doc build existing.
tier
PASS
declared
implemented
priority
P1

Where it lives

  • Answer: query engine + MCP server15

See it on the map

How it is met

implemented byresults (97 tests)_not_indexedclass_rowsdoc_scopefile_doc_rowsgate_symbol_rowshas_file_docshas_prose_corpusindex_scopeindexed_extensionsmember_doc_rowsprose_emptinesssearch_emptinesstoken_hit_countsundocumented_path_rowsunsearched_corpora97 passed97 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (97)

Linked directly

91 tests: 91 passed

91 passed
testresultlinked byimplementers exercisedcalls away
test_a_conjunction_miss_names_the_dead_tokenpassedmeasured9 of 15—
test_a_miss_with_every_token_matching_advises_fewer_tokenspassedmeasured9 of 15—
test_a_schema_stale_index_withdraws_the_definitive_claimpassedmeasured9 of 15—
test_a_sessions_own_build_invalidates_its_stale_active_defaultpassedmeasured9 of 15—
test_an_absent_symbol_keeps_the_definitive_notepassedmeasured9 of 15—
test_an_empty_reply_does_not_repeat_the_scope_DERIVATIONpassedmeasured9 of 15—
test_an_empty_symbol_search_points_at_the_code_corpuspassedmeasured9 of 15—
test_an_index_without_the_corpus_is_not_definitivepassedmeasured9 of 15—
test_data_staleness_alone_keeps_the_definitive_claimpassedmeasured9 of 15—
test_dossier_and_search_route_to_the_named_sub_indexpassedmeasured9 of 15—
test_the_token_diagnosis_is_cappedpassedmeasured9 of 15—
test_empty_results_are_explicit_not_barepassedmeasured8 of 15—
test_every_declared_corpus_answerspassedmeasured6 of 15—
test_every_tier1_reply_names_the_target_it_answered_frompassedmeasured6 of 15—
test_every_tier1_wrapper_is_json_serializablepassedmeasured5 of 15—
test_the_prose_corpus_returns_snippetspassedmeasured5 of 15—
test_a_conceptual_query_reaches_the_relevant_filepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_config_symbol_does_not_outrank_a_function_it_gatespassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_documented_file_is_not_displaced_by_a_name_only_matchpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_generated_symbol_loses_a_tiepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_name_match_still_outranks_a_path_matchpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_name_that_is_both_a_function_and_a_type_returns_bothpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_parsed_row_carries_no_brief_and_nothing_pretends_otherwisepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_parsed_row_is_distinguishable_from_a_doxygen_row_at_every_surfacepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_recovered_global_is_findable_through_search_and_typed_as_a_variablepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_registered_file_is_findable_in_the_default_corpuspassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_symbol_is_findable_by_the_file_it_lives_inpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_a_typedef_is_findablepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_an_enumeration_is_findable_and_says_it_is_onepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_an_exact_search_for_a_generated_symbol_still_finds_it_firstpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_an_over_specified_query_is_reported_not_answeredpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_build_index_against_a_rust_repo_is_queryablepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_every_tier1_tool_routes_and_omitting_the_target_keeps_the_derived_onepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_file_hits_are_labelled_and_do_not_displace_symbolspassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_search_discloses_a_dropped_row_only_when_provenance_DIFFERSpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_search_finds_a_gating_symbol_by_namepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_search_finds_a_macro_by_its_expansionpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_search_finds_a_macro_by_namepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_search_reaches_a_file_by_conceptpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_search_still_prefers_a_function_when_a_name_scores_equallypassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_the_api_answers_with_the_query_enginepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows—
test_other_corpora_keep_the_undiluted_definitive_notepassedmeasured3 of 15: has_prose_corpus, member_doc_rows, prose_emptiness—
test_a_files_miss_routes_rather_than_claiming_exhaustionpassedmeasured1 of 15: doc_scope—
test_a_widened_prose_search_says_so_in_the_envelopepassedmeasured1 of 15: member_doc_rows—
test_the_parity_capabilities_survive_the_tool_cullpassedmeasured1 of 15: member_doc_rows—
test_the_prose_reply_labels_its_text_as_the_repositorys_ownpassedmeasured1 of 15: member_doc_rows—
test_a_conjunction_miss_still_names_its_dead_tokenpassedmeasured9 of 151
test_a_genuinely_absent_token_still_gets_the_definitive_notepassedmeasured9 of 151
test_a_type_only_token_is_not_blamed_for_the_conjunctionpassedmeasured9 of 151
test_an_undocumented_file_is_not_assumed_searchablepassedmeasured8 of 151
test_an_unread_corpus_downgrades_the_verdictpassedmeasured8 of 151
test_the_unread_set_is_derived_from_the_databasepassedmeasured8 of 151
test_a_prose_miss_is_graded_by_what_the_index_holds_elsewherepassedmeasured5 of 151
test_extension_certainty_reads_the_uncapped_listpassedmeasured3 of 15: _not_indexed, index_scope, indexed_extensions1
test_the_token_diagnosis_counts_macrospassedmeasured3 of 15: class_rows, file_doc_rows, token_hit_counts1
test_token_counts_span_symbols_and_file_docspassedmeasured3 of 15: class_rows, file_doc_rows, token_hit_counts1
test_token_hit_counts_sees_the_class_corpuspassedmeasured3 of 15: class_rows, file_doc_rows, token_hit_counts1
test_absent_corpus_is_reported_as_absentpassedmeasured2 of 15: file_doc_rows, has_file_docs1
test_an_index_built_before_this_release_claims_nothingpassedmeasured2 of 15: _not_indexed, index_scope1
test_index_scope_summarises_provenance_and_shapepassedmeasured2 of 15: _not_indexed, index_scope1
test_the_query_layer_serves_what_the_build_stampedpassedmeasured2 of 15: _not_indexed, index_scope1
test_doc_scope_is_empty_rather_than_invented_when_nothing_is_declaredpassedmeasured1 of 15: doc_scope1
test_the_files_inventory_is_not_hidden_behind_an_omitted_argumentpassedmeasured1 of 15: doc_scope1
test_prose_search_reaches_documentation_attached_to_a_memberpassedmeasured1 of 15: member_doc_rows2
test_search_prose_does_not_widen_a_query_that_already_matchedpassedmeasured1 of 15: member_doc_rows2
test_search_prose_punctuation_only_tokens_never_reach_fts5passedmeasured1 of 15: member_doc_rows2
test_search_prose_single_token_miss_reports_no_wideningpassedmeasured1 of 15: member_doc_rows2
test_search_prose_widens_to_or_when_one_absent_word_empties_the_andpassedmeasured1 of 15: member_doc_rows2
test_a_limitation_documented_only_in_help_is_searchablepassedmeasured1 of 15: member_doc_rows3
test_kconfig_prose_must_be_ingested_after_the_markdown_ingestpassedmeasured1 of 15: member_doc_rows3
test_prompt_and_symbol_name_both_reach_the_prose_corpuspassedmeasured1 of 15: member_doc_rows3
test_search_prose_absent_table_is_emptypassedmeasured1 of 15: member_doc_rows3
test_search_prose_limit_and_bad_expressionpassedmeasured1 of 15: member_doc_rows3
test_search_prose_returns_a_snippetpassedmeasured1 of 15: member_doc_rows3
test_the_class_subject_matches_the_r2_librarypassedmeasured1 of 15: member_doc_rows3
test_every_corpus_exports_what_the_mcp_search_answerspassedmeasured14 of 154
test_a_search_prints_the_export_payloadpassedmeasured6 of 154
test_a_cut_search_reports_the_true_totalpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_a_search_under_its_limit_has_no_limited_keypassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_name_accessors_degrade_gracefully_on_table_less_dbpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_empty_and_unmatched_queries_stay_emptypassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_excludes_stl_compounds_but_lookup_class_still_reaches_thempassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_finds_a_class_by_its_briefpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_finds_a_class_by_namepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_finds_known_symbolpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_for_an_absent_class_name_is_still_emptypassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_is_capped_and_the_cap_is_caller_controlledpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_matches_every_token_not_the_literal_phrasepassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_ranking_is_unchanged_on_a_db_with_no_compoundspassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_ranks_name_matches_above_prose_matchespassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
test_search_still_finds_a_function_unchangedpassedmeasured4 of 15: class_rows, file_doc_rows, gate_symbol_rows, undocumented_path_rows4
Reached through calls

6 tests: 6 passed

6 passed
testresultlinked byimplementers exercisedcalls away
test_an_unknown_corpus_is_refused_by_namepassedinferred14 of 154
test_stats_and_cull_are_cli_verbspassedinferred14 of 156
test_a_dossier_prints_the_export_payloadpassedinferred14 of 157
test_a_missing_index_is_refused_not_answeredpassedinferred14 of 157
test_a_refused_request_exits_2_with_the_reasonpassedinferred14 of 157
test_several_subjects_are_one_batchpassedinferred14 of 157

Flows through it