Complete historical inventory and query services

This commit is contained in:
2026-10-26 16:09:32 +00:00
parent cacc558288
commit 76521f7cd8
13 changed files with 311 additions and 78 deletions

View File

@@ -222,7 +222,7 @@ func collectFieldInfo(node *document.Node, path Path, decoded decodedConfigurati
}
func cloneMetadata(metadata Metadata) Metadata {
if metadata.fields == nil && metadata.history == nil {
if metadata.fields == nil && metadata.history == nil && metadata.historyModel == nil {
return Metadata{}
}
cloned := Metadata{
@@ -230,15 +230,12 @@ func cloneMetadata(metadata Metadata) Metadata {
history: make(map[string][]Change, len(metadata.history)),
inheritance: append([]inheritanceOperation(nil), metadata.inheritance...),
inheritanceIndex: metadata.inheritanceIndex,
historyModel: metadata.historyModel,
}
cloned.effectivePaths = make(map[string]Path, len(metadata.effectivePaths))
for pointer, path := range metadata.effectivePaths {
cloned.effectivePaths[pointer] = path.clone()
}
cloned.historicalPaths = make(map[string][]Path, len(metadata.historicalPaths))
for pointer, paths := range metadata.historicalPaths {
cloned.historicalPaths[pointer] = clonePaths(paths)
}
for path, info := range metadata.fields {
cloned.fields[path] = cloneFieldInfo(info)
}