SquidMesh.Runtime.Journal.Starter (squid_mesh v0.1.0-beta.2)

Copy Markdown View Source

Journal-backed workflow start boundary for the Jido-native runtime.

This module resolves the public Squid Mesh workflow contract, plans initial runnables through Runic, appends durable run and run-index facts to Jido.Storage, then uses WorkflowAgent and DispatchAgent as rebuildable coordinators to schedule dispatch attempts from the journal.

The journal runtime can execute normal action steps, immediate built-in :log steps, built-in :wait steps in transition and dependency workflows, and manual :pause or :approval boundaries. Manual boundaries persist inspectable intervention state and can be resumed or reviewed through journal manual controls. Callers enter this path explicitly with runtime: :journal, journal_storage:, and optional queue or clock overrides. No Jido primitive is required in workflow authoring.

Summary

Functions

Starts a workflow run by appending Jido journal facts and scheduling dispatch.

Types

start_error()

@type start_error() ::
  {:invalid_payload, SquidMesh.Workflow.Definition.payload_error_details()}
  | SquidMesh.Workflow.Definition.load_error()
  | SquidMesh.Workflow.Definition.trigger_error()
  | {:invalid_option,
     {:journal_storage, nil}
     | {:now, term()}
     | {:queue, term()}
     | {:run_id, term()}}
  | term()

Functions

start_run(workflow, trigger_name, payload, opts)

@spec start_run(module(), atom() | nil, map(), keyword()) ::
  {:ok, SquidMesh.ReadModel.Inspection.Snapshot.t()}
  | {:ok,
     {:duplicate_schedule_start, SquidMesh.ReadModel.Inspection.Snapshot.t()}}
  | {:error, start_error()}

Starts a workflow run by appending Jido journal facts and scheduling dispatch.

The returned snapshot is rebuilt from the same journal-backed read model used by SquidMesh.inspect_run/2 with read_model: :read_model.