One fresh full index (the project DB removed first, so no incremental route * can keep earlier rows); returns the candidate rows, -1 on an index error. */
| 15374 | /* One fresh full index (the project DB removed first, so no incremental route |
| 15375 | * can keep earlier rows); returns the candidate rows, -1 on an index error. */ |
| 15376 | static int doccand_index(cbm_mcp_server_t *srv, const char *cache, const char *repo, |
| 15377 | const char *extra) { |
| 15378 | doccand_clear(cache); |
| 15379 | char args[1024]; |
| 15380 | snprintf(args, sizeof(args), "{\"repo_path\":\"%s\"%s}", repo, extra); |
| 15381 | char *resp = cbm_mcp_handle_tool(srv, "index_repository", args); |
| 15382 | bool ok = resp && response_contains_json_fragment(resp, "\"status\":\"indexed\""); |
| 15383 | free(resp); |
| 15384 | return ok ? doccand_rows(cache) : -1; |
| 15385 | } |
| 15386 | |
| 15387 | /* index_repository doc_candidates (full mode): an explicit false stores no |
| 15388 | * candidate rows; without the argument a set doc_candidates setting decides |
no test coverage detected