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

Function pipeline_battery

tests/repro/repro_grammar_web.c:311–357  ·  view source on GitHub ↗

── Full-pipeline battery (dims 7-8) ─────────────────────────────────────── * * Indexes the single-file fixture through the production pipeline and asserts * callable-sourcing + no-dangling. Returns 0 on PASS, 1 on FAIL. For web * languages that reach this path (SCSS, GoTemplate), dim 7 is expected RED: * SCSS mixin calls are likely sourced at Module (func_kinds_for_lang mapping * absent for

Source from the content-addressed store, hash-verified

309 * unconditionally Module-sourced. RED rows are the deliverable signal.
310 */
311static int pipeline_battery(const char *lang_tag, const char *filename,
312 const char *src) {
313 const char *RED = tf_red();
314 const char *RST = tf_reset();
315
316 RFile files[1];
317 files[0].name = filename;
318 files[0].content = src;
319
320 RProj lp;
321 cbm_store_t *store = rh_index_files(&lp, files, 1);
322 if (!store) {
323 printf(" %sFAIL%s [%s] pipeline: rh_index_files returned NULL\n",
324 RED, RST, lang_tag);
325 return 1;
326 }
327
328 int fails = 0;
329
330 /* 7. callable-sourcing */
331 int module_sourced = 0;
332 int callable_sourced = 0;
333 inv_count_calls_by_source(store, lp.project, &module_sourced,
334 &callable_sourced);
335 if (module_sourced != 0) {
336 printf(" %sFAIL%s [%s] callable-sourcing: %d in-body CALLS sourced at "
337 "Module (callable=%d) -- known enclosing-func gap\n",
338 RED, RST, lang_tag, module_sourced, callable_sourced);
339 fails++;
340 } else if (callable_sourced < 1) {
341 printf(" %sFAIL%s [%s] callable-sourcing: 0 CALLS edges (fixture "
342 "produced no in-body call edge to attribute)\n",
343 RED, RST, lang_tag);
344 fails++;
345 }
346
347 /* 8. no-dangling */
348 int dangling = inv_count_dangling_edges(store, lp.project, "CALLS");
349 if (dangling != 0) {
350 printf(" %sFAIL%s [%s] no-dangling: %d dangling CALLS endpoint(s)\n",
351 RED, RST, lang_tag, dangling);
352 fails++;
353 }
354
355 rh_cleanup(&lp, store);
356 return fails ? 1 : 0;
357}
358
359/* ── HTML ────────────────────────────────────────────────────────────────────
360 * Idiomatic minimal document with an element that carries an id attribute.

Callers 1

Calls 6

tf_redFunction · 0.85
tf_resetFunction · 0.85
rh_index_filesFunction · 0.85
inv_count_dangling_edgesFunction · 0.85
rh_cleanupFunction · 0.85

Tested by

no test coverage detected