Move sensitivity classification to shared history

This commit is contained in:
2026-10-26 17:25:11 +00:00
parent 408dd13c24
commit 8155465322
4 changed files with 150 additions and 54 deletions

View File

@@ -40,7 +40,9 @@ func TestSecretClassificationParsesTypedHistoryAfterNumericShapeChanges(t *testi
earlier := parseCompositionDocument(t, "earlier", test.earlier)
final := parseCompositionDocument(t, "final", test.final)
pointer := test.historical.String()
metadata := Metadata{history: map[string][]Change{pointer: {{Path: test.historical}}}}
builder := newHistoryBuilder()
builder.observeDocument(earlier, historyPhaseSources)
metadata := Metadata{historyModel: builder.freeze()}
seen := false
classified := classifySecretPaths(nil, func(path Path) bool {
if path.String() != pointer {
@@ -63,9 +65,10 @@ func TestSecretClassificationParsesTypedHistoryAfterNumericShapeChanges(t *testi
func TestSecretPredicateReceivesDetachedHistoricalPath(t *testing.T) {
path := Keys("records").Key("1")
metadata := Metadata{history: map[string][]Change{
path.String(): {{Path: path}},
}}
root := parseCompositionDocument(t, "history", "records: {'1': value}\n")
builder := newHistoryBuilder()
builder.observeDocument(root, historyPhaseSources)
metadata := Metadata{historyModel: builder.freeze()}
seen := false
classified := classifySecretPaths(nil, func(candidate Path) bool {
if candidate.String() != path.String() {