Expand description
Node executor (plan Unit 11).
dispatch(node, ctx) is the single entry point the DAG runner in
Unit 12 calls for each ready() node. Responsibilities:
- Emit
node.startedbefore any subprocess spawn. - Dispatch to the node’s kind — bash, AI (command / prompt), or loop — and run the subprocess under a wall-clock deadline.
- For loops, iterate under a sentinel
Scannerthat watches forBLOCKED(always reserved) plus the user’suntiltoken; session lifecycle follows the Unit 0 spike (--session-idfirst iteration,--resumethereafter, UUID not ULID). - If the node carries a
gate, run the platform-current hook script under a 60s deadline after a successful node terminates. - Emit exactly one terminal event (
node.completedornode.failed) and, when a gate ran, agate.passedevent between the node’s body completing and the terminal event.
The executor is the sole owner of node-level deadline handling —
claude_proc::ClaudeProcess deliberately has no per-call timeout so
that this module can decide, for example, that a loop’s wall-clock
budget covers all iterations rather than each one independently.
Structs§
- Executor
Context - Inputs the executor needs that span every dispatch call on one run.
Enums§
- Dispatch
Error - Failure categories returned from
dispatchitself (distinct fromNodeOutcome::Failed, which is a recorded node failure). These are infrastructure errors that prevent the executor from even deciding the node’s outcome — event-log I/O, malformed pipe data leaking past validation, stream-parser crashes, etc. - Node
Outcome - Result of dispatching one node.
Constants§
- DEFAULT_
NODE_ TIMEOUT - Default node wall-clock budget when a pipe node declares no
timeout:. Picked to match the memory-locked 1800s default called out in the plan’s “Open questions deferred to implementation” block. - GATE_
TIMEOUT - Gate hook deadline, per plan R12.
Functions§
- dispatch
- Dispatch one node end-to-end.