Skip to main content

Crate aion_integration_norn

Crate aion_integration_norn 

Source
Expand description

The first-party Norn adapter for Aion — the first concrete AgentHarness integration.

This crate implements the aion-integrations AgentHarness / AgentSession seam against a real Norn process driven in its --protocol jsonrpc mode. It is the analogue of aion-worker’s concrete liminal adapter: the ONE place in the workspace that names Norn’s on-wire contract and translates the neutral intervention primitives onto Norn’s native control channel (§3.4).

§The invariant this crate exists to preserve

The aion platform crates (aion-core, aion-worker, aion-server, …) stay Norn-blind: everything Norn-specific — the JSON-RPC method namespace, the event/* shapes, the intervene/* requests — is confined to protocol and translate here, behind the neutral trait. Nothing above this adapter references a Norn type (§3A.4). Norn itself does not depend on aion: this adapter maps Norn’s documented JSON-RPC contract, so Norn stays a standalone harness.

§Shape

  • NornHarness implements AgentHarness: AgentHarness::start spawns norn --protocol jsonrpc, performs the initialize handshake, issues run/execute, and returns a NornSession.
  • NornSession implements AgentSession: AgentSession::capabilities returns the parsed initialize capabilities, AgentSession::events streams live translated aion_core::ActivityEvents, AgentSession::intervene maps a neutral command onto an intervene/* request (capability-gated), and AgentSession::wait_result returns the id-matched run/execute Response as the terminal aion_core::Payload.
  • registration_capabilities publishes the neutral InterventionCapabilities this adapter can honour, for a worker that must advertise them when it REGISTERS — before any norn process exists to be asked. It is the adapter’s translation ceiling, not a guess about a binary; the per-session handshake reads what the spawned binary actually advertises, and the function’s own documentation is explicit about how the two can disagree.
  • protocol names Norn’s wire contract; translate is the pure, independently tested translation between that contract and the neutral types.
  • advice carries the operator route-out for Norn’s degraded-session refusal: AdvisingHarness decorates any composed harness so that specific refusal surfaces with the restart flag that gets past it, spelled the way the deployment’s own command line spells it. Promoted here from the assistant’s example worker so every composition root — the built-in aion worker agent verb included — teaches the same way.
  • NornInvocation is the previewable child invocation (NornHarness::invocation): the spawn path is built from it, so a composition root can assert the exact argv and child environment it composed without running an agent.

Re-exports§

pub use advice::ALLOW_DEGRADED_SESSION_FLAG;
pub use advice::AdvisingHarness;
pub use advice::argv_allows_degraded_session;
pub use advice::degraded_session_advice;
pub use advice::is_degraded_session_refusal;
pub use harness::NornHarness;
pub use harness::NornInvocation;
pub use harness::registration_capabilities;
pub use session::NornSession;

Modules§

advice
Operator advice for Norn’s degraded-session refusal.
harness
NornHarness — the AgentHarness implementation that drives a real Norn process.
protocol
Norn’s on-wire JSON-RPC contract — the ONLY module in the workspace that names it.
session
NornSession — a live Norn --protocol jsonrpc run behind the AgentSession seam.
translate
The §3.4 translation point — the single place Norn’s native event/command shapes are named.