@mcptoolshop/accessibility-suite 0.1.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.
Files changed (241) hide show
  1. package/.github/workflows/ci.yml +63 -0
  2. package/LICENSE +21 -0
  3. package/README.md +37 -0
  4. package/docs/prov-spec/.github/workflows/ci.yml +68 -0
  5. package/docs/prov-spec/CHANGELOG.md +69 -0
  6. package/docs/prov-spec/CODE_OF_CONDUCT.md +129 -0
  7. package/docs/prov-spec/CONFORMANCE_LEVELS.md +223 -0
  8. package/docs/prov-spec/CONTRIBUTING.md +145 -0
  9. package/docs/prov-spec/IMPLEMENTER_CHECKLIST.md +137 -0
  10. package/docs/prov-spec/LICENSE +21 -0
  11. package/docs/prov-spec/PRESS_RELEASE.md +74 -0
  12. package/docs/prov-spec/README.md +182 -0
  13. package/docs/prov-spec/SETUP.md +135 -0
  14. package/docs/prov-spec/WHY.md +86 -0
  15. package/docs/prov-spec/examples/artifact.example.json +14 -0
  16. package/docs/prov-spec/examples/artifact.ref.example.json +9 -0
  17. package/docs/prov-spec/examples/evidence.example.json +6 -0
  18. package/docs/prov-spec/examples/mcp.envelope.example.json +97 -0
  19. package/docs/prov-spec/examples/mcp.request.example.json +28 -0
  20. package/docs/prov-spec/examples/prov.record.example.json +35 -0
  21. package/docs/prov-spec/interop/PROOF_NODE_ENGINE.md +114 -0
  22. package/docs/prov-spec/spec/MCP_COMPATIBILITY.md +241 -0
  23. package/docs/prov-spec/spec/PROV_METHODS_CATALOG.md +142 -0
  24. package/docs/prov-spec/spec/PROV_METHODS_SPEC.md +397 -0
  25. package/docs/prov-spec/spec/methods.json +213 -0
  26. package/docs/prov-spec/spec/schemas/artifact.ref.schema.v0.1.json +58 -0
  27. package/docs/prov-spec/spec/schemas/artifact.schema.v0.1.json +61 -0
  28. package/docs/prov-spec/spec/schemas/assist.request.schema.v0.1.json +52 -0
  29. package/docs/prov-spec/spec/schemas/assist.response.schema.v0.1.json +70 -0
  30. package/docs/prov-spec/spec/schemas/cli.error.schema.v0.1.json +78 -0
  31. package/docs/prov-spec/spec/schemas/evidence.schema.v0.1.json +37 -0
  32. package/docs/prov-spec/spec/schemas/mcp.envelope.schema.v0.1.json +141 -0
  33. package/docs/prov-spec/spec/schemas/mcp.request.schema.v0.1.json +79 -0
  34. package/docs/prov-spec/spec/schemas/methods.schema.json +93 -0
  35. package/docs/prov-spec/spec/schemas/prov-capabilities.schema.json +122 -0
  36. package/docs/prov-spec/spec/schemas/prov.record.schema.v0.1.json +133 -0
  37. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/expected.json +4 -0
  38. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/input.json +1 -0
  39. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/negative/double_wrapped.json +14 -0
  40. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/negative/wrong_schema_version.json +11 -0
  41. package/docs/prov-spec/spec/vectors/engine.extract.evidence.json_pointer/expected.json +24 -0
  42. package/docs/prov-spec/spec/vectors/engine.extract.evidence.json_pointer/input.json +8 -0
  43. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/expected.json +7 -0
  44. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/input.json +1 -0
  45. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/non_hex_chars.json +16 -0
  46. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/uppercase_hex.json +16 -0
  47. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/wrong_length.json +16 -0
  48. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/hyphen_separator.json +8 -0
  49. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/reserved_namespace.json +8 -0
  50. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/starts_with_digit.json +8 -0
  51. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/uppercase.json +8 -0
  52. package/docs/prov-spec/spec/vectors/method_id_syntax/positive/valid_ids.json +18 -0
  53. package/docs/prov-spec/tools/python/prov_validator.py +428 -0
  54. package/examples/a11y-demo-site/.github/workflows/a11y-artifacts.yml +81 -0
  55. package/examples/a11y-demo-site/.github/workflows/a11y.yml +34 -0
  56. package/examples/a11y-demo-site/CODE_OF_CONDUCT.md +129 -0
  57. package/examples/a11y-demo-site/CONTRIBUTING.md +83 -0
  58. package/examples/a11y-demo-site/LICENSE +21 -0
  59. package/examples/a11y-demo-site/README.md +155 -0
  60. package/examples/a11y-demo-site/html/contact.html +15 -0
  61. package/examples/a11y-demo-site/html/index.html +20 -0
  62. package/examples/a11y-demo-site/scripts/a11y.sh +20 -0
  63. package/package.json +26 -0
  64. package/src/a11y-assist/.github/workflows/publish.yml +52 -0
  65. package/src/a11y-assist/.github/workflows/test.yml +30 -0
  66. package/src/a11y-assist/A11Y_ASSIST_TEST_COVERAGE_REQUIREMENTS.md +104 -0
  67. package/src/a11y-assist/CODE_OF_CONDUCT.md +129 -0
  68. package/src/a11y-assist/CONTRIBUTING.md +98 -0
  69. package/src/a11y-assist/ENGINE.md +363 -0
  70. package/src/a11y-assist/LICENSE +21 -0
  71. package/src/a11y-assist/PRESS_RELEASE.md +71 -0
  72. package/src/a11y-assist/QUICKSTART.md +101 -0
  73. package/src/a11y-assist/README.md +192 -0
  74. package/src/a11y-assist/RELEASE_NOTES.md +319 -0
  75. package/src/a11y-assist/a11y_assist/__init__.py +3 -0
  76. package/src/a11y-assist/a11y_assist/cli.py +599 -0
  77. package/src/a11y-assist/a11y_assist/from_cli_error.py +149 -0
  78. package/src/a11y-assist/a11y_assist/guard.py +444 -0
  79. package/src/a11y-assist/a11y_assist/ingest.py +407 -0
  80. package/src/a11y-assist/a11y_assist/methods.py +137 -0
  81. package/src/a11y-assist/a11y_assist/parse_raw.py +71 -0
  82. package/src/a11y-assist/a11y_assist/profiles/__init__.py +29 -0
  83. package/src/a11y-assist/a11y_assist/profiles/cognitive_load.py +245 -0
  84. package/src/a11y-assist/a11y_assist/profiles/cognitive_load_render.py +86 -0
  85. package/src/a11y-assist/a11y_assist/profiles/dyslexia.py +144 -0
  86. package/src/a11y-assist/a11y_assist/profiles/dyslexia_render.py +77 -0
  87. package/src/a11y-assist/a11y_assist/profiles/plain_language.py +119 -0
  88. package/src/a11y-assist/a11y_assist/profiles/plain_language_render.py +66 -0
  89. package/src/a11y-assist/a11y_assist/profiles/screen_reader.py +348 -0
  90. package/src/a11y-assist/a11y_assist/profiles/screen_reader_render.py +89 -0
  91. package/src/a11y-assist/a11y_assist/render.py +95 -0
  92. package/src/a11y-assist/a11y_assist/schemas/assist.request.schema.v0.1.json +52 -0
  93. package/src/a11y-assist/a11y_assist/schemas/assist.response.schema.v0.1.json +70 -0
  94. package/src/a11y-assist/a11y_assist/schemas/cli.error.schema.v0.1.json +78 -0
  95. package/src/a11y-assist/a11y_assist/storage.py +31 -0
  96. package/src/a11y-assist/pyproject.toml +60 -0
  97. package/src/a11y-assist/tests/__init__.py +1 -0
  98. package/src/a11y-assist/tests/fixtures/base_inputs/cli_error_high.json +18 -0
  99. package/src/a11y-assist/tests/fixtures/base_inputs/cli_error_medium.json +16 -0
  100. package/src/a11y-assist/tests/fixtures/base_inputs/raw_text_low.txt +3 -0
  101. package/src/a11y-assist/tests/fixtures/cli_error_good.json +9 -0
  102. package/src/a11y-assist/tests/fixtures/cli_error_missing_id.json +7 -0
  103. package/src/a11y-assist/tests/fixtures/cli_error_string_format.json +7 -0
  104. package/src/a11y-assist/tests/fixtures/expected/cognitive_load_high.txt +20 -0
  105. package/src/a11y-assist/tests/fixtures/expected/dyslexia_high.txt +20 -0
  106. package/src/a11y-assist/tests/fixtures/expected/lowvision_high.txt +18 -0
  107. package/src/a11y-assist/tests/fixtures/expected/plain_language_high.txt +14 -0
  108. package/src/a11y-assist/tests/fixtures/expected/screen_reader_high.txt +19 -0
  109. package/src/a11y-assist/tests/fixtures/golden_screen_reader_cli_error.txt +16 -0
  110. package/src/a11y-assist/tests/fixtures/golden_screen_reader_raw_no_id.txt +14 -0
  111. package/src/a11y-assist/tests/fixtures/golden_screen_reader_raw_with_id.txt +14 -0
  112. package/src/a11y-assist/tests/fixtures/raw_good.txt +11 -0
  113. package/src/a11y-assist/tests/fixtures/raw_no_id.txt +2 -0
  114. package/src/a11y-assist/tests/test_cognitive_load.py +469 -0
  115. package/src/a11y-assist/tests/test_dyslexia.py +337 -0
  116. package/src/a11y-assist/tests/test_explain.py +74 -0
  117. package/src/a11y-assist/tests/test_golden.py +127 -0
  118. package/src/a11y-assist/tests/test_guard.py +819 -0
  119. package/src/a11y-assist/tests/test_guard_integration.py +457 -0
  120. package/src/a11y-assist/tests/test_ingest.py +311 -0
  121. package/src/a11y-assist/tests/test_methods_metadata.py +236 -0
  122. package/src/a11y-assist/tests/test_plain_language.py +348 -0
  123. package/src/a11y-assist/tests/test_render.py +117 -0
  124. package/src/a11y-assist/tests/test_screen_reader.py +703 -0
  125. package/src/a11y-assist/tests/test_storage_last.py +61 -0
  126. package/src/a11y-assist/tests/test_triage.py +86 -0
  127. package/src/a11y-ci/.github/workflows/ci.yml +43 -0
  128. package/src/a11y-ci/.github/workflows/test.yml +30 -0
  129. package/src/a11y-ci/A11Y_CI_TEST_COVERAGE_REQUIREMENTS.md +94 -0
  130. package/src/a11y-ci/CODE_OF_CONDUCT.md +129 -0
  131. package/src/a11y-ci/CONTRIBUTING.md +142 -0
  132. package/src/a11y-ci/LICENSE +21 -0
  133. package/src/a11y-ci/README.md +105 -0
  134. package/src/a11y-ci/a11y_ci/__init__.py +3 -0
  135. package/src/a11y-ci/a11y_ci/allowlist.py +83 -0
  136. package/src/a11y-ci/a11y_ci/cli.py +145 -0
  137. package/src/a11y-ci/a11y_ci/gate.py +131 -0
  138. package/src/a11y-ci/a11y_ci/render.py +48 -0
  139. package/src/a11y-ci/a11y_ci/schemas/allowlist.schema.json +24 -0
  140. package/src/a11y-ci/a11y_ci/scorecard.py +99 -0
  141. package/src/a11y-ci/npm/package.json +35 -0
  142. package/src/a11y-ci/pyproject.toml +64 -0
  143. package/src/a11y-ci/tests/__init__.py +1 -0
  144. package/src/a11y-ci/tests/fixtures/allowlist_expired.json +10 -0
  145. package/src/a11y-ci/tests/fixtures/allowlist_ok.json +10 -0
  146. package/src/a11y-ci/tests/fixtures/baseline_ok.json +7 -0
  147. package/src/a11y-ci/tests/fixtures/current_fail.json +6 -0
  148. package/src/a11y-ci/tests/fixtures/current_ok.json +6 -0
  149. package/src/a11y-ci/tests/fixtures/current_regresses.json +7 -0
  150. package/src/a11y-ci/tests/test_gate.py +134 -0
  151. package/src/a11y-evidence-engine/.github/workflows/ci.yml +53 -0
  152. package/src/a11y-evidence-engine/CODE_OF_CONDUCT.md +129 -0
  153. package/src/a11y-evidence-engine/CONTRIBUTING.md +128 -0
  154. package/src/a11y-evidence-engine/LICENSE +21 -0
  155. package/src/a11y-evidence-engine/README.md +71 -0
  156. package/src/a11y-evidence-engine/bin/a11y-engine.js +11 -0
  157. package/src/a11y-evidence-engine/fixtures/bad/button-no-name.html +30 -0
  158. package/src/a11y-evidence-engine/fixtures/bad/img-missing-alt.html +19 -0
  159. package/src/a11y-evidence-engine/fixtures/bad/input-missing-label.html +26 -0
  160. package/src/a11y-evidence-engine/fixtures/bad/missing-lang.html +11 -0
  161. package/src/a11y-evidence-engine/fixtures/good/index.html +29 -0
  162. package/src/a11y-evidence-engine/package-lock.json +109 -0
  163. package/src/a11y-evidence-engine/package.json +45 -0
  164. package/src/a11y-evidence-engine/src/cli.js +74 -0
  165. package/src/a11y-evidence-engine/src/evidence/canonicalize.js +52 -0
  166. package/src/a11y-evidence-engine/src/evidence/json_pointer.js +34 -0
  167. package/src/a11y-evidence-engine/src/evidence/prov_emit.js +153 -0
  168. package/src/a11y-evidence-engine/src/fswalk.js +56 -0
  169. package/src/a11y-evidence-engine/src/html_parse.js +117 -0
  170. package/src/a11y-evidence-engine/src/ids.js +53 -0
  171. package/src/a11y-evidence-engine/src/rules/document_missing_lang.js +50 -0
  172. package/src/a11y-evidence-engine/src/rules/form_control_missing_label.js +105 -0
  173. package/src/a11y-evidence-engine/src/rules/img_missing_alt.js +77 -0
  174. package/src/a11y-evidence-engine/src/rules/index.js +37 -0
  175. package/src/a11y-evidence-engine/src/rules/interactive_missing_name.js +129 -0
  176. package/src/a11y-evidence-engine/src/scan.js +128 -0
  177. package/src/a11y-evidence-engine/test/scan.test.js +149 -0
  178. package/src/a11y-evidence-engine/test/vectors.test.js +200 -0
  179. package/src/a11y-lint/.github/workflows/ci.yml +46 -0
  180. package/src/a11y-lint/.github/workflows/test.yml +34 -0
  181. package/src/a11y-lint/CODE_OF_CONDUCT.md +129 -0
  182. package/src/a11y-lint/CONTRIBUTING.md +70 -0
  183. package/src/a11y-lint/GOVERNANCE.md +57 -0
  184. package/src/a11y-lint/LICENSE +21 -0
  185. package/src/a11y-lint/PRESS_RELEASE.md +50 -0
  186. package/src/a11y-lint/README.md +276 -0
  187. package/src/a11y-lint/RELEASE_NOTES.md +57 -0
  188. package/src/a11y-lint/RELEASING.md +57 -0
  189. package/src/a11y-lint/a11y_lint/__init__.py +64 -0
  190. package/src/a11y-lint/a11y_lint/cli.py +319 -0
  191. package/src/a11y-lint/a11y_lint/errors.py +252 -0
  192. package/src/a11y-lint/a11y_lint/render.py +293 -0
  193. package/src/a11y-lint/a11y_lint/report_md.py +289 -0
  194. package/src/a11y-lint/a11y_lint/scan_cli_text.py +434 -0
  195. package/src/a11y-lint/a11y_lint/schemas/cli.error.schema.v0.1.json +83 -0
  196. package/src/a11y-lint/a11y_lint/scorecard.py +244 -0
  197. package/src/a11y-lint/a11y_lint/validate.py +225 -0
  198. package/src/a11y-lint/pyproject.toml +75 -0
  199. package/src/a11y-lint/tests/__init__.py +1 -0
  200. package/src/a11y-lint/tests/test_cli.py +200 -0
  201. package/src/a11y-lint/tests/test_errors.py +188 -0
  202. package/src/a11y-lint/tests/test_render.py +202 -0
  203. package/src/a11y-lint/tests/test_report_md.py +188 -0
  204. package/src/a11y-lint/tests/test_scan_cli_text.py +290 -0
  205. package/src/a11y-lint/tests/test_scorecard.py +195 -0
  206. package/src/a11y-lint/tests/test_validate.py +257 -0
  207. package/src/a11y-mcp-tools/.github/workflows/ci.yml +53 -0
  208. package/src/a11y-mcp-tools/CODE_OF_CONDUCT.md +129 -0
  209. package/src/a11y-mcp-tools/CONTRIBUTING.md +136 -0
  210. package/src/a11y-mcp-tools/LICENSE +21 -0
  211. package/src/a11y-mcp-tools/PROV_METHODS_CATALOG.md +104 -0
  212. package/src/a11y-mcp-tools/README.md +168 -0
  213. package/src/a11y-mcp-tools/bin/cli.js +452 -0
  214. package/src/a11y-mcp-tools/bin/server.js +244 -0
  215. package/src/a11y-mcp-tools/fixtures/requests/a11y.diagnose.ok.json +27 -0
  216. package/src/a11y-mcp-tools/fixtures/requests/a11y.evidence.ok.json +25 -0
  217. package/src/a11y-mcp-tools/fixtures/responses/a11y.diagnose.ok.json +139 -0
  218. package/src/a11y-mcp-tools/fixtures/responses/a11y.diagnose.provenance_fail.json +13 -0
  219. package/src/a11y-mcp-tools/fixtures/responses/a11y.evidence.ok.json +88 -0
  220. package/src/a11y-mcp-tools/package-lock.json +189 -0
  221. package/src/a11y-mcp-tools/package.json +49 -0
  222. package/src/a11y-mcp-tools/src/envelope.js +197 -0
  223. package/src/a11y-mcp-tools/src/index.js +9 -0
  224. package/src/a11y-mcp-tools/src/schemas/artifact.js +85 -0
  225. package/src/a11y-mcp-tools/src/schemas/diagnosis.schema.v0.1.json +137 -0
  226. package/src/a11y-mcp-tools/src/schemas/envelope.schema.v0.1.json +108 -0
  227. package/src/a11y-mcp-tools/src/schemas/evidence.bundle.schema.v0.1.json +129 -0
  228. package/src/a11y-mcp-tools/src/schemas/evidence.js +97 -0
  229. package/src/a11y-mcp-tools/src/schemas/index.js +11 -0
  230. package/src/a11y-mcp-tools/src/schemas/provenance.js +140 -0
  231. package/src/a11y-mcp-tools/src/schemas/tools/a11y.diagnose.request.schema.v0.1.json +77 -0
  232. package/src/a11y-mcp-tools/src/schemas/tools/a11y.diagnose.response.schema.v0.1.json +50 -0
  233. package/src/a11y-mcp-tools/src/schemas/tools/a11y.evidence.request.schema.v0.1.json +120 -0
  234. package/src/a11y-mcp-tools/src/schemas/tools/a11y.evidence.response.schema.v0.1.json +50 -0
  235. package/src/a11y-mcp-tools/src/tools/diagnose.js +597 -0
  236. package/src/a11y-mcp-tools/src/tools/evidence.js +481 -0
  237. package/src/a11y-mcp-tools/src/tools/index.js +10 -0
  238. package/src/a11y-mcp-tools/test/contract.test.mjs +154 -0
  239. package/src/a11y-mcp-tools/test/diagnose.test.js +485 -0
  240. package/src/a11y-mcp-tools/test/evidence.test.js +183 -0
  241. package/src/a11y-mcp-tools/test/schema.test.js +327 -0
@@ -0,0 +1,64 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "a11y-ci"
7
+ version = "0.1.0"
8
+ description = "CI gate for a11y-lint scorecards (low-vision-first)."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "mcp-tool-shop", email = "64996768+mcp-tool-shop@users.noreply.github.com"}
14
+ ]
15
+ keywords = [
16
+ "a11y",
17
+ "accessibility",
18
+ "ci",
19
+ "gate",
20
+ "low-vision",
21
+ "scorecard",
22
+ "testing",
23
+ "quality-assurance",
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 4 - Beta",
27
+ "Environment :: Console",
28
+ "Intended Audience :: Developers",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Operating System :: OS Independent",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.10",
33
+ "Programming Language :: Python :: 3.11",
34
+ "Programming Language :: Python :: 3.12",
35
+ "Topic :: Software Development :: Quality Assurance",
36
+ "Topic :: Software Development :: Testing",
37
+ ]
38
+ dependencies = [
39
+ "click>=8.1.7",
40
+ "jsonschema>=4.22.0",
41
+ ]
42
+
43
+ [project.optional-dependencies]
44
+ dev = [
45
+ "pytest>=8.0.0",
46
+ "ruff>=0.6.0",
47
+ ]
48
+
49
+ [project.scripts]
50
+ a11y-ci = "a11y_ci.cli:main"
51
+
52
+ [project.urls]
53
+ Homepage = "https://github.com/mcp-tool-shop-org/a11y-ci"
54
+ Repository = "https://github.com/mcp-tool-shop-org/a11y-ci"
55
+ Issues = "https://github.com/mcp-tool-shop-org/a11y-ci/issues"
56
+
57
+ [tool.setuptools.packages.find]
58
+ include = ["a11y_ci*"]
59
+
60
+ [tool.ruff]
61
+ line-length = 100
62
+
63
+ [tool.pytest.ini_options]
64
+ testpaths = ["tests"]
@@ -0,0 +1 @@
1
+ """Tests for a11y-ci."""
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": "1",
3
+ "allow": [
4
+ {
5
+ "finding_id": "CLI.COLOR.ONLY",
6
+ "expires": "2020-01-01",
7
+ "reason": "Expired suppression should be flagged and removed."
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": "1",
3
+ "allow": [
4
+ {
5
+ "finding_id": "CLI.COLOR.ONLY",
6
+ "expires": "2026-12-31",
7
+ "reason": "Temporary suppression for legacy output. Tracked in issue #12."
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "tool": {"name": "a11y-lint", "version": "0.1.0"},
3
+ "summary": {"critical": 0, "serious": 0, "moderate": 1, "minor": 0, "info": 0},
4
+ "findings": [
5
+ {"rule_id": "CLI.LINE.LENGTH", "severity": "moderate", "title": "Line too long"}
6
+ ]
7
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "tool": {"name": "a11y-lint", "version": "0.1.0"},
3
+ "findings": [
4
+ {"rule_id": "CLI.COLOR.ONLY", "severity": "serious", "title": "Color-only meaning"}
5
+ ]
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "tool": {"name": "a11y-lint", "version": "0.1.0"},
3
+ "findings": [
4
+ {"rule_id": "CLI.LINE.LENGTH", "severity": "moderate", "title": "Line too long"}
5
+ ]
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "tool": {"name": "a11y-lint", "version": "0.1.0"},
3
+ "findings": [
4
+ {"rule_id": "CLI.COLOR.ONLY", "severity": "serious", "title": "Color-only meaning"},
5
+ {"rule_id": "CLI.ERROR.STRUCTURE", "severity": "serious", "title": "Missing What/Why/Fix"}
6
+ ]
7
+ }
@@ -0,0 +1,134 @@
1
+ """Tests for the gate module."""
2
+
3
+ from pathlib import Path
4
+
5
+ import pytest
6
+
7
+ from a11y_ci.allowlist import Allowlist
8
+ from a11y_ci.gate import gate
9
+ from a11y_ci.scorecard import Scorecard
10
+
11
+ FIX = Path(__file__).parent / "fixtures"
12
+
13
+
14
+ class TestGateBasic:
15
+ """Basic gate tests without baseline."""
16
+
17
+ def test_gate_passes_without_serious(self):
18
+ """Gate passes when no findings at/above threshold."""
19
+ current = Scorecard.load(str(FIX / "current_ok.json"))
20
+ result = gate(current=current, baseline=None, fail_on="serious", allowlist=None)
21
+ assert result.ok
22
+ assert result.current_blocking_ids == []
23
+
24
+ def test_gate_fails_on_serious_in_current(self):
25
+ """Gate fails when current has findings at/above threshold."""
26
+ current = Scorecard.load(str(FIX / "current_fail.json"))
27
+ result = gate(current=current, baseline=None, fail_on="serious", allowlist=None)
28
+ assert not result.ok
29
+ assert "Current run has" in " ".join(result.reasons)
30
+ assert "CLI.COLOR.ONLY" in result.current_blocking_ids
31
+
32
+ def test_gate_passes_when_below_threshold(self):
33
+ """Gate passes when findings are below the threshold."""
34
+ current = Scorecard.load(str(FIX / "current_fail.json"))
35
+ # fail_on=critical means serious is allowed
36
+ result = gate(current=current, baseline=None, fail_on="critical", allowlist=None)
37
+ assert result.ok
38
+
39
+
40
+ class TestGateWithBaseline:
41
+ """Gate tests with baseline comparison."""
42
+
43
+ def test_gate_regression_vs_baseline_counts_and_ids(self):
44
+ """Gate fails on regression from baseline."""
45
+ baseline = Scorecard.load(str(FIX / "baseline_ok.json"))
46
+ current = Scorecard.load(str(FIX / "current_regresses.json"))
47
+ result = gate(current=current, baseline=baseline, fail_on="serious", allowlist=None)
48
+ assert not result.ok
49
+ assert result.new_blocking_ids # new serious+ IDs
50
+ assert "CLI.COLOR.ONLY" in result.new_blocking_ids
51
+ assert "CLI.ERROR.STRUCTURE" in result.new_blocking_ids
52
+
53
+ def test_gate_no_regression_when_same(self):
54
+ """Gate passes when current matches baseline."""
55
+ baseline = Scorecard.load(str(FIX / "baseline_ok.json"))
56
+ current = Scorecard.load(str(FIX / "current_ok.json"))
57
+ result = gate(current=current, baseline=baseline, fail_on="serious", allowlist=None)
58
+ assert result.ok
59
+
60
+
61
+ class TestGateWithAllowlist:
62
+ """Gate tests with allowlist."""
63
+
64
+ def test_allowlist_suppresses_ids(self):
65
+ """Allowlist suppresses matching finding IDs."""
66
+ baseline = Scorecard.load(str(FIX / "baseline_ok.json"))
67
+ current = Scorecard.load(str(FIX / "current_fail.json"))
68
+ allow = Allowlist.load(str(FIX / "allowlist_ok.json"))
69
+
70
+ result = gate(current=current, baseline=baseline, fail_on="serious", allowlist=allow)
71
+ # suppression should remove the only serious finding, leaving gate pass
72
+ assert result.ok
73
+
74
+ def test_expired_allowlist_is_reported_as_reason(self):
75
+ """Expired allowlist entries cause gate failure."""
76
+ current = Scorecard.load(str(FIX / "current_fail.json"))
77
+ allow = Allowlist.load(str(FIX / "allowlist_expired.json"))
78
+ result = gate(current=current, baseline=None, fail_on="serious", allowlist=allow)
79
+ # Even though it's suppressed, expired allowlist should create a reason
80
+ assert not result.ok
81
+ assert any("expired" in r.lower() for r in result.reasons)
82
+
83
+
84
+ class TestScorecardLoading:
85
+ """Tests for scorecard loading and counts."""
86
+
87
+ def test_scorecard_loads_findings(self):
88
+ """Scorecard correctly loads findings."""
89
+ sc = Scorecard.load(str(FIX / "current_ok.json"))
90
+ assert len(sc.findings) == 1
91
+ assert sc.findings[0]["rule_id"] == "CLI.LINE.LENGTH"
92
+
93
+ def test_scorecard_counts_from_summary(self):
94
+ """Scorecard uses summary when present."""
95
+ sc = Scorecard.load(str(FIX / "baseline_ok.json"))
96
+ counts = sc.counts()
97
+ assert counts["moderate"] == 1
98
+ assert counts["serious"] == 0
99
+
100
+ def test_scorecard_counts_from_findings(self):
101
+ """Scorecard computes counts from findings when no summary."""
102
+ sc = Scorecard.load(str(FIX / "current_regresses.json"))
103
+ counts = sc.counts()
104
+ assert counts["serious"] == 2
105
+
106
+ def test_ids_at_or_above(self):
107
+ """ids_at_or_above returns correct finding IDs."""
108
+ sc = Scorecard.load(str(FIX / "current_regresses.json"))
109
+ ids = sc.ids_at_or_above("serious")
110
+ assert "CLI.COLOR.ONLY" in ids
111
+ assert "CLI.ERROR.STRUCTURE" in ids
112
+
113
+
114
+ class TestAllowlistLoading:
115
+ """Tests for allowlist loading and validation."""
116
+
117
+ def test_allowlist_loads_entries(self):
118
+ """Allowlist correctly loads entries."""
119
+ allow = Allowlist.load(str(FIX / "allowlist_ok.json"))
120
+ assert len(allow.entries) == 1
121
+ assert allow.entries[0].finding_id == "CLI.COLOR.ONLY"
122
+ assert allow.entries[0].expires == "2026-12-31"
123
+
124
+ def test_allowlist_suppressed_ids(self):
125
+ """suppressed_ids returns correct set."""
126
+ allow = Allowlist.load(str(FIX / "allowlist_ok.json"))
127
+ assert "CLI.COLOR.ONLY" in allow.suppressed_ids()
128
+
129
+ def test_allowlist_expired_entries(self):
130
+ """expired_entries detects expired suppressions."""
131
+ allow = Allowlist.load(str(FIX / "allowlist_expired.json"))
132
+ expired = allow.expired_entries()
133
+ assert len(expired) == 1
134
+ assert expired[0].finding_id == "CLI.COLOR.ONLY"
@@ -0,0 +1,53 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-version: [18.x, 20.x, 22.x]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Use Node.js ${{ matrix.node-version }}
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+ cache: 'npm'
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Run tests
30
+ run: npm test
31
+
32
+ - name: Verify CLI works
33
+ run: |
34
+ node bin/a11y-engine.js scan fixtures/html --out test-results
35
+ test -d test-results
36
+
37
+ lint:
38
+ runs-on: ubuntu-latest
39
+
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - name: Use Node.js
44
+ uses: actions/setup-node@v4
45
+ with:
46
+ node-version: '20.x'
47
+ cache: 'npm'
48
+
49
+ - name: Install dependencies
50
+ run: npm ci
51
+
52
+ - name: Check for syntax errors
53
+ run: node --check bin/a11y-engine.js src/cli.js
@@ -0,0 +1,129 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series
87
+ of actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or
94
+ permanent ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within
114
+ the community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.0, available at
120
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
121
+
122
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
123
+ enforcement ladder](https://github.com/mozilla/diversity).
124
+
125
+ [homepage]: https://www.contributor-covenant.org
126
+
127
+ For answers to common questions about this code of conduct, see the FAQ at
128
+ https://www.contributor-covenant.org/faq. Translations are available at
129
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,128 @@
1
+ # Contributing to a11y-evidence-engine
2
+
3
+ Thank you for your interest in contributing to a11y-evidence-engine! We appreciate your help in building a robust accessibility evidence engine with provenance tracking.
4
+
5
+ ## How to Contribute
6
+
7
+ ### Reporting Issues
8
+
9
+ If you find a bug or have a suggestion:
10
+
11
+ 1. Check if the issue already exists in [GitHub Issues](https://github.com/mcp-tool-shop-org/a11y-evidence-engine/issues)
12
+ 2. If not, create a new issue with:
13
+ - A clear, descriptive title
14
+ - Steps to reproduce (for bugs)
15
+ - Expected vs. actual behavior
16
+ - Your environment (Node version, OS)
17
+ - Sample HTML if relevant
18
+
19
+ ### Contributing Code
20
+
21
+ 1. **Fork the repository** and create a branch from `main`
22
+ 2. **Set up your development environment**
23
+ ```bash
24
+ npm install
25
+ ```
26
+ 3. **Make your changes**
27
+ - Follow the existing code style
28
+ - Add tests for new functionality
29
+ - Ensure all tests pass: `npm test`
30
+ - Update documentation as needed
31
+ 4. **Commit your changes**
32
+ - Use clear, descriptive commit messages
33
+ - Reference issue numbers when applicable
34
+ 5. **Submit a pull request**
35
+ - Describe what your PR does and why
36
+ - Link to related issues
37
+
38
+ ### Development Workflow
39
+
40
+ ```bash
41
+ # Install dependencies
42
+ npm install
43
+
44
+ # Run tests
45
+ npm test
46
+
47
+ # Scan HTML files (test the CLI)
48
+ npm run scan -- fixtures/html/example.html
49
+
50
+ # Test the engine directly
51
+ node bin/a11y-engine.js scan path/to/html --out results
52
+ ```
53
+
54
+ ### Testing
55
+
56
+ All new features should include tests. Tests are located in the `test/` directory and use Node's built-in test runner.
57
+
58
+ ```javascript
59
+ // Example test structure
60
+ import { test } from 'node:test';
61
+ import assert from 'node:assert/strict';
62
+
63
+ test('should detect missing lang attribute', () => {
64
+ const html = '<html><head></head><body></body></html>';
65
+ const findings = scan(html);
66
+ assert.equal(findings[0].rule, 'html.document.missing_lang');
67
+ });
68
+ ```
69
+
70
+ ### Adding New Rules
71
+
72
+ 1. Add rule implementation in `src/rules/`
73
+ 2. Add test cases in `test/*.test.js`
74
+ 3. Update README.md with rule documentation
75
+ 4. Ensure provenance records are generated correctly
76
+
77
+ ### Code Style
78
+
79
+ - Use ES modules (`import`/`export`)
80
+ - Prefer `const` over `let`
81
+ - Use descriptive variable names
82
+ - Add JSDoc comments for public APIs
83
+ - Follow existing patterns for consistency
84
+
85
+ ### Provenance Design Principles
86
+
87
+ - **Deterministic** - Same input produces same output
88
+ - **Verifiable** - Evidence can be independently verified
89
+ - **Tamper-evident** - SHA-256 digests detect any changes
90
+ - **Traceable** - prov-spec records document all operations
91
+ - **Evidence-anchored** - Findings reference specific artifact locations (JSON Pointer)
92
+
93
+ ## Project Structure
94
+
95
+ ```
96
+ a11y-evidence-engine/
97
+ ├── bin/ # CLI entry point
98
+ ├── src/ # Source code
99
+ │ ├── cli.js # CLI implementation
100
+ │ ├── scanner.js # Core scanner
101
+ │ ├── rules/ # Rule implementations
102
+ │ └── provenance.js # Provenance generation
103
+ ├── test/ # Test suite
104
+ ├── fixtures/ # Test fixtures
105
+ └── package.json # Project configuration
106
+ ```
107
+
108
+ ## Exit Codes
109
+
110
+ Maintain CI-native exit codes:
111
+ - `0` - No findings with severity `error`
112
+ - `2` - At least one `error` finding
113
+ - `3` - Internal engine failure / invalid input
114
+
115
+ ## Provenance Records
116
+
117
+ Ensure all findings include three prov-spec records:
118
+ 1. `record.json` - Evidence extraction
119
+ 2. `digest.json` - SHA-256 integrity
120
+ 3. `envelope.json` - MCP envelope
121
+
122
+ ## Code of Conduct
123
+
124
+ Please note that this project is released with a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to abide by its terms.
125
+
126
+ ## Questions?
127
+
128
+ Open an issue or start a discussion. We're here to help!
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mcp-tool-shop
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,71 @@
1
+ # a11y-evidence-engine
2
+
3
+ Headless accessibility evidence engine that emits [prov-spec](https://github.com/mcp-tool-shop-org/prov-spec) provenance records.
4
+
5
+ Designed to pair with **a11y-assist**: this engine finds issues and captures verifiable evidence; a11y-assist turns those findings into fixes.
6
+
7
+ ## Features
8
+
9
+ - **Deterministic output**: Same input always produces identical findings and provenance
10
+ - **prov-spec compatible**: Every finding includes cryptographically verifiable evidence
11
+ - **CI-friendly**: Exit codes designed for automation
12
+ - **No browser required**: Pure static HTML analysis
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install -g a11y-evidence-engine
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ # Scan a file or directory
24
+ a11y-engine scan ./path/to/html --out ./results
25
+
26
+ # View help
27
+ a11y-engine --help
28
+ ```
29
+
30
+ ## Output
31
+
32
+ ```
33
+ results/
34
+ ├── findings.json # All findings with metadata
35
+ └── provenance/
36
+ └── finding-0001/
37
+ ├── record.json # engine.extract.evidence.json_pointer
38
+ ├── digest.json # integrity.digest.sha256
39
+ └── envelope.json # adapter.wrap.envelope_v0_1
40
+ ```
41
+
42
+ ## Exit Codes
43
+
44
+ | Code | Meaning |
45
+ |------|---------|
46
+ | 0 | No findings with severity `error` |
47
+ | 2 | At least one `error` finding |
48
+ | 3 | Internal engine failure / invalid input |
49
+
50
+ ## Rules (v0.1.0)
51
+
52
+ | Rule ID | Description |
53
+ |---------|-------------|
54
+ | `html.document.missing_lang` | `<html>` element missing `lang` attribute |
55
+ | `html.img.missing_alt` | `<img>` element missing `alt` attribute |
56
+ | `html.form_control.missing_label` | Form control missing associated label |
57
+ | `html.interactive.missing_name` | Interactive element missing accessible name |
58
+
59
+ ## Provenance
60
+
61
+ Each finding includes three prov-spec records:
62
+
63
+ 1. **record.json**: Evidence extraction using `engine.extract.evidence.json_pointer`
64
+ 2. **digest.json**: SHA-256 hash of canonical evidence using `integrity.digest.sha256`
65
+ 3. **envelope.json**: Wrapped result using `adapter.wrap.envelope_v0_1`
66
+
67
+ These records are independently verifiable without trusting the engine.
68
+
69
+ ## License
70
+
71
+ MIT
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { run } = require("../src/cli.js");
5
+
6
+ run(process.argv.slice(2))
7
+ .then((code) => process.exit(code))
8
+ .catch((err) => {
9
+ console.error("Fatal error:", err.message);
10
+ process.exit(3);
11
+ });