Spectre.GAM.Duty.Disposition (Spectre v0.4.0)

Copy Markdown View Source

Data-only proposal for disposing of one exact Duty opening.

for_duty/4 pins the cause and opening digest and names supporting Evidence and any requested Meter resolution. Construction neither closes the Duty nor authorizes that resolution. Submit through Spectre.GAM.dispose_duty/4; the kernel validates the disposition route, independence where required, and mechanical closing conditions before committing an Act.

Ratification, repudiation or accepting loss never rewrites the original cause.

Summary

Functions

Returns the portable disposition data bound into the Candidate's material.

Wraps the proposal for a Candidate; only a governed Act can dispose of the Duty.

Identifies choices requiring discretionary authority rather than a mechanically met condition.

Builds a disposition bound to the exact current opening of an open Duty.

Restores only the exact canonical representation, preserving scalar types and bindings.

Decodes the closed duty-disposition consequence without accepting additional commands.

Validates a disposition proposal's data, not its authorization or supporting Evidence.

Types

kind()

@type kind() ::
  :condition_met | :ratify | :repudiate | :compensate | :assign | :accept_loss

meter_resolution()

@type meter_resolution() :: :none | :settle | :release

t()

@type t() :: %Spectre.GAM.Duty.Disposition{
  cause_key: term(),
  duty_ref: String.t(),
  kind: kind(),
  meter_resolution: meter_resolution(),
  opening_digest: String.t(),
  schema_version: 1,
  supporting_refs: [String.t()]
}

Functions

canonical(disposition)

@spec canonical(t()) :: map()

Returns the portable disposition data bound into the Candidate's material.

consequence(disposition)

@spec consequence(t()) :: map()

Wraps the proposal for a Candidate; only a governed Act can dispose of the Duty.

discretionary?(disposition)

@spec discretionary?(t()) :: boolean()

Identifies choices requiring discretionary authority rather than a mechanically met condition.

for_duty(duty, kind, supporting_refs, meter_resolution \\ :none)

@spec for_duty(Spectre.GAM.Duty.t(), kind(), [String.t()], meter_resolution()) ::
  {:ok, t()} | {:error, term()}

Builds a disposition bound to the exact current opening of an open Duty.

from_canonical(value)

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

Restores only the exact canonical representation, preserving scalar types and bindings.

from_consequence(consequence)

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

Decodes the closed duty-disposition consequence without accepting additional commands.

new(disposition)

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

Validates a disposition proposal's data, not its authorization or supporting Evidence.