auditmysite 1.2.0

Resource-efficient WCAG 2.1 Accessibility Checker in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/casoon/auditmysite/docs/json-report.schema.json",
  "title": "auditmysite unified report (single)",
  "type": "object",
  "required": ["schema_version", "report_type", "metadata", "metric_context", "summary", "pages"],
  "additionalProperties": false,
  "properties": {
    "schema_version": { "type": "string", "const": "2.0" },
    "report_type": { "type": "string", "const": "single" },
    "tool_version": { "type": "string" },
    "metadata": { "$ref": "#/$defs/metadata" },
    "audit_scope": { "$ref": "#/$defs/auditScope" },
    "execution_environment": { "type": "object" },
    "audit_quality": { "$ref": "#/$defs/auditQuality" },
    "metric_context": { "$ref": "#/$defs/metricContext" },
    "artifacts": { "type": "array", "items": { "$ref": "#/$defs/artifact" } },
    "summary": { "$ref": "#/$defs/summary" },
    "pages": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": { "$ref": "#/$defs/pageEntry" }
    },
    "collection_errors": {
      "description": "Errors raised while serializing the report. Audit and measurement failures are represented separately in module_runs, rule_outcomes, and audit_quality.",
      "type": "array",
      "items": { "$ref": "#/$defs/reportError" }
    },
    "verdict": { "type": "string", "enum": ["pass", "warn", "fail"] },
    "verdict_reasons": { "type": "array", "items": { "type": "string" } }
  },
  "$defs": {
    "artifact": {
      "type": "object",
      "required": ["kind", "media_type", "delivery", "path_template", "status"],
      "additionalProperties": false,
      "properties": {
        "kind": { "type": "string" },
        "media_type": { "type": "string" },
        "delivery": { "type": "string", "enum": ["sidecar"] },
        "path_template": { "type": "string" },
        "status": { "type": "string", "enum": ["completed", "partial", "failed", "skipped", "not_applicable", "not_requested"] }
      }
    },
    "reportError": {
      "type": "object",
      "required": ["module", "error_type", "reason"],
      "additionalProperties": false,
      "properties": {
        "module": { "type": "string" },
        "error_type": { "type": "string" },
        "reason": { "type": "string" }
      }
    },
    "auditScope": {
      "type": "object",
      "required": ["requested_modules", "full_audit", "interactive_mode", "journey_budget_ms", "throttling_profiles", "viewports", "dismiss_consent", "capture_screenshots", "capture_element_evidence"],
      "additionalProperties": false,
      "properties": {
        "requested_modules": { "type": "array", "items": { "type": "string" } },
        "full_audit": { "type": "boolean" },
        "interactive_mode": { "type": "string" },
        "journey_budget_ms": { "type": "integer", "minimum": 0 },
        "throttling_profiles": { "type": "array", "items": { "type": "string" } },
        "viewports": { "type": "array", "items": { "type": "object" } },
        "dismiss_consent": { "type": "boolean" },
        "capture_screenshots": { "type": "boolean" },
        "capture_element_evidence": { "type": "boolean" }
      }
    },
    "auditQuality": {
      "type": "object",
      "required": ["status", "qualified_results", "failed_rule_checks", "partial_or_failed_modules"],
      "additionalProperties": false,
      "properties": {
        "status": { "type": "string", "enum": ["complete", "partial", "insufficient"] },
        "qualified_results": { "type": "boolean" },
        "failed_rule_checks": { "type": "integer", "minimum": 0 },
        "partial_or_failed_modules": { "type": "integer", "minimum": 0 },
        "reasons": { "type": "array", "items": { "type": "string" } }
      }
    },
    "metricContext": {
      "type": "object",
      "required": ["score_scale", "score_definitions", "count_definitions"],
      "additionalProperties": false,
      "properties": {
        "score_scale": {
          "type": "object",
          "required": ["minimum", "maximum", "higher_is_better"],
          "additionalProperties": false,
          "properties": {
            "minimum": { "type": "integer", "const": 0 },
            "maximum": { "type": "integer", "const": 100 },
            "higher_is_better": { "type": "boolean", "const": true }
          }
        },
        "score_definitions": { "type": "array", "items": { "$ref": "#/$defs/metricDefinition" } },
        "count_definitions": { "type": "array", "items": { "$ref": "#/$defs/metricDefinition" } }
      }
    },
    "metricDefinition": {
      "type": "object",
      "required": ["field", "unit", "meaning"],
      "additionalProperties": false,
      "properties": {
        "field": { "type": "string" },
        "unit": { "type": "string" },
        "meaning": { "type": "string" }
      }
    },
    "metadata": {
      "type": "object",
      "required": ["tool", "timestamp", "wcag_level", "execution_time_ms"],
      "additionalProperties": false,
      "properties": {
        "tool": { "type": "string" },
        "timestamp": { "type": "string", "format": "date-time" },
        "wcag_level": { "type": "string" },
        "execution_time_ms": { "type": "integer", "minimum": 0 }
      }
    },
    "summary": {
      "type": "object",
      "required": [
        "url_count",
        "accessibility_score",
        "overall_score",
        "grade",
        "certificate",
        "risk_level",
        "violation_count",
        "finding_count",
        "finding_occurrence_count",
        "severity_counts",
        "severity_counts_scope",
        "occurrence_counts_scope",
        "passed_url_count",
        "failed_url_count"
      ],
      "additionalProperties": false,
      "properties": {
        "url_count": { "type": "integer", "minimum": 0 },
        "accessibility_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "overall_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "grade": { "type": "string" },
        "certificate": { "type": "string" },
        "risk_level": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
        "violation_count": { "type": "integer", "minimum": 0 },
        "finding_count": { "type": "integer", "minimum": 0 },
        "finding_occurrence_count": { "type": "integer", "minimum": 0 },
        "severity_counts": { "$ref": "#/$defs/severityCounts" },
        "severity_counts_scope": { "type": "string", "const": "wcag_only" },
        "occurrence_counts": { "$ref": "#/$defs/severityCounts" },
        "occurrence_counts_scope": { "type": "string", "const": "wcag_only" },
        "passed_url_count": { "type": "integer", "minimum": 0 },
        "failed_url_count": { "type": "integer", "minimum": 0 },
        "violated_rule_count": { "type": "integer", "minimum": 0 },
        "top_recurring_rules": { "type": "array" },
        "performance_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "seo_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "security_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "mobile_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "ux_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "journey_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "performance_throttled_avg_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "lh_mobile_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "wcag_coverage": { "$ref": "#/$defs/wcagCoverageSummary" },
        "accessibility_score_breakdown": {
          "type": "array",
          "items": { "$ref": "#/$defs/accessibilityScoreComponent" }
        },
        "management_risks": {
          "type": "array",
          "items": { "$ref": "#/$defs/managementRisk" }
        },
        "top_actions": {
          "type": "array",
          "items": { "$ref": "#/$defs/decisionAction" }
        },
        "commerce": { "type": ["object", "null"] }
      }
    },
    "wcagCoverageSummary": {
      "type": "object",
      "required": ["level", "automated_criteria", "manual_review_criteria", "total_wcag_aa_criteria", "note"],
      "additionalProperties": false,
      "properties": {
        "level": { "type": "string" },
        "automated_criteria": { "type": "integer", "minimum": 0 },
        "manual_review_criteria": { "type": "integer", "minimum": 0 },
        "total_wcag_aa_criteria": { "type": "integer", "minimum": 0 },
        "note": { "type": "string" }
      }
    },
    "accessibilityScoreComponent": {
      "type": "object",
      "required": ["area", "score", "weight_pct", "estimated_lost_points", "main_driver"],
      "additionalProperties": false,
      "properties": {
        "area": { "type": "string" },
        "score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "weight_pct": { "type": "integer", "minimum": 0, "maximum": 100 },
        "estimated_lost_points": { "type": "integer", "minimum": 0 },
        "main_driver": { "type": "string" }
      }
    },
    "managementRisk": {
      "type": "object",
      "required": ["dimension", "level", "rationale"],
      "additionalProperties": false,
      "properties": {
        "dimension": { "type": "string" },
        "level": { "type": "string" },
        "rationale": { "type": "string" }
      }
    },
    "decisionAction": {
      "type": "object",
      "required": ["title", "risk", "priority", "complexity", "occurrence_count", "root_cause", "expected_impact"],
      "additionalProperties": false,
      "properties": {
        "title": { "type": "string" },
        "risk": { "type": "string" },
        "priority": { "type": "string" },
        "complexity": { "type": "string" },
        "occurrence_count": { "type": "integer", "minimum": 0 },
        "root_cause": { "type": "string" },
        "expected_impact": { "type": "string" }
      }
    },
    "pageEntry": {
      "type": "object",
      "required": [
        "url",
        "accessibility_score",
        "overall_score",
        "grade",
        "certificate",
        "violation_count",
        "finding_count",
        "finding_occurrence_count",
        "severity_counts",
        "severity_counts_scope",
        "occurrence_counts_scope",
        "nodes_analyzed",
        "duration_ms",
        "module_scores",
        "risk",
        "principle_coverage",
        "findings"
      ],
      "additionalProperties": true,
      "properties": {
        "url": { "type": "string" },
        "accessibility_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "overall_score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "grade": { "type": "string" },
        "certificate": { "type": "string" },
        "violation_count": { "type": "integer", "minimum": 0 },
        "finding_count": { "type": "integer", "minimum": 0 },
        "finding_occurrence_count": { "type": "integer", "minimum": 0 },
        "severity_counts": { "$ref": "#/$defs/severityCounts" },
        "severity_counts_scope": { "type": "string", "const": "wcag_only" },
        "occurrence_counts": { "$ref": "#/$defs/severityCounts" },
        "occurrence_counts_scope": { "type": "string", "const": "wcag_only" },
        "nodes_analyzed": { "type": "integer", "minimum": 0 },
        "duration_ms": { "type": "integer", "minimum": 0 },
        "module_scores": {
          "type": "array",
          "items": { "$ref": "#/$defs/moduleScore" }
        },
        "risk": { "$ref": "#/$defs/riskAssessment" },
        "principle_coverage": { "$ref": "#/$defs/principleCoverage" },
        "findings": {
          "type": "array",
          "items": { "$ref": "#/$defs/finding" }
        },
        "audit_flags": { "type": "array" },
        "audit_quality": { "$ref": "#/$defs/auditQuality" },
        "module_runs": { "type": "array" },
        "rule_outcomes": { "type": "array" },
        "accessibility_assessments": { "type": "array" },
        "navigation": { "type": "object" },
        "consent": { "type": "object" },
        "detail": { "$ref": "#/$defs/pageDetail" }
      }
    },
    "pageDetail": {
      "type": "object",
      "required": ["modules"],
      "additionalProperties": true,
      "properties": {
        "fix_guidance": {
          "type": "array",
          "items": { "$ref": "#/$defs/fixGuidance" }
        },
        "modules": { "$ref": "#/$defs/moduleBlob" },
        "confidence_summary": {
          "type": "array",
          "items": { "$ref": "#/$defs/confidenceSignal" }
        },
        "capabilities": {
          "type": "array",
          "items": { "$ref": "#/$defs/capabilitySignal" }
        },
        "viewport_scores": { "type": ["object", "null"] },
        "viewport_comparison": { "type": ["object", "null"] },
        "budget_violations": { "type": "array" },
        "throttled_performance": { "type": "array" },
        "screenshot_status": { "type": ["object", "null"] },
        "collection_errors": {
          "description": "Errors raised while serializing this page detail; not audit execution failures.",
          "type": "array",
          "items": { "$ref": "#/$defs/reportError" }
        },
        "history": { "type": ["object", "null"] }
      }
    },
    "moduleBlob": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "accessibility": { "type": ["object", "null"] },
        "performance": { "type": ["object", "null"] },
        "seo": { "type": ["object", "null"] },
        "security": { "type": ["object", "null"] },
        "mobile": { "type": ["object", "null"] },
        "ux": { "type": ["object", "null"] },
        "journey": { "type": ["object", "null"] },
        "dark_mode": { "type": ["object", "null"] },
        "source_quality": { "type": ["object", "null"] },
        "ai_visibility": { "type": ["object", "null"] },
        "content_visibility": { "type": ["object", "null"] },
        "tech_stack": { "type": ["object", "null"] },
        "patterns": { "type": ["object", "null"] },
        "best_practices": { "type": ["object", "null"] },
        "commerce": { "type": ["object", "null"] },
        "dual_viewport": { "type": ["object", "null"] },
        "search_experience": { "type": ["object", "null"] }
      }
    },
    "principleCoverage": {
      "type": "object",
      "required": ["perceivable", "operable", "understandable", "robust"],
      "additionalProperties": false,
      "properties": {
        "perceivable": { "$ref": "#/$defs/coverageRatio" },
        "operable": { "$ref": "#/$defs/coverageRatio" },
        "understandable": { "$ref": "#/$defs/coverageRatio" },
        "robust": { "$ref": "#/$defs/coverageRatio" }
      }
    },
    "coverageRatio": {
      "type": "object",
      "required": ["passed", "total", "ratio"],
      "additionalProperties": false,
      "properties": {
        "passed": { "type": "integer", "minimum": 0 },
        "total": { "type": "integer", "minimum": 0 },
        "ratio": { "type": "number", "minimum": 0, "maximum": 1 }
      }
    },
    "severityCounts": {
      "type": "object",
      "required": ["critical", "high", "medium", "low", "total"],
      "additionalProperties": false,
      "properties": {
        "critical": { "type": "integer", "minimum": 0 },
        "high": { "type": "integer", "minimum": 0 },
        "medium": { "type": "integer", "minimum": 0 },
        "low": { "type": "integer", "minimum": 0 },
        "total": { "type": "integer", "minimum": 0 }
      }
    },
    "moduleScore": {
      "type": "object",
      "required": ["name", "score", "grade", "weight_pct", "contributes_to_overall", "measurement_type"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string" },
        "score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "grade": { "type": "string" },
        "weight_pct": { "type": "integer", "minimum": 0, "maximum": 100 },
        "contributes_to_overall": { "type": "boolean" },
        "measurement_type": { "type": "string", "enum": ["measured", "heuristic"] }
      }
    },
    "occurrenceEvidence": {
      "type": "object",
      "required": ["source"],
      "additionalProperties": false,
      "properties": {
        "source": { "type": "string", "description": "Provenance of this evidence item, e.g. \"ax_tree\", \"dom_attribute\", \"computed\"." },
        "field": { "type": ["string", "null"], "description": "E.g. \"dom_path\", \"contrast_ratio\", \"required_ratio\"." },
        "value": { "type": ["string", "null"] }
      }
    },
    "occurrence": {
      "type": "object",
      "required": ["node_id", "message"],
      "additionalProperties": true,
      "properties": {
        "node_id": { "type": "string" },
        "message": { "type": "string" },
        "selector": { "type": ["string", "null"] },
        "fix_suggestion": { "type": ["string", "null"] },
        "html_snippet": { "type": ["string", "null"] },
        "suggested_code": { "type": ["string", "null"] },
        "evidence": {
          "type": "array",
          "description": "Machine-readable provenance for this occurrence (DOM path, computed measurements like contrast ratio). Canonical English (#406). Absent/empty when no evidence was collected.",
          "items": { "$ref": "#/$defs/occurrenceEvidence" }
        }
      }
    },
    "finding": {
      "type": "object",
      "required": [
        "rule_id",
        "wcag_criterion",
        "wcag_level",
        "dimension",
        "subcategory",
        "issue_class",
        "severity",
        "user_impact",
        "technical_impact",
        "score_impact",
        "aggregation_key",
        "title",
        "description",
        "occurrence_count",
        "priority_score",
        "occurrences"
      ],
      "additionalProperties": true,
      "properties": {
        "rule_id": { "type": "string" },
        "wcag_criterion": { "type": "string" },
        "wcag_level": { "type": "string" },
        "dimension": { "type": "string" },
        "subcategory": { "type": "string" },
        "issue_class": { "type": "string" },
        "severity": { "type": "string" },
        "user_impact": { "type": "string" },
        "technical_impact": { "type": "string" },
        "score_impact": {
          "type": "object",
          "required": ["base_penalty", "max_penalty", "scaling"],
          "additionalProperties": false,
          "properties": {
            "base_penalty": { "type": "number" },
            "max_penalty": { "type": "number" },
            "scaling": { "type": "string" }
          }
        },
        "aggregation_key": { "type": "string" },
        "title": { "type": "string" },
        "description": { "type": "string" },
        "help_url": { "type": "string", "description": "Official reference URL for the criterion (e.g. WCAG Understanding page). Present only for WCAG findings that carry one." },
        "occurrence_count": { "type": "integer", "minimum": 0 },
        "priority_score": { "type": "number" },
        "occurrences": {
          "type": "array",
          "items": { "$ref": "#/$defs/occurrence" }
        }
      }
    },
    "fixGuidance": {
      "type": "object",
      "required": ["rule_id", "title", "wcag_criterion", "severity", "occurrence_count", "problem", "user_impact", "typical_cause", "recommendation", "technical_note", "affected_selectors"],
      "additionalProperties": true,
      "properties": {
        "rule_id": { "type": "string" },
        "title": { "type": "string" },
        "wcag_criterion": { "type": "string" },
        "severity": { "type": "string" },
        "occurrence_count": { "type": "integer", "minimum": 0 },
        "problem": { "type": "string" },
        "user_impact": { "type": "string" },
        "typical_cause": { "type": "string" },
        "recommendation": { "type": "string" },
        "technical_note": { "type": "string" },
        "code_example": {
          "type": ["object", "null"],
          "properties": {
            "bad": { "type": "string" },
            "good": { "type": "string" }
          }
        },
        "affected_selectors": {
          "type": "array",
          "items": { "type": "string" }
        }
      }
    },
    "confidenceSignal": {
      "type": "object",
      "required": ["signal", "assessment"],
      "additionalProperties": false,
      "properties": {
        "signal": { "type": "string" },
        "assessment": { "type": "string" }
      }
    },
    "capabilitySignal": {
      "type": "object",
      "required": ["signal", "source", "confidence", "surfaces", "note"],
      "additionalProperties": false,
      "properties": {
        "signal": { "type": "string" },
        "source": { "type": "string" },
        "confidence": { "type": "string" },
        "surfaces": {
          "type": "array",
          "items": { "type": "string" }
        },
        "note": { "type": "string" }
      }
    },
    "riskAssessment": {
      "type": "object",
      "required": ["level", "score", "threshold", "driven_by", "critical_issues", "high_issues", "legal_flags", "blocking_issues", "interactive_critical_issues", "interactive_high_issues", "summary"],
      "additionalProperties": false,
      "properties": {
        "level": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
        "score": { "type": "integer", "minimum": 0, "maximum": 100 },
        "threshold": { "type": "integer", "minimum": 0 },
        "driven_by": { "type": "string" },
        "critical_issues": { "type": "integer", "minimum": 0 },
        "high_issues": { "type": "integer", "minimum": 0 },
        "legal_flags": { "type": "integer", "minimum": 0 },
        "blocking_issues": { "type": "integer", "minimum": 0 },
        "interactive_critical_issues": { "type": "integer", "minimum": 0 },
        "interactive_high_issues": { "type": "integer", "minimum": 0 },
        "summary": { "type": "string" }
      }
    }
  }
}