Spectre.GAM.Kernel.Authority.Effective (Spectre v0.4.0)

Copy Markdown View Source

Immutable authority resolution for one admission decision.

This is a capability-free, non-durable value. Both forms retain the exact content-addressed Candidate reference checked by Authority, preventing a successful resolution from being reused for another proposal. The ordinary form otherwise points to the already-validated Mandate instead of copying all of its fields; the retained-controller form adds only its controller.

Keeping this distinct from Spectre.GAM.Mandate prevents an ephemeral narrowing from masquerading as a content-addressed durable Mandate with a stale ref.

Summary

Functions

Projects an ordinary durable Mandate into the Decision boundary.

Returns the durable Mandate identity represented by this resolution.

Builds the one-operation authority retained by a revocation controller.

Returns the durable Mandate revision represented by this resolution.

Materializes the exact authority fields consumed by Decision.

Types

snapshot()

@type snapshot() :: Spectre.GAM.Mandate.t() | map()

t()

@type t() :: %Spectre.GAM.Kernel.Authority.Effective{
  candidate_ref: String.t(),
  controller_ref: String.t() | nil,
  mandate: Spectre.GAM.Mandate.t(),
  mode: :ordinary | :retained_revocation
}

Functions

from_mandate(mandate, candidate)

@spec from_mandate(Spectre.GAM.Mandate.t(), Spectre.GAM.Candidate.t()) :: t()

Projects an ordinary durable Mandate into the Decision boundary.

ref(effective)

@spec ref(t()) :: String.t()

Returns the durable Mandate identity represented by this resolution.

retained_revocation(mandate, candidate, controller_ref)

@spec retained_revocation(
  Spectre.GAM.Mandate.t(),
  Spectre.GAM.Candidate.t(),
  String.t()
) :: t()

Builds the one-operation authority retained by a revocation controller.

revision(effective)

@spec revision(t()) :: pos_integer()

Returns the durable Mandate revision represented by this resolution.

snapshot(effective, candidate)

@spec snapshot(t(), Spectre.GAM.Candidate.t()) :: {:ok, snapshot()} | {:error, term()}

Materializes the exact authority fields consumed by Decision.