# `Spectre.GAM.Kernel.Decision`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/kernel/decision.ex#L1)

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.

# `outcome`

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

# `recognition`

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

# `t`

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

# `decide`

```elixir
@spec decide(
  Spectre.GAM.Candidate.t(),
  Spectre.GAM.Kernel.Authority.resolution(),
  recognition(),
  Spectre.GAM.Kernel.Decision.Context.t(),
  integer()
) :: t()
```

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
