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

Function imp_check_label

tests/test_importance.c:86–102  ·  view source on GitHub ↗

Every stored node of the given label must carry exactly `expect` copies of * the key. Returns the number of nodes checked, or -1 on a store error. */

Source from the content-addressed store, hash-verified

84/* Every stored node of the given label must carry exactly `expect` copies of
85 * the key. Returns the number of nodes checked, or -1 on a store error. */
86static int imp_check_label(cbm_store_t *s, const char *project, const char *label, int expect) {
87 cbm_node_t *nodes = NULL;
88 int count = 0;
89 if (cbm_store_find_nodes_by_label(s, project, label, &nodes, &count) != CBM_STORE_OK) {
90 return -1;
91 }
92 int bad = 0;
93 for (int i = 0; i < count; i++) {
94 if (imp_key_count(nodes[i].properties_json) != expect) {
95 bad++;
96 printf(" %s node '%s' props=%s\n", label, nodes[i].name ? nodes[i].name : "?",
97 nodes[i].properties_json ? nodes[i].properties_json : "(null)");
98 }
99 }
100 cbm_store_free_nodes(nodes, count);
101 return bad == 0 ? count : -1;
102}
103
104/* ── Store-level score readout (for the closure-delta tests) ──────────── */
105

Callers 1

test_importance.cFile · 0.85

Calls 3

imp_key_countFunction · 0.85
cbm_store_free_nodesFunction · 0.85

Tested by

no test coverage detected