STR-009
Hard constraint
layer: document
Maintain heading hierarchy
IF heading levels skip or reflect visual size rather than logical nesting, THEN repair the hierarchy ELSE retain.
Why the rule exists
Assistive technology and scanning readers depend on a coherent outline.
Condition
The rule fires when this evaluates true. Paths marked below must be present in the fact base; the engine reports the rest rather than guessing them.
- ANY
- document.heading_level_skip eq true
- document.headings_used_for_visual_style eq true
Facts this rule reads
| Path | Source |
|---|---|
document.heading_level_skip |
You supply it |
document.headings_used_for_visual_style |
You supply it |
Then
- restructure — target
document.heading_tree - separate — target
presentation_from_semantics
Else
- retain — target
current_text, No triggering condition is present.
LAKA
- Smallest sufficient intervention
- Yes
- Primary axes
Sources
-
Writing for Web Accessibility — W3C Web Accessibility Initiative
link
Clear structure, descriptive labels, alternatives, and understandable content. -
Web Content Accessibility Guidelines 2.2 — W3C
link
Testable accessibility requirements for web content.
The raw rule record
Verbatim from 10-paragraph-document-rules.json. Also available at /v1/rules/STR-009.
{
"id": "STR-009",
"name": "Maintain heading hierarchy",
"domain": "structure",
"layer": "document",
"strength": "hard_constraint",
"human_logic": "IF heading levels skip or reflect visual size rather than logical nesting, THEN repair the hierarchy ELSE retain.",
"when": {
"any": [
{
"path": "document.heading_level_skip",
"operator": "eq",
"value": true
},
{
"path": "document.headings_used_for_visual_style",
"operator": "eq",
"value": true
}
]
},
"then": [
{
"action": "restructure",
"target": "document.heading_tree",
"require": "logical_nesting"
},
{
"action": "separate",
"target": "presentation_from_semantics"
}
],
"else": [
{
"action": "retain",
"target": "current_text",
"reason": "No triggering condition is present."
}
],
"unless": [],
"because": "Assistive technology and scanning readers depend on a coherent outline.",
"diagnostics": [],
"examples": {},
"source_ids": [
"WEB-005",
"WEB-007"
],
"laka": {
"smallest_sufficient_intervention": true,
"primary_axes": [
"scope",
"depth",
"magnitude",
"reversibility"
]
}
}
Other structure rules
- STR-001 One controlling move per paragraph IF a paragraph performs more than one unrelated rhetorical move, THEN split it at the move boundary ELSE retain. Context default
- STR-002 Expose the paragraph point IF the paragraph’s controlling point is absent or recoverable only after rereading, THEN state or move it to a strategic position ELSE retain an intentional delayed reveal. Heuristic
- STR-003 Support consequential claims IF a paragraph makes a consequential factual claim, THEN provide evidence, cite it, qualify it, or remove the claim ELSE retain. Hard constraint
- STR-004 Keep evidence beside the claim IF evidence is separated from the claim it supports by unrelated material, THEN move it closer or label the relation ELSE retain. Context default
- STR-005 Use transitions that name the relation IF adjacent paragraphs have a meaningful but unstated relation, THEN add a transition that expresses that relation ELSE retain. Context default
- STR-006 Delete orphan paragraphs IF a paragraph neither advances the purpose nor supports another necessary move, THEN delete or relocate it ELSE retain. Heuristic
- STR-007 Section answers one reader question IF a section answers multiple unrelated reader questions, THEN split and label them ELSE retain. Context default
- STR-008 Heading predicts content IF a heading does not accurately predict its section, THEN rename the heading or repair the section ELSE retain. Hard constraint