Compact lifecycle index for executor-mediated Acts.
Pending dispatches remain a MapSet because expiry, authority changes and
reconciliation scan that small hot set repeatedly. Terminal dispatches share
one mutually-exclusive index: an Act either consumed one Attempt or was
cancelled. The durable Attempt and cancellation event remain in the ledger;
this module only reads and updates their disposable projection indexes.
Summary
Functions
Returns the Attempt bound to an Act, or nil before/without execution.
Returns whether an Act has consumed an Attempt.
Returns the cancellation bound to an Act, or nil when not cancelled.
Returns terminal cancellation entries without materializing another index.
Returns whether an Act's dispatch was cancelled.
Returns pending executor Acts whose pinned Mandate has expired.
Returns the validated Act and pinned Mandate behind each pending dispatch.
Returns whether an Act is waiting at the executor boundary.
Returns the hot set of Acts still eligible to consume a Grant.
Returns the terminal dispatch state for an Act, if one exists.
Types
@type cancellation() :: %{ cause_ref: String.t(), reason: :mandate_revoked | :mandate_restricted | :mandate_expired | :disputed_evidence, cancelled_at: non_neg_integer() }
@type terminal() :: {:attempt, String.t()} | {:cancelled, cancellation()}
Functions
@spec attempt_ref(Spectre.GAM.GovernedAct.State.t(), String.t()) :: String.t() | nil
Returns the Attempt bound to an Act, or nil before/without execution.
@spec attempted?(Spectre.GAM.GovernedAct.State.t(), String.t()) :: boolean()
Returns whether an Act has consumed an Attempt.
@spec cancellation(Spectre.GAM.GovernedAct.State.t(), String.t()) :: cancellation() | nil
Returns the cancellation bound to an Act, or nil when not cancelled.
@spec cancellations(Spectre.GAM.GovernedAct.State.t()) :: Enumerable.t()
Returns terminal cancellation entries without materializing another index.
@spec cancelled?(Spectre.GAM.GovernedAct.State.t(), String.t()) :: boolean()
Returns whether an Act's dispatch was cancelled.
@spec expired(Spectre.GAM.GovernedAct.State.t(), integer()) :: {:ok, [{Spectre.GAM.Act.t(), Spectre.GAM.Mandate.t()}]} | {:error, term()}
Returns pending executor Acts whose pinned Mandate has expired.
@spec pending(Spectre.GAM.GovernedAct.State.t()) :: {:ok, [{Spectre.GAM.Act.t(), Spectre.GAM.Mandate.t()}]} | {:error, term()}
Returns the validated Act and pinned Mandate behind each pending dispatch.
@spec pending?(Spectre.GAM.GovernedAct.State.t(), String.t()) :: boolean()
Returns whether an Act is waiting at the executor boundary.
@spec pending_refs(Spectre.GAM.GovernedAct.State.t()) :: MapSet.t(String.t())
Returns the hot set of Acts still eligible to consume a Grant.
@spec terminal(Spectre.GAM.GovernedAct.State.t(), String.t()) :: terminal() | nil
Returns the terminal dispatch state for an Act, if one exists.