Compare focused inspection views

This commit is contained in:
2026-11-21 04:09:41 +00:00
parent db743a4b3d
commit b5e1c11c4a
5 changed files with 134 additions and 2 deletions

View File

@@ -39,6 +39,18 @@ func (i Inspection) HistoricalPaths() []Path {
// writer errors can leave partial output.
func (i Inspection) WriteEffective(output io.Writer) error { return i.view.WriteEffective(output) }
// Diff compares frozen views at the same canonical scope, including differences
// at an ancestor when the existing comparison treats that ancestor atomically.
// Views may come from different root Go types. Unavailable or mismatched views
// return an error without records.
func (i Inspection) Diff(other Inspection) ([]Difference, error) {
values, err := i.view.Diff(other.view)
if err != nil {
return nil, err
}
return fromEngineDifferences(values), nil
}
// Sources returns the full detached source catalog.
func (i Inspection) Sources() []SourceInfo {
values := i.view.Inspection().Sources()