feat minor daemon feat/phase-2g-bundle
AI Agent git-import/068377df · 113 days ago · Apr 4, 2026 · Diff

feat(daemon): Session 5 — daemon lifecycle (Daemon Spec Phase B)

Add lib/daemon.mjs with full process lifecycle: startDaemon (foreground loop, SIGTERM/SIGINT graceful shutdown, cancellable sleep, stale PID crash recovery, run_on_start), stopDaemon (SIGTERM → SIGKILL with configurable timeout), getDaemonStatus (PID check, log-derived last-pass and next-pass). Pure helper exports (getPidPath, getLogPath, writePidFile, readPidFile, removePidFile, isProcessAlive, detectStalePid, appendDaemonLog, readDaemonLog, isIdle, validateLlmConnectivity) are fully injectable for testing — no real LLM calls in the test suite.

CLI: daemon start [--background] | stop | status | log [--tail <n>]. MCP: daemon_status tool returns running state, PID, last/next pass times.

74 new tests (729 total, 0 failures, 0 regressions).

sha256:9570cba382d24f9a79a433603234ad223c744590cce490f3c5ef776de1e42afb sha
sha256:05a067bce3a25b27d59d3779ca41fe21138d8c479005bebb2df5df86f9b51ac1 snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:9570cba382d24f9a79a433603234ad223c744590cce490f3c5ef776de1e42afb --body "your comment"