Closed registry of pure, portable consequence validators.
A Spectre.GAM.Surface records one validator identifier for every declared
consequence class. The identifier, rather than a module or callback, is
durable data: admission and an independent auditor can therefore replay the
same rule without executing application code from the ledger.
Ordinary application classes use none/0; their complete material shape is
still enforced by Spectre.GAM.Consequence.Contract. Validators in this module
exist only for core transitions whose validity depends on the current
projection or trusted time. Their immutable class binding comes from
Spectre.GAM.GovernedAct.Class, not from a callback named in ledger data.
Summary
Functions
Returns the built-in default recorded for a class by a new Surface.
Identifier for classes whose contract needs no projection-dependent rule.
Applies the validator selected by the active Surface.
Validates the immutable class-to-validator binding recorded by a Surface.
Validates that an identifier names a deterministic built-in rule.
Checks an admitted intrinsic transition against a provisional projection.
Types
@type id() :: String.t()
Functions
Returns the built-in default recorded for a class by a new Surface.
@spec none() :: id()
Identifier for classes whose contract needs no projection-dependent rule.
@spec validate(id(), Spectre.GAM.Candidate.t(), map(), integer()) :: :ok | {:error, term()}
Applies the validator selected by the active Surface.
Validates the immutable class-to-validator binding recorded by a Surface.
Validates that an identifier names a deterministic built-in rule.
@spec validate_transition( id(), Spectre.GAM.Candidate.t(), Spectre.GAM.Decision.t(), Spectre.GAM.Act.t(), Spectre.GAM.GovernedAct.State.t() ) :: :ok | {:error, term()}
Checks an admitted intrinsic transition against a provisional projection.