Carry sensitivity across matched records

This commit is contained in:
2026-11-02 14:56:38 +00:00
parent c296eba6c1
commit 3b10f97424
4 changed files with 113 additions and 1 deletions

View File

@@ -80,7 +80,31 @@ func classifySecretPathsWithEvidence(schema *schemaDescriptor, predicate func(Pa
classifyPath(resolved)
}
}
return closeSecretDependencies(paths, secret, dependencies, inherited)
classified := closeSecretDependencies(paths, secret, dependencies, inherited)
if model := metadata.historyEvidence(); model != nil && model.resolutionPayload != nil {
// Project from the completed entry classification into a separate map so
// one side of a swap cannot influence the other while it is being read.
projected := make(map[string]Path)
for _, path := range paths {
if !pathIsSecret(classified, path) {
continue
}
if target, matched := model.resolutionPayload.correspondence.finalPath(path); matched {
projected[target.String()] = target
}
}
for pointer, path := range projected {
paths[pointer] = path
secret[pointer] = true
}
for pointer, sensitive := range classified {
if sensitive {
secret[pointer] = true
}
}
return closeSecretDependencies(paths, secret, dependencies, inherited)
}
return classified
}
func addSecretPath(paths map[string]Path, pointer string) {