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

Function assert_strategy_absent

tests/repro/repro_lsp_ts.c:226–245  ·  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

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

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