Skip to main content

Module executor

Module executor 

Source
Expand description

Host tool execution (§4’s concurrency rule): a bounded thread pool runs effects in parallel; ALL store writes stay on the driver thread. The executor is a host-supplied trait — Areev never executes anything itself (Tool grains are data; execution is the host’s job), it hands the host a name, a pinned definition hash, the input, and the deterministic idempotency key the crash-redelivery contract depends on (§5.3).

Structs§

CommandExecutor
A subprocess executor — the CLI’s zero-dependency host-tool seam, the same pattern as --embed-cmd / --llm-cmd: the command receives the input JSON on stdin and AREEV_TOOL_NAME / AREEV_TOOL_HASH / AREEV_IDEMPOTENCY_KEY in the environment, and prints the result JSON on stdout. Non-zero exit or unparseable output is an ExecutorError (retryable per the §6.3 table). The subprocess NEVER opens the memory file — the parent journals on its behalf (§4’s single-writer rule, and the process-wide open-path registry would refuse it anyway).
DispatchDone
A completed dispatch coming back to the driver thread. Carries the executor the job DISPATCHED under — a flow tool inside an abstract node runs as a Host tool while the node-level executor says Abstract, and the result grain must re-state what actually ran (§5.1).
DispatchJob
One in-flight dispatch handed to the pool.
ExecutorRegistry
A registry-backed executor: tools dispatch by name; unknown names fail with ExecutorError (never a panic — a plan naming a tool the host didn’t register is the host’s configuration error, reported per attempt).
Pool
The bounded pool: N worker threads, jobs in, completions out. Workers touch NO store handle — parallelism lives here and only here. LLM effects route to the tool-calling seam; everything else to the host executor.
PreparedLlm
A prepared LLM request, built ON THE DRIVER THREAD (the pool never touches the store): the transcript translated to seam messages plus the pinned tool Definitions already fetched.

Enums§

ExecResult
What a host tool run produced. The driver turns this into an EffectOutcome with deterministic storage accounting.

Traits§

HostToolExecutor
The host’s executor. idempotency_key is stable across crash redeliveries of the same attempt — an executor that performs external side effects should deduplicate on it; one that cannot should be run with on_dangling = fail.

Type Aliases§

TokenSink
A §6.10 TokenChunk sink: text deltas stream into it as they arrive.