NodeInvoker
Runs the node bound to a state, writes what it produced, and takes the edge its answer names. Four things happen here and each one is derived from a declaration rather than configured: - **whether it may run** is what the node's own `#[Needs]` says, judged against whoever is driving the run right now ({@see Caller}) — a node the root's scope reached is not thereby a node its caller may run. A refused node is not called at all ({@see NodeRefused}); - **the input** is projected from the channels by parameter NAME, so no node declares a mapping; - **what it produced** is written into the log under the channel names its result object already uses, so the artifact lives in the process's own memory instead of in whoever drove it; - **the edge** is the case of the routing enum the node returned — the same mechanism a human's gate answer uses, which is the whole point. The node is called the way a surface calls every handler — its input, who to attribute the call to, and the caller's authority — so a `run()` that asks for its `InvocationContext` receives the one of the invocation that reached it. Who that was is written into the same event the node's channels are ({@see self::RAN}). The loop budget is counted FROM THE LOG, not from a counter someone maintains: the count rides in the appended payload, so a replay of the same events reaches the same decision. When the budget is spent the run does not stop — it takes the edge to the gate that asks a person what to do next.
NodeInvoker::__construct()
public function __construct(Milpa\Orchestrator\Declaration\CompiledGraph $graph, Milpa\Orchestrator\Declaration\Caller $caller = new Caller()):Parameters
| Name | Type | Description |
|---|---|---|
| $graph | Milpa\Orchestrator\Declaration\CompiledGraph | |
| $caller | Caller | who is driving the run for this advance. The default is nobody — no context to hand a node and no authority to judge its needs against, so only nodes that declare none run |
NodeInvoker::invoke()
public function invoke(string $state, array $context, array $transitions): ?arrayRuns the node bound to `$state`, writes what it produced, and returns the edge it takes.
Parameters
| Name | Type | Description |
|---|---|---|
| $state | string | |
| $context | array<string, mixed> | |
| $transitions | list<array{name: string, to: string}> |
Throws
NodeRefused when the caller driving the run does not hold what the node declares it needs