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

Function TestDiffCoverageGapNotMismatch

internal/intent/diff_test.go:80–95  ·  view source on GitHub ↗

TestDiffCoverageGapNotMismatch: a foreign-secret read with NO contract for its scope is an honest coverage gap, never a mismatch -- the load-bearing honesty rule that keeps unattributed effects from reading as rogue actions.

(t *testing.T)

Source from the content-addressed store, hash-verified

78// scope is an honest coverage gap, never a mismatch -- the load-bearing honesty
79// rule that keeps unattributed effects from reading as rogue actions.
80func TestDiffCoverageGapNotMismatch(t *testing.T) {
81 effects := []RuntimeEffect{
82 {Kind: EffectSecretRead, Target: "/root/.aws/credentials", AgentID: "", ToolCallID: "tc-wrapper", EventID: "e7", Confidence: 1},
83 }
84 diffs := Diff(nil, effects)
85 if _, ok := findDiff(diffs, func(d IntentRuntimeDiff) bool { return d.Status == StatusMismatch }); ok {
86 t.Fatal("uncontracted effect must NOT be reported as a mismatch")
87 }
88 d, ok := findDiff(diffs, func(d IntentRuntimeDiff) bool { return d.Status == StatusCoverageGap })
89 if !ok {
90 t.Fatalf("expected intent_coverage_gap, got %+v", diffs)
91 }
92 if d.Confidence != 0 {
93 t.Errorf("a coverage gap asserts nothing; confidence should be 0, got %.2f", d.Confidence)
94 }
95}
96
97// TestDiffBenignReadNoMismatch: a read-only file tool that only reads a benign
98// (non-secret) file matches its contract -- no false positive.

Callers

nothing calls this directly

Calls 2

DiffFunction · 0.85
findDiffFunction · 0.85

Tested by

no test coverage detected