Skip to content

Commit 4061125

Browse files
committed
fix: restore unconfirmed-ownership handling for a busy cohort; align conflict-hint tests
Jenkins release-tooling DeusData#64 on 928191b failed 4 tests, both groups caused by the PR #18 minor-comment fixes. 1. Revert the CBM_VERSION_COHORT_BUSY change in cli_activation_resolve_scope. 928191b followed a CodeRabbit suggestion to treat BUSY as ACTIVE and take the coordinated reservation path. That contradicts the recorded user decision of 2026-09-28, "unknown = foreign, keep it", which tests (e) and (f) in tests/test_cli.c pin. cli_install_foreign_home_busy_cohort_keeps_host_daemon (test_cli.c:2238) checks the busy case: when another activation holds the cohort maintenance gate, the cohort's cache identity cannot be read, so ownership is unconfirmed. Install must then leave the host daemon serving, drain no one, mutate only this home and cache, and print the notice naming that daemon and how to stop it. With the change, install refused with "something is still using CBM". BUSY is routed back through cli_activation_scope_unconfirmed, with a comment citing the decision. 2. tests/test_daemon_version.c (309, 327, 346): the daemon conflict remedy in runtime.c names the fork binary (codebase-memory-cli) since 928191b. The three remedy tests now assert `which -a codebase-memory-cli`, `codebase-memory-cli daemon stop` and `codebase-memory-cli daemon status`. Validated: -Werror build and test-runner, lint --ci, and the cli and daemon_version suites.
1 parent 928191b commit 4061125

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎src/cli/cli.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,11 @@ static cli_activation_scope_t cli_activation_resolve_scope(
629629
case CBM_VERSION_COHORT_OK:
630630
return CLI_ACTIVATION_SCOPE_ACTIVE;
631631
case CBM_VERSION_COHORT_BUSY:
632-
return CLI_ACTIVATION_SCOPE_ACTIVE;
632+
/* User decision 2026-09-28, "unknown = foreign, keep it": a busy
633+
* maintenance gate means ownership is unconfirmed, so the running
634+
* cohort is left serving and only this home/cache is mutated. */
635+
return cli_activation_scope_unconfirmed(
636+
context, scope, "the session group was busy, so its cache identity could not be read");
633637
case CBM_VERSION_COHORT_CONFLICT:
634638
break;
635639
default:

‎tests/test_daemon_version.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ TEST(daemon_conflict_remedy_names_session_managed_daemon_and_its_sessions) {
306306
ASSERT_NOT_NULL(strstr(remedy, "version 0.10.3"));
307307
ASSERT_NOT_NULL(strstr(remedy, "session-managed"));
308308
ASSERT_NOT_NULL(strstr(remedy, "5151, 6262"));
309-
ASSERT_NOT_NULL(strstr(remedy, "which -a codebase-memory-mcp"));
310-
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-mcp daemon stop"));
309+
ASSERT_NOT_NULL(strstr(remedy, "which -a codebase-memory-cli"));
310+
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-cli daemon stop"));
311311
PASS();
312312
}
313313

@@ -324,7 +324,7 @@ TEST(daemon_conflict_remedy_names_permanent_daemon_and_truncated_session_list) {
324324
ASSERT_NOT_NULL(strstr(remedy, "pid 77"));
325325
ASSERT_NOT_NULL(strstr(remedy, "permanent"));
326326
ASSERT_NOT_NULL(strstr(remedy, "1007 and 3 more"));
327-
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-mcp daemon stop"));
327+
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-cli daemon stop"));
328328
PASS();
329329
}
330330

@@ -343,9 +343,9 @@ TEST(daemon_conflict_remedy_without_status_points_at_daemon_status) {
343343
char remedy[CBM_DAEMON_CONFLICT_REMEDY_SIZE];
344344

345345
ASSERT_TRUE(cbm_daemon_conflict_remedy_format(NULL, remedy, sizeof(remedy)));
346-
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-mcp daemon status"));
347-
ASSERT_NOT_NULL(strstr(remedy, "which -a codebase-memory-mcp"));
348-
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-mcp daemon stop"));
346+
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-cli daemon status"));
347+
ASSERT_NOT_NULL(strstr(remedy, "which -a codebase-memory-cli"));
348+
ASSERT_NOT_NULL(strstr(remedy, "codebase-memory-cli daemon stop"));
349349
PASS();
350350
}
351351

0 commit comments

Comments
 (0)