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

Closed metadata authority for Kernel limits.

Every `PtcRunner.Kernel.Limits` field has exactly one row. A row fixes its
public name, application scope, compiled and installed defaults, accepted
range, and effective-identity participation. Host and manifest decoders,
their generated schemas, and effective-identity projection consume this
catalog rather than reflecting fields from a struct.

`:manifest_narrowable` limits may be requested by an application at or below
the installed ceiling. `:installed_only` limits are host-owned and are copied
unchanged into effective limits. `:optional_manifest_narrowable` limits are
disabled when omitted by the host; an enabled host value becomes both the
inherited manifest default and its ceiling.

# `row`

```elixir
@type row() :: %{
  optional(:prerequisites) =&gt; [
    :usage_tokens | :usage_cost_currency | :reservation_tariff
  ],
  optional(:prerequisite_description) =&gt; binary() | nil,
  field: atom(),
  name: binary(),
  scope: scope(),
  compiled_default: pos_integer() | nil,
  installed_default: pos_integer() | nil,
  minimum: pos_integer(),
  maximum: pos_integer(),
  identity: boolean(),
  unit: :milliseconds | :heap_words | :bytes | :count,
  description: binary()
}
```

# `scope`

```elixir
@type scope() ::
  :manifest_narrowable | :optional_manifest_narrowable | :installed_only
```

# `defaults`

```elixir
@spec defaults(:compiled | :installed) :: %{required(atom()) =&gt; pos_integer() | nil}
```

Projects the complete atom-keyed default table from the catalog.

# `effective_projection`

```elixir
@spec effective_projection(struct() | map()) :: %{
  required(binary()) =&gt; pos_integer() | nil
}
```

Projects exactly the limit rows that participate in effective identity.

# `fetch`

```elixir
@spec fetch(binary() | atom()) :: {:ok, row()} | :error
```

Looks up a row without converting caller-authored strings to atoms.

# `llm_request_timeout_ms?`

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

Checks one live LLM whole-call deadline against the cataloged range.

# `names`

```elixir
@spec names(:all | scope()) :: [binary()]
```

Returns public names for the host or one catalog scope.

# `rows`

```elixir
@spec rows() :: [row()]
```

Returns every catalog row in lexical public-name order.

# `rows`

```elixir
@spec rows(scope()) :: [row()]
```

Returns catalog rows in one scope, preserving lexical order.

# `schema_properties`

```elixir
@spec schema_properties(:host | :manifest) :: %{required(binary()) =&gt; map()}
```

Generates the scoped integer properties shared by the checked-in schemas.

# `valid_value?`

```elixir
@spec valid_value?(row(), term()) :: boolean()
```

Checks one value against its row's inclusive range.

# `valid_values?`

```elixir
@spec valid_values?(map()) :: boolean()
```

Checks a complete atom-keyed value map against every catalog row.

# `validate_fields!`

```elixir
@spec validate_fields!([atom()]) :: :ok
```

Fails generation when a limits struct and the checked-in catalog diverge.

---

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