@reqvire-org/ads 0.4.6 → 0.5.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 (1071) hide show
  1. package/README.md +265 -420
  2. package/dist/accessibility-declarations.mjs +43 -0
  3. package/dist/active-clock.d.mts +30 -0
  4. package/dist/active-clock.mjs +26 -17
  5. package/dist/ads-errors.mjs +3421 -0
  6. package/dist/ads-view-choices.mjs +17 -0
  7. package/dist/ads-views.mjs +12 -0
  8. package/dist/analysis/captured-content.mjs +16 -0
  9. package/dist/analysis/compiler-options.mjs +3 -7
  10. package/dist/analysis/context.mjs +14 -20
  11. package/dist/analysis/controller-gates.mjs +119 -0
  12. package/dist/analysis/design-usage.mjs +126 -0
  13. package/dist/analysis/file-tree.mjs +44 -29
  14. package/dist/analysis/framework-imports.mjs +62 -0
  15. package/dist/analysis/glyph-macros.mjs +103 -0
  16. package/dist/analysis/helpers.mjs +119 -91
  17. package/dist/analysis/impact.mjs +25 -12
  18. package/dist/analysis/inputs.mjs +19 -13
  19. package/dist/analysis/mock-check.mjs +98 -0
  20. package/dist/analysis/module-graph.mjs +156 -0
  21. package/dist/analysis/module-resolvers.mjs +30 -28
  22. package/dist/analysis/native-adapter.mjs +139 -146
  23. package/dist/analysis/native-boundary.mjs +52 -0
  24. package/dist/analysis/native-project.mjs +331 -231
  25. package/dist/analysis/native-session.mjs +20 -0
  26. package/dist/analysis/owner-accessibility.mjs +74 -0
  27. package/dist/analysis/owner-analysis-cache.mjs +125 -0
  28. package/dist/analysis/owner-analysis-key.mjs +114 -0
  29. package/dist/analysis/owner-choices.mjs +763 -0
  30. package/dist/analysis/owner-composition.mjs +612 -0
  31. package/dist/analysis/owner-discovery.mjs +164 -0
  32. package/dist/analysis/owner-failures.mjs +19 -0
  33. package/dist/analysis/owner-outcomes.mjs +42 -0
  34. package/dist/analysis/owner-reuse.mjs +100 -0
  35. package/dist/analysis/owner-source.mjs +1506 -0
  36. package/dist/analysis/public-imports.mjs +31 -0
  37. package/dist/analysis/queries.mjs +72 -54
  38. package/dist/analysis/runtime-setters.mjs +114 -0
  39. package/dist/analysis/scenario-keys.mjs +151 -0
  40. package/dist/analysis/service.mjs +111 -70
  41. package/dist/analysis/standalone.mjs +40 -37
  42. package/dist/analysis/styling-ownership.mjs +276 -0
  43. package/dist/analysis/svg-attributes.mjs +199 -0
  44. package/dist/analysis/syntax.mjs +82 -78
  45. package/dist/analysis/visual-bindings.mjs +68 -0
  46. package/dist/analysis/worker-protocol.mjs +302 -0
  47. package/dist/analysis/worker.mjs +234 -166
  48. package/dist/api-signature.mjs +53 -0
  49. package/dist/app-icon-checks.mjs +298 -0
  50. package/dist/app-icon-declaration.d.mts +53 -0
  51. package/dist/app-icon-declaration.mjs +66 -0
  52. package/dist/asset-binding.mjs +35 -0
  53. package/dist/asset-catalog.mjs +83 -0
  54. package/dist/asset-declaration.d.mts +42 -0
  55. package/dist/asset-declaration.mjs +108 -0
  56. package/dist/asset-macro.d.mts +63 -0
  57. package/dist/asset-macro.mjs +22 -0
  58. package/dist/asset-model.mjs +74 -0
  59. package/dist/asset-usage.mjs +14 -0
  60. package/dist/asset-view-facts.mjs +41 -0
  61. package/dist/authoring-macro.d.mts +11 -0
  62. package/dist/authoring-macro.mjs +21 -0
  63. package/dist/autocomplete-hints.mjs +31 -0
  64. package/dist/availability.mjs +9 -0
  65. package/dist/behavior-macro.d.mts +31 -0
  66. package/dist/behavior-macro.mjs +3 -0
  67. package/dist/behavior-registry.mjs +358 -0
  68. package/dist/boundaries.mjs +50 -212
  69. package/dist/browser-runtime.mjs +73 -0
  70. package/dist/browser-test.d.mts +3 -0
  71. package/dist/browser-test.mjs +2 -0
  72. package/dist/bun-bundler.mjs +10 -0
  73. package/dist/bun-compiler.mjs +30 -18
  74. package/dist/bun-runtime.mjs +4 -0
  75. package/dist/bun-worker.mjs +10 -4
  76. package/dist/capture/request.mjs +81 -0
  77. package/dist/capture/worker.mjs +69 -40
  78. package/dist/capture/worker.page.mjs +6 -0
  79. package/dist/capture-store.mjs +159 -75
  80. package/dist/capture.mjs +232 -95
  81. package/dist/check-service.mjs +27 -33
  82. package/dist/check.mjs +200 -904
  83. package/dist/cli-arguments.mjs +278 -0
  84. package/dist/cli.mjs +374 -304
  85. package/dist/color-values.mjs +294 -242
  86. package/dist/composed-contrast.mjs +628 -0
  87. package/dist/config.mjs +162 -454
  88. package/dist/construction-output.mjs +217 -0
  89. package/dist/construction-spec.d.mts +712 -0
  90. package/dist/construction-spec.mjs +937 -0
  91. package/dist/css-length.mjs +80 -0
  92. package/dist/css-quantity.mjs +173 -0
  93. package/dist/deletion-model.mjs +56 -0
  94. package/dist/deletion-plan.mjs +364 -0
  95. package/dist/dependency-manifest.mjs +56 -0
  96. package/dist/design-context-model.d.mts +61 -0
  97. package/dist/design-context-model.mjs +79 -0
  98. package/dist/design-contexts.mjs +105 -0
  99. package/dist/design-foundation.mjs +527 -0
  100. package/dist/design-inputs.mjs +156 -0
  101. package/dist/design-modules.mjs +27 -0
  102. package/dist/design-rejection.d.mts +23 -0
  103. package/dist/design-rejection.mjs +29 -0
  104. package/dist/design-system-closure.mjs +108 -0
  105. package/dist/design-usage.mjs +48 -0
  106. package/dist/development-modules.mjs +2 -0
  107. package/dist/development-runtime.mjs +0 -7
  108. package/dist/digest.mjs +2 -0
  109. package/dist/draft-boundary.mjs +1 -27
  110. package/dist/draft-workspace.mjs +11 -5
  111. package/dist/emit/accept.mjs +33 -0
  112. package/dist/emit/app-icon-emission.mjs +124 -0
  113. package/dist/emit/app-icon-render.mjs +126 -0
  114. package/dist/emit/asset-imports.mjs +18 -0
  115. package/dist/emit/cli-report.mjs +97 -0
  116. package/dist/emit/contract.mjs +136 -0
  117. package/dist/emit/emission.mjs +175 -0
  118. package/dist/emit/font-emission.mjs +91 -0
  119. package/dist/emit/foundation-sheet.mjs +55 -0
  120. package/dist/emit/icon-containers.mjs +46 -0
  121. package/dist/emit/integrity.mjs +61 -0
  122. package/dist/emit/lock.mjs +66 -0
  123. package/dist/emit/namespace.mjs +79 -0
  124. package/dist/emit/operation-reply.mjs +3 -0
  125. package/dist/emit/operation.mjs +36 -0
  126. package/dist/emit/output-location.mjs +20 -0
  127. package/dist/emit/output-package.mjs +7 -0
  128. package/dist/emit/owner-emission-cache.mjs +52 -0
  129. package/dist/emit/palette-module.mjs +19 -0
  130. package/dist/emit/palette-refresh.mjs +77 -0
  131. package/dist/emit/preview-emitter.mjs +110 -0
  132. package/dist/emit/preview-tree.mjs +174 -0
  133. package/dist/emit/scheduler.mjs +75 -0
  134. package/dist/emit/service.mjs +249 -0
  135. package/dist/emit/sync.mjs +38 -0
  136. package/dist/emit/watch.mjs +74 -0
  137. package/dist/emit/writer.mjs +102 -0
  138. package/dist/evidence.mjs +6 -8
  139. package/dist/example-babel.mjs +7 -0
  140. package/dist/example-literals.mjs +88 -0
  141. package/dist/finding-rules.mjs +71 -77
  142. package/dist/focus-checks.mjs +93 -0
  143. package/dist/font-checks.mjs +143 -0
  144. package/dist/font-declaration.d.mts +54 -0
  145. package/dist/font-declaration.mjs +77 -0
  146. package/dist/font-macro.d.mts +32 -0
  147. package/dist/font-macro.mjs +6 -0
  148. package/dist/font-model.mjs +37 -0
  149. package/dist/form-states.mjs +82 -0
  150. package/dist/foundation-macro.d.mts +108 -0
  151. package/dist/foundation-macro.mjs +6 -0
  152. package/dist/frame-regions.mjs +190 -0
  153. package/dist/glyph-set-declaration.d.mts +27 -0
  154. package/dist/glyph-set-declaration.mjs +36 -0
  155. package/dist/grid-checks.mjs +94 -0
  156. package/dist/grid-facts.mjs +92 -0
  157. package/dist/grid-lowering.mjs +257 -0
  158. package/dist/guard/cli.mjs +51 -0
  159. package/dist/guard/config.mjs +67 -0
  160. package/dist/guard/files.mjs +31 -0
  161. package/dist/guard/index.mjs +3 -0
  162. package/dist/guard/run.mjs +56 -0
  163. package/dist/guard/tsconfig.declarations.json +13 -0
  164. package/dist/index.mjs +2 -7
  165. package/dist/init-project.mjs +134 -0
  166. package/dist/init.mjs +225 -261
  167. package/dist/input-digests.mjs +216 -0
  168. package/dist/input-scope.mjs +18 -41
  169. package/dist/inspected-svg.d.mts +28 -0
  170. package/dist/inspected-svg.mjs +40 -0
  171. package/dist/inventories.mjs +149 -0
  172. package/dist/inventory-query.mjs +15 -0
  173. package/dist/investigations.mjs +177 -99
  174. package/dist/json.d.mts +10 -0
  175. package/dist/json.mjs +36 -0
  176. package/dist/linaria/atomic-processor.json +96 -0
  177. package/dist/linaria/atomic-processor.mjs +2452 -0
  178. package/dist/linaria/backend-identity.mjs +26 -0
  179. package/dist/linaria/compatibility.json +61 -0
  180. package/dist/linaria/css-shape.mjs +94 -0
  181. package/dist/linaria/custom-property-css.mjs +56 -0
  182. package/dist/linaria/delivery.mjs +111 -0
  183. package/dist/linaria/direct-extract.mjs +43 -0
  184. package/dist/linaria/extraction-cache.mjs +31 -0
  185. package/dist/linaria/extraction-model.mjs +5 -0
  186. package/dist/linaria/fingerprint.mjs +183 -0
  187. package/dist/linaria/pair-manifest.json +2315 -0
  188. package/dist/linaria/persisted-extraction-cache.mjs +352 -0
  189. package/dist/linaria/preservation.mjs +13 -0
  190. package/dist/linaria/priority-emitted-rank.mjs +40 -0
  191. package/dist/linaria/priority-manifest.mjs +87 -0
  192. package/dist/linaria/priority-table.mjs +47 -0
  193. package/dist/linaria/priority-tiers.mjs +27 -0
  194. package/dist/linaria/processor-host.mjs +42 -0
  195. package/dist/linaria/processor-runtime.mjs +36 -0
  196. package/dist/linaria-processor-NOTICES.md +147 -0
  197. package/dist/lowering-components.mjs +14 -0
  198. package/dist/lowering-effects.mjs +38 -0
  199. package/dist/lowering-emitter.mjs +29 -0
  200. package/dist/lowering-hidden.mjs +30 -0
  201. package/dist/lowering-layer.mjs +141 -0
  202. package/dist/lowering-motion.mjs +37 -0
  203. package/dist/lowering-normalize.mjs +194 -0
  204. package/dist/lowering-overlaps.mjs +328 -0
  205. package/dist/lowering-paint.mjs +32 -0
  206. package/dist/lowering-properties.mjs +144 -0
  207. package/dist/lowering-region-layout.mjs +191 -0
  208. package/dist/lowering-serialize.mjs +40 -0
  209. package/dist/lowering-session.mjs +130 -0
  210. package/dist/lowering-tiers.mjs +23 -0
  211. package/dist/lowering-transitions.mjs +39 -0
  212. package/dist/mcp/ads-mcp.mjs +423 -0
  213. package/dist/mcp/apps.mjs +3 -25
  214. package/dist/mcp/behavior-pages.mjs +58 -51
  215. package/dist/mcp/build-status.mjs +242 -254
  216. package/dist/mcp/catalog.mjs +21 -128
  217. package/dist/mcp/compiler-channel.mjs +280 -0
  218. package/dist/mcp/context.mjs +50 -40
  219. package/dist/mcp/deletions.mjs +147 -0
  220. package/dist/mcp/draft-discovery.mjs +43 -38
  221. package/dist/mcp/drafts.mjs +654 -755
  222. package/dist/mcp/execution-context.mjs +33 -22
  223. package/dist/mcp/execution-coordinator.mjs +367 -354
  224. package/dist/mcp/execution-results.mjs +440 -173
  225. package/dist/mcp/mutation-limits.mjs +1 -2
  226. package/dist/mcp/mutations.mjs +515 -553
  227. package/dist/mcp/patch.mjs +117 -75
  228. package/dist/mcp/preview-http.bundle.js +3 -7
  229. package/dist/mcp/preview-http.mjs +220 -107
  230. package/dist/mcp/preview-owner-guard.mjs +81 -43
  231. package/dist/mcp/preview-watch.mjs +492 -353
  232. package/dist/mcp/preview-widget.bundle.js +42 -46
  233. package/dist/mcp/preview-work.mjs +25 -13
  234. package/dist/mcp/prompts.mjs +22 -16
  235. package/dist/mcp/resource-loader.js +1 -1
  236. package/dist/mcp/result-pages.mjs +94 -54
  237. package/dist/mcp/sandbox-host.mjs +41 -19
  238. package/dist/mcp/server-discovery.mjs +96 -0
  239. package/dist/mcp/server-guides.mjs +43 -0
  240. package/dist/mcp/server-host.mjs +203 -0
  241. package/dist/mcp/server-observation.mjs +225 -0
  242. package/dist/mcp/server-project.mjs +371 -0
  243. package/dist/mcp/server-resources.mjs +466 -0
  244. package/dist/mcp/server-shared.mjs +79 -0
  245. package/dist/mcp/server-tools.mjs +791 -0
  246. package/dist/mcp/server.mjs +2 -2794
  247. package/dist/mcp/showcase-host.mjs +209 -135
  248. package/dist/mcp/showcase-http.mjs +50 -28
  249. package/dist/mcp/skills.mjs +32 -36
  250. package/dist/mcp/text-diff.mjs +18 -36
  251. package/dist/measured-geometry.mjs +157 -0
  252. package/dist/motion-model.mjs +50 -0
  253. package/dist/non-text-contrast.mjs +118 -0
  254. package/dist/owner-analysis-check.mjs +651 -0
  255. package/dist/owner-design.mjs +15 -0
  256. package/dist/owner-errors.mjs +200 -0
  257. package/dist/owner-lowering.mjs +186 -0
  258. package/dist/owner-scenarios.mjs +832 -0
  259. package/dist/ownership-model.d.mts +6 -0
  260. package/dist/ownership-model.mjs +124 -0
  261. package/dist/package-declarations.mjs +34 -0
  262. package/dist/paint-contrast.mjs +181 -0
  263. package/dist/palette-generated.mjs +101 -116
  264. package/dist/pictogram-model.mjs +13 -51
  265. package/dist/placeholder-contrast.mjs +34 -0
  266. package/dist/platform-features.mjs +377 -0
  267. package/dist/press-scale.mjs +26 -0
  268. package/dist/preview-bun.mjs +335 -406
  269. package/dist/preview-compile-inputs.mjs +78 -0
  270. package/dist/preview-contexts.mjs +7 -0
  271. package/dist/preview-failure.mjs +20 -10
  272. package/dist/preview-files.mjs +18 -36
  273. package/dist/preview-imports.mjs +76 -70
  274. package/dist/preview-incremental.mjs +322 -222
  275. package/dist/preview-inputs.mjs +28 -19
  276. package/dist/preview-manifest-update.mjs +67 -49
  277. package/dist/preview-requests.mjs +10 -17
  278. package/dist/preview-resources.mjs +275 -323
  279. package/dist/preview-scope.mjs +15 -17
  280. package/dist/preview-source.mjs +182 -0
  281. package/dist/preview-spatial.mjs +27 -0
  282. package/dist/profile-macro.d.mts +41 -0
  283. package/dist/profile-macro.mjs +6 -0
  284. package/dist/profile-model.d.mts +65 -0
  285. package/dist/profile-model.mjs +213 -0
  286. package/dist/profile-view-facts.mjs +42 -0
  287. package/dist/program-cache.mjs +9 -7
  288. package/dist/project-boundary.mjs +8 -13
  289. package/dist/project-documents.mjs +25 -29
  290. package/dist/property-registrations.mjs +44 -35
  291. package/dist/public-catalog.mjs +76 -0
  292. package/dist/recipe-defaults.mjs +117 -0
  293. package/dist/recipe-macro.d.mts +400 -0
  294. package/dist/recipe-macro.mjs +23 -0
  295. package/dist/recipe-model.d.mts +26 -0
  296. package/dist/recipe-model.mjs +190 -0
  297. package/dist/region-lowering.mjs +523 -0
  298. package/dist/registration-css.mjs +41 -0
  299. package/dist/registration-roles.mjs +35 -0
  300. package/dist/render-audit/axe-run.page.mjs +28 -0
  301. package/dist/render-audit/first-render.page.mjs +35 -0
  302. package/dist/render-audit/image-shape.page.mjs +42 -0
  303. package/dist/render-audit/layout-overflow.page.mjs +240 -0
  304. package/dist/render-audit/layout-shift.page.mjs +36 -0
  305. package/dist/render-audit/non-text-contrast.page.mjs +138 -0
  306. package/dist/render-audit/render-states.mjs +66 -293
  307. package/dist/render-audit/render-states.page.mjs +177 -0
  308. package/dist/render-audit/text-scale.mjs +42 -0
  309. package/dist/render-audit/text-scale.page.mjs +25 -0
  310. package/dist/render-audit/worker.mjs +125 -112
  311. package/dist/render-audit/worker.page.mjs +21 -0
  312. package/dist/render-audit.mjs +465 -500
  313. package/dist/resource-limits.mjs +185 -212
  314. package/dist/result.d.mts +34 -0
  315. package/dist/result.mjs +60 -0
  316. package/dist/role-vocabulary.d.mts +224 -0
  317. package/dist/role-vocabulary.mjs +223 -0
  318. package/dist/runtime-paint-contrast.mjs +97 -0
  319. package/dist/runtime-paint.mjs +42 -0
  320. package/dist/runtime-requirements.mjs +10 -11
  321. package/dist/runtime-style.mjs +21 -0
  322. package/dist/scenario-groups.mjs +42 -33
  323. package/dist/scenario-inspector.mjs +4 -4
  324. package/dist/scenario-kit.d.mts +79 -0
  325. package/dist/scenario-kit.mjs +18 -0
  326. package/dist/scenario-registry-model.mjs +2 -0
  327. package/dist/scenario-registry.mjs +89 -108
  328. package/dist/scenarios-compiler.mjs +901 -642
  329. package/dist/showcase/ads-views.mjs +103 -0
  330. package/dist/showcase/assets-view.mjs +221 -0
  331. package/dist/showcase/client.bundle.js +222 -59
  332. package/dist/showcase/guide-controls.d.mts +28 -0
  333. package/dist/showcase/guide-controls.mjs +31 -0
  334. package/dist/showcase/http-client.bundle.js +172 -9
  335. package/dist/showcase/index.html +1 -1
  336. package/dist/showcase/preview-frame.css +16 -0
  337. package/dist/showcase/preview-frame.d.mts +5 -0
  338. package/dist/showcase/preview-frame.mjs +4 -0
  339. package/dist/showcase/preview-root.d.mts +2 -0
  340. package/dist/showcase/preview-root.mjs +9 -0
  341. package/dist/showcase/profiles-view.mjs +280 -0
  342. package/dist/showcase/project-rules.mjs +9 -0
  343. package/dist/showcase/sandbox.bundle.js +1 -1
  344. package/dist/showcase/scenario-page.d.mts +39 -0
  345. package/dist/showcase/scenario-page.mjs +90 -0
  346. package/dist/showcase/style.css +2 -0
  347. package/dist/showcase/token-sample.mjs +46 -0
  348. package/dist/showcase/tokens-view.mjs +185 -0
  349. package/dist/showcase/ui/apple-touch-icon-9zwv3w79.png +0 -0
  350. package/dist/showcase/{favicon.ico → ui/favicon-c2c9kvtf.ico} +0 -0
  351. package/dist/showcase/ui/icon-192-t5zh7mxx.png +0 -0
  352. package/dist/showcase/ui/icon-512-ed6yz0n0.png +0 -0
  353. package/dist/showcase/ui/ui.css +1 -1353
  354. package/dist/showcase/ui/ui.js +165 -1064
  355. package/dist/showcase-http-routes.mjs +28 -21
  356. package/dist/skills/README.md +26 -26
  357. package/dist/skills/ads-designer/README.md +1 -1
  358. package/dist/skills/ads-designer/SKILL.md +311 -550
  359. package/dist/skills/ads-designer/references/accessibility.md +162 -114
  360. package/dist/skills/ads-designer/references/atomic-styles.md +61 -273
  361. package/dist/skills/ads-designer/references/behaviors.md +144 -278
  362. package/dist/skills/ads-designer/references/branding.md +132 -222
  363. package/dist/skills/ads-designer/references/captures.md +13 -7
  364. package/dist/skills/ads-designer/references/cli.md +80 -63
  365. package/dist/skills/ads-designer/references/contracts.md +218 -286
  366. package/dist/skills/ads-designer/references/design-craft.md +1 -1
  367. package/dist/skills/ads-designer/references/design-data.md +299 -323
  368. package/dist/skills/ads-designer/references/drafts.md +83 -22
  369. package/dist/skills/ads-designer/references/evidence.md +2 -1
  370. package/dist/skills/ads-designer/references/forms.md +199 -0
  371. package/dist/skills/ads-designer/references/guarded-editing.md +37 -48
  372. package/dist/skills/ads-designer/references/layers.md +64 -76
  373. package/dist/skills/ads-designer/references/layout.md +185 -330
  374. package/dist/skills/ads-designer/references/mobile.md +2 -2
  375. package/dist/skills/ads-designer/references/motion.md +30 -25
  376. package/dist/skills/ads-designer/references/performance.md +48 -49
  377. package/dist/skills/ads-designer/references/pictograms.md +62 -127
  378. package/dist/skills/ads-designer/references/recipes.md +307 -0
  379. package/dist/skills/ads-designer/references/review.md +51 -95
  380. package/dist/skills/ads-designer/references/runtimes.md +34 -33
  381. package/dist/skills/ads-designer/references/scenarios.md +255 -216
  382. package/dist/skills/ads-designer/references/stress-test.md +13 -5
  383. package/dist/skills/ads-designer/references/validation.md +28 -21
  384. package/dist/skills/ads-designer/references/workflows.md +7 -5
  385. package/dist/skills/ads-import/SKILL.md +29 -29
  386. package/dist/skills/ads-import/references/atomic-styles.md +61 -273
  387. package/dist/skills/ads-import/references/behaviors.md +144 -278
  388. package/dist/skills/ads-import/references/branding.md +24 -41
  389. package/dist/skills/ads-import/references/captures.md +13 -7
  390. package/dist/skills/ads-import/references/cli.md +80 -63
  391. package/dist/skills/ads-import/references/compatibility.md +3 -3
  392. package/dist/skills/ads-import/references/contracts.md +218 -286
  393. package/dist/skills/ads-import/references/design-data.md +299 -323
  394. package/dist/skills/ads-import/references/drafts.md +83 -22
  395. package/dist/skills/ads-import/references/evidence.md +2 -1
  396. package/dist/skills/ads-import/references/forms.md +199 -0
  397. package/dist/skills/ads-import/references/guarded-editing.md +37 -48
  398. package/dist/skills/ads-import/references/implementation.md +20 -20
  399. package/dist/skills/ads-import/references/layers.md +64 -76
  400. package/dist/skills/ads-import/references/layout.md +185 -330
  401. package/dist/skills/ads-import/references/recipes.md +307 -0
  402. package/dist/skills/ads-import/references/review.md +51 -95
  403. package/dist/skills/ads-import/references/runtimes.md +34 -33
  404. package/dist/skills/ads-import/references/scenarios.md +255 -216
  405. package/dist/skills/ads-import/references/tokens.md +26 -17
  406. package/dist/skills/ads-import/references/validation.md +28 -21
  407. package/dist/skills/ads-import/references/workflows.md +7 -5
  408. package/dist/skills/ads-migrate/SKILL.md +20 -5
  409. package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +6 -0
  410. package/dist/skills/ads-migrate/references/0.4.6-to-0.4.7.md +46 -0
  411. package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-boundary.md +71 -0
  412. package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-grid.md +204 -0
  413. package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0.md +727 -0
  414. package/dist/skills/ads-port/SKILL.md +27 -28
  415. package/dist/skills/ads-port/references/atomic-styles.md +61 -273
  416. package/dist/skills/ads-port/references/behaviors.md +144 -278
  417. package/dist/skills/ads-port/references/captures.md +13 -7
  418. package/dist/skills/ads-port/references/cli.md +80 -63
  419. package/dist/skills/ads-port/references/contracts.md +218 -286
  420. package/dist/skills/ads-port/references/design-data.md +299 -323
  421. package/dist/skills/ads-port/references/drafts.md +83 -22
  422. package/dist/skills/ads-port/references/evidence.md +2 -1
  423. package/dist/skills/ads-port/references/forms.md +199 -0
  424. package/dist/skills/ads-port/references/guarded-editing.md +37 -48
  425. package/dist/skills/ads-port/references/layers.md +64 -76
  426. package/dist/skills/ads-port/references/layout.md +185 -330
  427. package/dist/skills/ads-port/references/lint-and-docs.md +2 -3
  428. package/dist/skills/ads-port/references/native-implementation.md +23 -33
  429. package/dist/skills/ads-port/references/recipes.md +307 -0
  430. package/dist/skills/ads-port/references/review.md +51 -95
  431. package/dist/skills/ads-port/references/runtimes.md +34 -33
  432. package/dist/skills/ads-port/references/scenarios.md +255 -216
  433. package/dist/skills/ads-port/references/validation.md +28 -21
  434. package/dist/skills/ads-port/references/workflows.md +7 -5
  435. package/dist/source-inventory.mjs +33 -0
  436. package/dist/source-values.mjs +272 -262
  437. package/dist/spatial-css.mjs +403 -0
  438. package/dist/spatial-metadata.mjs +11 -11
  439. package/dist/spatial-model.mjs +422 -0
  440. package/dist/spatial-reading.mjs +127 -0
  441. package/dist/stage-timing.mjs +27 -0
  442. package/dist/starter-files.mjs +155 -0
  443. package/dist/starter-overlay.mjs +189 -0
  444. package/dist/starters/preact/design-system/assets/avatars/avatar.ads.ts +10 -0
  445. package/dist/starters/preact/design-system/assets/avatars/member.svg +1 -0
  446. package/dist/starters/preact/design-system/assets/brand/emblem.ads.ts +18 -0
  447. package/dist/starters/preact/design-system/assets/brand/emblem.svg +4 -0
  448. package/dist/starters/preact/design-system/assets/brand/iris-emblem.ads.ts +14 -0
  449. package/dist/starters/preact/design-system/assets/brand/iris-emblem.svg +4 -0
  450. package/dist/starters/preact/design-system/assets/brand/mark.ads.ts +14 -0
  451. package/dist/starters/preact/design-system/assets/brand/mark.svg +1 -0
  452. package/dist/starters/preact/design-system/assets/glyphs/arrow.ads.ts +14 -0
  453. package/dist/starters/preact/design-system/assets/glyphs/arrow.svg +1 -0
  454. package/dist/starters/preact/design-system/assets/glyphs/chevron-20.svg +1 -0
  455. package/dist/starters/preact/design-system/assets/glyphs/chevron-24.svg +1 -0
  456. package/dist/starters/preact/design-system/assets/glyphs/chevron.ads.ts +20 -0
  457. package/dist/starters/preact/design-system/assets/glyphs/close.ads.ts +13 -0
  458. package/dist/starters/preact/design-system/assets/glyphs/close.svg +1 -0
  459. package/dist/starters/preact/design-system/assets/glyphs/favorite.ads.ts +23 -0
  460. package/dist/starters/preact/design-system/assets/glyphs/favorite.normal.svg +1 -0
  461. package/dist/starters/preact/design-system/assets/glyphs/favorite.selected.svg +1 -0
  462. package/dist/starters/preact/design-system/assets/glyphs/search.ads.ts +10 -0
  463. package/dist/starters/preact/design-system/assets/glyphs/search.svg +1 -0
  464. package/dist/starters/preact/design-system/assets/illustrations/journey.ads.ts +32 -0
  465. package/dist/starters/preact/design-system/assets/illustrations/journey.contrast.svg +6 -0
  466. package/dist/starters/preact/design-system/assets/illustrations/journey.dark.svg +13 -0
  467. package/dist/starters/preact/design-system/assets/illustrations/journey.light.svg +13 -0
  468. package/dist/starters/preact/design-system/assets/logos/harbor-pay.ads.ts +17 -0
  469. package/dist/starters/preact/design-system/assets/logos/harbor-pay.dark.svg +10 -0
  470. package/dist/starters/preact/design-system/assets/logos/harbor-pay.light.svg +10 -0
  471. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.ads.ts +15 -0
  472. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.dark.svg +9 -0
  473. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.light.svg +9 -0
  474. package/dist/starters/preact/design-system/assets/status/error.svg +1 -0
  475. package/dist/starters/preact/design-system/assets/status/outcomes.ads.ts +31 -0
  476. package/dist/starters/preact/design-system/assets/status/status.ads.ts +16 -0
  477. package/dist/starters/preact/design-system/assets/status/success.svg +1 -0
  478. package/dist/starters/preact/design-system/assets/status/sync-status.ads.ts +14 -0
  479. package/dist/starters/preact/design-system/assets/status/sync-status.svg +7 -0
  480. package/dist/starters/preact/design-system/assets/status/warning.svg +1 -0
  481. package/dist/starters/preact/design-system/components/Actions/Button/Button.ads.scenario.tsx +12 -0
  482. package/dist/starters/preact/design-system/components/Actions/Button/Button.tsx +198 -0
  483. package/dist/starters/preact/design-system/components/Actions/IconButton/IconButton.tsx +95 -0
  484. package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +22 -0
  485. package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.tsx +60 -0
  486. package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +24 -0
  487. package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.tsx +50 -0
  488. package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +8 -0
  489. package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.tsx +110 -0
  490. package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +25 -0
  491. package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.tsx +72 -0
  492. package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +8 -0
  493. package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.tsx +43 -0
  494. package/dist/starters/preact/design-system/components/Content/Icon/Icon.ads.scenario.tsx +21 -0
  495. package/dist/starters/preact/design-system/components/Content/Icon/Icon.tsx +41 -0
  496. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/arrow.tsx +10 -0
  497. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/close.tsx +10 -0
  498. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/search.tsx +10 -0
  499. package/dist/starters/preact/design-system/components/Content/Image/Image.ads.fixture.ts +9 -0
  500. package/dist/starters/preact/design-system/components/Content/Image/Image.ads.scenario.tsx +12 -0
  501. package/dist/starters/preact/design-system/components/Content/Image/Image.tsx +83 -0
  502. package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +27 -0
  503. package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +46 -0
  504. package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +17 -0
  505. package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +41 -0
  506. package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +20 -0
  507. package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.tsx +37 -0
  508. package/dist/starters/preact/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +24 -0
  509. package/dist/starters/preact/design-system/components/Forms/TextField/TextField.tsx +173 -0
  510. package/dist/starters/preact/design-system/components/Identity/Identity.ads.scenario.tsx +13 -0
  511. package/dist/starters/preact/design-system/components/Identity/Identity.tsx +146 -0
  512. package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +27 -0
  513. package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.tsx +194 -0
  514. package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +19 -0
  515. package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.tsx +37 -0
  516. package/dist/starters/preact/design-system/controllers/FormField/FormField.ads.behavior.ts +70 -0
  517. package/dist/starters/preact/design-system/controllers/FormField/FormField.behavior.spec.ts +237 -0
  518. package/dist/starters/preact/design-system/controllers/FormField/FormField.ts +343 -0
  519. package/dist/starters/preact/design-system/controllers/FormField/useFormField.ts +70 -0
  520. package/dist/starters/preact/design-system/controllers/Palette/Palette.ts +165 -0
  521. package/dist/starters/preact/design-system/foundation.ads.ts +22 -0
  522. package/dist/starters/preact/design-system/index.ts +51 -0
  523. package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +5 -0
  524. package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +22 -0
  525. package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.fixture.ts +12 -0
  526. package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +21 -0
  527. package/dist/starters/preact/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +24 -0
  528. package/dist/starters/preact/design-system/mocks/Workspace/Media.ads.scenario.tsx +24 -0
  529. package/dist/starters/preact/design-system/mocks/Workspace/Stress.ads.scenario.tsx +36 -0
  530. package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.fixture.ts +13 -0
  531. package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +27 -0
  532. package/dist/starters/preact/design-system/mocks/Workspace/media/ads.svg +1 -0
  533. package/dist/starters/preact/design-system/palette.generated.ts +188 -0
  534. package/dist/starters/preact/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +73 -0
  535. package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +23 -0
  536. package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +94 -0
  537. package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +21 -0
  538. package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.tsx +137 -0
  539. package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +22 -0
  540. package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.tsx +248 -0
  541. package/dist/starters/preact/design-system/patterns/Shell/Shell.ads.scenario.tsx +26 -0
  542. package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +254 -261
  543. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +28 -0
  544. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.tsx +105 -0
  545. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +179 -0
  546. package/dist/starters/preact/design-system/profiles/Containers/containers.ads.ts +67 -0
  547. package/dist/starters/preact/design-system/profiles/Containers/frames.ads.ts +32 -0
  548. package/dist/starters/preact/design-system/profiles/Containers/geometry.ads.ts +30 -0
  549. package/dist/starters/preact/design-system/profiles/Containers/spacing.ads.ts +26 -0
  550. package/dist/starters/preact/design-system/profiles/Controls/controls.ads.ts +157 -0
  551. package/dist/starters/preact/design-system/profiles/Controls/frames.ads.ts +50 -0
  552. package/dist/starters/preact/design-system/profiles/Controls/spacing.ads.ts +29 -0
  553. package/dist/starters/preact/design-system/profiles/Focus/keyboard.ads.ts +13 -0
  554. package/dist/starters/preact/design-system/profiles/Identity/identity.ads.ts +25 -0
  555. package/dist/starters/preact/design-system/profiles/Identity/spacing.ads.ts +22 -0
  556. package/dist/starters/preact/design-system/profiles/Layout/grid.ads.ts +69 -0
  557. package/dist/starters/preact/design-system/profiles/Layout/inspector.ads.ts +146 -0
  558. package/dist/starters/preact/design-system/profiles/Layout/overlays.ads.ts +94 -0
  559. package/dist/starters/preact/design-system/profiles/Layout/regions.ads.ts +296 -0
  560. package/dist/starters/preact/design-system/profiles/Motion/feedback.ads.ts +92 -0
  561. package/dist/starters/preact/design-system/profiles/Surfaces/controls.ads.ts +142 -0
  562. package/dist/starters/preact/design-system/profiles/Surfaces/document.ads.ts +2 -0
  563. package/dist/starters/preact/design-system/profiles/Surfaces/materials.ads.ts +18 -0
  564. package/dist/starters/preact/design-system/profiles/Surfaces/surfaces.ads.ts +48 -0
  565. package/dist/starters/preact/design-system/profiles/Typography/details.ads.ts +19 -0
  566. package/dist/starters/preact/design-system/profiles/Typography/document.ads.ts +2 -0
  567. package/dist/starters/preact/design-system/profiles/Typography/headings.ads.ts +15 -0
  568. package/dist/starters/preact/design-system/profiles/Typography/text.ads.ts +73 -0
  569. package/dist/starters/preact/design-system/profiles/Visuals/artwork.ads.ts +46 -0
  570. package/dist/starters/preact/design-system/profiles/Visuals/charts.ads.ts +31 -0
  571. package/dist/starters/preact/design-system/profiles/Visuals/content.ads.ts +52 -0
  572. package/dist/starters/preact/design-system/profiles/Visuals/glyphs.ads.ts +35 -0
  573. package/dist/starters/preact/design-system/profiles/Visuals/identity.ads.ts +24 -0
  574. package/dist/starters/preact/design-system/tokens/Artwork/paint.ads.css +7 -0
  575. package/dist/starters/preact/design-system/tokens/Artwork/visual-size.ads.css +12 -0
  576. package/dist/starters/preact/design-system/tokens/Brand/paint.ads.css +7 -0
  577. package/dist/starters/preact/design-system/tokens/Charts/paint.ads.css +19 -0
  578. package/dist/starters/preact/design-system/tokens/Containers/border-width.ads.css +1 -0
  579. package/dist/starters/preact/design-system/tokens/Containers/content-gap.ads.css +5 -0
  580. package/dist/starters/preact/design-system/tokens/Containers/frame-inset.ads.css +6 -0
  581. package/dist/starters/preact/design-system/tokens/Containers/frame-size.ads.css +11 -0
  582. package/dist/starters/preact/design-system/tokens/Containers/radius.ads.css +1 -0
  583. package/dist/starters/preact/design-system/tokens/Controls/border-width.ads.css +4 -0
  584. package/dist/starters/preact/design-system/tokens/Controls/content-gap.ads.css +6 -0
  585. package/dist/starters/preact/design-system/tokens/Controls/control-min-size.ads.css +17 -0
  586. package/dist/starters/preact/design-system/tokens/Controls/frame-inset.ads.css +21 -0
  587. package/dist/starters/preact/design-system/tokens/Controls/radius.ads.css +1 -0
  588. package/dist/starters/preact/design-system/tokens/Controls/target-min-size.ads.css +2 -0
  589. package/dist/starters/preact/design-system/tokens/Controls/visual-size.ads.css +2 -0
  590. package/dist/starters/preact/design-system/tokens/Focus/border-width.ads.css +1 -0
  591. package/dist/starters/preact/design-system/tokens/Focus/focus-offset.ads.css +1 -0
  592. package/dist/starters/preact/design-system/tokens/Foundation/spacing.ads.css +20 -0
  593. package/dist/starters/preact/design-system/tokens/Grid/grid-gutter.ads.css +6 -0
  594. package/dist/starters/preact/design-system/tokens/Grid/layer.ads.css +2 -0
  595. package/dist/starters/preact/design-system/tokens/Grid/layout-size.ads.css +15 -0
  596. package/dist/starters/preact/design-system/tokens/Grid/spacing.ads.css +12 -0
  597. package/dist/starters/preact/design-system/tokens/Grid/track-count.ads.css +1 -0
  598. package/dist/starters/preact/design-system/tokens/Identity/content-gap.ads.css +6 -0
  599. package/dist/starters/preact/design-system/tokens/Identity/visual-size.ads.css +1 -0
  600. package/dist/starters/preact/design-system/tokens/Motion/duration.ads.css +6 -0
  601. package/dist/starters/preact/design-system/tokens/Motion/easing.ads.css +5 -0
  602. package/dist/starters/preact/design-system/tokens/Motion/motion-angle.ads.css +1 -0
  603. package/dist/starters/preact/design-system/tokens/Motion/motion-distance.ads.css +2 -0
  604. package/dist/starters/preact/design-system/tokens/Motion/motion-scale.ads.css +9 -0
  605. package/dist/starters/preact/design-system/tokens/Surfaces/blur.ads.css +2 -0
  606. package/dist/starters/preact/design-system/tokens/Surfaces/gradient.ads.css +2 -0
  607. package/dist/starters/preact/design-system/tokens/Surfaces/opacity.ads.css +2 -0
  608. package/dist/starters/preact/design-system/tokens/Surfaces/paint.ads.css +58 -0
  609. package/dist/starters/preact/design-system/tokens/Surfaces/shadow.ads.css +20 -0
  610. package/dist/starters/preact/design-system/tokens/Typography/font-family.ads.css +1 -0
  611. package/dist/starters/preact/design-system/tokens/Typography/font-features.ads.css +1 -0
  612. package/dist/starters/preact/design-system/tokens/Typography/font-size.ads.css +9 -0
  613. package/dist/starters/preact/design-system/tokens/Typography/font-stretch.ads.css +1 -0
  614. package/dist/starters/preact/design-system/tokens/Typography/font-variations.ads.css +1 -0
  615. package/dist/starters/preact/design-system/tokens/Typography/font-weight.ads.css +1 -0
  616. package/dist/starters/preact/design-system/tokens/Typography/letter-spacing.ads.css +1 -0
  617. package/dist/starters/preact/design-system/tokens/Typography/line-height.ads.css +11 -0
  618. package/dist/starters/preact/design-system/tokens/Typography/word-spacing.ads.css +1 -0
  619. package/dist/starters/preact/starter.json +11 -0
  620. package/dist/starters/react/design-system/assets/avatars/avatar.ads.ts +10 -0
  621. package/dist/starters/react/design-system/assets/avatars/member.svg +1 -0
  622. package/dist/starters/react/design-system/assets/brand/emblem.ads.ts +18 -0
  623. package/dist/starters/react/design-system/assets/brand/emblem.svg +4 -0
  624. package/dist/starters/react/design-system/assets/brand/iris-emblem.ads.ts +14 -0
  625. package/dist/starters/react/design-system/assets/brand/iris-emblem.svg +4 -0
  626. package/dist/starters/react/design-system/assets/brand/mark.ads.ts +14 -0
  627. package/dist/starters/react/design-system/assets/brand/mark.svg +1 -0
  628. package/dist/starters/react/design-system/assets/glyphs/arrow.ads.ts +14 -0
  629. package/dist/starters/react/design-system/assets/glyphs/arrow.svg +1 -0
  630. package/dist/starters/react/design-system/assets/glyphs/chevron-20.svg +1 -0
  631. package/dist/starters/react/design-system/assets/glyphs/chevron-24.svg +1 -0
  632. package/dist/starters/react/design-system/assets/glyphs/chevron.ads.ts +20 -0
  633. package/dist/starters/react/design-system/assets/glyphs/close.ads.ts +13 -0
  634. package/dist/starters/react/design-system/assets/glyphs/close.svg +1 -1
  635. package/dist/starters/react/design-system/assets/glyphs/favorite.ads.ts +23 -0
  636. package/dist/starters/react/design-system/assets/glyphs/favorite.normal.svg +1 -0
  637. package/dist/starters/react/design-system/assets/glyphs/favorite.selected.svg +1 -0
  638. package/dist/starters/react/design-system/assets/glyphs/search.ads.ts +10 -0
  639. package/dist/starters/react/design-system/assets/glyphs/search.svg +1 -1
  640. package/dist/starters/react/design-system/assets/illustrations/journey.ads.ts +32 -0
  641. package/dist/starters/react/design-system/assets/illustrations/journey.contrast.svg +6 -0
  642. package/dist/starters/react/design-system/assets/illustrations/journey.dark.svg +13 -0
  643. package/dist/starters/react/design-system/assets/illustrations/journey.light.svg +13 -0
  644. package/dist/starters/react/design-system/assets/logos/harbor-pay.ads.ts +17 -0
  645. package/dist/starters/react/design-system/assets/logos/harbor-pay.dark.svg +10 -0
  646. package/dist/starters/react/design-system/assets/logos/harbor-pay.light.svg +10 -0
  647. package/dist/starters/react/design-system/assets/logos/lumen-cloud.ads.ts +15 -0
  648. package/dist/starters/react/design-system/assets/logos/lumen-cloud.dark.svg +9 -0
  649. package/dist/starters/react/design-system/assets/logos/lumen-cloud.light.svg +9 -0
  650. package/dist/starters/react/design-system/assets/status/error.svg +1 -0
  651. package/dist/starters/react/design-system/assets/status/outcomes.ads.ts +31 -0
  652. package/dist/starters/react/design-system/assets/status/status.ads.ts +16 -0
  653. package/dist/starters/react/design-system/assets/status/success.svg +1 -0
  654. package/dist/starters/react/design-system/assets/status/sync-status.ads.ts +14 -0
  655. package/dist/starters/react/design-system/assets/status/sync-status.svg +7 -0
  656. package/dist/starters/react/design-system/assets/status/warning.svg +1 -0
  657. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.scenario.tsx +11 -12
  658. package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +187 -45
  659. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +83 -48
  660. package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +22 -0
  661. package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.tsx +60 -0
  662. package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +24 -0
  663. package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.tsx +50 -0
  664. package/dist/starters/react/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +8 -0
  665. package/dist/starters/react/design-system/components/Content/Artwork/Artwork.tsx +110 -0
  666. package/dist/starters/react/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +25 -0
  667. package/dist/starters/react/design-system/components/Content/BarChart/BarChart.tsx +72 -0
  668. package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +8 -0
  669. package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.tsx +43 -0
  670. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +21 -16
  671. package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +32 -33
  672. package/dist/starters/react/design-system/components/Content/Icon/glyphs/arrow.tsx +10 -0
  673. package/dist/starters/react/design-system/components/Content/Icon/glyphs/close.tsx +10 -0
  674. package/dist/starters/react/design-system/components/Content/Icon/glyphs/search.tsx +10 -0
  675. package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +9 -2
  676. package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +10 -11
  677. package/dist/starters/react/design-system/components/Content/Image/Image.tsx +74 -42
  678. package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +27 -0
  679. package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +46 -0
  680. package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +17 -0
  681. package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +41 -0
  682. package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +20 -0
  683. package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.tsx +37 -0
  684. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +23 -12
  685. package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +161 -49
  686. package/dist/starters/react/design-system/components/Identity/Identity.ads.scenario.tsx +13 -0
  687. package/dist/starters/react/design-system/components/Identity/Identity.tsx +146 -0
  688. package/dist/starters/react/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +27 -0
  689. package/dist/starters/react/design-system/components/Overlays/Menu/Menu.tsx +194 -0
  690. package/dist/starters/react/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +19 -0
  691. package/dist/starters/react/design-system/components/Overlays/Popover/Popover.tsx +37 -0
  692. package/dist/starters/react/design-system/controllers/FormField/FormField.ads.behavior.ts +70 -0
  693. package/dist/starters/react/design-system/controllers/FormField/FormField.behavior.spec.ts +237 -0
  694. package/dist/starters/react/design-system/controllers/FormField/FormField.ts +343 -0
  695. package/dist/starters/react/design-system/controllers/FormField/useFormField.ts +70 -0
  696. package/dist/starters/react/design-system/controllers/Palette/Palette.ts +5 -4
  697. package/dist/starters/react/design-system/foundation.ads.ts +22 -0
  698. package/dist/starters/react/design-system/index.ts +51 -12
  699. package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +5 -0
  700. package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +22 -0
  701. package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.fixture.ts +12 -0
  702. package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +21 -0
  703. package/dist/starters/react/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +24 -0
  704. package/dist/starters/react/design-system/mocks/Workspace/Media.ads.scenario.tsx +24 -0
  705. package/dist/starters/react/design-system/mocks/Workspace/Stress.ads.scenario.tsx +36 -0
  706. package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.fixture.ts +13 -0
  707. package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +27 -0
  708. package/dist/starters/react/design-system/mocks/Workspace/media/ads.svg +1 -0
  709. package/dist/starters/react/design-system/palette.generated.ts +188 -0
  710. package/dist/starters/react/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +73 -0
  711. package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +23 -0
  712. package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +94 -0
  713. package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +21 -0
  714. package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.tsx +137 -0
  715. package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +22 -0
  716. package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.tsx +248 -0
  717. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +26 -21
  718. package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +255 -261
  719. package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +28 -0
  720. package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.tsx +105 -0
  721. package/dist/starters/react/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +179 -0
  722. package/dist/starters/react/design-system/profiles/Containers/containers.ads.ts +67 -0
  723. package/dist/starters/react/design-system/profiles/Containers/frames.ads.ts +32 -0
  724. package/dist/starters/react/design-system/profiles/Containers/geometry.ads.ts +30 -0
  725. package/dist/starters/react/design-system/profiles/Containers/spacing.ads.ts +26 -0
  726. package/dist/starters/react/design-system/profiles/Controls/controls.ads.ts +157 -0
  727. package/dist/starters/react/design-system/profiles/Controls/frames.ads.ts +50 -0
  728. package/dist/starters/react/design-system/profiles/Controls/spacing.ads.ts +29 -0
  729. package/dist/starters/react/design-system/profiles/Focus/keyboard.ads.ts +13 -0
  730. package/dist/starters/react/design-system/profiles/Identity/identity.ads.ts +25 -0
  731. package/dist/starters/react/design-system/profiles/Identity/spacing.ads.ts +22 -0
  732. package/dist/starters/react/design-system/profiles/Layout/grid.ads.ts +69 -0
  733. package/dist/starters/react/design-system/profiles/Layout/inspector.ads.ts +146 -0
  734. package/dist/starters/react/design-system/profiles/Layout/overlays.ads.ts +94 -0
  735. package/dist/starters/react/design-system/profiles/Layout/regions.ads.ts +296 -0
  736. package/dist/starters/react/design-system/profiles/Motion/feedback.ads.ts +92 -0
  737. package/dist/starters/react/design-system/profiles/Surfaces/controls.ads.ts +142 -0
  738. package/dist/starters/react/design-system/profiles/Surfaces/document.ads.ts +2 -0
  739. package/dist/starters/react/design-system/profiles/Surfaces/materials.ads.ts +18 -0
  740. package/dist/starters/react/design-system/profiles/Surfaces/surfaces.ads.ts +48 -0
  741. package/dist/starters/react/design-system/profiles/Typography/details.ads.ts +19 -0
  742. package/dist/starters/react/design-system/profiles/Typography/document.ads.ts +2 -0
  743. package/dist/starters/react/design-system/profiles/Typography/headings.ads.ts +15 -0
  744. package/dist/starters/react/design-system/profiles/Typography/text.ads.ts +73 -0
  745. package/dist/starters/react/design-system/profiles/Visuals/artwork.ads.ts +46 -0
  746. package/dist/starters/react/design-system/profiles/Visuals/charts.ads.ts +31 -0
  747. package/dist/starters/react/design-system/profiles/Visuals/content.ads.ts +52 -0
  748. package/dist/starters/react/design-system/profiles/Visuals/glyphs.ads.ts +35 -0
  749. package/dist/starters/react/design-system/profiles/Visuals/identity.ads.ts +24 -0
  750. package/dist/starters/react/design-system/tokens/Artwork/paint.ads.css +7 -0
  751. package/dist/starters/react/design-system/tokens/Artwork/visual-size.ads.css +12 -0
  752. package/dist/starters/react/design-system/tokens/Brand/paint.ads.css +7 -0
  753. package/dist/starters/react/design-system/tokens/Charts/paint.ads.css +19 -0
  754. package/dist/starters/react/design-system/tokens/Containers/border-width.ads.css +1 -0
  755. package/dist/starters/react/design-system/tokens/Containers/content-gap.ads.css +5 -0
  756. package/dist/starters/react/design-system/tokens/Containers/frame-inset.ads.css +6 -0
  757. package/dist/starters/react/design-system/tokens/Containers/frame-size.ads.css +11 -0
  758. package/dist/starters/react/design-system/tokens/Containers/radius.ads.css +1 -0
  759. package/dist/starters/react/design-system/tokens/Controls/border-width.ads.css +4 -0
  760. package/dist/starters/react/design-system/tokens/Controls/content-gap.ads.css +6 -0
  761. package/dist/starters/react/design-system/tokens/Controls/control-min-size.ads.css +17 -0
  762. package/dist/starters/react/design-system/tokens/Controls/frame-inset.ads.css +21 -0
  763. package/dist/starters/react/design-system/tokens/Controls/radius.ads.css +1 -0
  764. package/dist/starters/react/design-system/tokens/Controls/target-min-size.ads.css +2 -0
  765. package/dist/starters/react/design-system/tokens/Controls/visual-size.ads.css +2 -0
  766. package/dist/starters/react/design-system/tokens/Focus/border-width.ads.css +1 -0
  767. package/dist/starters/react/design-system/tokens/Focus/focus-offset.ads.css +1 -0
  768. package/dist/starters/react/design-system/tokens/Foundation/spacing.ads.css +20 -0
  769. package/dist/starters/react/design-system/tokens/Grid/grid-gutter.ads.css +6 -0
  770. package/dist/starters/react/design-system/tokens/Grid/layer.ads.css +2 -0
  771. package/dist/starters/react/design-system/tokens/Grid/layout-size.ads.css +15 -0
  772. package/dist/starters/react/design-system/tokens/Grid/spacing.ads.css +12 -0
  773. package/dist/starters/react/design-system/tokens/Grid/track-count.ads.css +1 -0
  774. package/dist/starters/react/design-system/tokens/Identity/content-gap.ads.css +6 -0
  775. package/dist/starters/react/design-system/tokens/Identity/visual-size.ads.css +1 -0
  776. package/dist/starters/react/design-system/tokens/Motion/duration.ads.css +6 -0
  777. package/dist/starters/react/design-system/tokens/Motion/easing.ads.css +5 -0
  778. package/dist/starters/react/design-system/tokens/Motion/motion-angle.ads.css +1 -0
  779. package/dist/starters/react/design-system/tokens/Motion/motion-distance.ads.css +2 -0
  780. package/dist/starters/react/design-system/tokens/Motion/motion-scale.ads.css +9 -0
  781. package/dist/starters/react/design-system/tokens/Surfaces/blur.ads.css +2 -0
  782. package/dist/starters/react/design-system/tokens/Surfaces/gradient.ads.css +2 -0
  783. package/dist/starters/react/design-system/tokens/Surfaces/opacity.ads.css +2 -0
  784. package/dist/starters/react/design-system/tokens/Surfaces/paint.ads.css +58 -0
  785. package/dist/starters/react/design-system/tokens/Surfaces/shadow.ads.css +20 -0
  786. package/dist/starters/react/design-system/tokens/Typography/font-family.ads.css +1 -0
  787. package/dist/starters/react/design-system/tokens/Typography/font-features.ads.css +1 -0
  788. package/dist/starters/react/design-system/tokens/Typography/font-size.ads.css +9 -0
  789. package/dist/starters/react/design-system/tokens/Typography/font-stretch.ads.css +1 -0
  790. package/dist/starters/react/design-system/tokens/Typography/font-variations.ads.css +1 -0
  791. package/dist/starters/react/design-system/tokens/Typography/font-weight.ads.css +1 -0
  792. package/dist/starters/react/design-system/tokens/Typography/letter-spacing.ads.css +1 -0
  793. package/dist/starters/react/design-system/tokens/Typography/line-height.ads.css +11 -0
  794. package/dist/starters/react/design-system/tokens/Typography/word-spacing.ads.css +1 -0
  795. package/dist/starters/react/starter.json +11 -0
  796. package/dist/state-conditions.d.mts +51 -0
  797. package/dist/state-conditions.mjs +67 -0
  798. package/dist/static-values.mjs +94 -0
  799. package/dist/surface-contrast.mjs +194 -0
  800. package/dist/target-size.mjs +177 -0
  801. package/dist/task-cache.mjs +142 -136
  802. package/dist/task-worker.mjs +18 -18
  803. package/dist/test-boundaries.mjs +50 -189
  804. package/dist/token-checks.mjs +21 -0
  805. package/dist/token-dtcg.mjs +135 -0
  806. package/dist/token-expression.mjs +19 -0
  807. package/dist/token-inventory.mjs +146 -0
  808. package/dist/token-operations.mjs +37 -0
  809. package/dist/token-overlap.mjs +29 -0
  810. package/dist/token-provenance.mjs +260 -0
  811. package/dist/token-references.mjs +71 -0
  812. package/dist/token-registrations.mjs +116 -0
  813. package/dist/token-resolution.mjs +38 -0
  814. package/dist/token-sections.mjs +123 -0
  815. package/dist/token-shapes.mjs +121 -0
  816. package/dist/token-sheet-check.mjs +54 -0
  817. package/dist/token-type-check.mjs +89 -0
  818. package/dist/token-view-facts.mjs +62 -0
  819. package/dist/tsconfig.declarations.json +24 -0
  820. package/dist/types/css-tree.d.ts +45 -0
  821. package/dist/ui-framework.mjs +34 -34
  822. package/dist/units.mjs +186 -226
  823. package/dist/unknown.d.mts +9 -0
  824. package/dist/unknown.mjs +13 -0
  825. package/dist/validation-checks.mjs +62 -71
  826. package/dist/validation-inputs.mjs +287 -184
  827. package/dist/validation.mjs +132 -159
  828. package/dist/verification/browser.d.mts +21 -25
  829. package/dist/verification/browser.mjs +281 -124
  830. package/dist/verification/browser.page.d.mts +22 -0
  831. package/dist/verification/browser.page.mjs +19 -0
  832. package/dist/verification/paint-audit.page.d.mts +55 -0
  833. package/dist/verification/paint-audit.page.mjs +144 -0
  834. package/dist/verification/playwright-reporter.mjs +160 -0
  835. package/dist/verification/preview-startup.d.mts +51 -0
  836. package/dist/verification/preview-startup.mjs +76 -0
  837. package/dist/verification/request.d.mts +28 -0
  838. package/dist/verification/request.mjs +30 -0
  839. package/dist/verification/unit-preload.mjs +37 -0
  840. package/dist/verification.mjs +574 -607
  841. package/docs/ADS.md +562 -565
  842. package/docs/ARCHITECTURE.md +1857 -1345
  843. package/docs/ASSETS.md +416 -0
  844. package/docs/BEHAVIORS.md +339 -370
  845. package/docs/CACHING.md +365 -154
  846. package/docs/CHANGELOG.md +171 -21
  847. package/docs/COMPARISON.md +21 -26
  848. package/docs/DESIGN-REFERENCES.md +39 -26
  849. package/docs/GUIDE.md +2306 -1288
  850. package/docs/LANGUAGE.md +893 -0
  851. package/docs/LOWERING.md +168 -0
  852. package/docs/MCP.md +1461 -1179
  853. package/docs/MOTION.md +265 -0
  854. package/docs/PROFILE-KINDS.md +390 -0
  855. package/docs/PROFILES.md +176 -0
  856. package/docs/RULES.md +559 -0
  857. package/docs/STARTER.md +167 -0
  858. package/docs/TOKEN-ROLES.md +375 -0
  859. package/docs/benchmarks/README.md +26 -27
  860. package/package.json +59 -45
  861. package/dist/a11y.mjs +0 -187
  862. package/dist/assets.mjs +0 -159
  863. package/dist/atomic-composition.mjs +0 -337
  864. package/dist/atomic-trace.mjs +0 -162
  865. package/dist/behavior-libraries.mjs +0 -162
  866. package/dist/behaviors.mjs +0 -306
  867. package/dist/brand-assets.mjs +0 -458
  868. package/dist/brands.mjs +0 -141
  869. package/dist/component-contrast.mjs +0 -256
  870. package/dist/construction-styles.cjs +0 -10
  871. package/dist/contracts/foundation.json +0 -211
  872. package/dist/contracts/tokens.json +0 -52
  873. package/dist/contracts.d.mts +0 -30
  874. package/dist/contrast-composition.mjs +0 -80
  875. package/dist/contrast-styles.mjs +0 -88
  876. package/dist/control-padding.mjs +0 -113
  877. package/dist/css-values.mjs +0 -27
  878. package/dist/declarative-flow.mjs +0 -244
  879. package/dist/design-values.mjs +0 -173
  880. package/dist/font-rules.mjs +0 -108
  881. package/dist/fonts-generated.mjs +0 -112
  882. package/dist/foundation-views.mjs +0 -242
  883. package/dist/foundation.mjs +0 -154
  884. package/dist/generated-entries.mjs +0 -198
  885. package/dist/html.mjs +0 -30
  886. package/dist/icons.mjs +0 -154
  887. package/dist/image-attributes.mjs +0 -187
  888. package/dist/image-size.mjs +0 -28
  889. package/dist/layers.mjs +0 -461
  890. package/dist/layout-widths.mjs +0 -332
  891. package/dist/linaria/atomic-css.cjs +0 -2
  892. package/dist/linaria/atomic-styled.cjs +0 -2
  893. package/dist/linaria/preserve-values.cjs +0 -58
  894. package/dist/linaria/spatial-inputs.cjs +0 -56
  895. package/dist/linaria.d.mts +0 -1
  896. package/dist/linaria.mjs +0 -9
  897. package/dist/lockup-composition.mjs +0 -44
  898. package/dist/lockup-model.cjs +0 -64
  899. package/dist/paint-contracts.mjs +0 -216
  900. package/dist/pictograms.mjs +0 -52
  901. package/dist/public-api.mjs +0 -121
  902. package/dist/public-props.mjs +0 -91
  903. package/dist/render-audit/axe-run.mjs +0 -17
  904. package/dist/render-audit/first-render.mjs +0 -40
  905. package/dist/render-audit/image-shape.mjs +0 -46
  906. package/dist/render-audit/layout-overflow.mjs +0 -167
  907. package/dist/render-audit/layout-shift.mjs +0 -32
  908. package/dist/render-audit/non-text-contrast.mjs +0 -151
  909. package/dist/render-audit/pictograms.mjs +0 -88
  910. package/dist/render-color-probe.mjs +0 -202
  911. package/dist/render-composition.mjs +0 -186
  912. package/dist/runtime-contracts.mjs +0 -506
  913. package/dist/scenario-program.mjs +0 -19
  914. package/dist/scenario-selectors.mjs +0 -237
  915. package/dist/scenario-slots.mjs +0 -217
  916. package/dist/scenario-trace.mjs +0 -314
  917. package/dist/scenarios-vite.d.mts +0 -2
  918. package/dist/scenarios-vite.mjs +0 -2
  919. package/dist/scenarios.mjs +0 -616
  920. package/dist/selector-match.mjs +0 -94
  921. package/dist/showcase/comparison.js +0 -48
  922. package/dist/showcase/connection.js +0 -10
  923. package/dist/showcase/draft-navigation.js +0 -59
  924. package/dist/showcase/foundation-view.css +0 -58
  925. package/dist/showcase/foundation-view.mjs +0 -255
  926. package/dist/showcase/guide-controls.ads.review.mjs +0 -32
  927. package/dist/showcase/http-connection.js +0 -86
  928. package/dist/showcase/http-preview.js +0 -81
  929. package/dist/showcase/icons.js +0 -2
  930. package/dist/showcase/navigation.js +0 -13
  931. package/dist/showcase/pictogram-view.mjs +0 -53
  932. package/dist/showcase/preview-frame.ads.review.css +0 -46
  933. package/dist/showcase/preview-frame.ads.review.d.mts +0 -11
  934. package/dist/showcase/preview-frame.ads.review.mjs +0 -22
  935. package/dist/showcase/preview-state.js +0 -11
  936. package/dist/showcase/refresh-scheduler.js +0 -23
  937. package/dist/showcase/resource-reader.js +0 -37
  938. package/dist/showcase-coverage.mjs +0 -139
  939. package/dist/source-symbols.mjs +0 -4
  940. package/dist/spatial-composition.mjs +0 -322
  941. package/dist/spatial-contexts.cjs +0 -56
  942. package/dist/spatial-css.cjs +0 -351
  943. package/dist/spatial-inputs.cjs +0 -80
  944. package/dist/spatial-model.cjs +0 -322
  945. package/dist/spatial.mjs +0 -21
  946. package/dist/stage-timing.cjs +0 -21
  947. package/dist/starters/preact/design-system/patterns/Conversation/Conversation.tsx +0 -105
  948. package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
  949. package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
  950. package/dist/starters/preact/design-system/showcase/mcp/main.ads.mount.tsx +0 -8
  951. package/dist/starters/preact/ds.config.json +0 -37
  952. package/dist/starters/preact/package.json +0 -35
  953. package/dist/starters/preact/src/vite-env.d.ts +0 -7
  954. package/dist/starters/preact/tsconfig.json +0 -35
  955. package/dist/starters/preact/vite.config.ts +0 -23
  956. package/dist/starters/react/ADS.md +0 -286
  957. package/dist/starters/react/README.md +0 -184
  958. package/dist/starters/react/biome.css.json +0 -21
  959. package/dist/starters/react/design-system/assets/brand/README.md +0 -41
  960. package/dist/starters/react/design-system/assets/brand/app-icon.svg +0 -4
  961. package/dist/starters/react/design-system/assets/brand/logo.dark.svg +0 -6
  962. package/dist/starters/react/design-system/assets/brand/logo.svg +0 -6
  963. package/dist/starters/react/design-system/assets/glyphs/README.md +0 -15
  964. package/dist/starters/react/design-system/assets/glyphs/aliases.json +0 -1
  965. package/dist/starters/react/design-system/assets/glyphs/check.svg +0 -1
  966. package/dist/starters/react/design-system/assets/glyphs/chevron-down.svg +0 -1
  967. package/dist/starters/react/design-system/assets/glyphs/chevron-right.svg +0 -1
  968. package/dist/starters/react/design-system/assets/glyphs/external-link.svg +0 -1
  969. package/dist/starters/react/design-system/assets/glyphs/info.svg +0 -1
  970. package/dist/starters/react/design-system/assets/glyphs/menu.svg +0 -1
  971. package/dist/starters/react/design-system/assets/glyphs/plus.svg +0 -1
  972. package/dist/starters/react/design-system/assets/glyphs/warning.svg +0 -1
  973. package/dist/starters/react/design-system/assets/pictograms/catalog.ads.json +0 -13
  974. package/dist/starters/react/design-system/assets/pictograms/journey.dark.svg +0 -7
  975. package/dist/starters/react/design-system/assets/pictograms/journey.svg +0 -7
  976. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +0 -1
  977. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -1
  978. package/dist/starters/react/design-system/components/Actions/Button/README.md +0 -12
  979. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +0 -1
  980. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.fixture.ts +0 -9
  981. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.scenario.tsx +0 -16
  982. package/dist/starters/react/design-system/components/Actions/IconButton/README.md +0 -17
  983. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +0 -1
  984. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.fixture.ts +0 -6
  985. package/dist/starters/react/design-system/components/Content/Icon/README.md +0 -17
  986. package/dist/starters/react/design-system/components/Content/Icon/glyphs.ts +0 -17
  987. package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +0 -1
  988. package/dist/starters/react/design-system/components/Content/Image/README.md +0 -20
  989. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +0 -1
  990. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.fixture.ts +0 -1
  991. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.scenario.tsx +0 -12
  992. package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +0 -35
  993. package/dist/starters/react/design-system/components/Content/Logo/README.md +0 -12
  994. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.exports.ts +0 -1
  995. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.fixture.ts +0 -1
  996. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.scenario.tsx +0 -7
  997. package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.tsx +0 -26
  998. package/dist/starters/react/design-system/components/Forms/TextField/README.md +0 -14
  999. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +0 -1
  1000. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -6
  1001. package/dist/starters/react/design-system/composition/Search/SearchPage/README.md +0 -4
  1002. package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -7
  1003. package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -16
  1004. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/README.md +0 -5
  1005. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.fixture.ts +0 -13
  1006. package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.scenario.tsx +0 -22
  1007. package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +0 -1
  1008. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.exports.ts +0 -1
  1009. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.fixture.ts +0 -7
  1010. package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.scenario.tsx +0 -15
  1011. package/dist/starters/react/design-system/patterns/Conversation/Conversation.tsx +0 -105
  1012. package/dist/starters/react/design-system/patterns/Conversation/README.md +0 -9
  1013. package/dist/starters/react/design-system/patterns/Search/SearchBar/README.md +0 -12
  1014. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +0 -1
  1015. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -1
  1016. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -11
  1017. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -41
  1018. package/dist/starters/react/design-system/patterns/Shell/Floating.ads.fixture.ts +0 -5
  1019. package/dist/starters/react/design-system/patterns/Shell/Floating.ads.scenario.tsx +0 -21
  1020. package/dist/starters/react/design-system/patterns/Shell/README.md +0 -43
  1021. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.exports.ts +0 -1
  1022. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.fixture.ts +0 -5
  1023. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +0 -1
  1024. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
  1025. package/dist/starters/react/design-system/review/index.ads.review.ts +0 -4
  1026. package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.exports.ts +0 -1
  1027. package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.review.tsx +0 -6
  1028. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +0 -1
  1029. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
  1030. package/dist/starters/react/design-system/showcase/mcp/main.ads.mount.tsx +0 -10
  1031. package/dist/starters/react/design-system/styles.css +0 -7
  1032. package/dist/starters/react/design-system/tokens/base.css +0 -36
  1033. package/dist/starters/react/design-system/tokens/catalog.ads.json +0 -1221
  1034. package/dist/starters/react/design-system/tokens/colors.css +0 -215
  1035. package/dist/starters/react/design-system/tokens/elevation.css +0 -53
  1036. package/dist/starters/react/design-system/tokens/spacing.css +0 -87
  1037. package/dist/starters/react/design-system/tokens/spatial.ads.json +0 -70
  1038. package/dist/starters/react/design-system/tokens/themes.generated.css +0 -142
  1039. package/dist/starters/react/design-system/tokens/themes.generated.ts +0 -402
  1040. package/dist/starters/react/design-system/tokens/typography.css +0 -31
  1041. package/dist/starters/react/ds.config.json +0 -37
  1042. package/dist/starters/react/gitignore.template +0 -8
  1043. package/dist/starters/react/package.json +0 -39
  1044. package/dist/starters/react/scripts/build-mcp-previews.mjs +0 -3
  1045. package/dist/starters/react/src/vite-env.d.ts +0 -7
  1046. package/dist/starters/react/tsconfig.build.json +0 -20
  1047. package/dist/starters/react/tsconfig.json +0 -34
  1048. package/dist/starters/react/vite.config.ts +0 -23
  1049. package/dist/style-boundaries.mjs +0 -106
  1050. package/dist/style-token-rules.mjs +0 -51
  1051. package/dist/themes-generated.mjs +0 -161
  1052. package/dist/themes-watch.mjs +0 -83
  1053. package/dist/themes.mjs +0 -360
  1054. package/dist/token-export.mjs +0 -94
  1055. package/dist/token-origins.mjs +0 -24
  1056. package/dist/token-policy.mjs +0 -26
  1057. package/dist/token-quality.mjs +0 -149
  1058. package/dist/token-samples.mjs +0 -19
  1059. package/dist/tokens.mjs +0 -194
  1060. package/dist/unit-contracts.mjs +0 -396
  1061. package/dist/usage.mjs +0 -184
  1062. package/dist/verification/playwright-reporter.cjs +0 -87
  1063. package/docs/CONTRACTS.md +0 -285
  1064. package/docs/HTTP-SHOWCASE-POC.md +0 -397
  1065. package/docs/SPATIAL-CHECKS.md +0 -69
  1066. package/docs/benchmarks/http-showcase-optimized.json +0 -1879
  1067. package/docs/benchmarks/http-showcase-profile.json +0 -308
  1068. package/docs/benchmarks/http-showcase.json +0 -3069
  1069. /package/dist/{starters/react/design-system/assets/fonts/.gitkeep → analysis/semantic.mjs} +0 -0
  1070. /package/dist/{starters/react/design-system/controllers/.gitkeep → lowering-model.mjs} +0 -0
  1071. /package/dist/showcase/{favicon.svg → ui/favicon-scavmehf.svg} +0 -0
@@ -0,0 +1,3421 @@
1
+ export const plannedGuides = [], errorGroups = {
2
+ syntax: {
3
+ order: 1,
4
+ certainty: "violated",
5
+ actionability: "author",
6
+ summary: "The source does not parse or type-check.",
7
+ strategy: "Fix these first and accept again: analysis needs a valid program, and later errors may be consequences."
8
+ },
9
+ "unresolved-reference": {
10
+ order: 2,
11
+ certainty: "violated",
12
+ actionability: "author",
13
+ summary: "The source names something that does not exist in this revision.",
14
+ strategy: "Correct the name from the existing candidates. Declare a new one only when it is genuinely new design."
15
+ },
16
+ boundary: {
17
+ order: 3,
18
+ certainty: "violated",
19
+ actionability: "author",
20
+ summary: "Code reaches across an ownership or production/development boundary.",
21
+ strategy: "Move the code to its owner or pass the value through public props. Do not add an exception or widen the boundary."
22
+ },
23
+ "design-bypass": {
24
+ order: 4,
25
+ certainty: "violated",
26
+ actionability: "author",
27
+ summary: "Styling or design values are supplied outside the design language.",
28
+ strategy: "Take the value from a profile, token or recipe instead of writing it in place."
29
+ },
30
+ "structure-mismatch": {
31
+ order: 5,
32
+ certainty: "violated",
33
+ actionability: "author",
34
+ summary: "Rendered markup does not match what its declaration promises.",
35
+ strategy: "Make the markup match the declaration: each declared part, cell and binding exactly once, in the declared order. Change the declaration only if it is wrong."
36
+ },
37
+ "accessibility-semantics": {
38
+ order: 6,
39
+ certainty: "violated",
40
+ actionability: "author",
41
+ summary: "Owned markup or motion lacks required accessible semantics: a text alternative, an accessible name, keyboard access or reduced motion.",
42
+ strategy: "Add the missing semantics in the owning component (alt, aria-label, a native control, a reduced-motion value); do not suppress the check."
43
+ },
44
+ "project-files": {
45
+ order: 7,
46
+ certainty: "violated",
47
+ actionability: "author",
48
+ summary: "A required project file or declaration is missing, empty, undocumented or unused.",
49
+ strategy: "Add or complete the file the rule names (README, license, theme or brand values), or remove what nothing uses."
50
+ },
51
+ "wrong-value": {
52
+ order: 8,
53
+ certainty: "violated",
54
+ actionability: "author",
55
+ summary: "A value has the wrong kind, role or range for where it is used.",
56
+ strategy: "Choose one of the allowed values the error lists."
57
+ },
58
+ conflict: {
59
+ order: 9,
60
+ certainty: "violated",
61
+ actionability: "author",
62
+ summary: "Two definitions claim the same thing, or a definition depends on itself.",
63
+ strategy: "Keep exactly one source of truth and remove or derive the other."
64
+ },
65
+ unanalyzable: {
66
+ order: 10,
67
+ certainty: "unprovable",
68
+ actionability: "author",
69
+ summary: "ADS cannot prove the rule holds; the design itself may be fine.",
70
+ strategy: "Rewrite into a form ADS can follow (literal unions, const records, typed props, JSX) without changing rendered behavior."
71
+ },
72
+ unsupported: {
73
+ order: 11,
74
+ certainty: "unprovable",
75
+ actionability: "author",
76
+ summary: "The construct is valid design that ADS does not support yet.",
77
+ strategy: "Use a supported alternative. If none fits, report the gap rather than working around the checks."
78
+ },
79
+ "rendered-check": {
80
+ order: 12,
81
+ certainty: "violated",
82
+ actionability: "author",
83
+ summary: "The rendered result breaks an accessibility, layout, contrast or performance requirement.",
84
+ strategy: "Inspect the failing scenario in its audit result or capture, then fix the owning style or markup; do not change the scenario to hide it."
85
+ },
86
+ "behavior-failed": {
87
+ order: 13,
88
+ certainty: "violated",
89
+ actionability: "author",
90
+ summary: "A registered behavior guarantee failed or could not run.",
91
+ strategy: "Read the failing run with ads_results and ads_investigate, then fix the owner's behavior; keep the guarantee unless it is wrong."
92
+ },
93
+ "evidence-missing": {
94
+ order: 14,
95
+ certainty: "unprovable",
96
+ actionability: "rerun",
97
+ summary: "Required evidence is absent or belongs to another revision.",
98
+ strategy: "Run the named check (ads_validate, ads_accept dryRun or the preview build) for the current revision; do not edit source to satisfy it."
99
+ },
100
+ "run-interrupted": {
101
+ order: 15,
102
+ certainty: "unprovable",
103
+ actionability: "rerun",
104
+ summary: "The run did not complete: it was cancelled, busy, or its inputs changed while it ran.",
105
+ strategy: "Wait for the other run or the edits to finish, then run again with the current revision."
106
+ },
107
+ "after-apply": {
108
+ order: 16,
109
+ certainty: "violated",
110
+ actionability: "rerun",
111
+ summary: "Source was published, but a follow-up step after it failed.",
112
+ strategy: "Do not accept the change again. Perform the named follow-up (rebuild the preview, regenerate assets, clean up the draft) and check the result."
113
+ },
114
+ "ads-defect": {
115
+ order: 17,
116
+ certainty: "violated",
117
+ actionability: "ads-defect",
118
+ summary: "ADS produced inconsistent output; the project source is not at fault.",
119
+ strategy: "Stop. Do not rewrite source to avoid it; report it with the owner and the failing revision."
120
+ },
121
+ environment: {
122
+ order: 18,
123
+ certainty: "violated",
124
+ actionability: "environment",
125
+ summary: "The installed tooling does not match what ADS requires.",
126
+ strategy: "Reinstall the project's dependencies so ADS's pinned versions are used; do not change source."
127
+ }
128
+ };
129
+ const list = (values) => values.join(", "), pixels = (value) => `${Math.round(value * 100) / 100}px`, contextNames = (contexts) => contexts.length <= 1 ? contexts[0] ?? "" : `${contexts[0] ?? ""} (and ${contexts.length - 1} more context${contexts.length === 2 ? "" : "s"})`, detail = (value) => JSON.stringify(value), framePlace = (place) => {
130
+ const cell = place.cell.startsWith(".") ? `cell ${place.cell}` : place.cell;
131
+ return place.element === null ? `${cell.charAt(0).toUpperCase()}${cell.slice(1)}'s frame` : `The ${place.element} inside ${cell}: its frame`;
132
+ };
133
+ function restated(redundancy) {
134
+ switch (redundancy.kind) {
135
+ case "selection-default":
136
+ return `select.${redundancy.choice}: "${redundancy.option}" is the default option of ${redundancy.profile}'s ${redundancy.choice} choice`;
137
+ case "binding-default":
138
+ return `${redundancy.consumer} ${redundancy.binding} is what the ${redundancy.slot} slot already supplies (${redundancy.inherited})`;
139
+ case "gap-default":
140
+ return `gap ${redundancy.field}${redundancy.value === "" ? "" : ` (${redundancy.value})`} is the arrangement's default content gap`;
141
+ case "state-surface-unchanged":
142
+ return `the ${redundancy.condition} state selects ${redundancy.surface}, which is the element's base surface ${redundancy.base}`;
143
+ }
144
+ }
145
+ const RECIPES = "ads://guides/recipes", FORMS = "ads://guides/forms", REPORT = "Report it with the owner, the failing revision and this message.";
146
+ export const choiceErrors = {
147
+ "domain-not-finite": {
148
+ group: "unanalyzable",
149
+ rule: "Design is selected from a finite set of choices ADS can enumerate, so every rendered combination can be checked.",
150
+ guides: [RECIPES, "ads://guides/atomic-styles"],
151
+ message: () => "A value that selects design does not come from a finite set of choices.",
152
+ repair: "Type the selecting prop or variable as a literal union (or a const record key) so every choice can be enumerated."
153
+ },
154
+ "work-limit": {
155
+ group: "unanalyzable",
156
+ rule: "Choice analysis is bounded; a selection must stay small enough to be checked completely.",
157
+ guides: [RECIPES],
158
+ message: () => "Choice analysis exceeded its work limit before every choice was evaluated.",
159
+ repair: "Reduce how many independent axes combine in one class expression; split the selection into smaller recipes or parts."
160
+ },
161
+ "branch-limit": {
162
+ group: "unanalyzable",
163
+ rule: "Choice analysis is bounded; a selection must stay small enough to be checked completely.",
164
+ guides: [RECIPES],
165
+ message: () => "Choice analysis exceeded its branch limit.",
166
+ repair: "Replace deep conditional chains with one lookup over a const record keyed by the selecting value."
167
+ },
168
+ "construction-limit": {
169
+ group: "unanalyzable",
170
+ rule: "An owner lowers a bounded number of distinct constructions.",
171
+ guides: [RECIPES, "ads://guides/performance"],
172
+ message: () => "The choices produce more distinct constructions than ADS lowers for one owner.",
173
+ repair: "Collapse equivalent combinations, or move independent variation into separate parts so constructions do not multiply."
174
+ },
175
+ cyclic: {
176
+ group: "conflict",
177
+ rule: "A design value is defined from constants, profiles or recipes, never from itself.",
178
+ guides: [RECIPES],
179
+ message: () => "A design value depends on itself.",
180
+ repair: "Break the cycle: define the value from constants, a profile or a recipe, not from another value that refers back to it."
181
+ },
182
+ "no-reachable-choice": {
183
+ group: "structure-mismatch",
184
+ rule: "Every styled selection renders in at least one reachable state.",
185
+ guides: [RECIPES],
186
+ message: () => "No choice of this selection is reachable.",
187
+ repair: "Check the conditions guarding the element; remove dead branches or the unreachable styling."
188
+ },
189
+ "absent-property": {
190
+ group: "unresolved-reference",
191
+ rule: "A design record is read only at properties it defines for every choice.",
192
+ guides: [RECIPES],
193
+ message: () => "A design record is read at a property it does not have.",
194
+ repair: "Add the property to the record for every choice, or read it with optional chaining where absence is intended."
195
+ },
196
+ "record-unsupported": {
197
+ group: "unanalyzable",
198
+ rule: "Design records are plain object literals with literal keys, so their values are visible to analysis.",
199
+ guides: [RECIPES],
200
+ message: (failure) => failure.detail === "computed-key" ? "A design record uses a computed key." : "A design record uses a spread or an accessor.",
201
+ repair: "Write design records as plain object literals with literal keys and values; no spreads, getters or computed keys."
202
+ },
203
+ "recipe-access-unsupported": {
204
+ group: "unresolved-reference",
205
+ rule: "Recipe output is selected only through the variants and parts its spec declares.",
206
+ guides: [RECIPES],
207
+ message: (failure) => `A recipe is accessed at "${failure.key}", which is not one of its declared variants or parts.`,
208
+ repair: "Select recipe output only through the variants and parts its spec declares."
209
+ },
210
+ "part-unknown": {
211
+ group: "unresolved-reference",
212
+ rule: "A part is used only if the recipe spec declares it.",
213
+ guides: [RECIPES],
214
+ message: (failure) => `Part "${failure.name}" is not declared by the recipe.`,
215
+ repair: "Declare the part in the recipe spec, or use one of the parts it already declares."
216
+ },
217
+ "property-unresolved": {
218
+ group: "unanalyzable",
219
+ rule: "Design values resolve to literals or const references inside the design system.",
220
+ guides: [RECIPES],
221
+ message: (failure) => `Property "${failure.key}" cannot be resolved to a value.`,
222
+ repair: "Make the property a literal or a const reference ADS can follow within the design system."
223
+ },
224
+ "key-not-literal": {
225
+ group: "unanalyzable",
226
+ rule: "Design records are indexed by literal or finite union-typed keys.",
227
+ guides: [RECIPES],
228
+ message: () => "A design record is indexed with a key that is not a literal or a finite union.",
229
+ repair: "Index design records with a literal union-typed value (for example a variant prop), not an arbitrary string."
230
+ },
231
+ "binding-written": {
232
+ group: "unanalyzable",
233
+ rule: "Values that select design are immutable after declaration, so one declaration describes every use.",
234
+ guides: [RECIPES],
235
+ message: () => "A value that selects design is reassigned after its declaration.",
236
+ repair: "Declare it with const and derive new values into new bindings instead of reassigning."
237
+ },
238
+ "record-escapes": {
239
+ group: "unanalyzable",
240
+ rule: "Design records stay local: passing one to a call could mutate it outside analysis.",
241
+ guides: [RECIPES],
242
+ message: () => "A design record is passed to a call that may mutate it.",
243
+ repair: "Pass the selected value, not the record, or freeze the record with `as const` and read it locally."
244
+ },
245
+ "binding-not-immutable": {
246
+ group: "unanalyzable",
247
+ rule: "Design is selected from const bindings, component props or the element of a `.map` over a literal array.",
248
+ guides: [RECIPES],
249
+ message: () => "A design value comes from a binding that is not a const with an initializer.",
250
+ repair: "Use a const declaration initialized in place, a component prop, or the element of a `.map` over a literal array."
251
+ },
252
+ "evidence-not-local": {
253
+ group: "unanalyzable",
254
+ rule: "Design evidence comes from the owner's source or the design system's own modules.",
255
+ guides: [RECIPES, "ads://guides/layers"],
256
+ message: () => "A design value comes from outside the source ADS can analyze for this owner.",
257
+ repair: "Bring the value into the owner's source as a const or prop, or import it from the design system's own modules."
258
+ },
259
+ "text-content-read": {
260
+ group: "boundary",
261
+ rule: "Application text is data: design may depend on whether text is present, never on what it says.",
262
+ guides: ["ads://guides/layers"],
263
+ message: () => "Design depends on the content of application text.",
264
+ repair: "Select design from a typed prop (variant, size, state), never from the text the component displays."
265
+ },
266
+ unresolved: {
267
+ group: "unanalyzable",
268
+ rule: "Design values resolve to closed values ADS can trace through the source.",
269
+ guides: [RECIPES],
270
+ message: (failure) => `ADS could not establish a closed value: ${failure.reason}.`,
271
+ repair: "Simplify the expression to literals, const records and typed props that ADS can follow."
272
+ }
273
+ }, sourceErrors = {
274
+ "recipe-import-unnamed": {
275
+ group: "unanalyzable",
276
+ rule: "Recipe macros are imported by name so ADS can identify each macro call.",
277
+ guides: [RECIPES],
278
+ message: () => "The recipe module is imported without named imports.",
279
+ repair: 'Import recipe macros by name: `import { recipe } from "\u2026"`; no default or namespace import.'
280
+ },
281
+ "recipe-macro-unknown": {
282
+ group: "unresolved-reference",
283
+ rule: "Only the macros the recipe module exports may be used.",
284
+ guides: [RECIPES],
285
+ message: (failure) => `"${failure.name}" is not a recipe macro.`,
286
+ repair: "Use only the macros the recipe module exports."
287
+ },
288
+ "recipe-spec-not-literal": {
289
+ group: "unanalyzable",
290
+ rule: "A recipe's spec is one static object literal; it is the construction's identity and must be known at build time.",
291
+ guides: [RECIPES],
292
+ message: () => "A recipe's spec is not a single static object literal.",
293
+ repair: "Pass `recipe()` exactly one object literal whose values are static JSON (no calls or runtime values)."
294
+ },
295
+ "combine-needs-recipes": {
296
+ group: "wrong-value",
297
+ rule: "combine composes recipes only.",
298
+ guides: [RECIPES],
299
+ message: () => "An argument to combine is not a recipe.",
300
+ repair: "Pass combine only values created by `recipe()`."
301
+ },
302
+ "spread-attribute": {
303
+ group: "unanalyzable",
304
+ rule: "Owned elements receive attributes explicitly; a spread could carry styling analysis cannot see. The one exception is `{...recipe.measured.props({ \u2026 })}`: the recipe's own measured values as a style, typed and checked like its setter.",
305
+ guides: ["ads://guides/contracts"],
306
+ message: () => "An owned element receives spread attributes, which may carry styling ADS cannot see.",
307
+ repair: "Pass attributes explicitly. Public components accept extra props through their own typed props interface."
308
+ },
309
+ "raw-style": {
310
+ group: "design-bypass",
311
+ rule: "Owned elements are styled only through their recipe; inline style and css attributes bypass design evidence.",
312
+ guides: [RECIPES, "ads://guides/tokens"],
313
+ message: (failure) => `An owned element sets \`${failure.attribute}\` directly.`,
314
+ repair: "Move the styling into the owner's recipe."
315
+ },
316
+ "css-in-js-import": {
317
+ group: "design-bypass",
318
+ rule: "Styling exists only in owners, and owners style only through their recipes: no design-system file imports a CSS-in-JS package.",
319
+ guides: [RECIPES, "ads://guides/layers"],
320
+ message: (failure) => `${failure.specifier} is a CSS-in-JS package (${failure.packageName}).`,
321
+ repair: "Remove the import and move the styling into a recipe in an owner."
322
+ },
323
+ "plain-style-attribute": {
324
+ group: "design-bypass",
325
+ rule: "Styling exists only in owners: a module that authors no recipe sets no `className`, `class`, `style` or `css` on what it renders.",
326
+ guides: [RECIPES, "ads://guides/layers"],
327
+ message: (failure) => `A plain module sets \`${failure.attribute}\` on <${failure.element}>.`,
328
+ repair: "Move the styling into a recipe in an owner, and render that owner here."
329
+ },
330
+ "plain-style-write": {
331
+ group: "design-bypass",
332
+ rule: "Styling exists only in owners: a module that authors no recipe writes no styling through the DOM.",
333
+ guides: [RECIPES, "ads://guides/layers"],
334
+ message: (failure) => `A plain module writes styling through the DOM (\`${failure.member}\`).`,
335
+ repair: "Move the styling into a recipe in an owner, and select it through that owner's props."
336
+ },
337
+ "measured-undeclared": {
338
+ group: "unresolved-reference",
339
+ rule: "`recipe.measured.set` writes only the measured values the recipe declares, called directly with an object literal; `recipe.measured` is not passed on.",
340
+ guides: [RECIPES],
341
+ message: (failure) => failure.name === null ? "The recipe's `measured` setter is read from a recipe that declares no measured values." : `\`measured.set\` writes "${failure.name}", which the recipe does not declare.`,
342
+ repair: "Declare the value in the recipe's `measured` clause (a closed geometry property), or remove it from the call."
343
+ },
344
+ "paint-undeclared": {
345
+ group: "unresolved-reference",
346
+ rule: "`recipe.paints.set` writes only the runtime paints the recipe declares, called directly with an object literal; `recipe.paints` is not passed on.",
347
+ guides: [RECIPES],
348
+ message: (failure) => failure.name === null ? "The recipe's `paints` setter is read from a recipe that declares no runtime paints." : `\`paints.set\` writes "${failure.name}", which the recipe does not declare.`,
349
+ repair: "Declare the paint in the recipe's `paints` clause (a closed paint property and its paint tokens), or remove it from the call."
350
+ },
351
+ "paint-value-untyped": {
352
+ group: "unanalyzable",
353
+ rule: "A value written by `recipe.paints.set` has the declared paint's literal union type (or a part of it): a `string`, `any` or wider type could name a paint the recipe does not declare, so its contrast is not proven.",
354
+ guides: [RECIPES, "ads://guides/tokens"],
355
+ message: (failure) => `\`paints.set\` writes "${failure.name}" from a value of type ${failure.type}, not the declared union of ${failure.values.join(", ")}.`,
356
+ repair: `Type the data's paint with the recipe's union (\`(typeof chart)["paints"]["series"]\`), or map the data's own keys to declared tokens through a typed record.`
357
+ },
358
+ "owner-style-write": {
359
+ group: "design-bypass",
360
+ rule: 'An owner styles only through its recipe: runtime geometry goes through the recipe\'s declared `measured` values, never a direct DOM style write (`style`, `setProperty`, `classList`, `setAttribute("style")`).',
361
+ guides: [RECIPES, "ads://guides/layout"],
362
+ message: (failure) => `The owner writes styling through the DOM (\`${failure.member}\`).`,
363
+ repair: "Declare the value in the recipe's `measured` clause and write it with `recipe.measured.set(element, { \u2026 })`; any other styling belongs in the recipe."
364
+ },
365
+ "plain-stylesheet-import": {
366
+ group: "design-bypass",
367
+ rule: "Styling exists only in owners: a module that authors no recipe imports no stylesheet.",
368
+ guides: [RECIPES, "ads://guides/layers"],
369
+ message: (failure) => `A plain module imports the stylesheet ${failure.specifier}.`,
370
+ repair: "Remove the import and move the styling into a recipe in an owner."
371
+ },
372
+ "recipe-redundant": {
373
+ group: "conflict",
374
+ rule: "A recipe states only what its selected profile does not already supply: no explicit selection of a choice's default option, no binding of the profile a composite slot already supplies (by name or an equivalent profile; `{ slot: \"text\" }` on a text part), no gap that is the arrangement's default content gap, and no `when` state selecting the element's base surface. A declaration is redundant only when it is in every reachable choice.",
375
+ guides: [RECIPES],
376
+ message: (failure) => `Redundant recipe declaration: ${restated(failure.redundancy)}.`,
377
+ repair: "Remove the declaration and use the profile's default; to change the treatment, select a different option, profile or field."
378
+ },
379
+ "owner-stylesheet-import": {
380
+ group: "design-bypass",
381
+ rule: "An owner styles only through its recipes: it imports no stylesheet, whose rules would style outside the recipes ADS checks and emits.",
382
+ guides: [RECIPES, "ads://guides/layers"],
383
+ message: (failure) => `An owner imports the stylesheet ${failure.specifier}.`,
384
+ repair: "Remove the import and express the styling in the owner's recipe through profiles."
385
+ },
386
+ "plain-markup": {
387
+ group: "boundary",
388
+ rule: "A module that authors no recipe renders only design-system owners; markup belongs to owners.",
389
+ guides: [RECIPES, "ads://guides/layers"],
390
+ message: (failure) => `A plain module renders <${failure.element}>.`,
391
+ repair: "Render design-system owners here, or make this module an owner that styles its markup with a recipe."
392
+ },
393
+ "style-element": {
394
+ group: "design-bypass",
395
+ rule: "Styling exists only in owners: a scenario renders no `<style>` element.",
396
+ guides: [RECIPES, "ads://guides/scenarios"],
397
+ message: () => "A scenario renders <style>.",
398
+ repair: "Remove it, and choose the owner's appearance through its props; styling belongs to the owner's recipe."
399
+ },
400
+ "controller-recipe": {
401
+ group: "boundary",
402
+ rule: "A shared controller (controllers/) owns behaviour, not design: it authors no recipe. Recipes belong to the components and patterns that consume it.",
403
+ guides: ["ads://guides/behaviors", "ads://guides/layers"],
404
+ message: () => "A shared controller imports the recipe macro.",
405
+ repair: "Move the recipe into the component or pattern that renders with this controller, and pass the controller's state to it through props."
406
+ },
407
+ "controller-markup": {
408
+ group: "boundary",
409
+ rule: "A shared controller (controllers/) renders no markup: its consumers' components render, and the controller supplies state, effects and measurements.",
410
+ guides: ["ads://guides/behaviors", "ads://guides/layers"],
411
+ message: (failure) => `A shared controller renders <${failure.element}>.`,
412
+ repair: "Render the element in the component or pattern that uses the controller; a controller may return state, callbacks and refs, or render a context provider around its children."
413
+ },
414
+ "controller-ui-import": {
415
+ group: "boundary",
416
+ rule: "A shared controller (controllers/) imports no component or pattern at runtime: UI depends on controllers, never the reverse. Type-only imports are allowed.",
417
+ guides: ["ads://guides/behaviors", "ads://guides/layers"],
418
+ message: (failure) => `A shared controller imports ${failure.target} (${failure.specifier}) at runtime.`,
419
+ repair: "Invert the dependency: let the component or pattern import the controller, pass what the controller needs as arguments, or use `import type` when only the types are read."
420
+ },
421
+ "framework-mismatch": {
422
+ group: "boundary",
423
+ rule: "A design system's modules use the project's framework only: a Preact project imports no React package (`react`, `react-dom`), and a React project no Preact package.",
424
+ guides: ["ads://guides/runtimes"],
425
+ message: (failure) => `${failure.specifier} is a ${failure.imported === "react" ? "React" : "Preact"} package, but the project's framework is ${failure.framework === "react" ? "React" : "Preact"}.`,
426
+ repair: "Import the project's framework instead (Preact: `preact`, `preact/hooks`, `ComponentChildren`; React: `react`, `ReactNode`), or change `framework` in ds.config.json."
427
+ },
428
+ "foreign-interior": {
429
+ group: "boundary",
430
+ rule: "An owner styles only its own elements; another owner's interior is changed through its public props.",
431
+ guides: ["ads://guides/layers", "ads://guides/contracts"],
432
+ message: () => "A parent recipe styles an element inside another owner.",
433
+ repair: "Style the child through its public props (variants, parts it exposes), not by classing its interior."
434
+ },
435
+ "development-import": {
436
+ group: "boundary",
437
+ rule: "Production code never imports development files; scenarios, fixtures, mocks and tests may import production code, not the reverse.",
438
+ guides: ["ads://guides/layers", "ads://guides/scenarios"],
439
+ message: (failure) => `Production module imports development file ${failure.module}.`,
440
+ repair: "Remove the import and move what production needs into a production module."
441
+ },
442
+ "authoring-import": {
443
+ group: "boundary",
444
+ rule: "Emitted output runs without ADS; production modules do not import ADS.",
445
+ guides: ["ads://guides/layers", "ads://guides/runtimes"],
446
+ message: (failure) => `Production module imports ADS (${failure.specifier}).`,
447
+ repair: "Import authoring helpers only in development files, or use the compiled output."
448
+ },
449
+ "import-leaves-design-system": {
450
+ group: "boundary",
451
+ rule: "The design system is closed: its modules import only design-system files and declared packages.",
452
+ guides: ["ads://guides/layers"],
453
+ message: (failure) => `Import ${failure.specifier} resolves to ${failure.target}, outside the design system.`,
454
+ repair: "Move the dependency into the design system, or receive the data or behavior through props from the application."
455
+ },
456
+ "module-unresolved": {
457
+ group: "unresolved-reference",
458
+ rule: "Every local import resolves to a file of this revision.",
459
+ guides: ["ads://guides/layers"],
460
+ message: (failure) => `Local import ${failure.specifier} cannot be resolved.`,
461
+ repair: "Fix the import path or add the missing file to the design system."
462
+ },
463
+ "import-unanalyzable": {
464
+ group: "unanalyzable",
465
+ rule: "Dynamic imports use literal specifiers so every dependency can be reported.",
466
+ guides: ["ads://guides/layers"],
467
+ message: () => "A dynamic import uses a computed specifier.",
468
+ repair: "Use a string literal in `import()`."
469
+ },
470
+ "worker-module-missing": {
471
+ group: "unresolved-reference",
472
+ rule: "A worker entry names a module of this revision inside the design system.",
473
+ guides: ["ads://guides/runtimes"],
474
+ message: (failure) => `Worker entry ${failure.entry} names no module of this revision.`,
475
+ repair: "Point `new Worker(new URL(\u2026, import.meta.url))` at an existing module inside the design system."
476
+ },
477
+ "align-rows-mismatch": {
478
+ group: "structure-mismatch",
479
+ rule: "A grid aligns only the rows a public component exposes, in the order it exposes them.",
480
+ guides: ["ads://guides/layout"],
481
+ message: (failure) => failure.exposed === null ? `Grid cell ${failure.cell} aligns rows [${list(failure.expected)}], but its component exposes no rows.` : `Grid cell ${failure.cell} aligns rows [${list(failure.expected)}], but its component exposes [${list(failure.exposed)}].`,
482
+ repair: "Align only the rows the component exposes, in its order, or expose the rows from the component."
483
+ },
484
+ "helper-markup": {
485
+ group: "unanalyzable",
486
+ rule: "Styled markup is written in the owner's JSX or a `.map` callback, where ADS can match it to its declaration.",
487
+ guides: [RECIPES, "ads://guides/atomic-styles"],
488
+ message: () => "Styled markup is returned from a helper call ADS cannot follow.",
489
+ repair: "Inline the markup in the owner's JSX, or render it with `.map(item => <\u2026 />)` over a literal array."
490
+ },
491
+ "loop-markup": {
492
+ group: "unanalyzable",
493
+ rule: "Repeated styled markup is rendered with `.map` in JSX, not built in loop statements.",
494
+ guides: [RECIPES],
495
+ message: () => "Styled markup is produced inside a loop statement.",
496
+ repair: "Render repeated elements with `.map(\u2026)` in JSX instead of a for/while loop."
497
+ },
498
+ "class-expression-incomplete": {
499
+ group: "design-bypass",
500
+ rule: "A className is built only from recipe outputs, at most one placement and declared asset bindings.",
501
+ guides: [RECIPES, "ads://guides/atomic-styles"],
502
+ message: () => "A className contains a value that is not a recipe output, placement or asset class.",
503
+ repair: "Remove free class strings and conditions; express the styling in the recipe."
504
+ },
505
+ "placement-repeated": {
506
+ group: "structure-mismatch",
507
+ rule: "An element has at most one placement.",
508
+ guides: ["ads://guides/layout"],
509
+ message: () => "An element receives more than one placement.",
510
+ repair: "Give each element exactly one placement; combine positions into one placement value."
511
+ },
512
+ "placement-without-root": {
513
+ group: "structure-mismatch",
514
+ rule: "A placement positions a styled root; an element with a placement also carries its own recipe styling.",
515
+ guides: ["ads://guides/layout"],
516
+ message: () => "An element has a placement but no recipe styling of its own.",
517
+ repair: "Add the element's recipe output beside its placement, or move the placement to the styled root."
518
+ },
519
+ "placement-statement": {
520
+ group: "unanalyzable",
521
+ rule: "Placements are applied in the JSX the component returns.",
522
+ guides: ["ads://guides/layout"],
523
+ message: () => "A placement is applied outside the owner's return statement.",
524
+ repair: "Apply placements in the returned JSX, not in earlier statements."
525
+ },
526
+ "part-selector-unresolved": {
527
+ group: "structure-mismatch",
528
+ rule: "Every declared part is rendered by an element carrying the part's marker.",
529
+ guides: [RECIPES, "ads://guides/contracts"],
530
+ message: (failure) => `Part "${failure.part}" cannot be matched to an element.`,
531
+ repair: "Mark the element that renders the part with the part's declared selector."
532
+ },
533
+ "part-missing-or-repeated": {
534
+ group: "structure-mismatch",
535
+ rule: "Each declared part renders exactly once per choice; optional parts are declared as not required.",
536
+ guides: [RECIPES],
537
+ message: (failure) => `Part "${failure.part}" is rendered zero or several times.`,
538
+ repair: "Render the part exactly once per choice, or mark it as not required in the spec."
539
+ },
540
+ "layer-element-mismatch": {
541
+ group: "structure-mismatch",
542
+ rule: "A top-layer root renders the element its layer variant opens: a modal sheet is a `<dialog>`, an anchored popover carries the declared `popover` attribute value.",
543
+ guides: [RECIPES],
544
+ message: (failure) => `The layer root renders ${failure.actual}; its layer clause expects ${failure.expected}.`,
545
+ repair: "Render the recipe's root on a `<dialog>` (modal sheet) or give it the declared `popover` attribute (anchored popover)."
546
+ },
547
+ "layer-open-attribute": {
548
+ group: "accessibility-semantics",
549
+ rule: "A modal sheet is opened with `showModal()`, never rendered with `open`: an `open` attribute gives a non-modal dialog and a server render the client cannot make modal.",
550
+ guides: [RECIPES, "ads://guides/accessibility"],
551
+ message: () => "The modal sheet's dialog renders an `open` attribute.",
552
+ repair: "Render the dialog closed and open it with `showModal()` from an effect or handler; mirror the native state in owner state."
553
+ },
554
+ "layer-in-grid-cell": {
555
+ group: "structure-mismatch",
556
+ rule: "A top-layer root is not a grid cell: whenever it is open it leaves the grid for the top layer.",
557
+ guides: [RECIPES, "ads://guides/layout"],
558
+ message: (failure) => `Grid cell ${failure.cell} is a top-layer root.`,
559
+ repair: "Render the layer root as an uncelled child (or outside the grid), and keep an in-track alternative as its own cell."
560
+ },
561
+ "layer-name-missing": {
562
+ group: "accessibility-semantics",
563
+ rule: 'A dialog, and a popover with `role="dialog"`, has an accessible name from `aria-label` or `aria-labelledby`.',
564
+ guides: [RECIPES, "ads://guides/accessibility"],
565
+ message: (failure) => `The ${failure.element} layer root has no aria-label or aria-labelledby.`,
566
+ repair: "Label the layer root with `aria-labelledby` (its visible title's id) or `aria-label`."
567
+ },
568
+ "grid-container-missing": {
569
+ group: "structure-mismatch",
570
+ rule: 'A grid in container context (`context: "container"`) responds to the nearest `ads-region` size container, so an owned ancestor in the same owner starts one: a region framed `container: "region"` (a container is element-owned, never a cell\'s). Without one its tier rules never match and only the smallest tier applies, wherever the component is placed.',
571
+ guides: [RECIPES, "ads://guides/layout"],
572
+ message: () => 'This grid responds to its container (`context: "container"`), but no owned ancestor in this owner starts a size container.',
573
+ repair: 'Frame an owned ancestor of the grid with `frame: { container: "region" }` (a wrapper whose width is the region the grid should follow), or use `context: "viewport"`. A container a consumer renders around the component, or one inside a public component it is passed to, does not count.'
574
+ },
575
+ "frame-exceeds-region": {
576
+ group: "wrong-value",
577
+ rule: "A grid cell's frames fit the region its grid gives it: where the grid algebra bounds the cell at the lower edge of a tier (its span less its gutter insets), the fixed inline size (an `inline-size` its `max-inline-size` does not cap to the region, or a `min-inline-size`) of the cell's own frame, or of a frame deeper inside it less the insets of the owned elements between, is no wider, in every theme, brand and condition context. A tile of a fixed tiling grid is never wider than its tile size.",
578
+ guides: [RECIPES, "ads://guides/layout"],
579
+ message: (problem) => `${framePlace(problem)} ${problem.frame} needs ${pixels(problem.inlinePx)} (its ${problem.field}), but has ${pixels(problem.regionPx)} ${problem.tier === "every tier" ? "in its tile at every tier" : `at the lower edge of ${problem.tier}`}${problem.condition === null ? "" : ` while ${problem.condition} holds`} under ${problem.context}.`,
580
+ repair: "Span the cell over more tracks at that tier (or widen the tile), give the frame a smaller fixed size or cap it to its region (`max-inline-size` of 100%, `min(100%, \u2026)`), reduce the insets around it, or place it where it fits."
581
+ },
582
+ "form-state-colour-only": {
583
+ group: "accessibility-semantics",
584
+ rule: 'A field\'s error state (`[data-user-invalid]`, `[data-invalid]`, `[aria-invalid="true"]`) and its autofill state (`[data-autofill]`) are not shown by colour alone (WCAG 1.4.1): some element\'s treatment under the state adds a cue that is not a hue: an edge or ring (`boxShadow`), a pattern (`backgroundImage`) or a border that appears (`borderStyle: "solid"`).',
585
+ guides: [FORMS, RECIPES, "ads://guides/accessibility"],
586
+ message: (failure) => `The ${failure.state} state (${failure.condition}) changes only colours: nothing under it shows the state to someone who cannot tell the hues apart.`,
587
+ repair: "Give the state's surface a ring or edge (`boxShadow` with an inset ring token, such as the starter's `--shadow-invalid`) on the control, or another non-hue cue; colour changes may stay beside it."
588
+ },
589
+ "autofill-layout-shift": {
590
+ group: "wrong-value",
591
+ rule: "The autofill state changes paint only: the browser fills while the user reads, so its treatment never moves content. Under `[data-autofill]` no `borderStyle` normalization (a border's width appears or disappears) and no press `scale`; show autofill with a ring (`boxShadow`), which takes no space.",
592
+ guides: [FORMS, RECIPES],
593
+ message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} changes ${failure.property} under ${failure.condition}, which moves layout when the browser autofills.`,
594
+ repair: "Remove the layout change from the autofill treatment and indicate autofill with a surface whose `boxShadow` draws an inset ring."
595
+ },
596
+ "layer-modal-context": {
597
+ group: "conflict",
598
+ rule: "A modal sheet's `modalQuery` is a viewport media query, so the owner's layout swaps at viewport tiers too: no grid of the same owner responds to a container.",
599
+ guides: [RECIPES, "ads://guides/layout"],
600
+ message: () => "The owner hands its modal sheet over at a viewport tier, but one of its grids responds to a container.",
601
+ repair: 'Use `context: "viewport"` for the owner\'s grids, or keep the sheet modal at every size (no `modalBelow`).'
602
+ },
603
+ "part-element-mismatch": {
604
+ group: "structure-mismatch",
605
+ rule: "A region or part that declares a native element renders that element (an input of the declared type), and a vector part is an SVG shape directly under an owned `<svg>`.",
606
+ guides: [RECIPES],
607
+ message: (failure) => `${failure.part === "&" ? "The root" : `Part "${failure.part}"`} renders ${failure.actual}; it declares ${list(failure.expected)}.`,
608
+ repair: "Render the declared element for this part, or declare the element it actually renders."
609
+ },
610
+ "summary-outside-details": {
611
+ group: "structure-mismatch",
612
+ rule: "A declared summary is the first child of a `<details>` element: elsewhere it has no disclosure semantics.",
613
+ guides: [RECIPES, "ads://guides/accessibility"],
614
+ message: (failure) => `${failure.part === "&" ? "The root" : `Part "${failure.part}"`} is a summary outside a <details> element.`,
615
+ repair: "Render the summary inside the owner's `<details>`, or declare another element."
616
+ },
617
+ "clamp-on-control": {
618
+ group: "accessibility-semantics",
619
+ rule: "A clamp (`lines`) cuts text off for sighted readers: never on a control or a form label (a button, label, legend, summary, select, option or text field) or on text inside one, whose text says what the control does.",
620
+ guides: [RECIPES, "ads://guides/accessibility"],
621
+ message: (failure) => `Part "${failure.part}" clamps its text, but it is or is inside ${failure.element}, a control or its label.`,
622
+ repair: 'Let the control\'s text wrap (remove `lines` and `wrap: "truncate"`), shorten the text, or clamp a description outside the control.'
623
+ },
624
+ "pointer-transparent-interactive": {
625
+ group: "accessibility-semantics",
626
+ rule: '`pointerEvents: "none"` is for decorative overlays: never on a focusable element, and only on markup hidden from assistive technology (`aria-hidden`) or free of interactive content.',
627
+ guides: [RECIPES, "ads://guides/accessibility"],
628
+ message: (failure) => `${failure.part === "&" ? "The root" : `Part "${failure.part}"`} ignores the pointer but is focusable or exposes interactive content.`,
629
+ repair: "Remove `pointerEvents` from the interactive element, or move it to a decorative `aria-hidden` overlay."
630
+ },
631
+ "inspected-svg-inline": {
632
+ group: "design-bypass",
633
+ rule: "An inspected-SVG part is empty in JSX: the owner inserts the element ADS's sanitizer produced, never markup, children or `dangerouslySetInnerHTML`.",
634
+ guides: [RECIPES, "ads://guides/pictograms"],
635
+ message: (failure) => `Inspected-SVG part "${failure.part}" renders its own content.`,
636
+ repair: "Render the part empty and insert the sanitized `<svg>` (from `sanitizeInspectedSvg` of `@reqvire-org/ads/inspection`) in a layout effect."
637
+ },
638
+ "inspected-svg-parsed": {
639
+ group: "design-bypass",
640
+ rule: "An owner showing the inspected project's SVG never parses markup itself: ADS's sanitizer is the one reviewed parser.",
641
+ guides: [RECIPES, "ads://guides/pictograms"],
642
+ message: (failure) => `The owner shows inspected SVG and also uses ${failure.api}.`,
643
+ repair: "Take the sanitized element as a prop (the host sanitizes with `sanitizeInspectedSvg`) and insert it; remove the parsing call."
644
+ },
645
+ "pseudo-host-unsupported": {
646
+ group: "structure-mismatch",
647
+ rule: "A part treats only pseudo-elements its element has: `::placeholder` belongs to `<input>` and `<textarea>`.",
648
+ guides: [RECIPES],
649
+ message: (failure) => `Part "${failure.part}" treats ::${failure.pseudo}, but it renders a <${failure.element}>, which has none.`,
650
+ repair: "Move the pseudo treatment to the part that renders the input or textarea, or render that element for this part."
651
+ },
652
+ "cell-missing-or-repeated": {
653
+ group: "structure-mismatch",
654
+ rule: "Each declared grid cell renders exactly once.",
655
+ guides: ["ads://guides/layout"],
656
+ message: (failure) => `Grid cell "${failure.cell}" is rendered zero or several times.`,
657
+ repair: "Render each declared grid cell exactly once."
658
+ },
659
+ "markers-shared": {
660
+ group: "structure-mismatch",
661
+ rule: "One element carries one part or cell marker; distinct markers are lowered as distinct elements.",
662
+ guides: [RECIPES, "ads://guides/layout"],
663
+ message: (failure) => `One element carries several part/cell markers: ${list(failure.markers)}.`,
664
+ repair: "Use one element per declared part or cell; wrap to separate them."
665
+ },
666
+ "visual-binding-count": {
667
+ group: "structure-mismatch",
668
+ rule: "A construction has one visual part, and it binds exactly one declared asset.",
669
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
670
+ message: () => "A visual part does not have exactly one artwork binding.",
671
+ repair: "Bind exactly one declared asset to the visual part."
672
+ },
673
+ "asset-unknown": {
674
+ group: "unresolved-reference",
675
+ rule: "Artwork is used only through assets the design system declares.",
676
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
677
+ message: (failure) => `Asset "${failure.asset}" is not declared.`,
678
+ repair: "Use an existing asset name, or register the artwork as a new asset."
679
+ },
680
+ "glyph-set-unknown": {
681
+ group: "unresolved-reference",
682
+ rule: "A set binding names a glyph set declared with glyphSet() in a file under assets/.",
683
+ guides: ["ads://guides/pictograms"],
684
+ message: (failure) => `Glyph set "${failure.set}" is not declared under assets/.`,
685
+ repair: "Use a declared set's name, or declare the set with glyphSet({ name, title, members }) in an assets/**/*.ads.ts file."
686
+ },
687
+ "glyph-set-key": {
688
+ group: "wrong-value",
689
+ rule: "A set binding's drawing is looked up by a key typed as a finite union of the set's names (`typeof set.names[number]`).",
690
+ guides: ["ads://guides/pictograms"],
691
+ message: (failure) => failure.unexpected === null ? `The key into glyph set "${failure.set}" is not typed as a finite union of its names.` : `The key into glyph set "${failure.set}" admits names the set does not declare: ${list(failure.unexpected)}.`,
692
+ repair: "Type the key as `typeof set.names[number]` (import the set's declaration with `import type`), or add the names to the set."
693
+ },
694
+ "glyph-set-state": {
695
+ group: "unresolved-reference",
696
+ rule: "A set binding's state is declared by every member of the set: the runtime name selects a drawing, never a missing one.",
697
+ guides: ["ads://guides/pictograms"],
698
+ message: (failure) => `Glyph set "${failure.set}" member "${failure.member}" declares no "${failure.state}" state.`,
699
+ repair: "Bind the set without a state, or give every member a drawing for that state."
700
+ },
701
+ "glyph-source-form": {
702
+ group: "structure-mismatch",
703
+ rule: "A set-bound part renders `dangerouslySetInnerHTML={{ __html: recipe.assets.<part>.source[name] }}`; a reference-bound part renders `{{ __html: glyph.source }}` of the glyph reference it receives.",
704
+ guides: ["ads://guides/pictograms"],
705
+ message: (failure) => `A ${failure.binding}-bound visual part does not render its drawing in the ${failure.binding === "set" ? "`source[name]` lookup" : "`glyph.source`"} form.`,
706
+ repair: "Render the bound drawing in that exact form; select nothing else with the name or the reference."
707
+ },
708
+ "glyph-reference-type": {
709
+ group: "unanalyzable",
710
+ rule: 'A reference-bound part renders a value typed as a glyph reference with finite names (`Glyph<"close" | "search">` from @reqvire-org/ads/asset), so analysis knows every drawing it can receive.',
711
+ guides: ["ads://guides/pictograms"],
712
+ message: () => "The rendered glyph reference is not typed with a finite union of asset names.",
713
+ repair: "Type the prop as `Glyph<Names>` with a literal union of the asset names (or aliases) the owner accepts."
714
+ },
715
+ "glyph-reference-read": {
716
+ group: "design-bypass",
717
+ rule: "An owner reads a received glyph reference only for its drawing (`.source` in a reference-bound part) or passes it whole to a public component: a reference never selects CSS.",
718
+ guides: ["ads://guides/pictograms"],
719
+ message: (failure) => `Glyph reference "${failure.name}" is read for something other than its drawing.`,
720
+ repair: "Remove the read; choose treatments with the owner's own finite props, not with the glyph."
721
+ },
722
+ "glyph-ineligible": {
723
+ group: "wrong-value",
724
+ rule: 'A glyph reference carries one foreground drawing: its asset has paint "foreground" and exactly one drawing (no state, size or theme variants).',
725
+ guides: ["ads://guides/pictograms"],
726
+ message: (failure) => `Asset "${failure.asset}" (paint ${failure.paint}, ${failure.drawings} drawing(s)) cannot be a glyph reference.`,
727
+ repair: "Bind the asset by name in a recipe (optical, state and themed drawings are selected there), or give it one foreground drawing."
728
+ },
729
+ "glyph-grid-mixed": {
730
+ group: "conflict",
731
+ rule: "Every asset a reference binding can receive shares one grid (viewBox, optical center and minimum drawn height), so one construction draws them all.",
732
+ guides: ["ads://guides/pictograms"],
733
+ message: (failure) => `Assets "${failure.assets[0]}" and "${failure.assets[1]}" do not share one grid.`,
734
+ repair: "Draw the glyphs on one viewBox with one optical center, or accept them through separate props or owners."
735
+ },
736
+ "glyph-call-not-literal": {
737
+ group: "unanalyzable",
738
+ rule: "`glyph()` takes one asset name as a string literal and `glyphSet()` one literal declaration, so compilation can inline them.",
739
+ guides: ["ads://guides/pictograms"],
740
+ message: () => "A glyph macro call is not a literal.",
741
+ repair: "Write the asset name (or the set declaration) literally."
742
+ },
743
+ "theme-unknown": {
744
+ group: "unresolved-reference",
745
+ rule: "A construction refers only to themes the foundation declares.",
746
+ guides: ["ads://guides/tokens"],
747
+ message: (failure) => `Theme "${failure.theme}" is not declared.`,
748
+ repair: "Use a declared theme name, or declare the theme first."
749
+ },
750
+ "artwork-source-undeclared": {
751
+ group: "structure-mismatch",
752
+ rule: "Inline artwork renders its bound drawing's SVG through a single `dangerouslySetInnerHTML.__html`.",
753
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
754
+ message: () => "Inline artwork is not rendered from its binding through `dangerouslySetInnerHTML={{ __html: \u2026 }}`.",
755
+ repair: "Render the bound drawing's SVG text with a single `__html` property on the visual part."
756
+ },
757
+ "intrinsic-image-count": {
758
+ group: "structure-mismatch",
759
+ rule: "An image visual part contains exactly one <img>.",
760
+ guides: ["ads://guides/branding"],
761
+ message: () => "An image visual part does not contain exactly one <img>.",
762
+ repair: "Render exactly one <img> child in the part."
763
+ },
764
+ "intrinsic-src-missing": {
765
+ group: "structure-mismatch",
766
+ rule: "The image of a visual part takes its src from the bound asset.",
767
+ guides: ["ads://guides/branding"],
768
+ message: () => "The image of a visual part has no src from its binding.",
769
+ repair: "Set `src` from the bound asset."
770
+ },
771
+ "intrinsic-alt-missing": {
772
+ group: "structure-mismatch",
773
+ rule: "Every image states its text alternative; decorative images state it as empty.",
774
+ guides: ["ads://guides/branding", "ads://guides/accessibility"],
775
+ message: () => "The image of a visual part has no alt attribute.",
776
+ repair: 'Set `alt` to the text alternative, or `alt=""` when the image is decorative.'
777
+ },
778
+ "image-alt-missing": {
779
+ group: "accessibility-semantics",
780
+ rule: "Every `<img>` an owner renders states its text alternative (WCAG 2.2 1.1.1): content media and any other image, as artwork images do; decorative images state it as empty.",
781
+ guides: ["ads://guides/accessibility"],
782
+ message: () => "This <img> has no alt attribute.",
783
+ repair: 'Set `alt` to the text alternative (for content media, a prop the caller fills), or `alt=""` when the image is decorative.'
784
+ },
785
+ "control-name-missing": {
786
+ group: "accessibility-semantics",
787
+ rule: "A control without a text part in some reachable choice is named on its root by a non-empty `aria-label`, `aria-labelledby` or `title` in that choice (WCAG 2.2 4.1.2). Application text counts as a name, as it counts as content in a text part.",
788
+ guides: [RECIPES, "ads://guides/accessibility"],
789
+ message: (failure) => `This <${failure.element}> control renders no text part in some reachable choice and has no aria-label, aria-labelledby or title there.`,
790
+ repair: "Set `aria-label` (or `aria-labelledby`) on the control's root to its name in every choice that renders only artwork, for example from the label prop the visible text would show."
791
+ },
792
+ "artwork-mismatch": {
793
+ group: "structure-mismatch",
794
+ rule: "A visual part renders the drawing its binding selects.",
795
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
796
+ message: () => "Rendered artwork is not the drawing its binding declares.",
797
+ repair: "Render the drawing selected by the binding; do not swap in another asset or literal markup."
798
+ },
799
+ "pressed-state-mismatch": {
800
+ group: "accessibility-semantics",
801
+ rule: "A toggle's state is exposed as drawn (WCAG 2.2 4.1.2): where a choice pairs `aria-pressed` with artwork that declares a `selected` state, a pressed toggle draws the selected drawing and an unpressed one does not.",
802
+ guides: ["ads://guides/accessibility", "ads://guides/pictograms"],
803
+ message: (failure) => `This choice sets aria-pressed ${failure.pressed ? "true" : "false"} but draws ${failure.asset} in its ${failure.state} state.`,
804
+ repair: "Pair the choice's aria-pressed with the drawing that shows it: the selected state when pressed, another state when not."
805
+ },
806
+ "data-theme-mismatch": {
807
+ group: "structure-mismatch",
808
+ rule: "An element's data-theme matches the theme its construction declares.",
809
+ guides: ["ads://guides/tokens"],
810
+ message: (failure) => `data-theme does not match the declared theme "${failure.expected}".`,
811
+ repair: "Set data-theme to the theme the construction declares."
812
+ },
813
+ "public-import-unnamed": {
814
+ group: "unanalyzable",
815
+ rule: "Public components are imported by name from the public barrel.",
816
+ guides: ["ads://guides/contracts"],
817
+ message: () => "The public module is imported without named imports.",
818
+ repair: "Import public components by name."
819
+ },
820
+ "dependency-unresolved": {
821
+ group: "unresolved-reference",
822
+ rule: "Every name imported from the public barrel resolves to an exported declaration.",
823
+ guides: ["ads://guides/contracts"],
824
+ message: () => "A public import names no declaration.",
825
+ repair: "Export the component from the public barrel, or fix the imported name."
826
+ },
827
+ "dependency-not-emitted": {
828
+ group: "boundary",
829
+ rule: "An owner depends only on public owners that are emitted with it.",
830
+ guides: ["ads://guides/layers", "ads://guides/contracts"],
831
+ message: (failure) => `Dependency ${failure.dependency} is not part of the emitted output.`,
832
+ repair: "Make the dependency a public owner of the design system, or remove the dependency."
833
+ },
834
+ "declaration-not-split": {
835
+ group: "unanalyzable",
836
+ rule: "Each design binding has its own const statement, so ADS can replace it in emitted output.",
837
+ guides: [RECIPES],
838
+ message: () => "A declaration ADS must remove shares its statement with other declarations.",
839
+ repair: "Declare each design binding in its own `const` statement."
840
+ },
841
+ "local-name-collision": {
842
+ group: "conflict",
843
+ rule: "Names of the form compiledClassN are reserved for ADS's emitted output.",
844
+ guides: [RECIPES],
845
+ message: (failure) => `The source already uses the name ${failure.name}, which ADS needs for compiled output.`,
846
+ repair: "Rename the local identifier."
847
+ }
848
+ }, discoveryErrors = {
849
+ "export-unresolved": {
850
+ group: "unresolved-reference",
851
+ rule: "Every re-export in the public barrel resolves to a declaration.",
852
+ guides: ["ads://guides/contracts"],
853
+ message: (failure) => `${failure.file}:${failure.line}:${failure.column}: export ${failure.name} resolves to no declaration.`,
854
+ repair: "Fix the exported name or path, or remove the stale re-export."
855
+ },
856
+ "export-star": {
857
+ group: "unanalyzable",
858
+ rule: "The public barrel names each public owner; `export *` hides which owners are public.",
859
+ guides: ["ads://guides/contracts"],
860
+ message: (failure) => `${failure.file}:${failure.line}:${failure.column}: \`export *\` hides which owners are public.`,
861
+ repair: "Replace `export *` with named re-exports of each public owner."
862
+ },
863
+ "owner-cycle": {
864
+ group: "boundary",
865
+ rule: "Owners form an acyclic dependency graph.",
866
+ guides: ["ads://guides/layers"],
867
+ message: (failure) => `Owners import each other in a cycle: ${failure.owners.join(" \u2192 ")}.`,
868
+ repair: "Move the shared part into a lower owner both can import, or pass it through props."
869
+ }
870
+ }, specErrors = {
871
+ "field-unsupported": {
872
+ group: "wrong-value",
873
+ rule: "A spec uses only the fields its construction kind defines; unknown fields are rejected, never ignored.",
874
+ guides: [RECIPES],
875
+ message: (failure) => `${failure.construction} spec: field ${failure.path} is not supported.`,
876
+ repair: "Remove the field or move it to the construction kind that supports it."
877
+ },
878
+ "value-invalid": {
879
+ group: "wrong-value",
880
+ rule: "Each spec field has a defined value form.",
881
+ guides: [RECIPES],
882
+ message: (failure) => `${failure.construction} spec: ${failure.path} must be ${failure.expected}.`,
883
+ repair: "Change the value to the expected form."
884
+ },
885
+ "parts-unsupported": {
886
+ group: "unsupported",
887
+ rule: "A construction kind supports a fixed set of part shapes.",
888
+ guides: [RECIPES],
889
+ message: (failure) => `${failure.construction} spec: parts are not supported (${failure.detail}).`,
890
+ repair: "Declare only the parts this construction kind supports."
891
+ },
892
+ "condition-unsupported": {
893
+ group: "wrong-value",
894
+ rule: "A `when` condition selects a state of the owner's root: `&` followed by interaction or form pseudo-classes (:hover, :active, :focus, :focus-visible, :focus-within, :disabled, :enabled, :checked, :indeterminate), `[aria-*]`, `[data-*]` or `[open]` attributes with an optional quoted value, each optionally inside :not(). Pseudo-elements, combinators, classes and other selectors are not states.",
895
+ guides: [RECIPES],
896
+ message: (failure) => `${failure.construction} spec: condition ${failure.condition} at ${failure.path} ${conditionProblem(failure.problem)}.`,
897
+ repair: "Write the condition as owner states only. Style a pseudo-element with the part's `pseudo` treatment (for example `pseudo: { placeholder: { surface } }`), and a child through its own part."
898
+ },
899
+ "accessibility-declaration-invalid": {
900
+ group: "wrong-value",
901
+ rule: 'A text-entry control\'s `accessibility` declaration names how it is identified other than by a 3:1 boundary (WCAG 1.4.11) with a closed `boundary` kind, `"visible-label"` or `"boundary-on-interaction"`, and a concrete `reason` of 20\u2013300 characters. Placeholder text, a soft fill below 3:1 and a free-form design choice are not identification.',
902
+ guides: [RECIPES, "ads://guides/accessibility"],
903
+ message: (failure) => failure.problem === "boundary" ? `${failure.construction} spec: ${failure.path} must be "visible-label" or "boundary-on-interaction".` : `${failure.construction} spec: ${failure.path} must say concretely, in 20\u2013300 characters, how the field is identified in this design.`,
904
+ repair: "First make the control pass (a 3:1 fill, or one 3:1 border side such as a soft field's underline). Only with the user's explicit approval, declare a supported boundary kind and a concrete reason."
905
+ },
906
+ "accessibility-declaration-unsupported": {
907
+ group: "unsupported",
908
+ rule: 'An `accessibility` declaration is allowed only on a text-entry control part (`frame: "control"`): buttons, links, tabs, icon-only controls, checkboxes, radios, switches and sliders are identified by their content or need their own 3:1 boundary.',
909
+ guides: [RECIPES, "ads://guides/accessibility"],
910
+ message: (failure) => `${failure.construction} spec: ${failure.path} is allowed only on a text-entry control part (frame: "control").`,
911
+ repair: "Remove the declaration, and give the control a 3:1 boundary or fill."
912
+ }
913
+ };
914
+ function conditionProblem(problem) {
915
+ switch (problem.kind) {
916
+ case "owner-missing":
917
+ return "does not start with `&`, the owner root";
918
+ case "state-missing":
919
+ return "names no state";
920
+ case "pseudo-element":
921
+ return `selects the pseudo-element ::${problem.name}, which is not a state of the owner`;
922
+ case "pseudo-class-unsupported":
923
+ return /^(?:user-invalid|user-valid|invalid|valid|autofill|-webkit-autofill)$/i.test(problem.name) ? `uses :${problem.name}, which matches the field's input, not the owner root; select the form-field bridge's root state ([data-user-invalid], [data-user-valid] or [data-autofill]) instead` : `uses :${problem.name}, which is not a supported owner state`;
924
+ case "attribute-unsupported":
925
+ return `tests the attribute ${problem.name || "(unnamed)"}; only aria-*, data-* and open are owner states`;
926
+ case "structure":
927
+ return `has ${problem.text} at offset ${problem.at}, which is not an owner state (a combinator, class, type, nested & or attribute operator)`;
928
+ case "state-repeated":
929
+ return `repeats ${problem.state}`;
930
+ }
931
+ }
932
+ export const constructionErrors = {
933
+ "profile-kind": {
934
+ group: "wrong-value",
935
+ rule: "A construction references a profile of the kind its field requires.",
936
+ guides: [RECIPES],
937
+ message: (failure) => `${failure.reference} is a ${failure.actual} profile; a ${failure.expected} profile is required.`,
938
+ repair: "Reference a profile of the required kind."
939
+ },
940
+ "profile-field-missing": {
941
+ group: "unresolved-reference",
942
+ rule: "A construction reads only fields its profile defines.",
943
+ guides: [RECIPES],
944
+ message: (failure) => `Profile ${failure.profile} has no field ${failure.field}.`,
945
+ repair: "Add the field to the profile, or reference a profile that defines it."
946
+ },
947
+ "profile-field-unsupported": {
948
+ group: "wrong-value",
949
+ rule: "A profile field holds a value the construction can lower.",
950
+ guides: [RECIPES],
951
+ message: (failure) => `Profile ${failure.profile}.${failure.field} has unsupported value ${failure.value}.`,
952
+ repair: "Use a value this construction can lower."
953
+ },
954
+ "content-missing": {
955
+ group: "structure-mismatch",
956
+ rule: "A control renders text or artwork in every reachable choice, so it is never empty.",
957
+ guides: [RECIPES, "ads://guides/accessibility"],
958
+ message: () => "A control renders neither text nor artwork in some reachable choice.",
959
+ repair: "Give every choice a text part or an artwork part."
960
+ },
961
+ "profile-provider-conflict": {
962
+ group: "conflict",
963
+ rule: "Each profile field has one provider; input order never picks a winner.",
964
+ guides: [RECIPES],
965
+ message: (failure) => `Field ${failure.field} is supplied by both ${failure.providers[0]} and ${failure.providers[1]}.`,
966
+ repair: "Supply the field once: remove the explicit treatment or the slot provider."
967
+ },
968
+ "parts-visual-repeated": {
969
+ group: "structure-mismatch",
970
+ rule: "A construction declares at most one visual part.",
971
+ guides: [RECIPES],
972
+ message: () => "The construction declares more than one visual part.",
973
+ repair: "Declare a single visual part."
974
+ },
975
+ "artwork-binding-missing": {
976
+ group: "structure-mismatch",
977
+ rule: "An artwork construction binds its visual part to a declared asset.",
978
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
979
+ message: () => "An artwork construction has no asset binding.",
980
+ repair: "Bind the visual part to a declared asset."
981
+ },
982
+ "paint-unsupported": {
983
+ group: "wrong-value",
984
+ rule: "Artwork is painted only through channels its asset declares.",
985
+ guides: ["ads://guides/pictograms", "ads://guides/contracts"],
986
+ message: (failure) => `Asset ${failure.asset} does not support paint ${failure.paint}.`,
987
+ repair: "Use a paint channel the asset declares, or declare the channel on the asset."
988
+ },
989
+ "spatial-token-expected": {
990
+ group: "design-bypass",
991
+ rule: "Spatial values come from spatial tokens, not literal lengths.",
992
+ guides: ["ads://guides/layout", "ads://guides/tokens"],
993
+ message: (failure) => `${failure.value} is not a spatial token.`,
994
+ repair: "Use a spatial token from the design foundation."
995
+ },
996
+ "spatial-bound-unit": {
997
+ group: "wrong-value",
998
+ rule: "A breakpoint or named condition bound is a media or container query bound and is authored in rem or em, which follow the reader's text size; ADS writes it as authored and never converts px.",
999
+ guides: ["ads://guides/layout", "ads://guides/tokens"],
1000
+ message: (failure) => `Condition bound ${failure.token} is ${failure.value}; a query bound must be in rem or em.`,
1001
+ repair: "Write the token in rem (divide the px value by 16)."
1002
+ },
1003
+ "spatial-clause-unsupported": {
1004
+ group: "unsupported",
1005
+ rule: "Layouts are expressed with the supported spatial clauses.",
1006
+ guides: ["ads://guides/layout"],
1007
+ message: (failure) => `Spatial clause ${failure.clause} is not supported.`,
1008
+ repair: "Express the layout with the supported spatial clauses."
1009
+ },
1010
+ "drawn-height-unevaluable": {
1011
+ group: "unanalyzable",
1012
+ rule: "Artwork size resolves to a fixed length at the reference root, so its minimum drawn height can be checked.",
1013
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
1014
+ message: (failure) => `The drawn height of size ${failure.size} cannot be evaluated.`,
1015
+ repair: "Size the artwork with tokens that resolve to fixed lengths at the reference root."
1016
+ },
1017
+ "drawn-height-below-minimum": {
1018
+ group: "wrong-value",
1019
+ rule: "Artwork is never drawn below the minimum height its asset declares.",
1020
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
1021
+ message: (failure) => `Asset ${failure.asset} is drawn at ${failure.drawnPx}px, below its minimum ${failure.minimumPx}px.`,
1022
+ repair: "Increase the size token used for the artwork, or choose an asset whose minimum fits."
1023
+ },
1024
+ "paint-transition-redundant": {
1025
+ group: "wrong-value",
1026
+ rule: "A paint transition names only channels that change: each differs between the element's base surface and at least one of its state surfaces.",
1027
+ guides: [RECIPES],
1028
+ message: (failure) => `The paint transition on ${failure.element} names ${failure.channel}, which none of its state surfaces changes.`,
1029
+ repair: "Remove the channel from `paintTransition.channels`, or give a state surface a different value for it."
1030
+ },
1031
+ "paint-transition-effect-unsupported": {
1032
+ group: "unsupported",
1033
+ rule: "An element that transitions paints has only paint surfaces: a gradient image or blur would change without interpolating while its paints transition.",
1034
+ guides: [RECIPES],
1035
+ message: (failure) => `The paint transition on ${failure.element} uses surface ${failure.surface}, whose ${failure.field} does not interpolate.`,
1036
+ repair: "Use solid paint surfaces on a transitioned element, or remove its paint transition."
1037
+ },
1038
+ "pseudo-surface-unsupported": {
1039
+ group: "wrong-value",
1040
+ rule: "A pseudo-element surface sets exactly one field, its text colour: backgrounds, borders and effects of a placeholder are not supported.",
1041
+ guides: [RECIPES],
1042
+ message: (failure) => failure.field === null ? `Surface ${failure.surface} on ::${failure.pseudo} sets no colour.` : `Surface ${failure.surface} on ::${failure.pseudo} sets ${failure.field}; only color is supported.`,
1043
+ repair: "Treat the pseudo-element with a colour-only surface profile (for example one with just `color`)."
1044
+ },
1045
+ "placeholder-contrast-insufficient": {
1046
+ group: "accessibility-semantics",
1047
+ rule: "Placeholder text has at least 4.5:1 contrast against its part's background in every theme, brand and state (WCAG 1.4.3).",
1048
+ guides: [RECIPES, "ads://guides/accessibility", "ads://guides/tokens"],
1049
+ message: (failure) => `The placeholder of part "${failure.part}" has contrast ${failure.ratio}:1 (minimum ${failure.minimum}:1) in ${failure.context}, placeholder state ${failure.states[0] ?? "base"}, background state ${failure.states[1] ?? "base"}.`,
1050
+ repair: "Choose a placeholder surface whose colour token contrasts enough with the part's background in that context, or adjust the token's value there."
1051
+ },
1052
+ "placeholder-contrast-unresolved": {
1053
+ group: "unanalyzable",
1054
+ rule: "Placeholder contrast is proven from tokens: the placeholder colour and the part's own background resolve to opaque colours in every theme, brand and state.",
1055
+ guides: [RECIPES, "ads://guides/accessibility", "ads://guides/tokens"],
1056
+ message: (failure) => `The placeholder contrast of part "${failure.part}" cannot be proven in ${failure.context} (placeholder state ${failure.states[0] ?? "base"}, background state ${failure.states[1] ?? "base"}): ${failure.reason}.`,
1057
+ repair: "Give the part a surface with an opaque background colour token, and a placeholder colour that resolves to a colour token in every context."
1058
+ },
1059
+ "inactive-surface-active": {
1060
+ group: "accessibility-semantics",
1061
+ rule: 'A surface profile declaring `state: "inactive"` paints a disabled control: it has no contrast minimum (WCAG 2.2 1.4.3 exempts inactive components), so a construction selects it only under an inactive owner state (`:disabled`, `[aria-disabled="true"]`), never at rest or under another state.',
1062
+ guides: [RECIPES, "ads://guides/accessibility"],
1063
+ message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} selects inactive surface ${failure.surface} ${failure.condition === null ? "at rest" : `under ${failure.condition}`}, where the element is active.`,
1064
+ repair: 'Select it under `&:disabled` or `&[aria-disabled="true"]`, or use a surface without `state: "inactive"` (which is held to the contrast minimum).'
1065
+ },
1066
+ "state-contrast-insufficient": {
1067
+ group: "accessibility-semantics",
1068
+ rule: `An element's owner states keep its text readable: where a state's colour meets a background from another surface profile (a colour-only state over the base fill, a state fill under the base colour), the pair has at least 4.5:1 contrast in every theme, brand and condition, or 3:1 where the element's text profile makes its text large there (at least 24px, or 18.66px at weight 700); a state that holds only while the element is inactive (:disabled, [aria-disabled="true"]) has no minimum (WCAG 2.2 1.4.3).`,
1069
+ guides: [RECIPES, "ads://guides/accessibility", "ads://guides/tokens"],
1070
+ message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} pairs colour ${failure.foreground} (${failure.surfaces[0]}, state ${failure.states[0] ?? "base"}) with background ${failure.background} (${failure.surfaces[1]}, state ${failure.states[1] ?? "base"}) at ${failure.ratio}:1 under ${failure.context}; text needs ${failure.minimum}:1.`,
1071
+ repair: "Treat the state with a surface that sets both its colour and background, or choose colour and background tokens that contrast in that context."
1072
+ },
1073
+ "target-size-below-minimum": {
1074
+ group: "accessibility-semantics",
1075
+ rule: 'Every control construction and `frame: "control"` part is a pointer target of at least 24 \xD7 24 CSS px in every theme, brand and condition (WCAG 2.2 2.5.8), computed from its lowered box: min block = max(min-block-size, content + 2 (inset + border)), inline = 2 (padding-inline + border) + content; an enlarged hit area (min-target-inline-size, min-target-block-size) counts. Relative lengths are evaluated at the 16px reference root.',
1076
+ guides: [RECIPES, "ads://guides/accessibility", "ads://guides/tokens"],
1077
+ message: (failure) => `${failure.element === "&" ? "The control" : `Part "${failure.element}"`} is ${failure.size.inlineExact ? "" : "at least "}${pixels(failure.size.inlinePx)} wide and ${pixels(failure.size.blockPx)} tall under ${contextNames(failure.contexts)}, ${[
1078
+ ...failure.size.inlineExact && failure.size.inlinePx < failure.minimumPx ? [`${pixels(failure.minimumPx - failure.size.inlinePx)} short inline`] : [],
1079
+ ...failure.size.blockPx < failure.minimumPx ? [`${pixels(failure.minimumPx - failure.size.blockPx)} short on the block axis`] : []
1080
+ ].join(" and ")}; a pointer target needs ${pixels(failure.minimumPx)} \xD7 ${pixels(failure.minimumPx)}.`,
1081
+ repair: "Raise the frame profile's min-block-size, padding-inline or the visual size in that context, or give the frame a min-target-inline-size / min-target-block-size hit area of at least 24px."
1082
+ },
1083
+ "non-text-contrast-insufficient": {
1084
+ group: "accessibility-semantics",
1085
+ rule: "A control part inside a known surface keeps its boundary and focus visible (WCAG 2.2 1.4.11): where its own background does not reach 3:1 against the enclosing background, its border colour (base and each owner state) does; its focus outline colour reaches 3:1 against what it sits on (the enclosing background outside the box, its own inside), in every theme, brand and condition.",
1086
+ guides: [RECIPES, "ads://guides/accessibility", "ads://guides/tokens"],
1087
+ message: (failure) => `Part "${failure.element}" paints its ${failure.paint === "border" ? "border" : "focus outline"}${failure.state === null ? "" : ` (state ${failure.state})`} ${failure.foreground} on ${failure.background} at ${failure.ratio}:1 under ${failure.context}; it needs ${failure.minimum}:1.`,
1088
+ repair: "Choose a border or focus colour token that reaches 3:1 against the surrounding background in that context, or give the control a background that does."
1089
+ },
1090
+ "accessibility-declaration-unmet": {
1091
+ group: "accessibility-semantics",
1092
+ rule: 'An `accessibility` declaration is verified where ADS can: `"boundary-on-interaction"` needs a hover treatment of the control part whose border, drawn at the frame\'s width, reaches 3:1 against the surroundings in every context (the focus outline is held to 3:1 as always); `"visible-label"` needs a programmatically associated, rendered label (checked by the render audit).',
1093
+ guides: [RECIPES, "ads://guides/accessibility"],
1094
+ message: (failure) => `Part "${failure.element}" declares accessibility boundary "${failure.boundary}", but ${failure.detail}.`,
1095
+ repair: "Make the declared identification real (a hover border at 3:1, a visible associated label), or remove the declaration and give the control a 3:1 boundary or fill."
1096
+ },
1097
+ "target-area-overlap": {
1098
+ group: "accessibility-semantics",
1099
+ rule: "The enlarged hit areas of neighbouring targets in a stack or inline arrangement do not overlap across their gap in any context: a press there would reach two targets (WCAG 2.2 2.5.8).",
1100
+ guides: [RECIPES, "ads://guides/accessibility"],
1101
+ message: (failure) => `The hit areas of parts "${failure.elements[0]}" and "${failure.elements[1]}" overlap by ${pixels(failure.overlapPx)} across their ${failure.axis} gap under ${contextNames(failure.contexts)}.`,
1102
+ repair: "Widen the arrangement's gap to at least the hit areas' reach beyond the two boxes, or reduce the min-target sizes."
1103
+ },
1104
+ "layer-root-padding": {
1105
+ group: "conflict",
1106
+ rule: "A modal sheet dismissed by a backdrop press has no padding on its root: a press whose target is the dialog itself must lie outside its content.",
1107
+ guides: [RECIPES],
1108
+ message: (failure) => `The modal sheet closes on a backdrop press, but its root sets ${failure.property}: ${failure.value}.`,
1109
+ repair: 'Move the padding to an owned child of the sheet (a body or bar element with its own frame), or declare `backdrop.dismiss: "none"`.'
1110
+ },
1111
+ "layer-frame-position": {
1112
+ group: "conflict",
1113
+ rule: "A top-layer root is placed by its layer clause alone: its frame and normalization write no position, inset, margin or z-index.",
1114
+ guides: [RECIPES],
1115
+ message: (failure) => `The top-layer root also writes ${failure.property}, which its layer clause owns.`,
1116
+ repair: "Remove that field from the root's frame or normalization; the layer clause places the root and resets its margin."
1117
+ },
1118
+ "layer-tier-unknown": {
1119
+ group: "unresolved-reference",
1120
+ rule: "A modal sheet's `modalBelow` names a breakpoint tier of the spatial profile its recipe selects.",
1121
+ guides: [RECIPES, "ads://guides/layout"],
1122
+ message: (failure) => failure.spatial === null ? `modalBelow names tier "${failure.tier}", but the recipe selects no spatial profile.` : `modalBelow names tier "${failure.tier}", which spatial profile ${failure.spatial} does not declare.`,
1123
+ repair: "Select the spatial profile whose tiers the owner's layout uses (a composite's `spatialProfile`), and name one of its breakpoints."
1124
+ },
1125
+ "layer-clearance-unbounded": {
1126
+ group: "wrong-value",
1127
+ rule: "A layer clears a block-start region by a fixed length: `clear-block-start` resolves to a px, rem or em layout size.",
1128
+ guides: [RECIPES, "ads://guides/tokens"],
1129
+ message: (failure) => `clear-block-start ${failure.token} does not resolve to a fixed length${failure.value === null ? "" : ` (${failure.value})`}.`,
1130
+ repair: 'Give the cleared region a fixed block size token and clear by it, or declare `clear: "none"` and let the panel cover that region.'
1131
+ },
1132
+ "backdrop-surface-unsupported": {
1133
+ group: "wrong-value",
1134
+ rule: "A modal sheet's backdrop surface sets exactly one field, its background paint.",
1135
+ guides: [RECIPES],
1136
+ message: (failure) => failure.field === null ? `Backdrop surface ${failure.surface} sets no background.` : `Backdrop surface ${failure.surface} sets ${failure.field}; only background is supported on ::backdrop.`,
1137
+ repair: "Paint the backdrop with a background-only surface profile (a scrim)."
1138
+ },
1139
+ "overlay-layer-missing": {
1140
+ group: "unresolved-reference",
1141
+ rule: "A grid cell that covers other cells stacks by its spatial profile's `overlay-layer`.",
1142
+ guides: ["ads://guides/layout"],
1143
+ message: (failure) => `Cell ${failure.cell} overlays the grid, but spatial profile ${failure.spatial} declares no overlay-layer.`,
1144
+ repair: "Declare `overlayLayer` (a layer token) on the spatial profile the grid selects."
1145
+ },
1146
+ "grid-context-invalid": {
1147
+ group: "wrong-value",
1148
+ rule: "A grid's algebra holds in every theme, brand and condition context, like contrast and target size: a context that changes a margin, gutter, maximum width or fixed track the grid reads must still leave content width, fluid space and cells wider than their gutter insets at every breakpoint.",
1149
+ guides: ["ads://guides/layout", "ads://guides/tokens"],
1150
+ message: (failure) => `The grid on spatial profile ${failure.spatial} does not hold under ${failure.contexts.length === 1 ? failure.contexts[0] ?? "" : `${failure.contexts[0] ?? ""} (and ${failure.contexts.length - 1} more context${failure.contexts.length === 2 ? "" : "s"})`}: ${failure.rejection.message.replace(/^ADS spatial: /, "")}`,
1151
+ repair: "Change the named context's token value so the grid fits there too, or the grid's columns, bound or placement."
1152
+ },
1153
+ "frame-field-conflict": {
1154
+ group: "conflict",
1155
+ rule: "A frame profile sets its insets once: `padding` on every side, or `padding-inline` and `padding-block` per axis, never both.",
1156
+ guides: [RECIPES],
1157
+ message: (failure) => `The frame profile sets both ${failure.fields[0]} and ${failure.fields[1]}.`,
1158
+ repair: "Keep `padding` for equal insets, or replace it with `paddingInline` and `paddingBlock` for asymmetric ones."
1159
+ },
1160
+ "rule-width-missing": {
1161
+ group: "unresolved-reference",
1162
+ rule: "One-sided frame rules take their width from the frame profile's `border-width`.",
1163
+ guides: [RECIPES],
1164
+ message: (failure) => failure.frame === null ? "The frame declares rules, but the recipe selects no frame profile." : `The frame declares rules, but frame profile ${failure.frame} has no border-width.`,
1165
+ repair: "Give the recipe's frame profile a `borderWidth` (a border-width token), or remove `rules`."
1166
+ },
1167
+ "rule-paint-missing": {
1168
+ group: "unresolved-reference",
1169
+ rule: "One-sided frame rules are painted by the element's surface `border-color`.",
1170
+ guides: [RECIPES],
1171
+ message: (failure) => failure.surface === null ? "The frame declares rules, but the element has no surface." : `The frame declares rules, but surface ${failure.surface} has no border-color.`,
1172
+ repair: "Give the element a surface whose profile sets `borderColor`."
1173
+ },
1174
+ "extent-conflict": {
1175
+ group: "conflict",
1176
+ rule: "Each property of an element has one provider: fill, scrolling, truncation, reserved lines and a frame never write the same property differently.",
1177
+ guides: [RECIPES, "ads://guides/layout"],
1178
+ message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} writes ${failure.property} from both ${failure.providers[0]} and ${failure.providers[1]}.`,
1179
+ repair: "Keep one of the two constructs on this element, or move one to a wrapping part (a scrolling container around truncated text, say)."
1180
+ },
1181
+ "extent-parent-unsupported": {
1182
+ group: "unsupported",
1183
+ rule: "A part fills its parent's main axis only in a `stack` or `inline` arrangement; a layered part already fills its area, and grids place cells.",
1184
+ guides: [RECIPES, "ads://guides/layout"],
1185
+ message: (failure) => `Part "${failure.part}" declares extent fill, but its parent's layout is ${failure.layout}.`,
1186
+ repair: "Arrange the parent as a stack or inline, or remove `extent` (use grid rows `fill` for a grid cell)."
1187
+ },
1188
+ "extent-row-hugs": {
1189
+ group: "structure-mismatch",
1190
+ rule: 'An inline row is as wide as its content unless its recipe declares `extent: "container"`; a part can fill only a row that takes its container\'s width.',
1191
+ guides: [RECIPES, "ads://guides/layout"],
1192
+ message: (failure) => `Part "${failure.part}" fills its row, but the row is as wide as its content: there is nothing to fill, and the row cannot shrink below its content in a narrow container.`,
1193
+ repair: "Declare `extent: \"container\"` on the row's recipe so it takes its container's width, or remove the part's `extent`."
1194
+ },
1195
+ "layered-parts-missing": {
1196
+ group: "structure-mismatch",
1197
+ rule: "A layered arrangement stacks at least two declared parts in one area.",
1198
+ guides: [RECIPES, "ads://guides/layout"],
1199
+ message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} is layered but declares ${failure.parts} part(s).`,
1200
+ repair: "Declare each layer as a part of the layered element, or use another layout."
1201
+ },
1202
+ "condition-unknown": {
1203
+ group: "unresolved-reference",
1204
+ rule: "A part's `at` names a condition of the spatial profile its nearest recipe selects.",
1205
+ guides: [RECIPES, "ads://guides/layout"],
1206
+ message: (failure) => failure.spatial === null ? `Part "${failure.part}" names condition "${failure.condition}", but its recipe selects no spatial profile.` : `Part "${failure.part}" names condition "${failure.condition}", which spatial profile ${failure.spatial} does not declare.`,
1207
+ repair: "Select a spatial profile (a composite's `spatialProfile`) that declares the condition, or name one it declares."
1208
+ },
1209
+ "condition-hides-required": {
1210
+ group: "conflict",
1211
+ rule: "A required part renders in every choice and every viewport; only an optional part may be hidden under a condition.",
1212
+ guides: [RECIPES],
1213
+ message: (failure) => `Required part "${failure.part}" is hidden while condition "${failure.condition}" holds.`,
1214
+ repair: "Declare the part `required: false`, or keep it visible under the condition."
1215
+ },
1216
+ "reserve-without-text": {
1217
+ group: "structure-mismatch",
1218
+ rule: "`reserveLines` reserves lines of the part's own text profile, so the part has one.",
1219
+ guides: [RECIPES],
1220
+ message: (failure) => `Part "${failure.part}" reserves lines but has no text profile.`,
1221
+ repair: "Make the part a text part (with a text slot or `text` profile), or remove `reserveLines`."
1222
+ },
1223
+ "element-normalization-conflict": {
1224
+ group: "conflict",
1225
+ rule: "A declared native element's normalization (an iframe's border, a list's markers) is not also set by its frame, surface or text.",
1226
+ guides: [RECIPES],
1227
+ message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} normalizes ${failure.property}, which its treatment also writes.`,
1228
+ repair: "Remove that field from the element's frame or surface (an iframe takes no border; frame its wrapper instead)."
1229
+ },
1230
+ "vector-surface-unsupported": {
1231
+ group: "wrong-value",
1232
+ rule: "A vector part's surface sets exactly one field, its stroke `color`.",
1233
+ guides: [RECIPES, "ads://guides/pictograms"],
1234
+ message: (failure) => failure.field === null ? `Vector part "${failure.part}" has no colour from surface ${failure.surface || "(none)"}.` : `Vector part "${failure.part}" uses surface ${failure.surface}, which sets ${failure.field}.`,
1235
+ repair: "Give the vector part a colour-only surface profile."
1236
+ },
1237
+ "snap-without-scroll": {
1238
+ group: "structure-mismatch",
1239
+ rule: 'Scroll snap is declared by the arrangement of the element that scrolls on the snap axis (`overflow: "scroll-inline"` for inline, `"scroll-block"` for block, `"scroll-both"` for both); its children, which it places, snap. Elsewhere it has no effect.',
1240
+ guides: [RECIPES, "ads://guides/layout"],
1241
+ message: (failure) => `${failure.element === "&" ? "The root" : `Part "${failure.element}"`} snaps on ${failure.axis === "both" ? "both axes" : `the ${failure.axis} axis`} but ${failure.overflow.kind === "scroll" ? `scrolls only on its ${failure.overflow.axis} axis` : "does not scroll"}.`,
1242
+ repair: "Make the element scroll on the snap axis with `overflow` (`scroll-inline`, `scroll-block` or `scroll-both`), or move `snap` to the arrangement of the element that scrolls."
1243
+ },
1244
+ "cover-box-missing": {
1245
+ group: "structure-mismatch",
1246
+ rule: 'A cropped image (a visual part whose visual profile declares `fit: "cover"`) fills a box of its own: it is a top-level part of a region whose frame declares a `ratio` or whose frame profile fixes its `blockSize`. The frame has the shape; the image is cropped inside it.',
1247
+ guides: [RECIPES, "ads://guides/layout"],
1248
+ message: () => "The cropped image has no box to fill: its region's frame declares no ratio and no block size, or the part is nested in another part.",
1249
+ repair: 'Declare `frame: { ratio: "16 / 9" }` (a ratio the spatial profile permits) on the recipe whose top-level visual part crops, or use a visual profile with `fit: "contain"`.'
1250
+ },
1251
+ "cover-asset-unsupported": {
1252
+ group: "unsupported",
1253
+ rule: "Only application images and intrinsic artwork crop (`fit: \"cover\"`), around the image's own focal point (an asset's `opticalCenter`). A glyph or paint-slot asset (a logo) is never cropped.",
1254
+ guides: [RECIPES],
1255
+ message: (failure) => `Asset ${failure.asset} (paint ${failure.paint}) is bound to a visual profile with fit: "cover"; only intrinsic artwork crops.`,
1256
+ repair: 'Bind it to a visual profile with `fit: "contain"`.'
1257
+ },
1258
+ "measured-property-unsupported": {
1259
+ group: "unsupported",
1260
+ rule: 'A measured value sets one geometry property of its type\'s closed list: a `length` a logical inset or box size (inline/block size and their min/max) on a region root or top-level part, a `transform` `translate`, a `size-track` one track of a grid\'s own `grid-template-columns`/`-rows`. An `intrinsic-size` sets `inline-size` on a contained application image (`fit: "contain"`). A `position` sets `object-position` on a cropped application image (a visual part whose visual profile declares `fit: "cover"`). Padding, margin, gap, typography, borders, radius and paint are design values; a top-layer root is positioned by measured values only with `placement: "measured"`.',
1261
+ guides: [RECIPES, "ads://guides/layout"],
1262
+ message: (failure) => {
1263
+ const element = failure.element === "&" ? "the root" : `part "${failure.element}"`;
1264
+ switch (failure.reason) {
1265
+ case "outside-closed-list":
1266
+ return `Measured value "${failure.name}" (${failure.type}) on ${element} sets ${failure.property}, which a ${failure.type} value cannot set.`;
1267
+ case "host":
1268
+ return `Measured value "${failure.name}" (${failure.type}) cannot be declared on ${failure.type === "size-track" ? "a region; tracks belong to a grid" : "a grid; only its tracks are measured"}.`;
1269
+ case "layer-placement":
1270
+ return `Measured value "${failure.name}" positions the top-layer root (${failure.property}), which its layer clause places.`;
1271
+ case "track-unavailable":
1272
+ return `Measured track "${failure.name}" names a track the grid's ${failure.property} does not have in every tier.`;
1273
+ case "repeated":
1274
+ return `Measured value "${failure.name}" sets ${failure.property} on ${element}, which another measured value of it already sets.`;
1275
+ case "contain-missing":
1276
+ return `Measured value "${failure.name}" is an image's intrinsic size, but ${element} is not a contained application image (a visual part whose visual profile declares fit: "contain").`;
1277
+ case "cover-missing":
1278
+ return `Measured value "${failure.name}" is a focal position (${failure.property}), but ${element} is not a cropped application image (a visual part whose visual profile declares fit: "cover").`;
1279
+ }
1280
+ },
1281
+ repair: 'Measure a property of the closed list (`inset-*`, `inline-size`, `block-size` and their min/max, `translate`, a grid track that exists in every tier); declare `placement: "measured"` for an element-anchored popover; move design values to profiles.'
1282
+ },
1283
+ "measured-profile-conflict": {
1284
+ group: "conflict",
1285
+ rule: "A measured property is not also supplied by the element's profiles: profiles keep owning the frame's sizes, padding, typography and alignment.",
1286
+ guides: [RECIPES],
1287
+ message: (failure) => `Measured value "${failure.name}" sets ${failure.property} on ${failure.element === "&" ? "the root" : `part "${failure.element}"`}, which profile ${failure.profile} also supplies.`,
1288
+ repair: "Remove the field from the frame profile the element selects (or select one without it), or measure a different property; the profile value can become the measured value's `fallback`."
1289
+ },
1290
+ "measured-placement-missing": {
1291
+ group: "structure-mismatch",
1292
+ rule: 'A popover with `placement: "measured"` is anchored by the owner: its root declares at least one measured inset or `translate`.',
1293
+ guides: [RECIPES],
1294
+ message: () => "The popover is placed by measured values, but its root declares no measured inset or translate.",
1295
+ repair: 'Declare the measured position on the recipe root (`measured: { x: { type: "length", property: "inset-inline-start" }, y: { \u2026 "inset-block-start" } }`), or pin the popover to a viewport `corner`.'
1296
+ },
1297
+ "paint-property-unsupported": {
1298
+ group: "unsupported",
1299
+ rule: "A runtime paint sets one property of the closed paint list (`fill`, `stroke`, `color`, `background-color`, `border-color`), once per element: backgrounds as images, gradients, outlines and shadows are design values.",
1300
+ guides: [RECIPES, "ads://guides/tokens"],
1301
+ message: (failure) => {
1302
+ const element = failure.element === "&" ? "the root" : `part "${failure.element}"`;
1303
+ switch (failure.reason) {
1304
+ case "outside-closed-list":
1305
+ return `Runtime paint "${failure.name}" on ${element} sets ${failure.property}, which is not a paint property a runtime paint can set.`;
1306
+ case "repeated":
1307
+ return `Runtime paint "${failure.name}" sets ${failure.property} on ${element}, which another runtime paint of it already sets.`;
1308
+ }
1309
+ },
1310
+ repair: "Paint `fill`, `stroke`, `color`, `background-color` or `border-color`, one paint per property and element; keep other paint values in surface profiles."
1311
+ },
1312
+ "paint-value-role": {
1313
+ group: "wrong-value",
1314
+ rule: "A runtime paint's values (and its fallback) are paint-role tokens: never a raw colour, a URL or a token of another role.",
1315
+ guides: [RECIPES, "ads://guides/tokens"],
1316
+ message: (failure) => `Runtime paint "${failure.name}" on ${failure.element === "&" ? "the root" : `part "${failure.element}"`} lists ${failure.token}, which ${failure.role === null ? "is not a declared token" : `has role ${failure.role}, not paint`}.`,
1317
+ repair: "Declare the colour as a token in a `paint.ads.css` sheet (with its theme and brand values) and list that token."
1318
+ },
1319
+ "paint-profile-conflict": {
1320
+ group: "conflict",
1321
+ rule: "A runtime paint's property is not also supplied by the element's surface treatments (its base surface or an owner state's): profiles keep owning their paints.",
1322
+ guides: [RECIPES],
1323
+ message: (failure) => `Runtime paint "${failure.name}" sets ${failure.property} on ${failure.element === "&" ? "the root" : `part "${failure.element}"`}, which surface profile ${failure.profile} also supplies.`,
1324
+ repair: "Use a surface without that field on the element (a background-only surface under a `color` paint, say), or paint a different property."
1325
+ },
1326
+ "paint-contrast-insufficient": {
1327
+ group: "accessibility-semantics",
1328
+ rule: "Every declared value of a runtime paint keeps its contrast against the background the construction knows, in every theme, brand and owner state: a `color` paint 4.5:1 (3:1 for provably large text, WCAG 2.2 1.4.3); a `fill`, `stroke` or `border-color` paint, and a `background-color` paint against its enclosing background, 3:1 (1.4.11); text on a painted background its text minimum. The set is finite, so one failing value fails whichever value data selects.",
1329
+ guides: [RECIPES, "ads://guides/accessibility", "ads://guides/tokens"],
1330
+ message: (failure) => `Runtime paint "${failure.name}" (${failure.property}) on ${failure.element === "&" ? "the root" : `part "${failure.element}"`} paints ${failure.token} as ${failure.foreground} on ${failure.background}${failure.state === null ? "" : ` (state ${failure.state})`} at ${failure.ratio}:1 under ${failure.context}; it needs ${failure.minimum}:1.`,
1331
+ repair: "Adjust that token's value in the failing context, remove it from the paint's values, or place the element on a background it contrasts with."
1332
+ }
1333
+ }, loweringErrors = {
1334
+ emission: {
1335
+ group: "ads-defect",
1336
+ rule: "Lowering writes every declaration through ADS's emission boundary.",
1337
+ guides: ["ads://guides/evidence"],
1338
+ message: (failure) => `CSS emission failed: ${detail(failure.error)}`,
1339
+ repair: REPORT
1340
+ },
1341
+ hidden: {
1342
+ group: "ads-defect",
1343
+ rule: "ADS guards native `hidden` on owned elements it styles.",
1344
+ guides: ["ads://guides/evidence"],
1345
+ message: (failure) => `Hidden-target lowering failed: ${detail(failure.error)}`,
1346
+ repair: REPORT
1347
+ },
1348
+ motion: {
1349
+ group: "wrong-value",
1350
+ rule: "Motion is lowered from the motion profile fields the construction binds.",
1351
+ guides: ["ads://guides/performance", RECIPES],
1352
+ message: (failure) => `Motion lowering failed: ${detail(failure.error)}`,
1353
+ repair: "Check the motion profile fields the construction binds; report it if they are valid."
1354
+ },
1355
+ paint: {
1356
+ group: "wrong-value",
1357
+ rule: "A visual part binds only the paint channels its slot assets declare.",
1358
+ guides: ["ads://guides/pictograms", "ads://guides/contracts"],
1359
+ message: (failure) => `Paint channel lowering failed: ${detail(failure.error)}`,
1360
+ repair: "Check the asset's paint slots and the channels the part binds."
1361
+ },
1362
+ normalization: {
1363
+ group: "ads-defect",
1364
+ rule: "Lowered CSS normalizes to one canonical form.",
1365
+ guides: ["ads://guides/evidence"],
1366
+ message: (failure) => `CSS normalization failed: ${detail(failure.error)}`,
1367
+ repair: REPORT
1368
+ },
1369
+ "tree-unsupported": {
1370
+ group: "unsupported",
1371
+ rule: "Owner styling uses CSS constructs ADS can lower.",
1372
+ guides: ["ads://guides/atomic-styles"],
1373
+ message: (failure) => `${failure.operation} is not supported: ${failure.detail}.`,
1374
+ repair: "Rewrite the construct with supported styling, or report the missing support."
1375
+ },
1376
+ "tiers-unavailable": {
1377
+ group: "ads-defect",
1378
+ rule: "Every lowered property has a priority tier.",
1379
+ guides: ["ads://guides/evidence"],
1380
+ message: (failure) => failure.message,
1381
+ repair: REPORT
1382
+ }
1383
+ }, rejectionErrors = {
1384
+ "invalid-design": {
1385
+ group: "wrong-value",
1386
+ rule: "Declarations stay within the design language the model defines; its message names the rule.",
1387
+ guides: [RECIPES],
1388
+ repair: "Follow the rule the message names."
1389
+ },
1390
+ "redundant-design-declaration": {
1391
+ group: "conflict",
1392
+ rule: "A declaration states only what its default or input does not already provide.",
1393
+ guides: [RECIPES],
1394
+ repair: "Remove the declaration."
1395
+ },
1396
+ "profile-value-required": {
1397
+ group: "design-bypass",
1398
+ rule: "Owner design comes from a profile, not from literals or tokens written in place.",
1399
+ guides: [RECIPES, "ads://guides/tokens"],
1400
+ repair: "Take the value from a profile field."
1401
+ }
1402
+ }, foundationErrors = {
1403
+ "css-syntax": {
1404
+ group: "syntax",
1405
+ rule: "Every token sheet parses as CSS.",
1406
+ guides: ["ads://guides/tokens"],
1407
+ message: (failure) => `${failure.file}: ${failure.message}.`,
1408
+ repair: "Fix the CSS syntax at the reported position."
1409
+ },
1410
+ "declaration-rejected": {
1411
+ group: "wrong-value",
1412
+ rule: "Foundation declarations stay within the design language; the model's message names the rule.",
1413
+ guides: ["ads://guides/tokens", RECIPES],
1414
+ message: (failure) => `${failure.file}: ${failure.rejection.message}`,
1415
+ repair: "Correct the declaration as the message describes."
1416
+ },
1417
+ "profile-duplicate": {
1418
+ group: "conflict",
1419
+ rule: "Profile names are unique across the foundation.",
1420
+ guides: [RECIPES],
1421
+ message: (failure) => `Profile ${failure.name} is declared twice (${failure.file}).`,
1422
+ repair: "Give each profile a unique name, or merge the declarations."
1423
+ },
1424
+ "profile-rejected": {
1425
+ group: "wrong-value",
1426
+ rule: "Profiles stay within the design language; the model's message names the rule.",
1427
+ guides: [RECIPES],
1428
+ message: (failure) => `Profile ${failure.reference}: ${failure.rejection.message}`,
1429
+ repair: "Correct the profile as the message describes."
1430
+ },
1431
+ "profile-argument-default": {
1432
+ group: "conflict",
1433
+ rule: "A profile's slot reference selects only choices that differ from the referenced profile's defaults: the plain name already selects every default.",
1434
+ guides: [RECIPES],
1435
+ message: (failure) => `Profile ${failure.profile} selects ${failure.choice}: "${failure.option}" of ${failure.reference}, which is its default option.`,
1436
+ repair: "Remove the redundant selection (reference the profile by its plain name when no other choice remains)."
1437
+ },
1438
+ "profile-field-unknown": {
1439
+ group: "unresolved-reference",
1440
+ rule: "A profile declares only fields its kind has: a kind's token fields and policy fields, a composite's typed slots (textProfile, frameProfile, \u2026), a spatial clause's own fields. A misspelt field would otherwise be accepted and silently never read.",
1441
+ guides: [RECIPES, "ads://guides/tokens"],
1442
+ message: (failure) => `Profile ${failure.profile} (kind ${failure.profileKind}) declares ${failure.field}, which its kind does not have; its fields are ${list(failure.known)}.`,
1443
+ repair: "Correct the field's name to one the kind has, or move the value to a profile of the kind that owns it."
1444
+ },
1445
+ "token-role": {
1446
+ group: "wrong-value",
1447
+ rule: "A profile field references only tokens whose role its kind admits.",
1448
+ guides: ["ads://guides/tokens", RECIPES],
1449
+ message: (failure) => `${failure.profile}.${failure.field} references ${failure.token} (role ${failure.role ?? "none"}); expected ${list(failure.expected)}.`,
1450
+ repair: "Reference a token of an admitted role, or register the token under the right role."
1451
+ },
1452
+ "document-profile-kind": {
1453
+ group: "wrong-value",
1454
+ rule: "foundation.ads.ts's text names a text profile, its surface a surface profile and its focus a focus profile: they style the document and its default focus indicator.",
1455
+ guides: ["ads://guides/tokens", RECIPES],
1456
+ message: (failure) => `foundation.ads.ts's ${failure.field} names ${failure.reference}, a ${failure.actual} profile; it needs a ${failure.field} profile.`,
1457
+ repair: "Name a profile of the field's kind in foundation({ text, surface, focus }), or declare one with profile({ kind })."
1458
+ }
1459
+ };
1460
+ const FOUNDATION_CONTEXTS = `Declare themes ({ name, scheme: "light" | "dark" }) and brands ({ name }) in foundation.ads.ts's foundation({ ... }); the first of each is the default (the :root values).`;
1461
+ export const contextErrors = {
1462
+ "declaration-missing": {
1463
+ group: "project-files",
1464
+ rule: "A design system declares its foundation, themes and brands included, in foundation.ads.ts.",
1465
+ guides: ["ads://guides/tokens"],
1466
+ message: (failure) => `${failure.file} is missing: it declares the design system's themes and brands.`,
1467
+ repair: `Add foundation.ads.ts. ${FOUNDATION_CONTEXTS}`
1468
+ },
1469
+ "declaration-rejected": {
1470
+ group: "wrong-value",
1471
+ rule: "foundation.ads.ts is one literal foundation() declaration the design language accepts.",
1472
+ guides: ["ads://guides/tokens", RECIPES],
1473
+ message: (failure) => `${failure.file}: ${failure.rejection.message}`,
1474
+ repair: "Correct the foundation declaration as the message describes."
1475
+ },
1476
+ "list-invalid": {
1477
+ group: "wrong-value",
1478
+ rule: 'foundation() declares 1\u20138 themes, each { name, scheme } with a unique lowercase name and scheme "light" or "dark", and optionally up to 8 brands, each { name } with a unique lowercase name; followSystemTheme and sections are `true` or omitted.',
1479
+ guides: ["ads://guides/tokens", "ads://guides/branding"],
1480
+ message: (failure) => `${failure.file}: ${failure.problem.message}`,
1481
+ repair: `Correct the field the message names. ${FOUNDATION_CONTEXTS}`
1482
+ },
1483
+ "theme-undeclared": {
1484
+ group: "unresolved-reference",
1485
+ rule: 'Every theme a token sheet ([data-theme="<name>"]) or an asset variant (theme) names is declared in foundation.ads.ts themes.',
1486
+ guides: ["ads://guides/tokens"],
1487
+ message: (failure) => `${failure.reference.via === "token-sheet" ? "This token rule" : "This asset variant"} names theme "${failure.reference.name}", which foundation.ads.ts does not declare (themes: ${list(failure.declared)}).`,
1488
+ repair: "Correct the theme name, or declare the theme in foundation.ads.ts themes with its scheme."
1489
+ },
1490
+ "brand-undeclared": {
1491
+ group: "unresolved-reference",
1492
+ rule: 'Every brand a token sheet ([data-brand="<name>"]) names is declared in foundation.ads.ts brands.',
1493
+ guides: ["ads://guides/tokens", "ads://guides/branding"],
1494
+ message: (failure) => `This token rule names brand "${failure.reference.name}", which foundation.ads.ts does not declare (${failure.declared.length ? `brands: ${list(failure.declared)}` : "no brands"}).`,
1495
+ repair: "Correct the brand name, or declare the brand in foundation.ads.ts brands (the first brand is the default, on :root)."
1496
+ }
1497
+ }, assetErrors = {
1498
+ "name-duplicate": {
1499
+ group: "conflict",
1500
+ rule: "Asset names, asset aliases and glyph-set names share one namespace: each is declared once in the design system.",
1501
+ guides: ["ads://guides/pictograms", "ads://guides/branding"],
1502
+ message: (failure) => `"${failure.name}" is already declared in ${failure.declared.file}.`,
1503
+ repair: "Rename one of the declarations, or remove the repeated alias."
1504
+ },
1505
+ "set-member-unknown": {
1506
+ group: "unresolved-reference",
1507
+ rule: "A glyph set's members are declared assets, named by name or alias.",
1508
+ guides: ["ads://guides/pictograms"],
1509
+ message: (failure) => `Glyph set "${failure.set}" lists "${failure.member}", which no asset declares.`,
1510
+ repair: "Correct the member's name, or declare the asset with asset({ ... }) first."
1511
+ },
1512
+ "set-member-repeated": {
1513
+ group: "conflict",
1514
+ rule: "A glyph set lists each asset once; an alias of a member is a set alias, not a second member.",
1515
+ guides: ["ads://guides/pictograms"],
1516
+ message: (failure) => `Glyph set "${failure.set}" lists "${failure.member}", which is "${failure.asset}" again.`,
1517
+ repair: "Remove the repeated member; add the extra name to the set's aliases instead."
1518
+ },
1519
+ "set-alias-target": {
1520
+ group: "unresolved-reference",
1521
+ rule: "A glyph set's alias names one of the set's members, as written in members.",
1522
+ guides: ["ads://guides/pictograms"],
1523
+ message: (failure) => `Glyph set "${failure.set}" alias "${failure.alias}" names "${failure.target}", which is not one of its members.`,
1524
+ repair: "Point the alias at a member, or add the asset to members."
1525
+ },
1526
+ "set-alias-conflict": {
1527
+ group: "conflict",
1528
+ rule: "A glyph set's alias does not reuse a global asset name or alias for a different drawing.",
1529
+ guides: ["ads://guides/pictograms"],
1530
+ message: (failure) => `Glyph set "${failure.set}" alias "${failure.alias}" already names asset "${failure.asset}".`,
1531
+ repair: "Choose another alias, or point it at the asset the global name already means."
1532
+ },
1533
+ "set-member-paint": {
1534
+ group: "wrong-value",
1535
+ rule: `Glyph set members are foreground artwork (paint "foreground"): the owner's text colour paints every member alike.`,
1536
+ guides: ["ads://guides/pictograms"],
1537
+ message: (failure) => `Glyph set "${failure.set}" member "${failure.member}" has paint ${failure.paint}.`,
1538
+ repair: "Bind slot or intrinsic artwork by name in its own recipe; keep the set to foreground glyphs."
1539
+ },
1540
+ "set-grid-mixed": {
1541
+ group: "conflict",
1542
+ rule: "Glyph set members share one grid: one sizing, and at every size the same viewBox, optical center and minimum drawn height, so the set's construction does not depend on which member is drawn.",
1543
+ guides: ["ads://guides/pictograms"],
1544
+ message: (failure) => failure.member === failure.first ? `Glyph set "${failure.set}" member "${failure.member}" draws one size on different grids.` : `Glyph set "${failure.set}" member "${failure.member}" does not share the grid of "${failure.first}".`,
1545
+ repair: "Redraw the member on the set's viewBox and optical center, or keep it out of the set and bind it by name."
1546
+ }
1547
+ }, fontErrors = {
1548
+ "family-duplicate": {
1549
+ group: "conflict",
1550
+ rule: "Each font family is declared once in the design system, by one font() declaration; family names compare as CSS compares them (ASCII case-insensitively), and two families never share an emitted folder (fonts/<slug>).",
1551
+ guides: ["ads://guides/performance"],
1552
+ message: (failure) => failure.family === failure.first ? `Font family "${failure.family}" is already declared in ${failure.declared.file}.` : `Font family "${failure.family}" repeats "${failure.first}" (declared in ${failure.declared.file}): CSS matches family names case-insensitively, and both emit to one folder.`,
1553
+ repair: "Declare every face of the family in one font() declaration, or rename one family."
1554
+ }
1555
+ }, tokenCssErrors = {
1556
+ "token-missing": {
1557
+ group: "unresolved-reference",
1558
+ rule: "Every token referenced through var() is defined in the shared foundation. A token that only some themes or brands define is referenced with a var() fallback; a fallback does not excuse a token no context defines.",
1559
+ guides: ["ads://guides/tokens"],
1560
+ message: (failure) => failure.contexts === null ? `Token ${failure.token} is not defined in any context.` : `Token ${failure.token} is undefined under ${failure.contexts.join(", ")} and is referenced there without a fallback.`,
1561
+ repair: "Fix a mistyped reference, or define the token in the foundation; for a token only some themes or brands define, add a var() fallback or define it for the others."
1562
+ },
1563
+ "token-cyclic": {
1564
+ group: "conflict",
1565
+ rule: "Token definitions do not refer back to themselves through var(), in the base, any theme, any brand or any brand under a theme; a cycle makes every property in it invalid, so the browser silently uses initial values.",
1566
+ guides: ["ads://guides/tokens"],
1567
+ message: (failure) => `Tokens ${failure.cycle.join(" \u2192 ")} form a var() cycle under ${failure.context}.`,
1568
+ repair: "Point one token in the cycle at a value or a token outside it; a var() fallback does not break a cycle."
1569
+ },
1570
+ "quantum-context-dependent": {
1571
+ group: "unsupported",
1572
+ rule: "Grid quanta are invariant lengths so lengths can be folded at build time.",
1573
+ guides: ["ads://guides/layout", "ads://guides/tokens"],
1574
+ message: (failure) => `Grid quantum ${failure.token} depends on context and cannot be folded.`,
1575
+ repair: "Define the grid quantum as an invariant length (px) at :root."
1576
+ },
1577
+ "fold-unsupported": {
1578
+ group: "unsupported",
1579
+ rule: "Only invariant px lengths fold by a grid quantum.",
1580
+ guides: ["ads://guides/layout", "ads://guides/tokens"],
1581
+ message: (failure) => `${failure.length} cannot be folded by quantum ${failure.quantum}.`,
1582
+ repair: "Use px lengths that are multiples of the quantum, or express the size as a spatial token."
1583
+ }
1584
+ }, registrationErrors = {
1585
+ "anonymous-layer": {
1586
+ group: "conflict",
1587
+ rule: "Token CSS uses named layers; each anonymous layer is a distinct layer.",
1588
+ guides: ["ads://guides/tokens", "ads://guides/atomic-styles"],
1589
+ message: (failure) => `${failure.file}: token CSS creates an anonymous layer.`,
1590
+ repair: "Name the @layer, or remove it."
1591
+ },
1592
+ "css-invalid": {
1593
+ group: "syntax",
1594
+ rule: "Token CSS parses as valid CSS.",
1595
+ guides: ["ads://guides/tokens"],
1596
+ message: (failure) => `${failure.file}: ${failure.message}`,
1597
+ repair: "Fix the CSS syntax at the reported position."
1598
+ },
1599
+ "wrapper-unsupported": {
1600
+ group: "unsupported",
1601
+ rule: "@property registrations sit at the top level or inside @media, @supports or @layer.",
1602
+ guides: ["ads://guides/tokens", "ads://guides/atomic-styles"],
1603
+ message: (failure) => `${failure.file}: @property ${failure.name} is inside unsupported ${failure.wrapper}.`,
1604
+ repair: "Move the registration to the top level."
1605
+ },
1606
+ "token-undefined": {
1607
+ group: "unresolved-reference",
1608
+ rule: "An @property registration registers a defined token.",
1609
+ guides: ["ads://guides/tokens"],
1610
+ message: (failure) => `${failure.file}: @property ${failure.name} registers a token that is not defined.`,
1611
+ repair: "Define the token, or remove the registration."
1612
+ },
1613
+ "not-beside-token": {
1614
+ group: "conflict",
1615
+ rule: "A token is registered in the file that defines it, so the definition and its registration change together.",
1616
+ guides: ["ads://guides/tokens"],
1617
+ message: (failure) => `${failure.file}: @property ${failure.name} is registered away from its definition in ${failure.definedIn}.`,
1618
+ repair: "Move the registration into the file that defines the token."
1619
+ },
1620
+ duplicate: {
1621
+ group: "conflict",
1622
+ rule: "A token is registered once.",
1623
+ guides: ["ads://guides/tokens"],
1624
+ message: (failure) => `${failure.file}: @property ${failure.name} is registered twice.`,
1625
+ repair: "Keep one registration."
1626
+ },
1627
+ "role-unknown": {
1628
+ group: "unresolved-reference",
1629
+ rule: "Token files use only the declared token roles.",
1630
+ guides: ["ads://guides/tokens"],
1631
+ message: (failure) => `${failure.file}: role ${failure.role} is unknown.`,
1632
+ repair: "Use a declared token role."
1633
+ },
1634
+ "role-not-registrable": {
1635
+ group: "wrong-value",
1636
+ rule: "Only tokens of roles with a typed CSS syntax are registered with @property.",
1637
+ guides: ["ads://guides/tokens", "ads://guides/atomic-styles"],
1638
+ message: (failure) => `${failure.file}: ${failure.name} has role ${failure.role}, which cannot be registered (${failure.reason}).`,
1639
+ repair: "Remove the @property registration for this token."
1640
+ },
1641
+ "syntax-outside-role": {
1642
+ group: "wrong-value",
1643
+ rule: "A registration's syntax is one its token's role admits.",
1644
+ guides: ["ads://guides/tokens"],
1645
+ message: (failure) => `${failure.file}: @property ${failure.name} syntax does not fit its role: ${detail(failure.problem)}.`,
1646
+ repair: "Use the syntax the token's role admits."
1647
+ },
1648
+ "not-inherited": {
1649
+ group: "wrong-value",
1650
+ rule: "Registered design tokens inherit, so themes and brands cascade to descendants.",
1651
+ guides: ["ads://guides/tokens"],
1652
+ message: (failure) => `${failure.file}: @property ${failure.name} is not inherited.`,
1653
+ repair: "Set `inherits: true`."
1654
+ },
1655
+ "initial-out-of-bounds": {
1656
+ group: "wrong-value",
1657
+ rule: "A registration's initial value lies within its role's bounds.",
1658
+ guides: ["ads://guides/tokens"],
1659
+ message: (failure) => `${failure.file}: initial value ${failure.value} of ${failure.name} is outside its role's bounds.`,
1660
+ repair: "Choose an initial value within the role's range."
1661
+ },
1662
+ "alias-definition": {
1663
+ group: "conflict",
1664
+ rule: "A registered token is defined by a concrete value, not as an alias of another token.",
1665
+ guides: ["ads://guides/tokens"],
1666
+ message: (failure) => `${failure.file}: registered ${failure.name} is defined as alias ${failure.value}.`,
1667
+ repair: "Define it with a concrete value, or remove the registration."
1668
+ },
1669
+ "definition-mismatch": {
1670
+ group: "conflict",
1671
+ rule: "A registered token's :root definition equals its registered initial value.",
1672
+ guides: ["ads://guides/tokens"],
1673
+ message: (failure) => `${failure.file}: definition ${failure.value} of ${failure.name} differs from its registered initial value.`,
1674
+ repair: "Make the :root definition and the @property initial-value equal."
1675
+ },
1676
+ "definition-out-of-bounds": {
1677
+ group: "wrong-value",
1678
+ rule: "A token's definition lies within its role's bounds.",
1679
+ guides: ["ads://guides/tokens"],
1680
+ message: (failure) => `${failure.file}: definition ${failure.value} of ${failure.name} is outside its role's bounds.`,
1681
+ repair: "Choose a value within the role's range."
1682
+ }
1683
+ }, compileErrors = {
1684
+ "origin-missing": {
1685
+ group: "ads-defect",
1686
+ rule: "Every compiled construction keeps its source origin.",
1687
+ guides: ["ads://guides/evidence"],
1688
+ message: (failure) => `${failure.owner}: construction ${failure.id} has no source origin.`,
1689
+ repair: REPORT
1690
+ },
1691
+ "construction-conflict": {
1692
+ group: "ads-defect",
1693
+ rule: "One construction identity lowers to the same CSS in every owner.",
1694
+ guides: ["ads://guides/evidence"],
1695
+ message: (failure) => `Construction ${failure.id} lowers to different CSS in ${failure.owners[0]} and ${failure.owners[1]}.`,
1696
+ repair: REPORT
1697
+ },
1698
+ "keyframes-unreferenced": {
1699
+ group: "ads-defect",
1700
+ rule: "A construction retains only keyframes it uses.",
1701
+ guides: ["ads://guides/evidence"],
1702
+ message: (failure) => `Construction ${failure.id} retains keyframes ${failure.name} it does not use.`,
1703
+ repair: REPORT
1704
+ },
1705
+ "keyframes-missing": {
1706
+ group: "ads-defect",
1707
+ rule: "Every keyframes a construction references is emitted with it.",
1708
+ guides: ["ads://guides/evidence"],
1709
+ message: (failure) => `Construction ${failure.id} references keyframes ${failure.name} that were not emitted.`,
1710
+ repair: REPORT
1711
+ }
1712
+ }, extractionErrors = {
1713
+ "css-syntax": {
1714
+ group: "syntax",
1715
+ rule: "A construction's CSS parses as valid CSS.",
1716
+ guides: ["ads://guides/atomic-styles"],
1717
+ message: (failure) => `${failure.id}: ${failure.message}`,
1718
+ repair: "Fix the CSS the construction produces at the reported position."
1719
+ },
1720
+ "processor-threw": {
1721
+ group: "ads-defect",
1722
+ rule: "The CSS processor completes for valid construction CSS.",
1723
+ guides: ["ads://guides/evidence"],
1724
+ message: (failure) => `${failure.id}: CSS processor failed: ${failure.message}`,
1725
+ repair: REPORT
1726
+ },
1727
+ "preparation-rejected": {
1728
+ group: "boundary",
1729
+ rule: "Registrations (@property, @layer order) live in token CSS, not in element styling.",
1730
+ guides: ["ads://guides/atomic-styles", "ads://guides/tokens"],
1731
+ message: (failure) => `${failure.id}: ${failure.message}`,
1732
+ repair: "Move the registration out of element styling into token CSS."
1733
+ },
1734
+ "unexpected-host-request": {
1735
+ group: "ads-defect",
1736
+ rule: "The CSS processor uses only the capabilities ADS's adapter provides.",
1737
+ guides: ["ads://guides/evidence"],
1738
+ message: (failure) => `${failure.id}: the CSS processor requested ${detail(failure.request)}.`,
1739
+ repair: REPORT
1740
+ },
1741
+ "invalid-output": {
1742
+ group: "ads-defect",
1743
+ rule: "CSS processor output is well formed.",
1744
+ guides: ["ads://guides/evidence"],
1745
+ message: (failure) => `${failure.id}: CSS processor output is invalid: ${detail(failure.defect)}.`,
1746
+ repair: REPORT
1747
+ }
1748
+ };
1749
+ const REINSTALL = "Reinstall ADS so its bundled CSS processor is intact (in an ADS source checkout, reinstall its dependencies).";
1750
+ export const runtimeErrors = {
1751
+ "not-a-class": {
1752
+ group: "environment",
1753
+ rule: "ADS runs only with its pinned CSS processor version.",
1754
+ guides: ["ads://guides/runtimes"],
1755
+ message: () => "ADS's CSS processor is not a class.",
1756
+ repair: REINSTALL
1757
+ },
1758
+ "missing-method": {
1759
+ group: "environment",
1760
+ rule: "ADS runs only with its pinned CSS processor version.",
1761
+ guides: ["ads://guides/runtimes"],
1762
+ message: (failure) => `ADS's CSS processor lacks method ${failure.name}.`,
1763
+ repair: REINSTALL
1764
+ },
1765
+ "missing-getter": {
1766
+ group: "environment",
1767
+ rule: "ADS runs only with its pinned CSS processor version.",
1768
+ guides: ["ads://guides/runtimes"],
1769
+ message: (failure) => `ADS's CSS processor lacks getter ${failure.name}.`,
1770
+ repair: REINSTALL
1771
+ },
1772
+ "identity-unavailable": {
1773
+ group: "environment",
1774
+ rule: "ADS runs only with its pinned CSS processor version.",
1775
+ guides: ["ads://guides/runtimes"],
1776
+ message: (failure) => `The CSS processor's identity is unavailable: ${detail(failure.error)}.`,
1777
+ repair: REINSTALL
1778
+ }
1779
+ }, checkErrors = {
1780
+ "a11y-axe": {
1781
+ group: "rendered-check",
1782
+ severity: "error",
1783
+ rule: "A rendered component, pattern or mock scenario passes axe-core's WCAG A/AA rules in every declared brand and theme. The finding names the axe rule, the WCAG criteria, the failing elements and the rule's help link.",
1784
+ guides: ["ads://guides/accessibility"],
1785
+ repair: "Fix the failing element's markup, name or colors in the component or pattern that renders it (for color-contrast, change the token pair in its owner), not in the scenario.",
1786
+ emitters: ["src/render-audit.mts"],
1787
+ situations: 'one id for every axe rule; the axe rule id is in `axeRule`. color-contrast findings carry `overlaps: ["surface-contrast", "component-contrast"]`, the static checks of surface profiles\' paint pairs and of text on the backdrop its elements and owners compose.'
1788
+ },
1789
+ "a11y-focus": {
1790
+ group: "wrong-value",
1791
+ severity: "error",
1792
+ rule: "Focus stays visible (WCAG 2.2 2.4.7, 1.4.11). Every focus profile's width resolves to at least 2 CSS px in every context (theme, brand, brand under theme and condition; relative widths at the 16px reference root), and the document's default indicator (foundation({ focus }), which foundation.css paints on every :focus-visible element a construction does not style) has 3:1 contrast with the document surface's background in every context.",
1793
+ guides: ["ads://guides/accessibility"],
1794
+ repair: "Raise the focus profile's width token to 2px or more, or choose a focus colour token that reaches 3:1 on the document surface in the named context.",
1795
+ emitters: ["src/owner-analysis-check.mts"],
1796
+ situations: "located at the focus profile's declaration; width and default-indicator contrast are separate findings. Focus indicators of constructions inside a known surface are checked by owner analysis (construction/non-text-contrast-insufficient)."
1797
+ },
1798
+ "a11y-focus-unresolved": {
1799
+ group: "unanalyzable",
1800
+ severity: "review",
1801
+ rule: "A focus profile's width and the default indicator's contrast are proven from tokens; a width ADS cannot evaluate in px (a percentage, a viewport unit, em) or a contrast pair it cannot resolve (a translucent surface, a background image that is not a gradient of known colours) is reviewed, never treated as passing.",
1802
+ guides: ["ads://guides/accessibility"],
1803
+ repair: "Use a px or rem width token and an opaque document background, or check the rendered indicator by hand in the named context.",
1804
+ emitters: ["src/owner-analysis-check.mts"],
1805
+ situations: "located at the focus profile's declaration."
1806
+ },
1807
+ "a11y-icon-label": {
1808
+ group: "accessibility-semantics",
1809
+ severity: "error",
1810
+ rule: "A control whose only content is artwork has an accessible name through aria-label, aria-labelledby or title (WCAG 2.2 4.1.2), exact over the owner's reachable choices: in every choice where a control construction renders no text part, its root has a non-empty one of them.",
1811
+ guides: ["ads://guides/accessibility"],
1812
+ repair: "Add aria-label naming the action to the control's root in the choices that render only artwork.",
1813
+ emitters: ["src/owner-analysis-check.mts"],
1814
+ situations: "an owner-analysis error with code source/control-name-missing, located at the control's element."
1815
+ },
1816
+ "a11y-image-alt": {
1817
+ group: "accessibility-semantics",
1818
+ severity: "error",
1819
+ rule: 'Every <img> an owner renders has an alt attribute: meaningful text, or alt="" when decorative (WCAG 2.2 1.1.1).',
1820
+ guides: ["ads://guides/accessibility"],
1821
+ repair: 'Add alt text to the <img>, or alt="" if it is purely decorative.',
1822
+ emitters: ["src/owner-analysis-check.mts"],
1823
+ situations: "owner-analysis errors with code source/intrinsic-alt-missing (an artwork image) or source/image-alt-missing (content media and any other image), at the <img>; a spread on owned markup is rejected before."
1824
+ },
1825
+ "a11y-incomplete": {
1826
+ group: "rendered-check",
1827
+ severity: "info",
1828
+ rule: "An axe-core rule could not decide the rendered result on its own (for example text contrast over a gradient or image), so the criterion is unverified rather than failed.",
1829
+ guides: ["ads://guides/accessibility", "ads://guides/validation"],
1830
+ repair: "Check the named elements by hand in the scenario's capture or showcase preview, and fix the owning style only if it actually fails the criterion.",
1831
+ emitters: ["src/render-audit.mts"]
1832
+ },
1833
+ "a11y-keyboard": {
1834
+ group: "accessibility-semantics",
1835
+ severity: "review",
1836
+ rule: "An onClick on a non-interactive element (div, span, li, img and similar) without role and tabIndex cannot be reached or used from the keyboard (WCAG 2.2 2.1.1), unless a delegated or wrapping control handles it. Composite-widget items and backdrops whose handler reads currentTarget are exempt.",
1837
+ guides: ["ads://guides/accessibility"],
1838
+ repair: "Use a <button> for the action, or add role, tabIndex and a key handler to the element.",
1839
+ emitters: ["src/owner-analysis-check.mts"],
1840
+ situations: "an owner-analysis review note with code review/click-without-keyboard, over the owner's markup on the captured AST, at the element."
1841
+ },
1842
+ "a11y-non-text-contrast": {
1843
+ group: "rendered-check",
1844
+ severity: "error",
1845
+ rule: "Enabled, visible controls have 3:1 non-text contrast (WCAG 1.4.11) in every brand and theme: a border that is a control's only boundary against the surrounding background, an icon-only control's icon against the control's background, and a focus outline against the surrounding background.",
1846
+ guides: ["ads://guides/accessibility"],
1847
+ repair: "Paint the failing boundary, icon or focus outline with a token that reaches 3:1 (for example --border-strong for field borders, a text or -fg token for icons, --border-focus for outlines) in the owning component's styles.",
1848
+ emitters: ["src/render-audit.mts", "src/owner-analysis-check.mts"],
1849
+ situations: 'Rendered: kind "border" | "icon" | "focus" (field `kind`); each message carries its own fix. Static: owner-analysis errors with code construction/non-text-contrast-insufficient, where a construction knows the surface a control part sits on (its border and focus outline at 3:1); a control\'s artwork paints with its text colour, already held to 4.5:1 by surface-contrast.'
1850
+ },
1851
+ "a11y-boundary-declared": {
1852
+ group: "rendered-check",
1853
+ severity: "review",
1854
+ rule: "A text-entry control whose boundary is below 3:1 passes WCAG 1.4.11 only with a human-approved `accessibility` declaration on its recipe part (visible-label or boundary-on-interaction); the render audit lists every such control on every run, in each theme and brand it renders in, with screenshots at rest and focused, so the judgement is made on what users see. Its focus outline, icons, state indicators and text contrast are checked as usual.",
1855
+ guides: ["ads://guides/accessibility", "ads://guides/forms"],
1856
+ repair: "Check the screenshots (.ds/audit-evidence) still match the declared reason; otherwise make the control pass (a 3:1 fill, or one 3:1 border side such as a soft field's underline) and remove the declaration.",
1857
+ emitters: ["src/render-audit.mts"],
1858
+ situations: 'kind "declared"; nodes carry owner, part and boundary; `evidence` lists the screenshot files. A visible-label declaration without a rendered associated label is an a11y-non-text-contrast error of kind "declaration-unmet".'
1859
+ },
1860
+ "a11y-target-size": {
1861
+ group: "wrong-value",
1862
+ severity: "error",
1863
+ rule: 'Pointer targets are at least 24 \xD7 24 CSS px (WCAG 2.2 2.5.8): every control construction and every frame: "control" part, computed from its lowered box in every theme, brand and condition (relative lengths at the 16px reference root), its enlarged hit area included; neighbouring hit areas in a stack or inline arrangement do not overlap.',
1864
+ guides: ["ads://guides/accessibility"],
1865
+ repair: "Raise the frame profile's min-block-size, padding-inline or visual size in that context, or declare a min-target-inline-size / min-target-block-size hit area of at least 24px; widen the gap between overlapping hit areas.",
1866
+ emitters: ["src/owner-analysis-check.mts"],
1867
+ situations: "owner-analysis errors with code construction/target-size-below-minimum (the element, its size, the context and the deficit) or construction/target-area-overlap, at the construction's first selecting expression. The render audit's axe target-size rule cross-checks the rendered result."
1868
+ },
1869
+ "a11y-target-size-unresolved": {
1870
+ group: "unanalyzable",
1871
+ severity: "review",
1872
+ rule: "A target's size is proven from tokens in every context; a value ADS cannot evaluate in px, an inline extent that reaches 24px only with its label's width (text is data), or hit-area spacing a label's width decides, is reviewed, never treated as passing.",
1873
+ guides: ["ads://guides/accessibility"],
1874
+ repair: "Size the frame (or its hit area) to 24px without counting the label, or check the rendered target in that context.",
1875
+ emitters: ["src/owner-analysis-check.mts"],
1876
+ situations: "owner-analysis review notes with code review/target-size-unresolved or review/target-area-overlap-unresolved, at the construction."
1877
+ },
1878
+ "a11y-text-resize": {
1879
+ group: "wrong-value",
1880
+ severity: "error",
1881
+ rule: "Text follows the reader's font size (WCAG 2.2 1.4.4): every font-size token, and every line-height token that is a length, resolves in every context to rem or em (or a calc(), min(), max() or clamp() containing them); a unitless line-height multiplier already scales.",
1882
+ guides: ["ads://guides/accessibility"],
1883
+ repair: "Rewrite the named token in rem (px / 16) or em; for a line height, a unitless multiplier also works.",
1884
+ emitters: ["src/owner-analysis-check.mts"],
1885
+ situations: "part of the token-type check, located at the defining declaration in the token sheet; the message names the token, its role and the first failing context. Line heights are included because a px line height stays fixed while resized text grows, so lines overlap."
1886
+ },
1887
+ "a11y-text-scale": {
1888
+ group: "rendered-check",
1889
+ severity: "error",
1890
+ rule: "A rendered scenario keeps its content with text at 200% (WCAG 2.2 1.4.4): with the root font size doubled at the 390, 768 and 1280 px viewports, and zoomed to 200% of the widest (a 640 px viewport), no text or control is cut off, no content spills past a box whose block size is held, no items overlap past a reserved track, no control or its focus outline is clipped, and nothing overflows horizontally that does not at rest.",
1891
+ guides: ["ads://guides/accessibility", "ads://guides/layout"],
1892
+ repair: "Let the named box grow with its text: replace a fixed height, max-height or px track with min-block-size, auto, minmax(<size>, auto) or a rem/lh length, keep room for the focus outline, and make widths fluid.",
1893
+ emitters: ["src/render-audit.mts"],
1894
+ situations: `pass "font" (widths 390, 768, 1280) | "zoom" (640); kind "block-clipped" | "spilled" | "overlap" | "focus-clipped" | "document" | "viewport" | "clipped". Run in the first theme and brand; only what the same width at rest does not show (the widest width's fit, and every width's horizontal overflow, for zoom). Code passes guidanceUri ads://guides/accessibility.`
1895
+ },
1896
+ "a11y-text-spacing-override": {
1897
+ group: "rendered-check",
1898
+ severity: "error",
1899
+ rule: "A rendered scenario keeps its content under WCAG 2.2 1.4.12 text spacing (line height 1.5, letter spacing 0.12em, word spacing 0.16em, 2em after paragraphs, applied as the reader's stylesheet) at the 390, 768 and 1280 px viewports: nothing is cut off, spills, overlaps, clips a focus outline or overflows that does not at rest.",
1900
+ guides: ["ads://guides/accessibility", "ads://guides/layout"],
1901
+ repair: "Do not hold a text box to the height or width of its designed spacing: use min-block-size or auto instead of a fixed height or line-sized track, and let lines wrap.",
1902
+ emitters: ["src/render-audit.mts"],
1903
+ situations: `pass "spacing"; the same kinds as a11y-text-scale. Run in the first theme and brand against the same width at rest; intended truncation (text-overflow: ellipsis, line clamps) and the overflow check's exemptions stay exempt. Code passes guidanceUri ads://guides/accessibility.`
1904
+ },
1905
+ "a11y-reflow": {
1906
+ group: "rendered-check",
1907
+ severity: "error",
1908
+ rule: "A rendered scenario reflows at a 320 px viewport (1280 px at 400%, WCAG 2.2 1.4.10): nothing overflows horizontally that does not at the audited widths, and nothing is cut off, spills, overlaps or clips a focus outline that does not at the widest width.",
1909
+ guides: ["ads://guides/accessibility", "ads://guides/layout"],
1910
+ repair: "Make the named element fluid below 390 px: replace a fixed or minimum width with min(100%, ...), let rows wrap, and let boxes grow with their text.",
1911
+ emitters: ["src/render-audit.mts"],
1912
+ situations: 'pass "reflow" (width 320); the same kinds as a11y-text-scale. Run in the first theme and brand. Content that also overflows at 390 px is reported once, by layout-overflow. Code passes guidanceUri ads://guides/accessibility.'
1913
+ },
1914
+ "app-icon-asset": {
1915
+ group: "wrong-value",
1916
+ severity: "error",
1917
+ rule: 'The asset foundation({ appIcon }) names is declared, has paint "intrinsic" (browsers, launchers and app stores cannot read CSS variables), is one scalable drawing and has a square viewBox; appIcon.background is a paint-role token that resolves to an opaque colour in the default theme and brand.',
1918
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
1919
+ repair: "Name a declared intrinsic asset with a square viewBox (centre the artwork in it), and give background an opaque paint token.",
1920
+ emitters: ["src/app-icon-checks.mts", "src/owner-analysis-check.mts"],
1921
+ situations: "located at appIcon.asset or appIcon.background in foundation.ads.ts; the message names the asset or token and what it is."
1922
+ },
1923
+ "app-icon-export": {
1924
+ group: "wrong-value",
1925
+ severity: "error",
1926
+ rule: "Each appIcon export writes an .svg copy, a .png (size, or width and height), an .ico (sizes up to 256) or an .icns (sizes 16, 32, 64, 128, 256, 512, 1024) of a declared intrinsic asset, at a path inside the output folder that ADS does not write itself and no other export writes; sizes are 16\u20132048 px, and a background is an opaque paint-role token.",
1927
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
1928
+ repair: "Fix the entry's file, sizing, asset or background as the message says.",
1929
+ emitters: ["src/app-icon-checks.mts", "src/owner-analysis-check.mts"],
1930
+ situations: "located at the export's field (file, asset, size, width, height, sizes or background)."
1931
+ },
1932
+ "app-icon-maskable": {
1933
+ group: "wrong-value",
1934
+ severity: "error",
1935
+ rule: "A maskable icon survives a launcher's crop: a padded master (maskable.padding, 0\u20130.4) has a background to fill its corners and draws only inside the safe zone, the central circle of 80% of the icon's width (W3C Web App Manifest); a separate maskable drawing (maskable.asset) is a declared intrinsic, square asset, opaque to its edges.",
1936
+ guides: ["ads://guides/branding", "ads://guides/pictograms"],
1937
+ repair: "Increase maskable.padding and add appIcon.background, or declare a full-bleed drawing for maskable.asset.",
1938
+ emitters: ["src/app-icon-checks.mts", "src/owner-analysis-check.mts"],
1939
+ situations: "located at appIcon.maskable in foundation.ads.ts; the safe zone and the full bleed are read from the drawing rendered at 256 px."
1940
+ },
1941
+ "asset-unused": {
1942
+ group: "project-files",
1943
+ severity: "error",
1944
+ rule: "A design system declares only artwork it uses, like code: every asset is bound by an owner (by name, or as a member of a bound glyph set), exported through a glyph reference (`glyph()` in an emitted module) or drawn as the application icon (foundation({ appIcon }), its maskable drawing and its exports), and every glyph set is bound by an owner.",
1945
+ guides: ["ads://guides/pictograms", "ads://guides/branding"],
1946
+ repair: "Bind the asset in an owner's recipe or export a glyph reference for it from the public barrel; otherwise delete its declaration and drawings.",
1947
+ emitters: ["src/owner-analysis-check.mts"],
1948
+ situations: "positioned at the declaration's name. Reported only when every owner and plain module analyzed: a failed owner's bindings are unknown."
1949
+ },
1950
+ "behavior-contract-declaration": {
1951
+ group: "syntax",
1952
+ severity: "error",
1953
+ rule: 'An owner\'s behaviour registration (`<Owner>.ads.behavior.ts`) default-exports one call of the `behavior` macro, imported from `@reqvire-org/ads/behavior` with { type: "macro" }, whose argument is a closed literal { subjects, guarantees, checks }.',
1954
+ guides: ["ads://guides/behaviors"],
1955
+ repair: "Write the registration as `export default behavior({ subjects, guarantees, checks })` with literal values, and fix the field the finding names.",
1956
+ emitters: ["src/behavior-registry.mts"],
1957
+ situations: "missing macro import or default-exported call; a non-literal declaration; an unknown declaration or subject field; a subject that is neither { api } nor { source, symbol?, role? }. Located at the entry, `entry` names it (`behavior.subjects.<id>`)."
1958
+ },
1959
+ "behavior-spec-import": {
1960
+ group: "boundary",
1961
+ severity: "error",
1962
+ rule: "A registered behaviour spec imports its test API from what ADS provides: unit specs node:test and node:assert, browser and strict specs @reqvire-org/ads/browser-test. ADS runs every spec with its own Bun and its own Playwright, so the project installs no test framework.",
1963
+ guides: ["ads://guides/behaviors"],
1964
+ repair: "Import test and assertions from node:test and node:assert (unit specs) or from @reqvire-org/ads/browser-test (browser and strict specs) instead of bun:test or @playwright/test.",
1965
+ emitters: ["src/behavior-registry.mts"],
1966
+ situations: "a registered check's spec importing bun:test, @playwright/test, playwright or playwright-core; reported at the check's file field with the spec's line."
1967
+ },
1968
+ "behavior-contract-owner": {
1969
+ group: "boundary",
1970
+ severity: "error",
1971
+ rule: "A behaviour registration sits in the folder of the component, pattern or shared controller it registers, and an owner has one.",
1972
+ guides: ["ads://guides/behaviors"],
1973
+ repair: "Move the registration into its owner's folder, or merge a second registration into the first.",
1974
+ emitters: ["src/behavior-registry.mts"],
1975
+ situations: "a registration outside components/, patterns/ or controllers/ owners; a second registration for one owner. Line 1, column 1."
1976
+ },
1977
+ "behavior-subject-unknown": {
1978
+ group: "unresolved-reference",
1979
+ severity: "error",
1980
+ rule: "Every behaviour subject resolves in its own owner: `api` names a public export the barrel takes from the owner, and `source` a production file of the owner (with `symbol` an export of it), so a rename fails the check instead of dropping a guarantee.",
1981
+ guides: ["ads://guides/behaviors"],
1982
+ repair: "Point the subject at the owner's current export or runtime file, or remove the subject and the guarantees that name it.",
1983
+ emitters: ["src/behavior-registry.mts"],
1984
+ situations: "an `api` the barrel does not export from this owner; a `source` that is a peer's file, a development file or no file; a `symbol` the source does not export; a controller (the default role) in a component's or pattern's own recipe-authoring file that the barrel does not export from it (a private controller belongs in its own file; a private visual implementation declares role \"implementation\"). Located at the entry's value."
1985
+ },
1986
+ "behavior-contract-guarantee": {
1987
+ group: "structure-mismatch",
1988
+ severity: "error",
1989
+ rule: "Every guarantee has a unique id and a description, and references at least one subject and one check its registration declares.",
1990
+ guides: ["ads://guides/behaviors"],
1991
+ repair: "Use a unique id, describe the guarantee, and reference only declared subject and check ids.",
1992
+ emitters: ["src/behavior-registry.mts"],
1993
+ situations: "a missing or duplicate id; an empty description; an empty, unknown or non-static subject or check reference. Located at the entry (`behavior.guarantees.<index>.<field>[.<position>]`); the guarantee is not registered."
1994
+ },
1995
+ "behavior-contract-check": {
1996
+ group: "wrong-value",
1997
+ severity: "error",
1998
+ rule: "Each check names a spec of its owner (a development-only test file in the owner's folder), a case tagged `@ads:<case>` in one of its test titles, a built-in profile (unit, browser, or strict for React) and, optionally, a registered scenario; ADS runs every check itself, with no project command.",
1999
+ guides: ["ads://guides/behaviors"],
2000
+ repair: "Fix the check field the finding names: the owner's spec file, a tagged case, a built-in profile name (unit, browser, strict) or a scenario id.",
2001
+ emitters: ["src/behavior-registry.mts"],
2002
+ situations: "a file that is not the owner's spec; a case no test title tags; an unregistered profile; an unknown scenario; an unknown check field. Located at the field (`behavior.checks.<id>.<field>`); the check is not registered."
2003
+ },
2004
+ "test-ownership": {
2005
+ group: "boundary",
2006
+ severity: "error",
2007
+ rule: "A design-system test (a `*.test.*` or `*.spec.*` file, or one under a test folder) sits in the folder of the component, pattern or shared controller it tests; it is a test wherever it lives, never a mock.",
2008
+ guides: ["ads://guides/behaviors"],
2009
+ repair: "Move the test into the folder of the owner it tests, or out of the design system when it tests the application.",
2010
+ emitters: ["src/test-boundaries.mts"],
2011
+ situations: "a test under mocks/, review/, a plain-module folder or the design-system root. Line 1, column 1."
2012
+ },
2013
+ "test-private-import": {
2014
+ group: "boundary",
2015
+ severity: "error",
2016
+ rule: "A design-system test imports its own owner's files and the public barrel, nothing else of the design system: a peer is tested through its public API.",
2017
+ guides: ["ads://guides/behaviors"],
2018
+ repair: "Import the peer's public export from the public alias (the barrel), or move the test to the owner whose files it imports.",
2019
+ emitters: ["src/test-boundaries.mts"],
2020
+ situations: "an import, re-export, import() or require() of a peer owner's file, a plain module, a token sheet or another design input. Located at the specifier."
2021
+ },
2022
+ "test-registration": {
2023
+ group: "evidence-missing",
2024
+ severity: "error",
2025
+ rule: "A behaviour spec (a `*.behavior.spec.*` file, or a test file tagging a case `@ads:<case>`) is named by its owner's behaviour registration: ADS runs a spec's cases only as registered checks.",
2026
+ guides: ["ads://guides/behaviors"],
2027
+ repair: "Register the spec's cases as checks in the owner's <Owner>.ads.behavior.ts, or remove the spec (or its @ads: tags).",
2028
+ emitters: ["src/test-boundaries.mts"],
2029
+ situations: "a behaviour spec or tagged test file no registration's check names, including one whose naming check did not validate. Line 1, column 1."
2030
+ },
2031
+ "behavior-busy": {
2032
+ group: "run-interrupted",
2033
+ severity: "error",
2034
+ rule: "Only one registered behavior verification runs at a time per verification controller; a second request is refused while one is active.",
2035
+ guides: ["ads://guides/behaviors", "ads://guides/validation"],
2036
+ repair: "Wait for the running behavior verification to finish (see ads_status), then request the run again.",
2037
+ emitters: ["src/verification.mts"]
2038
+ },
2039
+ "behavior-check": {
2040
+ group: "behavior-failed",
2041
+ severity: "error",
2042
+ rule: "Draft acceptance requires every registered behavior check of the draft owners to pass on the candidate revision; a failed, skipped or incomplete check rejects the draft.",
2043
+ guides: ["ads://guides/behaviors", "ads://guides/drafts", "ads://guides/evidence"],
2044
+ repair: "Inspect the named unit#check with ads_results and ads_investigate, fix the owner's behavior in the draft and accept the new revision.",
2045
+ emitters: ["src/mcp/mutations.mts"],
2046
+ situations: "one diagnostic per non-passing check result; message is `<unit>#<check>: <status>. <message>` and carries the case's failure classification."
2047
+ },
2048
+ "behavior-runner": {
2049
+ group: "behavior-failed",
2050
+ severity: "error",
2051
+ rule: "A registered behavior runner profile must exit cleanly and leave a complete report for every selected check; a crash, timeout, suite error or incomplete report grants no pass.",
2052
+ guides: ["ads://guides/behaviors", "ads://guides/evidence"],
2053
+ repair: "Read the runner output and profile in the diagnostic, fix the failing suite setup or test (or raise the profile timeoutMs if the work is legitimately longer), then rerun.",
2054
+ emitters: ["src/verification.mts"],
2055
+ situations: "(1) the runner process errored/timed out or its report could not be read (progress + reason attached); (2) the runner exited non-zero, reported suite errors or left an incomplete report (exit 1 with real case failures is classified from the case failures)."
2056
+ },
2057
+ "behavior-selection": {
2058
+ group: "unresolved-reference",
2059
+ severity: "error",
2060
+ rule: "A behavior verification selection names only owner units and check IDs that are registered.",
2061
+ guides: ["ads://guides/behaviors"],
2062
+ repair: "Discover the exact owner/check IDs with ads_behaviors and request only those.",
2063
+ emitters: ["src/verification.mts"],
2064
+ situations: "(1) a selected unit registers no behavior checks; (2) a selected check ID is not registered for the selected units."
2065
+ },
2066
+ "behavior-verification": {
2067
+ group: "behavior-failed",
2068
+ severity: "error",
2069
+ rule: "Behavior verification must complete and record its evidence; an unexpected error while preparing, running or persisting the checks fails the whole verification.",
2070
+ guides: ["ads://guides/behaviors", "ads://guides/evidence"],
2071
+ repair: "Read the error message; if it names oversized evidence remove obsolete generated evidence, otherwise fix the reported setup problem and rerun the verification.",
2072
+ emitters: ["src/verification.mts"],
2073
+ situations: 'generic catch around the verification run (preview host start, analysis, report persistence incl. "Verification evidence exceeds 2 MiB").'
2074
+ },
2075
+ "brand-undefined": {
2076
+ group: "project-files",
2077
+ severity: "error",
2078
+ rule: 'Every non-default brand foundation.ads.ts declares sets at least one token value under [data-brand="<name>"].',
2079
+ guides: ["ads://guides/tokens", "ads://guides/branding"],
2080
+ repair: 'Give the brand token values under :root[data-brand="<name>"] in a token sheet, or remove it from foundation.ads.ts brands.',
2081
+ emitters: ["src/owner-analysis-check.mts"],
2082
+ situations: "positioned at the brand's entry in foundation.ads.ts. The first brand is the default: its values are the :root values."
2083
+ },
2084
+ "check-side-effect": {
2085
+ group: "boundary",
2086
+ severity: "error",
2087
+ rule: "Project check commands only check: they never rewrite source files.",
2088
+ guides: ["ads://guides/validation", "ads://guides/drafts"],
2089
+ repair: "Configure checks without write or fix modes (for example a formatter's --check instead of --write).",
2090
+ emitters: ["src/mcp/mutations.mts"]
2091
+ },
2092
+ "check-timeout": {
2093
+ group: "run-interrupted",
2094
+ severity: "error",
2095
+ rule: "Each project check command finishes within its time budget.",
2096
+ guides: ["ads://guides/validation", "ads://guides/drafts"],
2097
+ repair: "Run again; if the command is slow by nature, raise mcp.mutationCheckTimeoutMs, or speed the command up.",
2098
+ emitters: ["src/validation-checks.mts"]
2099
+ },
2100
+ "dependencies-missing": {
2101
+ group: "environment",
2102
+ severity: "error",
2103
+ rule: "Guarded mutations run with the project's dependencies installed.",
2104
+ guides: ["ads://guides/drafts"],
2105
+ repair: "Install the project's dependencies (its package manager's install command) and retry.",
2106
+ emitters: ["src/mcp/mutations.mts"]
2107
+ },
2108
+ "draft-cleanup": {
2109
+ group: "after-apply",
2110
+ severity: "review",
2111
+ rule: "After an accepted draft's source is applied, ADS removes the draft's manifest and workspace; a failure leaves the accepted source in place but the draft directory needs recovery.",
2112
+ guides: ["ads://guides/drafts"],
2113
+ repair: "Do not re-apply the change; check ads_drafts for the leftover draft, drop it with ads_drop_draft if it still appears, and report the error if cleanup keeps failing.",
2114
+ emitters: ["src/mcp/drafts.mts"],
2115
+ situations: "non-blocking warning in result.warnings after a successful apply."
2116
+ },
2117
+ "draft-dependency": {
2118
+ group: "after-apply",
2119
+ severity: "review",
2120
+ rule: "After a draft is accepted, ADS rebases every dependent draft onto the accepted bytes and removes the dependency; a failure leaves that dependent draft's manifest needing recovery.",
2121
+ guides: ["ads://guides/drafts"],
2122
+ repair: "Open the named dependent draft with ads_drafts/ads_show_draft, confirm its baseline against the newly accepted source and recreate it if its manifest is unusable.",
2123
+ emitters: ["src/mcp/drafts.mts"],
2124
+ situations: "non-blocking warning in result.warnings after a successful apply; one per failing dependent."
2125
+ },
2126
+ "draft-event": {
2127
+ group: "after-apply",
2128
+ severity: "review",
2129
+ rule: "Each accepted draft records an acceptance event; when event storage fails after source was applied, the source change stands but the event log needs recovery.",
2130
+ guides: ["ads://guides/drafts"],
2131
+ repair: "Treat the acceptance as applied, verify the accepted source with ads_status, and report the event-storage error.",
2132
+ emitters: ["src/mcp/drafts.mts"],
2133
+ situations: "non-blocking warning in result.warnings after a successful apply."
2134
+ },
2135
+ "draft-preview": {
2136
+ group: "syntax",
2137
+ severity: "error",
2138
+ rule: "A draft scenario preview must compile from the draft's source before it can be reviewed.",
2139
+ guides: ["ads://guides/drafts", "ads://guides/scenarios"],
2140
+ repair: "Read the compiler message in the diagnostic, fix the draft source it names with ads_update_draft, and show the draft again.",
2141
+ emitters: ["src/mcp/drafts.mts"],
2142
+ situations: "only used when the draft registry has no diagnostics of its own; message is the ads_show_scenario error text (any preview compile failure)."
2143
+ },
2144
+ "execution-cancelled": {
2145
+ group: "run-interrupted",
2146
+ severity: "error",
2147
+ rule: "A validation, acceptance or guarded application whose owning request was cancelled, disconnected or stopped does not establish a result.",
2148
+ guides: ["ads://guides/validation"],
2149
+ repair: "Run the same validation or acceptance again once the cancelling condition has cleared.",
2150
+ emitters: ["src/mcp/execution-coordinator.mts"],
2151
+ situations: 'rule is chosen from the abort reason code: every code except ADS_SOURCE_CHANGED_DURING_RUN maps here, i.e. ADS_RUN_CANCELLED (default: request cancelled/disconnected), ADS_RUN_INTERRUPTED ("ADS is stopping", process shutdown), or any other abort-reason code. The diagnostic carries `code`.'
2152
+ },
2153
+ "execution-error": {
2154
+ group: "ads-defect",
2155
+ severity: "error",
2156
+ rule: "An execution (validation, acceptance or guarded application) must report its own diagnostics; an uncaught error from the work is reported as a failed run.",
2157
+ guides: ["ads://guides/validation", "ads://guides/evidence"],
2158
+ repair: "Read the message and code; if it names a project condition fix that and rerun, otherwise report it with the run ID instead of changing source.",
2159
+ emitters: ["src/mcp/execution-coordinator.mts"],
2160
+ situations: "fallback for thrown errors without a .diagnostic; code is e.code or ADS_EXECUTION_ERROR."
2161
+ },
2162
+ "execution-inputs": {
2163
+ group: "evidence-missing",
2164
+ severity: "error",
2165
+ rule: "A run's result counts only when ADS can confirm, after the run, that its validation inputs still match the captured revision; failing to re-read them leaves the result unestablished.",
2166
+ guides: ["ads://guides/validation"],
2167
+ repair: "Fix the error the message names (usually an unreadable configuration or input path), then rerun against current source.",
2168
+ emitters: ["src/mcp/execution-coordinator.mts"]
2169
+ },
2170
+ "execution-interrupted": {
2171
+ group: "run-interrupted",
2172
+ severity: "error",
2173
+ rule: "A run abandoned by an ADS restart is recorded as interrupted and is never resumed or treated as a pass.",
2174
+ guides: ["ads://guides/validation"],
2175
+ repair: "Start the validation or acceptance again; the interrupted run left no baseline or acceptance behind.",
2176
+ emitters: ["src/mcp/execution-coordinator.mts"],
2177
+ situations: "code ADS_RUN_INTERRUPTED, written during journal recovery at startup."
2178
+ },
2179
+ "font-budget": {
2180
+ group: "wrong-value",
2181
+ severity: "error",
2182
+ rule: "Every font file a font() declaration lists stays within assets.fontBudgetKb (default 150 KB, rounded up to whole KiB): a heavier file delays the text that waits for it.",
2183
+ guides: ["ads://guides/performance"],
2184
+ repair: "Use WOFF2 and subset the face to the script the page uses (other scripts in their own faces), or raise assets.fontBudgetKb in ds.config.json.",
2185
+ emitters: ["src/owner-analysis-check.mts"],
2186
+ situations: "located at the face's source in the font declaration; the message names the file, its size and the limit."
2187
+ },
2188
+ "font-display": {
2189
+ group: "wrong-value",
2190
+ severity: "review",
2191
+ rule: `A font's display keeps text visible and consistent while it loads: "block" hides text until the face arrives, and "optional" lets the browser keep the fallback per file, so one page can mix the face and the fallback.`,
2192
+ guides: ["ads://guides/performance"],
2193
+ repair: 'Use display "swap" (or "fallback") unless the page deliberately trades the face for speed.',
2194
+ emitters: ["src/owner-analysis-check.mts"],
2195
+ situations: "located at the declaration's display field."
2196
+ },
2197
+ "font-format": {
2198
+ group: "wrong-value",
2199
+ severity: "review",
2200
+ rule: "Font files are WOFF2, the smallest format every current browser reads; WOFF, TrueType and OpenType files are reviewed.",
2201
+ guides: ["ads://guides/performance"],
2202
+ repair: "Convert the file to WOFF2 and point the face's source at it.",
2203
+ emitters: ["src/owner-analysis-check.mts"],
2204
+ situations: "located at the face's source in the font declaration."
2205
+ },
2206
+ "font-unused": {
2207
+ group: "project-files",
2208
+ severity: "review",
2209
+ rule: "A declared font is used where a font-family role token names it first (in some context), and each face of a used family is one a text profile selects: its weight in some context, in style normal. Faces covering 400 or 700, and italic faces, count as used, since browsers draw plain, bold and emphasized text with them.",
2210
+ guides: ["ads://guides/performance", "ads://guides/tokens"],
2211
+ repair: "Name the family first in a font-family token, or select the face's weight from a text profile; otherwise remove the declaration or the face and its file, so nothing downloads it.",
2212
+ emitters: ["src/owner-analysis-check.mts"],
2213
+ situations: "an unused family at the declaration's family field; an unused face at its entry in faces."
2214
+ },
2215
+ "font-weight-missing": {
2216
+ group: "wrong-value",
2217
+ severity: "error",
2218
+ rule: "A text profile whose font-family token names a declared font first draws only weights that font has: in every context, some upright face covers the profile's font-weight (a range covers what it spans). The document text profile without a weight draws at 400.",
2219
+ guides: ["ads://guides/performance", "ads://guides/tokens"],
2220
+ repair: "Add a face for the weight (or a variable face whose weight range spans it), or point the profile's font-weight at a weight the font has.",
2221
+ emitters: ["src/owner-analysis-check.mts"],
2222
+ situations: "located at the text profile's declaration; one finding per profile, family and weight, naming the contexts it is drawn in."
2223
+ },
2224
+ "generated-modified": {
2225
+ group: "boundary",
2226
+ severity: "error",
2227
+ rule: "The design system's emitted output folder (compile.outDir) holds exactly the files its ads-contract.json records, each with its recorded sha256: ADS owns the folder, and its files are never edited by hand.",
2228
+ guides: ["ads://guides/layers"],
2229
+ repair: "Run `ads emit` to regenerate the output (`ads emit --force` discards hand edits and removes foreign files); make the change in the design-system source instead.",
2230
+ emitters: ["src/emit/integrity.mts"],
2231
+ situations: "Emitted file edited after emission; recorded file missing; file not recorded (foreign); output folder without a readable ads-contract.json; output path is not a folder. Committing the output to Git or not makes no difference."
2232
+ },
2233
+ "generated-stale": {
2234
+ group: "evidence-missing",
2235
+ severity: "info",
2236
+ rule: "The emitted output folder's ads-contract.json records the source revision it was emitted from; while that is not the design system's current revision, the output is out of date. Never blocking: with compile.emitOnAccept false it is intended until the next emit.",
2237
+ guides: ["ads://guides/layers"],
2238
+ repair: "Run `ads emit` to refresh the output folder from the current source.",
2239
+ emitters: ["src/emit/integrity.mts"],
2240
+ situations: "The source changed since the last `ads emit` (an edit, or a draft accepted with compile.emitOnAccept false). Silent without an output folder, without a readable contract (generated-modified reports that), and in an analysis that captured no complete input read (a registered draft or candidate revision)."
2241
+ },
2242
+ "img-shape": {
2243
+ group: "rendered-check",
2244
+ severity: "error",
2245
+ rule: "An image renders at the shape it declares (its width/height attributes or aspect-ratio); a rendered box of another shape crops or stretches it.",
2246
+ guides: ["ads://guides/performance"],
2247
+ repair: "Add height: auto so the declared attributes keep the proportions, or for a deliberate crop set object-fit in a box of its own with no aspect-ratio.",
2248
+ emitters: ["src/render-audit.mts"]
2249
+ },
2250
+ "import-leaves-design-system": {
2251
+ group: "boundary",
2252
+ severity: "error",
2253
+ rule: "Every import in the design-system folder (tests excepted, type-only imports included) resolves inside that folder or to an installed package; application source is never a dependency.",
2254
+ guides: ["ads://guides/layers"],
2255
+ repair: "Move the imported module into the design-system folder, or pass the value (application data, stores, routing, services) in through a public prop.",
2256
+ emitters: ["src/check.mts"],
2257
+ situations: "located at the import; covers application source too, including unresolved relative or path-mapped imports that, as written, leave the design-system folder."
2258
+ },
2259
+ "layout-overflow": {
2260
+ group: "rendered-check",
2261
+ severity: "error",
2262
+ rule: "A rendered scenario does not overflow horizontally at the 390, 768 and 1280 px viewports: the page does not scroll sideways, no content reaches past the viewport, and no text or control is cut off by overflow: hidden or clip (a cropped image, artwork or decorative aria-hidden layer under a clip is not cut content).",
2263
+ guides: ["ads://guides/tokens", "ads://guides/layout"],
2264
+ repair: "Make the named element fluid (%, fr, min-width: 0 on flex/grid children, or a span of its owner's grid tracks instead of a fixed width, with a container-context grid where it must follow its region; cap a fixed frame with max-inline-size: 100%), let text wrap or truncate with text-overflow: ellipsis, or put it in an overflow-x: auto scroller.",
2265
+ emitters: ["src/render-audit.mts"],
2266
+ situations: 'kind "document" | "viewport" | "clipped" (the "container" kind is reported as layout-overflow-narrow). Code passes guidanceUri ads://guides/tokens.'
2267
+ },
2268
+ "layout-overflow-narrow": {
2269
+ group: "rendered-check",
2270
+ severity: "review",
2271
+ rule: "A component or pattern scenario fits a 240 px container (a narrow side pane) without its content reaching past the container.",
2272
+ guides: ["ads://guides/tokens", "ads://guides/layout"],
2273
+ repair: "Make the element fluid (%, fr, min(100%, ...)), wrap it or scroll it with overflow-x: auto.",
2274
+ emitters: ["src/render-audit.mts"],
2275
+ situations: "the same overflow kinds as layout-overflow, measured in the container render (first theme, widest viewport). Code passes guidanceUri ads://guides/tokens."
2276
+ },
2277
+ "layout-shift": {
2278
+ group: "rendered-check",
2279
+ severity: "error",
2280
+ rule: "A rendered scenario's cumulative layout shift stays at or below the Core Web Vitals threshold of 0.1 in every brand and theme.",
2281
+ guides: ["ads://guides/performance"],
2282
+ repair: "Give images and media width and height (or aspect-ratio), reserve space for late content, and load the fonts the first text uses early in the owning component.",
2283
+ emitters: ["src/render-audit.mts"]
2284
+ },
2285
+ "mutation-batch": {
2286
+ group: "wrong-value",
2287
+ severity: "error",
2288
+ rule: "A transaction contains 2 to the unit limit of distinct owner patches without a top-level unit/patch, one patch per unit, each owner giving files or a patch but not both, and at most the file limit of distinct files.",
2289
+ guides: ["ads://guides/drafts"],
2290
+ repair: "Combine each owner's changes into one entry, list each file once, and split oversized changes into separate drafts.",
2291
+ emitters: ["src/mcp/mutations.mts", "src/mcp/patch.mts"],
2292
+ situations: "transaction size/shape; duplicate unit; files + patch together; too many distinct files; (patch.mjs) duplicate or too many file patches in one diff."
2293
+ },
2294
+ "mutation-busy": {
2295
+ group: "run-interrupted",
2296
+ severity: "error",
2297
+ rule: "Only one guarded mutation validates at a time; a second mutation is refused while another is running.",
2298
+ guides: ["ads://guides/drafts"],
2299
+ repair: "Wait for the running mutation to finish (see ads_status), then accept again.",
2300
+ emitters: ["src/mcp/mutations.mts"],
2301
+ situations: "failure code ADS_MUTATION_BUSY."
2302
+ },
2303
+ "mutation-cancelled": {
2304
+ group: "run-interrupted",
2305
+ severity: "error",
2306
+ rule: "A cancelled mutation or analysis stops before publishing anything; its checks establish no result.",
2307
+ guides: ["ads://guides/drafts", "ads://guides/validation"],
2308
+ repair: "Run the acceptance or check again when it is no longer being cancelled.",
2309
+ emitters: ["src/validation-checks.mts", "src/check-service.mts", "src/task-cache.mts", "src/mcp/mutations.mts", "src/analysis/service.mts"],
2310
+ situations: "cancelled before validation, during a check command, before application, or analysis cancelled (code ADS_CANCELLED). Despite the name it is also the analysis-service cancellation diagnostic."
2311
+ },
2312
+ "mutation-capture": {
2313
+ group: "after-apply",
2314
+ severity: "review",
2315
+ rule: "After source is applied, ADS promotes the pending candidate captures to the new accepted revision; a promotion failure leaves source applied but capture state needing recovery.",
2316
+ guides: ["ads://guides/captures"],
2317
+ repair: "Treat the source as applied, re-capture the affected targets with ads_capture, and report the promotion error.",
2318
+ emitters: ["src/mcp/mutations.mts"],
2319
+ situations: "non-blocking warning in result.warnings after a successful apply."
2320
+ },
2321
+ "mutation-check": {
2322
+ group: "syntax",
2323
+ severity: "error",
2324
+ rule: "Every configured project check command (acceptance.scripts, and validation.scripts in ads_validate) exits 0 on the candidate.",
2325
+ guides: ["ads://guides/validation", "ads://guides/drafts"],
2326
+ repair: "Read the command output in the diagnostic and fix what it reports, then accept or validate the new revision.",
2327
+ emitters: ["src/validation-checks.mts", "src/mcp/mutations.mts"]
2328
+ },
2329
+ "mutation-conflict": {
2330
+ group: "run-interrupted",
2331
+ severity: "error",
2332
+ rule: "Accepted source and the declared validation inputs must not change between preparing a mutation and applying it; a change rejects the mutation without writing anything.",
2333
+ guides: ["ads://guides/drafts", "ads://guides/validation"],
2334
+ repair: "Read the current source, regenerate the patch or draft revision against it, and accept again.",
2335
+ emitters: ["src/mcp/mutations.mts"],
2336
+ situations: "a patched file changed while preparing; relevant inputs changed while preparing; inputs changed during validation (before application)."
2337
+ },
2338
+ "delete-target-unknown": {
2339
+ group: "unresolved-reference",
2340
+ severity: "error",
2341
+ rule: "An ads_delete target names a declared identity of its kind: a token sheet's custom property, a profile, asset, glyph-set or font family name, or a component or pattern owner path.",
2342
+ guides: ["ads://guides/drafts", "ads://guides/tokens"],
2343
+ repair: "Read ads_tokens, ads_catalog or ads_units for the declared identities and name one of them (an asset by its declared name, not an alias).",
2344
+ emitters: ["src/deletion-plan.mts", "src/mcp/deletions.mts", "src/deletion-model.mts"],
2345
+ situations: "no such declaration; an asset alias; an owner path without a unit; a planned file with no ADS owner."
2346
+ },
2347
+ "delete-target-invalid": {
2348
+ group: "structure-mismatch",
2349
+ severity: "error",
2350
+ rule: "An ads_delete target id is a well-formed identity of its kind (a token starts with --; an owner path is folder/Name).",
2351
+ guides: ["ads://guides/drafts"],
2352
+ repair: "Write the id as the identity is declared, for example --radius-control or Actions/Button.",
2353
+ emitters: ["src/deletion-model.mts"]
2354
+ },
2355
+ "delete-target-duplicate": {
2356
+ group: "conflict",
2357
+ severity: "error",
2358
+ rule: "An ads_delete request names each identity once.",
2359
+ guides: ["ads://guides/drafts"],
2360
+ repair: "Remove the repeated target from the request.",
2361
+ emitters: ["src/deletion-model.mts"]
2362
+ },
2363
+ "delete-inputs-unreadable": {
2364
+ group: "unanalyzable",
2365
+ severity: "error",
2366
+ rule: "ads_delete resolves its targets against design inputs that read; a revision whose token sheets, profiles or assets do not read cannot be planned.",
2367
+ guides: ["ads://guides/drafts", "ads://guides/validation"],
2368
+ repair: "Run ads check, fix its first error, then retry the deletion.",
2369
+ emitters: ["src/deletion-plan.mts", "src/deletion-model.mts"]
2370
+ },
2371
+ "delete-declaration-unsupported": {
2372
+ group: "unsupported",
2373
+ severity: "error",
2374
+ rule: "ADS removes a declaration by its own export statement; one statement declaring several macros cannot be partly removed.",
2375
+ guides: ["ads://guides/drafts"],
2376
+ repair: "Give the declaration its own export statement (through a draft), then retry the deletion.",
2377
+ emitters: ["src/deletion-plan.mts", "src/deletion-model.mts"]
2378
+ },
2379
+ "delete-referenced": {
2380
+ group: "conflict",
2381
+ severity: "error",
2382
+ rule: "A deletion leaves no surviving reference to a deleted identity in the design inputs: token aliases, composed or bound profiles, glyph-set members, the foundation's document profiles and font-family tokens. References between targets of the same request do not count.",
2383
+ guides: ["ads://guides/drafts", "ads://guides/tokens"],
2384
+ repair: "Change the referring declaration first, or name it in the same request; ADS never deletes dependents on its own.",
2385
+ emitters: ["src/mcp/deletions.mts", "src/deletion-model.mts"]
2386
+ },
2387
+ "delete-stale-revision": {
2388
+ group: "run-interrupted",
2389
+ severity: "error",
2390
+ rule: "ads_delete publishes only at the source revision its targets were inspected at; a different revision before or during its checks refuses it without writing anything.",
2391
+ guides: ["ads://guides/drafts"],
2392
+ repair: "Read ads_status.sourceRevision again, review the targets against the current source and retry.",
2393
+ emitters: ["src/mcp/deletions.mts", "src/deletion-model.mts"],
2394
+ situations: "the requested revision is not the current one; the source changed while the candidate was checked."
2395
+ },
2396
+ "delete-revision-changed": {
2397
+ group: "run-interrupted",
2398
+ severity: "error",
2399
+ rule: "A deletion's planned files are the captured bytes it was planned from.",
2400
+ guides: ["ads://guides/drafts"],
2401
+ repair: "Retry the deletion; the source changed while it was planned.",
2402
+ emitters: ["src/mcp/deletions.mts", "src/deletion-model.mts"]
2403
+ },
2404
+ "delete-draft-conflict": {
2405
+ group: "conflict",
2406
+ severity: "error",
2407
+ rule: "ads_delete does not change a file or owner an open draft holds.",
2408
+ guides: ["ads://guides/drafts"],
2409
+ repair: "Accept or drop the named draft first, then retry the deletion.",
2410
+ emitters: ["src/mcp/deletions.mts", "src/deletion-model.mts"]
2411
+ },
2412
+ "mutation-content": {
2413
+ group: "wrong-value",
2414
+ severity: "error",
2415
+ rule: "Each proposed file stays within the 16 MiB mutation size limit, and text source and documentation are valid UTF-8 without NUL bytes.",
2416
+ guides: ["ads://guides/drafts"],
2417
+ repair: "Shrink or split the file, or re-encode the text as UTF-8 without NUL bytes.",
2418
+ emitters: ["src/mcp/mutations.mts"],
2419
+ situations: "existing file too large to read; patched file too large; invalid UTF-8/NUL in text; binary patch block larger than 16 MiB."
2420
+ },
2421
+ "mutation-error": {
2422
+ group: "ads-defect",
2423
+ severity: "error",
2424
+ rule: "A guarded mutation reports its failures as diagnostics; an unexpected error during preparation, checking or application rejects the mutation without publishing source.",
2425
+ guides: ["ads://guides/drafts", "ads://guides/evidence"],
2426
+ repair: "Read the message and failure boundary; fix a named project condition and accept again, otherwise report it with the draft revision instead of rewriting source.",
2427
+ emitters: ["src/mcp/mutations.mts"],
2428
+ situations: "fallback for thrown errors without .diagnostic; failure is the current boundary (e.g. runner/behavior-verification/ADS_BEHAVIOR_SETUP or ADS_MUTATION_EXCEPTION)."
2429
+ },
2430
+ "mutation-notification": {
2431
+ group: "after-apply",
2432
+ severity: "review",
2433
+ rule: "After source is applied, ADS refreshes and re-warms the managed previews; a refresh failure leaves the change applied but the previews possibly not current.",
2434
+ guides: ["ads://guides/runtimes", "ads://guides/drafts"],
2435
+ repair: "Recheck ads_status.build and reopen the scenario; wait for a current verified preview before reviewing.",
2436
+ emitters: ["src/mcp/server-tools.mts"],
2437
+ situations: "non-blocking warning in result.warnings after a successful apply."
2438
+ },
2439
+ "mutation-patch": {
2440
+ group: "syntax",
2441
+ severity: "error",
2442
+ rule: "A draft patch is one well-formed Git unified diff (text hunks, or git diff --binary blocks with full blob hashes), given as exactly one of patch or patchFile, within the size limits; renames and mode changes are unsupported.",
2443
+ guides: ["ads://guides/drafts"],
2444
+ repair: "Regenerate the patch with `git diff` (`--binary` for binary assets) against canonical a/ b/ paths, and pass it once as patch or as a .patch/.diff file under .ds/patches/.",
2445
+ emitters: ["src/mcp/mutations.mts", "src/mcp/patch.mts"],
2446
+ situations: "malformed headers/hunks/counts, missing hunk, empty diff, rename, patchFile path/size/UTF-8 rules, patch + patchFile both or neither, oversize diff, mixed binary object formats, binary asset changed without a binary block."
2447
+ },
2448
+ "mutation-path": {
2449
+ group: "boundary",
2450
+ severity: "error",
2451
+ rule: "Mutation paths are canonical project-relative paths through ordinary directories to unlinked regular files, outside hidden, dependency and generated locations.",
2452
+ guides: ["ads://guides/drafts"],
2453
+ repair: "Target the canonical source path of the owned file, and edit the source of generated output instead of the output itself.",
2454
+ emitters: ["src/mcp/mutations.mts"],
2455
+ situations: "non-canonical path; path outside project; hidden/dependency/generated segment; symlink or non-regular file; generated output path; .ds resolves through a symlink (environment)."
2456
+ },
2457
+ "mutation-policy": {
2458
+ group: "boundary",
2459
+ severity: "error",
2460
+ rule: "Source outside the configuration unit carries no lint or typecheck suppression directives (eslint/oxlint-disable, biome-ignore, @ts-ignore, @ts-nocheck, @ts-expect-error); reviewed exceptions belong in the configuration unit.",
2461
+ guides: [],
2462
+ repair: "Remove the suppression directive and fix the reported problem, or configure a reviewed exception through the configuration unit.",
2463
+ emitters: ["src/mcp/mutations.mts"]
2464
+ },
2465
+ "mutation-preview-cache": {
2466
+ group: "after-apply",
2467
+ severity: "info",
2468
+ rule: "After source is applied, ADS tries to reuse the candidate's compiled previews; when that fails the previews are rebuilt in the background instead.",
2469
+ guides: ["ads://guides/runtimes"],
2470
+ repair: "No source change is needed; wait for ads_status.build to report current previews before reviewing.",
2471
+ emitters: ["src/mcp/mutations.mts"],
2472
+ situations: "non-blocking warning in result.warnings after a successful apply."
2473
+ },
2474
+ "mutation-preview-tree": {
2475
+ group: "after-apply",
2476
+ severity: "info",
2477
+ rule: "After source is applied, ADS copies the candidate's preview tree into the project's, so the project previews the accepted revision at once; it skips the copy when the project's tree already holds a later capture or the design system changed again.",
2478
+ guides: ["ads://guides/runtimes"],
2479
+ repair: "No source change is needed; the project's emitter emits the current revision. Wait for ads_status.build to report current previews before reviewing.",
2480
+ emitters: ["src/mcp/mutations.mts"],
2481
+ situations: "non-blocking warning in result.warnings after a successful apply."
2482
+ },
2483
+ "mutation-range": {
2484
+ group: "wrong-value",
2485
+ severity: "error",
2486
+ rule: "A bounded file read uses a non-negative character offset within the file and a limit between 1 and 12000.",
2487
+ guides: ["ads://guides/drafts"],
2488
+ repair: "Pass an offset no larger than the file length (follow nextOffset) and a limit from 1 to 12000.",
2489
+ emitters: ["src/mcp/mutations.mts"]
2490
+ },
2491
+ "mutation-snapshot": {
2492
+ group: "unsupported",
2493
+ severity: "error",
2494
+ rule: "A guarded mutation copies its relevant inputs into a bounded, symlink-free candidate snapshot; inputs beyond the file/byte allowance cannot be validated.",
2495
+ guides: ["ads://guides/validation"],
2496
+ repair: "Reduce what the validation inputs reach (remove large or unrelated paths from validation.inputs, keep generated runtime output small and free of symlinks), then accept again.",
2497
+ emitters: ["src/mcp/mutations.mts"],
2498
+ situations: "input limit (ADS_INPUT_LIMIT) exceeded; candidate copy budget exceeded; project source over limit; generated dist runtime contains symlinks or exceeds the limit."
2499
+ },
2500
+ "mutation-syntax": {
2501
+ group: "syntax",
2502
+ severity: "error",
2503
+ rule: "Proposed JSON source must be valid JSON, and configuration files valid JSON/JSONC.",
2504
+ guides: ["ads://guides/drafts"],
2505
+ repair: "Fix the JSON syntax of the named file in the draft.",
2506
+ emitters: ["src/mcp/mutations.mts"]
2507
+ },
2508
+ "mutation-unit": {
2509
+ group: "boundary",
2510
+ severity: "error",
2511
+ rule: "A mutation targets one ADS owner unit and may only change, create or delete files that unit owns; it cannot capture peer units' files or leave the selected unit unestablished.",
2512
+ guides: ["ads://guides/drafts", "ads://guides/layers"],
2513
+ repair: "Pick the owner ID from ads_units and put each owner's files in its own draft or transaction entry.",
2514
+ emitters: ["src/units.mts", "src/mcp/mutations.mts"],
2515
+ situations: "invalid/reserved unit ID; empty .gitkeep edited; file belongs to another owner; patch changes ownership of existing peer units; patched files do not establish the unit; (mutations.mts) read of a file outside every ADS/configuration unit."
2516
+ },
2517
+ "owner-analysis": {
2518
+ group: "wrong-value",
2519
+ severity: "error",
2520
+ rule: "The design system passes owner analysis: its design inputs (role token sheets, profiles, asset declarations) read, every owner its public barrel reaches type-checks, analyzes, lowers and compiles, and every owner's token CSS resolves.",
2521
+ guides: ["ads://guides/recipes", "ads://guides/tokens"],
2522
+ repair: "Fix the failure the finding's code names at the reported position; its message carries that code's repair hint.",
2523
+ emitters: ["src/owner-analysis-check.mts"],
2524
+ situations: "one id for every owner failure; the fine-grained code (`<domain>/<kind>`, innermost nested failure) is in `code`, its mistake group in `group`. Every owner is analyzed and each failed owner reports its first source failure; each plain-module failure, each TypeScript diagnostic, the analyzed owners' first compile failure and each owner's token-css failure is its own finding. Design-input, discovery and module-graph failures stop the revision's analysis. Styling ownership (source/css-in-js-import and the source/plain-* codes) reports each problem of a plain module and each CSS-in-JS import of a development file, design input or unemitted module; an owner's CSS-in-JS import is its first failure. The controller gates (source/controller-recipe, source/controller-markup, source/controller-ui-import) report each problem of every runtime file under controllers/, barrel-reached or not; a controller's markup is not also source/plain-markup. source/import-leaves-design-system is left to import-leaves-design-system."
2525
+ },
2526
+ "owner-analysis-blocked": {
2527
+ group: "evidence-missing",
2528
+ severity: "info",
2529
+ rule: "An owner whose analysis needs another owner's public rows (a grid's alignRows on that owner's component) is analyzed only after that owner analyzes: rows of a failed owner are unknown, so ADS does not guess them.",
2530
+ guides: ["ads://guides/validation"],
2531
+ repair: "Fix the owner-analysis error of the owner the finding names in blockedBy and check again; the blocked owner is then analyzed. Do not change the blocked owner for this note.",
2532
+ emitters: ["src/owner-analysis-check.mts"],
2533
+ situations: "positioned at the aligned public component; blockedBy names the failed owner at the end of a chain of blocked owners."
2534
+ },
2535
+ "mock-ownership": {
2536
+ group: "boundary",
2537
+ severity: "error",
2538
+ rule: "A mock (mocks/) is a mock of the application's screens. Like an application, it uses only what the design system exports: it renders public components and patterns from @ds with mock data and local state, and carries no design of its own. It is never exported.",
2539
+ guides: ["ads://guides/scenarios", "ads://guides/layers"],
2540
+ repair: "Fix the problem the finding's code names at the reported position; its message carries that code's repair hint.",
2541
+ emitters: ["src/check.mts"],
2542
+ situations: "one id for every mock problem; the fine-grained code (`mock/<kind>`) is in `code`. Every script under mocks/ and every helper it imports is checked; each problem is its own finding."
2543
+ },
2544
+ "owner-analysis-review": {
2545
+ group: "unanalyzable",
2546
+ severity: "review",
2547
+ rule: "What owner analysis cannot prove is shown for review, never blocking: a scroll container's keyboard path, a summary without its marker, truncated text's full text.",
2548
+ guides: ["ads://guides/recipes", "ads://guides/accessibility"],
2549
+ repair: "Read the note's code and repair hint; change the owner when the note applies, otherwise leave it.",
2550
+ emitters: ["src/owner-analysis-check.mts"],
2551
+ situations: "one id for every review note of an analyzed owner; the fine-grained code (`review/<kind>`) is in `code`. Positioned at the selecting class expression of the construction it concerns."
2552
+ },
2553
+ "package-dependency-undeclared": {
2554
+ group: "boundary",
2555
+ severity: "error",
2556
+ rule: "The design package's package.json declares what its emitted output needs: every package the output imports at runtime in dependencies or peerDependencies (peers for what the application must share: the framework, headless libraries holding context), and every package needed only for types in some field. Applications install the design package and get exactly what it declares.",
2557
+ guides: ["ads://guides/workflows"],
2558
+ repair: "Declare the package the message names in the design package's package.json: dependencies, or peerDependencies (with the same package in devDependencies for authoring) when the application must share one copy.",
2559
+ emitters: ["src/package-declarations.mts"],
2560
+ situations: "a runtime import of the output declared only in devDependencies or nowhere; a type-only need declared nowhere; a design package without package.json. Line 1, column 1 of package.json."
2561
+ },
2562
+ "palette-generated": {
2563
+ group: "evidence-missing",
2564
+ severity: "error",
2565
+ rule: "foundation.ads.ts declares the generated palette module (`palette: true`) exactly when the design system keeps palette.generated.ts, and a declared module matches what ADS derives from the token sheets' paint tokens and the declared themes and brands; it is never edited by hand.",
2566
+ guides: ["ads://guides/tokens"],
2567
+ repair: "Run `ads sync` to create or regenerate a declared module (editing directly), or accept the change through a draft, which does it in the candidate; for a module present without the declaration, add `palette: true` to the foundation or delete the file. Change the token sheets or foundation.ads.ts, never the module.",
2568
+ emitters: ["src/emit/palette-module.mts"],
2569
+ situations: "Declared but missing (located at foundation.ads.ts); a colour token or a declared theme or brand changed since the module was written, or it was edited by hand; present without `palette: true` (located at the module)."
2570
+ },
2571
+ "preview-build-failed": {
2572
+ group: "syntax",
2573
+ severity: "error",
2574
+ rule: "Every registered scenario's production preview builds.",
2575
+ guides: ["ads://guides/validation", "ads://guides/runtimes"],
2576
+ repair: "Fix the compile diagnostics in the finding's details, then validate again.",
2577
+ emitters: ["src/validation.mts"]
2578
+ },
2579
+ "project-check": {
2580
+ group: "wrong-value",
2581
+ severity: "error",
2582
+ rule: "acceptance.scripts and validation.scripts name existing package.json scripts, run through a declared npm or bun packageManager, and never call ads validate recursively.",
2583
+ guides: ["ads://guides/validation"],
2584
+ repair: "Correct the script names in ds.config.json, declare packageManager as npm or bun, and list only leaf scripts that do not run ads validate.",
2585
+ emitters: ["src/validation-checks.mts"]
2586
+ },
2587
+ "project-structure": {
2588
+ group: "unresolved-reference",
2589
+ severity: "error",
2590
+ rule: "ds.config.json's dsDir names an existing directory holding the public barrel (index.ts) and foundation.ads.ts.",
2591
+ guides: ["ads://guides/runtimes"],
2592
+ repair: "Bootstrap the design system with `ads init`, or correct dsDir in ds.config.json and add the public barrel and foundation.ads.ts.",
2593
+ emitters: ["src/check.mts"],
2594
+ situations: "render-stopping; stops the check before any other rule runs."
2595
+ },
2596
+ "render-audit": {
2597
+ group: "rendered-check",
2598
+ severity: "error",
2599
+ rule: "Every selected scenario renders and is audited in every brand and theme; a scenario that still fails after its retries is a failure, never a pass.",
2600
+ guides: ["ads://guides/accessibility", "ads://guides/validation"],
2601
+ repair: "Read the cause and fix the scenario's owning source so it renders and stays ready; do not change the scenario to avoid the audit.",
2602
+ emitters: ["src/render-audit.mts"],
2603
+ situations: "Carries the scenario, themes, attempts and cause."
2604
+ },
2605
+ "render-audit-error": {
2606
+ group: "ads-defect",
2607
+ severity: "error",
2608
+ rule: "The render audit runner completes once it starts.",
2609
+ guides: ["ads://guides/validation", "ads://guides/evidence"],
2610
+ repair: "Run again; if it fails the same way, report it with the message and the revision.",
2611
+ emitters: ["src/validation.mts", "src/mcp/mutations.mts"]
2612
+ },
2613
+ "render-audit-nothing-measured": {
2614
+ group: "evidence-missing",
2615
+ severity: "review",
2616
+ rule: "A render assigned overlay or control targets measures at least one of them; when every attempt to open or hover failed (gone, timeout, detached, failed), that render's interactive states are unverified.",
2617
+ guides: ["ads://guides/accessibility"],
2618
+ repair: "Make the scenario's controls stable while it renders (no unmounting, covering or re-rendering of triggers) and run the audit again.",
2619
+ emitters: ["src/render-audit.mts"]
2620
+ },
2621
+ "render-audit-skipped": {
2622
+ group: "evidence-missing",
2623
+ severity: "info",
2624
+ rule: "The audit opens overlays and hovers/focuses controls to measure their states; targets it could not reach are listed by reason, and their states are unmeasured rather than passed.",
2625
+ guides: ["ads://guides/accessibility"],
2626
+ repair: "Usually none; if a target matters, make it reachable in the scenario (an aria-haspopup trigger that opens a dialog/menu/listbox and closes on Escape, a page that settles within 5 s) or split a scenario that exceeds the 3-overlay/6-control limit.",
2627
+ emitters: ["src/render-audit.mts"],
2628
+ situations: "reason overlay-did-not-open, overlay-trigger-gone, overlay-left-open, overlay-timeout, overlay-detached, overlay-failed, overlay-cap, control-gone, control-timeout, control-detached, control-failed, control-cap, content-still-changing, focus-not-reachable. One finding per reason across the run."
2629
+ },
2630
+ "render-audit-unavailable": {
2631
+ group: "environment",
2632
+ severity: "error",
2633
+ rule: "The render audit runs in ADS's own Playwright browser, which ADS installs on first need.",
2634
+ guides: ["ads://guides/validation", "ads://guides/accessibility"],
2635
+ repair: "Let ADS install its browser (it does on first need; the message names the install command if that failed, e.g. offline) or select an installed Chrome with mcp.capture.channel, and run again; acceptance.audit: false turns the audit off for draft acceptance only.",
2636
+ emitters: ["src/validation.mts", "src/mcp/mutations.mts"]
2637
+ },
2638
+ "scenario-coverage": {
2639
+ group: "structure-mismatch",
2640
+ severity: "error",
2641
+ rule: "Every renderable public UI export has a colocated, registered component or pattern scenario with a specimen that renders it (a mock covers nothing); related parts may share one scenario.",
2642
+ guides: ["ads://guides/scenarios"],
2643
+ repair: "Add the export to the covers of a colocated scenario that renders it, or create an <Owner>.ads.scenario.tsx with a fixture that renders it.",
2644
+ emitters: ["src/owner-scenarios.mts"]
2645
+ },
2646
+ "scenario-covers": {
2647
+ group: "unresolved-reference",
2648
+ severity: "error",
2649
+ rule: "A scenario's covers is a nonempty static array, and every entry names a public UI export of the design system.",
2650
+ guides: ["ads://guides/scenarios"],
2651
+ repair: "List the public UI exports the scenario renders in covers, by their exported names.",
2652
+ emitters: ["src/owner-scenarios.mts"],
2653
+ situations: "Covers missing, empty or not an array: the scenario is not registered. covers[i] not a static string, or naming no public export: at that entry, which is left out of the registered covers; the valid entries stand."
2654
+ },
2655
+ "scenario-covers-role": {
2656
+ group: "wrong-value",
2657
+ severity: "error",
2658
+ rule: "covers names rendered UI only: a public behavioral API (a hook, controller, context provider or other callable) belongs in exercises.",
2659
+ guides: ["ads://guides/scenarios", "ads://guides/behaviors"],
2660
+ repair: "Move the behavioral API from covers to exercises.",
2661
+ emitters: ["src/owner-scenarios.mts"],
2662
+ situations: "covers[i] names a public export that is callable or constructible without rendering, or one declared under controllers/: at that entry, which is left out of the registered covers."
2663
+ },
2664
+ "scenario-entry": {
2665
+ group: "structure-mismatch",
2666
+ severity: "error",
2667
+ rule: "A scenario file exports data and subjects only (`scenario`); it has no default export. ADS draws the page and mounts each specimen's `render`.",
2668
+ guides: ["ads://guides/scenarios"],
2669
+ repair: "Remove the default export; move what it rendered into `specimens`, each with a title, an arrangement and a `render` that returns the owners.",
2670
+ emitters: ["src/owner-scenarios.mts"],
2671
+ situations: "A default export in a scenario file. Render-stopping."
2672
+ },
2673
+ "scenario-exercise": {
2674
+ group: "structure-mismatch",
2675
+ severity: "error",
2676
+ rule: "Each API in a scenario's exercises is used by the code the scenario mounts: called, constructed or rendered (a context provider) in a specimen's `render` or an adapter it reaches, event handlers included.",
2677
+ guides: ["ads://guides/scenarios", "ads://guides/behaviors"],
2678
+ repair: "Call the exercised hook or function, construct the controller or render the provider in a specimen's `render` or a rendered adapter, or remove the entry from exercises.",
2679
+ emitters: ["src/owner-scenarios.mts"],
2680
+ situations: "exercises[i] the mounted code never uses: only imported, used in a function nothing reaches, or in an adapter nothing renders. At that entry."
2681
+ },
2682
+ "scenario-exercise-api": {
2683
+ group: "unresolved-reference",
2684
+ severity: "error",
2685
+ rule: "Each exercises entry names a public behavioral API: a hook, controller, context provider or other callable or constructible export of the public barrel.",
2686
+ guides: ["ads://guides/scenarios", "ads://guides/behaviors"],
2687
+ repair: "Name a public behavioral export in exercises (check the barrel's exports first), or remove the entry; rendered UI belongs in covers.",
2688
+ emitters: ["src/owner-scenarios.mts"],
2689
+ situations: "exercises[i] not a static string; naming no public export; naming rendered UI; naming a value that is neither callable nor constructible (an object, a constant, any). At that entry; the scenario stays registered, with its covers. An export whose declaration cannot be read, or whose file does not parse, is owner analysis's finding and its entry is not judged."
2690
+ },
2691
+ "scenario-exercise-review": {
2692
+ group: "unanalyzable",
2693
+ severity: "review",
2694
+ rule: "An exercised API that the mounted code only passes on or reads, without a call ADS can trace, is not shown to run; and one whose type (or what calling it returns) is any, unknown or generic cannot be told apart from rendered UI. ADS never guesses either way.",
2695
+ guides: ["ads://guides/behaviors"],
2696
+ repair: "Call it in a specimen's `render` or a rendered adapter, give it a declared type (a hook's or function's return type, the framework's element type for a component), or verify it in a registered behavior check.",
2697
+ emitters: ["src/owner-scenarios.mts"],
2698
+ situations: "exercises[i] only passed on or read by the mounted code; exercises[i] naming an export typed any or unknown, or whose signatures return any, unknown or a type parameter (and that is not a recipe owner's export). At that entry; never blocking."
2699
+ },
2700
+ "scenario-field": {
2701
+ group: "wrong-value",
2702
+ severity: "error",
2703
+ rule: "A scenario uses only the known fields (id, title, description, covers, exercises, frame, states, specimens, captureTargets), with a nonempty title, exercises as an array, frame from its closed list and states as at most 12 uniquely named prop sets.",
2704
+ guides: ["ads://guides/scenarios", "ads://guides/captures"],
2705
+ repair: "Fix or remove the metadata field the `entry` detail names, using its documented static form.",
2706
+ emitters: ["src/owner-scenarios.mts"],
2707
+ situations: "Unknown field; missing or empty title; empty or non-static description; exercises not an array; frame outside inline, screen, phone; states not an object literal of named sets, with a repeated name or more than 12 names. Render-stopping."
2708
+ },
2709
+ "scenario-identity": {
2710
+ group: "conflict",
2711
+ severity: "error",
2712
+ rule: "Every scenario has one stable identity: a safe id inside its own folder, and no duplicate ids.",
2713
+ guides: ["ads://guides/scenarios", "ads://guides/review"],
2714
+ repair: "Give the scenario an id inside its own folder that no other scenario uses, or omit id to use the identity its path gives it.",
2715
+ emitters: ["src/owner-scenarios.mts"],
2716
+ situations: "Unsafe or foreign id; duplicate id. Render-stopping."
2717
+ },
2718
+ "scenario-location": {
2719
+ group: "boundary",
2720
+ severity: "error",
2721
+ rule: "Scenarios live beside what they preview, under components/, patterns/ or mocks/.",
2722
+ guides: ["ads://guides/scenarios", "ads://guides/layers"],
2723
+ repair: "Move the scenario into the folder of the owner or mock it previews.",
2724
+ emitters: ["src/owner-scenarios.mts"],
2725
+ situations: "A scenario outside components/, patterns/ and mocks/. Render-stopping."
2726
+ },
2727
+ "scenario-markup": {
2728
+ group: "boundary",
2729
+ severity: "error",
2730
+ rule: "A scenario file renders public owners, the scenario kit and its own small components only. ADS draws the page: an HTML or SVG element, a `style` attribute or a component a development file declares (a fixture's or a helper's) is layout nothing checks.",
2731
+ guides: ["ads://guides/scenarios"],
2732
+ repair: "Move text into `title`, `description` and each specimen's `title` and `note`; choose the specimen's `arrangement` and `width`; use the kit (Container, Placeholder, Anchor, EventLog from \"@reqvire-org/ads/showcase\") where the subject needs a sized parent, a stand-in, an overlay's control or a callback's output.",
2733
+ emitters: ["src/owner-scenarios.mts"],
2734
+ situations: "An intrinsic element (<div>, <h1>, <button>, <svg>) anywhere in a scenario file; a `style` attribute on any element; a component declared in another development file (a fixture, a helper). At the element. Under mocks/ the mock rules report markup instead."
2735
+ },
2736
+ "scenario-metadata": {
2737
+ group: "unanalyzable",
2738
+ severity: "error",
2739
+ rule: "A scenario's exported `scenario` metadata is a static literal ADS can read; until it is, coverage for its owner is not established.",
2740
+ guides: ["ads://guides/scenarios"],
2741
+ repair: "Write `export const scenario = { \u2026 }` as a literal (no calls, spreads or computed values).",
2742
+ emitters: ["src/owner-scenarios.mts"],
2743
+ situations: "Owner coverage is not established while this stands, so missing-coverage errors for it are suppressed. Render-stopping."
2744
+ },
2745
+ "scenario-render": {
2746
+ group: "structure-mismatch",
2747
+ severity: "error",
2748
+ rule: "Each public UI name in a scenario's covers is rendered from a specimen's `render`, directly or through a traced parent whose fixture props select that child; imports, unused JSX and unknown conditional paths do not count.",
2749
+ guides: ["ads://guides/scenarios"],
2750
+ repair: "Render the covered public part in the scenario (or pass fixture props that make its parent render it), or remove it from covers if the scenario does not demonstrate it.",
2751
+ emitters: ["src/owner-scenarios.mts"]
2752
+ },
2753
+ "scenario-specimens": {
2754
+ group: "structure-mismatch",
2755
+ severity: "error",
2756
+ rule: "A scenario lists what it shows in `specimens`: a nonempty array literal of object literals, each with a `render` function and optional static `title` and `note`, an `arrangement` (stack, row, tiles) and a `width` (content, full, small, medium).",
2757
+ guides: ["ads://guides/scenarios"],
2758
+ repair: 'Write `specimens: [{ title: "\u2026", arrangement: "row", render: () => <Owner /> }]`, with each field in its documented form.',
2759
+ emitters: ["src/owner-scenarios.mts"],
2760
+ situations: "specimens missing, empty or not an array literal; a specimen that is not an object literal; an unknown specimen field; a specimen without a render function; arrangement or width outside its list; an empty or non-static title or note. At the specimen or its field. A scenario without one mountable specimen is not registered."
2761
+ },
2762
+ "svg-attribute": {
2763
+ group: "wrong-value",
2764
+ severity: "error",
2765
+ rule: "SVG that Preact renders spells presentation attributes as SVG names them (stroke-width), not React-style camelCase (strokeWidth): Preact sets an attribute under the name it is given, so a camelCase one styles nothing.",
2766
+ guides: ["ads://guides/runtimes"],
2767
+ repair: "Rename the attribute to its hyphenated SVG form.",
2768
+ emitters: ["src/check.mts"]
2769
+ },
2770
+ "scenario-source": {
2771
+ group: "syntax",
2772
+ severity: "error",
2773
+ rule: "Every scenario file is part of the analyzed program and parses.",
2774
+ guides: ["ads://guides/scenarios"],
2775
+ repair: "Fix the scenario file's syntax, or make sure it is a TypeScript/JavaScript module inside the design system.",
2776
+ emitters: ["src/owner-scenarios.mts"],
2777
+ situations: "Render-stopping."
2778
+ },
2779
+ "source-changed-during-run": {
2780
+ group: "run-interrupted",
2781
+ severity: "error",
2782
+ rule: "Relevant project source must stay unchanged while a validation or acceptance runs; an external edit to a fenced input stops the run and rejects its result.",
2783
+ guides: ["ads://guides/validation"],
2784
+ repair: "Finish or coordinate the direct edits listed in the diagnostic's sourceChange files, then rerun against the current source.",
2785
+ emitters: ["src/mcp/execution-coordinator.mts"],
2786
+ situations: "chosen when the abort reason code is ADS_SOURCE_CHANGED_DURING_RUN (watcher fence or post-run checkSource); carries sourceChange {files,total,attribution}."
2787
+ },
2788
+ "source-symlink": {
2789
+ group: "boundary",
2790
+ severity: "error",
2791
+ rule: "Validation inputs never resolve through a symlink, so drafts and accepted source stay inside the fenced project boundary.",
2792
+ guides: ["ads://guides/drafts", "ads://guides/validation"],
2793
+ repair: "Replace the symlink with a real file inside the design system.",
2794
+ emitters: ["src/validation-inputs.mts"]
2795
+ },
2796
+ "source-unavailable": {
2797
+ group: "unresolved-reference",
2798
+ severity: "error",
2799
+ rule: "Checked modules import only analysis inputs of this project, not files in assets.generatedPaths, nested projects, drafts or project metadata.",
2800
+ guides: [],
2801
+ repair: "Import the source module instead, or remove the folder from assets.generatedPaths if it is source.",
2802
+ emitters: ["src/check.mts"],
2803
+ situations: "at the importing module's specifier when known, else line 1 of the requested file."
2804
+ },
2805
+ "spatial-context-unsupported": {
2806
+ group: "wrong-value",
2807
+ severity: "error",
2808
+ rule: "A spatial profile's breakpoint widths, column counts and named condition bounds are compiled into media queries and track lists, so they hold one value: no theme, brand or condition context may give such a token another value than the base context.",
2809
+ guides: ["ads://guides/layout", "ads://guides/tokens"],
2810
+ repair: "Keep the token's base value in every context (move the override to a token the grid reads live: a margin, gutter, maximum width or fixed track), or declare another spatial profile for the other grid.",
2811
+ emitters: ["src/grid-checks.mts", "src/owner-analysis-check.mts"],
2812
+ situations: "located at the profile's declaration; one finding per token and value, listing the contexts that set it."
2813
+ },
2814
+ "spatial-profile-invalid": {
2815
+ group: "wrong-value",
2816
+ severity: "error",
2817
+ rule: "Every declared spatial profile, selected by an owner or not, reads through the grid algebra: its units, scale, ratios, maximum width, breakpoints, margins and gutters are valid in the base context and in every theme, brand and condition context that changes a token it reads.",
2818
+ guides: ["ads://guides/layout", "ads://guides/tokens"],
2819
+ repair: "Fix the profile field or token value the message names (in the named context), or delete a profile nothing needs.",
2820
+ emitters: ["src/grid-checks.mts", "src/owner-analysis-check.mts"],
2821
+ situations: "located at the profile's declaration. The base reading is the one grid lowering and the preview facts use; a context is read only when it defines a token the profile reaches differently. An owner selecting the profile reports its own failure at the construction too."
2822
+ },
2823
+ "surface-contrast": {
2824
+ group: "accessibility-semantics",
2825
+ severity: "error",
2826
+ rule: "A surface profile that sets both color and background meets WCAG 2.2 AA for text, 4.5:1, in every context (theme, brand, brand under theme and condition); its background-image gradient stops count as backgrounds. A profile does not say whether its colour paints only non-text UI, so 3:1 is never assumed.",
2827
+ guides: ["ads://guides/accessibility", "ads://guides/tokens"],
2828
+ repair: "Adjust the colour or background token's value in the named context (or point the profile at a pair that contrasts), keeping the pair at 4.5:1 or more.",
2829
+ emitters: ["src/owner-analysis-check.mts"],
2830
+ situations: "located at the profile's declaration; profiles with identical paints (a profile and those composing it unchanged) are one finding naming them all. Owner states that pair one profile's colour with another's background are checked by owner analysis (construction/state-contrast-insufficient)."
2831
+ },
2832
+ "surface-contrast-unresolved": {
2833
+ group: "unanalyzable",
2834
+ severity: "review",
2835
+ rule: "A surface profile's text contrast is proven from tokens: its colour and background resolve to colours, the background is opaque, its opacity is 1 and any background image is a gradient of known colours. Otherwise the pair is reviewed, never treated as passing.",
2836
+ guides: ["ads://guides/accessibility", "ads://guides/tokens"],
2837
+ repair: "Use an opaque background token (and no element opacity) for text surfaces, or check the rendered contrast by hand with in the named context.",
2838
+ emitters: ["src/owner-analysis-check.mts"],
2839
+ situations: "located at the profile's declaration: a translucent background, an opacity below 1, an image that is not a gradient, currentColor or a colour ADS does not resolve statically."
2840
+ },
2841
+ "component-contrast": {
2842
+ group: "accessibility-semantics",
2843
+ severity: "error",
2844
+ rule: "Text meets WCAG 2.2 AA (4.5:1, or 3:1 where its text profile is provably large) against the backdrop it is rendered on: the nearest opaque background of the elements and owners around it, across files, with translucent backgrounds and known gradients composited, in every theme, brand and condition context. A public component is also placed by applications on the document surface foundation.ads.ts declares.",
2845
+ guides: ["ads://guides/accessibility", "ads://guides/tokens"],
2846
+ repair: "Choose a surface for the text whose colour contrasts with the surface it is rendered on, render the component on another surface, use large text where 3:1 suffices, or adjust the token in the named context.",
2847
+ emitters: ["src/composed-contrast.mts", "src/owner-analysis-check.mts"],
2848
+ situations: "located at the surface that chose the text's colour (the backdrop's when the colour is the document's); `related` names the backdrop, the placements and the slots between them, `tokens` the pair and `contexts` every failing context that differs from the one it extends. A pair one element sets entirely is surface-contrast's or construction/state-contrast-insufficient's. Inactive (disabled) and hidden text has no minimum; an application's own coloured container is outside the design system."
2849
+ },
2850
+ "component-contrast-unresolved": {
2851
+ group: "unanalyzable",
2852
+ severity: "review",
2853
+ rule: "Composed text contrast is proven from the owners' facts and tokens: the text's colour and backdrop resolve along its elements and owners. What cannot be (a wrapper component ADS does not analyze, a user-agent colour or fill, an out-of-flow element without its own backdrop, opacity, an image that is not a gradient of known colours, a data-theme subtree, an expression that may be text, an analysis limit) is reviewed, never treated as passing.",
2854
+ guides: ["ads://guides/accessibility"],
2855
+ repair: "Give the element or its renderer an opaque surface whose colour ADS can read, or cover the placement with a scenario so the render audit measures it.",
2856
+ emitters: ["src/composed-contrast.mts", "src/owner-analysis-check.mts"],
2857
+ situations: "located at the element, surface or placement whose paint breaks the proof; one item per position and reason, at its first context."
2858
+ },
2859
+ "theme-undefined": {
2860
+ group: "project-files",
2861
+ severity: "error",
2862
+ rule: 'Every non-default theme foundation.ads.ts declares is defined: a token sheet sets values under [data-theme="<name>"], or an asset variant draws it.',
2863
+ guides: ["ads://guides/tokens"],
2864
+ repair: 'Give the theme token values under :root[data-theme="<name>"] in a token sheet (or an asset variant with theme "<name>"), or remove it from foundation.ads.ts themes.',
2865
+ emitters: ["src/owner-analysis-check.mts"],
2866
+ situations: "positioned at the theme's entry in foundation.ads.ts. The first theme is the default: its values are the :root values."
2867
+ },
2868
+ "token-overlap-review": {
2869
+ group: "conflict",
2870
+ severity: "review",
2871
+ rule: "Tokens of one role with identical definitions in every theme, brand and condition scope are reviewed as possible duplicates of one design decision.",
2872
+ guides: ["ads://guides/tokens"],
2873
+ repair: "If they express the same decision, reuse one token or alias one to the other; otherwise keep both distinct roles.",
2874
+ emitters: ["src/token-overlap.mts", "src/owner-analysis-check.mts"],
2875
+ situations: "one note per group of identical tokens, at the second token's first definition; definitions compare as authored, so two aliases of one token are identical."
2876
+ },
2877
+ "token-provenance": {
2878
+ group: "wrong-value",
2879
+ severity: "error",
2880
+ rule: "Every authored token reference obeys the one-way role routes and its operation or composite position: a matching CSS type alone does not authorize a derivation. A token's own numeric value is role-checked inside any function; a colour, shadow or gradient reads references only in the forms ADS lists, because the position decides the role there.",
2881
+ guides: ["ads://guides/tokens"],
2882
+ repair: "Use a token of the position's permitted role, derive a named geometric decision from spacing, or author a shared literal in its role sheet. Use ads-half-border() only for a border-derived grid gutter; keep line-height independent of font-size. Inside a colour, shadow or gradient use a listed form; one ADS does not list is added by an ADS release, not worked around.",
2883
+ emitters: ["src/token-provenance.mts", "src/owner-analysis-check.mts"],
2884
+ situations: "at each forbidden authored reference or malformed registered operation, including unused tokens, overrides and fallbacks. Colour operands, alpha and composite geometry have separate contracts; unsupported reference-bearing colour forms, and unlisted functions around a numeric input of a colour, shadow or gradient, are errors. Missing names retain token-css/token-missing."
2885
+ },
2886
+ "token-type": {
2887
+ group: "wrong-value",
2888
+ severity: "error",
2889
+ rule: "Every token resolves, in every context (the base, each theme, each brand, each brand under each theme, and under each condition), to a value of its role sheet's shape (paint is a color, spacing a nonnegative length, duration a nonnegative time, \u2026).",
2890
+ guides: ["ads://guides/tokens"],
2891
+ repair: "Give the token (or the alias it resolves through) a value of its role's shape in the named context, or move it to the sheet of the role it really is.",
2892
+ emitters: ["src/token-type-check.mts", "src/owner-analysis-check.mts"],
2893
+ situations: "located at the defining declaration in the token sheet; the message names the token, its role, the first failing context and the expected shape. A sheet whose file name is not a role is reported here too."
2894
+ },
2895
+ "token-role-duplicate": {
2896
+ group: "conflict",
2897
+ severity: "error",
2898
+ rule: "A token has one role, the file name of its sheet: every declaration of it, its :root default and each theme or brand override, is in that one role sheet.",
2899
+ guides: ["ads://guides/tokens"],
2900
+ repair: "Move the declaration to the sheet that first declares the token (its role), or rename one of the two tokens if they are different decisions.",
2901
+ emitters: ["src/token-sheet-check.mts", "src/owner-analysis-check.mts"],
2902
+ situations: "located at each declaration in a sheet after the first one that declares the token; the message names the first sheet and both roles."
2903
+ },
2904
+ "token-selector-invalid": {
2905
+ group: "structure-mismatch",
2906
+ severity: "error",
2907
+ rule: 'Token sheets declare tokens only in token contexts: :root, :root[data-theme="<name>"], :root[data-brand="<name>"] or both, directly or inside @media, @supports or @layer. A rule under any other selector forms no context: its values would be left out of every check and emitted as written.',
2908
+ guides: ["ads://guides/tokens"],
2909
+ repair: "Move the declaration into a :root, theme or brand rule (under @media or @supports for a condition); style a selector in a recipe instead.",
2910
+ emitters: ["src/token-sheet-check.mts", "src/owner-analysis-check.mts"],
2911
+ situations: "located at each declaration under the selector or wrapper; a theme or brand override of a token with no :root default is not this rule: each bare reference to it is token-css/token-missing."
2912
+ },
2913
+ "token-sheet-property": {
2914
+ group: "structure-mismatch",
2915
+ severity: "error",
2916
+ rule: "Token sheets declare tokens only: custom properties (--name). A declaration of an ordinary CSS property (`:root { color: red }`) is no token, belongs to no role and styles outside every recipe; ADS does not read it as a token.",
2917
+ guides: ["ads://guides/tokens"],
2918
+ repair: "Remove the declaration. Style an element through its recipe, and the document through foundation({ text, surface }); a value meant to be shared is a token (--name) of its role.",
2919
+ emitters: ["src/token-sheet-check.mts", "src/owner-analysis-check.mts"],
2920
+ situations: "located at each such declaration, in any rule or at-rule of a token sheet except @property descriptors."
2921
+ },
2922
+ "token-type-unresolved": {
2923
+ group: "unanalyzable",
2924
+ severity: "review",
2925
+ rule: "A token's value shape is proven statically in every context; a value ADS cannot read (calc() mixing units for a bounded role, an unknown function, currentColor, a context-only token unavailable here) is reviewed, never treated as checked. A nowhere-declared reference instead has the primary token-css/token-missing error.",
2926
+ guides: ["ads://guides/tokens"],
2927
+ repair: "Prefer a literal of the role's shape or an alias of one; when the expression is deliberate, check its value by hand in the named context.",
2928
+ emitters: ["src/owner-analysis-check.mts"],
2929
+ situations: "located at the defining declaration in the token sheet."
2930
+ },
2931
+ "validation-baseline": {
2932
+ group: "ads-defect",
2933
+ severity: "error",
2934
+ rule: "A successful full validation publishes its baseline to .ds/validation-baseline.json (or a deferred .ds acceptance/validation baseline); if the write fails the run is reported as failed.",
2935
+ guides: ["ads://guides/validation"],
2936
+ repair: "Check that the project's .ds directory is writable, then rerun the validation; report the error if it names an invalid baseline target.",
2937
+ emitters: ["src/validation.mts", "src/mcp/execution-coordinator.mts"],
2938
+ situations: '(1) direct baseline write failure in validation.mts; (2) deferred commit failure in the coordinator, including "Invalid deferred baseline target." (an ADS defect).'
2939
+ },
2940
+ "validation-behavior": {
2941
+ group: "behavior-failed",
2942
+ severity: "error",
2943
+ rule: "Validation passes only when every registered behavior check it reaches passes.",
2944
+ guides: ["ads://guides/validation", "ads://guides/behaviors"],
2945
+ repair: "Inspect the recorded outcomes with ads_results and ads_investigate, fix the failing owner's behavior and validate again.",
2946
+ emitters: ["src/validation.mts"],
2947
+ situations: "emitted only when the verification failed without diagnostics of its own."
2948
+ },
2949
+ "validation-cancelled": {
2950
+ group: "run-interrupted",
2951
+ severity: "error",
2952
+ rule: "A cancelled validation establishes no result and advances no baseline.",
2953
+ guides: ["ads://guides/validation"],
2954
+ repair: "Run ads_validate again when it is no longer being cancelled.",
2955
+ emitters: ["src/validation.mts"]
2956
+ },
2957
+ "validation-execution": {
2958
+ group: "ads-defect",
2959
+ severity: "error",
2960
+ rule: "Each validation stage reports its own diagnostics; an uncaught error in a stage stops the validation and fails it.",
2961
+ guides: ["ads://guides/validation"],
2962
+ repair: "Read the message; fix a named project condition (for example a preview build or configuration error) and validate again, otherwise report it with the run ID.",
2963
+ emitters: ["src/validation.mts"],
2964
+ situations: "generic catch around selection, preview build, verified-previews and behavior stages (errors without .diagnostic, when not aborted)."
2965
+ },
2966
+ "validation-inputs": {
2967
+ group: "evidence-missing",
2968
+ severity: "error",
2969
+ rule: "A validation result is current only when ADS can re-read its inputs after the run and match the captured revision; failing to read them leaves the result unestablished.",
2970
+ guides: ["ads://guides/validation"],
2971
+ repair: "Fix the error the message names (usually configuration or a declared validation.inputs path), then validate again.",
2972
+ emitters: ["src/validation.mts"]
2973
+ },
2974
+ "validation-previews": {
2975
+ group: "evidence-missing",
2976
+ severity: "error",
2977
+ rule: "Validation requires a current verified production preview for every registered scenario; a successful build command alone is not enough.",
2978
+ guides: ["ads://guides/validation", "ads://guides/runtimes"],
2979
+ repair: "Wait for the named scenario's preview to become current (ads_status.build), then validate again.",
2980
+ emitters: ["src/validation.mts"],
2981
+ situations: "Preview pending, building or stale."
2982
+ },
2983
+ "validation-stale": {
2984
+ group: "run-interrupted",
2985
+ severity: "error",
2986
+ rule: "Validation evidence belongs only to the source revision it started on; if project inputs changed during the run, the result is rejected.",
2987
+ guides: ["ads://guides/validation"],
2988
+ repair: "Let the edits finish, then rerun ads_validate against the current source.",
2989
+ emitters: ["src/validation.mts"]
2990
+ }
2991
+ }, ownerErrors = {
2992
+ "typescript-diagnostics": {
2993
+ group: "syntax",
2994
+ rule: "Owner and scenario source type-checks; analysis needs a type-correct program.",
2995
+ guides: ["ads://guides/validation"],
2996
+ message: (failure) => `Authoring TypeScript reports ${failure.diagnostics.length} diagnostic(s).`,
2997
+ repair: "Fix the TypeScript errors in the design system's source."
2998
+ }
2999
+ }, mockErrors = {
3000
+ "re-export": {
3001
+ group: "boundary",
3002
+ rule: "A mock re-exports nothing: it is a mock of the application's screens, never a module of the design system.",
3003
+ guides: ["ads://guides/scenarios"],
3004
+ message: (problem) => `The mock re-exports from ${problem.specifier}.`,
3005
+ repair: "Import what the mock renders and remove the re-export."
3006
+ },
3007
+ "design-import": {
3008
+ group: "boundary",
3009
+ rule: "A mock reaches the design system through its public entry (`@ds`), as an application does: a relative import leads only to its own captured helpers and media under `mocks/`, and it imports none of ADS's authoring macros.",
3010
+ guides: ["ads://guides/scenarios", "ads://guides/layers"],
3011
+ message: (problem) => `The mock imports ${problem.specifier}: design is authored in the design system's own files, and a mock reaches it through \`@ds\`.`,
3012
+ repair: "Import the owner from `@ds`; move fixture data into a captured `*.ads.fixture.ts` helper and media under the mock's `media/` folder."
3013
+ },
3014
+ "helper-missing": {
3015
+ group: "unresolved-reference",
3016
+ rule: "A mock's relative import is a captured script of the revision (a fixture or helper) or its own media.",
3017
+ guides: ["ads://guides/scenarios"],
3018
+ message: (problem) => `${problem.specifier} resolves to no captured script or mock media.`,
3019
+ repair: "Correct the path, or add the helper beside the mock."
3020
+ },
3021
+ "dynamic-dependency": {
3022
+ group: "unanalyzable",
3023
+ rule: "A mock's code is static: no `import()`, `require`, `eval`, `Function` or tagged templates.",
3024
+ guides: ["ads://guides/scenarios"],
3025
+ message: (problem) => `The mock uses ${problem.form}.`,
3026
+ repair: "Import statically and pass plain values as props."
3027
+ },
3028
+ "component-outside-pattern": {
3029
+ group: "design-bypass",
3030
+ rule: "A pattern arranges the screen and a component fills a pattern: in a mock, a public component appears only as a pattern's child or in the value of a pattern's prop.",
3031
+ guides: ["ads://guides/scenarios", "ads://guides/layers"],
3032
+ message: (problem) => `The mock renders the component ${problem.name} outside every pattern, so nothing owns its place on the screen.`,
3033
+ repair: "Render it inside the pattern that arranges this screen (as its child or in a slot prop); if no pattern does, add one. A surface that stands alone on a screen, such as a dialog, is a pattern."
3034
+ },
3035
+ "local-markup": {
3036
+ group: "design-bypass",
3037
+ rule: "A mock's JSX renders what it imports from the design system (`@ds`), components and patterns alike: no native elements or local components laying out or wrapping them.",
3038
+ guides: ["ads://guides/scenarios", "ads://guides/layout"],
3039
+ message: (problem) => `The mock renders <${problem.tag}>, which is not imported from the design system.`,
3040
+ repair: "Render public owners directly; an arrangement the screen needs belongs in a pattern."
3041
+ },
3042
+ "spread-props": {
3043
+ group: "unanalyzable",
3044
+ rule: "A mock passes explicit props: a spread could carry design ADS cannot see.",
3045
+ guides: ["ads://guides/scenarios"],
3046
+ message: () => "The mock spreads props into an owner.",
3047
+ repair: "Pass each prop explicitly."
3048
+ },
3049
+ "design-prop": {
3050
+ group: "design-bypass",
3051
+ rule: "A mock supplies no design through props: no `style`, `className`, `css` or `dangerouslySetInnerHTML`.",
3052
+ guides: ["ads://guides/scenarios"],
3053
+ message: (problem) => `The mock passes ${problem.attribute}.`,
3054
+ repair: "Remove the prop; choose the treatment through the owner's own finite props."
3055
+ },
3056
+ "imperative-design": {
3057
+ group: "design-bypass",
3058
+ rule: "A mock writes no styles and creates no DOM imperatively.",
3059
+ guides: ["ads://guides/scenarios"],
3060
+ message: (problem) => `The mock uses ${problem.member}.`,
3061
+ repair: "Remove the imperative write; render owners with props."
3062
+ },
3063
+ "hidden-definition": {
3064
+ group: "design-bypass",
3065
+ rule: "A mock hides no design definitions in strings: no recipe or profile directives and no custom-property references.",
3066
+ guides: ["ads://guides/scenarios", "ads://guides/tokens"],
3067
+ message: () => "A string in the mock carries a recipe, profile or custom-property reference.",
3068
+ repair: "Remove the definition; design belongs in owners, profiles and token sheets."
3069
+ }
3070
+ }, reviewErrors = {
3071
+ "scroll-unreachable": {
3072
+ group: "accessibility-semantics",
3073
+ rule: "A scroll container is reachable by keyboard: it or content inside it is focusable. Some browsers (Safari) do not focus a scroller on their own.",
3074
+ guides: [RECIPES, "ads://guides/accessibility"],
3075
+ message: (review) => `${review.part === "&" ? "The root" : `Part "${review.part}"`} scrolls, but neither it nor owned content in it is focusable.`,
3076
+ repair: "Give the scroll container `tabIndex={0}` and an accessible name when its content holds nothing focusable; ignore this note when public components inside it are focusable."
3077
+ },
3078
+ "marker-none-unlabelled": {
3079
+ group: "accessibility-semantics",
3080
+ rule: "A summary without its disclosure marker shows its open state another way: artwork that changes with the owner's open state.",
3081
+ guides: [RECIPES, "ads://guides/accessibility"],
3082
+ message: (review) => `Summary ${review.part === "&" ? "root" : `part "${review.part}"`} removes its marker and renders no artwork.`,
3083
+ repair: "Render a chevron (a visual part or a public Icon) chosen by the controlled open state, or keep the native marker."
3084
+ },
3085
+ "truncated-text-unnamed": {
3086
+ group: "accessibility-semantics",
3087
+ rule: "Truncated or clamped text keeps its full text available to sighted readers: a `title` with the same text, an expand control or the full content elsewhere (assistive technology reads the full text already). Analysis sees only a `title`.",
3088
+ guides: [RECIPES, "ads://guides/accessibility"],
3089
+ message: (review) => `Part "${review.part}" truncates its text without a title.`,
3090
+ repair: "Set `title` on the truncated element to its full text; when an expand control or the full content elsewhere shows it, the note can be dismissed after review."
3091
+ },
3092
+ "balance-on-paragraph": {
3093
+ group: "wrong-value",
3094
+ rule: '`wrap: "balance"` evens out the line lengths of headings and short titles (browsers balance only a few lines); a paragraph is body text, whose breaks `wrap: "pretty"` improves. Analysis reads the rendered element, not the text\'s length.',
3095
+ guides: [RECIPES],
3096
+ message: (review) => `Part "${review.part}" balances its line breaks, but it is rendered as a <p>, a paragraph of body text.`,
3097
+ repair: 'Use `wrap: "pretty"` for body text, or render the heading as a heading element (`<h1>`\u2013`<h6>`); a short title kept in a paragraph can keep balance after review.'
3098
+ },
3099
+ "user-select-text": {
3100
+ group: "accessibility-semantics",
3101
+ rule: '`userSelect: "none"` belongs on handles and grips, which show no text: on an element that shows text (a text part or treatment, or text parts inside it) users cannot select or copy that text.',
3102
+ guides: [RECIPES, "ads://guides/accessibility"],
3103
+ message: (review) => `${review.element === "&" ? "The root" : `Part "${review.element}"`} suppresses text selection, but it shows text.`,
3104
+ repair: 'Move `userSelect: "none"` to the handle or grip part that starts the drag, or remove it; ignore this note when the text is a label of the handle itself.'
3105
+ },
3106
+ "touch-action-unhandled": {
3107
+ group: "accessibility-semantics",
3108
+ rule: '`touchAction: "none"` hands every touch gesture on the element to the owner: its markup handles pointer or touch events (`onPointerDown`, `onTouchStart`, \u2026), or the element cannot be scrolled, zoomed or used on a touch screen.',
3109
+ guides: [RECIPES, "ads://guides/accessibility"],
3110
+ message: (review) => `${review.element === "&" ? "The root" : `Part "${review.element}"`} disables touch gestures, but the owner's markup handles no pointer or touch events.`,
3111
+ repair: "Handle the gesture on the element (`onPointerDown` with `setPointerCapture`, then `onPointerMove`/`onPointerUp`), use `pan-x` or `pan-y` to keep scrolling on the other axis, or remove `touchAction`; ignore this note when a declared behaviour library attaches the listeners."
3112
+ },
3113
+ "frame-region-unresolved": {
3114
+ group: "unanalyzable",
3115
+ rule: "A grid cell's or tile's fixed-size frames are proven to fit their region from the grid algebra; where it cannot bound the region (inherited tracks, a placement outside a named condition above its bound, a tile narrower than its tile size, a public component in the way) or a size or inset is not a length ADS evaluates, the frame is reviewed, never passed. A public component placed as a cell or tile is reviewed too: its frame is its own owner's, which the placing owner does not see.",
3116
+ guides: [RECIPES, "ads://guides/layout"],
3117
+ message: (review) => `${framePlace(review)} ${review.frame} cannot be proven to fit its region under ${review.context}: ${review.reason}.`,
3118
+ repair: "Check the cell at narrow widths (ads audit renders the overflow check), or cap the frame to its region with a `max-inline-size` of 100%."
3119
+ },
3120
+ "target-size-unresolved": {
3121
+ group: "unanalyzable",
3122
+ rule: "A control's target size is proven from tokens in every context; a value ADS cannot evaluate in px (a percentage, a viewport unit), or an inline extent that reaches 24px only with its label's width (text is data), is reviewed, never passed.",
3123
+ guides: [RECIPES, "ads://guides/accessibility"],
3124
+ message: (review) => `${review.element === "&" ? "The control" : `Part "${review.element}"`} cannot be proven to be a 24 \xD7 24px target under ${contextNames(review.contexts)}: ${review.reason}.`,
3125
+ repair: "Give the frame a min-block-size and padding (or a min-target-inline-size hit area) that reach 24px without the label, or check the rendered target in that context (ads audit runs axe target-size)."
3126
+ },
3127
+ "boundary-identified-otherwise": {
3128
+ group: "accessibility-semantics",
3129
+ rule: "A text-entry control whose boundary is below 3:1 (WCAG 1.4.11) passes only with a human-approved `accessibility` declaration saying how it is identified otherwise; every such control is listed on every run, never silently.",
3130
+ guides: [RECIPES, "ads://guides/accessibility", "ads://guides/forms"],
3131
+ message: (review) => `Part "${review.element}" has a boundary below 3:1 (${review.ratio}:1 under ${review.context}); it is declared identified by ${review.boundary === "visible-label" ? "its visible label" : "a boundary shown on hover and focus"}: "${review.reason}".`,
3132
+ repair: "Keep it only if a person approved it and the design still matches the reason. Otherwise make the control pass (a 3:1 fill, or one 3:1 border side such as a soft field's underline) and remove the declaration."
3133
+ },
3134
+ "context-section-inactive": {
3135
+ group: "wrong-value",
3136
+ rule: "Without `foundation({ sections: true })` only the document root selects a theme or brand: a `data-theme` or `data-brand` set on design-system markup switches no tokens there (a construction root's data-theme that selects its themed artwork is exempt).",
3137
+ guides: [RECIPES, "ads://guides/tokens"],
3138
+ message: (review) => `This <${review.element}> sets ${review.attribute}, but the foundation does not declare nested sections, so it switches no tokens: its subtree keeps the document's ${review.attribute === "data-theme" ? "theme" : "brand"}.`,
3139
+ repair: "Declare `sections: true` in foundation.ads.ts to make nested theme and brand sections switch tokens, or remove the attribute."
3140
+ },
3141
+ "accessibility-declaration-unnecessary": {
3142
+ group: "accessibility-semantics",
3143
+ rule: "An `accessibility` declaration covers a control that cannot pass 3:1; on a control whose boundary or fill already passes it is stale.",
3144
+ guides: [RECIPES, "ads://guides/accessibility"],
3145
+ message: (review) => `Part "${review.element}" declares accessibility boundary "${review.boundary}", but its boundary already reaches 3:1: the declaration is unnecessary.`,
3146
+ repair: "Remove the declaration."
3147
+ },
3148
+ "non-text-contrast-unresolved": {
3149
+ group: "accessibility-semantics",
3150
+ rule: "A control part's border and focus contrast against its surroundings is proven from tokens; a translucent background, an unresolved colour or an offset ADS cannot evaluate is reviewed, never passed.",
3151
+ guides: [RECIPES, "ads://guides/accessibility"],
3152
+ message: (review) => `The ${review.paint === "border" ? "border" : "focus outline"} contrast of part "${review.element}"${review.state === null ? "" : ` (state ${review.state})`} cannot be proven under ${review.context}: ${review.reason}.`,
3153
+ repair: "Check the rendered boundary and focus indicator by hand (ads audit), or use opaque colour tokens for the control and its surroundings."
3154
+ },
3155
+ "target-area-overlap-unresolved": {
3156
+ group: "unanalyzable",
3157
+ rule: "Whether neighbouring hit areas overlap is proven from tokens; when a label's width (data) or a value ADS cannot evaluate decides it, it is reviewed, never passed.",
3158
+ guides: [RECIPES, "ads://guides/accessibility"],
3159
+ message: (review) => `Whether the hit areas of parts "${review.elements[0]}" and "${review.elements[1]}" overlap cannot be proven under ${contextNames(review.contexts)}: ${review.reason}.`,
3160
+ repair: "Widen the gap to cover the hit areas' full reach, or check the rendered spacing by hand."
3161
+ },
3162
+ "click-without-keyboard": {
3163
+ group: "accessibility-semantics",
3164
+ rule: "An `onClick` on a non-interactive element (div, span, li, img and similar) without a role and `tabIndex` cannot be reached or used from the keyboard (WCAG 2.2 2.1.1), unless a delegated or wrapping control handles it. Items of composite widgets (option, menuitem, tab, row, gridcell, \u2026) and backdrops whose handler reads `currentTarget` are exempt.",
3165
+ guides: ["ads://guides/accessibility"],
3166
+ message: (review) => `<${review.element} onClick> cannot be reached or used from the keyboard.`,
3167
+ repair: "Use a <button> for the action, or give the element a role, tabIndex and a key handler; when a wrapping control already handles it, leave it."
3168
+ },
3169
+ "pressed-state-unresolved": {
3170
+ group: "unanalyzable",
3171
+ rule: "A toggle drawing selectable artwork exposes its state through `aria-pressed`; when its value is not a finite value analysis can pair with the drawn state (WCAG 2.2 4.1.2), the agreement is reviewed, never assumed.",
3172
+ guides: ["ads://guides/accessibility"],
3173
+ message: (review) => `aria-pressed cannot be paired with the ${review.state} drawing of ${review.asset}.`,
3174
+ repair: 'Choose aria-pressed and the drawing in one choice table entry (a boolean or "true"/"false"), or check by hand that the drawing follows the pressed state.'
3175
+ },
3176
+ "measured-unused": {
3177
+ group: "structure-mismatch",
3178
+ rule: "A measured value the recipe declares is written by the owner (`recipe.measured.set`): an unused declaration is a stale permission.",
3179
+ guides: [RECIPES],
3180
+ message: (review) => `Measured value "${review.name}" is declared but the owner never sets it.`,
3181
+ repair: "Set it with `recipe.measured.set(element, { \u2026 })` where the owner measures it, or remove the declaration."
3182
+ },
3183
+ "paint-unused": {
3184
+ group: "structure-mismatch",
3185
+ rule: "A runtime paint the recipe declares is written by the owner (`recipe.paints.set`): an unused declaration is a stale permission.",
3186
+ guides: [RECIPES],
3187
+ message: (review) => `Runtime paint "${review.name}" is declared but the owner never sets it.`,
3188
+ repair: "Set it with `recipe.paints.set(element, { \u2026 })` where the owner reads its data, or remove the declaration."
3189
+ },
3190
+ "paint-contrast-unresolved": {
3191
+ group: "accessibility-semantics",
3192
+ rule: "A runtime paint's contrast over its declared values is proven from tokens against the background the construction knows; an element painting on its parent's background, a translucent background or an unresolved colour is reviewed, never passed.",
3193
+ guides: [RECIPES, "ads://guides/accessibility"],
3194
+ message: (review) => `The contrast of runtime paint "${review.name}" on ${review.element === "&" ? "the root" : `part "${review.element}"`} cannot be proven: ${review.reason}.`,
3195
+ repair: "Give the element (or the root it sits in) a surface with an opaque background colour token, or check the rendered paints in every context by hand (ads audit)."
3196
+ },
3197
+ "state-contrast-unresolved": {
3198
+ group: "accessibility-semantics",
3199
+ rule: "An element's owner states pair colours and backgrounds whose contrast ADS proves from tokens; a translucent or unresolvable pair is reviewed, never passed.",
3200
+ guides: [RECIPES, "ads://guides/accessibility"],
3201
+ message: (review) => `${review.element === "&" ? "The root" : `Part "${review.element}"`}: colour of ${review.surfaces[0]} (state ${review.states[0] ?? "base"}) on background of ${review.surfaces[1]} (state ${review.states[1] ?? "base"}) cannot be proven under ${review.context}: ${review.reason}.`,
3202
+ repair: "Check the state's rendered contrast by hand (ads audit), or give the state an opaque surface that sets both colour and background."
3203
+ },
3204
+ "autocomplete-missing": {
3205
+ group: "accessibility-semantics",
3206
+ rule: 'A text control whose name, id or type says what it collects states its autofill token (`autoComplete`, WCAG 1.3.5), so autofill and password managers fill it correctly; `autoComplete="off"` states that it must not be filled. ADS suggests the token from the literal attribute values, a heuristic.',
3207
+ guides: [FORMS, "ads://guides/accessibility"],
3208
+ message: (review) => `<${review.element}> looks like it collects ${review.suggestion} but states no autoComplete.`,
3209
+ repair: 'Set `autoComplete` to the field\'s HTML autofill token (the message suggests one), or `"off"` when it must not be filled; on a public component, pass it through its `autoComplete` prop. Ignore this note when the suggestion is wrong.'
3210
+ },
3211
+ "press-scale-large-surface": {
3212
+ group: "wrong-value",
3213
+ rule: 'A press scale is relative: the same factor moves a large element much further than a small one. A container root (`frame: "container"`, a card or tile surface) presses by a surface-class factor of at least 0.98 (about 1\u20132px per side on a 300px card) in every context, or not at all.',
3214
+ guides: [RECIPES],
3215
+ message: (review) => review.factor === null ? `The root's press under ${review.condition} reads a scale from motion profile "${review.motion}" that ADS cannot read as a number under ${review.context}; it may lurch on a surface this large.` : `The root presses to ${review.factor} under ${review.condition} (motion profile "${review.motion}", ${review.context}): below ${review.minimum}, a surface this large lurches by several pixels per side.`,
3216
+ repair: "Select a surface-class press profile (factor at least 0.98, such as `press-surface`) through the composite's motion slot, or declare no press scale on the root; ignore this note when a stronger press on this surface is deliberate."
3217
+ }
3218
+ }, nested = {
3219
+ owner: ["source", "compile", "token-css", "design-inputs", "discovery"],
3220
+ source: ["choice", "recipe-rejected", "spec-reference", "spec", "construction"],
3221
+ construction: ["lowering", "profile", "token-css", "design"],
3222
+ foundation: ["registration"],
3223
+ compile: ["runtime-incompatible", "extraction"]
3224
+ };
3225
+ const tables = {
3226
+ owner: ownerErrors,
3227
+ source: sourceErrors,
3228
+ choice: choiceErrors,
3229
+ discovery: discoveryErrors,
3230
+ spec: specErrors,
3231
+ construction: constructionErrors,
3232
+ lowering: loweringErrors,
3233
+ foundation: foundationErrors,
3234
+ contexts: contextErrors,
3235
+ assets: assetErrors,
3236
+ fonts: fontErrors,
3237
+ "token-css": tokenCssErrors,
3238
+ registration: registrationErrors,
3239
+ compile: compileErrors,
3240
+ extraction: extractionErrors,
3241
+ runtime: runtimeErrors,
3242
+ rejection: rejectionErrors,
3243
+ check: checkErrors,
3244
+ review: reviewErrors,
3245
+ mock: mockErrors
3246
+ };
3247
+ export const adsErrorCodes = new Map(Object.entries(tables).flatMap(([domain, table]) => Object.entries(table).map(([kind, entry]) => [`${domain}/${kind}`, { group: entry.group, rule: { statement: entry.rule, guides: entry.guides }, repair: entry.repair }])));
3248
+ export function codesByGroup() {
3249
+ const groups = new Map(Object.keys(errorGroups).sort((a, b) => errorGroups[a].order - errorGroups[b].order).map((group) => [group, []]));
3250
+ for (const [code, { group }] of adsErrorCodes)
3251
+ groups.get(group)?.push(code);
3252
+ return groups;
3253
+ }
3254
+ export const productGaps = {
3255
+ location: ["foundation/*", "registration/*", "rejection/*", "token-css/fold-unsupported"],
3256
+ candidates: [
3257
+ "source/recipe-macro-unknown",
3258
+ "source/asset-unknown",
3259
+ "source/theme-unknown",
3260
+ "source/module-unresolved",
3261
+ "choice/part-unknown",
3262
+ "construction/profile-field-missing",
3263
+ "token-css/token-missing",
3264
+ "registration/role-unknown",
3265
+ "discovery/export-unresolved"
3266
+ ],
3267
+ expected: [
3268
+ "spec/field-unsupported",
3269
+ "construction/profile-field-unsupported",
3270
+ "construction/paint-unsupported",
3271
+ "construction/spatial-clause-unsupported",
3272
+ "registration/syntax-outside-role",
3273
+ "registration/initial-out-of-bounds",
3274
+ "registration/definition-out-of-bounds",
3275
+ "registration/role-not-registrable"
3276
+ ]
3277
+ }, errorGuideUri = (group) => group === void 0 ? "ads://guides/errors" : `ads://guides/errors/${group}`;
3278
+ const groupsInOrder = () => Object.keys(errorGroups).sort((a, b) => errorGroups[a].order - errorGroups[b].order), guideLinks = (guides) => guides.map((guide) => plannedGuides.includes(guide) ? `${guide} (planned)` : guide).join(", ");
3279
+ export function errorCatalogGuide() {
3280
+ const codes = codesByGroup();
3281
+ return `${[
3282
+ "# ADS errors",
3283
+ "",
3284
+ "Every acceptance error has a code (`<domain>/<kind>`), a group, the rule it breaks, a repair hint and the guides that explain the rule.",
3285
+ "Fix errors in group order: earlier groups are often the cause of later ones. Accept again after each group.",
3286
+ "",
3287
+ "- **violated**: the source breaks the rule. Change the design or code as the repair says.",
3288
+ "- **unprovable**: ADS cannot prove the rule holds. Rewrite into a form ADS can follow; keep the rendered behavior.",
3289
+ "- **rerun**: nothing is wrong with source; the run was interrupted or its evidence is missing or stale. Run it again for the current revision.",
3290
+ "- **ads-defect** / **environment**: not a source problem. Do not rewrite source to avoid it; report it or reinstall.",
3291
+ "",
3292
+ "| Order | Group | Certainty | What it means | How to fix |",
3293
+ "| --- | --- | --- | --- | --- |",
3294
+ ...groupsInOrder().map((group) => {
3295
+ const { order, certainty, actionability, summary, strategy } = errorGroups[group], kind = actionability === "author" ? certainty : actionability;
3296
+ return `| ${order} | [${group}](${errorGuideUri(group)}) (${codes.get(group)?.length ?? 0}) | ${kind} | ${summary} | ${strategy} |`;
3297
+ })
3298
+ ].join(`
3299
+ `)}
3300
+ `;
3301
+ }
3302
+ export function errorGroupGuide(group) {
3303
+ const { order, certainty, actionability, summary, strategy } = errorGroups[group], lines = [
3304
+ `# ${group} (fix order ${order})`,
3305
+ "",
3306
+ summary,
3307
+ "",
3308
+ `**How to fix:** ${strategy}`,
3309
+ "",
3310
+ `Certainty: ${certainty}. Fixed by: ${actionability}. Index: ${errorGuideUri()}.`
3311
+ ];
3312
+ for (const code of codesByGroup().get(group) ?? []) {
3313
+ const entry = adsErrorCodes.get(code);
3314
+ if (entry === void 0)
3315
+ continue;
3316
+ lines.push("", `## \`${code}\``, "", `**Rule:** ${entry.rule.statement}`, "", `**Repair:** ${entry.repair}`);
3317
+ if (entry.rule.guides.length > 0)
3318
+ lines.push("", `**Read:** ${guideLinks(entry.rule.guides)}`);
3319
+ }
3320
+ return `${lines.join(`
3321
+ `)}
3322
+ `;
3323
+ }
3324
+ export function rulesByGuide() {
3325
+ const index = new Map;
3326
+ for (const [code, { rule }] of adsErrorCodes)
3327
+ for (const guide of rule.guides) {
3328
+ const codes = index.get(guide) ?? [];
3329
+ codes.push(code);
3330
+ index.set(guide, codes);
3331
+ }
3332
+ return index;
3333
+ }
3334
+ const BLOCKED_RULE = "owner-analysis-blocked";
3335
+ function notAnalysedOwners(advisories) {
3336
+ return advisories.flatMap((advisory) => {
3337
+ if (advisory.rule !== BLOCKED_RULE)
3338
+ return [];
3339
+ const file = typeof advisory.owner === "string" ? advisory.owner : advisory.file, blockedBy = Array.isArray(advisory.blockedBy) ? advisory.blockedBy.filter((item) => typeof item === "string") : [];
3340
+ return typeof file === "string" && blockedBy.length > 0 ? [{ file, blockedBy: blockedBy.join(", ") }] : [];
3341
+ });
3342
+ }
3343
+ const checkEntries = checkErrors, codeEntries = adsErrorCodes;
3344
+ function plannedKey(finding) {
3345
+ const code = finding.code;
3346
+ if (typeof code === "string") {
3347
+ const entry = codeEntries.get(code);
3348
+ if (entry)
3349
+ return { key: code, guidance: { group: entry.group, repair: entry.repair, guides: entry.rule.guides } };
3350
+ }
3351
+ const rule = finding.rule;
3352
+ if (typeof rule === "string" && Object.hasOwn(checkEntries, rule)) {
3353
+ const entry = checkEntries[rule];
3354
+ if (entry)
3355
+ return { key: rule, guidance: { group: entry.group, repair: entry.repair, guides: entry.guides } };
3356
+ }
3357
+ return null;
3358
+ }
3359
+ export function repairPlan(findings, { steps = 2, rulesPerStep = 2, repairChars = 240, notAnalysed: notAnalysedLimit = 5 } = {}, advisories = []) {
3360
+ const counts = new Map, guidance = new Map;
3361
+ for (const finding of findings) {
3362
+ const planned = plannedKey(finding);
3363
+ if (!planned)
3364
+ continue;
3365
+ counts.set(planned.key, (counts.get(planned.key) ?? 0) + 1);
3366
+ guidance.set(planned.key, planned.guidance);
3367
+ }
3368
+ if (!counts.size)
3369
+ return null;
3370
+ const byGroup = new Map;
3371
+ for (const [key, { group }] of guidance) {
3372
+ const keys = byGroup.get(group) ?? [];
3373
+ keys.push(key);
3374
+ byGroup.set(group, keys);
3375
+ }
3376
+ const ordered = groupsInOrder().filter((group) => byGroup.has(group));
3377
+ let omittedRules = 0;
3378
+ const planned = ordered.slice(0, steps).map((group) => {
3379
+ const keys = (byGroup.get(group) ?? []).sort((a, b) => (counts.get(b) ?? 0) - (counts.get(a) ?? 0) || a.localeCompare(b));
3380
+ omittedRules += Math.max(keys.length - rulesPerStep, 0);
3381
+ const shown = keys.slice(0, rulesPerStep), clip = (text) => text.length > repairChars ? `${text.slice(0, repairChars - 1).trimEnd()}\u2026` : text;
3382
+ return {
3383
+ fixOrder: errorGroups[group].order,
3384
+ group,
3385
+ groupGuide: errorGuideUri(group),
3386
+ fixedBy: errorGroups[group].actionability,
3387
+ rules: shown.map((key) => {
3388
+ const repair = guidance.get(key)?.repair;
3389
+ return { rule: key, count: counts.get(key) ?? 0, ...repairChars > 0 && repair ? { repair: clip(repair) } : {} };
3390
+ }),
3391
+ read: [...new Set(shown.flatMap((key) => guidance.get(key)?.guides ?? []))]
3392
+ };
3393
+ });
3394
+ for (const group of ordered.slice(steps))
3395
+ omittedRules += byGroup.get(group)?.length ?? 0;
3396
+ const omittedGroups = Math.max(ordered.length - steps, 0), blocked = notAnalysedOwners(advisories), listed = blocked.slice(0, notAnalysedLimit), omittedOwners = blocked.length - listed.length;
3397
+ return {
3398
+ steps: planned,
3399
+ ...listed.length > 0 ? { notAnalysed: listed } : {},
3400
+ ...omittedGroups || omittedRules || omittedOwners ? { omitted: { groups: omittedGroups, rules: omittedRules, ...omittedOwners ? { notAnalysed: omittedOwners } : {} } } : {}
3401
+ };
3402
+ }
3403
+ export function repairPlanText(plan) {
3404
+ const lines = [`Fix in this order; earlier errors are often the cause of later ones (${errorGuideUri()}):`];
3405
+ for (const [index, step] of plan.steps.entries()) {
3406
+ const who = step.fixedBy === "author" ? "" : `, fixed by: ${step.fixedBy}`;
3407
+ lines.push(` ${index + 1}. ${step.group} (${step.groupGuide}${who})`);
3408
+ for (const rule of step.rules)
3409
+ lines.push(` ${rule.rule} \xD7${rule.count}${rule.repair ? `: ${rule.repair}` : ""}`);
3410
+ if (step.read.length)
3411
+ lines.push(` read: ${step.read.join(", ")}`);
3412
+ }
3413
+ const { groups = 0, rules = 0, notAnalysed: unlisted = 0 } = plan.omitted ?? {};
3414
+ if (groups || rules)
3415
+ lines.push(` \u2026and ${rules} more rule${rules === 1 ? "" : "s"}${groups ? ` in ${groups} more group${groups === 1 ? "" : "s"}` : ""}, listed above.`);
3416
+ for (const owner of plan.notAnalysed ?? [])
3417
+ lines.push(` Not analysed until fixed: ${owner.file} (blocked by ${owner.blockedBy})`);
3418
+ if (unlisted)
3419
+ lines.push(` \u2026and ${unlisted} more not analysed (--json lists them).`);
3420
+ return lines;
3421
+ }