Expand description
ActionExecutor seam (M3 design §3) — the kernel’s one hole for “how a turn’s output becomes actions, and how actions become observations”.
Domain-neutral by construction: the kernel knows nothing about tool calls or
CodeAct. Backends implement ActionExecutor (and own their history
protocol — the kernel pushes Observation::history_messages verbatim).
Session life-and-death is a separate axis (SessionHandle) so neither
trait becomes a god-face (OV-12).
Contracts encoded here:
- Four-state parse (D4+OV-7):
ParseOutcome::Actions/ParseOutcome::Empty/ParseOutcome::Incomplete/ParseOutcome::Malformedmap onto the loop’s existing branches (execute / nudge / nudge-retry / salvage-breaker). - Observation always returns (D15): once anything ran,
executereturnsOk(Observation)carryingbatch_status(evenEnvDied);ExecErrormeans not a single action got off the ground. - Two-layer error face (D9): per-action refusals and failures are
ActionOutcomes (model-visible), never error variants.
Structs§
- ExecCtx
- Execution context threaded through
execute(OV-6): one cancel token for user interrupt / timeout / watchdog, one interaction channel for consent and ask_user. Reach the channel only throughExecCtx::request_consent/ExecCtx::ask_user— those carry the suspension discipline (answer / cancel / watchdog deadline); calling the trait directly drops it.
Enums§
- Exec
Error - Batch-level execution failure — reserved for “not one action ran” (D15).
- Interaction
Error - The product layer failed to carry an interaction to completion.
- Parse
Error parsefailed to classify at all (internal invariant broken).- Parse
Outcome - The four-state verdict of
parse(D4+OV-7). - Session
Error - Session lifecycle failure (
SessionHandle::rebuild).
Constants§
- DEFAULT_
INTERACT_ TIMEOUT - Default per-interaction watchdog (
ExecCtx::interact_timeout) — an unanswered suspension must not deadlock the run (M3 failure table: an unanswered consent hangs forever). Generous, because this is human reading time; a product that owns the human relationship (phimint’s TUI) clears it toNoneand leans on the run’s cancel token alone. - INTERRUPTED_
SUMMARY - Model-visible fate for an action the crash window cut off (OV-4). The
kernel owns this vocabulary and hands it to the backend inside
ActionOutcome::summary; a backend only renders the fate in its own history shape (ActionBackend::render_fates).
Traits§
- Action
Backend - The kernel’s mount face for one runtime’s injected action backend (T10c). The built-in tool-call backend keeps its own flow; this face serves any other action format one session can interleave with it (envelope turns go to tools, text turns go here).
- Action
Executor - The seam: one turn’s output in, one observation out.
- Interaction
Channel - Product-layer interaction surface hung off
ExecCtx(OV-6): consent and ask_user suspend the executing action and wait for the product to answer. Routed through the host’s single throat — the same seam policy and journal already use.cancelis the run’s one token (interrupt / timeout / watchdog); implementations must release promptly on it. - Session
Handle - Session life-and-death (OV-12): a different axis from the action face.