MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / index_capture

Function index_capture

tests/test_index_format.c:68–85  ·  view source on GitHub ↗

Run index_repository through the production MCP flow, capturing the log. */

Source from the content-addressed store, hash-verified

66
67/* Run index_repository through the production MCP flow, capturing the log. */
68static char *index_capture(RProj *lp) {
69 char args[700];
70 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\"}", lp->tmpdir);
71 char *prior = getenv("CBM_CACHE_DIR");
72 char *saved = prior ? strdup(prior) : NULL;
73 cbm_setenv("CBM_CACHE_DIR", lp->cachedir, 1);
74 capture_reset();
75 cbm_log_set_sink_ex(capture_sink, CBM_LOG_SINK_TEE);
76 char *resp = cbm_mcp_handle_tool(lp->srv, "index_repository", args);
77 cbm_log_set_sink(NULL);
78 if (saved) {
79 cbm_setenv("CBM_CACHE_DIR", saved, 1);
80 free(saved);
81 } else {
82 cbm_unsetenv("CBM_CACHE_DIR");
83 }
84 return resp;
85}
86/* ── Test 1: one File node per file, and every file reaches search ──── */
87
88TEST(index_format_siblings_distinct_and_searchable) {

Callers 1

Calls 6

cbm_setenvFunction · 0.85
capture_resetFunction · 0.85
cbm_log_set_sink_exFunction · 0.85
cbm_mcp_handle_toolFunction · 0.85
cbm_log_set_sinkFunction · 0.85
cbm_unsetenvFunction · 0.85

Tested by

no test coverage detected