Replace generic resolution recording with intent methods

This commit is contained in:
2026-10-27 15:12:38 +00:00
parent eafbd32489
commit 9833ca3aa3
30 changed files with 124 additions and 63 deletions

View File

@@ -525,10 +525,10 @@ func TestExplanationReplaysResolutionAdditionsAndOverlappingIntent(t *testing.T)
result, err := testLoad(Bytes("base", []byte("m: {old: 1}\n")), Options[cfg]{Definition: Definition[cfg]{Resolve: func(c *cfg, r *Resolution) error {
c.M["new"] = map[string]any{"child": int64(7)}
delete(c.M, "old")
r.Record(Keys("m", "new"), ChangeDerivedDefault, "add nested", Keys("m", "old"))
r.Record(Keys("m", "old"), ChangeNormalization, "remove old")
r.RecordDerivedDefault(Keys("m", "new"), "add nested", Keys("m", "old"))
r.RecordNormalization(Keys("m", "old"), "remove old")
if overlap {
r.Record(Keys("m"), ChangeNormalization, "update container")
r.RecordNormalization(Keys("m"), "update container")
}
return nil
}}})
@@ -587,7 +587,7 @@ func TestExplanationReplayDescriptorsRemainDetachedAcrossQueries(t *testing.T) {
result, err := testLoad(Bytes("resolution-explanation.yml", []byte("count: 1\n")), Options[config]{
Definition: Definition[config]{Resolve: func(value *config, resolution *Resolution) error {
value.Count = 2
resolution.Record(Keys("count"), ChangeNormalization, "normalized", Keys("count"))
resolution.RecordNormalization(Keys("count"), "normalized", Keys("count"))
return nil
}},
})
@@ -635,7 +635,7 @@ func TestConcurrentReadOnlyInspectionQueries(t *testing.T) {
result, err := testLoad(Bytes("concurrent-inspection.yml", []byte("group: {value: input}\n")), Options[config]{
Definition: Definition[config]{Resolve: func(value *config, resolution *Resolution) error {
value.Group.Value = "resolved"
resolution.Record(Keys("group", "value"), ChangeNormalization, "normalized", Keys("group", "value"))
resolution.RecordNormalization(Keys("group", "value"), "normalized", Keys("group", "value"))
return nil
}},
})