Spectre.GAM.GovernedAct.View (Spectre v0.4.0)

Copy Markdown View Source

Pure read operations over folded governed state.

The fold owns transitions; this module owns derived views and exact lookups. Keeping them separate prevents query convenience from becoming part of the authority state and lets the kernel, Domain facade and recovery reuse the same calculations without duplicating indexes or policy.

Summary

Functions

Returns the authority-only facts consumed by resolution.

Returns consequence digests held by unresolved containment Duties.

Returns Mandates blocked by unresolved Meter recontainment deficits.

Looks up the durable Decision selected by a Candidate identity key.

Looks up the Act paired with a durable Decision.

Looks up one immutable governed Definition by its exact content reference.

Looks up a Duty by idempotent cause key or durable reference.

Fetches an Evidence set in caller order.

Returns physical Meter accounts for a logical Mandate revision.

Validates an observation, allowing only exact Presentation responses from another authenticated recipient.

Checks an authenticated context against its durable Scope opening.

Functions

authority(state)

Returns the authority-only facts consumed by resolution.

blocked_effect_digests(state)

@spec blocked_effect_digests(Spectre.GAM.GovernedAct.State.t()) ::
  MapSet.t(String.t())

Returns consequence digests held by unresolved containment Duties.

blocked_mandate_refs(state)

@spec blocked_mandate_refs(Spectre.GAM.GovernedAct.State.t()) :: MapSet.t(String.t())

Returns Mandates blocked by unresolved Meter recontainment deficits.

candidate_decision(state, identity_key)

@spec candidate_decision(Spectre.GAM.GovernedAct.State.t(), String.t()) ::
  {:ok, Spectre.GAM.Decision.t()} | :not_found | {:error, term()}

Looks up the durable Decision selected by a Candidate identity key.

decision_act(state, decision)

@spec decision_act(Spectre.GAM.GovernedAct.State.t(), Spectre.GAM.Decision.t()) ::
  {:ok, Spectre.GAM.Act.t() | nil} | {:error, term()}

Looks up the Act paired with a durable Decision.

definition(state, ref)

@spec definition(Spectre.GAM.GovernedAct.State.t(), String.t()) ::
  {:ok, Spectre.GAM.Definition.t()} | {:error, term()}

Looks up one immutable governed Definition by its exact content reference.

duty(state, arg2)

@spec duty(
  Spectre.GAM.GovernedAct.State.t(),
  {:cause_key, term()} | {:ref, String.t()}
) ::
  {:ok, Spectre.GAM.Duty.t()} | :not_found | {:error, :invalid_duty_lookup}

Looks up a Duty by idempotent cause key or durable reference.

evidence_set(state, refs)

@spec evidence_set(Spectre.GAM.GovernedAct.State.t(), [String.t()]) ::
  {:ok, [term()]} | {:error, term()}

Fetches an Evidence set in caller order.

meter_accounts(state, mandate_ref)

@spec meter_accounts(Spectre.GAM.GovernedAct.State.t(), String.t()) ::
  {:ok, Spectre.GAM.Kernel.Meter.accounts()} | {:error, term()}

Returns physical Meter accounts for a logical Mandate revision.

observation_context(state, context, evidence)

Validates an observation, allowing only exact Presentation responses from another authenticated recipient.

scope_context(state, context)

Checks an authenticated context against its durable Scope opening.