docs(docs): add ADR-0036 for omni-dev daemon framework deployment and lifecycle - #896
Draft
newhoggy wants to merge 1 commit into
Draft
docs(docs): add ADR-0036 for omni-dev daemon framework deployment and lifecycle#896newhoggy wants to merge 1 commit into
newhoggy wants to merge 1 commit into
Conversation
… lifecycle Adds a new Architecture Decision Record proposing the daemon framework design for omni-dev, covering deployment, IPC, lifecycle management, and per-OS supervisor integration. The ADR addresses the core problem that per-invocation MCP servers cannot cheaply support features requiring persistent state, shared resources, or cross-session coordination (e.g. the proposed Claude Code chat-history module from issue #876). It records twelve policies taken together: - Single binary with daemon, stub, and CLI as subcommands (`omni-dev daemon serve`, `omni-dev mcp stub`, existing CLI commands unchanged) - Stub + daemon split with socket-activated supervisor as the primary path and stub-spawn as the automatic fallback - IPC via Unix domain sockets (Linux/macOS) and named pipes (Windows) with CBOR framing for non-MCP control traffic - Linux deployment using systemd user units with socket activation (`omni-dev-daemon.socket` + `omni-dev-daemon.service`) - macOS deployment using a launchd LaunchAgent plist with `Sockets` key and `KeepAlive.Crashed = true` - Windows deployment defaulting to stub-spawn with opt-in Scheduled Task via `omni-dev daemon install-service` - XDG-aware cross-platform filesystem layout via the `directories` crate - Generic module-hosting architecture: modules implement a small trait; the daemon loads zero or more compiled-in modules - Installation flow via `omni-dev daemon setup` (= install + install-mcp + install-hooks) with idempotent component commands - Version handshake on every stub→daemon connection with graceful self-restart when stub is newer than daemon - Security via peer-credential verification, `0600` socket permissions, `0700` data directories, and no network listener by default - Out-of-scope boundaries: multi-machine HTTP transport, Windows Services, Docker/OCI, sandbox/seccomp hardening, user-overridable paths Also registers ADR-0036 in the ADR index (docs/adrs/README.md) with status 🟡 Proposed and date 2026-05-25.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds ADR-0036, proposing the daemon framework design for omni-dev, covering deployment, IPC, lifecycle management, and per-OS supervisor integration. The ADR addresses the architectural need for a long-lived shared daemon process to support features requiring persistent state, shared resources, or cross-session coordination — most immediately the proposed Claude Code chat-history module from issue #876.
The core problem: per-invocation MCP servers cannot cheaply support features requiring a persistent on-disk index (Tantivy + SQLite + vectors), an always-loaded embedding model (~500 MB resident, ~80 ms cold-start), or coordination across multiple concurrent Claude Code instances. Without a shared daemon, N concurrent Claude Code sessions each spawn their own MCP server processes, leading to the documented 42-process / ~1.9 GB RAM OOM problem (anthropics/claude-code#28860).
ADR-0036 records twelve policies taken together that define the daemon framework:
omni-dev daemon serve,omni-dev mcp stub, and all existing CLI subcommands coexist in one artifact with one version number.omni-dev-daemon.socket+omni-dev-daemon.service).Socketskey andKeepAlive.Crashed = true.omni-dev daemon install-service.directoriescrate; per-module data undermodules/<name>/.omni-dev daemon setup(=install+install-mcp+install-hooks); all steps idempotent with matchinguninstallcounterparts.0600socket/pipe permissions,0700data directories, no network listener by default, refuse to run as root.Type of Change
Related Issue
Relates to #876 — proposal: shared-daemon MCP server for Claude Code session history; the proximate driver for the daemon framework.
Changes Made
Documentation:
docs/adrs/adr-0036.md— full Architecture Decision Record (512 lines) covering daemon framework deployment and lifecycle with status 🟡 Proposed (2026-05-25)docs/adrs/README.md— registered ADR-0036 in the ADR index tableADR Content Coverage:
systemctl/launchctlexecution in CI) and which must be covered cross-platform (file generation golden tests, IPC round-trips, handshake version-skew matrix, stub-spawn fallback, end-to-enddaemon setupin a temp$HOME)Testing
Automated Testing:
Manual Testing:
docs/adrs/README.mdmatches the new file name and summaryTest Commands
Review Focus Areas
Please pay special attention to:
omni-devMCP server and all existing CLI subcommands are unchanged; confirm the proposed namespacing (omni-dev-daemonMCP server alongsideomni-dev) is acceptableomni-dev daemon setup/install/install-mcp/install-hooks/teardowncommand hierarchy; verify it fits ADR-0016's hierarchical subcommand conventionsChecklist
Performance Impact
Security Considerations
Breaking Changes
None. This PR adds only documentation. No existing functionality is changed.
Deployment Notes
Additional Notes
Future Enhancements:
Known Limitations:
Alternatives Considered:
omni-dev daemon serve --httpmode for multi-machine scenarios; out of scope for v1