CompiledGraph

org.llm4s.agent.graph.CompiledGraph
final class CompiledGraph[I, O]

An immutable, validated graph, run in supersteps.

Each superstep runs every ready task against the same committed ThreadState, then commits their updates and schedules the next frontier together:

  1. Tasks run in frontier order (possibly concurrently); none sees another's writes.
  2. If any task fails, the superstep commits nothing and the run fails with the first failure in frontier order.
  3. Each command is checked: every update is to a key in the node's declared write set, every route targets a node and join of this graph, and a task fans out to a join at most once.
  4. Updates apply task by task in frontier order, and in emission order within a task.
  5. The next frontier is, for each task in order, its static edges (declaration order) then its routes (route order, fan-out payloads in item order); then the targets of joins this commit released - static joins in declaration order, then dynamic activations in the order they opened.

The run completes when the frontier is empty and no join is waiting; a join still waiting at that point can never release and fails the run with GraphError.UnsatisfiedJoin.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Rebuilds an execution from a snapshot, checking it against this graph first: the graph id, version and structural fingerprint; that every state value and pending input decodes with this graph's codec for that key or node; that every join exists with the right kind; and that every arrival a dynamic join still expects is a pending task in its fan-out. Every problem is reported at once.

Rebuilds an execution from a snapshot, checking it against this graph first: the graph id, version and structural fingerprint; that every state value and pending input decodes with this graph's codec for that key or node; that every join exists with the right kind; and that every arrival a dynamic join still expects is a pending task in its fan-out. Every problem is reported at once.

Attributes

def run(input: I): RunResult[O]

Runs the graph from input to completion or failure.

Runs the graph from input to completion or failure.

Attributes

def runFrom(execution: Execution): RunResult[O]

Runs supersteps from execution to completion or failure.

Runs supersteps from execution to completion or failure.

Attributes

Encodes execution as data, using each key's and node's codec.

Encodes execution as data, using each key's and node's codec.

Attributes

def start(input: I): Execution

An execution with only the entry task ready, before any superstep has run.

An execution with only the entry task ready, before any superstep has run.

Attributes

def step(execution: Execution): Step[O]

Runs one superstep, or finishes the run if execution is quiescent.

Runs one superstep, or finishes the run if execution is quiescent.

Attributes

Concrete fields

val fingerprint: String
val id: String
val maxSupersteps: Int
val version: String