# `ExGAM.Payload.Store`
[🔗](https://github.com/elchemista/ex_gam/blob/0.1.0/lib/ex_gam/payload/store.ex#L1)

Host boundary for content-addressed payloads kept outside the Domain ledger.

A configured adapter must verify both presence and digest correspondence for
the supplied `payload:<sha256>` reference. ExGAM verifies all live references
during cold recovery, the introduced references during incremental recovery,
and the pertinent references again before use. Historical payloads are not
polled on unrelated writes; hosts should independently monitor storage health.
A durable erasure Attempt is the only
reason a referenced payload may be absent; its ledger tombstone remains.

# `config`

```elixir
@type config() :: module() | {module(), keyword()}
```

# `ref`

```elixir
@type ref() :: String.t()
```

# `verify`

```elixir
@callback verify(ref(), keyword()) :: :ok | {:error, :not_found | term()}
```

Checks that the referenced payload exists and matches the digest in its reference.

# `act_payload_refs`

```elixir
@spec act_payload_refs(ExGAM.GovernedAct.State.t(), ExGAM.Act.t()) :: [ref()]
```

Returns external payload refs which must be usable before an Attempt is recorded.

# `normalize`

```elixir
@spec normalize(config() | nil) ::
  {:ok, {module(), keyword()} | nil} | {:error, term()}
```

Checks the host adapter configuration and callback; does not contact payload storage.

# `post_attempt_payload_refs`

```elixir
@spec post_attempt_payload_refs(ExGAM.GovernedAct.State.t(), ExGAM.Act.t()) :: [ref()]
```

Returns payload refs still needed after an Attempt has made its target mutable.

# `verify`

```elixir
@spec verify(config() | nil, ref()) :: :ok | {:error, term()}
```

Calls the configured adapter to verify one payload's presence and digest without returning its contents.

# `verify_live_references`

```elixir
@spec verify_live_references(config() | nil, ExGAM.GovernedAct.State.t()) ::
  :ok | {:error, term()}
```

Verifies every payload which the durable projection still classifies as live.

# `verify_new_references`

```elixir
@spec verify_new_references(config() | nil, ExGAM.GovernedAct.State.t(), [ref()]) ::
  :ok | {:error, term()}
```

Verifies a newly introduced ref and prevents resurrection after an erasure Attempt.

# `verify_usable`

```elixir
@spec verify_usable(config() | nil, ExGAM.GovernedAct.State.t(), [ref()]) ::
  :ok | {:error, term()}
```

Verifies refs at their point of use and reports causal unavailability explicitly.

---

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