Localize history selection to affected paths

This commit is contained in:
2026-10-27 03:10:07 +00:00
parent 9ff873f54c
commit 731149fc6d
4 changed files with 26 additions and 19 deletions

View File

@@ -36,10 +36,10 @@ func (model *historyModel) selectHistory(path Path) []historySelection {
for _, observationID := range model.observationsByPointer[path.String()] {
candidateSet[observationID] = struct{}{}
}
model.reportedPathIndex.visitAncestors(path.String(), func(observationID int) {
candidateSet[observationID] = struct{}{}
})
model.reportedPathIndex.visitDescendants(path.String(), func(observationID int) {
// Producers register all affected before/after paths. Exact facts cover
// ancestor replacements; descendants cover operations within an enclosing
// query. Logical operations are still deduplicated by payload below.
model.affectedPathIndex.visitDescendants(path.String(), func(observationID int) {
candidateSet[observationID] = struct{}{}
})
candidates := make([]int, 0, len(candidateSet))