Module

contracts.rules_oob_registry

OOB registry / layout consistency check.

Fails loud at startup when the OOB registry contains blocks (e.g. shell_actions_oob) that no layout template defines. Without the matching {% region %} or {% block %}, the registered region is inert — OOB swaps would silently fail at render time, so reachingapp.check()with an orphaned registration is almost always a bug.

Severity tiering:

  • optional=False(default): ERROR. Render-time pre-check would raise BlockNotFoundErroron a request hitting this layout, so flagging at startup is the earlier, cheaper signal.
  • optional=True: WARNING. Apps that intentionally register regions for some-but-not-all layouts opt in; the render path silently skips them.

Apps that need the pre-0.5.0 behavior can demote globally with app.override_contract_severity("oob_registry", Severity.WARNING).

Functions

check_oob_registry_coverage 3 list[ContractIssue]
Emit ERROR/WARNING issues for OOB blocks absent from all layouts. For each blo…
def check_oob_registry_coverage(oob_registry: OOBRegistry | None, layout_templates: list[str], kida_env: Environment | None) -> list[ContractIssue]

Emit ERROR/WARNING issues for OOB blocks absent from all layouts.

For each block in the OOB registry, checks whether at least one layout template defines that block. Non-optional orphans emit ERROR (render would raise); optional orphans emit WARNING (render silently skips).

Parameters
Name Type Description
oob_registry OOBRegistry | None
layout_templates list[str]
kida_env Environment | None
Returns
list[ContractIssue]