@kinti/a11y-toolkit 5.32.0 → 5.33.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/a11y_toolkit/a11yaudit.py +271 -13
- package/a11y_toolkit/a11ycrit.py +13 -1
- package/a11y_toolkit/a11ydocx.py +151 -16
- package/a11y_toolkit/a11ydom.py +5 -4
- package/a11y_toolkit/a11ypdf.py +71 -3
- package/a11y_toolkit/a11ywcag3.py +80 -18
- package/a11y_toolkit/locales/en.json +36 -7
- package/a11y_toolkit/locales/es.json +36 -7
- package/a11y_toolkit/server.py +30 -8
- package/package.json +1 -1
package/a11y_toolkit/a11ydom.py
CHANGED
|
@@ -717,7 +717,8 @@ _JS = r'''(maxEj) => {
|
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
for (const el of deepQ('a[target="_blank"]')) {
|
|
720
|
-
|
|
720
|
+
// title NO cuenta: hover-only, invisible para quien navega con teclado
|
|
721
|
+
const t = (el.innerText || '') + ' ' + (el.getAttribute('aria-label') || '');
|
|
721
722
|
if (!/(nueva|nuevo|ventana|pesta|tab\b|window|external|externo|exterior)/i.test(t)) out.blank++;
|
|
722
723
|
}
|
|
723
724
|
for (const el of deepQ('video')) {
|
|
@@ -861,9 +862,9 @@ def audit_dom(data, url='(rendered)', lang='en', color_scheme='light'):
|
|
|
861
862
|
_add(findings, lang, 'low', '1.4.3', 'contrast_review', n=remaining)
|
|
862
863
|
|
|
863
864
|
# 1b. Contraste del placeholder (::placeholder): el gris típico sobre
|
|
864
|
-
# blanco falla 1.4.3 y el AT lo lee como texto real
|
|
865
|
-
#
|
|
866
|
-
#
|
|
865
|
+
# blanco falla 1.4.3 y el AT lo lee como texto real. Severidad de
|
|
866
|
+
# contrast_fail (medium: la misma clase de texto que falla, no grave
|
|
867
|
+
# como un bloqueo de uso).
|
|
867
868
|
ph_failures = data.get('placeholderContrast') or []
|
|
868
869
|
if ph_failures:
|
|
869
870
|
det = '; '.join(
|
package/a11y_toolkit/a11ypdf.py
CHANGED
|
@@ -227,7 +227,7 @@ def pdf_screen(path_or_bytes, lang='en'):
|
|
|
227
227
|
_info_refs = re.findall(rb'/Info\s+(\d+)\s+\d+\s+R', todo)
|
|
228
228
|
if _info_refs:
|
|
229
229
|
_obj_id = _info_refs[-1] # actualizaciones incrementales: el último manda
|
|
230
|
-
_m_obj = re.search(
|
|
230
|
+
_m_obj = re.search(rb'\b' + _obj_id + rb'\s+\d+\s+obj(.{0,4000}?)endobj', todo, re.S)
|
|
231
231
|
if _m_obj:
|
|
232
232
|
title_meta = re.search(rb'/Title\s*\(([^)]{1,300})\)', _m_obj.group(1))
|
|
233
233
|
if not title_meta:
|
|
@@ -243,6 +243,17 @@ def pdf_screen(path_or_bytes, lang='en'):
|
|
|
243
243
|
title_meta = _m
|
|
244
244
|
break
|
|
245
245
|
n_pages = len(re.findall(rb'/Type\s*/Page[^s]', todo))
|
|
246
|
+
# estructura del árbol de tags (solo si tagged): TD sin TH = tablas planas;
|
|
247
|
+
# cero H1-H6 = documento etiquetado SIN jerarquía navegable
|
|
248
|
+
n_tag_td = len(re.findall(rb'/S\s*/TD\b', todo))
|
|
249
|
+
n_tag_th = len(re.findall(rb'/S\s*/TH\b', todo))
|
|
250
|
+
n_tag_h = len(re.findall(rb'/S\s*/H[1-6]\b', todo))
|
|
251
|
+
# la declaración PDF/UA del XMP viaja de dos formas: como atributo
|
|
252
|
+
# (pdfuaid:part="2", la única que se leía) y como elemento RDF
|
|
253
|
+
# (<pdfuaid:part>2</pdfuaid:part>, que es como XMP serializa una propiedad)
|
|
254
|
+
_m_ua = re.search(rb'pdfuaid:part\s*=\s*["\x27]?\s*(\d+)', todo) \
|
|
255
|
+
or re.search(rb'<pdfuaid:part(?:\s[^>]*)?>\s*(\d+)\s*</pdfuaid:part>', todo)
|
|
256
|
+
pdfua_part = int(_m_ua.group(1)) if _m_ua else None
|
|
246
257
|
# /Alt acepta literal (/Alt (…)) y hex (/Alt <FEFF…>, la forma natural
|
|
247
258
|
# UTF-16BE para alt no latino) — misma paridad que /TU
|
|
248
259
|
n_alt = len(re.findall(rb'/Alt\s*[<(]', todo))
|
|
@@ -254,10 +265,30 @@ def pdf_screen(path_or_bytes, lang='en'):
|
|
|
254
265
|
# contar solo Flate acusaba en falso de 'escaneo' a PDFs reales)
|
|
255
266
|
n_text = sum(len(re.findall(rb'\)\s*Tj|\]\s*TJ|\(\s*[A-Za-z0-9]', f)) for f in streams)
|
|
256
267
|
n_text += len(re.findall(rb'\)\s*Tj|\]\s*TJ', data))
|
|
268
|
+
# modo de render del texto: el operador `N Tr` fija el modo; 3 = invisible
|
|
269
|
+
# (capa OCR de un escaneo o fuentes invisibles). Si TODO el texto va en
|
|
270
|
+
# modo 3, lo visible es imagen y la capa 'de texto' no se pinta: dato de
|
|
271
|
+
# informe para la revisión (¿el escaneo tiene etiquetado/alt?), no fallo.
|
|
272
|
+
_mode, _t_vis, _t_inv = 0, 0, 0
|
|
273
|
+
_RE_TROPS = re.compile(rb'(?P<tr>[\d.]+)\s+Tr\b|(?P<show>Tj|TJ)\b')
|
|
274
|
+
for _blob in list(streams) + [data]:
|
|
275
|
+
for _m in _RE_TROPS.finditer(_blob):
|
|
276
|
+
if _m.group('tr') is not None:
|
|
277
|
+
try:
|
|
278
|
+
_mode = int(float(_m.group('tr')))
|
|
279
|
+
except ValueError:
|
|
280
|
+
pass
|
|
281
|
+
elif _m.group('show'):
|
|
282
|
+
if _mode == 3:
|
|
283
|
+
_t_inv += 1
|
|
284
|
+
else:
|
|
285
|
+
_t_vis += 1
|
|
257
286
|
|
|
258
287
|
findings = []
|
|
259
288
|
|
|
260
|
-
#
|
|
289
|
+
# capa OCR pura (todo el texto en modo 3): el dato viaja en el informe; la
|
|
290
|
+
# nota solo al final si procede (tras el conteo real de streams)
|
|
291
|
+
|
|
261
292
|
low_hits = []
|
|
262
293
|
for stream in streams:
|
|
263
294
|
for ej in _stream_low_contrast(stream.decode('latin-1', 'replace')):
|
|
@@ -292,6 +323,36 @@ def pdf_screen(path_or_bytes, lang='en'):
|
|
|
292
323
|
'remediation': _t(lang, 'pdf_fake_link_rem'),
|
|
293
324
|
'examples': bluish})
|
|
294
325
|
|
|
326
|
+
# ── 1.3.1 en PDF: etiquetado plano (tablas sin TH, sin H1-H6) ──
|
|
327
|
+
_tagged_ok = bool(tagged and marked)
|
|
328
|
+
if _tagged_ok and n_tag_td and not n_tag_th:
|
|
329
|
+
findings.append({
|
|
330
|
+
'severity': 'medium', 'criterion': '1.3.1 (PDF)',
|
|
331
|
+
'signal': 'pdf_table_no_header',
|
|
332
|
+
'issue': _t(lang, 'pdf_table_no_header').format(n=n_tag_td),
|
|
333
|
+
'remediation': _t(lang, 'pdf_table_no_header_rem')})
|
|
334
|
+
if _tagged_ok and (n_pages or 0) >= 3 and not n_tag_h \
|
|
335
|
+
and not re.search(rb'/H[1-6]\b[^>]{0,200}/RoleMap|RoleMap[^>]{0,200}/H[1-6]\b', todo) \
|
|
336
|
+
and not re.search(rb'/FT\s*/(?:Tx|Ch|Btn|Sig)', todo):
|
|
337
|
+
findings.append({
|
|
338
|
+
'severity': 'low', 'criterion': '1.3.1 (PDF)',
|
|
339
|
+
'signal': 'pdf_no_heading_tags',
|
|
340
|
+
'issue': _t(lang, 'pdf_no_heading_tags'),
|
|
341
|
+
'remediation': _t(lang, 'pdf_no_heading_tags_rem')})
|
|
342
|
+
# ── contradicción PDF/UA: XMP declara pdfuaid:part pero falta idioma,
|
|
343
|
+
# título o etiquetado — el sello miente sobre su propio documento
|
|
344
|
+
if pdfua_part is not None:
|
|
345
|
+
_missing = [k for k, v in (('/Lang', lang_found is None),
|
|
346
|
+
('/Title', title_meta is None),
|
|
347
|
+
('StructTree', not _tagged_ok)) if v]
|
|
348
|
+
if _missing:
|
|
349
|
+
findings.append({
|
|
350
|
+
'severity': 'high', 'criterion': '1.3.1 (PDF)',
|
|
351
|
+
'signal': 'pdfua_contradiction',
|
|
352
|
+
'issue': _t(lang, 'pdfua_contradiction').format(
|
|
353
|
+
part=pdfua_part, missing=', '.join(_missing)),
|
|
354
|
+
'remediation': _t(lang, 'pdfua_contradiction_rem')})
|
|
355
|
+
|
|
295
356
|
# ── 3.3.2 / 4.1.2 en PDF: campos AcroForm sin etiqueta accesible ──
|
|
296
357
|
# /FT declara el tipo de campo (/Tx texto, /Ch lista, /Sig firma, /Btn
|
|
297
358
|
# botón); /TU es el texto alternativo — LO que anuncia el lector de
|
|
@@ -353,7 +414,7 @@ def pdf_screen(path_or_bytes, lang='en'):
|
|
|
353
414
|
from .a11yaudit import compute_score
|
|
354
415
|
order = {'high': 0, 'medium': 1, 'low': 2}
|
|
355
416
|
findings.sort(key=lambda h: order[h['severity']])
|
|
356
|
-
|
|
417
|
+
_report = {
|
|
357
418
|
'mode': 'pdf', 'file': name,
|
|
358
419
|
'pages': n_pages or None,
|
|
359
420
|
'tagged': bool(tagged and marked),
|
|
@@ -363,6 +424,10 @@ def pdf_screen(path_or_bytes, lang='en'):
|
|
|
363
424
|
if title_meta else None),
|
|
364
425
|
'images': n_imgs, 'alt_entries': n_alt, 'actual_text': n_actual,
|
|
365
426
|
'text_operators': n_text,
|
|
427
|
+
'text_render': {'visible_ops': _t_vis, 'invisible_ops': _t_inv},
|
|
428
|
+
'pdfua_claimed': pdfua_part,
|
|
429
|
+
'tag_counts': {'td': n_tag_td, 'th': n_tag_th, 'h': n_tag_h},
|
|
430
|
+
'ocr_layer_only': bool(_t_inv and not _t_vis),
|
|
366
431
|
'form_fields': n_fields, 'form_labels': n_tu,
|
|
367
432
|
'truncated': truncated,
|
|
368
433
|
'score': compute_score(findings),
|
|
@@ -371,6 +436,9 @@ def pdf_screen(path_or_bytes, lang='en'):
|
|
|
371
436
|
for s in ('high', 'medium', 'low')},
|
|
372
437
|
'limits': _t(lang, 'limits'),
|
|
373
438
|
}
|
|
439
|
+
if _report['ocr_layer_only']:
|
|
440
|
+
_report['ocr_layer_note'] = _t(lang, 'pdf_ocr_layer_note')
|
|
441
|
+
return _report
|
|
374
442
|
|
|
375
443
|
|
|
376
444
|
def main(argv):
|
|
@@ -14,6 +14,9 @@ Honest boundaries, by design:
|
|
|
14
14
|
- The criterion→outcome mapping is OURS. The W3C has published no
|
|
15
15
|
official WCAG 2 → WCAG 3 mapping (transition materials are planned);
|
|
16
16
|
every grouping is a documented approximation.
|
|
17
|
+
- NO forced landing: WCAG 2.2 criteria the draft has no provision for
|
|
18
|
+
(`_NO_EQUIVALENT`) are listed apart in `no_equivalent`, never grouped
|
|
19
|
+
under an unrelated outcome.
|
|
17
20
|
|
|
18
21
|
CLI:
|
|
19
22
|
a11ywcag3.py --from-audit informe.json [--lang es] [-o salida.json]
|
|
@@ -26,7 +29,7 @@ import re
|
|
|
26
29
|
import sys
|
|
27
30
|
|
|
28
31
|
from .a11yi18n import pair
|
|
29
|
-
from .a11ycrit import _SIGNAL_CRIT
|
|
32
|
+
from .a11ycrit import _C, _SIGNAL_CRIT
|
|
30
33
|
|
|
31
34
|
TXT = pair('wcag3') # locales/<lang>.json — community-editable
|
|
32
35
|
|
|
@@ -80,7 +83,10 @@ _OUTCOMES = {
|
|
|
80
83
|
# criterio WCAG 2.2 → outcomes del borrador. CURADO por a11y-toolkit:
|
|
81
84
|
# el W3C no ha publicado mapeo oficial (los materiales de transición están
|
|
82
85
|
# planificados). Cubre el 100% de los criterios alcanzables por señales del
|
|
83
|
-
# toolkit (pinned por tests/test_wcag3.py) más los evidentes sin señal
|
|
86
|
+
# toolkit (pinned por tests/test_wcag3.py) más los evidentes sin señal; los
|
|
87
|
+
# que el borrador no cubre van a _NO_EQUIVALENT. Cada fila se colocó contra
|
|
88
|
+
# el Working Draft publicado: la guía donde vive la provisión equivalente,
|
|
89
|
+
# no la que se le parece.
|
|
84
90
|
_CRIT_OUTCOME = {
|
|
85
91
|
'1.1.1': ['2.1.1', '2.1.3'], # alt texto / alternativas no textuales
|
|
86
92
|
'1.2.2': ['2.1.5'],
|
|
@@ -89,41 +95,38 @@ _CRIT_OUTCOME = {
|
|
|
89
95
|
'1.2.5': ['2.1.6'],
|
|
90
96
|
'1.3.1': ['2.7.3'],
|
|
91
97
|
'1.3.2': ['2.7.3'],
|
|
92
|
-
'1.3.3': ['2.
|
|
98
|
+
'1.3.3': ['2.11.1'], # instrucciones sin rasgos sensoriales
|
|
93
99
|
'1.3.4': ['2.12.3'],
|
|
94
|
-
'1.3.5': ['2.3.5'],
|
|
95
|
-
'1.4.1': ['2.
|
|
100
|
+
'1.3.5': ['2.3.5', '2.9.1'], # + "Automated entry allowed": el relleno automático depende del propósito
|
|
101
|
+
'1.4.1': ['2.1.8'], # "Hue not relied on" es core req del draft
|
|
96
102
|
'1.4.2': ['2.12.4'],
|
|
97
103
|
'1.4.3': ['2.2.1'],
|
|
98
104
|
'1.4.4': ['2.2.1', '2.12.3'],
|
|
99
|
-
'1.4.5': ['2.2.1'],
|
|
105
|
+
'1.4.5': ['2.2.1', '2.2.2'], # + "Text detectable": el texto en imagen no tiene equivalente
|
|
100
106
|
'1.4.10': ['2.12.3'],
|
|
101
107
|
'1.4.12': ['2.2.1'],
|
|
102
|
-
'1.4.13': ['2.
|
|
108
|
+
'1.4.13': ['2.4.5'], # el contenido en hover/foco vive en Input operation
|
|
103
109
|
'2.1.1': ['2.4.1'],
|
|
104
110
|
'2.1.2': ['2.4.1'],
|
|
105
|
-
'2.1.4': ['2.4.
|
|
111
|
+
'2.1.4': ['2.4.1'], # "No keyboard conflicts" + "Custom keys documented"
|
|
106
112
|
'2.2.1': ['2.9.2'],
|
|
107
|
-
'2.2.2': ['2.
|
|
113
|
+
'2.2.2': ['2.6.1'], # pausar/parar/ocultar = "No visual motion" (daño físico)
|
|
108
114
|
'2.3.1': ['2.6.1'], # sin señal hoy; la vía del daño físico
|
|
109
|
-
'2.4.1': ['2.3.3'],
|
|
115
|
+
'2.4.1': ['2.7.3', '2.3.3'], # bloques identificables (Structure) + foco sin bloques repetidos
|
|
110
116
|
'2.4.2': ['2.7.2'],
|
|
111
117
|
'2.4.3': ['2.3.3'],
|
|
112
118
|
'2.4.4': ['2.3.5'],
|
|
113
|
-
'2.4.5': ['2.3.3'],
|
|
114
119
|
'2.4.6': ['2.7.3', '2.2.3'],
|
|
115
120
|
'2.4.7': ['2.3.1'],
|
|
116
121
|
'2.4.11': ['2.7.4'],
|
|
117
|
-
'2.5.1': ['2.4.3'],
|
|
122
|
+
'2.5.1': ['2.4.5', '2.4.3'], # "Path-based gesture not relied on" + entrada simple de puntero
|
|
118
123
|
'2.5.2': ['2.4.3'],
|
|
119
|
-
'2.5.3': ['2.
|
|
124
|
+
'2.5.3': ['2.3.5'], # "Label included in programmatic name"
|
|
120
125
|
'2.5.4': ['2.4.5'],
|
|
121
126
|
'2.5.7': ['2.4.3'],
|
|
122
|
-
'2.5.8': ['2.4.3'],
|
|
123
127
|
'3.1.1': ['2.2.2'],
|
|
124
128
|
'3.1.2': ['2.2.2'],
|
|
125
129
|
'3.2.1': ['2.3.4'],
|
|
126
|
-
'3.2.2': ['2.3.4'],
|
|
127
130
|
'3.2.3': ['2.8.1'],
|
|
128
131
|
'3.2.4': ['2.8.1'],
|
|
129
132
|
'3.2.5': ['2.3.4'],
|
|
@@ -132,15 +135,31 @@ _CRIT_OUTCOME = {
|
|
|
132
135
|
'3.3.2': ['2.3.5', '2.5.2'],
|
|
133
136
|
'3.3.3': ['2.5.1'],
|
|
134
137
|
'3.3.4': ['2.5.2'],
|
|
135
|
-
'3.3.7': ['2.9.
|
|
138
|
+
'3.3.7': ['2.9.4'], # "No redundant entry" vive en Retain information
|
|
136
139
|
'3.3.8': ['2.4.6'],
|
|
137
140
|
'4.1.2': ['2.3.5'],
|
|
138
141
|
'4.1.3': ['2.12.5'],
|
|
139
142
|
}
|
|
140
143
|
|
|
144
|
+
# criterios 2.2 para los que el borrador de sept-2026 NO tiene provisión
|
|
145
|
+
# equivalente (leído provisión a provisión; el del tamaño de objetivo lo
|
|
146
|
+
# confirma la issue #808 del propio grupo). No se fuerzan bajo un outcome
|
|
147
|
+
# ajeno: sus hallazgos se listan aparte en `no_equivalent`. Re-visitar en cada
|
|
148
|
+
# re-baseline: en cuanto el borrador los cubra, vuelven a _CRIT_OUTCOME.
|
|
149
|
+
_NO_EQUIVALENT = ('2.4.5', '2.5.8', '3.2.2')
|
|
150
|
+
|
|
141
151
|
_CODE = re.compile(r'^(\d+\.\d+\.\d+)')
|
|
142
152
|
|
|
143
153
|
|
|
154
|
+
def _name_22(code, lang):
|
|
155
|
+
"""Nombre del criterio en el catálogo 2.2 (misma extracción que `criterion()`)."""
|
|
156
|
+
try:
|
|
157
|
+
_, languages = _C[code]
|
|
158
|
+
return (languages.get(lang) or languages['en'])[0]
|
|
159
|
+
except (KeyError, TypeError, IndexError):
|
|
160
|
+
return code
|
|
161
|
+
|
|
162
|
+
|
|
144
163
|
def preview(report, lang='en'):
|
|
145
164
|
"""Re-agrupa un informe WCAG 2.2 bajo los outcomes del borrador WCAG 3.
|
|
146
165
|
|
|
@@ -154,8 +173,10 @@ def preview(report, lang='en'):
|
|
|
154
173
|
'hint': 'audit first, then preview the same report'}
|
|
155
174
|
|
|
156
175
|
per_outcome = {}
|
|
176
|
+
no_equivalent = {}
|
|
157
177
|
unmapped = []
|
|
158
178
|
mapped_count = 0
|
|
179
|
+
no_equiv_count = 0
|
|
159
180
|
for i, f in enumerate(report['findings']):
|
|
160
181
|
if not isinstance(f, dict):
|
|
161
182
|
# nada desaparece en silencio: un finding deforme también se reporta
|
|
@@ -169,6 +190,18 @@ def preview(report, lang='en'):
|
|
|
169
190
|
else:
|
|
170
191
|
sig = str(f.get('signal') or '')
|
|
171
192
|
code = _SIGNAL_CRIT.get(sig)
|
|
193
|
+
if code in _NO_EQUIVALENT:
|
|
194
|
+
# el borrador no tiene provisión equivalente: se lista aparte,
|
|
195
|
+
# nunca bajo un outcome ajeno ni en el cajón de "sin mapear"
|
|
196
|
+
no_equiv_count += 1
|
|
197
|
+
e = no_equivalent.setdefault(code, {'findings': 0, 'high': 0, 'medium': 0,
|
|
198
|
+
'low': 0, 'signals': set()})
|
|
199
|
+
e['findings'] += 1
|
|
200
|
+
sev = str(f.get('severity') or '').lower()
|
|
201
|
+
if sev in ('high', 'medium', 'low'):
|
|
202
|
+
e[sev] += 1
|
|
203
|
+
e['signals'].add(str(f.get('signal') or code))
|
|
204
|
+
continue
|
|
172
205
|
if not code or code not in _CRIT_OUTCOME:
|
|
173
206
|
unmapped.append({'finding': i, 'signal': f.get('signal'),
|
|
174
207
|
'criterion': f.get('criterion')})
|
|
@@ -202,12 +235,24 @@ def preview(report, lang='en'):
|
|
|
202
235
|
'criteria_22': sorted(e['criteria_22']),
|
|
203
236
|
})
|
|
204
237
|
|
|
205
|
-
|
|
238
|
+
no_equiv = []
|
|
239
|
+
for code in sorted(no_equivalent, key=_vers):
|
|
240
|
+
e = no_equivalent[code]
|
|
241
|
+
no_equiv.append({
|
|
242
|
+
'criterion_22': code,
|
|
243
|
+
'criterion_name': _name_22(code, lang),
|
|
244
|
+
'findings': e['findings'],
|
|
245
|
+
'severity': {'high': e['high'], 'medium': e['medium'], 'low': e['low']},
|
|
246
|
+
'signals': sorted(e['signals']),
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
res = {
|
|
206
250
|
'mode': 'wcag3-preview',
|
|
207
251
|
'lang': lang,
|
|
208
252
|
'draft': dict(DRAFT),
|
|
209
253
|
'disclaimer': t['disclaimer'],
|
|
210
254
|
'mapping_note': t['mapping_note'],
|
|
255
|
+
'no_equivalent_note': t['no_equivalent_note'],
|
|
211
256
|
'no_score': t['no_score'],
|
|
212
257
|
'conformance_model': {
|
|
213
258
|
'levels': 'single conformance level (no A/AA/AAA in the draft)',
|
|
@@ -216,16 +261,33 @@ def preview(report, lang='en'):
|
|
|
216
261
|
'source': DRAFT['intro'],
|
|
217
262
|
},
|
|
218
263
|
'outcomes': outcomes,
|
|
264
|
+
'no_equivalent': no_equiv,
|
|
219
265
|
'counts': {
|
|
220
266
|
'findings_total': len(report['findings']),
|
|
221
267
|
'findings_mapped': mapped_count,
|
|
222
268
|
'findings_unmapped': len(unmapped),
|
|
269
|
+
'findings_no_equivalent': no_equiv_count,
|
|
223
270
|
'outcomes_touched': len(outcomes),
|
|
224
271
|
'outcomes_in_draft': len(_OUTCOMES),
|
|
225
272
|
},
|
|
226
273
|
'unmapped': unmapped,
|
|
227
|
-
'source_report': {'url': report.get('url'), 'mode': report.get('mode')
|
|
274
|
+
'source_report': {'url': report.get('url'), 'mode': report.get('mode'),
|
|
275
|
+
'http_status': report.get('http_status')},
|
|
228
276
|
}
|
|
277
|
+
# el informe de ORIGEN falló (una respuesta HTTP 4xx/5xx conserva los
|
|
278
|
+
# hallazgos y declara el error; también un error del motor): su estado
|
|
279
|
+
# viaja con la vista previa. El mapa se conserva para leerlo, pero ninguna
|
|
280
|
+
# capa puede darlo por bueno: MCP lo marca isError y el CLI sale 1
|
|
281
|
+
_st = report.get('http_status')
|
|
282
|
+
if not isinstance(_st, int) or isinstance(_st, bool):
|
|
283
|
+
_st = None
|
|
284
|
+
if report.get('error') or (_st is not None and _st >= 400):
|
|
285
|
+
res['error'] = str(report.get('error') or
|
|
286
|
+
t['source_http_error'].format(status=_st))
|
|
287
|
+
res['source_error_note'] = t['source_error_note']
|
|
288
|
+
if _st is not None:
|
|
289
|
+
res['http_status'] = _st
|
|
290
|
+
return res
|
|
229
291
|
|
|
230
292
|
|
|
231
293
|
def main(argv):
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"nested_main_rem": "Move main to the root of body (one per page); inside sections use headings, not another main.",
|
|
38
38
|
"fake_list": "{n} fake lists built with typographic bullets and <br> breaks: {example}. Screen readers do not announce them as lists nor count their items (1.3.1).",
|
|
39
39
|
"fake_list_rem": "Turn them into real <ul><li> lists: navigable structure and item counts come for free.",
|
|
40
|
-
"alert_polite": "{n} role=alert with aria-live=polite: {example}. The
|
|
41
|
-
"alert_polite_rem": "
|
|
40
|
+
"alert_polite": "{n} role=alert with aria-live=polite: {example}. The explicit polite SILENCES the role's implicit assertiveness (that is how Chromium exposes it); some screen readers historically honored the implicit value and announce differently. Review the intent (1.4.2/4.1.2).",
|
|
41
|
+
"alert_polite_rem": "For an interrupting alert leave the role alone; for a gentler one role=status expresses it without contradiction. Depending on which of the two wins per reader is the part to avoid.",
|
|
42
42
|
"lang_xml_mismatch": "{n} elements whose lang and xml:lang disagree: {example}. The screen reader cannot tell which language to apply (3.1.2, ACT 5b7ae0).",
|
|
43
43
|
"lang_xml_mismatch_rem": "Make lang and xml:lang identical on the element (same subtag, any casing).",
|
|
44
44
|
"headers_attr_bad": "{n} headers= attributes pointing outside their table or to non-header cells: {example}. The cell-header relationship breaks (1.3.1, ACT d0f69e/a25f45).",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
},
|
|
117
117
|
"images_of_text_rem": "Except for logotypes, present text as real text (1.4.5): it rescales, reflows and translates; an image does not.",
|
|
118
118
|
"overlay_widgets_note": "A third-party accessibility overlay widget was detected (see overlay_widgets). Overlays do not make a site accessible — see the community Overlay Fact Sheet (overlayfactsheet.com). Reported as information for procurement diligence, not as a WCAG finding.",
|
|
119
|
+
"statement_note": "No visible link to an accessibility statement. Directive (EU) 2016/2102 (art. 7) and its national transpositions require it linked; reported as data for legal review, not a WCAG failure.",
|
|
119
120
|
"img_no_alt": {
|
|
120
121
|
"one": "1 <img> without an alt attribute (not even alt=\"\").",
|
|
121
122
|
"other": "{n} <img> without an alt attribute (not even alt=\"\")."
|
|
@@ -241,7 +242,19 @@
|
|
|
241
242
|
"alt_quality": "{n} images with low-quality alt text (filenames, generic words or placeholders).",
|
|
242
243
|
"alt_quality_rem": "Alt like \"image\", \"foto\", \"img_123.jpg\" or a dash says nothing to a screen-reader user. Replace it with what the image conveys in its context; if the image is decorative, use alt=\"\" so assistive tech skips it.",
|
|
243
244
|
"onfocus_blur": "{n} element(s) whose onfocus handler removes focus (onfocus=\"blur()\"): keyboard users cannot reach them at all.",
|
|
244
|
-
"onfocus_blur_rem": "Remove the onfocus=\"blur()\" handler: stealing focus makes the element unreachable by keyboard (2.1.1). If the element must not be focusable, use tabindex=\"-1\" instead of taking focus away."
|
|
245
|
+
"onfocus_blur_rem": "Remove the onfocus=\"blur()\" handler: stealing focus makes the element unreachable by keyboard (2.1.1). If the element must not be focusable, use tabindex=\"-1\" instead of taking focus away.",
|
|
246
|
+
"nested_interactive": "{n} interactive elements nested inside other interactives: {example}. The HTML content model forbids it: the inner control is misannounced and the outer loses its boundary (4.1.2).",
|
|
247
|
+
"nested_interactive_rem": "Make them siblings and fake the visual nesting with an expanded hit area (a stretched ::before over the primary link) or by wrapping the text in a heading; give the secondary action a contextual name (\"Favorite: set menu\").",
|
|
248
|
+
"invoker_command_bad": "{n} buttons with broken invoker commands: {example}. commandfor does not resolve or the command does not match the target type (show-modal/close require <dialog>; the popover commands require the popover attribute) (4.1.2).",
|
|
249
|
+
"invoker_command_bad_rem": "Point commandfor at an existing id of the right type: <dialog> for show-modal/close, [popover] for show/hide/toggle-popover. Without a target there is no behavior and no managed states.",
|
|
250
|
+
"aria_level_gt6": "{n} headings with aria-level greater than 6: {example}. The value is valid ARIA and Chromium exposes it as-is; the documented JAWS behavior is to downgrade it to another level (TetraLogical 2026 matrix): verify intent and your target screen reader (1.3.1).",
|
|
251
|
+
"aria_level_gt6_rem": "If the real hierarchy fits within h1-h6, drop the extra aria-level; if you genuinely need deeper levels, verify with the screen reader your users run before trusting the written number.",
|
|
252
|
+
"role_orphan": "{n} roles without their required container: {example}. A listitem without a list, a tab without a tablist or an option without a listbox lose the structure their role announces (1.3.1).",
|
|
253
|
+
"role_orphan_rem": "Wrap them in their role's container (list, menu, listbox, tablist, tree) or the equivalent implicit element (ul/ol for list).",
|
|
254
|
+
"skip_broken": "{n} skip links pointing at nonexistent targets: {example}. The bypass mechanism aims at an id that does not exist and the user stays trapped in the repeated navigation (2.4.1, F89).",
|
|
255
|
+
"skip_broken_rem": "Point the link at the real id of the main content (or create the id): a broken bypass is worse than no bypass.",
|
|
256
|
+
"select_auto_focus": "{n} selects with autofocus carry a script that changes the context ({example}). The page loads with focus already on the control, so the navigation, new window, submit or focus move it triggers is one key away for someone who never chose to enter it (3.2.1).",
|
|
257
|
+
"select_auto_focus_rem": "Remove the autofocus from the select, or keep it and run the script on activation (a Go button) instead of on focus or on selection change."
|
|
245
258
|
},
|
|
246
259
|
"badge": {
|
|
247
260
|
"name": "a11y-toolkit",
|
|
@@ -298,7 +311,13 @@
|
|
|
298
311
|
"docx_no_lang_rem": "Review → Language → set the whole-document language.",
|
|
299
312
|
"docx_table_no_header": "{n} tables with no marked header row: cells lose their column context (1.3.1).",
|
|
300
313
|
"docx_table_no_header_rem": "Table → mark the header row (\"Repeat header rows\" for multi-page tables).",
|
|
301
|
-
"limits": "Structural XML screening: not a substitute for human review (reading order of complex tables, meaning of under-described images, embedded charts)."
|
|
314
|
+
"limits": "Structural XML screening: not a substitute for human review (reading order of complex tables, meaning of under-described images, embedded charts).",
|
|
315
|
+
"docx_fake_list": "{n} fake list groups: bullets or numbers typed as text instead of a real Word list. Screen readers do not announce them as lists nor count their items.",
|
|
316
|
+
"docx_fake_list_rem": "Apply a real Word list (Home → Bullets/Numbering): the navigable structure comes for free and the number recalculates itself.",
|
|
317
|
+
"docx_heading_skips": "{n} heading level jumps (e.g. Heading 1 → Heading 3): the navigation pane hierarchy comes out flat.",
|
|
318
|
+
"docx_heading_skips_rem": "Fix the intermediate levels: each heading should step down by one (1→2→3); check which level belonged between the two.",
|
|
319
|
+
"docx_generic_link": "{n} links without purpose in their text: repeated \"click here\", the raw URL as text, or an image-only link with no description.",
|
|
320
|
+
"docx_generic_link_rem": "Write the destination in the link text (\"Download the annual report (PDF, 2 MB)\"); screen readers pull the link list out of context."
|
|
302
321
|
},
|
|
303
322
|
"dom": {
|
|
304
323
|
"contrast_fail": "{n} text areas with insufficient contrast: {det}. (computed fg/background, with alpha compositing).",
|
|
@@ -544,7 +563,14 @@
|
|
|
544
563
|
"pdf_scanned": "no text layer (0 characters in content): looks like a scan — fully invisible (1.1.1).",
|
|
545
564
|
"pdf_scanned_rem": "Apply OCR with real text and tag the result.",
|
|
546
565
|
"pdf_untagged": "no structure tree (/StructTreeRoot): reading order and semantic roles do not exist for the reader. THE root failure of inaccessible PDFs (1.3.1).",
|
|
547
|
-
"pdf_untagged_rem": "Tag the document (export as tagged PDF from authoring, or remediate in Acrobat): without a tree, everything else is cosmetic."
|
|
566
|
+
"pdf_untagged_rem": "Tag the document (export as tagged PDF from authoring, or remediate in Acrobat): without a tree, everything else is cosmetic.",
|
|
567
|
+
"pdf_ocr_layer_note": "All text in this PDF is drawn in invisible render mode (Tr 3): what is visible is imagery. Check whether the scan carries tagging and alternatives; the invisible layer may announce text nobody sees. Review data, not a direct failure.",
|
|
568
|
+
"pdf_table_no_header": "{n} tagged TD cells and zero TH: tables sit in the tag tree with no header row.",
|
|
569
|
+
"pdf_table_no_header_rem": "Re-tag the header row as TH (or /TH with scope) in the source authoring tool; without it, the reader announces no columns.",
|
|
570
|
+
"pdf_no_heading_tags": "Tagged document with no H1-H6 at all: heading navigation does not exist. A letter or brochure without headings can be legitimate: review.",
|
|
571
|
+
"pdf_no_heading_tags_rem": "Apply heading styles in the source document and export tagged; H1-H6 are the map of the document.",
|
|
572
|
+
"pdfua_contradiction": "The XMP claims PDF/UA part {part} but is missing: {missing}. The seal contradicts its own document.",
|
|
573
|
+
"pdfua_contradiction_rem": "Either complete it (language, title, tagging) or remove the pdfuaid declaration from the XMP: a lying seal is worse than no seal."
|
|
548
574
|
},
|
|
549
575
|
"scroll": {
|
|
550
576
|
"limits": "Infinite-scroll auditor: heuristics with real focus and a live-region observer over {n} batches. Not a substitute for screen-reader testing on the real feed.",
|
|
@@ -688,7 +714,10 @@
|
|
|
688
714
|
"mapping_note": "The criterion-to-outcome mapping is curated by a11y-toolkit: the W3C has not published an official WCAG 2 to WCAG 3 mapping (transition materials are planned). Treat every grouping as an approximation.",
|
|
689
715
|
"model_tags": "Core requirement tags in the draft: physical harm, risk, barrier and friction (per the W3C introduction; they qualify requirements, not findings).",
|
|
690
716
|
"model_tiers": "Reporting tiers 1-6, where tier 3 corresponds to conformance. Counts and thresholds are still to be determined by the W3C.",
|
|
691
|
-
"no_score": "No score, tier or conformance level is produced on purpose: the draft's tier thresholds are still to be determined by the W3C."
|
|
717
|
+
"no_score": "No score, tier or conformance level is produced on purpose: the draft's tier thresholds are still to be determined by the W3C.",
|
|
718
|
+
"no_equivalent_note": "no_equivalent lists WCAG 2.2 criteria whose findings the September 2026 draft has no equivalent provision for, as read by a11y-toolkit (target size, multiple ways, change of context on input). They are listed apart instead of being grouped under an unrelated outcome, and re-checked on every re-baseline of the draft.",
|
|
719
|
+
"source_error_note": "The source audit failed: its error travels with this preview. The mapping is kept so the findings can still be read, but nothing here may pass a gate, a budget or a conformance claim.",
|
|
720
|
+
"source_http_error": "HTTP {status}: the source audit got an error response, not the requested page."
|
|
692
721
|
},
|
|
693
722
|
"scope": {
|
|
694
723
|
"notice": "Machine proposals are not exclusions: 'proposed-excluded' rows need a human answer before anything downstream (evidence pack, VPAT, OpenACR) may treat the criterion as not applicable.",
|
|
@@ -753,4 +782,4 @@
|
|
|
753
782
|
"journeyrec": {
|
|
754
783
|
"bad_format": "Not an a11y-journey/1 record: verification refuses to judge it."
|
|
755
784
|
}
|
|
756
|
-
}
|
|
785
|
+
}
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"nested_main_rem": "Saca el main a la raíz del body (uno solo por página); dentro de secciones usan encabezados, no otro main.",
|
|
38
38
|
"fake_list": "{n} listas falsas con viñetas tipográficas y saltos <br>: {example}. El lector no las anuncia como lista ni cuenta sus elementos (1.3.1).",
|
|
39
39
|
"fake_list_rem": "Conviértelas en <ul><li> reales: la estructura navegable y el conteo de elementos llegan gratis.",
|
|
40
|
-
"alert_polite": "{n} role=alert con aria-live=polite: {example}. El rol
|
|
41
|
-
"alert_polite_rem": "
|
|
40
|
+
"alert_polite": "{n} role=alert con aria-live=polite: {example}. El polite explícito SILENCIA la asertividad implícita del rol (así lo expone Chromium); algunos lectores históricamente honraron la implícita y anuncian distinto. Revisa la intención (1.4.2/4.1.2).",
|
|
41
|
+
"alert_polite_rem": "Si quieres una alerta que interrumpa, deja el rol solo; si la quieres amable, role=status lo expresa sin contradicción. Lo que no conviene es depender de cuál de las dos gane en cada lector.",
|
|
42
42
|
"lang_xml_mismatch": "{n} elementos con lang y xml:lang discrepando: {example}. El lector no sabe qué lengua aplicar (3.1.2, ACT 5b7ae0).",
|
|
43
43
|
"lang_xml_mismatch_rem": "Iguala lang y xml:lang en el mismo elemento (mismo subtag, da igual la caja).",
|
|
44
44
|
"headers_attr_bad": "{n} atributos headers= apuntando fuera de tabla o a celdas que no son cabecera: {example}. La relación celda-cabecera se rompe (1.3.1, ACT d0f69e/a25f45).",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
},
|
|
117
117
|
"images_of_text_rem": "Salvo logotipos, presenta el texto como texto real (1.4.5): se re escala, se re-fluye y se traduce; una imagen no.",
|
|
118
118
|
"overlay_widgets_note": "Se ha detectado un widget de accesibilidad de terceros (overlay; véase overlay_widgets). Un overlay no hace accesible un sitio — véase el Overlay Fact Sheet comunitario (overlayfactsheet.com). Se informa como dato para la diligencia de compra, no como hallazgo WCAG.",
|
|
119
|
+
"statement_note": "Sin enlace visible a la declaración de accesibilidad. La Directiva (UE) 2016/2102 (art. 7) y el RD 1112/2018 la exigen enlazada; se reporta como dato para la revisión legal, no como fallo WCAG.",
|
|
119
120
|
"img_no_alt": {
|
|
120
121
|
"one": "1 <img> sin atributo alt (ni siquiera alt=\"\").",
|
|
121
122
|
"other": "{n} <img> sin atributo alt (ni siquiera alt=\"\")."
|
|
@@ -241,7 +242,19 @@
|
|
|
241
242
|
"alt_quality": "{n} imágenes con texto alt de baja calidad (nombres de fichero, palabras genéricas o marcadores).",
|
|
242
243
|
"alt_quality_rem": "Un alt como «imagen», «foto», «img_123.jpg» o una raya no dice nada a quien usa lector de pantalla. Sustitúyelo por lo que la imagen transmite en su contexto; si es decorativa, usa alt=\"\" para que la tecnología asistiva la salte.",
|
|
243
244
|
"onfocus_blur": "{n} elemento(s) cuyo manejador onfocus quita el foco (onfocus=\"blur()\"): con teclado no se puede llegar a ellos.",
|
|
244
|
-
"onfocus_blur_rem": "Quita el manejador onfocus=\"blur()\": robar el foco deja el elemento inalcanzable por teclado (2.1.1). Si el elemento no debe ser enfocable, usa tabindex=\"-1\" en vez de robar el foco."
|
|
245
|
+
"onfocus_blur_rem": "Quita el manejador onfocus=\"blur()\": robar el foco deja el elemento inalcanzable por teclado (2.1.1). Si el elemento no debe ser enfocable, usa tabindex=\"-1\" en vez de robar el foco.",
|
|
246
|
+
"nested_interactive": "{n} elementos interactivos dentro de otros interactivos: {example}. El modelo de contenido de HTML lo prohíbe: el lector anuncia mal el interno y el externo pierde su límite (4.1.2).",
|
|
247
|
+
"nested_interactive_rem": "Sepáralos en hermanos y finge el anidamiento visual con un área de impacto expandida (::before estirado sobre el enlace principal) o envolviendo el texto en un encabezado; nombra la acción secundaria con contexto («Favorito: menú del día»).",
|
|
248
|
+
"invoker_command_bad": "{n} botones con comandos invoker rotos: {example}. El commandfor no resuelve o el comando no casa con el tipo de destino (show-modal/close exigen <dialog>; los comandos popover exigen el atributo popover) (4.1.2).",
|
|
249
|
+
"invoker_command_bad_rem": "Apunta commandfor a un id existente del tipo correcto: <dialog> para show-modal/close, [popover] para show/hide/toggle-popover. Sin destino no hay comportamiento ni estados gestionados.",
|
|
250
|
+
"aria_level_gt6": "{n} encabezados con aria-level mayor que 6: {example}. El valor es ARIA válido y Chromium lo expone tal cual; el comportamiento documentado de JAWS es degradarlo a otro nivel (matriz TetraLogical 2026): comprueba la intención y tu lector objetivo (1.3.1).",
|
|
251
|
+
"aria_level_gt6_rem": "Si la jerarquía real cabe en h1-h6, quita el aria-level extra; si necesitas niveles más profundos, verifica con el lector que usan tus personas usuarias antes de fiarte del número escrito.",
|
|
252
|
+
"role_orphan": "{n} roles sin su contenedor requerido: {example}. Un listitem sin lista, un tab sin tablist o un option sin listbox pierden la estructura que anuncia su rol (1.3.1).",
|
|
253
|
+
"role_orphan_rem": "Envuélvelos en el contenedor de su rol (list, menu, listbox, tablist, tree) o en la etiqueta implícita equivalente (ul/ol para list).",
|
|
254
|
+
"skip_broken": "{n} enlaces de salto con destino inexistente: {example}. El mecanismo de bypass apunta a un id que no existe y quien navega queda atrapado en la navegación repetida (2.4.1, F89).",
|
|
255
|
+
"skip_broken_rem": "Apunta el enlace al id real del contenido principal (o crea el id): un bypass roto es peor que no tener bypass.",
|
|
256
|
+
"select_auto_focus": "{n} select con autofocus llevan un script que cambia el contexto ({example}). La página carga con el foco ya en el control, así que la navegación, la ventana nueva, el envío o el cambio de foco que dispara está a una tecla de quien nunca decidió entrar en él (3.2.1).",
|
|
257
|
+
"select_auto_focus_rem": "Quita el autofocus del select, o consérvalo y ejecuta el script al activar (un botón Ir) en vez de al recibir el foco o al cambiar la opción."
|
|
245
258
|
},
|
|
246
259
|
"badge": {
|
|
247
260
|
"name": "a11y-toolkit",
|
|
@@ -298,7 +311,13 @@
|
|
|
298
311
|
"docx_no_lang_rem": "Revisar → Idioma → establece el idioma del documento completo.",
|
|
299
312
|
"docx_table_no_header": "{n} tablas sin fila de encabezado marcada: las celdas pierden su contexto de columna (1.3.1).",
|
|
300
313
|
"docx_table_no_header_rem": "Tabla → fila de encabezado marcada («Repetir filas de encabezado» en tablas multi-página).",
|
|
301
|
-
"limits": "Cribado estructural del XML: no sustituye la revisión humana (orden de lectura de tablas complejas, significado de imágenes con alt insuficiente, gráficos incrustados)."
|
|
314
|
+
"limits": "Cribado estructural del XML: no sustituye la revisión humana (orden de lectura de tablas complejas, significado de imágenes con alt insuficiente, gráficos incrustados).",
|
|
315
|
+
"docx_fake_list": "{n} grupos de listas falsas: viñetas o números escritos como texto en vez de lista de Word. El lector no las anuncia como lista ni cuenta sus elementos.",
|
|
316
|
+
"docx_fake_list_rem": "Aplica la lista real de Word (Inicio → Viñadas/Numeración): la estructura navegable llega sola y el número se recalcula solo.",
|
|
317
|
+
"docx_heading_skips": "{n} saltos de nivel en los encabezados (p. ej. Título 1 → Título 3): la jerarquía del panel de navegación queda plana.",
|
|
318
|
+
"docx_heading_skips_rem": "Corrige los niveles intermedios: cada título debería bajar de a uno (1→2→3); revisa qué nivel debía estar entre los dos.",
|
|
319
|
+
"docx_generic_link": "{n} enlaces sin propósito en su texto: «pincha aquí» repetido, la URL cruda como texto, o un enlace solo-imagen sin descripción.",
|
|
320
|
+
"docx_generic_link_rem": "Escribe el destino en el texto del enlace («Descargar el informe anual (PDF, 2 MB)»); el lector navega por la lista de enlaces y el contexto no llega."
|
|
302
321
|
},
|
|
303
322
|
"dom": {
|
|
304
323
|
"contrast_fail": "{n} zonas de texto con contraste insuficiente: {det}. (fg/fondo computados, con composición de transparencias).",
|
|
@@ -544,7 +563,14 @@
|
|
|
544
563
|
"pdf_scanned": "sin capa de texto (0 caracteres en el contenido): parece un escaneo — invisible por completo (1.1.1).",
|
|
545
564
|
"pdf_scanned_rem": "Aplica OCR con texto real y etiqueta el resultado.",
|
|
546
565
|
"pdf_untagged": "sin árbol de estructura (/StructTreeRoot): el orden de lectura y los roles semánticos no existen para el lector. Es EL fallo raíz de los PDF inaccesibles (1.3.1).",
|
|
547
|
-
"pdf_untagged_rem": "Etiqueta el documento (exporta con «PDF etiquetado» desde authoring, o remedia con Acrobat): sin árbol, todo lo demás es cosmético."
|
|
566
|
+
"pdf_untagged_rem": "Etiqueta el documento (exporta con «PDF etiquetado» desde authoring, o remedia con Acrobat): sin árbol, todo lo demás es cosmético.",
|
|
567
|
+
"pdf_ocr_layer_note": "Todo el texto del PDF se dibuja en modo invisible (Tr 3): lo visible es imagen. Revisa si el escaneo lleva etiquetado y alternativos; la capa invisible puede anunciar texto que nadie ve. Dato de revisión, no fallo directo.",
|
|
568
|
+
"pdf_table_no_header": "{n} celdas TD etiquetadas y ninguna TH: las tablas están en el árbol de tags sin fila de cabecera.",
|
|
569
|
+
"pdf_table_no_header_rem": "Re-etiqueta la fila de cabecera como TH (o /TH con scope) en el autor de origen; sin ella, el lector no anuncia columnas.",
|
|
570
|
+
"pdf_no_heading_tags": "Documento etiquetado sin ningún H1-H6: la navegación por encabezados no existe. Si es una carta o tríptico sin títulos puede ser legítimo: revisar.",
|
|
571
|
+
"pdf_no_heading_tags_rem": "Aplica estilos de título en el documento de origen y exporta con etiquetado; H1-H6 son el mapa del documento.",
|
|
572
|
+
"pdfua_contradiction": "El XMP declara PDF/UA parte {part} pero le falta: {missing}. El sello contradice su propio documento.",
|
|
573
|
+
"pdfua_contradiction_rem": "O se completa (idioma, título, etiquetado) o se retira la declaración pdfuaid del XMP: un sello que miente es peor que no llevar sello."
|
|
548
574
|
},
|
|
549
575
|
"scroll": {
|
|
550
576
|
"limits": "Auditor de scroll infinito: heurística con foco real y observador de regiones vivas en {n} tandas. No sustituye la prueba con lector de screen reader en el feed real.",
|
|
@@ -688,7 +714,10 @@
|
|
|
688
714
|
"mapping_note": "El mapeo de criterio a outcome está curado por a11y-toolkit: el W3C no ha publicado un mapeo oficial de WCAG 2 a WCAG 3 (los materiales de transición están planificados). Trata cada agrupación como una aproximación.",
|
|
689
715
|
"model_tags": "Etiquetas de los requisitos core del borrador: physical harm, risk, barrier y friction (según la introducción del W3C; califican requisitos, no hallazgos).",
|
|
690
716
|
"model_tiers": "Tiers de reporte 1-6, donde el tier 3 corresponde a la conformidad. Recuentos y umbrales están aún por determinar por el W3C.",
|
|
691
|
-
"no_score": "No se produce puntuación, tier ni nivel de conformidad a propósito: los umbrales de los tiers del borrador están aún por determinar por el W3C."
|
|
717
|
+
"no_score": "No se produce puntuación, tier ni nivel de conformidad a propósito: los umbrales de los tiers del borrador están aún por determinar por el W3C.",
|
|
718
|
+
"no_equivalent_note": "no_equivalent lista los criterios WCAG 2.2 cuyos hallazgos no tienen provisión equivalente en el borrador del 10 de septiembre de 2026, según la lectura de a11y-toolkit (tamaño de objetivo, múltiples vías, cambio de contexto al recibir entrada). Se listan aparte en vez de agruparse bajo un outcome ajeno, y se revisan en cada re-baseline del borrador.",
|
|
719
|
+
"source_error_note": "La auditoría de origen falló: su error viaja con esta vista previa. El mapeo se conserva para poder leer los hallazgos, pero nada de aquí puede pasar un gate, un presupuesto ni una declaración de conformidad.",
|
|
720
|
+
"source_http_error": "HTTP {status}: la auditoría de origen recibió una respuesta de error, no la página pedida."
|
|
692
721
|
},
|
|
693
722
|
"scope": {
|
|
694
723
|
"notice": "Las propuestas de la máquina no son exclusiones: las filas 'proposed-excluded' necesitan respuesta humana antes de que algo aguas abajo (pack de evidencia, VPAT, OpenACR) pueda tratar el criterio como no aplicable.",
|
|
@@ -753,4 +782,4 @@
|
|
|
753
782
|
"journeyrec": {
|
|
754
783
|
"bad_format": "No es un registro a11y-journey/1: la verificación se niega a juzgarlo."
|
|
755
784
|
}
|
|
756
|
-
}
|
|
785
|
+
}
|
package/a11y_toolkit/server.py
CHANGED
|
@@ -97,7 +97,7 @@ try:
|
|
|
97
97
|
except ImportError:
|
|
98
98
|
ARIALIVE_JS = None # repo checkout: read the file
|
|
99
99
|
|
|
100
|
-
VERSION = '5.
|
|
100
|
+
VERSION = '5.33.0'
|
|
101
101
|
|
|
102
102
|
# Params renombrados a inglés en 5.11.0; se aceptan los nombres previos.
|
|
103
103
|
PARAM_ALIASES = {
|
|
@@ -804,7 +804,10 @@ TOOLS = [
|
|
|
804
804
|
'mapping (this one is curated and labeled as such), and NO score, tier '
|
|
805
805
|
'or conformance claim is produced — the draft\'s tier thresholds are '
|
|
806
806
|
'still TBD. Use it to show teams where today\'s 2.2 findings will land '
|
|
807
|
-
'tomorrow; keep auditing against WCAG 2.2.'
|
|
807
|
+
'tomorrow; keep auditing against WCAG 2.2. Criteria the draft has no '
|
|
808
|
+
'provision for (target size, multiple ways, change of context on input) '
|
|
809
|
+
'are listed apart in `no_equivalent`, never grouped under an unrelated '
|
|
810
|
+
'outcome.'),
|
|
808
811
|
'inputSchema': {'type': 'object', 'properties': {
|
|
809
812
|
'report': {'type': 'object', 'description': 'audit report object with a findings list (from a11y_audit_url, a11y_audit_dom, a11y_disprove, …)'},
|
|
810
813
|
'lang': {'type': 'string', 'enum': ['es', 'en'], 'description': 'Output language (en default)'},
|
|
@@ -1235,7 +1238,7 @@ _RETURNS = {
|
|
|
1235
1238
|
'a11y_generate_vpat': 'Returns {html, summary {level: count}, levels {code: level}, pack_sha256, draft} — the VPAT draft; writes a file only when output_path is given.',
|
|
1236
1239
|
'a11y_generate_openacr': 'Returns {yaml, summary {level: count}, levels {code: level}, pack_sha256, format, draft} — the OpenACR YAML draft; writes a file only when output_path is given.',
|
|
1237
1240
|
'a11y_contrast_dom': 'Returns JSON: {url, selector, text_color, worst_ratio, median_ratio, p95_ratio, area_passes_aa_normal_text_4_5, worst_zone?, sampled_pixels, interpretation}.',
|
|
1238
|
-
'a11y_wcag3_preview': 'Returns JSON: {mode, draft, disclaimer, mapping_note, no_score, conformance_model, outcomes [{outcome, draft_url, findings, severity, signals, criteria_22}], counts, unmapped} — never a score.',
|
|
1241
|
+
'a11y_wcag3_preview': 'Returns JSON: {mode, draft, disclaimer, mapping_note, no_equivalent_note, no_score, conformance_model, outcomes [{outcome, draft_url, findings, severity, signals, criteria_22}], no_equivalent [{criterion_22, criterion_name, findings, severity, signals}], counts, unmapped} — never a score.',
|
|
1239
1242
|
'a11y_route': 'Returns JSON: {route, steps [{step, tool, why}], alternates, prompts, cli, note} — the ordered tool sequence for the goal. Diagnosis mode (url/html passed): {mode: diagnose, vitals {score, summary, signals}, symptoms [{symptom, evidence}], steps [...], guarantee} — evidence orders the exams, severity breaks ties.',
|
|
1240
1243
|
'a11y_scope': 'Returns JSON: {format: a11y-scope/1, standard, target, criteria [{criterion, level, status, clause?, evidence?, reason?}], counters, en301549_families?, sha256} — statuses in-scope|proposed-excluded|excluded; only human-confirmed exclusions count downstream.',
|
|
1241
1244
|
}
|
|
@@ -1696,6 +1699,13 @@ def main():
|
|
|
1696
1699
|
_stream.reconfigure(**_kw)
|
|
1697
1700
|
except (ValueError, OSError, AttributeError):
|
|
1698
1701
|
pass # exotic/closed streams: keep their default encoding
|
|
1702
|
+
# versiones que este servidor soporta DE VERDAD (batching no está
|
|
1703
|
+
# implementado, así que las 2025-* se sirven sin esa característica y
|
|
1704
|
+
# el cliente lo sabe por las capabilities). La negociación es por
|
|
1705
|
+
# spec: si el cliente pide una soportada se responde ESA; si pide una
|
|
1706
|
+
# desconocida, se responde la última nuestra.
|
|
1707
|
+
_SUPPORTED = ('2024-11-05', '2025-06-18', '2025-11-25')
|
|
1708
|
+
_session = {'proto': '2024-11-05'}
|
|
1699
1709
|
for line in sys.stdin:
|
|
1700
1710
|
line = line.strip()
|
|
1701
1711
|
if not line:
|
|
@@ -1717,11 +1727,11 @@ def main():
|
|
|
1717
1727
|
continue # notificación: sin respuesta
|
|
1718
1728
|
try:
|
|
1719
1729
|
if method == 'initialize':
|
|
1730
|
+
_requested = (msg.get('params') or {}).get('protocolVersion', '')
|
|
1731
|
+
_session['proto'] = (_requested if _requested in _SUPPORTED
|
|
1732
|
+
else _SUPPORTED[-1])
|
|
1720
1733
|
resp = {'jsonrpc': '2.0', 'id': mid, 'result': {
|
|
1721
|
-
|
|
1722
|
-
# never echo the client's (batching is rejected below, so
|
|
1723
|
-
# echoing e.g. '2025-06-18' would be a partial lie)
|
|
1724
|
-
'protocolVersion': '2024-11-05',
|
|
1734
|
+
'protocolVersion': _session['proto'],
|
|
1725
1735
|
'capabilities': {'tools': {}, 'prompts': {}},
|
|
1726
1736
|
'serverInfo': {'name': 'a11y-toolkit', 'version': VERSION},
|
|
1727
1737
|
'instructions': INSTRUCTIONS,
|
|
@@ -1732,7 +1742,19 @@ def main():
|
|
|
1732
1742
|
resp = {'jsonrpc': '2.0', 'id': mid, 'result': {'tools': TOOLS}}
|
|
1733
1743
|
elif method == 'tools/call':
|
|
1734
1744
|
p = msg.get('params', {})
|
|
1735
|
-
|
|
1745
|
+
_r = invoke(p.get('name'), p.get('arguments') or {})
|
|
1746
|
+
if _session['proto'] >= '2025-06-18':
|
|
1747
|
+
# structuredContent (MCP 2025-06-18): el MISMO objeto que
|
|
1748
|
+
# viaja como texto, también como JSON nativo — el cliente
|
|
1749
|
+
# moderno no tiene que re-parsear; el texto sigue para los
|
|
1750
|
+
# antiguos. Es la pieza que la comparativa externa echaba
|
|
1751
|
+
# en falta (JSON-as-text en pleno 2026).
|
|
1752
|
+
try:
|
|
1753
|
+
_r['structuredContent'] = json.loads(
|
|
1754
|
+
_r['content'][0]['text'])
|
|
1755
|
+
except Exception: # noqa: BLE001 — texto no-JSON: sin nativo
|
|
1756
|
+
pass
|
|
1757
|
+
resp = {'jsonrpc': '2.0', 'id': mid, 'result': _r}
|
|
1736
1758
|
elif method == 'prompts/list':
|
|
1737
1759
|
resp = {'jsonrpc': '2.0', 'id': mid, 'result': {'prompts': _PROMPTS}}
|
|
1738
1760
|
elif method in ('prompts/get', 'prompts/call'): # get = spec method (2024-11-05); call kept as alias
|