Spectre.GAM.Outcome (Spectre v0.4.0)

Copy Markdown View Source

World-side observation associated with one durable attempt.

:ambiguous is distinct from failure. In particular, only :definitive_no_effect carries the semantic fact needed to safely release a reservation; a timeout or missing response must remain :ambiguous.

Summary

Functions

Returns the plain, string-keyed ledger representation.

Returns the content-derived outcome reference, independent of an assigned ref.

Returns true for a concrete late observation correcting a prior no-effect claim.

Returns true when Evidence proves that no external effect occurred.

Returns the stable digest of the complete outcome.

Returns the Evidence stance required for an Outcome status.

Restores an outcome from its canonical map.

Builds and validates an observed outcome.

Returns the exact, versioned proposition that Evidence for an Outcome must carry.

Types

status()

@type status() :: :succeeded | :failed | :definitive_no_effect | :ambiguous

t()

@type t() :: %Spectre.GAM.Outcome{
  act_ref: String.t(),
  attempt_ref: String.t(),
  contradicts_outcome_ref: String.t() | nil,
  details_ref: String.t(),
  evidence_refs: [String.t()],
  observed_at: integer(),
  ref: String.t(),
  schema_version: 1,
  status: status()
}

Functions

canonical(outcome)

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

Returns the plain, string-keyed ledger representation.

content_ref(outcome)

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

Returns the content-derived outcome reference, independent of an assigned ref.

correction?(outcome)

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

Returns true for a concrete late observation correcting a prior no-effect claim.

definitive_no_effect?(outcome)

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

Returns true when Evidence proves that no external effect occurred.

digest(outcome)

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

Returns the stable digest of the complete outcome.

evidence_stance(status)

@spec evidence_stance(status()) :: :supports

Returns the Evidence stance required for an Outcome status.

from_canonical(value)

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

Restores an outcome from its canonical map.

new(outcome)

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

Builds and validates an observed outcome.

proposition(status, act_ref, attempt_ref, executor_contract_ref)

@spec proposition(status(), String.t(), String.t(), String.t()) :: map()

Returns the exact, versioned proposition that Evidence for an Outcome must carry.