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

Copy Markdown View Source

Disposable state derived from a verified governed history.

This struct is a read model, never an authority store. Every field can be rebuilt from the append-only ledger through Spectre.GAM.GovernedAct.Fold. Keeping the container separate from the reducer lets transition modules share one explicit shape without turning the fold itself into a mutable domain object.

Governed declarations live together in Spectre.GAM.GovernedAct.Catalog; execution, information lineage and accounting stay on this state. Both containers have fixed shapes and share their immutable records, but their historical collections still grow with the Domain. This is not a bounded hot cache or a trusted snapshot that can bypass ledger verification.

Summary

Functions

Returns the current HostProfile from its single historical collection.

Creates an empty read model; it contains no recognized Genesis, authority or execution history.

Returns the current Surface from its single historical collection.

Types

admission()

@type admission() :: %{decision_ref: String.t(), act_ref: String.t() | nil}

dispatch_cancellation()

@type dispatch_cancellation() :: Spectre.GAM.GovernedAct.DispatchState.cancellation()

meter_recontainment()

@type meter_recontainment() :: %{
  outcome_ref: String.t(),
  cause_key: term(),
  recontained: %{optional(String.t()) => pos_integer()},
  deficits: %{optional(String.t()) => pos_integer()},
  disposition_act_ref: String.t() | nil
}

meter_reservation()

@type meter_reservation() :: %{
  mandate_ref: String.t(),
  amounts: %{optional(String.t()) => non_neg_integer()},
  status: reservation_status()
}

reservation_status()

@type reservation_status() :: :reserved | :suspended | :settled | :released

t()

@type t() :: %Spectre.GAM.GovernedAct.State{
  acts: %{optional(String.t()) => Spectre.GAM.Act.t()},
  admissions: %{optional(String.t()) => admission()},
  attempts: %{optional(String.t()) => Spectre.GAM.Attempt.t()},
  catalog: Spectre.GAM.GovernedAct.Catalog.t(),
  constitution: map(),
  consumed_nonces: MapSet.t(String.t()),
  decisions: %{optional(String.t()) => Spectre.GAM.Decision.t()},
  declassifications: %{optional(String.t()) => Spectre.GAM.Declassification.t()},
  declassifications_by_evidence: %{optional(String.t()) => String.t()},
  domain_ref: String.t(),
  duties: %{optional(term()) => Spectre.GAM.Duty.t()},
  duty_meter_resolutions: MapSet.t(String.t()),
  erasures: %{optional(String.t()) => Spectre.GAM.Erasure.t()},
  event_metadata: %{
    optional(String.t()) => Spectre.GAM.Domain.Event.Metadata.t()
  },
  evidence: %{optional(String.t()) => Spectre.GAM.Evidence.t()},
  head_digest: String.t(),
  mandate_successors: %{optional(String.t()) => String.t()},
  mandates: %{optional(String.t()) => Spectre.GAM.Mandate.t()},
  meter_devolutions: MapSet.t(String.t()),
  meter_owner_aliases: %{optional(String.t()) => String.t()},
  meter_recontainments: %{optional(String.t()) => meter_recontainment()},
  meter_reservations: %{optional(String.t()) => reservation_status()},
  meters: %{optional(String.t()) => Spectre.GAM.Kernel.Meter.accounts()},
  outcomes: %{optional(String.t()) => Spectre.GAM.Outcome.t()},
  pending_dispatches: MapSet.t(String.t()),
  presentations: %{optional(String.t()) => Spectre.GAM.Presentation.t()},
  read_index: Spectre.GAM.GovernedAct.ReadIndex.t(),
  recorded_at: non_neg_integer(),
  revision: non_neg_integer(),
  revocations: %{optional(String.t()) => Spectre.GAM.Mandate.Revocation.t()},
  terminal_dispatches: %{
    optional(String.t()) => Spectre.GAM.GovernedAct.DispatchState.terminal()
  }
}

Functions

host_profile(state)

@spec host_profile(t()) :: Spectre.GAM.HostProfile.t() | nil

Returns the current HostProfile from its single historical collection.

new(domain_ref, constitution \\ %{})

@spec new(String.t(), map()) :: t()

Creates an empty read model; it contains no recognized Genesis, authority or execution history.

surface(state)

@spec surface(t()) :: Spectre.GAM.Surface.t() | nil

Returns the current Surface from its single historical collection.