Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.
C aiderastclaude-codecode-analysiscode-intelligencecodexcursorcypherdeveloper-toolsgemini-cligraph-visualizationkilocodeknowledge-graphmcpmcp-servermodel-context-protocolopencodesqlitetree-sitterwindsurf
test(doc_mentions_go): make the fixture index name the step it is in
Martin Vogel2efbdd9852a1
diff --git a/src/git/git_context.c b/src/git/git_context.cindex 51cc4bf99..f0be0c4b5 100644--- a/src/git/git_context.c+++ b/src/git/git_context.c@@ -2,6 +2,7 @@#include "foundation/compat_fs.h"#include "foundation/constants.h"+#include "foundation/log.h"#include "foundation/platform.h"#include "foundation/str_util.h"@@ -65,19 +66,28 @@ static int git_capture(const char *repo_path, const char *git_args, char **out)return CBM_NOT_FOUND;}+ /* Debug-level stage markers: none of these waits has a deadline, so a+ * stuck git child is named by the last marker printed (spawn, read or+ * close). Silent at the default level. */+ cbm_log_debug("git.capture", "stage", "spawn", "args", git_args);FILE *fp = cbm_popen_git(cmd);if (!fp) {return CBM_NOT_FOUND;}+ cbm_log_debug("git.capture", "stage", "read", "args", git_args);char buf[GIT_OUTPUT_MAX];if (!fgets(buf, sizeof(buf), fp)) {+ cbm_log_debug("git.capture", "stage", "close", "args", git_args, "output", "none");cbm_pclose(fp);+ cbm_log_debug("git.capture", "stage", "done", "args", git_args);return CBM_NOT_FOUND;}trim_newlines(buf);+ cbm_log_debug("git.capture", "stage", "close", "args", git_args);int rc = cbm_pclose(fp);+ cbm_log_debug("git.capture", "stage", "done", "args", git_args);if (rc != 0 || buf[0] == '\0') {return CBM_NOT_FOUND;}diff --git a/src/pipeline/pipeline.c b/src/pipeline/pipeline.cindex dd93d63de..7a4df05e9 100644--- a/src/pipeline/pipeline.c+++ b/src/pipeline/pipeline.c@@ -3595,11 +3595,13 @@ static int cbm_pipeline_run_staged(cbm_pipeline_t *p) {p->mode = p->requested_mode;pipeline_reset_doc_links(p);+ cbm_log_debug("pipeline.setup", "step", "coverage");bool mode_promoted = p->frozen ? false : promote_mode_to_existing_coverage(p);/* cbm_pipeline_new() may precede the actual run by an arbitrary interval.* Refresh once here, then use this exact snapshot for both Branch graph* construction and the baseline semantic manifest. */+ cbm_log_debug("pipeline.setup", "step", "git_context");if (!p->frozen && pipeline_refresh_git_context(p) != 0) {return CBM_NOT_FOUND;}@@ -3611,6 +3613,7 @@ static int cbm_pipeline_run_staged(cbm_pipeline_t *p) {/* One project read supplies extensions, declarations and manifest digest.* Snapshot ownership extends through the outer publication guard. */+ cbm_log_debug("pipeline.setup", "step", "test_config");CBM_PROF_START(t_userconfig);if (!p->frozen && !pipeline_load_test_config(p)) {cbm_log_error("pipeline.err", "phase", "test_declarations_config");@@ -3620,6 +3623,7 @@ static int cbm_pipeline_run_staged(cbm_pipeline_t *p) {CBM_PROF_END("pipeline", "0_userconfig_load", t_userconfig);/* Phase 1: Discover files */+ cbm_log_debug("pipeline.setup", "step", "discover");CBM_PROF_START(t_discover);p->resource_violation = (cbm_index_resource_violation_t){0};cbm_discover_opts_t opts = {@@ -4310,6 +4314,9 @@ int cbm_pipeline_run(cbm_pipeline_t *p) {if (!p) {return CBM_NOT_FOUND;}+ /* Debug-level setup markers up to discovery, the first info line: a run+ * that stops before it is named by the last step printed. */+ cbm_log_debug("pipeline.setup", "step", "stage");pipeline_release_test_config(p);p->export_error[0] = '\0';char *final_path = resolve_db_path(p);@@ -4350,6 +4357,7 @@ int cbm_pipeline_run(cbm_pipeline_t *p) {free(final_path);return CBM_NOT_FOUND;}+ cbm_log_debug("pipeline.setup", "step", "staged");int rc = cbm_pipeline_run_staged(p);free(p->db_path);p->db_path = configured_db_path;diff --git a/tests/test_doc_mentions_go.c b/tests/test_doc_mentions_go.cindex 1f81030db..78f1934e0 100644--- a/tests/test_doc_mentions_go.c+++ b/tests/test_doc_mentions_go.c@@ -9,6 +9,8 @@#include "test_framework.h"#include "test_doc_mentions_helpers.h"+#include "foundation/log.h"+/* ── helpers of this file ────────────────────────────────────────── */static CBMFileResult *go_extract(const char *src, const char *rel) {@@ -1258,17 +1260,30 @@ static void go_write_lookup_fixture(const char *repo) {free(big);}-/* Write the lookup fixture below `tmp` and index it into `db`. */+/* Write the lookup fixture below `tmp` and index it into `db`.+ *+ * Self-diagnosing: on windows-11-arm the suite once hung in local_rules before+ * the pipeline's first info line (dry run 38186491924, 2026-10-12; not+ * reproduced since). The setup therefore runs at debug level, where this+ * helper, the pipeline's setup steps and every git child name themselves, so+ * a hang ends on the step it is stuck in. */static int go_index_lookup(char *tmp, size_t tmp_cap, char *db, size_t db_cap) {+ CBMLogLevel prev_level = cbm_log_get_level();+ cbm_log_set_level(CBM_LOG_DEBUG);+ int rc = -1;+ cbm_log_debug("go_index_lookup", "step", "mkdtemp");snprintf(tmp, tmp_cap, "/tmp/cbm_dm_go_XXXXXX");- if (!cbm_mkdtemp(tmp)) {- return -1;+ if (cbm_mkdtemp(tmp)) {+ char repo[400];+ snprintf(repo, sizeof(repo), "%s/repo", tmp);+ cbm_log_debug("go_index_lookup", "step", "fixture", "dir", tmp);+ go_write_lookup_fixture(repo);+ snprintf(db, db_cap, "%s/go.db", tmp);+ cbm_log_debug("go_index_lookup", "step", "index");+ rc = dm_index(repo, db, NULL);}- char repo[400];- snprintf(repo, sizeof(repo), "%s/repo", tmp);- go_write_lookup_fixture(repo);- snprintf(db, db_cap, "%s/go.db", tmp);- return dm_index(repo, db, NULL);+ cbm_log_set_level(prev_level);+ return rc;}/* ── resolver: every reference form, in its first lookup level ───── */