Module

contracts.rules_page_handlers

Page-handler contract check.

Apage.py without a recognised HTTP method handler (get/post/ put/delete/patch/head/options, or handleras a fallback) registers no routes. Hitting it at runtime yields a 404 or a 500 depending on the surrounding layout, with no startup signal that the file was misconfigured.

This check promotesPageHandlerFindingdiagnostics produced during page discovery intopage_handlerscontract issues:

  • kind="missing"Severity.ERROR— the file defines no handler at all; ship-blocker.
  • kind="typo"Severity.WARNING— a handler-shaped function (handle, GET, index…) was defined but not recognised.

Severity can be tuned with app.override_contract_severity("page_handlers", Severity.ERROR).

Functions

check_page_handlers 1 list[ContractIssue]
Turn page-discovery handler findings into contract issues.
def check_page_handlers(findings: list[PageHandlerFinding]) -> list[ContractIssue]
Parameters
Name Type Description
findings list[PageHandlerFinding]
Returns
list[ContractIssue]