Correct the unindexed sensitivity fixture

This commit is contained in:
2026-10-09 04:11:50 +00:00
parent b37948cfea
commit f849e06b77
2 changed files with 17 additions and 7 deletions

View File

@@ -49,7 +49,10 @@ the completion evidence with the actual implementation.
## 2. Correct the unindexed-sensitivity regression fixture (P2) ## 2. Correct the unindexed-sensitivity regression fixture (P2)
Status: Open. Status: Complete. The fixture now uses canonical `/untracked` while leaving it
unindexed, and explicitly checks that `/copy` is sensitive and `/ordinary` is
not. The new assertion failed with the original malformed seed and passed after
correction. The closure equivalence test and `./scripts/check.sh` passed.
Affected: [secret_propagation_test.go](../../internal/engine/secret_propagation_test.go), Affected: [secret_propagation_test.go](../../internal/engine/secret_propagation_test.go),
`TestSecretDependencyClosureMatchesFixedPointScan`, the `TestSecretDependencyClosureMatchesFixedPointScan`, the

View File

@@ -7,11 +7,12 @@ import (
func TestSecretDependencyClosureMatchesFixedPointScan(t *testing.T) { func TestSecretDependencyClosureMatchesFixedPointScan(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
paths map[string]Path paths map[string]Path
seed map[string]bool seed map[string]bool
dependencies []secretDependency dependencies []secretDependency
inherited []secretDependency inherited []secretDependency
wantSensitivity map[string]bool
}{ }{
{ {
name: "forward reverse chains and cycles", name: "forward reverse chains and cycles",
@@ -38,13 +39,14 @@ func TestSecretDependencyClosureMatchesFixedPointScan(t *testing.T) {
{ {
name: "unindexed seed only activates inherited relations", name: "unindexed seed only activates inherited relations",
paths: secretPaths(Keys("ordinary"), Keys("copy")), paths: secretPaths(Keys("ordinary"), Keys("copy")),
seed: map[string]bool{"untracked": true}, seed: secretSet(Keys("untracked")),
dependencies: []secretDependency{ dependencies: []secretDependency{
{dependency: Keys("untracked"), target: Keys("ordinary")}, {dependency: Keys("untracked"), target: Keys("ordinary")},
}, },
inherited: []secretDependency{ inherited: []secretDependency{
{dependency: Keys("untracked"), target: Keys("copy")}, {dependency: Keys("untracked"), target: Keys("copy")},
}, },
wantSensitivity: map[string]bool{"/copy": true, "/ordinary": false},
}, },
{ {
name: "inheritance direction root escapes and numeric spellings", name: "inheritance direction root escapes and numeric spellings",
@@ -75,6 +77,11 @@ func TestSecretDependencyClosureMatchesFixedPointScan(t *testing.T) {
if !reflect.DeepEqual(got, want) { if !reflect.DeepEqual(got, want) {
t.Fatalf("closure = %#v, want %#v", got, want) t.Fatalf("closure = %#v, want %#v", got, want)
} }
for pointer, sensitive := range test.wantSensitivity {
if got[pointer] != sensitive {
t.Errorf("sensitivity at %q = %v, want %v", pointer, got[pointer], sensitive)
}
}
}) })
} }
} }