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

Function has_strategy_with_confidence

tests/test_configlink.c:49–62  ·  view source on GitHub ↗

Check if any CONFIGURES edge has given strategy AND confidence. */

Source from the content-addressed store, hash-verified

47
48/* Check if any CONFIGURES edge has given strategy AND confidence. */
49static bool has_strategy_with_confidence(const cbm_gbuf_edge_t **edges, int count,
50 const char *strategy, double confidence) {
51 char strat_needle[64];
52 snprintf(strat_needle, sizeof(strat_needle), "\"strategy\":\"%s\"", strategy);
53 char conf_needle[64];
54 snprintf(conf_needle, sizeof(conf_needle), "\"confidence\":%.2f", confidence);
55
56 for (int i = 0; i < count; i++) {
57 if (edges[i]->properties_json && strstr(edges[i]->properties_json, strat_needle) &&
58 strstr(edges[i]->properties_json, conf_needle))
59 return true;
60 }
61 return false;
62}
63
64/* Check if any CONFIGURES edge has given strategy AND config_key. */
65static bool has_strategy_with_key(const cbm_gbuf_edge_t **edges, int count, const char *strategy,

Callers 1

test_configlink.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected