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

Function budget_fixture_write

tests/test_mcp.c:21281–21300  ·  view source on GitHub ↗

Write the 64-file Go fixture (above MIN_FILES_FOR_PARALLEL, so the gated * parallel extract path runs). generation 2 gives every file a second * definition so a re-run must re-extract all of them — an unchanged repo is an * incremental no-op and never reaches the memory gate. */

Source from the content-addressed store, hash-verified

21279 * definition so a re-run must re-extract all of them — an unchanged repo is an
21280 * incremental no-op and never reaches the memory gate. */
21281static bool budget_fixture_write(const char *repo, int generation) {
21282 for (int i = 0; i < 64; i++) {
21283 char path[CBM_SZ_1K];
21284 char body[CBM_SZ_256];
21285 snprintf(path, sizeof(path), "%s/f%02d.go", repo, i);
21286 if (generation == 1) {
21287 snprintf(body, sizeof(body), "package main\n\nfunc F%02d() int {\n\treturn %d\n}\n", i,
21288 i);
21289 } else {
21290 snprintf(body, sizeof(body),
21291 "package main\n\nfunc F%02d() int {\n\treturn %d\n}\n\n"
21292 "func G%02d() int {\n\treturn F%02d() + 1\n}\n",
21293 i, i, i, i);
21294 }
21295 if (th_write_file(path, body) != 0) {
21296 return false;
21297 }
21298 }
21299 return true;
21300}
21301
21302/* Parse the JSON object inside an MCP tool result. NULL when absent. */
21303static yyjson_doc *budget_result_doc(const char *result) {

Callers 1

test_mcp.cFile · 0.85

Calls 1

th_write_fileFunction · 0.85

Tested by

no test coverage detected