Add captured configuration comparison

This commit is contained in:
2026-10-09 15:58:04 +00:00
parent 3f76c75919
commit fd82524977
4 changed files with 134 additions and 1 deletions

View File

@@ -27,6 +27,20 @@ func (e *Engine) InspectConfiguration() (ConfigurationInspection, error) {
return ConfigurationInspection{source: e.internal.InspectConfiguration()}, nil
}
// Diff compares this view's captured effective configuration with other. This
// view is the earlier (left) value and other is the later (right) value. The
// comparison delegates to ConfigKit's frozen effective-value semantics, so
// source or resolution history alone does not create differences. Either zero
// view returns ErrInvalidConfig and no records. Returned records can contain
// ordinary application data and are not evidence of equivalent execution
// behavior; callers choose where and to whom to disclose them.
func (v ConfigurationInspection) Diff(other ConfigurationInspection) ([]configkit.Difference, error) {
if v.source == nil || other.source == nil {
return nil, ErrInvalidConfig
}
return configuration.Diff(v.source, other.source)
}
// Metadata returns detached effective presence and history records.
func (v ConfigurationInspection) Metadata() configkit.Metadata {
if v.source == nil {