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

Function i1025_write_repo

tests/test_mcp.c:9542–9550  ·  view source on GitHub ↗

#1025: agents pass the repo FOLDER name ("codebase-memory-mcp"), but * indexed project names derive from the full path * (E:\project\graph\x -> "E-project-graph-x"), so exact lookup fails with * "project not found" while list_projects clearly shows the project. A * passed name that matches exactly ONE indexed project as a segment-aligned * tail ("- " suffix) must resolve to it; zero or s

Source from the content-addressed store, hash-verified

9540 * scans filenames), so this test indexes real fixtures under an overridden
9541 * CBM_CACHE_DIR. */
9542static void i1025_write_repo(const char *dir, const char *fn_name) {
9543 char path[CBM_SZ_512];
9544 snprintf(path, sizeof(path), "%s/mod.py", dir);
9545 FILE *f = fopen(path, "w");
9546 if (!f)
9547 return;
9548 fprintf(f, "def %s(x):\n return x + 1\n", fn_name);
9549 fclose(f);
9550}
9551
9552TEST(tool_project_arg_resolves_unique_tail_issue1025) {
9553 char repo_a[CBM_SZ_256];

Callers 1

test_mcp.cFile · 0.85

Calls 1

fopenFunction · 0.85

Tested by

no test coverage detected