Part of #71. The daemon process itself, no service-file plumbing, no CLI wiring yet.
Scope
Create `src/daemon/` with five focused modules:
The watcher's events feed the queue; the queue's timer fires call into `src/ingest/index.ts`'s `ingest()` function in-process (no subprocess).
Verified prerequisites
- ✅ `ingest()` and `ingestAll()` are clean async exports from `src/ingest/index.ts` — importable standalone
- ✅ Bun 1.3.6 supports Node-compatible `fs.watch` with `{ recursive: true }` on macOS
Acceptance
- `bun src/daemon/server.ts` runs in foreground, binds socket, exits cleanly on SIGTERM
- Second instance attempting to bind same socket exits 0 with a "already running" message
- Touching a file under any configured agent log dir triggers ingest after debounce window
- Sending bytes to the socket triggers immediate Claude ingest
- SIGKILL leaves no stale socket file blocking the next start
Out of scope (other issues in milestone)
Part of #71. The daemon process itself, no service-file plumbing, no CLI wiring yet.
Scope
Create `src/daemon/` with five focused modules:
/.cache/smriti/daemon.sock`, single-instance guard via bind-fail, signal handling (SIGTERM/SIGINT graceful drain), diagnostic PID file at `/.cache/smriti/daemon.pid`, log rotation to `~/.cache/smriti/daemon.log`The watcher's events feed the queue; the queue's timer fires call into `src/ingest/index.ts`'s `ingest()` function in-process (no subprocess).
Verified prerequisites
Acceptance
Out of scope (other issues in milestone)