Background
The invariant catalog in crates/afm-markdown-test-support/src/lib.rs
defines shape-only HTML predicates (Tiers A–K) that every test surface —
unit tests, proptest, the corpus sweep, and fuzz harnesses — runs through
assert_invariants. Two tiers are excluded (lib.rs:31-34):
Tier H (no setext <h2> from a decorative rule) and Tier L (no empty
heading) are unit-test-only for now — they depend on being able to
witness the pre-/post-promotion AST, which the shape-only HTML
predicate cannot observe.
Because they are unit-test-only, Tier H and Tier L are not exercised
by proptest / corpus / fuzz, so a regression that only those broad
surfaces would surface could slip through.
What to do
Make Tier H and Tier L observable from rendered-HTML shape alone (or from
a cheap, test-support-visible artifact) so they can join
assert_invariants on equal footing with Tiers A–K, then add them to the
aggregated predicate. If a pure-HTML witness is genuinely impossible,
document that conclusion in the docstring and close — but the goal is to
remove the "unit-test-only" asterisk.
- Tier H: no setext
<h2> produced from a decorative rule.
- Tier L: no empty heading.
References
crates/afm-markdown-test-support/src/lib.rs:31-34 (the exclusion note)
crates/afm-markdown-test-support/src/lib.rs → assert_invariants,
invariant catalog table
- CLAUDE.md → "CSS class contract drift" / test surface notes
Background
The invariant catalog in
crates/afm-markdown-test-support/src/lib.rsdefines shape-only HTML predicates (Tiers A–K) that every test surface —
unit tests, proptest, the corpus sweep, and fuzz harnesses — runs through
assert_invariants. Two tiers are excluded (lib.rs:31-34):Because they are unit-test-only, Tier H and Tier L are not exercised
by proptest / corpus / fuzz, so a regression that only those broad
surfaces would surface could slip through.
What to do
Make Tier H and Tier L observable from rendered-HTML shape alone (or from
a cheap, test-support-visible artifact) so they can join
assert_invariantson equal footing with Tiers A–K, then add them to theaggregated predicate. If a pure-HTML witness is genuinely impossible,
document that conclusion in the docstring and close — but the goal is to
remove the "unit-test-only" asterisk.
<h2>produced from a decorative rule.References
crates/afm-markdown-test-support/src/lib.rs:31-34(the exclusion note)crates/afm-markdown-test-support/src/lib.rs→assert_invariants,invariant catalog table