Skip to main content

Module mock

Module mock 

Source
Expand description

The interveneable mock harness advertising {inject_message, cancel}. MockAgentHarness — the second, INTERVENEABLE shape driven in NOI-8.

Where crate::CliHarness proves the observability-only tier (empty capability set), this deterministic in-crate harness proves the interveneable tier: it advertises {inject_message, cancel}, accepts those commands (recording them so a test can assert the neutral command reached the agent), and REJECTS at least one advertised-unsupported primitive (RespondToApproval, and the other two it does not advertise) with a clean [HarnessError::CapabilityNotSupported] NACK.

Together the two harnesses exercise BOTH branches of the [AgentSession::intervene] contract — the empty-set rejection and the advertised-set accept/gate — through the same neutral seam, proving aion-integrations is a real SDK with two independent implementations, not a Norn wrapper (§9.1, NOI-8).

It is a genuine AgentHarness implementation (not a stub returning canned outcomes): the worker driver ([aion_worker::spawn_agent]) drives it live in the crate’s e2e test, feeding real commands through the real control channel and observing the real accept/gate results.

Structs§

MockAgentHarness
An interveneable mock harness advertising {inject_message, cancel}.
MockAgentSession
The live session the mock produces: it streams a fixed transcript, gates commands on the advertised set, and drains an event channel whose sender (the RunHandle) a driver holds so the run stays live until the driver ends it.
RunHandle
A handle that keeps a MockAgentSession’s run alive and ends it on demand.

Type Aliases§

AppliedLog
A record of the commands a MockAgentSession accepted, shared with the test that drives it.