Definition and declaration validation for the operation runtime.
Loads the code-owned Spectre.Operation.Definition behind a committed loop
and enforces everything the definition declares: kind and version
compatibility, controller callbacks, security policy, branches, blockers,
waits, triggers, artifact policy and update fields.
Summary
Functions
Resolves the declared artifact retention limit.
Authorizes a control command against the definition security policy.
Fences a control command against the committed loop revision.
Loads and validates the current definition for a committed loop.
Requires the definition kind to match the requested loop kind.
Stamps definition-owned publication and correlation policy into metadata.
Validates artifact kinds and the retention limit for appended artifacts.
Validates a blocker against the declared blocker ids.
Validates a requested operation against declared branches.
Requires cognitive constraint updates to be maps.
Requires optional controller callbacks implied by the definition.
Validates a non-negative operation cost.
Validates a delivered trigger, always accepting correlated retry timers.
Validates loop origins, destinations and visibility against security policy.
Validates a non-negative integral page count.
Validates a request input against the operation spec, unless reconciling.
Validates a declared Vigil significance value.
Enforces the declared trigger correlation policy for the active wait.
Validates changed update fields against the declared update contract.
Validates a wait against the declared wait kinds.
Functions
@spec artifact_limit(Spectre.Operation.Definition.t()) :: pos_integer()
Resolves the declared artifact retention limit.
@spec authorize_control( Spectre.Operation.Definition.t(), Spectre.Operation.Control.Command.t() ) :: :ok | {:error, term()}
Authorizes a control command against the definition security policy.
@spec authorize_revision(Spectre.Operation.Loop.t(), non_neg_integer() | nil) :: :ok | {:error, term()}
Fences a control command against the committed loop revision.
@spec current_definition(Spectre.Operation.Loop.t()) :: {:ok, Spectre.Operation.Definition.t()} | {:error, term()}
Loads and validates the current definition for a committed loop.
@spec ensure_kind(Spectre.Operation.Definition.t(), Spectre.Operation.Loop.kind()) :: :ok | {:error, term()}
Requires the definition kind to match the requested loop kind.
@spec policy_metadata(map(), Spectre.Operation.Definition.t()) :: map()
Stamps definition-owned publication and correlation policy into metadata.
@spec validate_artifacts( Spectre.Operation.Definition.t(), Spectre.Operation.Loop.t(), [term()] ) :: :ok | {:error, term()}
Validates artifact kinds and the retention limit for appended artifacts.
@spec validate_blocker(Spectre.Operation.Definition.t(), term()) :: :ok | {:error, term()}
Validates a blocker against the declared blocker ids.
@spec validate_branch(Spectre.Operation.Definition.t(), Spectre.Operation.Request.t()) :: :ok | {:error, term()}
Validates a requested operation against declared branches.
Requires cognitive constraint updates to be maps.
@spec validate_controller_contract(Spectre.Operation.Definition.t(), module()) :: :ok | {:error, term()}
Requires optional controller callbacks implied by the definition.
Validates a non-negative operation cost.
@spec validate_delivered_trigger( Spectre.Operation.Definition.t(), Spectre.Operation.Loop.t(), term(), term() ) :: :ok | {:error, term()}
Validates a delivered trigger, always accepting correlated retry timers.
@spec validate_loop_security( Spectre.Operation.Definition.t(), Spectre.Operation.Loop.t() ) :: :ok | {:error, term()}
Validates loop origins, destinations and visibility against security policy.
Validates a non-negative integral page count.
@spec validate_request_input( Spectre.Operation.Spec.t(), Spectre.Operation.Request.t(), boolean() ) :: :ok | {:error, term()}
Validates a request input against the operation spec, unless reconciling.
@spec validate_significance(Spectre.Operation.Loop.kind(), term()) :: :ok | {:error, term()}
Validates a declared Vigil significance value.
@spec validate_trigger_correlation( Spectre.Operation.Definition.t(), Spectre.Operation.Wait.t() | nil, term(), term() ) :: {:ok, :exact | :legacy} | {:error, term()}
Enforces the declared trigger correlation policy for the active wait.
@spec validate_updated_fields(term(), term(), Spectre.Operation.Definition.t()) :: :ok | {:error, term()}
Validates changed update fields against the declared update contract.
@spec validate_wait(Spectre.Operation.Definition.t(), Spectre.Operation.Wait.t()) :: :ok | {:error, term()}
Validates a wait against the declared wait kinds.