@kinti/a11y-toolkit 5.29.0 → 5.30.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.
@@ -97,7 +97,7 @@ try:
97
97
  except ImportError:
98
98
  ARIALIVE_JS = None # repo checkout: read the file
99
99
 
100
- VERSION = '5.29.0'
100
+ VERSION = '5.30.0'
101
101
 
102
102
  # Params renombrados a inglés en 5.11.0; se aceptan los nombres previos.
103
103
  PARAM_ALIASES = {
@@ -398,7 +398,13 @@ TOOLS = [
398
398
  'name': 'a11y_scroll',
399
399
  'description': ('Infinite-scroll accessibility audit — the documented disaster nobody '
400
400
  'automates (Deque guidance + ARIA APG Feed pattern; criteria 2.4.3, '
401
- '4.1.3, 2.2.2). Real scrolling batches in Chromium with a live-region '
401
+ '4.1.3, 2.2.2). PASSIVE BY DEFAULT (external review round 5: the '
402
+ 'load-more fallback clicked by substring match hit unrelated buttons — '
403
+ 'the walk now scrolls only and never clicks). To ALSO test the '
404
+ 'load-more alternative pass interactive=true together with '
405
+ 'load_more="the exact visible text of the control" — that performs a '
406
+ 'REAL click on that one control and nothing else. Real scrolling '
407
+ 'batches in Chromium with a live-region '
402
408
  'observer: does the focused element SURVIVE each batch (re-render '
403
409
  'destroys it — the documented failure)? Is new content ANNOUNCED '
404
410
  '(aria-live/status receives text, role=feed)? Does the feed END or '
@@ -412,6 +418,8 @@ TOOLS = [
412
418
  'max_batches': {'type': 'integer', 'description': 'scroll batches (5 default)'},
413
419
  'auth_state': {'type': 'string', 'description': 'Path to a Playwright storage_state JSON (exported session) to audit an authenticated feed'},
414
420
  'browser': {'type': 'string', 'enum': ['auto', 'chromium', 'firefox', 'webkit', 'chrome', 'msedge'], 'description': 'Browser engine (auto = detect the first available)'},
421
+ '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)'},
422
+ 'load_more': {'type': 'string', 'description': 'with interactive=true: the EXACT visible text of the load-more control (full trimmed-text match, never substring)'},
415
423
  },
416
424
  'required': ['url']},
417
425
  },
@@ -420,8 +428,11 @@ TOOLS = [
420
428
  'description': ('Builds the verifiable evidence pack: the machine→human '
421
429
  'handoff object for WCAG conformance work. Takes one or more audit '
422
430
  '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 — NOT pass / not-run / manual-only), '
431
+ 'returns: the full 55-criterion A/AA matrix (statuses: automated-fail / '
432
+ 'automated-review / not-flagged / not-run / manual-only / agent-verified — '
433
+ 'never a pass; not-flagged means an ACCEPTED report of a mode that can '
434
+ 'signal that criterion ran and found nothing, not-run names the missing '
435
+ 'tool, and reports carrying an error never count as coverage), '
425
436
  'each row priced with its human-effort class (MIN 1-3 / MED 5-10 / '
426
437
  'MAX 15-30 min of human review remaining) and total remaining minutes '
427
438
  'every artifact SHA-256-'
@@ -521,10 +532,15 @@ TOOLS = [
521
532
  {
522
533
  'name': 'a11y_sr_transcript',
523
534
  'description': ('Screen reader TRANSCRIPT: what a blind user HEARS on this page. '
524
- 'Walks the accessibility tree linearly and returns the announcement '
525
- 'text with roles, names and states — the linearized reading '
526
- 'experience, as prose an agent can READ to understand the page '
527
- 'from a blind user\'s perspective. — Read-only: for structure '
535
+ 'Walks the accessibility tree linearly and returns announcements '
536
+ 'as a LIST OF STRINGS (the linearized reading order — roles and '
537
+ 'names embedded in the text, e.g. "button \"Search\"") plus '
538
+ 'arbol_raw, the raw accessibility-tree snapshot it was read from '
539
+ '(external review round 6: the contract published objects with '
540
+ 'time/politeneness/role/text — the real shape was strings; the '
541
+ 'contract now matches reality and existing clients keep working). '
542
+ 'Prose an agent can READ to understand the page from a blind '
543
+ 'user\'s perspective. — Read-only: for structure '
528
544
  'use a11y_snapshot, for keyboard traps use a11y_keyboard. '
529
545
  'Requires Playwright.'),
530
546
  'inputSchema': {'type': 'object', 'properties': {
@@ -539,7 +555,10 @@ TOOLS = [
539
555
  'name': 'a11y_disprove',
540
556
  'description': ('Disprover pattern (from Cloudflare\'s security-audit-skill): '
541
557
  're-runs the audit against the live page and marks each finding '
542
- 'confirmed or rejected — findings that don\'t reproduce are '
558
+ 'confirmed or rejected — rendered reports are re-verified under '
559
+ 'their ORIGINAL color scheme (a dark-only contrast fail must not '
560
+ 'look fixed under light; reports that don\'t record their scheme '
561
+ 'come back not-rechecked), and findings that don\'t reproduce are '
543
562
  'rejected with the reason. Catches false positives, race '
544
563
  'conditions, and page changes between audit and report. Returns '
545
564
  'a fresh score over confirmed findings only. — Run this before '
@@ -1143,7 +1162,6 @@ _ANN = {
1143
1162
  'a11y_keyboard': ('Keyboard-trap + skip-link landing detector', True, True),
1144
1163
  'a11y_html_validate': ('W3C Nu validation', True, True),
1145
1164
  'a11y_forms': ('Form error testing', True, True),
1146
- 'a11y_scroll': ('Infinite-scroll audit', True, True),
1147
1165
  'a11y_snapshot': ('A11y snapshot + tab order', True, True),
1148
1166
  'a11y_locate': ('Locate element by accessible name', True, True),
1149
1167
  'a11y_patches': ('Sealed patch-set (sha-keyed)', True, False),
@@ -1174,6 +1192,10 @@ _ANN = {
1174
1192
  'a11y_wcag3_preview': ('WCAG 3 draft preview (no score)', True, False),
1175
1193
  'a11y_route': ('Tool router (goal or page to steps)', True, True),
1176
1194
  'a11y_scope': ('Applicability scope (semi-automatic)', True, False),
1195
+ # (5ª pasada) el scroll declaraba readOnlyHint=true mientras clicaba por
1196
+ # subcadena; ahora pasivo por defecto y la prueba activa exige control
1197
+ # explícito — la anotación dice la verdad: PUEDE actuar cuando se le pide
1198
+ 'a11y_scroll': ('Infinite-scroll audit (passive by default; interactive=true clicks the exact control you name)', False, True),
1177
1199
  }
1178
1200
  # TDQS hygiene: annotations must match reality, and every description states
1179
1201
  # its return shape and when (not) to use the tool. a11y_ledger.record mutates
@@ -1379,7 +1401,9 @@ def invoke(name, args):
1379
1401
  return _content(audit_scroll(args['url'], max_batches=args.get('max_batches', 5),
1380
1402
  lang=args.get('lang', 'en'),
1381
1403
  auth_state=args.get('auth_state'),
1382
- browser=args.get('browser', 'auto')))
1404
+ browser=args.get('browser', 'auto'),
1405
+ interactive=bool(args.get('interactive', False)),
1406
+ load_more=args.get('load_more')))
1383
1407
  except ImportError:
1384
1408
  return {'content': [{'type': 'text',
1385
1409
  '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, ['-m', entry, ...args],
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.29.0",
3
+ "version": "5.30.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",