Repository navigation
feat(runtime): preserve writers during ordinary watcher startup - #399
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (14)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change adds runtime APIs for starting or reusing a verified watcher. It also adds an MCP option that prevents replacement of existing or uncertain daemon and writer owners, with exact-root checks and read-only fallback behavior. ChangesWatcher and daemon lifecycle
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable ownership or watcher-startup issue remains identified. Complete the required platform lifecycle CI before landing. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Startup adds stronger checkout-readiness checks and preserves existing owners. No newly introduced ownership bypass was established, but validation of the latest lifecycle changes across supported platforms remains outstanding. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
Full details: User-Visible Changes DocumentedExplanation The PR adds the
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Ordinary checkout startup previously had to use replacement-oriented MCP launch or promotion control, and a readable daemon did not prove that its watcher was active. Add
startRuntimeWatcher(root, {expectedVersion, cliPath, runtimePath?, timeoutMs?})andserve --mcp --path <root> --preserve-existingfor startup that preserves existing writers.The ordinary operation returns only after verifying the exact canonical root, build, active watcher, MCP status and unchanged daemon/writer ownership. Preservation covers initial connection, detached election, default and explicit project activation, fallback reads and reconnect. Live, legacy, uncertain, wrong-build, direct and promotion owners remain untouched. Timeouts leave a possibly shared daemon to its existing idle lifecycle.
Validation passed: 74 focused runtime-control, writer-lock and explicit-project lifecycle tests; the full engine/UI suite with 7,522 tests passed and 39 skipped across 587 files; TypeScript
tsc --noEmit; kernel rules; agent-document size; whitespace. Reversing the writer-generation guard and disabling read-only fallback produced the intended successor-preservation andolder -> older -> olderfailures. Both mutations were restored before the full suite. Lifecycle CI passed on Linux, Windows and macOS at this head.README review covered the About this fork runtime-policy paragraph and embedding/runtime section. Language, framework and measured-result rows are unchanged. The API reference and Unreleased changelog describe the new operation. No installer, dependency, artifact promotion or installed-runtime change is included.