Skip to content

Commit 309780d

Browse files
author
Your Name
committed
feat(store): include HANDLES/HTTP_CALLS in process detection BFS
Process detection now follows HANDLES, HTTP_CALLS, and ASYNC_CALLS edges in addition to CALLS when building Louvain communities and running BFS from entry points. Previously only CALLS edges were traversed, making Express/Hapi route→handler flows invisible to process detection. Changes: - Louvain edge loading query: type IN ('CALLS','HANDLES','HTTP_CALLS','ASYNC_CALLS') - BFS from entry points: 4 edge types instead of 1 Tested: Express monorepo with 158 routes went from 3 to 4 detected flows, with routes now participating in community detection.
1 parent 975329a commit 309780d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/store/store.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4666,7 +4666,11 @@ int cbm_store_detect_processes(cbm_store_t *s, const char *project, int max_proc
46664666
sqlite3_finalize(nst);
46674667
}
46684668

4669-
const char *esql = "SELECT source_id, target_id FROM edges WHERE project=?1 AND type='CALLS'";
4669+
/* Include CALLS, HANDLES, and HTTP_CALLS for Louvain community detection.
4670+
* HANDLES connects Route → handler, HTTP_CALLS connects client → API endpoint.
4671+
* Without these, Express/Hapi route flows are invisible to process detection. */
4672+
const char *esql = "SELECT source_id, target_id FROM edges WHERE project=?1 "
4673+
"AND type IN ('CALLS','HANDLES','HTTP_CALLS','ASYNC_CALLS')";
46704674
sqlite3_stmt *est = NULL;
46714675
int le_cap = 8192;
46724676
int le_count = 0;
@@ -4725,9 +4729,9 @@ int cbm_store_detect_processes(cbm_store_t *s, const char *project, int max_proc
47254729
int proc_count = 0;
47264730

47274731
for (int ei = 0; ei < ep_count && proc_count < max_processes; ei++) {
4728-
const char *bfs_types[] = {"CALLS"};
4732+
const char *bfs_types[] = {"CALLS", "HANDLES", "HTTP_CALLS", "ASYNC_CALLS"};
47294733
cbm_traverse_result_t tr = {0};
4730-
cbm_store_bfs(s, ep_ids[ei], "outbound", bfs_types, 1, 8, 50, &tr);
4734+
cbm_store_bfs(s, ep_ids[ei], "outbound", bfs_types, 4, 8, 50, &tr);
47314735

47324736
if (tr.visited_count < 2) {
47334737
cbm_store_traverse_free(&tr);

0 commit comments

Comments
 (0)