Remove superseded history attribution paths

This commit is contained in:
2026-10-26 18:11:04 +00:00
parent 6a1447c327
commit 3ffaef7ede
18 changed files with 146 additions and 534 deletions

View File

@@ -47,12 +47,16 @@ func TestMetadataHistoricalPaths(t *testing.T) {
}
}
func TestMetadataPathIndexesOwnIndependentSegments(t *testing.T) {
func TestEffectivePathIndexOwnsIndependentSegments(t *testing.T) {
t.Parallel()
final := parseDocumentForDecode(t, "service: {workers: [1]}\n")
var metadata Metadata
finalizeMetadataPaths(&metadata, final, nil)
finalizeEffectiveMetadataPaths(&metadata, final)
builder := newHistoryBuilder()
builder.observePostCLICheckpoint(final, nil)
builder.model.final = final
metadata.historyModel = builder.freeze()
pointer := "/service/workers/0"
effective := metadata.effectivePaths[pointer]
historical := metadata.historyModel.concreteShapes(pointer)
@@ -75,9 +79,13 @@ func TestMetadataPathIndexesRetainDistinctHistoricalShapes(t *testing.T) {
final := parseDocumentForDecode(t, "shape: [replacement]\n")
earlier := parseDocumentForDecode(t, "shape: {'0': base}\n")
var metadata Metadata
// Repeated trees must not add duplicate shapes to the historical index.
finalizeMetadataPaths(&metadata, final, nil, earlier, earlier, final)
builder := newHistoryBuilder()
builder.observeBaseline(earlier)
builder.setScratch(earlier)
builder.observePostCLICheckpoint(final, nil)
builder.model.final = final
metadata := Metadata{historyModel: builder.freeze()}
finalizeEffectiveMetadataPaths(&metadata, final)
keyPath := Keys("shape", "0")
indexPath := Keys("shape").Index(0)
pointer := indexPath.String()