Module

contracts.rules_route_contract

Route directory contract validation.

Functions

check_section_bindings 2 list[ContractIssue]
Warn if RouteMeta.section references unknown section.
def check_section_bindings(route_metas: dict[str, RouteMeta | None], sections: dict[str, Section]) -> list[ContractIssue]
Parameters
Name Type Description
route_metas dict[str, RouteMeta | None]
sections dict[str, Section]
Returns
list[ContractIssue]
check_shell_mode_blocks 4 list[ContractIssue]
Error if shell_mode='tabbed' but template lacks required blocks.
def check_shell_mode_blocks(route_metas: dict[str, RouteMeta | None], route_templates: dict[str, str], fragment_target_registry: FragmentTargetRegistry, kida_env: Environment | None) -> list[ContractIssue]
Parameters
Name Type Description
route_metas dict[str, RouteMeta | None]
route_templates dict[str, str]
fragment_target_registry FragmentTargetRegistry
kida_env Environment | None
Returns
list[ContractIssue]
check_route_file_consistency 4 list[ContractIssue]
Info-level for page routes without _meta.py. Action routes (no sibling templat…
def check_route_file_consistency(route_metas: dict[str, RouteMeta | None], page_route_paths: set[str], action_route_paths: set[str] | None = None, meta_provider_paths: set[str] | None = None) -> list[ContractIssue]

Info-level for page routes without _meta.py.

Action routes (no sibling template, pure mutation handlers) are skipped because they render fragments rather than standalone pages and don't benefit from title/breadcrumb metadata.

Routes whose_meta.py defines meta()(dynamic metadata) register a meta provider at discovery time with staticmeta left None; those paths are listed in meta_provider_paths and are treated as having metadata.

Parameters
Name Type Description
route_metas dict[str, RouteMeta | None]
page_route_paths set[str]
action_route_paths set[str] | None Default:None
meta_provider_paths set[str] | None Default:None
Returns
list[ContractIssue]
check_duplicate_routes 1 list[ContractIssue]
Warn if two routes resolve to the same (url_path, method) pair.
def check_duplicate_routes(discovered_routes: list[Any]) -> list[ContractIssue]
Parameters
Name Type Description
discovered_routes list[Any]
Returns
list[ContractIssue]
check_section_tab_hrefs 2 list[ContractIssue]
Warn if a TabItem.href does not match any registered route path.
def check_section_tab_hrefs(sections: dict[str, Section], page_route_paths: set[str]) -> list[ContractIssue]
Parameters
Name Type Description
sections dict[str, Section]
page_route_paths set[str]
Returns
list[ContractIssue]
check_context_provider_signatures 2 list[ContractIssue]
Warn if _context.py param matches neither path param nor provider type.
def check_context_provider_signatures(discovered_routes: list[Any], providers: dict[type, Any] | None) -> list[ContractIssue]
Parameters
Name Type Description
discovered_routes list[Any]
providers dict[type, Any] | None
Returns
list[ContractIssue]