# rules_boundary URL: /chirp/api/contracts/rules_boundary/ Section: contracts -------------------------------------------------------------------------------- rules_boundary - Chirp window.BENGAL_THEME_DEFAULTS = { appearance: 'light', palette: 'charcoal-bengal' }; window.Bengal = window.Bengal || {}; window.Bengal.enhanceBaseUrl = '/chirp/assets/js/enhancements'; window.Bengal.watchDom = true; window.Bengal.debug = false; window.Bengal.enhanceUrls = { 'toc': '/chirp/assets/js/enhancements/toc.736b857e.js', 'docs-nav': '/chirp/assets/js/enhancements/docs-nav.57e4b129.js', 'tabs': '/chirp/assets/js/enhancements/tabs.aac9e817.js', 'lightbox': '/chirp/assets/js/enhancements/lightbox.1ca22aa1.js', 'interactive': '/chirp/assets/js/enhancements/interactive.96c8880c.js', 'mobile-nav': '/chirp/assets/js/enhancements/mobile-nav.d991657f.js', 'action-bar': '/chirp/assets/js/enhancements/action-bar.d62417f4.js', 'copy-link': '/chirp/assets/js/enhancements/copy-link.7d9a5c29.js', 'data-table': '/chirp/assets/js/enhancements/data-table.1f5bc1eb.js', 'lazy-loaders': '/chirp/assets/js/enhancements/lazy-loaders.a5c38245.js', 'holo': '/chirp/assets/js/enhancements/holo.ee13c841.js', 'link-previews': '/chirp/assets/js/enhancements/link-previews.96620bcf.js' }; (function () { try { var defaults = window.BENGAL_THEME_DEFAULTS || { appearance: 'system', palette: '' }; var defaultAppearance = defaults.appearance; if (defaultAppearance === 'system') { defaultAppearance = (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) ? 'dark' : 'light'; } var storedTheme = localStorage.getItem('bengal-theme'); var storedPalette = localStorage.getItem('bengal-palette'); var theme = storedTheme ? (storedTheme === 'system' ? defaultAppearance : storedTheme) : defaultAppearance; var palette = storedPalette ?? defaults.palette; document.documentElement.setAttribute('data-theme', theme); if (palette) { document.documentElement.setAttribute('data-palette', palette); } } catch (e) { document.documentElement.setAttribute('data-theme', 'light'); } })(); Skip to main content For a complete page index, fetch /chirp/llms.txt. ⌁⌁ DocumentationInfoAboutGet StartedBuild AppsQuality and OperationsFile TextReferenceCubeExamplesApplied TutorialsReleasesDevGitHubChirp API ReferenceForum Magnifying Glass Search ⌘K Palette Appearance Chevron Down Mode Monitor System Sun Light Moon Dark Palette Snow Lynx Brown Bengal Silver Bengal Charcoal Bengal Blue Bengal List Chirp API Reference Caret Right Internal asgi invoke invoke_plan kwargs_resolve multimap types Caret Right Ai _providers _structured errors llm streaming Caret Right App compiler diagnostics lifecycle mount registry runtime server state url_for Caret Right Cache Caret Right Backends memory null redis deferred key middleware protocol Caret Right Cli Caret Right Templates minimal scaffold shell sse v2 _check _freeze _makemigrations _new _resolve _routes _run _security_check _templates Caret Right Contracts checker declarations patterns routes rules_accessibility rules_alpine_cdn rules_boundary rules_chirpui_runtime rules_commands rules_composition rules_context_cascade rules_csrf_forms rules_debug_wiring rules_defer_falsy rules_form_routes rules_forms rules_fragment_scope rules_fragment_targets rules_htmx rules_inline rules_islands rules_kida_analysis rules_layout rules_live_blocks rules_mount_app rules_oob_registry rules_oob_targets rules_page_handlers rules_page_shell rules_reactive rules_route_contract rules_route_names rules_safety rules_sse rules_swap rules_unreachable_blocks rules_vary template_scan types utils Caret Right Data Caret Right Drivers postgres sqlite Caret Right Schema diff generate introspect operations parse types _mapping _sqlite database errors migrate pagination query types Caret Right Docs autodoc checks collection frontmatter models plugin search tools Caret Right Ext chirp_ui Caret Right Http cookies forms headers query request response sync_request Caret Right I18N catalog detection formatting middleware Caret Right Markdown errors filters renderer Caret Right Middleware _redis_rate_limit allowed_hosts auth auth_rate_limit builtin csp_nonce csrf debug_fragment_validator inject layout_debug protocol security_headers sessions static streaming_html Caret Right Pages actions context debug discovery Caret Right index bus events stream renderer resolve sections shell_actions shell_context types Caret Right Realtime events sse Caret Right Routing params route router Caret Right Security audit decorators lockout passwords urls Caret Right Server Caret Right Debug editor frames render_plan_snapshot renderers request_context styles template_context alpine debug_page debug_runtime delegation dev dev_browser_reload devtools errors fragment_dispatch fragment_targets_debug handler handler_kwargs htmx_debug htmx_safe_target islands negotiation negotiation_oob production route_explorer sender speculation_rules sse_lifecycle sync_handler terminal_checks terminal_errors view_transitions Caret Right Templating adapter composition filters fragment_target_registry integration kida_adapter macros navigation_swap oob_registry render_plan returns streaming suspense trace Caret Right Testing assertions client route_smoke sse Caret Right Tools events handler registry schema Caret Right Validation result rules chirp config context domains errors extraction freeze health live_blocks logging plugin resilience shell_actions shell_regions sources Chirp API ReferenceContracts ᗢ Caret Down Link Copy URL External Open LLM text Copy Copy LLM text Share with AI Ask Claude Ask ChatGPT Ask Gemini Ask Copilot Module contracts.rules_boundary Error boundary coverage check for OOB template blocks. Scans template sources for blocks inside elements with hx-swap-oob attributes and suggests wrapping them in {% try %}...{% fallback %} for graceful error handling. This only catches templates that embed hx-swap-oob in their source. Templates used with Suspense don't contain hx-swap-oob — the OOB wrappers are generated at render time by chirp's Suspense pipeline, which already has its own per-block error handling (see suspense.py). Kida 0.4.0 introduced error boundaries — {% try %} blocks that catch render errors and fall back to safe defaults. This check emits INFO-level issues (not errors or warnings) since server-side error handling already prevents page-level failures. Scope limitations — the check uses regex-based HTML parsing, so it: Only sees blocks in the literal template source (not inherited/included blocks) May miss OOB regions split across template conditionals These are acceptable trade-offs for an INFO-level advisory check. 2Functions Functions _extract_oob_regions 1 list[str] ▼ Extract the inner content of each OOB element by tracking tag nesting. Limitat… def _extract_oob_regions(source: str) -> list[str] Extract the inner content of each OOB element by tracking tag nesting. Limitations (regex-based HTML parsing): Cannot see blocks inherited via {% extends %} or pulled in via {% include %} — only the literal source of each template is scanned. HTML comments or template conditionals that split tags may confuse the nesting tracker, though this is rare in practice. Parameters Name Type Description source str Returns list[str] check_boundary_coverage 1 list[ContractIssue] ▼ Suggest error boundaries for blocks inside OOB elements. Only inspects blocks … def check_boundary_coverage(template_sources: dict[str, str]) -> list[ContractIssue] Suggest error boundaries for blocks inside OOB elements. Only inspects blocks that are inside elements with hx-swap-oob attributes (explicit OOB swap targets). Blocks outside OOB regions in the same template are not flagged. Does not cover Suspense-rendered OOB (those wrappers are generated at render time, not in the source). Parameters Name Type Description template_sources dict[str, str] Returns list[ContractIssue] ← Previous rules_alpine_cdn Next → rules_chirpui_runtime List Magnifying Glass ESC Recent Clear Magnifying Glass No results for "" Start typing to search... ↑↓ Navigate ↵ Open ESC Close Powered by Lunr ⌁⌁ Magnifying Glass Search X Close Documentation Caret Down Info About Get Started Build Apps Quality and Operations File Text Reference Cube Examples Applied Tutorials Releases Dev Caret Down GitHub Chirp API Reference Forum Palette Appearance Chevron Down Mode Monitor System Sun Light Moon Dark Palette Snow Lynx Brown Bengal Silver Bengal Charcoal Bengal Blue Bengal © 2026 Chirp built in ᓚᘏᗢ { "linkPreviews": { "enabled": true, "hoverDelay": 200, "hideDelay": 150, "showSection": true, "showReadingTime": true, "showWordCount": true, "showDate": true, "showTags": true, "maxTags": 3, "includeSelectors": [".prose"], "excludeSelectors": ["nav", ".toc", ".breadcrumb", ".pagination", ".card", "[class*='-card']", ".tab-nav", "[class*='-widget']", ".child-items", ".content-tiles"], "allowedHosts": [], "allowedSchemes": ["https"], "hostFailureThreshold": 3, "showDeadLinks": true } } window.BENGAL_LAZY_ASSETS = { tabulator: '/chirp/assets/js/tabulator.min.js', dataTable: '/chirp/assets/js/data-table.js', mermaidToolbar: '/chirp/assets/js/mermaid-toolbar.9de5abba.js', mermaidTheme: '/chirp/assets/js/mermaid-theme.344822c5.js', graphMinimap: '/chirp/assets/js/graph-minimap.ff04e939.js', graphContextual: '/chirp/assets/js/graph-contextual.355458ba.js' }; window.BENGAL_ICONS = { close: '/chirp/assets/icons/close.911d4fe1.svg', enlarge: '/chirp/assets/icons/enlarge.652035e5.svg', copy: '/chirp/assets/icons/copy.3d56e945.svg', 'download-svg': '/chirp/assets/icons/download.04f07e1b.svg', 'download-png': '/chirp/assets/icons/image.c34dfd40.svg', 'zoom-in': '/chirp/assets/icons/zoom-in.237b4a83.svg', 'zoom-out': '/chirp/assets/icons/zoom-out.38857c77.svg', reset: '/chirp/assets/icons/reset.d26dba29.svg' }; { "prerender": [ { "where": { "and": [ { "href_matches": "/docs/*" }, { "not": { "selector_matches": "[data-external], [target=_blank], .external" } } ] }, "eagerness": "conservative" } ], "prefetch": [ { "where": { "and": [ { "href_matches": "/*" }, { "not": { "selector_matches": "[data-external], [target=_blank], .external" } } ] }, "eagerness": "conservative" } ] } Arrow Up -------------------------------------------------------------------------------- Metadata: - Word Count: 1077 - Reading Time: 5 minutes