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

Sealed Manifest V2 for one canonical Definition.

A Manifest binds the Definition Ref, its effective Authority Envelope, its
Execution Closure, and the exact component-contract interpretation used at
publication time. Integrity is content-addressed; publisher trust, approval,
revocation, and current authority remain separate host concerns.

# `t`

```elixir
@type t() :: %Spectre.Definition.Manifest{
  authority: Spectre.Authority.Envelope.t(),
  component_contracts: [map()],
  contract_version: pos_integer(),
  definition_ref: Spectre.Definition.Ref.t(),
  execution_closure: Spectre.Execution.Closure.t(),
  parent_refs: [Spectre.Definition.Ref.t()],
  provenance_refs: [String.t()],
  publisher_ref: String.t() | nil,
  receipt_refs: [String.t()],
  schema_version: pos_integer()
}
```

# `contract_version`

```elixir
@spec contract_version() :: pos_integer()
```

Returns the mandatory reflective Stack/Manifest contract version.

# `decode`

```elixir
@spec decode(binary()) :: {:ok, t()} | {:error, term()}
```

Decodes and validates canonical Manifest bytes.

# `digest`

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

Returns the content digest of the sealed Manifest.

# `encode`

```elixir
@spec encode(t()) :: {:ok, binary()} | {:error, term()}
```

Encodes a Manifest into portable canonical bytes.

# `encode!`

```elixir
@spec encode!(t()) :: binary()
```

Encodes a Manifest or raises on invalid canonical data.

# `from_data`

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

Restores a Manifest from decoded canonical data.

# `new`

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

Builds and validates a Manifest from already normalized fields.

# `new`

```elixir
@spec new(
  Spectre.Definition.Canonical.t(),
  Spectre.Authority.Envelope.t(),
  Spectre.Execution.Closure.t(),
  keyword()
) :: {:ok, t()} | {:error, term()}
```

Builds and seals a Manifest for a canonical Definition.

# `new!`

```elixir
@spec new!(
  Spectre.Definition.Canonical.t(),
  Spectre.Authority.Envelope.t(),
  Spectre.Execution.Closure.t(),
  keyword()
) :: t()
```

Builds a Manifest or raises with its stable validation reason.

# `schema_version`

```elixir
@spec schema_version() :: pos_integer()
```

Returns the Manifest schema version.

# `to_data`

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

Returns the portable Manifest representation.

# `verify`

```elixir
@spec verify(
  t(),
  Spectre.Definition.Canonical.t(),
  Spectre.Definition.ContractRegistry.t()
) ::
  :ok | {:error, term()}
```

Verifies the Definition binding and its exact component-contract snapshot.

---

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