Spectre.GAM.Kernel.Decision (Spectre v0.4.0)

Copy Markdown View Source

Pure admission decision for one classified Candidate.

This module joins four already-separated inputs: a typed Candidate, the result of authority resolution, Recognition's factual result and a typed snapshot of Meter/foundation state. It performs no I/O, mints no Grant and mutates no projection. Its output is the portable attribute map accepted by the durable Spectre.GAM.Decision record.

Authority narrowing is represented by Spectre.GAM.Kernel.Authority.Effective; it is never guessed from a generic map. Likewise environmental fields live in Spectre.GAM.Kernel.Decision.Context. These two containers keep the decision boundary explicit without turning it into another stateful subsystem.

The four outcomes intentionally remain distinct:

  • :admitted -- authority, facts and resources cover the Candidate;
  • :refused -- a known rule definitively denies it;
  • :undecidable -- required or consistent information is unavailable;
  • :unknown_class -- the governed Surface cannot classify it.

Summary

Functions

Decides whether candidate can be admitted at trusted time.

Types

outcome()

@type outcome() :: :admitted | :refused | :undecidable | :unknown_class

recognition()

@type recognition() ::
  :satisfied | {:unsatisfied, [term()]} | {:undecidable, [term()]} | nil

t()

@type t() :: %{
  :outcome => outcome(),
  :reasons => [term()],
  :decided_at => integer(),
  :recognition_evidence_refs => [String.t()],
  :reservations => map(),
  optional(atom()) => term()
}

Functions

decide(candidate, resolution, recognition, context, time)

Decides whether candidate can be admitted at trusted time.

The full authority resolution is accepted so ambiguity cannot be collapsed by accidentally selecting the first eligible Mandate.