Independent admission, authority, retention and activation axes for a Definition.
A saved Run authority epoch is lineage only. Authorization always consults the current lifecycle record at admission, commit or dispatch time.
Summary
Functions
Moves the active lifecycle fence atomically for a Definition Activation.
Checks current-time lifecycle authority for a runtime operation.
Fetches a lifecycle or returns a safe default for a known Definition.
Builds the initial active lifecycle represented by an Activation.
Restores lifecycle data without creating atoms.
Returns the stable map key for a Definition lifecycle.
Builds and validates a Definition lifecycle record.
Builds a lifecycle record or raises with its stable reason.
Returns the lifecycle schema version.
Returns portable lifecycle data.
Transitions one axis through revision CAS and monotonic safety rules.
Types
@type axis() :: :admission | :authority | :retention | :activation
@type t() :: %Spectre.Instance.Lifecycle{ activation: :active | :inactive, admission: :accepting | :draining | :closed, authority: :granted | :restricted | :revoked, authority_epoch: non_neg_integer(), changed_at: non_neg_integer(), definition_ref: Spectre.Definition.Ref.t(), provenance: map(), reason: term(), retention: :retained | :gc_eligible | :purged, revision: non_neg_integer(), schema_version: pos_integer() }
Functions
@spec activate( map(), Spectre.Instance.Activation.t() | nil, Spectre.Instance.Activation.t(), keyword() ) :: {:ok, map()} | {:error, term()}
Moves the active lifecycle fence atomically for a Definition Activation.
@spec authorize(t(), :new_admission | :continuation | :dispatch | :commit) :: :ok | {:error, term()}
Checks current-time lifecycle authority for a runtime operation.
@spec fetch(map(), Spectre.Definition.Ref.t(), keyword()) :: t()
Fetches a lifecycle or returns a safe default for a known Definition.
@spec from_activation(Spectre.Instance.Activation.t()) :: t()
Builds the initial active lifecycle represented by an Activation.
Restores lifecycle data without creating atoms.
@spec key(Spectre.Definition.Ref.t() | t()) :: String.t()
Returns the stable map key for a Definition lifecycle.
Builds and validates a Definition lifecycle record.
Builds a lifecycle record or raises with its stable reason.
@spec schema_version() :: pos_integer()
Returns the lifecycle schema version.
Returns portable lifecycle data.
Transitions one axis through revision CAS and monotonic safety rules.