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

Function build_api_vec

src/pipeline/pass_semantic_edges.c:499–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497/* ── Build per-function semantic data ────────────────────────────── */
498
499static void build_api_vec(const cbm_gbuf_t *gbuf, int64_t node_id, cbm_sem_vec_t *out) {
500 memset(out, 0, sizeof(*out));
501 /* Sorted neighbors: stable MAX_CALLEES subset + stable float-accumulation
502 * order (see collect_sorted_call_neighbors). */
503 int n = 0;
504 const char **names = collect_sorted_call_neighbors(gbuf, node_id, /*outbound=*/true, &n);
505 if (!names) {
506 return;
507 }
508 for (int i = 0; i < n && i < MAX_CALLEES; i++) {
509 cbm_sem_vec_t callee_ri;
510 cbm_sem_random_index(names[i], &callee_ri);
511 cbm_sem_vec_add_scaled(out, &callee_ri, PSE_UNIT_POS);
512 }
513 cbm_free(CBM_MEM_CLASS_SEMANTIC, (void *)names);
514 cbm_sem_normalize(out);
515}
516
517static void build_type_vec(const char *props_json, cbm_sem_vec_t *out) {
518 memset(out, 0, sizeof(*out));

Callers 1

collect_workerFunction · 0.85

Calls 5

cbm_sem_random_indexFunction · 0.85
cbm_sem_vec_add_scaledFunction · 0.85
cbm_freeFunction · 0.85
cbm_sem_normalizeFunction · 0.85

Tested by

no test coverage detected