MCPcopy Create free account
hub / github.com/ByteYellow/AgentProvenance / findDiff

Function findDiff

internal/intent/diff_test.go:8–15  ·  view source on GitHub ↗

findDiff returns the first diff matching a predicate, or a zero value.

(diffs []IntentRuntimeDiff, pred func(IntentRuntimeDiff) bool)

Source from the content-addressed store, hash-verified

6
7// findDiff returns the first diff matching a predicate, or a zero value.
8func findDiff(diffs []IntentRuntimeDiff, pred func(IntentRuntimeDiff) bool) (IntentRuntimeDiff, bool) {
9 for _, d := range diffs {
10 if pred(d) {
11 return d, true
12 }
13 }
14 return IntentRuntimeDiff{}, false
15}
16
17// TestDiffDeclaredVsEffectMismatch: an install tool call that reads a foreign
18// secret violates its contract (install does not permit secret_read).

Calls

no outgoing calls

Tested by

no test coverage detected