PtcRunner.Kernel.ProviderDescriptor (PtcRunner v0.14.0)

Copy Markdown View Source

Sealed, declarative metadata for one installed provider implementation.

Descriptors contain no executable callback, credential value, endpoint, command, path, OAuth authority, store/context, grant, token manager, or principal. Phase 5 may therefore normalize selections and compute identity without consulting an implementation or crossing the provider-activity boundary.

local_preflight is a trust declaration rather than a capability flag. Only a shipped source may declare :audited_local, because that value permits phase 7 to run the callback behind it before provider activity is marked. A :custom registration declares :unverified instead, and its check becomes active work after the phase-8 marker. PtcRunner.Kernel.InstallationCatalog completes the rule: an :audited_local declaration also requires a host runtime binding. Both rules bound what may be declared; neither attests where an admitted implementation came from.

Summary

Functions

Projects the declared data policy a run-bound builder must honor.

Returns safe installed metadata suitable for models and contexts.

Validates and seals one provider declaration.

Projects only selector-safe declaration identity for one occurrence.

Checks the closed descriptor shape and construction seal.

Types

data_policy()

@type data_policy() :: %{
  data_class: :normal | :private_inspection,
  accepts_data: [:normal | :private_inspection]
}

source()

@type source() ::
  :mcp
  | :llm
  | :llm_replay
  | :ptc_trace_snapshot
  | :ptc_private_trace_snapshot
  | :ptc_inspection_snapshot
  | :custom

t()

@type t() :: %PtcRunner.Kernel.ProviderDescriptor{
  accepts_data: [:normal | :private_inspection],
  attestation: binary() | nil,
  authority_fingerprint: binary() | nil,
  authorization_mode: :none | :oauth,
  connectivity_mode: :none | :acquisition | :probe,
  credential_names: [binary()],
  data_class: :normal | :private_inspection,
  destinations: [:workflow | :mission],
  installation_revision: binary(),
  local_preflight: :none | :audited_local | :unverified,
  probe_effect: nil | :metadata | :completion,
  provides: [atom()],
  requires: [atom()],
  selection_rules: PtcRunner.Kernel.SelectionRules.t(),
  selection_validation: :declarative | :active,
  source: source(),
  workflow_llm?: boolean()
}

Functions

data_policy(descriptor)

@spec data_policy(t()) :: data_policy()

Projects the declared data policy a run-bound builder must honor.

Run-bound registries carry only this projection. A complete descriptor also holds selection rules, which are bounded but large enough that copying them into every provider worker would compete with the provider heap limit.

display_projection(descriptor, name)

@spec display_projection(t(), binary()) :: map()

Returns safe installed metadata suitable for models and contexts.

new(opts)

@spec new(keyword()) :: {:ok, t()} | {:error, :invalid_provider_descriptor}

Validates and seals one provider declaration.

public_projection(descriptor, name, normalized_config)

@spec public_projection(t(), binary(), map()) :: map()

Projects only selector-safe declaration identity for one occurrence.

valid?(descriptor)

@spec valid?(term()) :: boolean()

Checks the closed descriptor shape and construction seal.