Mandatory runtime Stack contract for reflective Definition Manifests.
Contract V2 seals two distinct objects: the effective Authority Envelope and
the Execution Closure. Existing compiled Stack V1 definitions are accepted
only through from_v1/2, which reads and conservatively lowers them without
mutating or retaining V1 as the native Manifest contract.
Summary
Functions
Builds Contract V2 for a compiled Agent/Skill and its canonical projection.
Conservatively adapts an immutable Stack Contract V1 definition.
Adapts a V1 Stack or raises with its stable validation reason.
Builds a native Contract V2 from reviewed authority and closure data.
Builds a native Contract V2 or raises.
Returns portable inspection data for the adapted contract.
Returns the mandatory reflective Stack contract version.
Types
@type t() :: %Spectre.Stack.Contract.V2{ authority: Spectre.Authority.Envelope.t(), contract_version: 2, execution_closure: Spectre.Execution.Closure.t(), source_contract: :native_v2 | :adapted_v1 }
Functions
@spec from_compiled( Spectre.Definition.t(), Spectre.Definition.Canonical.t(), keyword() ) :: {:ok, t()} | {:error, term()}
Builds Contract V2 for a compiled Agent/Skill and its canonical projection.
@spec from_v1( Spectre.Stack.Definition.t() | module() | nil, keyword() ) :: {:ok, t()} | {:error, term()}
Conservatively adapts an immutable Stack Contract V1 definition.
V1 capability declarations are requests only. Effective grants are their
intersection with the explicit :authority_ceiling; omitting the ceiling
produces an empty envelope.
@spec from_v1!( Spectre.Stack.Definition.t() | module() | nil, keyword() ) :: t()
Adapts a V1 Stack or raises with its stable validation reason.
@spec new(Spectre.Authority.Envelope.t(), Spectre.Execution.Closure.t()) :: {:ok, t()} | {:error, term()}
Builds a native Contract V2 from reviewed authority and closure data.
@spec new!(Spectre.Authority.Envelope.t(), Spectre.Execution.Closure.t()) :: t()
Builds a native Contract V2 or raises.
Returns portable inspection data for the adapted contract.
@spec version() :: pos_integer()
Returns the mandatory reflective Stack contract version.