@kinti/a11y-toolkit 5.29.0 → 5.31.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/a11yact.py +17 -8
- package/a11y_toolkit/a11yaudit.py +240 -87
- package/a11y_toolkit/a11ybudget.py +21 -1
- package/a11y_toolkit/a11ycorpus.py +14 -1
- package/a11y_toolkit/a11ycrit.py +72 -0
- package/a11y_toolkit/a11ydiff.py +24 -11
- package/a11y_toolkit/a11ydisprove.py +27 -4
- package/a11y_toolkit/a11ydocx.py +28 -4
- package/a11y_toolkit/a11ydom.py +604 -370
- package/a11y_toolkit/a11yengines.py +19 -6
- package/a11y_toolkit/a11yevidence.py +34 -11
- package/a11y_toolkit/a11yfingerprints.py +8 -5
- package/a11y_toolkit/a11yfix.py +21 -2
- package/a11y_toolkit/a11yinit.py +24 -5
- package/a11y_toolkit/a11yjourney.py +7 -0
- package/a11y_toolkit/a11yledger.py +9 -0
- package/a11y_toolkit/a11ylocate.py +7 -1
- package/a11y_toolkit/a11yopenacr.py +16 -1
- package/a11y_toolkit/a11ypatterns.py +139 -43
- package/a11y_toolkit/a11ypdf.py +67 -10
- package/a11y_toolkit/a11ysarif.py +10 -2
- package/a11y_toolkit/a11yscope.py +19 -0
- package/a11y_toolkit/a11yscroll.py +48 -23
- package/a11y_toolkit/a11ytrace.py +6 -8
- package/a11y_toolkit/a11yvpat.py +11 -1
- package/a11y_toolkit/a11yvtt.py +33 -3
- package/a11y_toolkit/arialive.js +17 -7
- package/a11y_toolkit/contrast.py +12 -5
- package/a11y_toolkit/locales/_template.json +9 -3
- package/a11y_toolkit/locales/en.json +8 -0
- package/a11y_toolkit/locales/es.json +8 -0
- package/a11y_toolkit/server.py +39 -11
- package/lib/_bootstrap.py +36 -0
- package/lib/runner.cjs +12 -4
- package/package.json +1 -1
|
@@ -301,6 +301,8 @@
|
|
|
301
301
|
"focus_navigates_rem": "Recibir foco nunca debe cambiar el contexto (3.2.1): revisa focus→location.href, focus→form.submit(), focus→window.open().",
|
|
302
302
|
"focus_not_focusable": "{n} controles que no reciben foco con .focus(): {det}.",
|
|
303
303
|
"focus_not_focusable_rem": "Si debe ser interactivo, que sea enfocable (tabindex=\"0\"); si no, quítalo de la ruta de tabulación.",
|
|
304
|
+
"focus_static_indicator": "Un indicador de foco ambiguo en {n} controles: tienen borde/sombra que NO cambia al recibir el foco ({det}). Decoración permanente no es indicador demostrado.",
|
|
305
|
+
"focus_static_indicator_rem": "Recorre con Tab y mira si ALGO cambia visualmente en cada parada. Si nada cambia, añade un outline real en :focus (o :focus-visible) — la decoración permanente no guía a nadie por teclado.",
|
|
304
306
|
"focus_obscured": "{n} controles quedan tapados por elementos fijos/sticky al recibir el foco (cabeceras sticky, banners): {det}. Revisar (2.4.11).",
|
|
305
307
|
"focus_obscured_rem": "Un elemento fijo no debe ocultar el elemento enfocado (2.4.11, nuevo en WCAG 2.2 AA): usa scroll-padding-top igual a la altura del header fijo, o hazlo auto-colapsable.",
|
|
306
308
|
"forced_colors_svg": "{n} SVG con fill coloreado hardcoded: en forced-colors (Windows High Contrast) el fill cae al heredado y el icono puede volverse invisible.",
|
|
@@ -311,6 +313,8 @@
|
|
|
311
313
|
"form_error_no_suggestion_rem": "Cuando la corrección se conoce, dila: «Usa DD/MM/AAAA», no «Fecha inválida» (3.3.3). Sugerimos patrón: texto con formato/ejemplo cerca del campo.",
|
|
312
314
|
"form_navigated": "El formulario navega al enviar; el comportamiento del error no es medible en la página ({example}).",
|
|
313
315
|
"form_navigated_rem": "Captura la página de destino o prueba con un intercepto; el juicio del error requiere ver el DOM tras el envío.",
|
|
316
|
+
"form_untestable": "{n} formulario(s) sin ningún campo rellenable con dato inválido (solo casillas/radios o botones): la identificación de errores NO se probó en esta muestra.",
|
|
317
|
+
"form_untestable_rem": "Prueba el flujo a mano: envía el formulario con errores reales y comprueba que el error se anuncia en texto. Las casillas obligatorias también pueden invalidarse (desmárcalas).",
|
|
314
318
|
"hover_not_dismissible": "{n} tooltips/overlays aparecen al hover/focus que NO se cierran con Escape (1.4.13).",
|
|
315
319
|
"hover_not_dismissible_rem": "El contenido emergente debe poder cerrarse con Escape sin mover el puntero (1.4.13): añade keydown Escape que oculte el tooltip.",
|
|
316
320
|
"input_navigates": "Cambiar {example} provocó navegación automática (URL: {url}) — 3.2.2.",
|
|
@@ -336,6 +340,7 @@
|
|
|
336
340
|
"manual_remaining": "revisión humana pendiente después de la máquina, por clase (MIN 1-3, MED 5-10, MAX 15-30 min por criterio)",
|
|
337
341
|
"no_signal": "no hay señal automática para este criterio en este motor",
|
|
338
342
|
"not_flagged": "sin señal ≠ pasa: ninguna señal automática saltó en esta muestra",
|
|
343
|
+
"not_run": "ninguna prueba de este criterio se ejecutó en la muestra — falta: {modes}",
|
|
339
344
|
"notice": "Este pack es evidencia, no conformidad: dice qué encontró la máquina y qué queda para una persona. Una declaración de conformidad requiere el bloque de firma completo, de una persona cualificada que haya revisado la lista manual.",
|
|
340
345
|
"reviewer_note": "cualquier contrafirma debe referenciar pack.sha256 e indicar qué criterios revisó la persona más allá de la matriz automática",
|
|
341
346
|
"verified": "verificado sobre esta muestra según el protocolo del checklist manual",
|
|
@@ -489,6 +494,8 @@
|
|
|
489
494
|
"pattern_tabs_no_activation_rem": "Haz que la selección siga al foco (activación automática) o activa con Enter/Espacio (manual) — aria-selected debe reflejar el panel visible.",
|
|
490
495
|
"pattern_disclosure_state_frozen": "Activar «{name}» nunca cambia aria-expanded: el estado expuesto contradice lo visual.",
|
|
491
496
|
"pattern_disclosure_state_frozen_rem": "Alterna aria-expanded (true/false) en cada activación y apunta aria-controls a la región que revela.",
|
|
497
|
+
"pattern_disclosure_keyboard_dead": "«{name}» no reacciona a Enter ni Espacio con el foco en el control: el desplegable solo funciona con ratón.",
|
|
498
|
+
"pattern_disclosure_keyboard_dead_rem": "Los disclosure deben abrirse con teclado: maneja keydown de Enter y Espacio (y ArrowDown en botones de menú) exactamente como el patrón Disclosure del APG.",
|
|
492
499
|
"pattern_combobox_no_open": "Un combobox nunca abre su popup con ArrowDown (sin aria-expanded, sin listbox visible).",
|
|
493
500
|
"pattern_combobox_no_open_rem": "Abre el listbox con ArrowDown / Alt+ArrowDown y pon aria-expanded=true; mantiene el foco en el input mientras filtra.",
|
|
494
501
|
"pattern_combobox_esc_no_close": "El popup de un combobox sigue abierto tras Escape.",
|
|
@@ -639,6 +646,7 @@
|
|
|
639
646
|
"notes": "Notas",
|
|
640
647
|
"product": "Nombre del producto",
|
|
641
648
|
"signature": "Este documento es un <strong>BORRADOR</strong> generado por cribado automatizado. Los niveles marcados «No evaluado» deben ser fijados por una persona cualificada tras la revisión; la declaración de firma debe referenciar el hash del paquete de evidencia:",
|
|
649
|
+
"signature_scope": "Alcance de aplicabilidad aplicado (exclusiones confirmadas por una persona): sello del alcance <code>{sha}</code>. El sello del pack cubre los informes; este cubre las exclusiones que cambian esta matriz.",
|
|
642
650
|
"signature_empty": "Bloque de firma sin completar: nombre, credencial y fecha pendientes.",
|
|
643
651
|
"signature_title": "Firma y evidencia",
|
|
644
652
|
"standard": "<abbr lang=\"en\" title=\"Web Content Accessibility Guidelines\">WCAG</abbr> 2.2 (niveles A y AA) — Recomendación W3C de octubre de 2023.",
|
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.31.0'
|
|
101
101
|
|
|
102
102
|
# Params renombrados a inglés en 5.11.0; se aceptan los nombres previos.
|
|
103
103
|
PARAM_ALIASES = {
|
|
@@ -209,6 +209,10 @@ TOOLS = [
|
|
|
209
209
|
'focus indicator heuristic (2.4.7), plus rendered versions of the '
|
|
210
210
|
'static checks (alt, accessible names, labels, headings, lang/title, '
|
|
211
211
|
'tabindex, aria-hidden, captions, tables). Findings include remediation. '
|
|
212
|
+
'HTTP contract: the report carries http_status, its url is the FINAL '
|
|
213
|
+
'page after redirects (requested_url keeps the original), and a 4xx/5xx '
|
|
214
|
+
'response is returned as an error — the audited content still rides '
|
|
215
|
+
'along, but no CI gate can pass on an error response. '
|
|
212
216
|
'Requires playwright: pip install playwright && playwright install '
|
|
213
217
|
'chromium.'),
|
|
214
218
|
'inputSchema': {'type': 'object', 'properties': {
|
|
@@ -398,7 +402,13 @@ TOOLS = [
|
|
|
398
402
|
'name': 'a11y_scroll',
|
|
399
403
|
'description': ('Infinite-scroll accessibility audit — the documented disaster nobody '
|
|
400
404
|
'automates (Deque guidance + ARIA APG Feed pattern; criteria 2.4.3, '
|
|
401
|
-
'4.1.3, 2.2.2).
|
|
405
|
+
'4.1.3, 2.2.2). PASSIVE BY DEFAULT (external review round 5: the '
|
|
406
|
+
'load-more fallback clicked by substring match hit unrelated buttons — '
|
|
407
|
+
'the walk now scrolls only and never clicks). To ALSO test the '
|
|
408
|
+
'load-more alternative pass interactive=true together with '
|
|
409
|
+
'load_more="the exact visible text of the control" — that performs a '
|
|
410
|
+
'REAL click on that one control and nothing else. Real scrolling '
|
|
411
|
+
'batches in Chromium with a live-region '
|
|
402
412
|
'observer: does the focused element SURVIVE each batch (re-render '
|
|
403
413
|
'destroys it — the documented failure)? Is new content ANNOUNCED '
|
|
404
414
|
'(aria-live/status receives text, role=feed)? Does the feed END or '
|
|
@@ -412,6 +422,8 @@ TOOLS = [
|
|
|
412
422
|
'max_batches': {'type': 'integer', 'description': 'scroll batches (5 default)'},
|
|
413
423
|
'auth_state': {'type': 'string', 'description': 'Path to a Playwright storage_state JSON (exported session) to audit an authenticated feed'},
|
|
414
424
|
'browser': {'type': 'string', 'enum': ['auto', 'chromium', 'firefox', 'webkit', 'chrome', 'msedge'], 'description': 'Browser engine (auto = detect the first available)'},
|
|
425
|
+
'interactive': {'type': 'boolean', 'description': 'passive walk by default (scroll only, NEVER clicks); true enables the load-more click test (a real action on the page)'},
|
|
426
|
+
'load_more': {'type': 'string', 'description': 'with interactive=true: the EXACT visible text of the load-more control (full trimmed-text match, never substring)'},
|
|
415
427
|
},
|
|
416
428
|
'required': ['url']},
|
|
417
429
|
},
|
|
@@ -420,8 +432,11 @@ TOOLS = [
|
|
|
420
432
|
'description': ('Builds the verifiable evidence pack: the machine→human '
|
|
421
433
|
'handoff object for WCAG conformance work. Takes one or more audit '
|
|
422
434
|
'reports (any mode — static, rendered, reflow, keyboard, scroll) and '
|
|
423
|
-
'returns: the full 55-criterion A/AA matrix (automated-fail / '
|
|
424
|
-
'automated-review / not-flagged
|
|
435
|
+
'returns: the full 55-criterion A/AA matrix (statuses: automated-fail / '
|
|
436
|
+
'automated-review / not-flagged / not-run / manual-only / agent-verified — '
|
|
437
|
+
'never a pass; not-flagged means an ACCEPTED report of a mode that can '
|
|
438
|
+
'signal that criterion ran and found nothing, not-run names the missing '
|
|
439
|
+
'tool, and reports carrying an error never count as coverage), '
|
|
425
440
|
'each row priced with its human-effort class (MIN 1-3 / MED 5-10 / '
|
|
426
441
|
'MAX 15-30 min of human review remaining) and total remaining minutes '
|
|
427
442
|
'every artifact SHA-256-'
|
|
@@ -521,10 +536,15 @@ TOOLS = [
|
|
|
521
536
|
{
|
|
522
537
|
'name': 'a11y_sr_transcript',
|
|
523
538
|
'description': ('Screen reader TRANSCRIPT: what a blind user HEARS on this page. '
|
|
524
|
-
'Walks the accessibility tree linearly and returns
|
|
525
|
-
'
|
|
526
|
-
'
|
|
527
|
-
'
|
|
539
|
+
'Walks the accessibility tree linearly and returns announcements '
|
|
540
|
+
'as a LIST OF STRINGS (the linearized reading order — roles and '
|
|
541
|
+
'names embedded in the text, e.g. "button \"Search\"") plus '
|
|
542
|
+
'arbol_raw, the raw accessibility-tree snapshot it was read from '
|
|
543
|
+
'(external review round 6: the contract published objects with '
|
|
544
|
+
'time/politeneness/role/text — the real shape was strings; the '
|
|
545
|
+
'contract now matches reality and existing clients keep working). '
|
|
546
|
+
'Prose an agent can READ to understand the page from a blind '
|
|
547
|
+
'user\'s perspective. — Read-only: for structure '
|
|
528
548
|
'use a11y_snapshot, for keyboard traps use a11y_keyboard. '
|
|
529
549
|
'Requires Playwright.'),
|
|
530
550
|
'inputSchema': {'type': 'object', 'properties': {
|
|
@@ -539,7 +559,10 @@ TOOLS = [
|
|
|
539
559
|
'name': 'a11y_disprove',
|
|
540
560
|
'description': ('Disprover pattern (from Cloudflare\'s security-audit-skill): '
|
|
541
561
|
're-runs the audit against the live page and marks each finding '
|
|
542
|
-
'confirmed or rejected —
|
|
562
|
+
'confirmed or rejected — rendered reports are re-verified under '
|
|
563
|
+
'their ORIGINAL color scheme (a dark-only contrast fail must not '
|
|
564
|
+
'look fixed under light; reports that don\'t record their scheme '
|
|
565
|
+
'come back not-rechecked), and findings that don\'t reproduce are '
|
|
543
566
|
'rejected with the reason. Catches false positives, race '
|
|
544
567
|
'conditions, and page changes between audit and report. Returns '
|
|
545
568
|
'a fresh score over confirmed findings only. — Run this before '
|
|
@@ -1143,7 +1166,6 @@ _ANN = {
|
|
|
1143
1166
|
'a11y_keyboard': ('Keyboard-trap + skip-link landing detector', True, True),
|
|
1144
1167
|
'a11y_html_validate': ('W3C Nu validation', True, True),
|
|
1145
1168
|
'a11y_forms': ('Form error testing', True, True),
|
|
1146
|
-
'a11y_scroll': ('Infinite-scroll audit', True, True),
|
|
1147
1169
|
'a11y_snapshot': ('A11y snapshot + tab order', True, True),
|
|
1148
1170
|
'a11y_locate': ('Locate element by accessible name', True, True),
|
|
1149
1171
|
'a11y_patches': ('Sealed patch-set (sha-keyed)', True, False),
|
|
@@ -1174,6 +1196,10 @@ _ANN = {
|
|
|
1174
1196
|
'a11y_wcag3_preview': ('WCAG 3 draft preview (no score)', True, False),
|
|
1175
1197
|
'a11y_route': ('Tool router (goal or page to steps)', True, True),
|
|
1176
1198
|
'a11y_scope': ('Applicability scope (semi-automatic)', True, False),
|
|
1199
|
+
# (5ª pasada) el scroll declaraba readOnlyHint=true mientras clicaba por
|
|
1200
|
+
# subcadena; ahora pasivo por defecto y la prueba activa exige control
|
|
1201
|
+
# explícito — la anotación dice la verdad: PUEDE actuar cuando se le pide
|
|
1202
|
+
'a11y_scroll': ('Infinite-scroll audit (passive by default; interactive=true clicks the exact control you name)', False, True),
|
|
1177
1203
|
}
|
|
1178
1204
|
# TDQS hygiene: annotations must match reality, and every description states
|
|
1179
1205
|
# its return shape and when (not) to use the tool. a11y_ledger.record mutates
|
|
@@ -1379,7 +1405,9 @@ def invoke(name, args):
|
|
|
1379
1405
|
return _content(audit_scroll(args['url'], max_batches=args.get('max_batches', 5),
|
|
1380
1406
|
lang=args.get('lang', 'en'),
|
|
1381
1407
|
auth_state=args.get('auth_state'),
|
|
1382
|
-
browser=args.get('browser', 'auto')
|
|
1408
|
+
browser=args.get('browser', 'auto'),
|
|
1409
|
+
interactive=bool(args.get('interactive', False)),
|
|
1410
|
+
load_more=args.get('load_more')))
|
|
1383
1411
|
except ImportError:
|
|
1384
1412
|
return {'content': [{'type': 'text',
|
|
1385
1413
|
'text': 'Playwright not installed: pip install playwright && playwright install chromium'}],
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Arranque AISLADO del motor interno del paquete npm (@kinti/a11y-toolkit).
|
|
3
|
+
|
|
4
|
+
El lanzador ejecuta `python -I _bootstrap.py <entrada> <args…>`: -I (modo
|
|
5
|
+
aislado) saca el directorio de trabajo de sys.path — un módulo homónimo del
|
|
6
|
+
proyecto auditado (que VS Code invoca desde la raíz del workspace) jamás
|
|
7
|
+
gana a la hora de importarse — e ignora PYTHONPATH. El motor se carga aquí
|
|
8
|
+
por RUTA ABSOLUTA del paquete que viaja dentro de este npm.
|
|
9
|
+
|
|
10
|
+
Entradas: a11y_toolkit.a11y (CLI) y a11y_toolkit.server (servidor MCP).
|
|
11
|
+
"""
|
|
12
|
+
import os
|
|
13
|
+
import sys
|
|
14
|
+
|
|
15
|
+
_ENGINE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
16
|
+
sys.path.insert(0, _ENGINE)
|
|
17
|
+
|
|
18
|
+
_ENTRY = {
|
|
19
|
+
'a11y_toolkit.a11y': 'main',
|
|
20
|
+
'a11y_toolkit.server': 'main',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _run(entry, args):
|
|
25
|
+
if entry not in _ENTRY:
|
|
26
|
+
print(f'unknown entry: {entry}', file=sys.stderr)
|
|
27
|
+
return 2
|
|
28
|
+
module = __import__(entry, fromlist=[_ENTRY[entry]])
|
|
29
|
+
return getattr(module, _ENTRY[entry])(args)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
if __name__ == '__main__':
|
|
33
|
+
if len(sys.argv) < 2:
|
|
34
|
+
print('usage: _bootstrap.py <entry> [args…]', file=sys.stderr)
|
|
35
|
+
sys.exit(2)
|
|
36
|
+
sys.exit(_run(sys.argv[1], sys.argv[2:]))
|
package/lib/runner.cjs
CHANGED
|
@@ -2,18 +2,27 @@
|
|
|
2
2
|
/* Launcher: runs the SELF-CONTAINED engine that ships inside this package
|
|
3
3
|
* (a11y_toolkit/, pure-stdlib Python). No downloads at runtime when a
|
|
4
4
|
* python3 (>=3.9) exists; falls back to a version-pinned uvx when it does
|
|
5
|
-
* not. Zero install, zero network, reproducible by construction.
|
|
5
|
+
* not. Zero install, zero network, reproducible by construction.
|
|
6
|
+
*
|
|
7
|
+
* Hardening (external review 2026-11-22): python used to load the engine
|
|
8
|
+
* from the CALLER's working directory, so a module named like the engine in
|
|
9
|
+
* the audited project would shadow the bundled one and execute with the
|
|
10
|
+
* user's permissions (VS Code launches this from the workspace root). Now
|
|
11
|
+
* Python runs the bundled bootstrap in ISOLATED mode (-I: no CWD on the
|
|
12
|
+
* path, no env-var paths, no user site) and the engine loads by absolute
|
|
13
|
+
* path from this package. */
|
|
6
14
|
const { spawn, spawnSync } = require('child_process');
|
|
7
15
|
const path = require('path');
|
|
8
16
|
|
|
9
17
|
const ENGINE = path.join(__dirname, '..'); // where a11y_toolkit/ lives
|
|
18
|
+
const BOOTSTRAP = path.join(__dirname, '_bootstrap.py'); // isolated entry point
|
|
10
19
|
const PY = process.platform === 'win32' ? 'python' : 'python3';
|
|
11
20
|
const UVX = process.platform === 'win32' ? 'uvx.exe' : 'uvx';
|
|
12
21
|
const VERSION = require('../package.json').version; // pinned fallback, same release
|
|
13
22
|
|
|
14
23
|
function pythonOk() {
|
|
15
24
|
try {
|
|
16
|
-
const r = spawnSync(PY, ['-c', 'import sys; sys.exit(0 if sys.version_info >= (3, 9) else 1)']);
|
|
25
|
+
const r = spawnSync(PY, ['-I', '-c', 'import sys; sys.exit(0 if sys.version_info >= (3, 9) else 1)']);
|
|
17
26
|
return r.status === 0;
|
|
18
27
|
} catch { return false; }
|
|
19
28
|
}
|
|
@@ -21,8 +30,7 @@ function pythonOk() {
|
|
|
21
30
|
function run(entry) {
|
|
22
31
|
const args = process.argv.slice(2);
|
|
23
32
|
if (pythonOk()) {
|
|
24
|
-
const child = spawn(PY, ['-
|
|
25
|
-
{ stdio: 'inherit', env: { ...process.env, PYTHONPATH: ENGINE } });
|
|
33
|
+
const child = spawn(PY, ['-I', BOOTSTRAP, entry, ...args], { stdio: 'inherit' });
|
|
26
34
|
child.on('close', (c) => process.exit(c === null ? 1 : c));
|
|
27
35
|
return;
|
|
28
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinti/a11y-toolkit",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.31.0",
|
|
4
4
|
"mcpName": "io.github.kinti/a11y-toolkit",
|
|
5
5
|
"description": "Zero-dependency WCAG 2.2 accessibility engine (37 MCP tools + CLI): audits, contrast fixing, SHA-256-sealed evidence packs, SARIF, EARL/ACT, CI ratchet. Self-contained: the pure-stdlib Python engine ships inside and runs via python3 \u2014 no downloads, no installs.",
|
|
6
6
|
"license": "MIT",
|