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

Function assert_strategy_absent

tests/repro/repro_lsp_ts.c:229–248  ·  view source on GitHub ↗

* assert_strategy_absent — assert a given strategy tag NEVER surfaces on any * CALLS edge. Used for the bare "lsp_ts" probe: the default fallback tag is * never emitted as a distinct strategy (every concrete site passes a literal * "lsp_ts_*"), and the fixture is an UNRESOLVED call (no "lsp_ts_*" edge to * substring-alias against), so its absence is the accurate, intended invariant. * Returns

Source from the content-addressed store, hash-verified

227 * Returns 0 on PASS (tag absent), non-zero on FAIL (tag unexpectedly present).
228 */
229static int assert_strategy_absent(const char *filename, const char *src,
230 const char *strategy) {
231 RProj lp;
232 cbm_store_t *store = rh_index(&lp, filename, src);
233 if (!store) {
234 printf(" %sFAIL%s %s:%d: index failed for absent-strategy %s\n", tf_red(),
235 tf_reset(), __FILE__, __LINE__, strategy);
236 rh_cleanup(&lp, store);
237 return 1;
238 }
239 int rc = 0;
240 if (inv_edge_has_strategy(store, lp.project, strategy)) {
241 printf(" %sFAIL%s %s:%d: strategy %s unexpectedly PRESENT on a CALLS "
242 "edge (expected ABSENT — bare fallback tag is never emitted)\n",
243 tf_red(), tf_reset(), __FILE__, __LINE__, strategy);
244 rc = 1;
245 }
246 rh_cleanup(&lp, store);
247 return rc;
248}
249
250/* ── Fixtures ────────────────────────────────────────────────────────────────
251 *

Callers 1

repro_lsp_ts.cFile · 0.85

Calls 5

rh_indexFunction · 0.85
tf_redFunction · 0.85
tf_resetFunction · 0.85
rh_cleanupFunction · 0.85
inv_edge_has_strategyFunction · 0.85

Tested by

no test coverage detected