Jidoka.Agent.Spec.Operation (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Model-callable operation definition.

Summary

Functions

Returns the operation kind used for control matching and policy checks.

Returns true when a recorded intent may be retried without reconciliation.

Returns true when this operation requires an explicit operation control.

Types

idempotency()

@type idempotency() :: :pure | :idempotent | :dedupe | :reconcile | :unsafe_once

t()

@type t() :: %Jidoka.Agent.Spec.Operation{
  description: nil | nil | binary(),
  idempotency:
    (:pure | :idempotent | :dedupe | :reconcile | :unsafe_once) | binary(),
  metadata: map(),
  name: binary()
}

Functions

from_input(operation)

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

kind(operation)

@spec kind(t()) :: atom()

Returns the operation kind used for control matching and policy checks.

Direct operations default to :operation. Adapters can set :kind, :operation_kind, :source_kind, :runtime, or :source metadata to expose a more precise kind while preserving one operation contract.

new(attrs)

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

new!(attrs)

@spec new!(keyword() | map()) :: t()

replay_safe?(arg1)

@spec replay_safe?(t() | idempotency()) :: boolean()

Returns true when a recorded intent may be retried without reconciliation.

requires_control?(arg1)

@spec requires_control?(t() | idempotency()) :: boolean()

Returns true when this operation requires an explicit operation control.

schema()

@spec schema() :: Zoi.schema()

valid_idempotencies()

@spec valid_idempotencies() :: [idempotency()]