Backplane.AgentRuntime.Command behaviour (backplane_agent_runtime v1.10.17)

Copy Markdown

Authorized command execution with environment allowlists and output caps.

Shell interpretation is a separate capability. This module never claims OS sandbox guarantees; supported cleanup is declared by the CommandPort backend.

Summary

Functions

Acknowledge consumed cleanup evidence so a backend may retire its pinned receipt.

Reserve a trusted session before launch; legacy adapters retain uncertain cleanup semantics.

Host-verified PTY dimensions for this platform, or an unsupported capability error.

Validate backend-issued proof of non-execution; error metadata alone is not proof.

Types

t()

@type t() :: map()

Callbacks

acknowledge_release(map, map)

(optional)
@callback acknowledge_release(map(), map()) ::
  :ok | {:error, Backplane.AgentRuntime.Error.t()}

cancel(map, map)

@callback cancel(map(), map()) :: :ok | {:error, Backplane.AgentRuntime.Error.t()}

cancel_confirmed(map, map, pos_integer)

(optional)
@callback cancel_confirmed(map(), map(), pos_integer()) ::
  :ok | {:error, Backplane.AgentRuntime.Error.t()}

capabilities(map)

(optional)
@callback capabilities(map()) :: map()

read(map, map, map, keyword)

@callback read(map(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

reserve(map, map)

(optional)
@callback reserve(map(), map()) :: :ok | {:error, Backplane.AgentRuntime.Error.t()}

start(map, map, keyword)

@callback start(map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

validate_refusal(map, map, t)

(optional)
@callback validate_refusal(map(), map(), Backplane.AgentRuntime.Error.t()) ::
  :ok | {:error, Backplane.AgentRuntime.Error.t()}

write(map, map, map, binary)

(optional)
@callback write(map(), map(), map(), binary()) ::
  :ok | {:error, Backplane.AgentRuntime.Error.t()}

Functions

acknowledge_release(command, invocation)

Acknowledge consumed cleanup evidence so a backend may retire its pinned receipt.

cancel(command, invocation)

@spec cancel(t(), map()) :: :ok | {:error, Backplane.AgentRuntime.Error.t()}

cancel_confirmed(command, invocation, timeout)

@spec cancel_confirmed(t(), map(), pos_integer()) ::
  :ok | {:error, Backplane.AgentRuntime.Error.t()}

new(namespace)

@spec new(map()) :: {:ok, t()} | {:error, Backplane.AgentRuntime.Error.t()}

read(command, invocation, job, opts \\ [])

@spec read(t(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

reserve(command, invocation)

Reserve a trusted session before launch; legacy adapters retain uncertain cleanup semantics.

start(command, invocation, opts \\ [])

@spec start(t(), map(), keyword()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

terminal(command)

Host-verified PTY dimensions for this platform, or an unsupported capability error.

validate_refusal(command, invocation, error)

Validate backend-issued proof of non-execution; error metadata alone is not proof.

workspace_conflict?(arg1, arg2)

write(command, invocation, job, chars)

@spec write(t(), map(), map(), binary()) ::
  :ok | {:error, Backplane.AgentRuntime.Error.t()}