Preserve derived publication and preparation evidence
This commit is contained in:
@@ -46,37 +46,26 @@ func finalizePipelineResolution(cfg *PipelineConfig) error {
|
||||
return recomputePipelineEffectiveDigest(cfg)
|
||||
}
|
||||
|
||||
// recomputePipelineEffectiveDigest is the single package-owned hook for
|
||||
// refreshing provenance after later resolution expands concrete pipeline
|
||||
// values. Loader directives and runtime provenance are not serialized.
|
||||
// recomputePipelineEffectiveDigest records informational configuration identity.
|
||||
// Derived domain products are not part of this configuration projection.
|
||||
func recomputePipelineEffectiveDigest(cfg *PipelineConfig) error {
|
||||
if cfg == nil || cfg.resolution == nil {
|
||||
return fmt.Errorf("pipeline resolution metadata is required")
|
||||
}
|
||||
snapshot, err := newPipelineInspection(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
canonical, err := projectionJSON(snapshot.Config)
|
||||
canonical, err := projectionJSON(projectEffectivePipeline(cfg))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
digestInput := append([]byte(effectivePipelineDigestVersion), canonical...)
|
||||
digest := sha256.Sum256(digestInput)
|
||||
cfg.resolution.effectiveDigest = hex.EncodeToString(digest[:])
|
||||
cfg.resolution.inspection = snapshot
|
||||
return nil
|
||||
}
|
||||
|
||||
func newPipelineInspection(cfg *PipelineConfig) (*configkit.Result[effectivePipelineProjection], error) {
|
||||
projection := projectEffectivePipeline(cfg)
|
||||
return configkit.Load(configkit.NoSource(), configkit.Options[effectivePipelineProjection]{Definition: configkit.Definition[effectivePipelineProjection]{Defaults: func() effectivePipelineProjection { return projection }}})
|
||||
}
|
||||
|
||||
// DiffEffectivePipelines compares frozen final-domain snapshots.
|
||||
// DiffEffectivePipelines compares the authoritative native load results.
|
||||
func DiffEffectivePipelines(left, right *PipelineConfig) ([]configkit.Difference, error) {
|
||||
if left == nil || right == nil || left.resolution == nil || right.resolution == nil {
|
||||
if left == nil || right == nil || left.ConfigKitResult() == nil || right.ConfigKitResult() == nil {
|
||||
return nil, fmt.Errorf("resolved pipelines are required")
|
||||
}
|
||||
return configkit.Diff(left.resolution.inspection, right.resolution.inspection)
|
||||
return configkit.Diff(left.ConfigKitResult(), right.ConfigKitResult())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user