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

Function cr536_setup

tests/repro/repro_issue523.c:247–268  ·  view source on GitHub ↗

Index a one-file client and a one-file server project through the production * pipeline. Closes both stores again — cbm_cross_repo_match re-opens the DBs * from the cache dir. Returns false when either project failed to index or the * PRECONDITIONS (client HTTP_CALLS edge, server Route node) are missing, so a * broken fixture fails RED instead of vacuously passing. */

Source from the content-addressed store, hash-verified

245 * PRECONDITIONS (client HTTP_CALLS edge, server Route node) are missing, so a
246 * broken fixture fails RED instead of vacuously passing. */
247static bool cr536_setup(RProj *client, const char *client_py, RProj *server,
248 const char *server_py) {
249 memset(client, 0, sizeof(*client));
250 memset(server, 0, sizeof(*server));
251 cbm_store_t *cs = rh_index(client, "client/orders.py", client_py);
252 if (!cs) {
253 return false;
254 }
255 int client_http = rh_count_edges(cs, client->project, "HTTP_CALLS");
256 cbm_store_close(cs);
257
258 cbm_store_t *ss = rh_index(server, "server/app.py", server_py);
259 if (!ss) {
260 return false;
261 }
262 int server_routes = rh_count_label(ss, server->project, "Route");
263 cbm_store_close(ss);
264
265 fprintf(stderr, " [523] precondition: client HTTP_CALLS=%d server Routes=%d (both >=1)\n",
266 client_http, server_routes);
267 return client_http >= 1 && server_routes >= 1;
268}
269
270/* Count CROSS_HTTP_CALLS rows in a project DB (re-opened from the cache dir,
271 * because cbm_cross_repo_match wrote through its own store handles). */

Callers 1

repro_issue523.cFile · 0.85

Calls 4

rh_indexFunction · 0.85
rh_count_edgesFunction · 0.85
cbm_store_closeFunction · 0.85
rh_count_labelFunction · 0.85

Tested by

no test coverage detected