# `Spectre.GAM.GovernedAct.Commit`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/governed_act/commit.ex#L1)

One prepared governed transaction, before its durability acknowledgement.

The existing pure fold validates the exact canonical records once, including
their real batch identity, acquisition time and predecessor. `state` is the
proposed result, not committed authority. A persistence driver may publish it
only after confirming `receipt` exactly; uncertainty must recover the actual
committed records instead. No capability is created by preparation.

This separates the semantic transaction from its physical storage. A ledger
driver persists `payloads`; a state-oriented driver can additionally publish
the resulting current facts in the same storage transaction. Neither driver
gets to reimplement the governed transitions or change the accepted records.
The current representation still contains a full State: this is not a bounded
read-model implementation or a persisted checkpoint format.

# `t`

```elixir
@type t() :: %Spectre.GAM.GovernedAct.Commit{
  payloads: [map()],
  prefix: Spectre.GAM.Ledger.cursor(),
  receipt: Spectre.GAM.Ledger.batch_info(),
  recorded_at: non_neg_integer(),
  state: Spectre.GAM.GovernedAct.State.t()
}
```

# `confirmed?`

```elixir
@spec confirmed?(t(), term()) :: boolean()
```

Checks an exact durable acknowledgement; numeric coercion is never allowed.

# `prepare`

```elixir
@spec prepare(
  Spectre.GAM.GovernedAct.State.t(),
  String.t(),
  [map()],
  non_neg_integer()
) ::
  {:ok, t()} | {:error, term()}
```

Folds an exact proposed batch and builds its expected durability receipt.

Entries use the real predecessor and batch coordinates so confirmation can
reuse the checked State without another semantic fold. Neither the entries
nor `state` prove persistence: the storage driver must match the receipt or
recover the actual durable prefix before adopting this result.

---

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