Expand description
The behavior interpreter as a module: the well-known ids and call
conventions under which the runtime exposes its one
BehaviorInterpreter on the engine.
The runtime assembles a host module under ID (the engine’s generic
module builder) with functions attached to the interpreter’s entry points:
LOAD→BehaviorInterpreter::load: replace the running behavior with a wholeGraph;EDIT→BehaviorInterpreter::apply: apply aGraphDiffto it;SPAWN→BehaviorInterpreter::spawn: start a task run from aCallunder aRunPolicy, returning aTaskHandle;HALT→BehaviorInterpreter::halt: stop the run named by aTaskId.
Payloads travel as structured Value arguments, converted generically
through arora_types::value_serde — any serde type flows, no bespoke
encoding — and SPAWN’s TaskHandle returns the same way. A
Call{module_id: ID, id: LOAD|EDIT|SPAWN|HALT} — a remote’s
BridgeOp::Call, or a behavior’s own call bridge — reaches the interpreter
through the engine’s normal dispatch, like any module function.
Constants§
- EDIT
- Function id of edit: apply a
GraphDiffto the running behavior. - EDIT_
ARG - Argument id of
EDIT’s one argument: theGraphDiff, as a structuredValue. - HALT
- Function id of halt: stop the run named by a
TaskId. - HALT_
ARG - Argument id of
HALT’s one argument: theTaskIdof the run to stop. - ID
- Module id under which the runtime registers the behavior interpreter on the engine. Self-identifying like the vizij type ids: the ASCII bytes of “arora” lead the UUID, a small offset tails it.
- LOAD
- Function id of load: replace the running behavior with a
Graph. - LOAD_
ARG - Argument id of
LOAD’s one argument: theGraph, as a structuredValue. - SPAWN
- Function id of spawn: start a task run from a
Callunder aRunPolicy, returning aTaskHandle. - SPAWN_
CALL_ ARG - Argument id of
SPAWN’s first argument: theCallto run, as a structuredValue. - SPAWN_
POLICY_ ARG - Argument id of
SPAWN’s second argument: theRunPolicy.
Functions§
- decode_
edit - Read the
GraphDiffout of anEDITcall. - decode_
halt - Read the
TaskIdout of aHALTcall. - decode_
load - Read the
Graphout of aLOADcall. - decode_
spawn - Read the
Callto run and itsRunPolicyout of aSPAWNcall. - decode_
spawn_ result - Read the
TaskHandleout of aSPAWNcall’s returnValue. - encode_
edit - Build the
Callthat appliesdiffto the running behavior. - encode_
halt - Build the
Callthat halts the run named bytask. - encode_
load - Build the
Callthat loadsgraphas the running behavior. - encode_
spawn - Build the
Callthat spawnscallas a task run underpolicy. - encode_
spawn_ result - Convert the
TaskHandlethatSPAWNreturns to aValue, to travel back as the call’s return.