Spectre.GAM.Audit.Report (Spectre v0.4.0)

Copy Markdown View Source

Pure renderer for a verified governed history.

Reports are derived only after Spectre.GAM.GovernedAct.Integrity succeeds. The renderer never validates or repairs history and never reads runtime state; its input is the disposable result of replaying the exported ledger.

Recorded open_duties are kept separate from pending_duty_causes derived after capture. Likewise, expired_dispatches describe pending deliveries that expire by observation time, not cancellations that were committed. Counts and Meter accounts always describe the captured ledger, not a simulated repair. These distinctions preserve an export's causal history.

Summary

Functions

Builds the portable semantic audit report from verified folded state.

Builds an observation report without mutating the verified captured state.

Types

t()

@type t() :: %{
  format: String.t(),
  format_version: pos_integer(),
  domain_ref: String.t(),
  ledger_revision: non_neg_integer(),
  head_digest: String.t(),
  constitution_ref: String.t(),
  audited_at: non_neg_integer(),
  captured_at: non_neg_integer(),
  foundation: map(),
  act_contexts: [map()],
  meters: map(),
  meter_owners: map(),
  mandate_restrictions: [map()],
  meter_recontainments: [map()],
  dispatch_cancellations: [map()],
  open_duties: [map()],
  pending_duty_causes: [Spectre.GAM.Duty.Derive.cause()],
  expired_dispatches: [map()],
  scopes: [map()],
  definitions: [map()],
  definition_heads: [map()],
  declassifications: [map()],
  erasures: [map()],
  counts: map()
}

Functions

build(state, audited_at)

@spec build(Spectre.GAM.GovernedAct.State.t(), non_neg_integer()) ::
  {:ok, t()} | {:error, term()}

Builds the portable semantic audit report from verified folded state.

build(state, captured_at, audited_at)

@spec build(Spectre.GAM.GovernedAct.State.t(), non_neg_integer(), non_neg_integer()) ::
  {:ok, t()} | {:error, term()}

Builds an observation report without mutating the verified captured state.