nfunc-mcp 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -5
- package/dist/index.js +23 -4
- package/dist/index.js.map +1 -1
- package/dist/mappers/a11yDedupe.d.ts +25 -0
- package/dist/mappers/a11yDedupe.js +95 -0
- package/dist/mappers/a11yDedupe.js.map +1 -0
- package/dist/mappers/compositeScore.d.ts +23 -0
- package/dist/mappers/compositeScore.js +107 -0
- package/dist/mappers/compositeScore.js.map +1 -0
- package/dist/mappers/correlator.js +94 -33
- package/dist/mappers/correlator.js.map +1 -1
- package/dist/mappers/defectFormatter.js +129 -15
- package/dist/mappers/defectFormatter.js.map +1 -1
- package/dist/mappers/priorityMapper.d.ts +38 -0
- package/dist/mappers/priorityMapper.js +126 -0
- package/dist/mappers/priorityMapper.js.map +1 -1
- package/dist/tools/accessibility.js +72 -31
- package/dist/tools/accessibility.js.map +1 -1
- package/dist/tools/lighthouse.d.ts +14 -0
- package/dist/tools/lighthouse.js +134 -34
- package/dist/tools/lighthouse.js.map +1 -1
- package/dist/tools/qaGate.js +109 -34
- package/dist/tools/qaGate.js.map +1 -1
- package/dist/utils/outputParsers.d.ts +25 -0
- package/dist/utils/outputParsers.js +42 -0
- package/dist/utils/outputParsers.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { lighthouseImpactToPriority, a11yTechniqueToPriority, axeImpactToPriority, staticAnalysisToPriority, } from "./priorityMapper.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parenthesised measurement, or nothing at all.
|
|
4
|
+
*
|
|
5
|
+
* displayValue is absent on binary audits and comes and goes across Lighthouse
|
|
6
|
+
* versions, so interpolating it directly left "()" or a doubled space stranded
|
|
7
|
+
* mid-sentence. Every template that appends a measurement goes through this;
|
|
8
|
+
* templates that build a sentence *around* the value guard it explicitly and
|
|
9
|
+
* supply alternative phrasing instead.
|
|
10
|
+
*/
|
|
11
|
+
const paren = (v) => (v ? ` (${v})` : "");
|
|
2
12
|
const QA_DESCRIPTIONS = {
|
|
3
|
-
"first-contentful-paint": (a) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
"first-contentful-paint": (a) => a.displayValue
|
|
14
|
+
? `Users see the first piece of content ${a.displayValue} after navigation, which is slower than the recommended threshold for a smooth perceived load.`
|
|
15
|
+
: `Users see the first piece of content later after navigation than the recommended threshold for a smooth perceived load.`,
|
|
16
|
+
"largest-contentful-paint": (a) => a.displayValue
|
|
17
|
+
? `Users see the main page content ${a.displayValue} after navigation, above the recommended threshold for a responsive feel.`
|
|
18
|
+
: `Users see the main page content later after navigation than the recommended threshold for a responsive feel.`,
|
|
19
|
+
"speed-index": (a) => a.displayValue
|
|
20
|
+
? `The page takes ${a.displayValue} to visually populate, which feels sluggish to users on first load.`
|
|
21
|
+
: `The page is slow to visually populate, which feels sluggish to users on first load.`,
|
|
22
|
+
"total-blocking-time": (a) => a.displayValue
|
|
23
|
+
? `The page is unresponsive to user input for ${a.displayValue} during load, causing noticeable input lag.`
|
|
24
|
+
: `The page is unresponsive to user input for a prolonged stretch of the load, causing noticeable input lag.`,
|
|
25
|
+
"cumulative-layout-shift": (a) => `The page layout shifts unexpectedly during load${a.displayValue ? ` (CLS ${a.displayValue})` : ""}, causing users to misclick or lose their reading place.`,
|
|
26
|
+
interactive: (a) => a.displayValue
|
|
27
|
+
? `The page takes ${a.displayValue} before it can reliably respond to user input.`
|
|
28
|
+
: `The page takes a long time before it can reliably respond to user input.`,
|
|
29
|
+
// Lighthouse 13 changed this displayValue from a bare duration to a clause
|
|
30
|
+
// ("Root document took 780 ms"), which broke the original inlined phrasing.
|
|
31
|
+
"server-response-time": (a) => a.displayValue
|
|
32
|
+
? `${a.displayValue} to respond to the initial request, delaying every downstream load step.`
|
|
33
|
+
: `The server is slow to respond to the initial request, delaying every downstream load step.`,
|
|
34
|
+
"document-latency-insight": (a) => `The initial HTML document is slow to arrive${paren(a.displayValue)}; nothing else can start loading until it does, so this delay is paid by every other resource on the page.`,
|
|
35
|
+
"render-blocking-resources": (a) => `Render-blocking scripts or styles are delaying the first paint${paren(a.displayValue)}; users stare at a blank page longer than necessary.`,
|
|
36
|
+
"unused-javascript": (a) => `The page ships JavaScript that is never executed${paren(a.displayValue)}, inflating load time on slower connections.`,
|
|
37
|
+
"unused-css-rules": (a) => `The page ships CSS rules that go unused${paren(a.displayValue)}, wasting bytes on every visit.`,
|
|
38
|
+
"uses-responsive-images": (a) => `Images larger than their displayed size are being served${paren(a.displayValue)}, wasting bandwidth on mobile users.`,
|
|
39
|
+
"uses-optimized-images": (a) => `Images are not optimally compressed${paren(a.displayValue)}; users on slower networks wait longer than necessary.`,
|
|
15
40
|
"color-contrast": () => `Text on the page does not have sufficient contrast against its background, making it hard to read for users with low vision.`,
|
|
16
41
|
"image-alt": () => `One or more images are missing alt text; screen-reader users cannot understand what the image conveys.`,
|
|
17
42
|
label: () => `Form fields are missing accessible labels; assistive-tech users cannot tell what each field is for.`,
|
|
@@ -21,13 +46,64 @@ const QA_DESCRIPTIONS = {
|
|
|
21
46
|
"meta-description": () => `The page is missing a meta description; search results show no preview snippet to users.`,
|
|
22
47
|
"is-on-https": () => `The page is served over HTTP rather than HTTPS; browsers warn users that the connection is not secure.`,
|
|
23
48
|
viewport: () => `The page has no viewport meta tag; on mobile, content renders at desktop width and users must pinch-zoom to read.`,
|
|
49
|
+
// --- Responsiveness / main thread ---
|
|
50
|
+
"max-potential-fid": (a) => a.displayValue
|
|
51
|
+
? `The worst-case delay between a user's first tap or click and the page reacting to it is ${a.displayValue}; users who interact early during load will feel the page freeze.`
|
|
52
|
+
: `There is a long worst-case delay between a user's first tap or click and the page reacting to it; users who interact early during load will feel the page freeze.`,
|
|
53
|
+
"mainthread-work-breakdown": (a) => a.displayValue
|
|
54
|
+
? `The browser's main thread is busy for ${a.displayValue} during load, so scrolling, taps, and clicks are ignored or delayed while it catches up.`
|
|
55
|
+
: `The browser's main thread is busy for much of the load, so scrolling, taps, and clicks are ignored or delayed while it catches up.`,
|
|
56
|
+
"bootup-time": (a) => a.displayValue
|
|
57
|
+
? `JavaScript occupies the main thread for ${a.displayValue}; on mid-range phones this is where most of the perceived slowness comes from.`
|
|
58
|
+
: `JavaScript occupies the main thread for a prolonged stretch of the load; on mid-range phones this is where most of the perceived slowness comes from.`,
|
|
59
|
+
"forced-reflow-insight": (a) => `Scripts read layout values immediately after changing the DOM, forcing the browser to recalculate layout mid-frame${paren(a.displayValue)}; this shows up as stutter during scroll and interaction.`,
|
|
60
|
+
// --- Console / runtime health ---
|
|
61
|
+
"errors-in-console": () => `The page logs JavaScript errors to the browser console during load. Each one is a code path that failed at runtime, and features downstream of it may be silently broken for real users.`,
|
|
62
|
+
deprecations: (a) => `The page relies on browser APIs that are deprecated${paren(a.displayValue)}; these will stop working in a future browser release and break the feature that depends on them.`,
|
|
63
|
+
"inspector-issues": () => `Chrome DevTools recorded issues against this page — typically blocked requests, cookie problems, or content-security violations. Each represents browser-enforced behaviour that may differ from what was tested locally.`,
|
|
64
|
+
"third-party-cookies": (a) => `The page sets third-party cookies${paren(a.displayValue)}. Browsers are phasing these out, so any feature depending on them — analytics, personalisation, embedded checkout — will degrade as that rollout completes.`,
|
|
65
|
+
// --- Caching / payload ---
|
|
66
|
+
"bf-cache": (a) => `The page blocks back/forward cache restoration${paren(a.displayValue)}, so pressing Back triggers a full reload instead of an instant restore — a visible regression on the most common navigation in a browsing session.`,
|
|
67
|
+
"cache-insight": (a) => `Static assets are served with short or missing cache lifetimes${paren(a.displayValue)}; returning visitors re-download content that has not changed.`,
|
|
68
|
+
// displayValue here is already a full clause ("Total size was 4,814 KiB"),
|
|
69
|
+
// unlike the bare metrics most audits report, so it leads the sentence
|
|
70
|
+
// instead of being inlined mid-clause.
|
|
71
|
+
"total-byte-weight": (a) => a.displayValue
|
|
72
|
+
? `${a.displayValue} — a payload that size is slow and expensive to load for users on mobile data or metered connections.`
|
|
73
|
+
: `The page transfers more data than it needs to render, which is slow and expensive for users on mobile data or metered connections.`,
|
|
74
|
+
"unminified-javascript": (a) => `JavaScript is shipped unminified${paren(a.displayValue)}, sending comments and whitespace to every visitor.`,
|
|
75
|
+
"legacy-javascript-insight": (a) => `The bundle ships transpiled polyfills that modern browsers do not need${paren(a.displayValue)}, penalising up-to-date users to support ones that may no longer be in the support matrix.`,
|
|
76
|
+
"image-delivery-insight": (a) => `Images are not delivered in an optimal format or size${paren(a.displayValue)}; users on slower networks wait longer than necessary for the same visual result.`,
|
|
77
|
+
"unsized-images": () => `Images are missing explicit width and height attributes, so the browser cannot reserve space before they load and surrounding content jumps as each one arrives.`,
|
|
78
|
+
// --- Network / critical path ---
|
|
79
|
+
"render-blocking-insight": (a) => `Scripts or stylesheets block the first paint${paren(a.displayValue)}; users stare at a blank page until they finish downloading.`,
|
|
80
|
+
"lcp-discovery-insight": () => `The browser cannot discover the largest content element early — it is loaded lazily, injected by script, or not preloaded — so the main content paints later than the network allows.`,
|
|
81
|
+
"network-dependency-tree-insight": () => `Critical resources load in a long dependent chain rather than in parallel, so total load time is the sum of the chain instead of its slowest link.`,
|
|
82
|
+
// --- Accessibility (Lighthouse-side) ---
|
|
83
|
+
"aria-prohibited-attr": () => `An element carries an ARIA attribute that its role does not permit; assistive tech either ignores the attribute or announces the element incorrectly.`,
|
|
84
|
+
// Shared with the axe runner, whose rule ids match Lighthouse audit ids.
|
|
85
|
+
"aria-allowed-attr": () => `An element uses an ARIA attribute its role does not support; the attribute is ignored, so the state it was meant to convey — pressed, expanded, selected — never reaches screen-reader users.`,
|
|
86
|
+
"aria-required-children": () => `An ARIA role that requires specific child roles is missing them; assistive tech cannot interpret the widget and may skip or misannounce its contents.`,
|
|
87
|
+
"aria-required-parent": () => `An element with a child ARIA role sits outside the parent role it requires; screen readers lose the relationship and announce the item without its surrounding context.`,
|
|
88
|
+
"aria-valid-attr-value": () => `An ARIA attribute holds an invalid value, often an id reference pointing at an element that does not exist; the name or relationship it was meant to establish silently fails.`,
|
|
89
|
+
"duplicate-id-aria": () => `An id used by an ARIA reference appears more than once; the reference resolves to the wrong element, so labels and relationships attach to the wrong control.`,
|
|
90
|
+
"aria-dialog-name": () => `A dialog or alertdialog has no accessible name; screen-reader users are moved into a modal with no indication of what it is asking them to do.`,
|
|
91
|
+
"heading-order": () => `Heading levels skip a step (for example h2 straight to h4); screen-reader users navigating by heading get a broken outline and may believe content is missing.`,
|
|
92
|
+
"label-content-name-mismatch": () => `An element's visible text is not contained in its accessible name, so speech-control users saying the label they can see fail to activate the control.`,
|
|
93
|
+
"meta-viewport": () => `The viewport tag disables zooming (user-scalable="no" or maximum-scale under 5); low-vision users cannot pinch-zoom to read the page.`,
|
|
94
|
+
// --- SEO / crawlability ---
|
|
95
|
+
"link-text": (a) => `One or more links use non-descriptive text such as "click here"${paren(a.displayValue)}; screen-reader users listing links out of context cannot tell where they lead, and search engines gain no signal from the anchor.`,
|
|
96
|
+
"crawlable-anchors": () => `Links are not crawlable — they lack a resolvable href, so search engines cannot follow them and the destination pages may go unindexed.`,
|
|
97
|
+
"robots-txt": () => `robots.txt is invalid. Crawlers may misread the directives and either index pages meant to stay private or skip pages meant to rank.`,
|
|
98
|
+
"llms-txt": () => `llms.txt is missing or does not follow the recommended format, so AI agents fetching the site get no curated guide to its content.`,
|
|
99
|
+
"agent-accessibility-tree": () => `The accessibility tree is malformed, which degrades both screen readers and automated agents that navigate the page through it.`,
|
|
24
100
|
};
|
|
25
101
|
function fallbackDescription(audit) {
|
|
26
102
|
const detail = audit.displayValue ? ` (current: ${audit.displayValue})` : "";
|
|
27
103
|
return `The "${audit.title}" check did not meet the recommended quality threshold${detail}.`;
|
|
28
104
|
}
|
|
29
105
|
export function formatLighthouseFinding(audit) {
|
|
30
|
-
const priority =
|
|
106
|
+
const priority = lighthouseImpactToPriority(audit.score, audit.weight);
|
|
31
107
|
if (!priority)
|
|
32
108
|
return null;
|
|
33
109
|
const describe = QA_DESCRIPTIONS[audit.id];
|
|
@@ -39,6 +115,10 @@ export function formatLighthouseFinding(audit) {
|
|
|
39
115
|
evidence: {
|
|
40
116
|
audit_id: audit.id,
|
|
41
117
|
value: audit.displayValue ?? "",
|
|
118
|
+
// Why this landed where it did — weight is Lighthouse's own importance
|
|
119
|
+
// signal, and weight 0 marks a diagnostic that blocks nothing.
|
|
120
|
+
...(audit.weight !== undefined ? { category_weight: audit.weight } : {}),
|
|
121
|
+
...(audit.category ? { category: audit.category } : {}),
|
|
42
122
|
},
|
|
43
123
|
};
|
|
44
124
|
}
|
|
@@ -186,10 +266,44 @@ export function formatStaticAnalysisFinding(issue) {
|
|
|
186
266
|
},
|
|
187
267
|
};
|
|
188
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* axe rule ids are the same identifiers Lighthouse uses for its accessibility
|
|
271
|
+
* audits — Lighthouse runs axe internally — so an axe finding can borrow the
|
|
272
|
+
* QA prose already written for the matching Lighthouse audit instead of
|
|
273
|
+
* duplicating it. Falls back to axe's own help text, stripped of the trailing
|
|
274
|
+
* documentation URL that would otherwise land in a defect ticket.
|
|
275
|
+
*/
|
|
276
|
+
function axeDescription(violation) {
|
|
277
|
+
const shared = QA_DESCRIPTIONS[violation.code];
|
|
278
|
+
if (shared) {
|
|
279
|
+
return shared({ id: violation.code, displayValue: "" });
|
|
280
|
+
}
|
|
281
|
+
const cleaned = violation.message.replace(/\s*\(https?:\/\/[^)]*\)\s*$/, "").trim();
|
|
282
|
+
return cleaned
|
|
283
|
+
? `${cleaned}. Flagged by axe as ${violation.impact ?? "unrated"} impact; assistive-tech users are likely affected.`
|
|
284
|
+
: `axe rule "${violation.code}" failed; assistive-tech users are likely affected.`;
|
|
285
|
+
}
|
|
189
286
|
export function formatA11yFinding(violation) {
|
|
190
287
|
if (violation.type === "notice")
|
|
191
288
|
return null;
|
|
192
|
-
|
|
289
|
+
if (violation.runner === "axe") {
|
|
290
|
+
const priority = axeImpactToPriority(violation.impact, violation.needsReview);
|
|
291
|
+
if (!priority)
|
|
292
|
+
return null;
|
|
293
|
+
return {
|
|
294
|
+
priority,
|
|
295
|
+
title: violation.message.replace(/\s*\(https?:\/\/[^)]*\)\s*$/, "").trim() || violation.code,
|
|
296
|
+
description: axeDescription(violation),
|
|
297
|
+
evidence: {
|
|
298
|
+
rule_code: violation.code,
|
|
299
|
+
selector: violation.selector,
|
|
300
|
+
runner: "axe",
|
|
301
|
+
...(violation.impact ? { axe_impact: violation.impact } : {}),
|
|
302
|
+
...(violation.needsReview ? { needs_manual_review: true } : {}),
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
const priority = a11yTechniqueToPriority(violation.technique, violation.wcagLevel);
|
|
193
307
|
if (!priority)
|
|
194
308
|
return null;
|
|
195
309
|
const describe = lookupA11yTemplate(violation.technique);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defectFormatter.js","sourceRoot":"","sources":["../../src/mappers/defectFormatter.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAK7B,MAAM,eAAe,GAA8B;IACjD,wBAAwB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC9B,wCAAwC,CAAC,CAAC,YAAY,gGAAgG;IACxJ,0BAA0B,EAAE,CAAC,CAAC,EAAE,EAAE,CAChC,mCAAmC,CAAC,CAAC,YAAY,2EAA2E;IAC9H,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CACnB,kBAAkB,CAAC,CAAC,YAAY,qEAAqE;IACvG,qBAAqB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC3B,8CAA8C,CAAC,CAAC,YAAY,6CAA6C;IAC3G,yBAAyB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC/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,QAAQ;SAC7B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
import type { Finding, Priority } from "../types.js";
|
|
2
2
|
export type { Priority };
|
|
3
3
|
export declare function lighthouseScoreToPriority(score: number): Priority | null;
|
|
4
|
+
/**
|
|
5
|
+
* Priority from an audit's actual impact on its Lighthouse category score.
|
|
6
|
+
*
|
|
7
|
+
* Scoring on `score` alone made every failing binary audit a P1: binary audits
|
|
8
|
+
* score exactly 0 when they fail, so a missing llms.txt ranked level with a
|
|
9
|
+
* 30-second Time to Interactive. On a real commerce page that produced 24
|
|
10
|
+
* Lighthouse P1s, 18 of them binary — and 19 of the 35 failing audits carried
|
|
11
|
+
* weight 0, meaning Lighthouse itself counts them toward no category score at
|
|
12
|
+
* all.
|
|
13
|
+
*
|
|
14
|
+
* `weight * (1 - score)` is the number of category points the audit actually
|
|
15
|
+
* costs — the same quantity Lighthouse uses to compute the category score. It
|
|
16
|
+
* ranks a weight-30 metric failing outright (30) above a weight-25 metric
|
|
17
|
+
* scoring 78 (5.5) above a weight-1 SEO check (1), which is the ordering a
|
|
18
|
+
* human triager would pick.
|
|
19
|
+
*
|
|
20
|
+
* Weight-0 diagnostics stay reportable but never block: they are supporting
|
|
21
|
+
* detail for the weighted metrics, and counting them again is double-counting
|
|
22
|
+
* (unused-javascript, bootup-time and mainthread-work-breakdown all describe
|
|
23
|
+
* the same overloaded main thread that total-blocking-time already charges for).
|
|
24
|
+
*
|
|
25
|
+
* `weight` undefined means the audit belongs to no category, which is not the
|
|
26
|
+
* same as weight 0 — fall back to the score-only mapping there.
|
|
27
|
+
*/
|
|
28
|
+
export declare function lighthouseImpactToPriority(score: number, weight: number | undefined): Priority | null;
|
|
4
29
|
export declare function wcagLevelToPriority(level: string): Priority | null;
|
|
30
|
+
/**
|
|
31
|
+
* Priority for an axe finding, from axe's own impact rating.
|
|
32
|
+
*
|
|
33
|
+
* Same principle as using Lighthouse's audit weight: the tool has already
|
|
34
|
+
* graded severity, so grade with it rather than inventing a parallel scheme.
|
|
35
|
+
* axe's ladder is critical > serious > moderate > minor.
|
|
36
|
+
*
|
|
37
|
+
* `needsFurtherReview` marks a rule that could not decide on its own and wants
|
|
38
|
+
* a human to confirm. Those are demoted one tier — a maybe should not gate a
|
|
39
|
+
* release with the same force as a definite.
|
|
40
|
+
*/
|
|
41
|
+
export declare function axeImpactToPriority(impact: string | undefined, needsReview: boolean | undefined): Priority | null;
|
|
42
|
+
export declare function a11yTechniqueToPriority(technique: string, wcagLevel: string): Priority | null;
|
|
5
43
|
export declare function staticAnalysisToPriority(source: "eslint" | "semgrep", severity: number | string, category?: string): Priority | null;
|
|
6
44
|
export declare function sortFindingsByPriority<T extends Finding>(findings: T[]): T[];
|
|
@@ -8,6 +8,42 @@ export function lighthouseScoreToPriority(score) {
|
|
|
8
8
|
return "P3";
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Priority from an audit's actual impact on its Lighthouse category score.
|
|
13
|
+
*
|
|
14
|
+
* Scoring on `score` alone made every failing binary audit a P1: binary audits
|
|
15
|
+
* score exactly 0 when they fail, so a missing llms.txt ranked level with a
|
|
16
|
+
* 30-second Time to Interactive. On a real commerce page that produced 24
|
|
17
|
+
* Lighthouse P1s, 18 of them binary — and 19 of the 35 failing audits carried
|
|
18
|
+
* weight 0, meaning Lighthouse itself counts them toward no category score at
|
|
19
|
+
* all.
|
|
20
|
+
*
|
|
21
|
+
* `weight * (1 - score)` is the number of category points the audit actually
|
|
22
|
+
* costs — the same quantity Lighthouse uses to compute the category score. It
|
|
23
|
+
* ranks a weight-30 metric failing outright (30) above a weight-25 metric
|
|
24
|
+
* scoring 78 (5.5) above a weight-1 SEO check (1), which is the ordering a
|
|
25
|
+
* human triager would pick.
|
|
26
|
+
*
|
|
27
|
+
* Weight-0 diagnostics stay reportable but never block: they are supporting
|
|
28
|
+
* detail for the weighted metrics, and counting them again is double-counting
|
|
29
|
+
* (unused-javascript, bootup-time and mainthread-work-breakdown all describe
|
|
30
|
+
* the same overloaded main thread that total-blocking-time already charges for).
|
|
31
|
+
*
|
|
32
|
+
* `weight` undefined means the audit belongs to no category, which is not the
|
|
33
|
+
* same as weight 0 — fall back to the score-only mapping there.
|
|
34
|
+
*/
|
|
35
|
+
export function lighthouseImpactToPriority(score, weight) {
|
|
36
|
+
if (score >= 90)
|
|
37
|
+
return null;
|
|
38
|
+
if (weight === undefined)
|
|
39
|
+
return lighthouseScoreToPriority(score);
|
|
40
|
+
const impact = weight * (1 - score / 100);
|
|
41
|
+
if (impact >= 10)
|
|
42
|
+
return "P1";
|
|
43
|
+
if (impact >= 3)
|
|
44
|
+
return "P2";
|
|
45
|
+
return "P3";
|
|
46
|
+
}
|
|
11
47
|
// Pass "notice" (or "warning" / "unknown") to suppress the finding.
|
|
12
48
|
export function wcagLevelToPriority(level) {
|
|
13
49
|
if (level === "A")
|
|
@@ -18,6 +54,96 @@ export function wcagLevelToPriority(level) {
|
|
|
18
54
|
return "P3";
|
|
19
55
|
return null;
|
|
20
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Priority for a pa11y violation, keyed on the WCAG technique rather than the
|
|
59
|
+
* conformance level.
|
|
60
|
+
*
|
|
61
|
+
* Level is not impact. Almost everything a WCAG2AA scan detects is Level A, so
|
|
62
|
+
* mapping A→P1 made all 17 pa11y findings on a real page P1 and left the tier
|
|
63
|
+
* doing no discrimination. Technique says what actually breaks: an unlabelled
|
|
64
|
+
* input stops a screen-reader user completing a form, while a duplicate id
|
|
65
|
+
* degrades an experience that still works.
|
|
66
|
+
*
|
|
67
|
+
* Keys are matched by the progressive-narrowing rule used for descriptions —
|
|
68
|
+
* "H91.InputText.Name" falls back to "H91" — and anything unlisted falls back
|
|
69
|
+
* to the conformance-level mapping.
|
|
70
|
+
*/
|
|
71
|
+
const TECHNIQUE_PRIORITY = {
|
|
72
|
+
// P1 — blocks a user from completing a task.
|
|
73
|
+
H91: "P1", // no accessible name on an interactive element
|
|
74
|
+
F68: "P1", // form control with no label
|
|
75
|
+
H44: "P1", // label not associated with its control
|
|
76
|
+
ARIA6: "P1", // empty/invalid aria-label
|
|
77
|
+
ARIA9: "P1", // aria-labelledby pointing at missing ids
|
|
78
|
+
H32: "P1", // form with no submit mechanism
|
|
79
|
+
H37: "P1", // img with no alt
|
|
80
|
+
F65: "P1", // img with neither alt nor title
|
|
81
|
+
H30: "P1", // link whose only content is an unlabelled image
|
|
82
|
+
H36: "P1", // image submit button with no alt
|
|
83
|
+
H53: "P1", // object with no fallback content
|
|
84
|
+
G202: "P1", // keyboard focus trapped or invisible
|
|
85
|
+
F54: "P1", // mouse-only interaction
|
|
86
|
+
F55: "P1", // focus stolen on hover
|
|
87
|
+
G18: "P1", // body text below 4.5:1 contrast
|
|
88
|
+
G145: "P1", // large text below 3:1 contrast
|
|
89
|
+
// P2 — degrades the experience without blocking it.
|
|
90
|
+
F77: "P2", // duplicate id
|
|
91
|
+
H93: "P2", // duplicate id (label/for variant)
|
|
92
|
+
G141: "P2", // heading levels skipped
|
|
93
|
+
H42: "P2", // text styled as a heading but not marked up
|
|
94
|
+
H25: "P2", // missing page title
|
|
95
|
+
F89: "P2", // empty page title
|
|
96
|
+
H57: "P2", // missing lang on <html>
|
|
97
|
+
H58: "P2", // unmarked language change
|
|
98
|
+
H64: "P2", // iframe with no title
|
|
99
|
+
H67: "P2", // decorative img carrying meaning
|
|
100
|
+
G94: "P2", // inaccurate alt text
|
|
101
|
+
"G1,G123,G124": "P2", // link to a named anchor that does not exist
|
|
102
|
+
H85: "P2", // ungrouped select options
|
|
103
|
+
G174: "P2", // no higher-contrast alternative
|
|
104
|
+
F40: "P2", // meta refresh with delay
|
|
105
|
+
F41: "P2", // auto-refresh with no user control
|
|
106
|
+
// P3 — advisory.
|
|
107
|
+
F92: "P3", // role="presentation" hiding real semantics
|
|
108
|
+
ARIA4: "P3", // role inappropriate for the content
|
|
109
|
+
H49: "P3", // emphasis conveyed only visually
|
|
110
|
+
F2: "P3", // meaning conveyed by formatting alone
|
|
111
|
+
G14: "P3", // meaning conveyed by colour alone
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Priority for an axe finding, from axe's own impact rating.
|
|
115
|
+
*
|
|
116
|
+
* Same principle as using Lighthouse's audit weight: the tool has already
|
|
117
|
+
* graded severity, so grade with it rather than inventing a parallel scheme.
|
|
118
|
+
* axe's ladder is critical > serious > moderate > minor.
|
|
119
|
+
*
|
|
120
|
+
* `needsFurtherReview` marks a rule that could not decide on its own and wants
|
|
121
|
+
* a human to confirm. Those are demoted one tier — a maybe should not gate a
|
|
122
|
+
* release with the same force as a definite.
|
|
123
|
+
*/
|
|
124
|
+
export function axeImpactToPriority(impact, needsReview) {
|
|
125
|
+
const base = impact === "critical" ? "P1"
|
|
126
|
+
: impact === "serious" ? "P2"
|
|
127
|
+
: impact === "moderate" ? "P3"
|
|
128
|
+
: impact === "minor" ? "P3"
|
|
129
|
+
: "P3"; // unrated: report, never block
|
|
130
|
+
if (!needsReview)
|
|
131
|
+
return base;
|
|
132
|
+
return base === "P1" ? "P2" : "P3";
|
|
133
|
+
}
|
|
134
|
+
export function a11yTechniqueToPriority(technique, wcagLevel) {
|
|
135
|
+
let key = technique;
|
|
136
|
+
while (key) {
|
|
137
|
+
const p = TECHNIQUE_PRIORITY[key];
|
|
138
|
+
if (p)
|
|
139
|
+
return p;
|
|
140
|
+
const lastDot = key.lastIndexOf(".");
|
|
141
|
+
if (lastDot < 0)
|
|
142
|
+
break;
|
|
143
|
+
key = key.slice(0, lastDot);
|
|
144
|
+
}
|
|
145
|
+
return wcagLevelToPriority(wcagLevel);
|
|
146
|
+
}
|
|
21
147
|
export function staticAnalysisToPriority(source, severity, category) {
|
|
22
148
|
// Security findings always win regardless of severity level.
|
|
23
149
|
if (source === "semgrep" && category === "security")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priorityMapper.js","sourceRoot":"","sources":["../../src/mappers/priorityMapper.ts"],"names":[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CAAC;IAC9B,CAAC;IACD,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,MAA4B,EAC5B,QAAyB,EACzB,QAAiB;IAEjB,6DAA6D;IAC7D,IAAI,MAAM,KAAK,SAAS,IAAI,QAAQ,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACjE,IAAI,MAAM,KAAK,QAAQ,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1F,IAAI,MAAM,KAAK,QAAQ,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,6CAA6C;IAC7C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAoB,QAAa;IACrE,OAAO,QAAQ,CAAC,IAAI,CAClB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAClE,CAAC;AACJ,CAAC"}
|
|
@@ -3,56 +3,97 @@ import { runShell } from "../utils/shellRunner.js";
|
|
|
3
3
|
import { parsePa11yJSON } from "../utils/outputParsers.js";
|
|
4
4
|
import { shellErrorResponse, parseErrorResponse, } from "../utils/toolResponse.js";
|
|
5
5
|
import { formatA11yFinding } from "../mappers/defectFormatter.js";
|
|
6
|
+
import { dedupeA11yFindings } from "../mappers/a11yDedupe.js";
|
|
6
7
|
import { sortFindingsByPriority } from "../mappers/priorityMapper.js";
|
|
7
8
|
const inputShape = {
|
|
8
9
|
url: z.string().url(),
|
|
9
10
|
standard: z.enum(["WCAG2A", "WCAG2AA", "WCAG2AAA"]).optional(),
|
|
10
11
|
ignore: z.array(z.string()).optional(),
|
|
12
|
+
runner: z
|
|
13
|
+
.enum(["htmlcs", "axe", "both"])
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("Which accessibility engine to run. 'htmlcs' (default) checks WCAG " +
|
|
16
|
+
"techniques and is strong on document structure, labels, and forms. " +
|
|
17
|
+
"'axe' is Deque's engine and is materially stronger on ARIA — roles, " +
|
|
18
|
+
"required parent/child relationships, prohibited and unsupported " +
|
|
19
|
+
"attributes — and on computed colour contrast, so prefer it when the " +
|
|
20
|
+
"work under test involves ARIA or a component library. 'both' runs " +
|
|
21
|
+
"the two and merges the results, which is the most thorough option " +
|
|
22
|
+
"and roughly doubles runtime."),
|
|
11
23
|
};
|
|
12
24
|
export function registerAccessibilityTool(server) {
|
|
13
25
|
server.registerTool("run_accessibility_check", {
|
|
14
|
-
description: "Runs pa11y against a URL and returns a QA-style report
|
|
15
|
-
"violations
|
|
16
|
-
"
|
|
17
|
-
"
|
|
26
|
+
description: "Runs pa11y against a URL and returns a QA-style report of WCAG " +
|
|
27
|
+
"violations prioritised P1/P2/P3 (notices are filtered out). " +
|
|
28
|
+
"\n\n" +
|
|
29
|
+
"Two engines are available via `runner`. htmlcs (default) checks WCAG " +
|
|
30
|
+
"techniques and is strong on document structure, labels, and forms. " +
|
|
31
|
+
"axe is Deque's engine and is materially stronger on ARIA — invalid " +
|
|
32
|
+
"roles, missing required parent/child relationships, prohibited and " +
|
|
33
|
+
"unsupported attributes — and on computed colour contrast. " +
|
|
34
|
+
"**Prefer runner='axe' whenever the work under test involves ARIA, a " +
|
|
35
|
+
"component library, or a design system**, and runner='both' for the " +
|
|
36
|
+
"most thorough sweep. The two engines overlap only partly: on a real " +
|
|
37
|
+
"commerce page htmlcs found unlabelled inputs and duplicate ids that " +
|
|
38
|
+
"axe did not, while axe found aria-allowed-attr, aria-required-parent " +
|
|
39
|
+
"and image-alt failures htmlcs missed entirely. " +
|
|
40
|
+
"\n\n" +
|
|
41
|
+
"Requires the pa11y CLI on PATH (`npm install -g pa11y`).",
|
|
18
42
|
inputSchema: inputShape,
|
|
19
|
-
}, async ({ url, standard, ignore }) => {
|
|
43
|
+
}, async ({ url, standard, ignore, runner }) => {
|
|
20
44
|
const resolvedStandard = standard ?? "WCAG2AA";
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"json",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
45
|
+
const resolvedRunner = runner ?? "htmlcs";
|
|
46
|
+
const engines = resolvedRunner === "both" ? ["htmlcs", "axe"] : [resolvedRunner];
|
|
47
|
+
const buildArgs = (engine) => {
|
|
48
|
+
const args = [url, "--reporter", "json", "--standard", resolvedStandard,
|
|
49
|
+
"--runner", engine];
|
|
50
|
+
if (ignore && ignore.length > 0)
|
|
51
|
+
args.push("--ignore", ignore.join(";"));
|
|
52
|
+
return args;
|
|
53
|
+
};
|
|
54
|
+
// Engines run concurrently so "both" costs little more wall time than one.
|
|
55
|
+
const results = await Promise.all(engines.map((e) => runShell("pa11y", buildArgs(e), { timeoutMs: 120_000 })));
|
|
32
56
|
// pa11y exits 2 when issues are found — that's a successful run with data.
|
|
33
57
|
// Exit 1 means pa11y itself failed (browser launch, bad URL, etc.).
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
return shellErrorResponse("pa11y did not produce a usable report",
|
|
37
|
-
}
|
|
38
|
-
let parsed;
|
|
39
|
-
try {
|
|
40
|
-
parsed = parsePa11yJSON(result.stdout);
|
|
41
|
-
}
|
|
42
|
-
catch (err) {
|
|
43
|
-
return parseErrorResponse("Failed to parse pa11y JSON", err, result);
|
|
58
|
+
const usable = results.filter((r) => (r.exitCode === 0 || r.exitCode === 2) && r.stdout);
|
|
59
|
+
if (usable.length === 0) {
|
|
60
|
+
return shellErrorResponse("pa11y did not produce a usable report", results[0]);
|
|
44
61
|
}
|
|
45
|
-
const
|
|
46
|
-
for (const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
62
|
+
const rawFindings = [];
|
|
63
|
+
for (const result of usable) {
|
|
64
|
+
let parsed;
|
|
65
|
+
try {
|
|
66
|
+
parsed = parsePa11yJSON(result.stdout);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
return parseErrorResponse("Failed to parse pa11y JSON", err, result);
|
|
70
|
+
}
|
|
71
|
+
for (const violation of parsed.violations) {
|
|
72
|
+
const finding = formatA11yFinding(violation);
|
|
73
|
+
if (finding)
|
|
74
|
+
rawFindings.push(finding);
|
|
75
|
+
}
|
|
50
76
|
}
|
|
77
|
+
// Collapse repeats of the same defect before counting or sorting — see
|
|
78
|
+
// a11yDedupe for why pa11y produces them. Note this dedupes *within* an
|
|
79
|
+
// engine only: the key is (rule_code, selector), and the two engines emit
|
|
80
|
+
// different code shapes for the same defect ("...1_1_1.H37" vs
|
|
81
|
+
// "image-alt"), so an element both engines flag appears twice. That is
|
|
82
|
+
// deliberate for now — two independent engines agreeing is corroboration
|
|
83
|
+
// worth seeing, the same signal the Lighthouse/pa11y correlator promotes.
|
|
84
|
+
const { findings, rawCount } = dedupeA11yFindings(rawFindings);
|
|
51
85
|
sortFindingsByPriority(findings);
|
|
52
86
|
const report = {
|
|
53
87
|
url,
|
|
54
88
|
standard: resolvedStandard,
|
|
89
|
+
runners: engines,
|
|
90
|
+
...(usable.length < engines.length
|
|
91
|
+
? { warnings: [`Only ${usable.length} of ${engines.length} runners produced output.`] }
|
|
92
|
+
: {}),
|
|
55
93
|
violation_count: findings.length,
|
|
94
|
+
// Pre-dedup total, so a large drop between the two is explainable
|
|
95
|
+
// rather than looking like dropped findings.
|
|
96
|
+
raw_violation_count: rawCount,
|
|
56
97
|
findings,
|
|
57
98
|
};
|
|
58
99
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility.js","sourceRoot":"","sources":["../../src/tools/accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,K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C,OAAO,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;QAED,uEAAuE;QACvE,wEAAwE;QACxE,0EAA0E;QAC1E,+DAA+D;QAC/D,uEAAuE;QACvE,yEAAyE;QACzE,0EAA0E;QAC1E,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;QAC/D,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAEjC,MAAM,MAAM,GAAG;YACb,GAAG;YACH,QAAQ,EAAE,gBAAgB;YAC1B,OAAO,EAAE,OAAO;YAChB,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;gBAChC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,MAAM,CAAC,MAAM,OAAO,OAAO,CAAC,MAAM,2BAA2B,CAAC,EAAE;gBACvF,CAAC,CAAC,EAAE,CAAC;YACP,eAAe,EAAE,QAAQ,CAAC,MAAM;YAChC,kEAAkE;YAClE,6CAA6C;YAC7C,mBAAmB,EAAE,QAAQ;YAC7B,QAAQ;SACT,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACnE,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
export type FormFactor = "mobile" | "desktop";
|
|
3
|
+
/**
|
|
4
|
+
* Lighthouse defaults to mobile: a 412x823 screen, a mid-range Android UA,
|
|
5
|
+
* simulated slow 4G and a 4x CPU slowdown. Desktop needs --preset=desktop,
|
|
6
|
+
* which also drops throttling to 1x.
|
|
7
|
+
*
|
|
8
|
+
* These are not interchangeable runs. On a real commerce page the desktop
|
|
9
|
+
* pass scored accessibility 73 against mobile's 87 and surfaced image-alt,
|
|
10
|
+
* aria-required-children, aria-required-parent, aria-allowed-attr and
|
|
11
|
+
* aria-valid-attr-value failures that the mobile pass never reported, because
|
|
12
|
+
* the two render different DOM. Mobile likewise found failures desktop did
|
|
13
|
+
* not. Neither substitutes for the other.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formFactorArgs(ff: FormFactor): string[];
|
|
2
16
|
export declare function registerLighthouseTool(server: McpServer): void;
|