REQ-DDB-QUERY-008: One whole-graph aggregate, so a consumer can calibrate how much to trust the index

← Requirements

What it requires

  1. A single graph_stats accessor aggregates the GRAPH rather than a symbol or a seed, and reports each figure under a name that cannot be misread.
  2. The call-edge row count and the count of distinct (caller_rowid, callee_rowid) logical pairs are BOTH returned, with their ratio and a row_meaning sentence carrying both numbers — because call_edges stores one row per extraction layer and a single collapsed edge count is the misreading gh#38 already shipped.
  3. The confidence and source distributions are returned at row level, and the share of LOGICAL PAIRS for which no layer resolved the endpoint non-fuzzily is returned as its own figure (a per-pair test, not a row filter).
  4. Every richness layer is reported in one of THREE states — populated, empty, or absent — so an empty layer reads as a measurement and an absent one as a fact about the build, never as evidence about the code.
  5. Indexed files, files yielding symbols and files yielding bodies are three separate counts under the decl/def duality, and gh#6's persisted coverage figures are READ from build_meta rather than re-measured.
  6. The whole accessor is NON-RAISING — a thin, tableless or partially-built index returns a populated aggregate rather than an error, because a trust aggregate that fails on a thin index is useless exactly when it is needed.
tier
PASS
declared
implemented
priority
P1

Where it lives

  • Answer: query engine + MCP server4

See it on the map

How it is met

implemented byresults (125 tests)call_edge_countsfile_countsgraph_statslayer_states125 passed125 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (125)

Linked directly

120 tests: 120 passed

120 passed
testresultlinked byimplementers exercisedcalls away
test_an_empty_layer_reads_as_empty_and_a_dropped_one_as_absentpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_an_index_with_no_call_graph_says_so_instead_of_reporting_a_zero_ratiopassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_every_declared_layer_is_reported_with_a_registered_statepassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_file_counts_read_the_persisted_coverage_and_admit_when_it_is_absentpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_graph_stats_survives_a_database_with_no_tablespassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_non_fuzzy_evidence_is_tested_per_pair_not_per_rowpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_rows_and_logical_pairs_are_separate_numbers_and_the_payload_says_whichpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_symbol_provenance_is_a_measured_distribution_or_nothingpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states—
test_a_capture_on_one_thread_leaves_another_threads_output_alonepassedcatalogunknown—
test_a_client_advertising_no_roots_is_never_askedpassedcatalogunknown—
test_a_data_stale_subject_miss_withdraws_the_definitive_claimpassedcatalogunknown—
test_a_deliberate_refusal_is_tagged_refusedpassedcatalogunknown—
test_a_dossier_without_a_bound_repo_root_still_answers_minus_the_bodypassedcatalogunknown—
test_a_failed_preserve_is_reported_as_a_failure_not_as_successpassedcatalogunknown—
test_a_failing_build_reports_the_exception_not_an_exit_codepassedcatalogunknown—
test_a_negative_does_not_invite_a_status_callpassedcatalogunknown—
test_a_query_refreshes_only_when_the_data_axis_is_stalepassedcatalogunknown—
test_a_query_tool_refusal_is_tagged_refused_toopassedcatalogunknown—
test_a_refused_or_unusable_roots_list_degrades_to_no_targetpassedcatalogunknown—
test_a_response_over_budget_is_trimmed_AND_says_sopassedcatalogunknown—
test_a_response_under_budget_is_left_alonepassedcatalogunknown—
test_a_roots_derived_target_announces_that_the_link_is_deprecatedpassedcatalogunknown—
test_a_server_with_no_target_does_not_answer_from_a_previous_onepassedcatalogunknown—
test_a_stale_project_dir_falls_through_rather_than_being_adoptedpassedcatalogunknown—
test_a_stated_option_forces_a_build_on_a_current_indexpassedcatalogunknown—
test_a_widened_prose_search_says_so_in_the_envelopepassedcatalogunknown—
test_activate_tier1_notifies_tool_list_changedpassedcatalogunknown—
test_active_db_without_target_raisespassedcatalogunknown—
test_ambiguity_disclosure_states_the_spread_it_cannot_resolvepassedcatalogunknown—
test_ambiguity_is_not_disclosed_for_an_unambiguous_namepassedcatalogunknown—
test_an_unbuilt_directory_target_refuses_instead_of_answeringpassedcatalogunknown—
test_an_unbuilt_target_fails_by_name_not_by_sqlitepassedcatalogunknown—
test_an_unknown_corpus_is_refused_by_namepassedcatalogunknown—
test_an_unknown_target_is_refused_by_namepassedcatalogunknown—
test_an_unreadable_registry_is_reported_and_its_content_survivespassedcatalogunknown—
test_build_or_refresh_proceeds_when_the_process_matches_its_sourcepassedcatalogunknown—
test_build_or_refresh_refuses_when_the_process_predates_its_sourcepassedcatalogunknown—
test_build_or_refresh_reports_a_measured_durationpassedcatalogunknown—
test_build_or_refresh_skips_current_db_and_activatespassedcatalogunknown—
test_build_or_refresh_without_target_is_an_errorpassedcatalogunknown—
test_build_without_doxyfile_reports_errorpassedcatalogunknown—
test_building_a_target_does_register_itpassedcatalogunknown—
test_corrupt_registry_is_toleratedpassedcatalogunknown—
test_cull_age_rulepassedcatalogunknown—
test_cull_drops_stale_and_keeps_currentpassedcatalogunknown—
test_data_staleness_does_not_hedge_an_empty_row_listpassedcatalogunknown—
test_db_status_detects_source_driftpassedcatalogunknown—
test_db_status_freshness_uses_build_signaturepassedcatalogunknown—
test_db_status_source_drift_survives_a_corrupt_dbpassedcatalogunknown—
test_discover_doxyfilepassedcatalogunknown—
test_empty_results_are_explicit_not_barepassedcatalogunknown—
test_every_served_tool_is_exempt_from_tool_search_deferralpassedcatalogunknown—
test_every_tier1_reply_names_the_target_it_answered_frompassedcatalogunknown—
test_every_tier1_wrapper_is_json_serializablepassedcatalogunknown—
test_every_tool_is_present_at_constructionpassedcatalogunknown—
test_every_tool_parameter_is_describedpassedcatalogunknown—
test_invoking_a_registered_tool_runs_the_refresh_hookpassedcatalogunknown—
test_lock_roster_on_an_index_without_the_layer_says_sopassedcatalogunknown—
test_lock_roster_separates_the_mutex_count_from_the_row_countpassedcatalogunknown—
test_lock_roster_trims_its_nesting_passenger_rather_than_the_locks_asked_forpassedcatalogunknown—
test_neighbour_wire_keys_are_pinned_literallypassedcatalogunknown—
test_no_served_text_is_ever_truncatedpassedcatalogunknown—
test_no_successor_has_appeared_for_roots_on_the_modern_revisionspassedcatalogunknown—
test_probed_module_name_is_derived_from_the_real_importpassedcatalogunknown—
test_project_dir_env_resolves_a_target_at_startuppassedcatalogunknown—
test_register_and_unregister_query_toolspassedcatalogunknown—
test_registering_after_an_unreadable_registry_does_not_destroy_itpassedcatalogunknown—
test_registry_roundtrip_and_droppassedcatalogunknown—
test_repo_flag_sets_the_target_and_does_NOT_pin_itpassedcatalogunknown—
test_resolving_a_target_registers_nothingpassedcatalogunknown—
test_retargeting_follows_the_new_repo_without_a_tool_list_changepassedcatalogunknown—
test_root_uri_parsing_verifies_before_it_trustspassedcatalogunknown—
test_roots_is_not_asked_on_a_revision_that_cannot_carry_the_requestpassedcatalogunknown—
test_roots_list_changed_invalidates_only_a_roots_derived_targetpassedcatalogunknown—
test_roots_resolve_lazily_on_the_first_call_that_needs_a_targetpassedcatalogunknown—
test_schema_staleness_still_withdraws_with_the_missing_layer_wordingpassedcatalogunknown—
test_sdk_exposes_everything_the_server_callspassedcatalogunknown—
test_sdk_shim_reaches_the_lowlevel_server_by_the_right_namepassedcatalogunknown—
test_staleness_notices_without_a_target_is_empty_not_an_errorpassedcatalogunknown—
test_state_home_env_overridepassedcatalogunknown—
test_status_interprets_an_unresolvable_version_skewpassedcatalogunknown—
test_status_on_a_PRE_DIAGNOSTICS_index_says_nothing_rather_than_guessingpassedcatalogunknown—
test_status_on_a_PRE_SCOPE_index_says_nothing_rather_than_guessingpassedcatalogunknown—
test_status_on_a_current_index_carries_no_staleness_blockpassedcatalogunknown—
test_status_reports_WHAT_THE_BUILD_DID_NOT_FINDpassedcatalogunknown—
test_status_reports_WHY_the_file_set_is_what_it_ispassedcatalogunknown—
test_stdio_run_advertises_tool_list_changedpassedcatalogunknown—
test_target_slug_disambiguates_same_named_checkoutspassedcatalogunknown—
test_targets_is_a_listing_not_a_wall_of_full_statuspassedcatalogunknown—
test_the_build_passes_only_what_the_repo_actually_haspassedcatalogunknown—
test_the_build_runs_in_process_and_keeps_stdout_cleanpassedcatalogunknown—
test_the_class_subject_matches_the_r2_librarypassedcatalogunknown—
test_the_descriptions_name_every_subject_kind_the_tools_acceptpassedcatalogunknown—
test_the_dossier_body_caps_and_reports_truncationpassedcatalogunknown—
test_the_dossier_body_takes_the_repo_root_from_the_server_not_the_modelpassedcatalogunknown—
test_the_flag_outranks_the_environmentpassedcatalogunknown—
test_the_measurement_is_r2_and_the_dossier_withholds_nothingpassedcatalogunknown—
test_the_parity_capabilities_survive_the_tool_cullpassedcatalogunknown—
test_the_pipeline_exiting_is_reported_rather_than_escapingpassedcatalogunknown—
test_the_production_registrations_pass_a_refresh_hookpassedcatalogunknown—
test_the_prose_corpus_returns_snippetspassedcatalogunknown—
test_the_public_tool_names_are_frozenpassedcatalogunknown—
test_the_refresh_wrapper_preserves_every_tool_schemapassedcatalogunknown—
test_the_registry_is_replaced_atomically_never_truncated_in_placepassedcatalogunknown—
test_the_sdk_still_offers_the_deprecated_roots_routepassedcatalogunknown—
test_the_server_holds_no_set_target_toolpassedcatalogunknown—
test_the_steering_the_1_4_0_grid_missed_is_servedpassedcatalogunknown—
test_the_target_refusal_is_shared_by_every_routed_toolpassedcatalogunknown—
test_thread_roster_answers_with_an_envelope_carrying_its_splitpassedcatalogunknown—
test_tier0_and_tier1_names_do_not_collidepassedcatalogunknown—
test_unknown_symbols_return_a_self_describing_miss_naming_the_targetpassedcatalogunknown—
test_unregister_is_tolerant_when_never_registeredpassedcatalogunknown—
test_wrapper_content_reaches_the_r1_richnesspassedcatalogunknown—
test_wrappers_match_the_r2_library_exactlypassedcatalogunknown—
test_an_unresolved_include_is_neither_first_party_nor_externalpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states1
test_an_untagged_index_reports_no_external_recordingpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states1
test_graph_stats_counts_first_party_and_reports_external_beside_itpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states1
test_graph_stats_ships_its_zeroes_and_never_a_bare_edge_countpassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states1
test_the_aggregate_is_reachable_from_the_package_surfacepassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states1
test_stats_and_cull_are_cli_verbspassedmeasured4 of 4: call_edge_counts, file_counts, graph_stats, layer_states3
Reached through calls

5 tests: 5 passed

5 passed
testresultlinked byimplementers exercisedcalls away
test_a_dossier_prints_the_export_payloadpassedinferred4 of 4: call_edge_counts, file_counts, graph_stats, layer_states4
test_a_missing_index_is_refused_not_answeredpassedinferred4 of 4: call_edge_counts, file_counts, graph_stats, layer_states4
test_a_refused_request_exits_2_with_the_reasonpassedinferred4 of 4: call_edge_counts, file_counts, graph_stats, layer_states4
test_a_search_prints_the_export_payloadpassedinferred4 of 4: call_edge_counts, file_counts, graph_stats, layer_states4
test_several_subjects_are_one_batchpassedinferred4 of 4: call_edge_counts, file_counts, graph_stats, layer_states4