Spectre.GAM.Duty (Spectre v0.4.0)

Copy Markdown View Source

Durable normative debt derived from unresolved canonical facts.

cause_key is the idempotency key for materializing a required duty. A duty never expires by timer, restart or deployment. A disposed projection must point at the later Act that authorized its disposition; the original cause and evidence remain unchanged. conflict_refs freezes both interested principals and the causal Mandate reference so independence can be verified from the ledger rather than inferred from the current configuration.

Spectre.GAM.Duty.Derive is the pure cause-family facade. Commit materializes missing causes idempotently, while GovernedAct.Transition.Duty proves and replays disposition. The record itself contains no scheduler or policy callback.

Summary

Functions

Returns the plain, string-keyed ledger representation.

Returns the stable reference derived only from the idempotent cause key.

Returns the stable digest of the complete duty projection.

Restores a duty from its canonical map.

Builds and validates a duty projection.

Types

class()

@type class() ::
  :ambiguous_outcome
  | :contradicted_outcome
  | :disputed_evidence
  | :scope_promise_overdue
  | :erasure_reduces_verifiability
  | String.t()

t()

@type t() :: %Spectre.GAM.Duty{
  accountable: String.t(),
  act_ref: String.t() | nil,
  attempt_ref: String.t() | nil,
  cause_key: term(),
  class: class(),
  closing_conditions: [term()],
  conflict_refs: [String.t()],
  containment: term(),
  disposition_act_ref: String.t() | nil,
  disposition_authority_refs: [String.t()],
  evidence_refs: [String.t()],
  mandate_ref: String.t() | nil,
  missing: [term()],
  opened_at: integer(),
  ref: String.t(),
  schema_version: 1,
  status: :open | :disposed,
  subjects: [String.t()]
}

Functions

canonical(duty)

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

Returns the plain, string-keyed ledger representation.

content_ref(duty)

@spec content_ref(t()) :: String.t()

Returns the stable reference derived only from the idempotent cause key.

digest(duty)

@spec digest(t()) :: String.t()

Returns the stable digest of the complete duty projection.

from_canonical(value)

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

Restores a duty from its canonical map.

new(duty)

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

Builds and validates a duty projection.