pub struct DaemonConfig {Show 19 fields
pub memory_limit_mb: u64,
pub idle_timeout_minutes: u64,
pub debounce_ms: u64,
pub incremental_threshold: usize,
pub closure_limit_percent: u32,
pub stale_serve_max_age_hours: u32,
pub rebuild_drain_timeout_ms: u64,
pub ipc_shutdown_drain_secs: u64,
pub tool_timeout_secs: u64,
pub max_shim_connections: usize,
pub interner_compaction_threshold: f32,
pub log_file: Option<PathBuf>,
pub log_level: String,
pub log_max_size_mb: u64,
pub socket: SocketConfig,
pub workspaces: Vec<WorkspaceConfig>,
pub auto_start_ready_timeout_secs: u64,
pub log_keep_rotations: u32,
pub install_user_service: bool,
}Expand description
Top-level daemon configuration.
Loaded from ~/.config/sqry/daemon.toml by default. Env-var overrides
(see the ENV_* constants) are layered on top by DaemonConfig::load.
Fields§
§memory_limit_mb: u64Hard cap on total resident graph memory across every loaded workspace.
idle_timeout_minutes: u64Workspace idle-timeout before it becomes eligible for LRU eviction.
debounce_ms: u64Filesystem-watcher debounce window (ms) for coalescing bursts of changes.
incremental_threshold: usizeIf > incremental_threshold files changed in one window, full-rebuild
instead of incremental-rebuild.
closure_limit_percent: u32If the reverse-dep closure covers > closure_limit_percent% of the
graph’s files, full-rebuild instead of incremental-rebuild.
stale_serve_max_age_hours: u32Cap on how long a Failed workspace may keep serving its last-good
snapshot as stale: true. 0 disables the cap (serve indefinitely).
rebuild_drain_timeout_ms: u64Retention-reaper WARN threshold, not an accounting deadline.
Retained bytes are released when Arc::strong_count drops to 1 —
regardless of wall-clock time.
ipc_shutdown_drain_secs: u64Grace window (seconds) for the IPC accept loop to drain active connections during shutdown. Task 8 Phase 8a.
tool_timeout_secs: u64Per-tool invocation timeout. Bounds the response latency of
any single tool call; exceeding this returns
DaemonError::ToolTimeout (JSON-RPC -32000 / MCP
internal_error with kind = "deadline_exceeded").
Important contract: this bounds RESPONSE LATENCY, not the
detached OS-thread lifetime. When the timeout fires, the
tokio::task::spawn_blocking tokio::task::JoinHandle is
dropped; the OS thread running the tool closure continues
until the closure itself returns. A buggy/runaway tool closure
can keep its thread alive past daemon/stop. Default 60
seconds. Task 8 Phase 8c U6.
max_shim_connections: usizeCap on the number of concurrently-registered shim byte-pump
connections. Every accepted ShimRegister frame must pass
crate::ipc::shim_registry::ShimRegistry::try_register_bounded
against this cap under a single mutex-guard — over-cap
admissions reply ShimRegisterAck { accepted: false, reason: "shim registry full (N / cap)" } and the connection closes.
Default 256. Task 8 Phase 8c U10.
interner_compaction_threshold: f32Interner housekeeping: if the live-ratio drops below this, the next debounce tick schedules a mandatory full rebuild.
log_file: Option<PathBuf>Optional structured-log file path.
log_level: StringLog verbosity (matches tracing_subscriber::EnvFilter syntax).
log_max_size_mb: u64Log-rotation trigger.
socket: SocketConfigIPC listener binding (UDS on Unix, named pipe on Windows).
workspaces: Vec<WorkspaceConfig>Pre-declared workspaces — pinned workspaces load at daemon startup.
auto_start_ready_timeout_secs: u64Timeout (seconds) used in two places:
--detachparent wait loop (run_start_detach): how long the launching parent process waits for the grandchild to signal ready via the self-pipe before giving up and killing the grandchild.lifecycle::start_detached(Task 10 auto-spawn): how long the client helper polls the daemon socket before returningDaemonError::AutoStartTimeout.
Valid range (enforced by DaemonConfig::validate): 1..=60.
log_keep_rotations: u32Number of rotated log archives to keep alongside the live log file.
When RollingSizeAppender rotates, it shifts existing .1–.N files
one position and deletes any file beyond this limit. A value of 5 means
.1–.5 are retained; .6 and beyond are removed.
Valid range (enforced by DaemonConfig::validate): 1..=100.
install_user_service: boolReserved for future use — will drive automated systemd user-service
installation on first sqryd start when set to true. Currently a
no-op; stored in config to avoid breaking changes when the feature
lands. Defaults to false.
Implementations§
Source§impl DaemonConfig
impl DaemonConfig
Sourcepub fn load() -> DaemonResult<Self>
pub fn load() -> DaemonResult<Self>
Load the effective config: start from defaults, apply the TOML file at
the canonical path (or the one named by ENV_CONFIG_PATH), then
layer environment-variable overrides.
A missing config file is not an error — the defaults plus env-var overrides are returned. A malformed file is always an error.
Sourcepub fn load_from_path(path: &Path) -> DaemonResult<Self>
pub fn load_from_path(path: &Path) -> DaemonResult<Self>
Load a config file from an explicit path, ignoring env overrides. Useful for tests and documentation examples.
Sourcepub fn from_toml_str(text: &str) -> Result<Self>
pub fn from_toml_str(text: &str) -> Result<Self>
Parse a TOML string into a DaemonConfig. Defaults fill any missing
fields.
Sourcepub fn apply_env_overrides(&mut self) -> DaemonResult<()>
pub fn apply_env_overrides(&mut self) -> DaemonResult<()>
Apply SQRY_DAEMON_* environment-variable overrides. See the
ENV_* constants for the full list.
Sourcepub fn validate(&self) -> DaemonResult<()>
pub fn validate(&self) -> DaemonResult<()>
Sanity-check invariants that admission accounting and the rebuild dispatcher depend on.
Sourcepub fn resolve_config_path() -> DaemonResult<PathBuf>
pub fn resolve_config_path() -> DaemonResult<PathBuf>
Resolve the config-file path, respecting ENV_CONFIG_PATH.
Falls back to $XDG_CONFIG_HOME/sqry/daemon.toml, then
$HOME/.config/sqry/daemon.toml.
Sourcepub fn socket_path(&self) -> PathBuf
pub fn socket_path(&self) -> PathBuf
Path the IPC server binds to.
- Unix: explicit
socket.path, else$XDG_RUNTIME_DIR/sqry/sqryd.sock, else$TMPDIR/sqry-<uid>/sqryd.sock. - Windows:
\\\\.\\pipe\\<socket.pipe_name>(defaultsqry).
Sourcepub fn lock_path(&self) -> PathBuf
pub fn lock_path(&self) -> PathBuf
Flock target — held exclusively by the running daemon, and briefly
by clients during auto-start to avoid racing two sqry processes.
Sourcepub fn runtime_dir(&self) -> PathBuf
pub fn runtime_dir(&self) -> PathBuf
Platform-specific per-user runtime directory where the socket, pidfile, and lockfile live.
This is the public accessor for the private [runtime_dir] free
function. The return value is the same as socket_path().parent()
when the socket path uses the default (not the explicit socket.path
override).
Sourcepub const fn memory_limit_bytes(&self) -> u64
pub const fn memory_limit_bytes(&self) -> u64
Memory budget in bytes, derived from Self::memory_limit_mb.
Trait Implementations§
Source§impl Clone for DaemonConfig
impl Clone for DaemonConfig
Source§fn clone(&self) -> DaemonConfig
fn clone(&self) -> DaemonConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DaemonConfig
impl Debug for DaemonConfig
Source§impl Default for DaemonConfig
impl Default for DaemonConfig
Source§impl<'de> Deserialize<'de> for DaemonConfig
impl<'de> Deserialize<'de> for DaemonConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DaemonConfig
impl RefUnwindSafe for DaemonConfig
impl Send for DaemonConfig
impl Sync for DaemonConfig
impl Unpin for DaemonConfig
impl UnsafeUnpin for DaemonConfig
impl UnwindSafe for DaemonConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more