Helper to check if any CONFIGURES edge has a given strategy (parsed from JSON) */
| 36 | |
| 37 | /* Helper to check if any CONFIGURES edge has a given strategy (parsed from JSON) */ |
| 38 | static bool has_strategy(const cbm_gbuf_edge_t **edges, int count, const char *strategy) { |
| 39 | char needle[64]; |
| 40 | snprintf(needle, sizeof(needle), "\"strategy\":\"%s\"", strategy); |
| 41 | for (int i = 0; i < count; i++) { |
| 42 | if (edges[i]->properties_json && strstr(edges[i]->properties_json, needle)) |
| 43 | return true; |
| 44 | } |
| 45 | return false; |
| 46 | } |
| 47 | |
| 48 | /* Check if any CONFIGURES edge has given strategy AND confidence. */ |
| 49 | static bool has_strategy_with_confidence(const cbm_gbuf_edge_t **edges, int count, |