Pure resolution of the authority that may cover a candidate.
Authority is resolved exclusively from the candidate, the authenticated
SubmissionContext, the current authority view and trusted time. Evidence is
deliberately absent from this API: facts may satisfy a mandate's conditions,
but they cannot create or select the mandate itself.
Every ledger record is decoded before it reaches this module. The resolver
therefore consumes typed Candidates and Mandates plus the closed
Spectre.GAM.Kernel.Authority.Facts container; accepting alternate storage
shapes here would make authority semantics depend on map-key guesses.
Summary
Types
The authority-relevant subset shared by a live or replayed submission context.
Functions
Validates one durable Mandate and returns the exact authority used by Decision.
Verifies that a child Mandate is a subtractive restriction of its parent.
Rechecks mutable authority facts before an admitted Act may start execution.
Explains whether one mandate is eligible without consulting Evidence.
Returns whether a Mandate branch is blocked by an unresolved Meter debt.
Verifies that every label owner explicitly granted within a Mandate lineage.
Resolves the one current mandate which covers candidate.
Returns whether a Mandate or one of its authority ancestors has been superseded.
Verifies that a successor is a strict, non-quantitative restriction.
Types
@type context() :: %{ :domain_ref => String.t(), :scope_ref => String.t(), :authenticated_principal_ref => String.t(), :authentication_ref => String.t(), :ingress_ref => String.t(), :host_generation => non_neg_integer(), optional(atom()) => term() }
The authority-relevant subset shared by a live or replayed submission context.
@type effective() :: Spectre.GAM.Kernel.Authority.Effective.t()
Functions
@spec authorize( Spectre.GAM.Candidate.t(), context(), Spectre.GAM.Mandate.t(), Spectre.GAM.Kernel.Authority.Facts.t(), integer() ) :: {:ok, effective()} | {:error, term()}
Validates one durable Mandate and returns the exact authority used by Decision.
Usually that is the Mandate itself. A retained_controller revocation is the
one narrow exception recorded by the Mandate: while it is current, a named
controller may revoke that exact Mandate through the ledger kernel. The
returned map narrows every field to that single consequence; it is not a new
durable Mandate and cannot authorize any other Candidate.
@spec delegation_within?( Spectre.GAM.Mandate.t() | map() | keyword(), Spectre.GAM.Mandate.t() | map() | keyword(), integer() ) :: :ok | {:error, term()}
Verifies that a child Mandate is a subtractive restriction of its parent.
Quantitative transfer still has to be applied through Kernel.Meter.delegate/3;
this function checks declared ceilings, not mutable balances. It also requires
the parent's conditions to be preserved or strengthened and the recorded
revocation policy to remain identical. Equality is intentionally used for
opaque purpose parameters and revocation policies because the core has no
safe domain-independent way to infer a broader restriction relation. It never
creates the child or changes either Mandate.
@spec dispatchable?( Spectre.GAM.Act.t(), Spectre.GAM.Mandate.t(), Spectre.GAM.Kernel.Authority.Facts.t(), integer() ) :: :ok | {:error, term()}
Rechecks mutable authority facts before an admitted Act may start execution.
@spec eligible?( Spectre.GAM.Candidate.t(), context(), Spectre.GAM.Mandate.t(), Spectre.GAM.Kernel.Authority.Facts.t(), integer() ) :: :ok | {:error, term()}
Explains whether one mandate is eligible without consulting Evidence.
This function is useful to auditors and to tests which need a stable reason for exclusion. It does not check whether mandate Evidence conditions are met or whether a Meter currently has sufficient available quantity.
@spec meter_debt_status( Spectre.GAM.Mandate.t(), Spectre.GAM.Kernel.Authority.Facts.t() ) :: :ok | {:error, term()}
Returns whether a Mandate branch is blocked by an unresolved Meter debt.
@spec owners_authorize_mandate?( Spectre.GAM.Mandate.t(), [String.t()], Spectre.GAM.Kernel.Authority.Facts.t() ) :: :ok | {:error, term()}
Verifies that every label owner explicitly granted within a Mandate lineage.
@spec resolve( Spectre.GAM.Candidate.t(), context(), Spectre.GAM.Kernel.Authority.Facts.t(), integer() ) :: resolution()
Resolves the one current mandate which covers candidate.
:none includes an unauthenticated or self-contradicting submission context.
Multiple independently eligible mandates are returned explicitly instead of
being selected by order, evidence, or caller preference.
@spec restriction_status( Spectre.GAM.Mandate.t(), Spectre.GAM.Kernel.Authority.Facts.t() ) :: :ok | {:error, term()}
Returns whether a Mandate or one of its authority ancestors has been superseded.
@spec restriction_within?( Spectre.GAM.Mandate.t() | map() | keyword(), Spectre.GAM.Mandate.t() | map() | keyword(), integer() ) :: :ok | {:error, term()}
Verifies that a successor is a strict, non-quantitative restriction.
Restriction keeps the same authority lineage and Meter allocation while narrowing at least one decidable boundary. Moving or shrinking quantities is deliberately left to delegation/devolution, so replacing a Mandate cannot silently mint, destroy or strand an in-flight allocation.