Expand description
Harness-blind trait driver (NOI-4): spawn_agent drives any AgentHarness.
The harness-blind trait driver: spawn_agent drives ANY [AgentHarness]
generically (NOI-4, §3A.1).
This is a NEW additive spawn mode beside the worker’s existing one-shot
.output() capture (the run_norn_step path in the norn-fan-worker example,
which stays working and unchanged). It is the single place the worker DRIVES
an agent session:
- it pumps the session’s neutral [
AgentSession::events] stream OUT to a caller-supplied event sink (the worker’s transcript delivery — an [mpsc::UnboundedSender<ActivityEvent>], theevent_senderNOI-5 wires to liminal), - it feeds neutral commands IN from a caller-supplied control source (the
control_receiverNOI-6 wires from the server’s intervention PUSH) to [AgentSession::intervene], and - it correlates the single terminal [
AgentSession::wait_result] intoDispatchOutcome::Completed { output }— the same replay-authoritative output the one-shot capture produces today.
The worker stays harness-blind. spawn_agent is generic over
AgentHarness; it never names a concrete adapter, a transport, or a wire
protocol. The concrete harness (Norn, or a future one) is injected by the
binary composition root (aion-cli), never chosen here. This crate depends on
aion-integrations for the TRAIT ONLY and has NO edge to
aion-integration-norn or norn (the §3A.4 invariant, CI-gated).
§Result/event split (structural, §4.1)
Events flow only to the event sink; the terminal result flows only from
[AgentSession::wait_result]. An event can never be captured as the result
and the result is never delivered as an event — the two are distinct channels
of the session by construction, so the driver never has to disambiguate them.
Structs§
- Control
Message - One routed intervention on the driver’s control channel: the neutral command
plus an OPTIONAL reply channel the driver answers with the neutral
InterventionOutcomeack.
Functions§
- harness_
error_ to_ outcome - Maps a
HarnessErrorinto aDispatchOutcome::Faileda caller can report. - spawn_
agent - Drives one activity attempt through the neutral
AgentHarnessseam and returns its terminalDispatchOutcome. - spawn_
dyn_ agent - Drives one activity attempt through an ERASED
DynAgentHarness— the same harness-blind driver asspawn_agent, but over adynharness a worker can HOLD without being generic (the typedAgentHarnessis not object-safe).
Type Aliases§
- Activity
Event Sender - The neutral event sink the driver pumps a session’s
AgentSession::eventsout to. This is theevent_senderthe worker’sActivityContexttranscript delivery installs; NOI-5 forwards it onto a liminal events channel. - Control
Receiver - The neutral command source the driver feeds into a session’s
AgentSession::intervene. This is thecontrol_receiverthe worker installs per attempt; NOI-6 delivers server-routed operator commands (each with its ack reply channel) onto it.