# `SquidMesh.Runtime.DispatchProtocol.Projection`
[🔗](https://github.com/ccarvalho-eng/squid_mesh/blob/main/lib/squid_mesh/runtime/dispatch_protocol/projection.ex#L1)

Rebuildable projection over durable dispatch journal entries.

The projection is deliberately pure. Storage adapters can rebuild it from
Jido thread journals, IntentLedger lifecycle signals, or from a single
append-only Squid Mesh journal table without changing the runtime invariants.

# `anomaly`

```elixir
@type anomaly() :: %{
  :reason =&gt; atom(),
  :entry_type =&gt; atom(),
  optional(:runnable_key) =&gt; String.t(),
  optional(:run_id) =&gt; String.t(),
  optional(:idempotency_key) =&gt; String.t(),
  optional(:claim_id) =&gt; String.t(),
  optional(:claim_token_hash) =&gt; String.t()
}
```

# `t`

```elixir
@type t() :: %SquidMesh.Runtime.DispatchProtocol.Projection{
  anomalies: [anomaly()],
  attempts: %{
    optional(String.t()) =&gt; SquidMesh.Runtime.DispatchProtocol.ActionAttempt.t()
  },
  terminal_runs: MapSet.t(String.t())
}
```

# `anomalies`

```elixir
@spec anomalies(t()) :: [anomaly()]
```

# `completed_results`

```elixir
@spec completed_results(t()) :: [SquidMesh.Runtime.DispatchProtocol.ActionAttempt.t()]
```

# `expired_claims`

```elixir
@spec expired_claims(t(), DateTime.t()) :: [
  SquidMesh.Runtime.DispatchProtocol.ActionAttempt.t()
]
```

# `rebuild`

```elixir
@spec rebuild([SquidMesh.Runtime.DispatchProtocol.Entry.t()]) :: t()
```

# `replay`

```elixir
@spec replay(t(), [SquidMesh.Runtime.DispatchProtocol.Entry.t()]) :: t()
```

# `results_ready_to_apply`

```elixir
@spec results_ready_to_apply(t()) :: [
  SquidMesh.Runtime.DispatchProtocol.ActionAttempt.t()
]
```

# `visible_attempts`

```elixir
@spec visible_attempts(t(), DateTime.t()) :: [
  SquidMesh.Runtime.DispatchProtocol.ActionAttempt.t()
]
```

---

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