From cbacf99e7406d2dd06e8eeec42cf4253001216d9 Mon Sep 17 00:00:00 2001 From: Andrew Hundt Date: Tue, 30 Jun 2026 07:19:07 -0400 Subject: [PATCH] docs(cli): list dependency ranking config search_graph already reads search_disable_dep_ranking, and the MCP schema names that config key. Add it to CBM_CONFIG_REGISTRY so config list/get guidance exposes the same setting users see in the API description. Add a CLI registry regression test for the key, default, range, and dependency-ranking guidance. This does not change search behavior, MCP schemas, DB schema, or tool visibility. Validated with make -f Makefile.cbm build/c/test-runner, CBM_ONLY_SUITE=cli ./build/c/test-runner, CBM_ONLY_SUITE=tool_consolidation ./build/c/test-runner, git diff --check, and bash scripts/check-source-safety.sh. Signed-off-by: Andrew Hundt --- src/cli/cli.c | 5 +++++ tests/test_cli.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/cli/cli.c b/src/cli/cli.c index c66997994..7bccc9630 100644 --- a/src/cli/cli.c +++ b/src/cli/cli.c @@ -2887,6 +2887,11 @@ const cbm_config_entry_t CBM_CONFIG_REGISTRY[] = { "true|false", "false = restrict to project code only (exclude dep sub-projects). " "Set false for single-project focus workflows."}, + {"search_disable_dep_ranking", "false", NULL, "Tools", + "Disable project-before-dependency ranking in search_graph", + "true|false", + "false (default) ranks project symbols before dependency symbols when include_dependencies=true. " + "true uses pure relevance order across project and dependency symbols."}, /* ── PageRank ── */ {"pagerank_max_iter", "20", NULL, "PageRank", "Max iterations for PageRank algorithm before stopping (more = more accurate convergence)", diff --git a/tests/test_cli.c b/tests/test_cli.c index fd2751b5e..79eaf4017 100644 --- a/tests/test_cli.c +++ b/tests/test_cli.c @@ -2766,6 +2766,23 @@ TEST(cli_config_get_effective_env_overrides_db) { PASS(); } +TEST(cli_config_registry_includes_dep_ranking_toggle) { + const cbm_config_entry_t *found = NULL; + for (int i = 0; CBM_CONFIG_REGISTRY[i].key; i++) { + if (strcmp(CBM_CONFIG_REGISTRY[i].key, "search_disable_dep_ranking") == 0) { + found = &CBM_CONFIG_REGISTRY[i]; + break; + } + } + + ASSERT_NOT_NULL(found); + ASSERT_STR_EQ(found->default_val, "false"); + ASSERT_STR_EQ(found->range, "true|false"); + ASSERT_NOT_NULL(strstr(found->description, "search_graph")); + ASSERT_NOT_NULL(strstr(found->guidance, "dependency")); + PASS(); +} + TEST(cli_config_delete) { char tmpdir[256]; snprintf(tmpdir, sizeof(tmpdir), "/tmp/cli-cfg-XXXXXX"); @@ -3085,6 +3102,7 @@ SUITE(cli) { RUN_TEST(cli_config_get_bool); RUN_TEST(cli_config_get_int); RUN_TEST(cli_config_get_effective_env_overrides_db); + RUN_TEST(cli_config_registry_includes_dep_ranking_toggle); RUN_TEST(cli_config_delete); RUN_TEST(cli_config_persists);