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

Function TestDiffPeerMessageMismatch

internal/intent/diff_test.go:43–59  ·  view source on GitHub ↗

TestDiffPeerMessageMismatch: a peer instruction to install, followed by the recipient reading a foreign secret, is a peer_message_intent_mismatch.

(t *testing.T)

Source from the content-addressed store, hash-verified

41// TestDiffPeerMessageMismatch: a peer instruction to install, followed by the
42// recipient reading a foreign secret, is a peer_message_intent_mismatch.
43func TestDiffPeerMessageMismatch(t *testing.T) {
44 contracts := []IntentContract{{
45 ID: "contract/msg-1", Kind: ContractPeerMessage, ScopeAgent: "bob",
46 Operation: "install", Target: "python3 setup.py install", Profile: profileFor(profiles(), "install"), Confidence: 0.5,
47 }}
48 effects := []RuntimeEffect{
49 {Kind: EffectMetadataEgress, Target: "169.254.169.254", AgentID: "bob", ToolCallID: "tcx", EventID: "e9", Confidence: 1},
50 }
51 diffs := Diff(contracts, effects)
52 d, ok := findDiff(diffs, func(d IntentRuntimeDiff) bool { return d.Finding == FindingPeerMessageMismatch })
53 if !ok {
54 t.Fatalf("expected peer_message_intent_mismatch, got %+v", diffs)
55 }
56 if d.Status != StatusMismatch {
57 t.Errorf("peer mismatch should be a declared_vs_effect_mismatch, got %s", d.Status)
58 }
59}
60
61// TestDiffRefusedButRuntimeHappened: an agent that refused, yet whose runtime
62// produced a baseline-sensitive effect, is a refusal bypass.

Callers

nothing calls this directly

Calls 4

profileForFunction · 0.85
profilesFunction · 0.85
DiffFunction · 0.85
findDiffFunction · 0.85

Tested by

no test coverage detected