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

Function resolve_same_module

src/pipeline/registry.c:677–693  ·  view source on GitHub ↗

Strategy 2: Same-module match */

Source from the content-addressed store, hash-verified

675
676/* Strategy 2: Same-module match */
677static cbm_resolution_t resolve_same_module(const cbm_registry_t *r, const char *callee_name,
678 const char *suffix, const char *module_qn) {
679 char candidate[CBM_SZ_512];
680 snprintf(candidate, sizeof(candidate), "%s.%s", module_qn, callee_name);
681 const char *stored_key = cbm_ht_get_key(r->exact, candidate);
682 if (stored_key) {
683 return (cbm_resolution_t){stored_key, "same_module", CONF_SAME_MODULE, REG_RESOLVED};
684 }
685 if (suffix && suffix[0]) {
686 snprintf(candidate, sizeof(candidate), "%s.%s", module_qn, suffix);
687 stored_key = cbm_ht_get_key(r->exact, candidate);
688 if (stored_key) {
689 return (cbm_resolution_t){stored_key, "same_module", CONF_SAME_MODULE, REG_RESOLVED};
690 }
691 }
692 return empty_result();
693}
694
695/* Strategy 4: multiple candidates with import filtering. */
696static cbm_resolution_t resolve_multi_with_imports(const qn_array_t *arr, const char *module_qn,

Callers 1

cbm_registry_resolveFunction · 0.85

Calls 2

cbm_ht_get_keyFunction · 0.85
empty_resultFunction · 0.85

Tested by

no test coverage detected