Expand description
The canonical operation driver — the plan function of [KernelTransaction] (spec §5.4, §6, §7.4,
§10.1, §10.2).
This is the layer the migration’s semantic half turns on. Everything above it is contract
(envelope → record → transaction); everything below it is the kernel’s existing semantic
machinery (the scheduler’s [LoopStateMachine], the P1 syscall gate, the P2 task table, the P3
context VM). The driver is the only place the two meet, and §5.4 fixes exactly how: every
wire input reduces to a P1/P2/P3 primitive, and none of them is allowed to grow a parallel
business state machine here.
Three properties define it:
- No protocol adapter. The driver reads
NormalizedPayloaddirectly and reduces it to scheduler/context primitives such asLoopStateMachine::start,load_workflow,resolve_workflow_spawn, andfeed. The canonical envelope is the only wire contract. RootKindis immutable andExecutionFocusmoves only on a committed transition (§6.1.5/6.1.6, §7.4). Both live inCanonicalOperationDriver, andplannever writes them — it stages the next value, andCanonicalOperationDriver::note_committedis what installs it. There is no input, host command or otherwise, that sets a focus directly.- A root start is one atomic input.
ConfigureOperationbuilds the engine;StartOperationseeds the initial context, enters the root, and publishes the first effect — a provider call for an agent root, a task spawn for a workflow root — in the same planned step. The historical 12+ separate accepted inputs before a first provider call (§3.3 item 20) have no equivalent path here. - One resolution entry, one decision per failure (§7.9). Every pending effect — provider,
tools, approval, spawn, preempt, memory, page-out, milestone — is answered through
ResolveEffectand nothing else, and aFailedoutcome buys exactly one policy decision: abandon, switch recovery ladder, or commit a terminal. The kernel never re-emits the same intent (DEC-5), so the historical unboundedretry_approval/retry_workflow_spawn/retry_preemptround trips are not expressible on this path.ContextOverflowis not a failure at all: it is the one semantic provider outcome, and it feeds the compaction ladder.
§What plan may mutate
[KernelTransaction::prepare] guarantees that a non-Prepared outcome leaves the transaction
byte-for-byte unchanged, and it can reject after the planner has already run (an unsupported
effect kind, a duplicate effect identity, the tail hard limit). The driver answers that in two
layers:
- every refusal the driver itself owns — root authority, focus depth, an unreducible input — is decided before the semantic engine is touched, so it is a genuine zero-mutation rejection;
- the engine advance that a successful plan performs is guarded by a staging slot. A second
planwithout an interveningnote_committedmeans the previous plan was discarded while the engine had already moved, and the driver fails closed with a poison fault that names the only legal recovery — rebuild from the journal (§8.3).
Structs§
- Canonical
Operation Driver - Reduces the five canonical input classes onto the kernel’s existing semantic mechanisms.
- Planned
Step - One planned transition, as the canonical driver produces it.
Constants§
- ROOT_
TASK_ ID - The internal id of the root agent task. The kernel’s task table has used it since M1d; the
canonical
TaskIdis the same string so anAgentTurnfocus names a row that exists. - SYSCALL_
TOOL_ NAMES - Tool names that reduce to a P1 syscall instead of to a host tool execution.