Portable execution dependencies sealed into a Definition Manifest.
The closure records exact data references and the fingerprints of compiled
implementations observed when a Definition was composed. A fingerprint is
evidence of one build, not a promise that BEAM code can be restored by
digest. compare_builds/2 makes missing or changed code explicit so a
resolver can block before execution or report drift under a host policy.
Summary
Functions
Compares sealed build fingerprints with fingerprints observed by trusted host code. The observed map is keyed by the closure's logical code Refs.
Returns the canonical SHA-256 digest of the closure.
Computes the SHA-256 fingerprint of the currently loaded BEAM object code.
Builds one validated fingerprint entry for a trusted loaded module.
Restores a closure from decoded canonical data.
Builds a complete, validated execution closure.
Builds a closure or raises with its stable validation reason.
Observes every BEAM fingerprint through trusted loaded-code metadata.
Returns the Execution Closure schema version.
Returns the portable data sealed into a Definition Manifest.
Types
@type t() :: %Spectre.Execution.Closure{ build_fingerprints: [fingerprint()], compatibility_mode: :native_v2 | :adapted_v1, contract_refs: [String.t()], evaluation_corpus_digest: String.t() | nil, model_profile_refs: [String.t()], package_refs: [String.t()], projection_generators: [map()], prompt_fragment_digests: [String.t()], recording_refs: [String.t()], schema_version: pos_integer(), stack_ref: String.t(), state_codec_ref: String.t(), state_schema_ref: String.t() }
Functions
@spec compare_builds(t(), %{optional(String.t()) => String.t()}) :: {:ok, :matched} | {:drift, [drift()]} | {:error, term()}
Compares sealed build fingerprints with fingerprints observed by trusted host code. The observed map is keyed by the closure's logical code Refs.
Returns the canonical SHA-256 digest of the closure.
Computes the SHA-256 fingerprint of the currently loaded BEAM object code.
This helper is intended for trusted composition and deployment registries; canonical runtime data is never converted into a module to call it.
@spec fingerprint_entry(String.t(), module(), :block | :report) :: {:ok, fingerprint()} | {:error, term()}
Builds one validated fingerprint entry for a trusted loaded module.
Restores a closure from decoded canonical data.
Builds a complete, validated execution closure.
Builds a closure or raises with its stable validation reason.
@spec observe_builds( t(), keyword() ) :: {:ok, %{optional(String.t()) => String.t()}} | {:error, term()}
Observes every BEAM fingerprint through trusted loaded-code metadata.
@spec schema_version() :: pos_integer()
Returns the Execution Closure schema version.
Returns the portable data sealed into a Definition Manifest.