pub struct ConfigLayers<'a> {
pub project_toml: Option<&'a str>,
pub local_toml: Option<&'a str>,
pub settings: &'a [String],
pub overrides: &'a [String],
}Expand description
BP-9 (D6 rows “Layered config w/ precedence” + “Inline per-run config
override”): every layer that sits ABOVE the trusted user/global file,
lowest priority first. Passing ConfigLayers::default() is exactly
today’s single-project-layer behavior.
The precedence line, lowest to highest (§3.3, cx§6’s
mdm → system → user → profile → project → flags ordering):
built-in defaults
< preset chain (`extends`, root-first)
< user / global file (~/.config/supercode/config.toml)
< selected profile (`--profile <name>`, CLI-side layer)
< project file (.supercode.toml — UNTRUSTED)
< project-local file (.supercode.local.toml — UNTRUSTED)
< `--settings <json|path>` (per-run, typed at launch)
< `-c/--config key=value` (per-run, typed at launch)
< individual CLI flagsThe two UNTRUSTED layers are sanitized and clamped INDIVIDUALLY before
merge — .supercode.local.toml is gitignored by convention, and a
convention is not a trust boundary: nothing stops a repo from committing
one. It therefore gets the identical §3.3 treatment as
.supercode.toml, and buys precedence over the checked-in project file
(its actual purpose: your own per-checkout overrides), never new
authority.
The two per-run layers ARE trusted: a --settings/-c value was typed
on the command line by the person running the tool, the same trust level
as any other flag. They are applied THROUGH this resolver rather than
poked onto the materialized Config, so a per-run override can never
bypass the project sanitization/clamping that already ran below it.
Fields§
§project_toml: Option<&'a str>.supercode.toml text (untrusted).
local_toml: Option<&'a str>.supercode.local.toml text (untrusted; per-user by convention).
settings: &'a [String]--settings documents: inline JSON ({…}), inline TOML, or a path
to a .json/.toml file. Applied in order.
overrides: &'a [String]-c/--config key=value assignments, dotted TOML keys with
TOML-typed values. Applied last, in order.
Trait Implementations§
Source§impl<'a> Clone for ConfigLayers<'a>
impl<'a> Clone for ConfigLayers<'a>
Source§fn clone(&self) -> ConfigLayers<'a>
fn clone(&self) -> ConfigLayers<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more