Repository navigation
Law rules limited to classes; W-22's Astro rules for astro-site only - #74
Merged
Merged
Conversation
…s Astro a11y rules (R106) A rule entry in laws/W-NN.yaml takes an optional classes list, a subset of the law's classes: without it the rule applies to every class the law maps. The schema, the loader type and the validator (which fails a class outside the law's) carry it, laws explain shows it, and section 8.3 describes it. W-22 lists the 31 astro/jsx-a11y rules that eslint-plugin-astro's strict a11y config enables, each for astro-site only; a test keeps the list equal to the plugin's. The ESLint reader and the probe honour the field in the step that follows; until then `laws probe` still treats the new rules as owed to every class W-22 maps. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The probe took every rule of a law as owed to every class the law maps, so W-22's Astro rules were demanded under web-app and ui-components too. A probe law now carries the classes of each rule whose entry names some, and the laws of a class keep only the proofs that apply to it. The W-22 rule list test keeps its own five rules apart from Astro's, which rule-classes.test.ts checks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A rule that names several classes prints them comma separated; no test had a rule with more than one, so the separator could be emptied unseen. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
W-22 now maps 31 astro/jsx-a11y rules for astro-site, so under that class the probe owes a bad twin that fires each. One .astro bad twin carries a line per rule with its marker, and a clean twin holds the valid forms. Co-Authored-By: Claude Sonnet 5.5 <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.
A law's rule can now be limited to some of the classes the law maps. W-22's 31 Astro accessibility rules apply only to
astro-site.What it does
schema/law.schema.json: a rule entry takes an optionalclasseslist: at least one entry, no repeats, launch-class names only. With noclasses, the rule applies to every class the law maps, as before.src/laws/catalog/{types,schema,view}.ts):LawRulegainsclasses./rules/<n>/classes.laws explainmarks such a rule, for example "(astro-site only)".laws/W-22.yaml: the 31astro/jsx-a11y/*rules carryclasses: [astro-site]. A new test checks them against the plugin's strict accessibility config.WEB_TOPS.md§8.3: the rules bullet describes the optionalclasses.laws sync --checkreports no drift.src/laws/probe/{source,types,catalog}.ts): a probe law records which rules name classes, and keeps only the proofs that apply to the class being probed.fixtures/laws/W-22/{bad,clean}/astro-semantics.astro.--class astro-site, W-22 now has to prove its 31 Astro rules.The gate's laws reader honours
classesin the next readers PR.Declared exceptions
WEB_TOPS.md§8.3, under theprotocol-changelabel.src/laws/probe/{source,types,catalog}.tsand their tests.Gate on this head
layers: 5 in range, 5 ran, 0 failed, 0 not-evaluated.🤖 Generated with Claude Code