Record consumption of nested inheritance selectors

This commit is contained in:
2026-12-05 17:11:20 +00:00
parent 1858c9331f
commit 447868e285
3 changed files with 95 additions and 11 deletions

View File

@@ -65,22 +65,26 @@ func (builder *historyBuilder) observeInheritanceControl(payload historyPayloadR
node, before := builder.scratchAt(control.path)
selections := resolveInheritanceAttribution(operation, control.path)
var attributionRef historyAttributionRef = noHistoryAttribution
var sensitive bool
if before && node != nil {
sensitive = node.Sensitive
}
if len(selections) != 0 {
selection := selections[0]
attributionRef = builder.addAttribution(selection.origin, nil, selection.dependencies)
}
ref := payload
ref.substep = operationIndex * 2
builder.addObservation(historyObservation{
path: control.path, phase: historyPhaseInheritance, payload: ref,
reportedPath: control.path, role: historyRoleControl,
beforePresent: before, sensitive: sensitive,
attributionRef: attributionRef,
})
observe := func(path Path, value *document.Node) {
builder.addObservation(historyObservation{
path: path, phase: historyPhaseInheritance, payload: ref,
reportedPath: control.path, role: historyRoleControl,
beforePresent: before, sensitive: value != nil && value.Sensitive,
attributionRef: attributionRef,
})
}
if before {
walkDocument(node, control.path, observe)
} else {
observe(control.path, nil)
}
replaceHistoryPath(&builder.scratch, control.path, nil)
}