nfunc-mcp 0.1.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 +88 -43
- 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 +117 -70
- package/dist/tools/qaGate.js.map +1 -1
- package/dist/tools/staticAnalysis.js +15 -67
- package/dist/tools/staticAnalysis.js.map +1 -1
- package/dist/utils/eslintConfigDetector.d.ts +13 -0
- package/dist/utils/eslintConfigDetector.js +65 -2
- package/dist/utils/eslintConfigDetector.js.map +1 -1
- package/dist/utils/eslintRunner.d.ts +9 -0
- package/dist/utils/eslintRunner.js +103 -0
- package/dist/utils/eslintRunner.js.map +1 -0
- 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
|
@@ -9,17 +9,49 @@ function promotePriority(p) {
|
|
|
9
9
|
// Maps Lighthouse accessibility audit IDs to substrings that appear inside the
|
|
10
10
|
// pa11y rule_code for the same class of issue. A leading "." prevents matching
|
|
11
11
|
// partial segment names (e.g. ".H44" won't accidentally match ".1H44").
|
|
12
|
+
//
|
|
13
|
+
// Keep this keyed on defects the two tools genuinely detect in common. A wrong
|
|
14
|
+
// entry is worse than a missing one: a bogus match promotes a finding a whole
|
|
15
|
+
// priority tier and stamps it "confirmed by two tools". Where Lighthouse and
|
|
16
|
+
// pa11y test adjacent-but-different criteria (e.g. label-content-name-mismatch
|
|
17
|
+
// under WCAG 2.5.3 vs F68 under 1.3.1) they are deliberately left unmapped.
|
|
12
18
|
const LH_TO_PA11Y_SUBSTRINGS = {
|
|
19
|
+
// Colour / contrast
|
|
13
20
|
"color-contrast": [".G18", ".G145", ".G174"],
|
|
21
|
+
// Images
|
|
14
22
|
"image-alt": [".H37", ".H67", ".F65"],
|
|
23
|
+
"input-image-alt": [".H36"],
|
|
24
|
+
"object-alt": [".H53"],
|
|
25
|
+
// Accessible names on controls
|
|
15
26
|
label: [".H44", ".F68", ".H91.Input", ".H91.Select", ".H91.Textarea"],
|
|
27
|
+
"form-field-multiple-labels": [".H44", ".F68"],
|
|
28
|
+
"button-name": [".H91.Button"],
|
|
29
|
+
"select-name": [".H91.Select"],
|
|
30
|
+
"aria-input-field-name": [".ARIA6", ".ARIA9", ".H91"],
|
|
31
|
+
"aria-toggle-field-name": [".ARIA6", ".ARIA9", ".H91"],
|
|
32
|
+
"aria-command-name": [".ARIA6", ".ARIA9", ".H91"],
|
|
33
|
+
"aria-dialog-name": [".ARIA6", ".ARIA9"],
|
|
34
|
+
// ARIA misuse
|
|
35
|
+
"aria-prohibited-attr": [".ARIA6", ".ARIA4"],
|
|
36
|
+
"aria-valid-attr-value": [".ARIA9"],
|
|
37
|
+
// Links
|
|
16
38
|
"link-name": [".H30", ".H91.A."],
|
|
39
|
+
"link-text": [".H30", ".H91.A."],
|
|
40
|
+
"crawlable-anchors": [".G1,G123,G124", ".H30"],
|
|
41
|
+
// Document / language
|
|
17
42
|
"document-title": [".H25", ".F89"],
|
|
18
43
|
"html-has-lang": [".H57"],
|
|
44
|
+
"html-lang-valid": [".H57"],
|
|
45
|
+
"valid-lang": [".H58"],
|
|
46
|
+
// Structure
|
|
47
|
+
"heading-order": [".G141", ".H42"],
|
|
19
48
|
"frame-title": [".H64"],
|
|
20
|
-
|
|
21
|
-
|
|
49
|
+
// Duplicate identifiers. Lighthouse 12 removed duplicate-id-aria altogether,
|
|
50
|
+
// which is why a page throwing 35 pa11y F77 violations correlated with
|
|
51
|
+
// nothing under Lighthouse 13. Both ids are kept so older Lighthouse output
|
|
52
|
+
// still matches; there is currently no LH 13 equivalent to pair F77 with.
|
|
22
53
|
"duplicate-id-aria": [".H93", ".F77"],
|
|
54
|
+
"duplicate-id-active": [".H93", ".F77"],
|
|
23
55
|
};
|
|
24
56
|
// Lighthouse performance audit IDs where Rule 2 (code linkage) is relevant.
|
|
25
57
|
const PERFORMANCE_AUDIT_IDS = new Set([
|
|
@@ -30,14 +62,27 @@ const PERFORMANCE_AUDIT_IDS = new Set([
|
|
|
30
62
|
"mainthread-work-breakdown",
|
|
31
63
|
"total-blocking-time",
|
|
32
64
|
]);
|
|
65
|
+
// Deterministic non-crypto string hash (djb2), base36-encoded.
|
|
66
|
+
// Selectors are long and routinely share long prefixes — e.g.
|
|
67
|
+
// "#accordion-panel-:rn: > div > div > input:nth-child(1)" and the same
|
|
68
|
+
// selector ending ":nth-child(3)" are identical for their first 40 characters.
|
|
69
|
+
// The previous id truncated the selector to 16 chars, so those two distinct
|
|
70
|
+
// findings collapsed to one id and consumedA11yIds claimed the wrong entry
|
|
71
|
+
// during correlation. Hashing the whole selector keeps ids short and unique.
|
|
72
|
+
function shortHash(input) {
|
|
73
|
+
let h = 5381;
|
|
74
|
+
for (let i = 0; i < input.length; i++) {
|
|
75
|
+
h = ((h << 5) + h + input.charCodeAt(i)) | 0;
|
|
76
|
+
}
|
|
77
|
+
return (h >>> 0).toString(36);
|
|
78
|
+
}
|
|
33
79
|
function makeId(tool, f) {
|
|
34
80
|
const e = f.evidence;
|
|
35
81
|
if (tool === "lighthouse")
|
|
36
82
|
return `lh:${String(e["audit_id"] ?? f.title)}`;
|
|
37
83
|
if (tool === "a11y") {
|
|
38
84
|
const code = String(e["rule_code"] ?? "").split(".").slice(-2).join(".");
|
|
39
|
-
|
|
40
|
-
return `a11y:${code}:${sel}`;
|
|
85
|
+
return `a11y:${code}:${shortHash(String(e["selector"] ?? ""))}`;
|
|
41
86
|
}
|
|
42
87
|
const basename = String(e["file"] ?? "").split("/").pop() ?? "";
|
|
43
88
|
return `static:${String(e["source"] ?? "")}:${basename}:${String(e["line"] ?? "")}`;
|
|
@@ -58,37 +103,53 @@ function applyRule1(lhFindings, a11yFindings) {
|
|
|
58
103
|
const substrings = LH_TO_PA11Y_SUBSTRINGS[auditId];
|
|
59
104
|
if (!substrings)
|
|
60
105
|
continue;
|
|
61
|
-
|
|
106
|
+
// Claim every unconsumed pa11y finding covering the same technique, not
|
|
107
|
+
// just the first. One Lighthouse audit routinely corresponds to several
|
|
108
|
+
// pa11y violations — one per offending element — and stopping at the first
|
|
109
|
+
// left the rest to reappear as uncorroborated copies of the same defect.
|
|
110
|
+
const matches = a11yFindings.filter((a11yF) => {
|
|
62
111
|
if (consumedA11yIds.has(a11yF.id))
|
|
63
|
-
|
|
112
|
+
return false;
|
|
64
113
|
const ruleCode = String(a11yF.evidence["rule_code"] ?? "");
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
114
|
+
return substrings.some((s) => ruleCode.includes(s));
|
|
115
|
+
});
|
|
116
|
+
if (matches.length === 0)
|
|
117
|
+
continue;
|
|
118
|
+
// Use the most severe of the matched pa11y findings, then take the better
|
|
119
|
+
// (lower index = higher priority) of that and the Lighthouse finding as the
|
|
120
|
+
// base, and promote it one tier.
|
|
121
|
+
const worstA11y = matches.reduce((a, b) => PRIORITY_ORDER[a.priority] <= PRIORITY_ORDER[b.priority] ? a : b);
|
|
122
|
+
const basePriority = PRIORITY_ORDER[lhF.priority] <= PRIORITY_ORDER[worstA11y.priority]
|
|
123
|
+
? lhF.priority
|
|
124
|
+
: worstA11y.priority;
|
|
125
|
+
// Findings arrive here already deduplicated, so fold the collapsed
|
|
126
|
+
// occurrence counts back in to report how many elements are affected.
|
|
127
|
+
const elementCount = matches.reduce((n, m) => n + Number(m.evidence["occurrences"] ?? 1), 0);
|
|
128
|
+
correlated.push({
|
|
129
|
+
id: `corr:lh+a11y:${auditId}`,
|
|
130
|
+
source_tool: "lighthouse+pa11y",
|
|
131
|
+
priority: promotePriority(basePriority),
|
|
132
|
+
title: lhF.title,
|
|
133
|
+
description: `[Lighthouse] ${lhF.description} ` +
|
|
134
|
+
`[pa11y] ${worstA11y.description} ` +
|
|
135
|
+
`Two independent tools flagged the same accessibility gap across ` +
|
|
136
|
+
`${elementCount} element${elementCount !== 1 ? "s" : ""} — ` +
|
|
137
|
+
`this cross-tool confirmation increases confidence that the issue is real and affects real users.`,
|
|
138
|
+
evidence: {
|
|
139
|
+
...lhF.evidence,
|
|
140
|
+
pa11y_rule_codes: [
|
|
141
|
+
...new Set(matches.map((m) => String(m.evidence["rule_code"] ?? ""))),
|
|
142
|
+
],
|
|
143
|
+
pa11y_selectors: matches
|
|
144
|
+
.slice(0, 5)
|
|
145
|
+
.map((m) => String(m.evidence["selector"] ?? "")),
|
|
146
|
+
pa11y_elements_affected: elementCount,
|
|
147
|
+
},
|
|
148
|
+
confirmed_by: ["lighthouse", "pa11y"],
|
|
149
|
+
});
|
|
150
|
+
consumedLhIds.add(lhF.id);
|
|
151
|
+
for (const m of matches)
|
|
152
|
+
consumedA11yIds.add(m.id);
|
|
92
153
|
}
|
|
93
154
|
return { correlated, consumedLhIds, consumedA11yIds };
|
|
94
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correlator.js","sourceRoot":"","sources":["../../src/mappers/correlator.ts"],"names":[],"mappings":"AA+BA,MAAM,cAAc,GAA6B,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AAEzE,SAAS,eAAe,CAAC,CAAW;IAClC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAC/E,gFAAgF;AAChF,wEAAwE;AACxE,MAAM,sBAAsB,GAA6B;IACvD,gBAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"correlator.js","sourceRoot":"","sources":["../../src/mappers/correlator.ts"],"names":[],"mappings":"AA+BA,MAAM,cAAc,GAA6B,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AAEzE,SAAS,eAAe,CAAC,CAAW;IAClC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAC/E,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,MAAM,sBAAsB,GAA6B;IACvD,oBAAoB;IACpB,gBAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;IAE5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,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;IAEnE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,UAAU,CAC/D,QAAQ,EACR,UAAU,CACX,CAAC;IAEF,MAAM,WAAW,GAAG,UAAU,CAC5B,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAChD,YAAY,CACb,CAAC;IACF,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3E,OAAO;QACL,mBAAmB,EAAE,UAAU;QAC/B,eAAe,EAAE,CAAC,GAAG,WAAW,EAAE,GAAG,aAAa,EAAE,GAAG,YAAY,CAAC;QACpE,kBAAkB,EAAE,UAAU,CAAC,MAAM;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -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/B,wDAAwD,CAAC,CAAC,YAAY,2DAA2D;IACnI,WAAW,EAAE,CAAC,CA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
|
|
|
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")
|