Spectre.GAM.Execution.Boundary (Spectre v0.4.0)

Copy Markdown View Source

Normalizes and validates the host execution boundary shared by Domain boot, the executor Runner and Doctor.

Executor and broker callbacks expose stable identifiers only. Adapter options remain host-local and are deliberately omitted from describe/1, because they may contain credentials or other operational material that must never enter a diagnostic report or the ledger.

Summary

Functions

Returns a deterministic, credential-free description of a normalized boundary.

Invokes a validated executor or broker callback without exposing its failure payload.

Normalizes the configured executor routes and credential broker.

Checks whether a broker profile is at least as strong as the declared profile.

Validates the stable descriptor passed from the Sequencer to an executor runner.

Validates the exact host-only route passed across the Sequencer boundary.

Types

broker()

@type broker() :: %{
  broker: module(),
  broker_opts: keyword(),
  descriptor: %{ref: String.t(), profile: atom()}
}

route()

@type route() :: %{executor: module(), executor_opts: keyword()}

route_key()

@type route_key() :: {String.t(), String.t()}

runtime_route()

@type runtime_route() :: %{
  executor: module(),
  executor_opts: keyword(),
  broker: module(),
  broker_opts: keyword(),
  broker_descriptor: map()
}

t()

@type t() :: %{routes: %{optional(route_key()) => route()}, broker: broker() | nil}

Functions

describe(map)

@spec describe(t()) :: map()

Returns a deterministic, credential-free description of a normalized boundary.

invoke(module, callback, arguments)

@spec invoke(module(), atom(), [term()]) ::
  {:ok, term()} | {:error, :exception | :exit | :throw}

Invokes a validated executor or broker callback without exposing its failure payload.

normalize(executors, broker)

@spec normalize(term(), term()) :: {:ok, t()} | {:error, term()}

Normalizes the configured executor routes and credential broker.

profile_covers?(actual, required)

@spec profile_covers?(atom(), atom()) :: boolean()

Checks whether a broker profile is at least as strong as the declared profile.

validate_broker_descriptor(descriptor)

@spec validate_broker_descriptor(term()) :: :ok | {:error, :invalid_broker_descriptor}

Validates the stable descriptor passed from the Sequencer to an executor runner.

validate_runtime_route(route)

@spec validate_runtime_route(term()) :: :ok | {:error, term()}

Validates the exact host-only route passed across the Sequencer boundary.