PtcRunner.Kernel.LimitCatalog (PtcRunner v0.14.0)

Copy Markdown View Source

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.

Summary

Functions

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

Projects exactly the limit rows that participate in effective identity.

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

Returns public names for the host or one catalog scope.

Returns every catalog row in lexical public-name order.

Returns catalog rows in one scope, preserving lexical order.

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

Checks one value against its row's inclusive range.

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

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

Types

row()

@type row() :: %{
  field: atom(),
  name: binary(),
  scope: scope(),
  compiled_default: pos_integer(),
  installed_default: pos_integer(),
  minimum: pos_integer(),
  maximum: pos_integer(),
  identity: boolean(),
  unit: :milliseconds | :heap_words | :bytes | :count,
  description: binary()
}

scope()

@type scope() :: :manifest_narrowable | :installed_only

Functions

defaults(atom)

@spec defaults(:compiled | :installed) :: %{required(atom()) => pos_integer()}

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

effective_projection(limits)

@spec effective_projection(struct() | map()) :: %{required(binary()) => pos_integer()}

Projects exactly the limit rows that participate in effective identity.

fetch(name)

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

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

names(scope \\ :all)

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

Returns public names for the host or one catalog scope.

rows()

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

Returns every catalog row in lexical public-name order.

rows(scope)

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

Returns catalog rows in one scope, preserving lexical order.

schema_properties(atom)

@spec schema_properties(:host | :manifest) :: %{required(binary()) => map()}

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

valid_value?(arg1, value)

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

Checks one value against its row's inclusive range.

valid_values?(values)

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

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

validate_fields!(fields)

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

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