| 23641 | * the ranked query and the count query still agree. */ |
| 23642 | |
| 23643 | static cbm_mcp_server_t *setup_prose_search_server(const char *proj) { |
| 23644 | cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL); |
| 23645 | if (!srv) { |
| 23646 | return NULL; |
| 23647 | } |
| 23648 | cbm_store_t *st = cbm_mcp_server_store(srv); |
| 23649 | cbm_mcp_server_set_project(srv, proj); |
| 23650 | cbm_store_upsert_project(st, proj, "/tmp/prose"); |
| 23651 | |
| 23652 | cbm_node_t section = {.project = proj, |
| 23653 | .label = "Section", |
| 23654 | .name = "Installation", |
| 23655 | .qualified_name = "prose.README.Installation", |
| 23656 | .file_path = "README.md", |
| 23657 | .start_line = 1, |
| 23658 | .end_line = 20, |
| 23659 | .properties_json = "{\"docstring\":\"provisions an ephemeral " |
| 23660 | "workstation runner and seeds the cache\"}"}; |
| 23661 | cbm_store_upsert_node(st, §ion); |
| 23662 | |
| 23663 | cbm_node_t module = {.project = proj, |
| 23664 | .label = "Module", |
| 23665 | .name = "action.yml", |
| 23666 | .qualified_name = "prose.action_yml", |
| 23667 | .file_path = "action.yml", |
| 23668 | .start_line = 1, |
| 23669 | .end_line = 40, |
| 23670 | .properties_json = |
| 23671 | "{\"docstring\":\"aggregates telemetry from every shard\"}"}; |
| 23672 | cbm_store_upsert_node(st, &module); |
| 23673 | |
| 23674 | cbm_node_t fn = {.project = proj, |
| 23675 | .label = "Function", |
| 23676 | .name = "telemetryCollector", |
| 23677 | .qualified_name = "prose.src.telemetryCollector", |
| 23678 | .file_path = "src/collect.c", |
| 23679 | .start_line = 3, |
| 23680 | .end_line = 9}; |
| 23681 | cbm_store_upsert_node(st, &fn); |
| 23682 | |
| 23683 | cbm_store_fts_rebuild(st, NULL, 0); |
| 23684 | return srv; |
| 23685 | } |
| 23686 | |
| 23687 | static char *prose_search(cbm_mcp_server_t *srv, const char *proj, const char *query) { |
| 23688 | char req[512]; |
no test coverage detected