TestDiffPeerMessageMismatch: a peer instruction to install, followed by the recipient reading a foreign secret, is a peer_message_intent_mismatch.
(t *testing.T)
| 41 | // TestDiffPeerMessageMismatch: a peer instruction to install, followed by the |
| 42 | // recipient reading a foreign secret, is a peer_message_intent_mismatch. |
| 43 | func 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. |
nothing calls this directly
no test coverage detected