Oi.Compiler (oi v0.1.0)

Copy Markdown

Compiles a pure structural graph into Orchid RecipeBundles.

Two-phase compilation:

  1. compile_graph/2 — pure topology: topological sort + cluster paint

    • recipe construction. Produces static bundles without interventions. Result is reusable across different intervention sets.
  2. bind/2 — attaches interventions to static bundles, filtered by node membership. Cheap; can be called repeatedly with different interventions.

Summary

Functions

Phase 2: Bind interventions to static bundles.

Phase 1: Compile graph + cluster into static RecipeBundles (no interventions).

Functions

bind(static_bundles, interventions)

Phase 2: Bind interventions to static bundles.

Thin wrapper around RecipeBundle.bind_interventions/2.

compile_graph(graph, cluster_decl \\ %Cluster{})

@spec compile_graph(
  Oi.Topology.Graph.t(Orchid.Step.implementation()),
  Oi.Topology.Cluster.t()
) ::
  {:error, :cycle_detected} | {:ok, [Oi.Compiler.RecipeBundle.t()]}

Phase 1: Compile graph + cluster into static RecipeBundles (no interventions).

Reusable across different intervention sets.