ExGAM.Domain.Event.Builder (ExGAM v0.1.0)

Copy Markdown View Source

Canonical constructors for Domain event envelopes.

Builders validate records and causal bindings before producing the plain maps accepted by the ledger writer. Decoding and acquisition-time checks remain in ExGAM.Domain.Event; this module contains no replay semantics.

Summary

Functions

Encodes a governed Definition revision; publishing data alone does not activate it.

Encodes the causal cancellation of a pending dispatch, not cancellation of an already-attempted effect.

Encodes readiness for a committed world Act; creating this map does not mint a Grant.

Links disposal of the exact causal opening to its disposition Act; the fold verifies the closing route.

Links a HostProfile revision to its predecessor and governance Act, without proving deployment isolation.

Links a subtractive Mandate successor to its predecessor and governance Act.

Binds revocation to the governance Act's effective time without changing past Acts or observations.

Encodes the Act's exact reservation movement; the fold verifies the permitted accounting transition.

Encodes return of child allocation; ancestry and available quantity remain fold checks.

Binds a Meter resolution to its cause, open Duty and disposition Act; does not authorize disposal.

Encodes recontainment and its deficit after Evidence contradicts a no-effect Outcome.

Encodes Principal registration under an Act, not authentication or a new Mandate.

Validates a typed record and encodes its envelope; authorization and batch completeness remain fold checks.

Encodes a validated Scope opening; parent authority and promise semantics remain governed checks.

Links a Surface successor and its exact predecessor to the governance Act.

Functions

definition_revised(act, definition)

@spec definition_revised(ExGAM.Act.t(), ExGAM.Definition.t()) ::
  {:ok, map()} | {:error, term()}

Encodes a governed Definition revision; publishing data alone does not activate it.

dispatch_cancelled(act, cause_act, reason)

@spec dispatch_cancelled(
  ExGAM.Act.t(),
  ExGAM.Act.t() | ExGAM.Duty.t() | ExGAM.Mandate.t(),
  atom()
) ::
  {:ok, map()} | {:error, term()}

Encodes the causal cancellation of a pending dispatch, not cancellation of an already-attempted effect.

dispatch_ready(act)

@spec dispatch_ready(ExGAM.Act.t()) :: map()

Encodes readiness for a committed world Act; creating this map does not mint a Grant.

duty_disposed(disposition_act, cause_key)

@spec duty_disposed(ExGAM.Act.t(), term()) :: {:ok, map()} | {:error, term()}

Links disposal of the exact causal opening to its disposition Act; the fold verifies the closing route.

host_profile_revised(act, previous_ref, profile)

@spec host_profile_revised(ExGAM.Act.t(), String.t(), ExGAM.HostProfile.t()) ::
  {:ok, map()} | {:error, term()}

Links a HostProfile revision to its predecessor and governance Act, without proving deployment isolation.

mandate_restricted(act, predecessor_ref, successor)

@spec mandate_restricted(ExGAM.Act.t(), String.t(), ExGAM.Mandate.t()) ::
  {:ok, map()} | {:error, term()}

Links a subtractive Mandate successor to its predecessor and governance Act.

mandate_revoked(act, mandate_ref)

@spec mandate_revoked(ExGAM.Act.t(), String.t()) :: {:ok, map()} | {:error, term()}

Binds revocation to the governance Act's effective time without changing past Acts or observations.

meter(operation, act)

@spec meter(:reserve | :settle | :release | :suspend, ExGAM.Act.t()) ::
  {:ok, map()} | {:error, term()}

Encodes the Act's exact reservation movement; the fold verifies the permitted accounting transition.

meter_devolved(act, child_mandate_ref, amounts)

@spec meter_devolved(ExGAM.Act.t(), String.t(), map()) ::
  {:ok, map()} | {:error, term()}

Encodes return of child allocation; ancestry and available quantity remain fold checks.

meter_duty_resolved(cause_act, disposition_act, duty, operation, amounts)

@spec meter_duty_resolved(
  ExGAM.Act.t(),
  ExGAM.Act.t(),
  ExGAM.Duty.t(),
  :settle | :release,
  map()
) :: {:ok, map()} | {:error, term()}

Binds a Meter resolution to its cause, open Duty and disposition Act; does not authorize disposal.

meter_recontained(act, outcome, recontained, deficits)

@spec meter_recontained(ExGAM.Act.t(), ExGAM.Outcome.t(), map(), map()) ::
  {:ok, map()} | {:error, term()}

Encodes recontainment and its deficit after Evidence contradicts a no-effect Outcome.

principal_registered(act, principal)

@spec principal_registered(ExGAM.Act.t(), ExGAM.Principal.t()) ::
  {:ok, map()} | {:error, term()}

Encodes Principal registration under an Act, not authentication or a new Mandate.

record(kind, record)

@spec record(atom(), struct()) :: {:ok, map()} | {:error, term()}

Validates a typed record and encodes its envelope; authorization and batch completeness remain fold checks.

scope_opened(opening)

@spec scope_opened(ExGAM.Scope.Opening.t()) :: {:ok, map()} | {:error, term()}

Encodes a validated Scope opening; parent authority and promise semantics remain governed checks.

surface_revised(act, previous_ref, surface)

@spec surface_revised(ExGAM.Act.t(), String.t(), ExGAM.Surface.t()) ::
  {:ok, map()} | {:error, term()}

Links a Surface successor and its exact predecessor to the governance Act.