Expand description
Config loading entry point.
See spec/crates/core.md § Config layers.
Module responsibilities:
- Best-effort
dotenvyload of<config_dir>/.env. OS env wins —dotenvy::from_pathdoes not override pre-existing keys, which matches operator expectations (systemd / supervisor unit files are authoritative). - Scan
<config_dir>/rules/*.jsonforRawRuleFiles. - Read every
VANE_*deployment constant into a typedEnvsnapshot.
Structs§
- Env
- Typed snapshot of every
VANE_*deployment constant the daemon reads at startup. Defaults matchspec/crates/core.md§ Config layers. - Loaded
Config - Result of
load: rule files (unmerged) plus the typedEnvsnapshot. Downstream callers threadfilesintocrate::compile::compileand readenvfor deployment constants. - Process
Env - Production
EnvReader— reads fromstd::env.
Traits§
- EnvReader
- Reads a key → optional string value. The single production
implementation,
ProcessEnv, delegates tostd::env::var. Tests hand-roll a fakeEnvReaderto keep state local.
Functions§
- load
- Load a vane config directory.
- scan_
rules_ dir - Scan a directory for
*.jsonrule files. Returns oneRawRuleFileper discovered file withpathpopulated from the on-disk filename. Order of the returned vector is unspecified — the merge stage sorts by(order asc, path lex)so the loader does not pre-sort.