ExGAM.Audit.Export (ExGAM v0.1.0)

Copy Markdown View Source

Self-contained, canonical input for an independent semantic audit.

An export contains only the portable Domain ledger, the exact Constitution whose digest is pinned by Genesis, and the trusted Domain time at which the export was captured. It contains no projection, Grant, credential, process identifier or store configuration.

Summary

Functions

Decodes and validates a canonical audit export without creating atoms.

Encodes an audit export with the deterministic ExGAM value codec.

Validates an already decoded audit export.

Builds and validates a self-contained audit export.

Runs the independent semantic auditor over an export.

Types

t()

@type t() :: %{required(String.t()) => term()}

Functions

decode(encoded, opts \\ [])

@spec decode(binary(), keyword()) :: {:ok, t()} | {:error, term()}

Decodes and validates a canonical audit export without creating atoms.

encode(data, opts \\ [])

@spec encode(t(), keyword()) :: {:ok, binary()} | {:error, term()}

Encodes an audit export with the deterministic ExGAM value codec.

from_data(data)

@spec from_data(map()) :: {:ok, t()} | {:error, term()}

Validates an already decoded audit export.

new(ledger, constitution, exported_at)

@spec new(map(), map(), non_neg_integer()) :: {:ok, t()} | {:error, term()}

Builds and validates a self-contained audit export.

verify(export, audited_at \\ nil, codec_opts \\ [])

@spec verify(t() | binary(), non_neg_integer() | nil, keyword()) ::
  {:ok, ExGAM.Audit.report()} | {:error, term()}

Runs the independent semantic auditor over an export.