ExGAM.GovernedAct.State (ExGAM v0.1.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 ExGAM.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 ExGAM.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() :: ExGAM.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() :: %ExGAM.GovernedAct.State{
  acts: %{optional(String.t()) => ExGAM.Act.t()},
  admissions: %{optional(String.t()) => admission()},
  attempts: %{optional(String.t()) => ExGAM.Attempt.t()},
  catalog: ExGAM.GovernedAct.Catalog.t(),
  constitution: map(),
  consumed_nonces: MapSet.t(String.t()),
  decisions: %{optional(String.t()) => ExGAM.Decision.t()},
  declassifications: %{optional(String.t()) => ExGAM.Declassification.t()},
  declassifications_by_evidence: %{optional(String.t()) => String.t()},
  domain_ref: String.t(),
  duties: %{optional(term()) => ExGAM.Duty.t()},
  duty_meter_resolutions: MapSet.t(String.t()),
  erasures: %{optional(String.t()) => ExGAM.Erasure.t()},
  event_metadata: %{optional(String.t()) => ExGAM.Domain.Event.Metadata.t()},
  evidence: %{optional(String.t()) => ExGAM.Evidence.t()},
  head_digest: String.t(),
  mandate_successors: %{optional(String.t()) => String.t()},
  mandates: %{optional(String.t()) => ExGAM.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()) => ExGAM.Kernel.Meter.accounts()},
  outcomes: %{optional(String.t()) => ExGAM.Outcome.t()},
  pending_dispatches: MapSet.t(String.t()),
  presentations: %{optional(String.t()) => ExGAM.Presentation.t()},
  read_index: ExGAM.GovernedAct.ReadIndex.t(),
  recorded_at: non_neg_integer(),
  revision: non_neg_integer(),
  revocations: %{optional(String.t()) => ExGAM.Mandate.Revocation.t()},
  terminal_dispatches: %{
    optional(String.t()) => ExGAM.GovernedAct.DispatchState.terminal()
  }
}

Functions

host_profile(state)

@spec host_profile(t()) :: ExGAM.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()) :: ExGAM.Surface.t() | nil

Returns the current Surface from its single historical collection.