# `PtcRunner.Kernel.InstallationCatalog`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/kernel/installation_catalog.ex#L1)

Inert provider declarations paired with trusted implementations.

Phase 5 reads only `descriptors`; process-free implementations remain sealed
for later active phases. Credential access is supplied separately through
`PtcRunner.Kernel.ProviderRuntimeServices` when execution opens.
Host-backed catalogs carry an opaque keyed binding so runtime services from
a different host document are rejected before activation.
Run-bound registry construction receives the exact selected aliases and
their already-anchored operation deadline; unselected implementations and
OAuth authorities never enter that registry. The two-argument embedding
adapter intentionally opens the complete catalog under its own bounded
activation deadline because it has no run selection.
Catalog construction checks that active validators, connectivity probes, and
local checks agree with their descriptors without invoking any callback. An
`:audited_local` declaration additionally requires a runtime binding, so an
embedder-assembled catalog cannot carry a check phase 7 runs before provider
activity. The binding scopes that claim to a sealed host document; it does not
attest that the callback itself came from a shipped installation recipe, which
no in-process registration can prove about its own caller.
Every builder placed in a run-bound registry carries the data policy its
validated sealed descriptor declares, so a staged preparation cannot
contradict the policy phase 5 and sink authorization already used.

# `implementation`

```elixir
@type implementation() :: %{
  :builder =&gt; function(),
  optional(:oauth_builder) =&gt; function(),
  optional(:local_preflight) =&gt; (map(),
                                 map(),
                                 PtcRunner.Kernel.ProviderRuntimeServices.t() -&gt;
                                   :ok | {:error, term()}),
  optional(:provider_application) =&gt; :req_llm,
  optional(:selection_validator) =&gt; function(),
  optional(:connectivity_probe) =&gt; (map(),
                                    map(),
                                    PtcRunner.Kernel.ProviderRuntimeServices.t() -&gt;
                                      :ok | {:error, term()})
}
```

# `registration`

```elixir
@type registration() :: %{
  descriptor: PtcRunner.Kernel.ProviderDescriptor.t(),
  implementation: implementation(),
  authority: PtcRunner.Kernel.MCPOAuth.Authority.t() | :host_runtime | nil
}
```

# `t`

```elixir
@type t() :: %PtcRunner.Kernel.InstallationCatalog{
  attestation: binary() | nil,
  authorities: %{
    required(binary()) =&gt;
      PtcRunner.Kernel.MCPOAuth.Authority.t() | :host_runtime | nil
  },
  descriptors: %{required(binary()) =&gt; PtcRunner.Kernel.ProviderDescriptor.t()},
  implementations: %{required(binary()) =&gt; implementation()},
  installation_config_digests: %{required(binary()) =&gt; binary()},
  installed_limits: PtcRunner.Kernel.Limits.t(),
  runtime_binding: binary() | nil
}
```

# `close`

```elixir
@spec close(t()) :: :ok
```

Closes an inert catalog.

# `fetch`

```elixir
@spec fetch(t(), binary()) :: {:ok, PtcRunner.Kernel.ProviderDescriptor.t()} | :error
```

Fetches one inert descriptor by installed safe alias.

# `names`

```elixir
@spec names(t()) :: [binary()]
```

Returns installed aliases in UTF-8 byte order.

# `new`

```elixir
@spec new(
  map(),
  keyword()
) :: {:ok, t()} | {:error, :invalid_installation_catalog}
```

Validates and seals explicit registrations without invoking implementations.

# `public_installations`

```elixir
@spec public_installations(t()) :: [map()]
```

Returns the closed selector-safe installed-provider projection.

# `valid?`

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

Checks declaration/implementation parity and the catalog seal.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
