v0.1.3-pre.010

This commit is contained in:
2026-08-15 21:48:54 +02:00
parent 97a07ce683
commit 1fc002c978
16 changed files with 1113 additions and 42 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-config-lib/src/profile.rs
// version: 2
// version: 3
/// Origin of one top-level value in a resolved standard Config profile.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
@@ -82,13 +82,19 @@ impl ResolvedConfigProfile {
pub fn origin(&self, key: &str) -> std::option::Option<ConfigValueOrigin> {
return self.origins.get(key).copied();
}
/// Resolves environment placeholders in the effective view while preserving this source profile and its Global/Profile provenance unchanged.
pub fn resolve_effective_environment(&self, environment: &crate::ConfigEnvironment) -> ksp_core_lib::Result<serde_json::Map<String, serde_json::Value>> {
return environment.resolve_map(&self.effective);
}
}
impl crate::ConfigDocumentEngine {
/// Loads, validates and resolves one standard Config document to its default or explicitly requested profile.
///
/// Passing `None` selects the autonomous `default_profile` declared by the document. Passing `Some(profile_id)` selects that profile explicitly.
/// Environment interpolation is intentionally not applied by this prerelease.
/// Environment interpolation is intentionally not applied implicitly by profile selection. Call `ResolvedConfigProfile::resolve_effective_environment` with
/// a Config-owned environment snapshot when an effective runtime view is required.
pub fn load_resolved_profile(
&self,
file_id: &crate::ConfigFileId,