Suspense defer coupling contract (#949).
Uses the freeze-time Suspense defer execution DAG (#948) to warn when deferred
context keys share a leaf block (couplesedges). Coupled keys are not
independent for concurrent resolution / distinct pool checkouts — they wait on
the same OOB leaf. Split them into separate leaf blocks when independence
matters; keep a shared panel only when serial resolution is intentional.
Severity is env-aware: silent in development,WARNINGin staging and
production. NeverERRORby default — shared-panel coupling is a valid
hypermedia pattern and must not fail production boots without evidence. Promote
viaapp.override_contract_severity("defer_coupling", Severity.ERROR)in CI
when independence is required.
contracts.rules_defer_coupling
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
_env_severity
function
def _env_severity(env: str) -> Severity | None
Return env-aware severity, orNoneto stay silent (development).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
env
|
str
|
— |
check_defer_coupling
function
def check_defer_coupling(dag: _SuspenseDeferDAG | None, *, env: str = 'development') -> list[ContractIssue]
Flag Suspense routes whose deferred keys share a leaf block.
Readscouples edges from the compiled freeze-time DAG. One WARNING
(staging/production) per unordered key pair. Independent keys (no
couplesedges) are silent.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
dag
|
_SuspenseDeferDAG | None
|
— | |
env
|
str
|
'development'
|
View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/rules_defer_coupling.py:1