Island mount metadata checks.
contracts.rules_islands
| 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
Return an error phrase if op is an invalid optimistic_apply op, else None.
The single source of truth for op validity, shared by the…
Extract island mount metadata from template HTML.
Validate theoptimistic_applyprops schema.
Best-effort and ERGONOMIC, not the zero-server-state guarantee: it only
sees STATICALLY-spelleddata-island-props(the canonical
{{ optimistic_attrs(...) }}helper form…
Validate framework-agnostic island mount metadata in templates.
validate_optimistic_op
function
def validate_optimistic_op(op: object) -> str | None
Return an error phrase if op is an invalid optimistic_apply op, else None.
The single source of truth for op validity, shared by the static contract
(_check_optimistic_props) and the render-time helper
(chirp.templating.filters.optimistic_attrs) so the two enforcement
points cannot drift. Phrases are suffix fragments ("op 'setAttr' needs ...")
each caller frames for its own context.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
op
|
object
|
— |
extract_island_mounts
function
def extract_island_mounts(source: str) -> list[dict[str, str | None]]
Extract island mount metadata from template HTML.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
source
|
str
|
— |
_check_optimistic_props
function
def _check_optimistic_props(name: str, parsed: dict[str, object], template_name: str) -> list[ContractIssue]
Validate theoptimistic_applyprops schema.
Best-effort and ERGONOMIC, not the zero-server-state guarantee: it only
sees STATICALLY-spelleddata-island-props(the canonical
{{ optimistic_attrs(...) }} helper form and any {{ }}-bearing props
are invisible toextract_island_mounts, which scans raw disk source).
The render-time guard inchirp.templating.filters.optimistic_attrsis
authoritative; the zero-server-state boundary itself is enforced by the
runtime guardrail intests/test_islands.py.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name
|
str
|
— | |
parsed
|
dict[str, object]
|
— | |
template_name
|
str
|
— |
check_island_mounts
function
def check_island_mounts(template_sources: dict[str, str], *, strict: bool) -> list[ContractIssue]
Validate framework-agnostic island mount metadata in templates.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
template_sources
|
dict[str, str]
|
— | |
strict
|
bool
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/rules_islands.py:1