# `Spectre.GAM.Act`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/act.ex#L1)

Immutable, durable exercise of authority.

An Act freezes the admitted consequence and its complete authority-side
context.  It intentionally has no mutable status, result or error field;
attempts and outcomes are separate world-side records.

`requested_mandate_ref` preserves the Candidate's exact selection separately
from `mandate_ref`, which records the Mandate actually resolved by admission.
Keeping both removes guesswork when the Candidate is rebuilt during replay.
Condition refs and the Evidence actually used to recognize them remain
separate in `recognition_refs` and `recognition_evidence_refs`.

# `t`

```elixir
@type t() :: %Spectre.GAM.Act{
  accountable_ref: String.t(),
  authenticated_principal_ref: String.t(),
  authentication_ref: String.t(),
  authorizer_ref: String.t(),
  candidate_identity_key: String.t(),
  class: String.t(),
  committed_at: integer(),
  consent: Spectre.GAM.Consent.t() | nil,
  consequence: term(),
  decision_ref: String.t(),
  disclosure: Spectre.GAM.Disclosure.t() | nil,
  evidence_refs: [String.t()],
  executor_contract_ref: String.t(),
  executor_ref: String.t(),
  host_generation: non_neg_integer(),
  host_profile_ref: String.t(),
  ingress_ref: String.t(),
  mandate_ref: String.t(),
  mandate_revision: pos_integer(),
  material_digest: String.t(),
  observation_window_ms: non_neg_integer(),
  presentation_ref: String.t() | nil,
  proposer_ref: String.t(),
  purpose_params: map(),
  purpose_ref: String.t(),
  recognition_evidence_refs: [String.t()],
  recognition_refs: [String.t()],
  ref: String.t(),
  requested_mandate_ref: String.t() | nil,
  reservations: Spectre.GAM.Kernel.Meter.Amounts.t(),
  row: Spectre.GAM.Row.t(),
  schema_version: 1,
  scope_ref: String.t(),
  subject_refs: [String.t()],
  submission_context_ref: String.t(),
  surface_revision: non_neg_integer(),
  target_refs: [String.t()]
}
```

# `canonical`

```elixir
@spec canonical(t()) :: map()
```

Returns the plain, string-keyed ledger representation.

# `content_ref`

```elixir
@spec content_ref(t()) :: String.t()
```

Returns the content-derived Act reference, independent of an assigned `ref`.

# `digest`

```elixir
@spec digest(t()) :: String.t()
```

Returns the stable digest of the complete Act.

# `from_canonical`

```elixir
@spec from_canonical(map()) :: {:ok, t()} | {:error, term()}
```

Restores an Act from its canonical map.

# `new`

```elixir
@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, term()}
```

Builds and validates an immutable Act.

# `reservations?`

```elixir
@spec reservations?(t()) :: boolean()
```

Returns whether the Act commits any Meter reservation.

# `row?`

```elixir
@spec row?(t(), [Spectre.GAM.Row.dimension()]) :: boolean()
```

Checks the Act's exact declared effect-row dimensions.

# `targets?`

```elixir
@spec targets?(t(), [String.t()]) :: boolean()
```

Checks that every required reference is frozen in the Act targets.

---

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