test(css-contract): close the render→AFM_CLASSES loop#87
Open
P4suta wants to merge 1 commit into
Open
Conversation
The css_class_contract suite only proved AFM_CLASSES ⊆ CSS. Add the render direction: render a curated corpus of every known aozora construct through afm and assert (1) every emitted afm-* class is in AFM_CLASSES, and (2) every AFM_CLASSES entry is emitted by some construct (catching stale entries), modulo a documented UNEXERCISED allowlist. This is the pin-independent half of #74 and de-risks the upcoming notation absorption (#81): a new upstream class — or a class going stale on the DoubleRuby→AngleQuote pin bump — now fails by name instead of shipping silent unstyled drift. The heavier build.rs source-scrape stays deferred in #74. Corpus sources are copied verbatim from existing passing afm tests and aozora-render tests at the pinned SHA (none authored from memory). The completeness test already surfaced two gaps — afm-indent (leaf) and afm-kaeriten have no afm-source trigger at the current pin — both documented in UNEXERCISED. Part of #81. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the render-direction half of the afm CSS class contract in
crates/afm-markdown/tests/css_class_contract.rs. The existing tests proveAFM_CLASSES ⊆ CSS; these close the loopconstruct → afm-* class → AFM_CLASSES:every_rendered_class_is_recognised— everyafm-*class a known construct emits is inAFM_CLASSES.every_afm_class_is_exercised_by_the_corpus— everyAFM_CLASSESentry is emitted by some construct (catches stale entries), modulo a documentedUNEXERCISEDallowlist.Why
The pin-independent half of #74, and groundwork for the aozora
feat/devex-inner-loopnotation absorption (#81). On the next aozora pin bump, a newafm-*class — or one going stale on theDoubleRuby→AngleQuoterename — now fails by name instead of shipping silent unstyled markup. The heavierbuild.rssource-scrape that would eliminate the manualAFM_CLASSESappend stays deferred in #74.Notes
UNEXERCISED:afm-indent(leaf indent has no source trigger; aozora-render exercises it only via a directly-constructed node) andafm-kaeriten(no afm-source trigger emits it at the current pin) — candidate follow-ups.Verification
just test— 321/321 greenjust lint— fmt-check / clippy-D warnings/ typos / strict-code all cleanPart of #81. Implements the pin-independent half of #74.
🤖 Generated with Claude Code