Reuse frozen inspection mapping lookups

This commit is contained in:
2026-10-09 03:54:14 +00:00
parent 344f4f73d7
commit d32c94eca3
9 changed files with 85 additions and 14 deletions

View File

@@ -12,7 +12,11 @@ import (
// Snapshot projection is the shared redaction boundary for effective YAML
// and explanation values. It borrows frozen trees and returns a detached tree.
func valueSnapshot(root *document.Node, path Path, secrets map[string]bool) ValueSnapshot {
node, present := documentAtPath(root, path)
return valueSnapshotWithLookup(root, path, secrets, nil)
}
func valueSnapshotWithLookup(root *document.Node, path Path, secrets map[string]bool, lookup *documentLookup) ValueSnapshot {
node, present := documentAtPathWithLookup(root, path, lookup)
if !present {
return ValueSnapshot{}
}