sqry-daemon — long-lived code-graph service.
The daemon (sqryd binary) owns one or more loaded code graphs in memory,
watches source trees for changes, and serves CLI / LSP / MCP clients over a
shared Unix-domain socket (named pipe on Windows). The goal is to amortise
graph-load cost across every sqry invocation on a machine while preserving
the semantic guarantees of direct-mode sqry (bijective per-file buckets,
tombstone compaction, ArcSwap publish, etc.).
Architecture at a glance
- [
config] — parses~/.config/sqry/daemon.tomlinto a [config::DaemonConfig] with every tuning knob from the Amendment-2 design (memory limits, working-set multipliers, stale-serve age cap, debounce timing, interner compaction threshold, log rotation, socket path). - [
workspace] (Task 6) —WorkspaceManagerownsLoadedWorkspacestate (§G admission accounting, §H rebuild plumbing, §F bijection check). - [
rebuild] (Task 7) — per-workspace rebuild lane + coalescing (§J). - [
ipc] (Task 8) — JSON-RPC over UDS with a standard response envelope. - [
lifecycle] (Task 9) — pidfile locking, signal handling, service unit generators. - [
client] (Task 10) — client library used bysqry-cli/sqry-lsp --daemon/sqry-mcp --daemonto connect to a running daemon and auto-start one if necessary.
Only [config] and the public error type [DaemonError] are in the surface
today; later tasks in this plan land the other modules in order.