Unify layered provenance history

This commit is contained in:
2026-09-06 21:09:52 +00:00
parent ef0e6078f7
commit 26cece6d53
9 changed files with 347 additions and 48 deletions

View File

@@ -1,7 +1,7 @@
package configkit
// Metadata provides detached presence, origin, and history queries for a load.
// Its zero value contains no paths.
// Metadata provides detached effective presence/origin and chronological history
// queries for a load. Its zero value contains no paths.
type Metadata struct {
fields map[string]FieldInfo
history map[string][]Change
@@ -27,8 +27,10 @@ func (m Metadata) IsExplicit(path Path) bool {
return ok && info.Explicit
}
// History returns detached definition and resolution records for path. Unknown and
// invalid paths return nil.
// History returns detached definition and resolution records for path. A record's
// Path can be an ancestor when that container operation replaced or removed path.
// Removed historical paths can have history even though Lookup returns false.
// Unknown and invalid paths return nil.
func (m Metadata) History(path Path) []Change {
if !path.valid() {
return nil