# `ExGAM.GovernedAct.Index`
[🔗](https://github.com/elchemista/ex_gam/blob/0.1.0/lib/ex_gam/governed_act/index.ex#L1)

Shared access rules for collections in disposable governed state.

Transition modules use these functions so missing-record and duplicate-record
errors remain stable as the fold is split by concern. This is not a general
repository abstraction: it only reads and updates the in-memory projection
rebuilt from the ledger.

# `ensure_present`

```elixir
@spec ensure_present(map(), [String.t()], atom()) :: :ok | {:error, term()}
```

Requires every reference to exist in a collection, preserving caller error context.

# `fetch_act`

```elixir
@spec fetch_act(ExGAM.GovernedAct.State.t(), String.t()) ::
  {:ok, ExGAM.Act.t()} | {:error, term()}
```

Fetches an Act using the common governed-history error vocabulary.

# `fetch_attempt`

```elixir
@spec fetch_attempt(ExGAM.GovernedAct.State.t(), String.t()) ::
  {:ok, ExGAM.Attempt.t()} | {:error, term()}
```

Fetches an Attempt using the common governed-history error vocabulary.

# `fetch_decision`

```elixir
@spec fetch_decision(ExGAM.GovernedAct.State.t(), String.t()) ::
  {:ok, ExGAM.Decision.t()} | {:error, term()}
```

Fetches a Decision using the common governed-history error vocabulary.

# `fetch_duty_by_cause`

```elixir
@spec fetch_duty_by_cause(ExGAM.GovernedAct.State.t(), term()) ::
  {:ok, ExGAM.Duty.t()} | {:error, term()}
```

Fetches a Duty by its stable causal identity.

# `fetch_duty_by_ref`

```elixir
@spec fetch_duty_by_ref(ExGAM.GovernedAct.State.t(), term()) ::
  {:ok, ExGAM.Duty.t()} | {:error, term()}
```

Fetches a Duty by its durable record reference.

# `fetch_mandate`

```elixir
@spec fetch_mandate(ExGAM.GovernedAct.State.t(), String.t()) ::
  {:ok, ExGAM.Mandate.t()} | {:error, term()}
```

Fetches a Mandate using the common governed-history error vocabulary.

# `fetch_required`

```elixir
@spec fetch_required(map(), term(), atom()) :: {:ok, term()} | {:error, term()}
```

Fetches a required value while preserving the caller's record kind.

# `restore_unique`

```elixir
@spec restore_unique(map(), module(), String.t(), term(), atom()) ::
  {:ok, struct()} | {:error, term()}
```

Restores one canonical record and rejects identity reuse in its target index.

# `unique`

```elixir
@spec unique(map(), term(), atom()) :: :ok | {:error, term()}
```

Rejects a duplicate identity in a governed-state collection.

---

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