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

@@ -42,6 +42,7 @@ func TestSecretClassificationParsesTypedHistoryAfterNumericShapeChanges(t *testi
pointer := test.historical.String()
builder := newHistoryBuilder()
builder.observeDocument(earlier, historyPhaseSources)
builder.observeDocument(final, historyPhasePostCLI)
metadata := Metadata{historyModel: builder.freeze()}
seen := false
classified := classifySecretPaths(nil, func(path Path) bool {
@@ -55,7 +56,7 @@ func TestSecretClassificationParsesTypedHistoryAfterNumericShapeChanges(t *testi
}
}
return true
}, metadata, final, []historyApplication{{value: earlier}}, earlier)
}, metadata)
if !seen || !classified[pointer] {
t.Fatalf("historical/final numeric path was not classified: %#v", classified)
}
@@ -77,7 +78,7 @@ func TestSecretPredicateReceivesDetachedHistoricalPath(t *testing.T) {
seen = true
candidate.segments[0].key = "changed"
return true
}, metadata, nil, nil)
}, metadata)
if !seen || !classified[path.String()] || classified["/changed/1"] {
t.Fatalf("classification after predicate mutation = %#v, predicate called: %v", classified, seen)
@@ -133,6 +134,9 @@ func TestSourceVersionEvidenceSensitivityUsesOriginalMountedPaths(t *testing.T)
final := parseCompositionDocument(t, "final", "tenant:\n groups:\n blue:\n - public: shifted-neighbor\n labels:\n public: visible\n")
var sawOriginalSequencePath, sawAncestorPredicate bool
builder := newHistoryBuilder()
builder.observeDocument(final, historyPhaseSources)
metadata := Metadata{historyModel: builder.freeze()}
classified := classifySecretPathsWithEvidence(schema, func(path Path) bool {
if path.String() == appendDestination(destination, predicatePath).String() {
return true
@@ -151,7 +155,7 @@ func TestSourceVersionEvidenceSensitivityUsesOriginalMountedPaths(t *testing.T)
sawOriginalSequencePath = len(path.segments) == 5 && path.segments[3].kind == pathSegmentIndex && path.segments[3].index == 2
}
return false
}, Metadata{}, final, []historyApplication{{path: destination, value: final}}, evidence)
}, metadata, evidence)
for _, path := range []Path{
appendDestination(destination, sequencePath),
@@ -197,7 +201,7 @@ func TestSourceVersionEvidenceClassificationKeepsCollidingShapes(t *testing.T) {
sawKey = sawKey || reflect.DeepEqual(path, keyPath)
sawIndex = sawIndex || reflect.DeepEqual(path, indexPath)
return false
}, Metadata{}, nil, nil, evidence)
}, Metadata{}, evidence)
if !classified[keyPath.String()] || !sawKey || !sawIndex {
t.Errorf("reverse=%v: classified=%v, key seen=%v, index seen=%v", reverse, classified, sawKey, sawIndex)
}