Squidie.ReadModel.Explanation (squidie v0.1.2)

Copy Markdown View Source

Projection-backed explanation for the journal-backed runtime.

Squidie.ReadModel.Inspection answers what durable journal projections currently show. This module answers why that state matters to an operator by deriving a deterministic reason, high-signal details, and the runtime boundary that would make progress.

Explanations are read-only. They do not schedule missing dispatches, apply completed results, recover expired claims, or mutate checkpoints.

Summary

Functions

Builds a projection-backed explanation for one workflow run.

Derives an explanation from an existing projection-backed snapshot.

Types

explanation_error()

@type explanation_error() ::
  Squidie.ReadModel.Inspection.snapshot_error()
  | {:invalid_option, {:run_id, :invalid}}

explanation_option()

@type explanation_option() :: Squidie.ReadModel.Inspection.snapshot_option()

storage_config()

@type storage_config() :: Squidie.ReadModel.Inspection.storage_config()

Functions

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

Builds a projection-backed explanation for one workflow run.

Options are the same as Squidie.ReadModel.Inspection.snapshot/3. Missing runs and invalid options return the same structured errors as the underlying snapshot call.

from_snapshot(snapshot)

Derives an explanation from an existing projection-backed snapshot.

This is useful when a caller already has a snapshot and wants a stable diagnostic view without re-reading storage.