Skip to content

fix(daemon): linked-worktree indexing opt-in surfaces reopen, concurrent-open, and shutdown defects #912

Description

@ScriptedAlchemy

Context

f347a0a46 (fix(index): require opt-in for linked worktree scopes) gates project-open code-index activation for a linked worktree behind sync.watch_linked_worktrees (default false). daemon::tests::runtime_identity::concurrent_same_identity_worktrees_keep_exact_server_and_scheduler_bindings predates that contract and still asserts the linked route serves tracedecay_files; it now correctly answers code-graph-unavailable.

While repairing that test (production fixes for the federated store locator, the scope-digest pairing, and the observability store-owner identity are landing separately), a lane prototyped the opt-in (sync.watch_linked_worktrees = true through the production configuration surface plus a wait on subscribe_serving_seats / generation publications for the boundary) and reverted it because indexing the linked route exposes three further defects, each needing its own root cause:

  1. Reopening the linked route fails with a different retained runtime is already registered for this projectcrates/tracedecay-daemon-service/src/invocation/registrars.rs (~line 1204) requires Arc::ptr_eq on a ports Arc that a reopen necessarily replaces. Same class as the observability-registry identity defect (store authority, not object identity, is the identity).
  2. Concurrent open intermittently blocks ~30 s at linked phase=graph_admitted elapsed_ms=30070 and then fails project Context Scout durable owner is unavailable (crates/tracedecay/src/daemon/engine.rs ~line 183).
  3. engine.shutdown_all() then exceeds the test's 5 s bound. The bound must not be extended; find what holds shutdown.

Acceptance

  • With sync.watch_linked_worktrees = true, a second worktree of the same project opens, indexes, reopens, and shuts down within the existing bounds, concurrently with the primary.
  • No timeouts extended, no retries or polling added; waits are on typed signals (serving seats, publications, route cancellation).
  • concurrent_same_identity_worktrees_keep_exact_server_and_scheduler_bindings (or its restated successor) green on Linux and macOS CI.

Targets codex/tracedecay-total-redesign-plan-reopened (#707). Refs #863, #896.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions