# `Spectre.Morph.Surface`
[🔗](https://github.com/elchemista/spectre/blob/0.3.0/lib/spectre/morph/surface.ex#L1)

Canonical, closed declaration of the changes an Agent is willing to review.

A Surface is a ceiling over proposals, never an authority grant. The
governance Composer still intersects it with Manifest authority and host
policy. Runtime data cannot add operation types, widen scopes, or increase
prompt budgets after the Definition has been published.

The value object in this module owns transport normalization and identity.
Enforcement lives in `Spectre.Morph.Surface.Policy`, while mandatory replay
cases are derived by `Spectre.Morph.Surface.EvaluationObligations`.

# `approval_requirement`

```elixir
@type approval_requirement() :: :host_policy | :human
```

The minimum approval source required by the Agent Surface.

# `t`

```elixir
@type t() :: %Spectre.Morph.Surface{
  approval_requirement: approval_requirement(),
  operation_types: [String.t()],
  prompt_token_ceiling: pos_integer(),
  schema_version: pos_integer(),
  scope_ceiling: [String.t()]
}
```

The normalized immutable proposal ceiling sealed in Definition identity.

# `allows?`

```elixir
@spec allows?(t(), atom() | String.t()) :: boolean()
```

Returns whether the Surface permits proposing an operation type.

# `applicability_ceilings`

```elixir
@spec applicability_ceilings(t(), [String.t()]) :: map()
```

Builds exact applicability ceilings for the affected mount identifiers.

# `digest`

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

Returns the canonical Surface digest used in audit evidence.

# `from_canonical`

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

Reads and validates the immutable Surface of an Agent Definition.

# `from_data`

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

Restores a Surface from decoded canonical data.

# `new`

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

Builds a normalized proposal Surface.

Atom keys are accepted only as an Elixir authoring convenience. Transport
data uses the exact string-key schema returned by `to_data/1`.

# `new!`

```elixir
@spec new!(t() | map() | keyword()) :: t()
```

Builds a Surface or raises `ArgumentError` with its validation reason.

# `operation_types`

```elixir
@spec operation_types() :: [String.t()]
```

Returns the complete closed vocabulary of Morph proposal operations.

# `schema_ref`

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

Returns the stable schema reference for the canonical component.

# `to_data`

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

Returns the transport-stable data sealed into Definition identity.

---

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