Expose native configuration inspection scopes
This commit is contained in:
@@ -257,11 +257,12 @@ func cloneStringMap(value map[string]string) map[string]string {
|
||||
}
|
||||
|
||||
func validatePipelineConfigKit(cfg *PipelineConfig, validation *configkit.Validation) {
|
||||
// Checks that depend on family expansion or campaign/session context remain
|
||||
// at Narratio's explicit resolution boundary. This early definition check is
|
||||
// deliberately limited to an invariant that is wholly file-local.
|
||||
if strings.TrimSpace(cfg.Workspace.Root) == "" {
|
||||
validation.Error(configkit.Keys("workspace", "root"), "workspace root is required")
|
||||
// Concrete artifacts and publication actions are validated during domain
|
||||
// derivation. These checks require only the completed pipeline document.
|
||||
for _, issue := range pipelineConfigurationIssues(cfg) {
|
||||
if issue.err != nil {
|
||||
validation.Error(configkit.Keys(issue.path...), issue.err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,58 +287,6 @@ func pipelineMetadataFromConfigKit(result *configkit.Result[PipelineConfig], opt
|
||||
return resolved
|
||||
}
|
||||
|
||||
func pipelineMetadataPaths(cfg *PipelineConfig) ([]projectedPipelineValue, error) {
|
||||
effective, err := projectionDetailedRecords(projectEffectivePipeline(cfg))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if cfg.Scriptorium == nil {
|
||||
return effective, nil
|
||||
}
|
||||
families := cfg.Scriptorium.ArtifactFamilies
|
||||
if len(families) == 0 {
|
||||
return effective, nil
|
||||
}
|
||||
detailedFamilies, err := projectionDetailedRecords(map[string]any{"scriptorium": map[string]any{"artifact_families": families}})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return append(effective, detailedFamilies...), nil
|
||||
}
|
||||
|
||||
func ownershipSources(origin configkit.Origin, pathsByID map[string]string) []string {
|
||||
if origin.Layer == configkit.LayerDefault || (origin.Layer == configkit.LayerResolution && origin.Operation == configkit.ChangeDerivedDefault) {
|
||||
return []string{pipelineDefaultOwnershipSource}
|
||||
}
|
||||
if origin.Layer == configkit.LayerResolution {
|
||||
return []string{"resolution"}
|
||||
}
|
||||
seen := map[string]struct{}{}
|
||||
var sources []string
|
||||
add := func(location configkit.Location) {
|
||||
value := pathsByID[location.SourceID]
|
||||
if value == "" {
|
||||
value = location.SourceID
|
||||
}
|
||||
if _, ok := seen[value]; !ok {
|
||||
seen[value] = struct{}{}
|
||||
sources = append(sources, value)
|
||||
}
|
||||
}
|
||||
for _, location := range origin.Locations {
|
||||
add(location)
|
||||
}
|
||||
for _, inheritance := range origin.Inheritance {
|
||||
for _, location := range inheritance.Locations {
|
||||
add(location)
|
||||
}
|
||||
}
|
||||
if len(sources) == 0 {
|
||||
return []string{pipelineDefaultOwnershipSource}
|
||||
}
|
||||
return sources
|
||||
}
|
||||
|
||||
func pipelineSourcePaths(cfg *PipelineConfig) map[string]string {
|
||||
paths := make(map[string]string)
|
||||
if cfg.ConfigKitResult() == nil {
|
||||
|
||||
Reference in New Issue
Block a user