Oi.Workspace (oi v0.1.0)

Copy Markdown

Pure data container for a single computation unit.

A Workspace holds the resolved graph (projected by the upstream editor), cluster declaration, interventions, and the products of compilation and dispatch. It is a plain struct — no process, no state machine.

Lifecycle

# Phase 1: static compile (topology only, reusable)
workspace = Oi.Workspace.new("svs-1", graph, cluster)
{:ok, workspace} = Oi.compile(workspace)

# Phase 2: dispatch with interventions (can swap interventions)
{:ok, ws_a} = Oi.dispatch(workspace, interventions: interventions_a)
{:ok, ws_b} = Oi.dispatch(workspace, interventions: interventions_b)

Summary

Types

id()

@type id() :: String.t() | atom()

t()

@type t() :: %Oi.Workspace{
  cluster: Oi.Topology.Cluster.t(),
  drafting: Oi.Workspace.Drafting.t() | nil,
  graph: Oi.Topology.Graph.t(Orchid.Step.implementation()),
  id: id(),
  interventions: Oi.Compiler.RecipeBundle.interventions_map(),
  plan: Oi.Workspace.Planning.Plan.t() | nil,
  static_bundles: [Oi.Compiler.RecipeBundle.t()] | nil
}

Functions

new(id, graph, cluster \\ %Cluster{}, interventions \\ %{})