PtcRunner.Kernel.ProviderSnapshot (PtcRunner v0.14.0)

Copy Markdown View Source

Builds the closed selector-safe public identity for an acquired provider.

The declaration projection is operator-authored safe behavior identity. The acquisition projection contains only bounded facts captured from the active provider. Unattested selectors, endpoints, commands, paths, credentials, OAuth authority, and identifiers derived from secret-bearing values are never admitted. An adapter may explicitly attest its exact model target as public. Audited executable and launcher content digests may be included as non-secret build identity without exposing their paths.

llm_identity/1 extracts model attribution from a complete current LLM snapshot, including declaration config that carries max_calls. It also accepts the previous three-key config so already-captured traces stay attributable. Malformed or private snapshots return no attribution and remain loadable by the canonical trace boundary.

Summary

Functions

Extracts {alias, installation revision, resolved model} from one valid current LLM provider snapshot.

Functions

build(descriptor, name, config, acquisition, content_snapshot_hash \\ nil, installation_config_digest \\ nil)

@spec build(
  PtcRunner.Kernel.ProviderDescriptor.t(),
  binary(),
  map(),
  map(),
  binary() | nil,
  binary() | nil
) :: {:ok, map()} | {:error, :invalid_provider_snapshot}

llm_identity(snapshot)

@spec llm_identity(term()) ::
  {:ok,
   %{alias: binary(), installation_revision: binary(), resolved_model: binary()}}
  | :error

Extracts {alias, installation revision, resolved model} from one valid current LLM provider snapshot.

Hash verification detects inconsistent or edited trace data; the hashes are not signatures. Invalid and private snapshots return :error. A current snapshot whose declaration config omits max_calls remains attributable.