Pristine.RuntimeCapabilities (Pristine v0.4.0)

Copy Markdown View Source

Provider-neutral discovery for the configured runtime transport contract.

Capability discovery is fail-closed. A missing callback, absent capability, malformed advertisement, or callback failure is reported as :unverified. Explicit false/:unsupported is reported as :unsupported.

A capability advertisement is a transport adapter's declared contract. For Pristine-owned adapters, :supported is only published after Pristine's own acceptance tests prove the behavior. Third-party adapter authors remain responsible for conformance with their declarations.

Capability callbacks must be side-effect free and must never return request bodies, credentials, headers, or other context secrets.

Summary

Functions

Return true only when a transport positively advertises a capability.

Inspect the configured unary transport without performing a request.

Types

capability()

@type capability() :: %{
  :status => capability_status(),
  optional(:value) => non_neg_integer()
}

capability_status()

@type capability_status() :: :supported | :unsupported | :unverified

transport_capabilities()

@type transport_capabilities() :: %{
  adapter: module() | nil,
  capabilities: %{optional(atom()) => capability()}
}

Functions

supported?(source, capability)

@spec supported?(Pristine.Core.Context.t() | Pristine.Client.t(), atom()) :: boolean()

Return true only when a transport positively advertises a capability.

transport(context)

Inspect the configured unary transport without performing a request.