Preserve sibling inheritance in configuration history and explanations

This commit is contained in:
2026-09-29 22:52:51 +00:00
parent 462e57df3e
commit f916e7d1f9
13 changed files with 615 additions and 20 deletions

View File

@@ -42,6 +42,8 @@ func (r *Inspection) WriteExplanation(output io.Writer, path Path) error {
rendered.WriteString(" - representation: ")
if change.Origin.Operation == ChangeDecoding {
rendered.WriteString("input to canonical typed\n")
} else if change.Origin.Operation == ChangeInheritance {
rendered.WriteString("structural inheritance\n")
} else if change.Origin.Layer == LayerBase || change.Origin.Layer == LayerUnderlay || change.Origin.Layer == LayerOverlay || change.Origin.Layer == LayerCLI {
rendered.WriteString("policy-validated input\n")
} else {
@@ -91,6 +93,15 @@ func writeExplanationOrigin(output *strings.Builder, label string, origin Origin
output.WriteString(strconv.Itoa(location.Column))
output.WriteByte('\n')
}
for _, step := range origin.Inheritance {
output.WriteString(" inherited: from=")
output.WriteString(strconv.Quote(step.From.String()))
output.WriteString(" to=")
output.WriteString(strconv.Quote(step.To.String()))
output.WriteString(" reference=")
output.WriteString(strconv.Quote(step.Reference.String()))
output.WriteByte('\n')
}
}
func writeExplanationSnapshot(output *strings.Builder, label string, snapshot ValueSnapshot, indent int) {