Squidie.Runtime.Journal.ManualControl (squidie v0.1.2)

Copy Markdown View Source

Journal-backed manual intervention controls.

This module resolves manual pause boundaries by appending run-thread facts. The dispatch thread is updated only after the run thread contains the durable resolution and any successor runnable intent.

Summary

Functions

Approves a journal-paused :approval step and schedules its success path.

Rejects a journal-paused :approval step and schedules its rejection path.

Resumes a journal-paused :pause step and schedules its successor.

Types

control_error()

@type control_error() ::
  :not_found
  | :invalid_run_id
  | {:invalid_option, term()}
  | {:invalid_resume, map()}
  | {:invalid_transition, atom(), atom()}
  | {:invalid_step, atom() | String.t()}
  | {:invalid_workflow, String.t()}
  | term()

Functions

approve(run_id, attrs, opts \\ [])

@spec approve(String.t(), map(), keyword()) ::
  {:ok, Squidie.ReadModel.Inspection.Snapshot.t()} | {:error, control_error()}

Approves a journal-paused :approval step and schedules its success path.

reject(run_id, attrs, opts \\ [])

@spec reject(String.t(), map(), keyword()) ::
  {:ok, Squidie.ReadModel.Inspection.Snapshot.t()} | {:error, control_error()}

Rejects a journal-paused :approval step and schedules its rejection path.

resume(run_id, attrs, opts \\ [])

@spec resume(String.t(), map(), keyword()) ::
  {:ok, Squidie.ReadModel.Inspection.Snapshot.t()} | {:error, control_error()}

Resumes a journal-paused :pause step and schedules its successor.