Durable, idempotent command shared by operation and inference control lanes.
Summary
Functions
Marks the command as :applied, stamping completed_at with the current time.
Marks the command as :committed, stamping committed_at with the current time.
Builds a pending control command for loop_id.
Marks the command as :rejected with reason, stamping completed_at with
the current time.
Validates the command's identity, action, mode, timestamps and portability.
Types
@type t() :: %Spectre.Operation.Control.Command{ action: atom(), base_revision: non_neg_integer() | nil, causation_id: String.t() | nil, committed_at: non_neg_integer() | nil, completed_at: non_neg_integer() | nil, correlation_id: String.t(), desired_state: :active | :paused | :terminal | nil, id: String.t(), loop_id: String.t(), metadata: map(), mode: :safe | :immediate, payload: term(), provenance: map(), rejection: term(), requested_at: non_neg_integer(), status: :pending | :committed | :applied | :rejected }
Functions
Marks the command as :applied, stamping completed_at with the current time.
Marks the command as :committed, stamping committed_at with the current time.
Builds a pending control command for loop_id.
Operational loops accept :pause, :update, :resume, :stop, :renew,
:trigger and :update_and_resume. Inference control accepts :steer and
:cancel. Each runtime rejects commands from the other domain. The desired
state is derived from the action unless :desired_state is given. Missing
ids and requested_at default to fresh UUIDv7s and the current time. Raises
ArgumentError on an invalid mode.
Marks the command as :rejected with reason, stamping completed_at with
the current time.
Validates the command's identity, action, mode, timestamps and portability.
Returns :ok, or {:error, reason} naming the first invalid field or the
status whose timestamps are inconsistent.