# `Squidie.ReadModel.Inspection.Snapshot`
[🔗](https://github.com/dark-trench/squidie/blob/main/lib/squidie/read_model/inspection/snapshot.ex#L2)

Projection-backed inspection snapshot for one Jido-native workflow run.

This struct is a compact read model built from the workflow and dispatch
durable journals so callers can inspect a stable public shape without parsing
raw journal entries.

Terminal runs keep both `terminal?` and `terminal_status` so operator-facing
surfaces can suppress recovery actions while still distinguishing completed,
failed, and cancelled histories.

Future-visible attempts are kept separate from currently visible attempts.
This lets operator-facing surfaces explain delayed retry or deferred dispatch
state without treating the run as idle or recoverable.

# `attempt`

```elixir
@type attempt() :: %{
  :runnable_key =&gt; String.t(),
  :status =&gt; atom(),
  :attempt_number =&gt; pos_integer(),
  :step =&gt; String.t(),
  :input =&gt; map(),
  optional(:scheduled_at) =&gt; DateTime.t(),
  :visible_at =&gt; DateTime.t(),
  :idempotency_key =&gt; String.t(),
  optional(:claim_id) =&gt; String.t(),
  optional(:owner_id) =&gt; String.t(),
  optional(:lease_until) =&gt; DateTime.t(),
  optional(:claimed_at) =&gt; DateTime.t(),
  optional(:result) =&gt; map(),
  optional(:completed_at) =&gt; DateTime.t(),
  optional(:transition) =&gt; map(),
  optional(:error) =&gt; map(),
  optional(:recovery) =&gt; map(),
  optional(:deferred) =&gt; map(),
  wakeup_emitted?: boolean(),
  applied?: boolean()
}
```

# `reason`

```elixir
@type reason() ::
  :terminal
  | :completed_result_pending_apply
  | :planned_dispatch_pending_schedule
  | :expired_claim
  | :attempt_claimed
  | :attempt_visible
  | :deferred_continuation
  | :attempt_scheduled_for_later
  | :manual_intervention_required
  | :run_started
  | :idle
  | :waiting_for_dispatch
```

# `t`

```elixir
@type t() :: %Squidie.ReadModel.Inspection.Snapshot{
  anomalies: [map()],
  applied_at: %{optional(String.t()) =&gt; DateTime.t()},
  applied_runnable_keys: [String.t()],
  attempts: [attempt()],
  child_runs: [map()],
  command_history: [map()],
  context: map(),
  deadline: map() | nil,
  definition_version: String.t() | nil,
  dynamic_work: [map()],
  expired_claims: [attempt()],
  guardrails: [map()],
  input: map() | nil,
  manual_state: map() | nil,
  next_visible_at: DateTime.t() | nil,
  parent_run: map() | nil,
  pending_dispatches: [map()],
  pending_results: [attempt()],
  planned_runnable_keys: [String.t()],
  planned_runnables: [map()],
  queue: String.t(),
  reason: reason(),
  replayed_from_run_id: String.t() | nil,
  run_id: String.t(),
  scheduled_attempts: [attempt()],
  started_at: DateTime.t() | nil,
  status: atom(),
  terminal?: boolean(),
  terminal_at: DateTime.t() | nil,
  terminal_error: map() | nil,
  terminal_status: atom() | nil,
  thread_revisions: %{run: non_neg_integer(), dispatch: non_neg_integer()},
  trigger: String.t() | nil,
  visible_attempts: [attempt()],
  workflow: String.t() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
