Squidie.ReadModel.Inspection (squidie v0.1.2)

Copy Markdown View Source

Projection-backed inspection for the journal-backed runtime.

The current public Squidie.inspect_run/2 API reads the durable Jido journal through the configured Jido.Storage. This module is the read-model boundary for the journal-backed runtime: it rebuilds workflow and dispatch agents from journal entries, combines their projections, and returns a factual snapshot of one run.

The snapshot is intentionally read-only. It does not recover missing dispatch entries, apply completed results, or mutate checkpoints. Recovery remains owned by Squidie.Runtime.AgentRecovery; inspection reports what the durable journals currently prove.

Summary

Functions

Builds a projection-backed inspection snapshot for one workflow run.

Types

snapshot_error()

@type snapshot_error() ::
  :not_found
  | {:invalid_option,
     {:now, :invalid}
     | {:queue, :invalid}
     | {:run_id, :invalid}
     | {:opts, :invalid}
     | {:option, atom()}}
  | term()

snapshot_option()

@type snapshot_option() :: {:queue, atom() | String.t()} | {:now, DateTime.t()}

storage_config()

@type storage_config() :: Squidie.Runtime.Journal.storage_config()

Functions

snapshot(storage, run_id, opts \\ [])

Builds a projection-backed inspection snapshot for one workflow run.

Options:

  • :queue selects the dispatch queue projection to join with the run projection. It defaults to "default".
  • :now controls visibility and lease-expiry calculations. It defaults to DateTime.utc_now/0.

Missing run threads return {:error, :not_found}. A missing dispatch thread is treated as an empty queue projection because a run can be planned before its dispatch intents have been recovered.