fix(watch): Scope runtime state per project - #158
Conversation
Namespace mutable files per canonical project and use one ownership-checked bridge for legacy daemon transitions. Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
Route MCP watcher control through the CLI owner and reject poisoned runtime markers without fallback writes. Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
Wait for detached watcher initialization before reporting CLI or MCP success, and preserve bounded lifecycle completion across request cancellation. Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
ed0f36a to
b196eed
Compare
|
Reviewed in depth with live daemon testing (concurrent starts, 1. BLOCKING — legacy-daemon detection misses the immediately-prior
|
Complied
|
|
Verified and merged. Reproduced the migration scenario live against the new head: a daemon started by a main-built binary under Generated by Claude Code |
What does this PR do?
Scopes mutable watcher state to the canonical project root and hardens watcher lifecycle handling:
.codemapdirectory.Why it matters
Projects sharing a setup root could collide on daemon state or stop one another’s watcher. Invalid linked-worktree metadata could also produce misleading success or raw git errors. This keeps ownership and lifecycle outcomes explicit.
CLI / MCP surface
No new commands, arguments, or MCP tools. Existing watch, hook, and handoff flows use project-scoped runtime state.
Security
Runtime markers are accepted only for the canonical owning project and verified process. Invalid roots and foreign ownership fail closed.
Developed with carefully directed, manually reviewed AI assistance.
Co-Authored-By: GPT-5.6 Sol codex@openai.com