Python API

Action contracts

Validate an action against its versioned contract before admission. A valid envelope still needs Supervisor checks and an executing environment. Target-state v4 stages a combined request as pose-first, conditional-gripper phases.

from ora.contracts.action import (
    ActionValidationError,
    validate_runtime_action,
    target_state_phases,
)

ActionValidationError

class ActionValidationError(ValueError)

Raised before an untrusted action reaches the execution bridge.

validate_runtime_action

validate_runtime_action(payload: Any) -> dict[str, Any]

Validate the thin Harness action after trusted identity binding.

target_state_phases

target_state_phases(payload: Mapping[str, Any]) -> list[dict[str, Any]]

Expand one validated v4 target state into ordered v3 backend phases. A motion v3 move_pose may carry an optional speed: the end-effector speed the move asks for (a preset, speed_m_s, slow_approaching). A call that names none carries no speed and runs at the default; see Motion speed and wrist checks.

from ora.contracts.motion_speed import speed_request, validate_speed

speed_request

speed_request(
    arguments: Mapping[str, Any],
) -> tuple[dict[str, Any] | None, dict[str, Any]]

The validated speed of a call, in wire form, and the arguments without the speed fields.

None when the call names no speed option (each null counts as omitted). Raises SpeedArgumentError. Example: speed_request({"speed": "normal"})[0] == {"speed": "normal", "slow_approaching": False}.

validate_speed

validate_speed(value: Any) -> dict[str, Any]

The normalized wire form of a speed request; raises ValueError on anything else.

Example: validate_speed({"speed": "custom", "speed_m_s": 0.2, "slow_approaching": True}). Runtime lifecycle and authority

Source: docs/api/actions.md