Skip to main content

Module config_loader

Module config_loader 

Source
Expand description

Config file loading and layered merge.

Config::load() resolves three layers — global ~/.engram/engram.toml, project-local <project>/.engram/engram.toml, and ENGRAM_* env overrides — with priority env > project-local > global. This module owns the file-tree side: it reads each TOML file into a generic toml::Value tree, deep-merges the project-local tree over the global one, and enforces the secret invariant that api_key values always come from the global layer. config.rs keeps the Config shape and the Config::load() orchestration that drives these functions.