| 270 | #endif |
| 271 | |
| 272 | cbm_daemon_ipc_endpoint_t *cbm_daemon_bootstrap_endpoint_new(const char *runtime_parent) { |
| 273 | char key[CBM_DAEMON_KEY_SIZE]; |
| 274 | if (!cbm_daemon_rendezvous_key(key)) { |
| 275 | return NULL; |
| 276 | } |
| 277 | /* The override is resolved HERE, the one function every product endpoint |
| 278 | * goes through (daemon, MCP client, local CLI, index worker, activation), |
| 279 | * so no call site can silently keep the default. */ |
| 280 | char override_parent[BOOTSTRAP_PATH_CAP]; |
| 281 | const char *parent = |
| 282 | bootstrap_runtime_parent_resolve(runtime_parent, override_parent, sizeof(override_parent)); |
| 283 | #ifdef CBM_ENABLE_TEST_SEAMS |
| 284 | if (!parent && g_bootstrap_default_runtime_forbidden) { |
| 285 | (void)fprintf(stderr, "codebase-memory-mcp: test run refused the default daemon runtime " |
| 286 | "directory (no explicit parent and CBM_RUNTIME_DIR unset): the " |
| 287 | "developer's live daemon listens there\n"); |
| 288 | return NULL; |
| 289 | } |
| 290 | #endif |
| 291 | return cbm_daemon_ipc_endpoint_new(key, parent); |
| 292 | } |
| 293 | |
| 294 | bool cbm_daemon_bootstrap_launch_spec_init(const char *executable_path, |
| 295 | cbm_daemon_bootstrap_launch_spec_t *spec_out) { |