Spectre.GAM.Kernel (Spectre v0.4.0)

Copy Markdown View Source

Pure admission orchestration for the governed-act runtime.

evaluate/4 joins already-authenticated ingress context with the current domain projection and an explicit trusted time. It performs no I/O, reads no ambient clock, appends nothing and cannot create a Grant. Its only outputs are portable Spectre.GAM.Decision and, exclusively for an admitted decision, an immutable Spectre.GAM.Act. They are proposed records until the Domain commits them; returning an Act here does not establish durability or release power.

The order is intentional: the surface classifies first, authority is resolved without Evidence, then Evidence and Presentation are recognized, and finally Spectre.GAM.Kernel.Decision applies resource accounting through Spectre.GAM.Kernel.Meter.

Spectre.GAM.Kernel.Commit plans the resulting atomic records. The Domain's transaction driver confirms persistence before its execution command can mint a Grant. Later receipts enter through Spectre.GAM.Kernel.Observation, not by evaluating the original Candidate again. This is the GAM separation between permission to act and evidence of what actually happened.

Summary

Functions

Evaluates one portable Candidate against one immutable projection snapshot.

Types

result()

@type result() ::
  {:ok, Spectre.GAM.Decision.t(), Spectre.GAM.Act.t() | nil} | {:error, term()}

Functions

evaluate(candidate, context, projection, time)

Evaluates one portable Candidate against one immutable projection snapshot.

Domain routing errors are rejected as API errors because they must not be written into the wrong ledger. Candidate claims that disagree with the authenticated principal or scope instead produce a refused Decision for the Domain to commit; the kernel itself still performs no durable write. An undeclared class produces :unknown_class; a declared class whose Row does not match the Candidate exactly is refused before authority resolution.