GET /api/impact?project=X&node=QN|#id — reverse reachability: who could * notice a change to this symbol, at what distance, in which regions, and * which test functions reach it. */
| 2746 | * notice a change to this symbol, at what distance, in which regions, and |
| 2747 | * which test functions reach it. */ |
| 2748 | static void handle_atlas_impact(cbm_http_conn_t *c, const cbm_http_req_t *req) { |
| 2749 | char project[256] = {0}; |
| 2750 | cbm_store_t *store = atlas_open_project(c, req, project, sizeof(project)); |
| 2751 | if (!store) |
| 2752 | return; |
| 2753 | char node_str[1024] = {0}; |
| 2754 | cbm_http_query_param(req->query, "node", node_str, (int)sizeof(node_str)); |
| 2755 | if (!node_str[0]) { |
| 2756 | cbm_store_close(store); |
| 2757 | cbm_http_replyf(c, 400, g_cors_json, "{\"error\":\"missing node parameter\"}"); |
| 2758 | return; |
| 2759 | } |
| 2760 | int64_t node_id = node_str[0] == '#' ? strtoll(node_str + 1, NULL, 10) : -1; |
| 2761 | char *json = cbm_atlas_impact_json(store, project, node_id, node_id < 0 ? node_str : NULL); |
| 2762 | cbm_store_close(store); |
| 2763 | atlas_reply_json(c, json, 500, "{\"error\":\"impact failed\"}"); |
| 2764 | } |
| 2765 | |
| 2766 | /* Attach guard chains to a flow-detail JSON (guards=1): each step's call |
| 2767 | * site is (steps[step.parent] → step); the guard chain is extracted in the |
no test coverage detected