Expand description
Environment overlay loader (--env, FDL_ENV, first-arg convention)
with per-field origin annotations for fdl config show.
Multi-environment configuration overlays.
An fdl.yml project manifest can be layered with per-environment files
(e.g. fdl.local.yml, fdl.ci.yml, fdl.cloud.yml). When an environment
is active, its file is deep-merged on top of the base config before the
strongly-typed ProjectConfig /
CommandConfig deserialization runs.
§Merge rules
- Maps: deep-merge. Recurse into nested maps; overlay keys win.
- Scalars: replace. Overlay value takes over.
- Lists: replace entirely. (Order is contentious — append/prepend modes cause more debugging pain than they save.)
nulldeletes: a key set tonullin the overlay removes it from the merged map (not “write null”). Useful for “reset to defaults in this env.”
§Discovery
Sibling files matching fdl.<env>.{yml,yaml,json} alongside the base
config. The <env> token is the first-arg env selector.
Enums§
- Annotated
Node - A merged value plus the layer that produced each leaf.
Functions§
- deep_
merge - Deep-merge
overontobase. Maps recurse; scalars and lists replace;nullvalues in a map context delete the key from the result. - find_
env_ file - Find a sibling overlay for
envnext tobase_config. - list_
envs - List every environment overlay discoverable beside the base config.
- load_
value - Load a YAML/JSON file as a
Value. Extension-based dispatch on the file suffix (.yml,.yaml,.json). - merge_
layers - Merge a chain of layers left-to-right. The first is the base; each subsequent layer is merged on top of the running result.
- merge_
layers_ annotated - Merge a chain of layers left-to-right with provenance tracking. Mirrors
merge_layersbut returns anAnnotatedNodeinstead of a flatValue. Layer indices in the result are positions intolayers. - render_
annotated_ yaml - Emit an
AnnotatedNodeas YAML with a trailing# <label>on each leaf line, column-aligned for legibility. - resolve_
chain - Load
pathand every ancestor reachable viainherit-from:, returning them in merge order (deepest ancestor first,pathitself last). Theinherit-fromkey is removed from every returnedValue.