Skip to content

Zero out category score for showstopper rules (e.g. no-a11y-statement)#79

Open
marcusosterberg wants to merge 1 commit into
mainfrom
feat/showstopper-rules
Open

Zero out category score for showstopper rules (e.g. no-a11y-statement)#79
marcusosterberg wants to merge 1 commit into
mainfrom
feat/showstopper-rules

Conversation

@marcusosterberg
Copy link
Copy Markdown
Contributor

@marcusosterberg marcusosterberg commented May 14, 2026

Summary

Adds a mechanism for rules that represent fundamental, "you failed the
exam" failures to zero out their category score, instead of going
through the normal severity deduction.

Motivation

The current scoring deducts 25 points for severity: 'critical', which
means a site missing a legally required accessibility statement scores
75/100 (rating 3.75/5.0). That doesn't reflect the severity of the
underlying problem — a legally mandated artifact is entirely missing.

We can't simply make all critical issues zero out the category,
because the lighthouse converter also uses severity: 'critical' in
its try/catch fallback when an audit crashes. That's a technical
failure of one audit, not a wholesale failure of the category. So the
trigger must be a rule whitelist, not the severity field.

Change

Score now holds a showstopperRules set. During calculateScore,
any issue whose rule is in the set, with a non-resolved severity,
forces its category score to 0. All other scoring behaviour is
unchanged.

Currently the set contains only 'no-a11y-statement'. If we later
identify other fundamental failures (e.g. missing HTTPS, depending on
policy), they can be added here.

Impact on other plugins

None. Verified by examining all uses of severity: 'critical' across
the plugin family:

  • lighthouse-converter.js crash fallback uses critical but with
    audit-specific rule names — not in the showstopper set.
  • plugin-accessibility-statement uses critical only for
    no-a11y-statement, which is the rule we explicitly want to flag.

Verification

  • https://finsamornskoldsvik.se (no statement): score.a11y goes
    from 75 → 0, rating_a11y is now lowest possible.
  • https://eskilstuna.se ("delvis förenlig" statement): unchanged,
    score.a11y: 90.
  • Lighthouse-driven tests: unchanged.

Related

Fixes <link to issue in Webperf-se/webperf_core>

Some rules represent failures so fundamental that the affected category
should be considered failed outright, rather than just deducted from.
Missing an accessibility statement when it is legally required is one
such case: under the current scoring (-25 for severity 'critical'),
the site still gets 75/100, which doesn't reflect that a mandatory
artifact is entirely absent.

This commit introduces a `showstopperRules` set in Score. Any issue
whose rule is in the set, with a non-resolved severity, forces its
category score to 0 instead of going through the normal severity
deduction. Currently only 'no-a11y-statement' is in the set.

Other plugins using severity 'critical' (notably the lighthouse
converter's crash fallback) are unaffected, since they use different
rule names. Sites that have a statement but flag it as partially
compliant ('compatible-word-partly', severity 'error') also continue to
score as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sites missing an accessibility statement incorrectly get a perfect score (100/5.0) instead of failing

1 participant