DeclaredGraph
Compiles a declared graph into the process definition the engine already runs. The rule this implements is the one the whole house is built on, applied one level up: **what changes authority is DECLARED; what a type already says is DERIVED.** The wiring, the loop budget and who may answer a gate are declared, because nothing can infer them. Everything else is read off types that already exist: - the graph's constructor IS its state — each promoted property is a channel; - each node is an ordinary `#[Operation]`, so its input schema, its effect ceiling, its consent and its scopes come along without being restated; - the routing enum's CASES are the outgoing edges, so a model's verdict and a human's gate choice are written the same way; - a node with no outgoing edge is terminal — there is no such thing here as a state with nowhere to go, which is the silent dead end the engine used to tolerate. Nothing is guessed. Every refusal below names the class and says what to declare, once, at compile time — never on the first request in production.
DeclaredGraph::isDeclared()
public static function isDeclared(string $class): boolDoes this class declare itself a graph?
Parameters
| Name | Type | Description |
|---|---|---|
| $class | string |
DeclaredGraph::from()
public static function from(string $class, ?Closure $resolve = null): Milpa\Orchestrator\Declaration\CompiledGraphCompiles the graph declared by `$class`.
Parameters
| Name | Type | Description |
|---|---|---|
| $class | class-string | the declaring class |
| $resolve | (\Closure | null) | `fn (string $type): object` — how each node's collaborators are found |
Throws
GraphDeclarationException when the declaration cannot be compiled without guessing