Expose layered configuration loading and inspection

This commit is contained in:
2026-09-29 17:58:15 +00:00
parent 1cdf90d831
commit 5a77728a81
13 changed files with 456 additions and 16 deletions

View File

@@ -6,6 +6,7 @@ type Layer string
const (
LayerDefault Layer = "default"
LayerBase Layer = "base"
LayerUnderlay Layer = "underlay"
LayerOverlay Layer = "overlay"
LayerCLI Layer = "cli"
LayerResolution Layer = "resolution"
@@ -102,6 +103,7 @@ const (
CodeImportRepeated Code = "import.repeated"
CodeImportLimitExceeded Code = "import.limit_exceeded"
CodeImportVersion Code = "import.version"
CodeUnderlayVersion Code = "underlay.version"
CodeOverlayInvalid Code = "overlay.invalid"
CodeOverlayMissing Code = "overlay.missing"
@@ -172,14 +174,16 @@ type Location struct {
// SourceInfo describes a source discovered during a load. Kind identifies its
// acquisition, independent of Layer. Path is canonical for a host file and
// namespace-relative for a filesystem file; synthetic sources have no Path.
// ImportedFrom identifies the declaration that included this source.
// UnderlayIndex is the one-based original underlay position, or zero for other
// sources. ImportedFrom identifies the declaration that included this source.
type SourceInfo struct {
ID string
Label string
Path string
Layer Layer
Kind SourceKind
ImportedFrom *Location
ID string
Label string
Path string
Layer Layer
Kind SourceKind
UnderlayIndex int
ImportedFrom *Location
}
// Diagnostic is a safe structured problem report. Message and source labels must