# `ExGAM.Erasure.Analysis`
[🔗](https://github.com/elchemista/ex_gam/blob/0.1.0/lib/ex_gam/erasure/analysis.ex#L1)

Pure causal analysis for payload erasure.

The analysis consumes decoded governed records through `Analysis.Facts`.
It derives the immutable closure affected by deleting a payload and remains
conservative when execution may have touched the external payload store.

# `input`

```elixir
@type input() :: ExGAM.GovernedAct.State.t() | ExGAM.Erasure.Analysis.Facts.t()
```

# `payload_state`

```elixir
@type payload_state() :: ExGAM.Erasure.Analysis.Execution.payload_state()
```

# `affected_evidence_refs`

```elixir
@spec affected_evidence_refs(input(), String.t()) ::
  {:ok, MapSet.t(String.t())} | {:error, term()}
```

Returns affected Evidence using the current dynamic causal closure.

# `affected_refs`

```elixir
@spec affected_refs(input(), String.t()) :: {:ok, [String.t()]} | {:error, term()}
```

Returns every durable record causally affected by one payload.

# `available_evidence`

```elixir
@spec available_evidence(input()) :: %{optional(String.t()) =&gt; ExGAM.Evidence.t()}
```

Returns the Evidence records that remain valid inputs after erasure.

# `derive_request`

```elixir
@spec derive_request(input(), String.t(), String.t(), String.t(), integer()) ::
  {:ok, map()} | {:error, term()}
```

Derives the exact immutable erasure draft from the current fact prefix.

# `execution_state`

```elixir
@spec execution_state(input(), String.t()) ::
  {:ok, payload_state()} | {:error, term()}
```

Classifies whether deletion may have touched the named payload.

# `requestable?`

```elixir
@spec requestable?(input(), String.t()) :: :ok | {:error, term()}
```

Rejects duplicate erasure while an earlier request may still have had effect.

# `unavailable_evidence_refs`

```elixir
@spec unavailable_evidence_refs(input()) :: MapSet.t(String.t())
```

Returns all Evidence made unusable by an attempted erasure.

# `validate_evidence_available`

```elixir
@spec validate_evidence_available(input(), [String.t()]) :: :ok | {:error, term()}
```

Rejects reuse of Evidence whose causal payload may have been erased.

# `validate_request`

```elixir
@spec validate_request(input(), ExGAM.Erasure.t() | map() | keyword()) ::
  :ok | {:error, term()}
```

Checks a supplied draft against the closure derivable at this exact prefix.

---

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