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

Function pipeline_battery

tests/repro/repro_grammar_scientific.c:156–203  ·  view source on GitHub ↗

── Shared full-pipeline battery (dimensions 7-8) ────────────────────────── * * Indexes the single-file fixture through the production pipeline and asserts * callable-sourcing (no Module-sourced in-body CALLS) and no dangling CALLS * edges. Returns 0 on PASS, 1 on FAIL. Dimension 7 is RED for most grammar-only * languages on current code -- that is the intended signal. */

Source from the content-addressed store, hash-verified

154 * languages on current code -- that is the intended signal.
155 */
156static int pipeline_battery(const char *lang_tag, const char *filename,
157 const char *src) {
158 const char *RED = tf_red();
159 const char *RST = tf_reset();
160
161 RFile files[1];
162 files[0].name = filename;
163 files[0].content = src;
164
165 RProj lp;
166 cbm_store_t *store = rh_index_files(&lp, files, 1);
167 if (!store) {
168 printf(" %sFAIL%s [%s] pipeline: rh_index_files returned NULL\n",
169 RED, RST, lang_tag);
170 return 1;
171 }
172
173 int fails = 0;
174
175 /* 7. callable-sourcing -- mod must be 0; we also require >=1 callable-sourced
176 * edge so a fixture that produced zero CALLS edges cannot vacuously pass. */
177 int module_sourced = 0;
178 int callable_sourced = 0;
179 inv_count_calls_by_source(store, lp.project, &module_sourced,
180 &callable_sourced);
181 if (module_sourced != 0) {
182 printf(" %sFAIL%s [%s] callable-sourcing: %d in-body CALLS sourced at "
183 "Module (callable=%d) -- known enclosing-func gap\n",
184 RED, RST, lang_tag, module_sourced, callable_sourced);
185 fails++;
186 } else if (callable_sourced < 1) {
187 printf(" %sFAIL%s [%s] callable-sourcing: 0 CALLS edges (fixture "
188 "produced no in-body call edge to attribute)\n",
189 RED, RST, lang_tag);
190 fails++;
191 }
192
193 /* 8. no-dangling -- every CALLS edge endpoint must resolve. */
194 int dangling = inv_count_dangling_edges(store, lp.project, "CALLS");
195 if (dangling != 0) {
196 printf(" %sFAIL%s [%s] no-dangling: %d dangling CALLS endpoint(s)\n",
197 RED, RST, lang_tag, dangling);
198 fails++;
199 }
200
201 rh_cleanup(&lp, store);
202 return fails ? 1 : 0;
203}
204
205/* ── Robustness probe ───────────────────────────────────────────────────────
206 *

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