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

Immutable, portable definition used by the governed surface.

Definitions contain declarative data only.  They do not embed evaluator
functions, modules or callbacks capable of granting authority.  Revisions
form an explicit content-addressed chain and become active only through a
governance Act recorded by the Domain.

# `t`

```elixir
@type t() :: %Spectre.GAM.Definition{
  body: map(),
  declared_at: integer(),
  name: String.t(),
  namespace: String.t(),
  previous_ref: String.t() | nil,
  ref: String.t(),
  revision: pos_integer(),
  schema_version: 1
}
```

# `canonical`

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

Returns the plain, string-keyed ledger representation.

# `content_ref`

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

Returns the reference derived from immutable Definition content.

# `digest`

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

Returns the stable digest of the complete Definition.

# `from_canonical`

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

Restores a Definition and verifies its content reference.

# `key`

```elixir
@spec key(t()) :: {String.t(), String.t()}
```

Returns the stable logical key shared by all revisions.

# `new`

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

Builds and validates a declarative Definition.

# `revise`

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

Prepares the next immutable revision without activating it.

This is the data operation behind Morph: the application supplies a new body
(from a DSL, transformation function or planner) and an explicit declaration
time. Identity, predecessor and revision are derived from the exact current
record, not chosen by the transformation. Submit the result through
`Spectre.GAM.revise_definition/4`; a stale predecessor is rejected by governance.
No process state, Mandate, open Duty or active code changes here.

---

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