Share sequence history construction

This commit is contained in:
2026-10-25 23:09:41 +00:00
parent d172a5e46a
commit 1dd94a3cc6
5 changed files with 44 additions and 34 deletions

View File

@@ -469,21 +469,18 @@ func TestSequenceHistoryReplaysCombinationEvidence(t *testing.T) {
t.Fatalf("combine diagnostics = %#v", diagnostics)
}
mode := sequenceHistoryMapped
if test.operation == sequenceModeReplace {
mode = sequenceHistoryReplace
}
length := 0
if mode == sequenceHistoryReplace {
length = len(combined.higherItems)
}
application := historyApplication{
layer: LayerOverlay,
value: higherRoot,
sequences: []sequenceHistoryContribution{{
path: Keys("records"), mode: mode, length: length,
items: combined.higherItems, replacements: combined.replacements,
}},
sequences: []sequenceHistoryContribution{
sequenceHistoryContributionForCombination(Keys("records"), test.operation, higher, combined),
},
}
if len(combined.higherItems) != 0 {
combined.higherItems[0].outputIndex++
}
if len(combined.replacements) != 0 {
combined.replacements[0].outputIndex++
}
application.sequencesByPath = indexSequenceHistoryContributions(application.sequences)
replayed := document.Clone(lowerRoot)