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

Function handle_atlas_scent

src/ui/http_server.c:2912–2927  ·  view source on GitHub ↗

GET /api/scent?project=X&q=pattern — per-region search hit counts. */

Source from the content-addressed store, hash-verified

2910
2911/* GET /api/scent?project=X&q=pattern — per-region search hit counts. */
2912static void handle_atlas_scent(cbm_http_conn_t *c, const cbm_http_req_t *req) {
2913 char project[256] = {0};
2914 cbm_store_t *store = atlas_open_project(c, req, project, sizeof(project));
2915 if (!store)
2916 return;
2917 char q[256] = {0};
2918 cbm_http_query_param(req->query, "q", q, (int)sizeof(q));
2919 if (strlen(q) < 2) {
2920 cbm_store_close(store);
2921 cbm_http_replyf(c, 400, g_cors_json, "{\"error\":\"q must be at least 2 characters\"}");
2922 return;
2923 }
2924 char *json = cbm_atlas_scent_json(store, project, q);
2925 cbm_store_close(store);
2926 atlas_reply_json(c, json, 500, "{\"error\":\"scent failed\"}");
2927}
2928
2929/* GET /api/flows?project=X — ranked entry→terminal flows. */
2930static void handle_atlas_flows(cbm_http_conn_t *c, const cbm_http_req_t *req) {

Callers 1

dispatch_requestFunction · 0.85

Calls 6

atlas_open_projectFunction · 0.85
cbm_http_query_paramFunction · 0.85
cbm_store_closeFunction · 0.85
cbm_http_replyfFunction · 0.85
cbm_atlas_scent_jsonFunction · 0.85
atlas_reply_jsonFunction · 0.85

Tested by

no test coverage detected