Expose source version modes in load options

This commit is contained in:
2026-10-15 15:48:59 +00:00
parent 15f5b591b9
commit 1f95cf905a
5 changed files with 241 additions and 10 deletions

View File

@@ -23,8 +23,12 @@ type Underlay struct{ Inputs []Input }
// LayeredOptions selects lower-priority tiers and final application rules.
// An active Overlay requires an explicit OverlayFilesystem; an inactive overlay
// ignores it. Overrides remain explicit CLI records, not general mappings.
// SourceVersionMode applies one declaration policy to main, underlay, import,
// and selected overlay documents. Enabled modes interpret the version path
// source-locally while protecting main's destination-prefixed path.
type LayeredOptions[T any] struct {
Definition Definition[T]
SourceVersionMode SourceVersionMode
Underlays []Underlay
Overlay string
OverlayFilesystem *FilesystemContext
@@ -57,7 +61,9 @@ func toEngineInput(input Input) engine.Input {
func toEngineLayeredOptions[T any](options LayeredOptions[T]) engine.LayeredOptions[T] {
result := engine.LayeredOptions[T]{
Definition: toEngineDefinition(options.Definition), Overlay: options.Overlay,
Definition: toEngineDefinition(options.Definition),
SourceVersionMode: engine.SourceVersionModeFromFacade(uint8(options.SourceVersionMode)),
Overlay: options.Overlay,
OverlayFilesystem: toEngineFilesystemContext(options.OverlayFilesystem),
}
if options.Underlays != nil {