Skip to main content

Module config

Module config 

Source
Expand description

Server config file support (~/.mse/config.toml, CLI > file > default merge). Server config file support (~/.mse/config.toml by default).

Resolution precedence: CLI flag > config file > built-in default. CLI flags are represented as Option<T> on the main.rs Args struct (rather than relying on clap’s default_value) so “not passed” can be distinguished from “matches the default value”; [resolve] performs the actual 3-way merge.

Design rationale: the config file becomes the lifecycle SoT; the launchd plist’s ProgramArguments stays fixed at <server-bin> --config <path>, so changing settings = editing the file + restarting, not editing the plist.

Structs§

CliOverrides
CLI-side overrides. Mirrors FileConfig field-for-field. Kept as a separate type (rather than reusing clap::Args directly) so this module stays independent of the clap derive on main.rs::Args.
FileConfig
TOML config schema. All fields are optional — a missing field falls back to the CLI-supplied value or the built-in default at resolve time. Unknown fields are a hard error (deny_unknown_fields; typo guard).
ResolvedConfig
Fully resolved config — every field has the built-in default applied.

Functions§

default_config_path
Default config path, ~/.mse/config.toml. Falls back to a relative path literal when $HOME is unset (best-effort; dev-only edge case).
default_replay_store_path
Default ReplayStore SQLite path, ~/.mse/store/replay.sqlite. Sibling of default_run_store_path — persisted by default so a restart can consult the replay log (see mlua_swarm::store::replay module doc).
default_run_store_path
Default RunStore SQLite path, ~/.mse/store/run.sqlite. Sibling of default_task_store_path.
default_store_path
Default BlueprintStore root, ~/.mse/store. Same $HOME fallback rule as default_config_path. The store is always git-backed; config/CLI only override where the repos live, never whether they persist.
default_sync_timeout_secs
Built-in default sync-launch timeout ceiling (GH #33 Guard 2), seconds. 3600s / 60 min — sized for LLM-driven agent flows where individual spawns routinely take 60-180s and full phases run 20-40 min. The previous 300s ceiling under-shot the primary workload; users hitting it were legitimate long-running runs, not stuck ones. Callers who want faster fail-loud can override per-request (TaskLaunchRequest.timeout_secs) or server-wide (config or CLI). GH #39.
default_task_store_path
Default TaskStore SQLite path, ~/.mse/store/task.sqlite (issue #35 ST1 — persist-by-default). Same $HOME fallback as default_config_path.
load_file_config
Load + parse a TOML config file. A missing file resolves to Ok(FileConfig::default()) (built-in default fallback, per module doc); any other IO error or a parse error is Err — a malformed config file must not be silently ignored (fail-loud).
resolve
3-way merge: CLI > file > built-in default. bind requires a parse step (both CLI and file carry it as a string); a parse error surfaces as Err.