@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
@@ -1,586 +1,744 @@
1
1
  # Architecture
2
2
 
3
- ADS makes shared design standards a tooling contract while keeping UI source in
4
- the project. Coding agents can build and evolve that source directly; the tools
5
- keep changes within a defined architecture. The project owns its components,
6
- patterns, token values, and branding.
3
+ ADS makes shared design standards a tooling contract and keeps the UI source in
4
+ the project. Coding agents build and change that source directly. The tools
5
+ keep each change inside a defined architecture. The project owns its components,
6
+ patterns, token values and branding.
7
7
 
8
8
  ADS manages project-owned UI for websites and MCP Apps. Both use the same public
9
9
  components, patterns, controllers, tokens and styles. The consuming application
10
- supplies data, actions, mounting and integration, including serving its MCP Apps.
11
- The ADS showcase renders those real implementations in isolated HTTP frames; its previews
12
- and registered checks provide evidence for the exercised states and conditions.
13
- Normal application checks verify website integration.
14
-
15
- This document explains the what, why, and high-level how. [ADS.md](ADS.md) defines
16
- the enforceable contract, [GUIDE.md](GUIDE.md) covers tool integration, and the
17
- [starter/playground guide](../starters/README.md) covers implementation details.
10
+ supplies data, actions, mounting and integration, and serves its own MCP Apps.
11
+ The ADS showcase renders the real implementations in isolated HTTP frames. Its
12
+ previews and registered checks are evidence for the states and conditions they
13
+ exercise. Normal application checks verify website integration.
14
+
15
+ This document explains the what, the why and the high-level how.
16
+ [ADS.md](ADS.md) defines the enforceable contract. [GUIDE.md](GUIDE.md) covers
17
+ tool integration, configuration and commands. [MCP.md](MCP.md) covers the MCP
18
+ surface. Component-local READMEs cover APIs, lifecycle, tests and provenance.
19
+
20
+ ## ADS closes what it has to prove
21
+
22
+ **ADS closes a form where a proof depends on understanding it, and reports what
23
+ it cannot evaluate.** This is the rule behind every check and every change to
24
+ them. It decides, for each thing an author can write, whether an unlisted form
25
+ is an error or a review item.
26
+
27
+ - **A proof depends on the form: closed.** The form is a finite list. An
28
+ unlisted form is an **error** that names the supported forms. The remedy is
29
+ an ADS change that adds the form with its grammar, checks, lowering,
30
+ documentation and tests. Recipe and profile fields, `when` selectors, token
31
+ roles, breakpoint units, and the colour, shadow and gradient forms a token
32
+ reference may sit in are closed. Each has positions with different meanings,
33
+ and ADS cannot say what belongs where in a form it does not know.
34
+ - **No proof depends on the form: open, and reported.** The value is accepted,
35
+ every rule that still applies is enforced, and what ADS cannot evaluate is a
36
+ **review item**, never silently passed. A token's own numeric value is open:
37
+ a reference in it follows one contract (its own role, or `spacing` where that
38
+ route exists) inside any CSS function. So `env(safe-area-inset-left,
39
+ var(--space-4))` or a function a browser shipped last month needs no ADS
40
+ release. Its role is still checked; its value is reviewed as unevaluable.
41
+
42
+ So a new CSS function is usable in a token's numeric value at once, and inside
43
+ a colour, shadow or gradient only once ADS lists it. See
44
+ [the token-role reference](TOKEN-ROLES.md#functions-a-token-value-may-use).
45
+
46
+ For ADS development this means:
47
+
48
+ - Before closing a form, name the proof that needs it. Do not close a form for
49
+ uniformity: a refusal that proves nothing only blocks valid design.
50
+ - Before leaving a form open, confirm that nothing ADS guarantees reads through
51
+ it, and that the unevaluable case is reported.
52
+ - A closed form has no "for now" fallback for unlisted input. In review, a new
53
+ permissive branch inside a closed form is a defect, and so is a new refusal
54
+ with no proof behind it.
55
+ - An agent or developer who meets a refusal in a project uses a supported form,
56
+ which the error names. If the design needs the unlisted one, that is an ADS
57
+ change to request, not a check to work around.
18
58
 
19
59
  ## Shared tooling, project-owned design
20
60
 
21
- Skills ship in the package and are served as an immutable snapshot, each file under
22
- `skill://ads/<name>/`. Connections on protocol `2026-07-28` get the skills extension: entries with
23
- verbatim frontmatter and complete manifests, each digest computed from the bytes served, and directory
24
- reads. Earlier connections get the same files as ordinary resources and through tools. ADS serves
25
- content; verification, approval and activation belong to the host.
26
-
27
- The shared layer supplies architectural rules, token definitions, checks,
28
- skills, and setup. Components, patterns, themes, and examples are authored in
29
- the project or brought in through explicit imports and adaptations.
30
-
31
- This lets standards evolve without tying the product's UI to a centrally
32
- distributed component catalogue. A project can change its implementation,
33
- branding, or external dependencies while retaining compatible contracts.
34
- Tool updates preserve local values and customized source; content updates have
35
- their own reviewed lifecycle.
36
-
37
- ADS is opinionated about tooling and ownership. Linaria is required for the
38
- component and pattern styling pipeline. Visual choices belong to the project.
39
- ADS's tools run on Bun 1.4.1+ and compile MCP previews independently of the
40
- application's build tools. The project may use Node or Bun: what it imports from
41
- ADS in its own build, lint or Playwright specs works under Node. Project scripts
42
- and behavior profiles retain their explicit interpreter commands; `command:
43
- "runtime"` runs on ADS's Bun. This tooling choice is separate
44
- from the UI framework and adds no Node/Bun dependency to deployed components.
61
+ The shared layer supplies the architectural rules, the authoring macros, the
62
+ compiler, the checks, the skills and the setup. The project authors its
63
+ components, patterns, themes and examples, or brings them in through explicit
64
+ imports and adaptations.
45
65
 
46
- ### Semantic analysis
66
+ This split lets standards change without a centrally distributed component
67
+ catalogue. A project can change its implementation, branding or external
68
+ dependencies and keep compatible contracts. A tool update preserves local values
69
+ and customized source. A content update has its own reviewed lifecycle.
47
70
 
48
- ADS semantic analysis uses its own pinned TypeScript 7.1 beta asynchronous
49
- native API from Bun. Analysis, orchestration and preview compilation all run on
50
- Bun; registered application commands retain their explicit runtimes. Generated
51
- applications retain their TypeScript 5.9.3 dependency and their own `tsc`; ADS's
52
- compiler is a separate nested package when necessary.
71
+ ADS is opinionated about tooling and ownership, not about visual choices:
53
72
 
54
- `src/analysis/service.mjs` is the shared asynchronous entry point for acceptance,
55
- architecture checks, scenario/catalog discovery, tokens, behavior planning and
56
- audit selection. Each calling ADS process shares a Bun child host with plain-data IPC. That host
57
- serializes analysis requests and owns bounded native project sessions. One job
58
- is an inspection/check/selection request that may inspect many files. Independent
59
- native queries inside it can share pending promises and be batched.
60
- Rendering and registered test commands execute outside this service.
61
-
62
- Each project keeps an immutable live snapshot. Drafts branch from it using file
63
- deltas; acceptance promotes the checked revision, while rejection releases it.
64
- Sibling drafts cannot alter each other, and a changed live generation prevents
65
- stale promotion. Project input bytes are captured during the existing validation
66
- inventory read. Imported dependencies, missing resolution targets, configuration
67
- and package changes invalidate the compiler state. Content fences remain required
68
- around operations that can overlap filesystem edits; timestamps alone never
69
- establish freshness. The beta compiler's unsafe program-removal operation is
70
- avoided by bounded snapshot compaction within the same compiler process.
71
- Relocated AST wrappers belong to a live project or one draft, rather than a
72
- global map of draft paths. Unchanged live trees keep their identity across
73
- revisions; releasing a draft releases its wrapper cache. Promotion creates live
74
- paths without mutating trees already returned to draft callers.
75
-
76
- Production acceptance registers the candidate's file delta against its live
77
- project before checking. The architecture guard, contract discovery and affected
78
- selection use that branch through the shared analysis service. Successful source
79
- publication promotes the checked snapshot; rejected, abandoned and temporary
80
- branches are released. Configured scripts and browser evidence remain separate
81
- acceptance stages and retain their own source-freshness requirements.
82
-
83
- Rules must use `analysis/helpers.mjs` for `sourceAst`, `sourceText`, `symbolAt`,
84
- `valueSymbolAt`, `localValueDeclarations`, `walk`, `findNode`, `nodesOfKind`, `memoFact` and `memoProgram`. Program acquisition
85
- goes through `cachedProgram`; import resolution goes through `importResolver`.
86
- With fixed compiler options, import resolution shares normalized specifiers by
87
- importing directory, including pending queries from sibling files. Its cache
88
- belongs to the current inventory/request; a new capture resolves against current
89
- package/configuration bytes and cannot inherit an earlier resolution by path alone.
90
- Input capture shares compiler options and the import resolver with configuration
91
- discovery. `analysis/module-resolvers.mjs` owns native resolver leases for that
92
- capture, including pending queries; cleanup drains them on success or failure.
93
- The syntax client stays alive until the capture releases its leases. No resolver
94
- that observes the live filesystem survives into the next capture.
95
- Warm checks collect compiler source bytes while computing the task input key and
96
- pass them through `analyzeCaptured`; registered draft branches remain authoritative.
97
- The independent post-check input capture still verifies freshness before caching
98
- the report. Draft preparation similarly shares one inventory between inspection
99
- and workspace population, retaining its targeted live conflict/path checks.
100
- `render-composition.mjs` reuses the captured native program and `createSourceValues`
101
- for owned JSX, component calls, props and classes. Its pending/completed graph is weakly
102
- memoized by immutable program, so sibling drafts and edited imports do not share mutable
103
- render facts. It does not execute project code or open another compiler. The contrast
104
- adapter consumes the CSS trees already parsed by the check, resolves ancestor backdrops
105
- and caches identical token-pair calculations within the check. It reports incomplete
106
- cascade/branch evidence explicitly; browser axe audits retain dynamic rendering coverage.
107
- Class choices stay factored in the immutable render graph. The contrast adapter compares
108
- all alternatives' paint facts without enumerating their Cartesian product; layout-only
109
- choices can retain a known ancestor backdrop. Captured selector targets distinguish inert
110
- class hooks from possible paint overrides. Native type queries identify string/number
111
- text slots without treating arbitrary React/Preact children as plain text.
112
- Optional inputs and immediate directory membership use `optionalSourceText` and
113
- `sourceDirectoryFiles`; both observe the captured revision, including absence.
114
- `sourceCss` shares read-only PostCSS trees across requests on the same captured revision; transforms clone
115
- before modifying them. Spatial guards and foundation discovery use
116
- `spatial.mjs` over these helpers. The pure `spatial-model.cjs` compiler does no
117
- filesystem I/O. `spatial-inputs.cjs` retains a bounded cache of immutable models
118
- by contents, without branch paths or ASTs. Linaria's build adapter captures at
119
- the build/extraction boundary, and Bun previews track spatial contents and token
120
- sheet membership, including layouts introduced by evaluated interpolations.
121
- `spatial-contexts.cjs` validates bounded conditional token graphs and shares immutable
122
- context models. `spatial-css.cjs` normalizes supported ordinary CSS placement and protects
123
- generated geometry. Its bounded 256-entry cache contains only immutable selector-text
124
- facts, including finite functional branches and attribute targets; it retains no source
125
- trees or project paths. Keyframe effects join the same target/property checks.
126
- `spatial-composition.mjs` binds those facts to existing native JSX
127
- nodes and owned component calls; it creates no compiler or independent syntax tree.
128
- Standalone extraction checks algebra; acceptance adds the owned composition evidence.
129
-
130
- The spatial design and starter defaults draw on IBM Carbon's 2x Grid. The
131
- [design references](DESIGN-REFERENCES.md) record adopted concepts, the consulted
132
- source revision, and attribution boundaries. ADS's compiler and analysis services
133
- are separate from Carbon's Sass/React grid packages; consumers own their definitions.
134
-
135
- File-local accessibility and image-attribute checks consume the main check's source
136
- inventory and captured native ASTs. Their findings are memoized by immutable source
137
- tree; they create no separate syntax parser or filesystem scan. Font checking and
138
- preload generation share captured CSS trees and parsed face facts. Token values,
139
- current preload configuration and actual style uses are evaluated separately on
140
- each operation, so changing a consumer or theme cannot reuse an unrelated result.
141
- Optional text (including absence) and CSS trees have weak captured-revision ownership;
142
- new revisions invalidate them, while repeated reads on the same revision share data.
143
-
144
- Do not create compiler programs, native clients, path-keyed semantic caches or
145
- independent AST parsers in new rules. `memoFact` lives for one fenced request;
146
- `memoProgram` is only for facts determined by an immutable program/tree or captured
147
- revision, with weak ownership. Return
148
- copies when exposing cached mutable results. A boundary test prevents rule modules
149
- from constructing programs or importing native transports. Library inspection
150
- APIs are asynchronous and use the same native session implementation. Await
151
- `checkProject`, `inspectTokens`, contract/scenario inspection and import
152
- resolution. Direct library callers acquire a context through `standalone.mjs`;
153
- they do not select a different engine. Syntax-only work uses the native API's
154
- bounded source-file leases. There is one compiler implementation.
155
-
156
- Semantic calls go through `analysis/queries.mjs`, which shares pending promises
157
- and batches independent symbol/type queries. Await source and semantic lookups;
158
- ordinary syntax predicates remain synchronous. Use the ordered async traversal
159
- and collection helpers when callbacks perform semantic work, so short-circuit
160
- checks and diagnostic order remain deterministic.
161
- Use `walkValuesAsync` for CSS values: returning false prunes that function's
162
- children. `walkAsync` follows PostCSS's different contract, stopping the walk.
163
- Resolve named subjects through `localValueDeclarations` instead of enumerating
164
- all symbols in scope. Resolving declarations for a global symbol inventory can
165
- load the compiler libraries unnecessarily and exhaust memory.
166
-
167
- `bun run test:analysis` verifies native analysis, cache invalidation, production
168
- draft acceptance and computed-CSS compilation without browser rendering or
169
- registered behavior execution. The [analysis benchmark](../scripts/benchmarks/analysis/README.md)
170
- runs the current engine serially with correctness assertions and time/memory
171
- regression gates when a compatible baseline is supplied. Its acceptance fixtures
172
- disable scripts, registered behavior execution and rendering so measurements
173
- include input capture, branching, guards and publication without browser work.
174
- [AGENTS.md](../AGENTS.md#mandatory-analysis-benchmarks) requires both inventory
175
- sizes for relevant changes. Browser and component behavior suites remain
176
- separate from these engine measurements.
177
-
178
- Changed-scope validation follows shared source trees and native import resolution.
179
- Its successful full baseline also retains plain dependency closures, so later
180
- selection includes consumers from both the previous and current revisions.
181
- Deleted inputs without previous evidence, unknown ownership, computed imports
182
- and shared configuration widen selection conservatively. This selects what to
183
- audit; it does not replace browser evidence or grant a passing result.
184
- The project declares React or native Preact in `ds.config.json` and uses the
185
- matching compiler and mount adapter. Both integrate with the required styling
186
- and validation pipeline; additional frameworks need explicit tooling support.
187
-
188
- A design system can start from the starter that ships inside the same ADS package:
189
- `ads init --framework react|preact --include-starter`, run inside an existing project, adds
190
- `dist/starters/react` and its generated Preact overlay
191
- where the project has nothing, so it always matches the tool version that checks it. It
192
- never replaces a project file or writes a lockfile. Skills carry no starter copy; they
193
- point agents to `ads init --include-starter`. The starter is a working base: a
194
- token foundation in six groups (color ramps with AA-checked roles, type,
195
- space and sizing, shape and elevation, motion, layout with a column grid), brand artwork
196
- with Brand previews, an icon set, and one example of each layer.
73
+ - Design is declared through ADS's typed macros. ADS compiles it into plain
74
+ modules and CSS.
75
+ - Visual choices belong to the project.
76
+ - ADS's tools run on Bun 1.4.1 or later. ADS compiles MCP previews
77
+ independently of the application's build tools.
78
+
79
+ ### ADS is self-sufficient
80
+
81
+ ADS needs nothing from the project to do its job:
82
+
83
+ - ADS ships its own Playwright. Playwright's own installer installs the browser
84
+ on first need.
85
+ - ADS runs unit specs with its own Bun and browser.
86
+ - ADS runs strict specs with its own Playwright test runner.
87
+ - ADS takes no command, runner or framework from configuration. A project
88
+ setting can only tune ADS (a budget, a browser choice).
89
+
90
+ ### The design system is its own package
91
+
92
+ The design system is a folder with its own `package.json`, `ds.config.json`,
93
+ `tsconfig.json` and `design-system/`, where ADS is a development dependency.
94
+ Applications consume its emitted output and never install ADS. Several
95
+ applications install the design package as a copy (git reference, tarball or
96
+ registry) and get its committed `dist/`. One application can instead keep the
97
+ design package in a folder and have it emit into the application's source. The
98
+ [guide](GUIDE.md#set-up-a-design-package) covers both layouts.
99
+
100
+ Either way the emitted modules resolve the framework from the application's own
101
+ `node_modules`, so there is one React (or Preact). A copy carries none of the
102
+ design package's development dependencies, and output in the application's
103
+ source resolves upward from there.
104
+
105
+ The design package declares what its output imports: `dependencies`, and
106
+ `peerDependencies` for what the application must share.
107
+ `package-dependency-undeclared` checks it, and `ads-dependencies.json` lists it
108
+ for the application.
109
+
110
+ What an application imports from ADS in its own build works under Node. The Bun
111
+ tooling choice is separate from the UI framework and adds no Node or Bun
112
+ dependency to deployed components.
113
+
114
+ ### Frameworks and the starter
115
+
116
+ The project declares its framework in `ds.config.json`: React or native Preact.
117
+ The framework's own JSX runtime and hooks module type the owners, emission
118
+ writes its JSX runtime, and a package of the other framework is an error.
119
+ Additional frameworks need explicit tooling support.
120
+
121
+ There is one starter source (`starter/`, written for React). The build copies it
122
+ to `dist/starters/react/` and generates the native Preact starter
123
+ `dist/starters/preact/` through an overlay (`src/starter-overlay.mts`). The
124
+ overlay stops the build on a React API without a declared Preact counterpart.
125
+
126
+ A design system starts from the starter inside the same ADS package, so it
127
+ always matches the tool version that checks it. `ads init --framework react`
128
+ (or `preact`), run inside an existing project, copies the declared file set of
129
+ the framework's starter into an empty or absent design-system folder. It never
130
+ replaces a project file, edits `.gitignore` or writes a lockfile. Skills carry
131
+ no starter copy.
132
+
133
+ ### No production runtime
197
134
 
198
135
  ADS checks run during development and builds. The tool adds no production UI
199
- runtime. Its ownership boundaries preserve a project's optimization strategy:
200
- lazy loading, code splitting, memoized data, caching, worker execution, and
201
- cancellable work can remain behind public APIs. Sharing a screen pattern does
202
- not require eager loading of its renderer or moving application services into
203
- the ADS. Validate these properties when migrating an existing application.
204
-
205
- ## Data, UX, and Skin
206
-
207
- Every UI implementation has three cooperating responsibilities:
208
-
209
- | Pillar | Defines | Implemented through | Result |
210
- |--------|---------|---------------------|--------|
211
- | **Data** | Design values, semantic roles, and their relationships | Shared token definitions with project-owned values and themes | A consistent visual vocabulary |
212
- | **UX** | Structure, behavior, accessibility, states, and layout | Markup, interaction logic, and structural styles in components and patterns | Operable controls and reusable compositions |
213
- | **Skin** | Visual identity and the appearance of each state or variant | Token-backed styles composed with the UX structure | The project's visual treatment |
214
-
215
- The separation makes each decision's purpose clear while keeping related code
216
- together. A button gets its dimensions and colors from Data, its native semantics
217
- and focus behavior from UX, and its fills, borders, and typography from Skin.
218
- A form group or application shell applies the same model to composition.
219
-
220
- ### Data gives implementations a common language
221
-
222
- Data includes both primitive values and semantic roles. A color ramp describes
223
- available values; a surface or accent token describes their intended use.
224
- Typography, spacing, elevation, and motion follow the same principle.
225
-
226
- Projects share compatible token names, meanings, types, and relationships while
227
- choosing their own values. Stable names let implementations move between
228
- projects without importing an unrelated brand. Themes evolve by changing
229
- values behind those names, and visual formulas have one source of truth.
230
-
231
- The shared foundation is the only design-value catalogue. Components and patterns
232
- map its roles into owned `--ds-*` and `--ux-*` variables; these namespaces cannot
233
- introduce independent design values. Raw literals hidden by aliases, fallbacks,
234
- themes or static helper/import interpolation follow the same source checks.
235
- Every interpolated alternative must resolve. The checker deduplicates known
236
- values and checks all resulting styles; unknown alternatives and work-limit
237
- exhaustion produce a blocking `design-value-source` finding. A template may
238
- produce at most 256 distinct styles, including combinations of interpolations;
239
- larger constructions must be split into smaller styles, never silently sampled.
240
- Runtime measurements and typed instance paints retain narrow, explicit contracts.
241
- When adapting external UI, use the project's existing font, text, spacing and
242
- other semantic roles even when their values differ from the reference. Add a
243
- shared role only for a missing design decision, and document intentional visual
244
- differences. Equal values alone do not prove equivalent roles: duplicate shared
245
- definitions invite review; ownership and value-source violations are errors.
246
- Ports should converge on that shared vocabulary, consolidating equivalent roles
247
- introduced by their source dependencies. Acceptance checks required behavior and
248
- project consistency; exact upstream pixels apply only when explicitly requested.
249
-
250
- ### UX owns the interaction contract
251
-
252
- Components own control semantics, input handling, focus, accessibility, and
253
- state mechanics. Patterns own reusable layout and composition. Application
254
- containers provide domain data, routing, application effects, and callbacks through public
255
- APIs.
256
-
257
- A component provides one cohesive UI capability. A pattern arranges capabilities
258
- into a reusable structure or workflow; a layout part may arrange content slots.
259
- Components may compose other components/controllers, and patterns may compose
260
- patterns. Import count, element count and implementation size do not decide the
261
- layer. Scenarios may compose public UI and development review helpers to demonstrate their
262
- subject without becoming production patterns.
263
-
264
- Patterns are production application UI. The showcase owns generic preview UX:
265
- navigation, theme/viewport controls, framing and hosting inside the App iframe.
266
- Projects supply `.ads.scenario.*` demonstrations and `.ads.fixture.*` inputs for
267
- the actual production implementation. Small project-specific arrangements
268
- and demonstration controls use `.ads.review.*` files. `review/`
269
- is an optional organizational home for shared helpers, not another production
270
- UI layer or an exemption from the filename marker. Its generated helper entry is
271
- `review/index.ads.review.ts`, imported through `@ds/review`.
272
-
273
- The tool-owned `@reqvire-org/ads/preview` API supplies generic frame classes and
274
- mount containers; project framework adapters use `.ads.mount.*`. Its development-only
275
- `setPreviewGuides(options)` and `observePreviewGuides(listener)` helpers let a
276
- composed inspection toolbar control the managed preview’s existing guide overlay.
277
- Choices are a `mode` (`off`, `hover` or `always`: where guides show) and boolean
278
- layers (`bounds`, `tracks`, `gaps`, `padding`, `margins`, `mini`: what they draw);
279
- the observer receives the current choices immediately and returns an unsubscribe
280
- function. The App forwards edits to its host, which retains them across views and
281
- synchronizes other controls. This does not create a second overlay or a production
282
- layout dependency. Neither this
283
- preview API nor marked project code/styles may enter production dependencies.
284
- Review helpers retain public product-contract and style checks. They reuse
285
- production tokens unchanged; literal width/height and grid-track dimensions are
286
- permitted only for isolated demonstration geometry. Colors, typography, spacing
287
- and component states remain governed by production Data and owners. Showcase-only
288
- values do not belong in the production token foundation. See the
289
- [scenario support guide](../skills/ads-designer/references/review.md).
290
-
291
- Core guards reject component runtime dependencies on patterns/composition through
292
- resolved imports, re-exports and helpers. Patterns consume public component
293
- contracts rather than private implementation symbols or rendered style hooks;
294
- documented non-state customization variables remain available. Source tracing
295
- distinguishes styling a private part from reading ancestor context for the
296
- pattern's own arrangement. Application and development dependencies retain their
297
- separate boundaries. The portable skill-local [layer guide](../skills/ads-designer/references/layers.md)
298
- explains repairs and analysis limits; semantic classification still needs review.
299
-
300
- The Data pillar describes design values; business data is a separate input to
301
- the UX contract. Application adapters own live business-data loading,
302
- authentication, stores, routing, caching and refresh policy. Components and
303
- patterns receive typed inputs and callbacks. They may invoke an injected
304
- callback or service to request work and present its loading/error state, while
305
- the consumer retains ownership of the data source. They do not bind themselves
306
- to a product backend or application provider.
307
-
308
- UI mechanics remain with their owner: lazy implementation imports, asset
309
- loading, measured geometry and cancellable layout workers are compatible with
310
- this boundary. Separating business-data access does not require moving renderer
311
- work into the application or sacrificing performance.
312
-
313
- A visual change should preserve the interaction contract unless behavior is
314
- deliberately changed. A disabled control remains disabled across skins; a field
315
- keeps its label association and error semantics. Keeping this policy with its
316
- owner prevents consumers from creating conflicting versions of the same UI.
317
-
318
- ### Skin applies identity to that structure
319
-
320
- Skin maps the visual vocabulary to the structure and its states. Visual
321
- variants reuse the same UX implementation when their behavior is the same.
322
-
323
- Broad identity changes flow through token values. Changes to a particular
324
- control's treatment live with that control as a supported variant. Changes to
325
- layout or interaction also involve UX. Some decisions span all three pillars:
326
- motion uses Data for timing, UX for when transitions happen, and Skin for their
327
- visual expression.
328
-
329
- ## Linaria is the implementation mechanism
330
-
331
- Linaria connects these responsibilities in the component and pattern styling
332
- pipeline. The starter has one authored `starters/shared/` design with generated
333
- native React/Preact imports and configuration. Both runtimes are supported: the project
334
- chooses its rendering runtime, while ADS checks the same architecture and serves
335
- its actual compiled scenarios. A React application remains React; MCP does not
336
- substitute a different runtime or a visual reproduction.
337
-
338
- The choice serves both architecture and performance:
339
-
340
- | Reason | How it supports ADS |
341
- |--------|--------------------|
342
- | **Colocation and ownership** | Structural UX styles, Skin styles, and modifiers remain distinct local blocks beside their behavior. A change has one reviewable owner. |
343
- | **Explicit composition** | Atomic styles assemble a UX base, visual treatment, and size/state variants with precedence for matching declarations. Different visual variants can reuse the same UX implementation. |
344
- | **Less browser work** | Style templates become CSS at build time, avoiding render-time CSS generation, serialization, and stylesheet injection for those styles. |
345
- | **Independent CSS caching** | Extracted CSS can be delivered and cached separately from JavaScript. With stable content-hashed assets and suitable cache headers, unchanged CSS can be reused across code changes. |
346
- | **Bundle optimization** | Colocated style dependencies and static extraction let build tooling analyze usage and remove unreachable code and styles. The result depends on references, extraction, and side-effect configuration. |
347
- | **Declaration reuse** | Atomic extraction can deduplicate identical declarations across components and combinations, reducing repeated CSS. |
348
- | **Token-driven themes** | The browser applies theme values to already compiled rules. Changing token values does not need a runtime CSS generator. |
349
- | **Inspectable policy** | Source checks inspect Linaria templates alongside their owner for token use and ownership violations before bundling. |
350
-
351
- Linaria's [colocation and extraction model](https://github.com/callstack/linaria/blob/master/docs/BENEFITS.md)
352
- and [atomic composition model](https://github.com/callstack/linaria/blob/master/docs/ATOMIC_CSS.md)
353
- support this combination of local ownership and compiled styling.
354
-
355
- CSS file count is an output detail, not an ownership boundary. The native preview
356
- compiler attaches extracted styles after JavaScript tree shaking, retaining only
357
- owners whose generated classes survive in that chunk. Foundation CSS loads first
358
- to preserve cascade-layer declarations. Owner styles and fonts have separate,
359
- immutable resource identities, so unchanged CSS survives JavaScript edits and can
360
- be reused by multiple views. A shared JavaScript chunk can carry styles for its
361
- shared owners; this is not selector-level pruning of every unused variant. The
362
- compiler does not inject one whole-system stylesheet into every preview. Product
363
- builds keep their own bundler's splitting and caching policy.
364
-
365
- Atomic merging matches property/selector/condition keys; it does not resolve
366
- every shorthand/logical-property overlap. ADS reports detectable composition
367
- risks as nonblocking review items with guidance, while registered rendered checks
368
- can enforce actual geometry. See the skill-local
369
- [atomic style composition guide](../skills/ads-designer/references/atomic-styles.md).
370
- Bounded source tracing follows local class helpers and explicit component
371
- `className` forwarding to DOM targets. Separate elements remain separate;
372
- unsupported paths are informational limits, not evidence of safe composition.
373
-
374
- Airbnb's 2022 [migration report](https://medium.com/airbnb-engineering/airbnbs-trip-to-linaria-dc169230bd12)
375
- provides practical evidence for this choice: performance was its leading
376
- criterion, with separate CSS caching and colocated authoring among the benefits.
377
- Its measurements describe Airbnb's workloads, not promised gains for ADS projects.
378
-
379
- The requirement concerns how styling is authored and built; visual identity
380
- belongs to the project. Foundation tokens and base document styles remain CSS.
381
- “Zero runtime” describes CSS generation, not the whole component: rendering,
382
- interaction, class composition, and dynamic values can still require JavaScript.
383
- Colocation makes dependencies explicit; it does not by itself guarantee removal
384
- of every unused variant. Atomic composition still requires care with the cascade.
385
-
386
- Apply extraction to application and project preview builds, preserve intentional
387
- foundation CSS, and inspect compiled output when performance matters. The
388
- [starter guide](../starters/shared/README.md) covers these details.
389
- Both extraction pipelines use the build-only `@reqvire-org/ads/linaria` tag
390
- resolver. It delegates atomization and nesting to the project's installed Linaria
391
- processor while preserving custom-property token streams around that pass.
392
- Arithmetic becomes meaningful after `var()` substitution, so stripping whitespace
393
- can invalidate otherwise valid source. Verify emitted CSS and computed browser
394
- values; source guards alone cannot establish extraction correctness. The
395
- skill-local [atomic styling guide](../skills/ads-designer/references/atomic-styles.md#preserve-custom-property-arithmetic-during-extraction)
396
- documents integration and source-workaround semantics.
397
-
398
- The resolver also preserves complete `@property` registrations and their
399
- conditional at-rule context for atomic `css`/`styled`. Their descriptors are schema
400
- metadata, not separate atomic declarations. CSS-tree validates CSS value grammar;
401
- PostCSS supplies source/at-rule structure. Registered names have one owner and a
402
- stable schema across its modules, because registration is document-global. Runtime
403
- variables are registered in owned Linaria; shared design tokens are
404
- registered beside their real value definitions. Base resets and fonts cannot own
405
- registrations. Descriptor literals are narrowly permitted where CSS requires an
406
- independent initial value; ordinary visual assignments remain token-governed.
407
- MCP serves these styles to the sandboxed App document. Registration metadata
408
- neither creates new token definitions nor replaces token sample coverage.
409
- Compiled-CSS and browser tests verify interpolation in React and Preact Apps.
136
+ runtime.
137
+
138
+ The ownership boundaries preserve the project's optimization strategy. Lazy
139
+ loading, code splitting, memoized data, caching, worker execution and
140
+ cancellable work can stay behind public APIs. A shared screen pattern does not
141
+ require eager loading of its renderer, and application services do not move
142
+ into the design system.
143
+
144
+ ## Tokens, profiles and recipes
145
+
146
+ Design moves through four kinds of source. Each has one job:
147
+
148
+ | Source | Defines |
149
+ | --- | --- |
150
+ | Role token sheets (`tokens/<group>/<role>.ads.css`) | Shared primitive and semantic values; the filename declares the role |
151
+ | Profiles (`profiles/<group>/*.ads.ts`) | Named, typed combinations of token values for one design responsibility, with explicit composition |
152
+ | Recipes (`recipe()`, `combineRecipes()` in a component or pattern) | Owner-local construction: frame, arrangement, parts and alignment, selecting profiles |
153
+ | `foundation.ads.ts` | The document's text, surface and reset, and the design system's themes and brands |
154
+
155
+ TypeScript beside a recipe handles markup and behavior. Asset declarations
156
+ (`assets/<group>/*.ads.ts` beside their SVG drawings) give artwork a shared
157
+ identity, paint contract, variants and optical anchors.
158
+
159
+ Every declaration uses a typed Bun macro from `@reqvire-org/ads`: `recipe`,
160
+ `profile`, `asset`, `font` or `foundation`. A `font()` declaration beside its
161
+ files makes a font family part of the design system.
162
+
163
+ Recipes select profiles and use closed structural choices. Mocks under
164
+ `mocks/` are mocks of the application's screens: they render public components
165
+ and patterns with explicit props and carry no design, not even through
166
+ profiles. The part of their check that concerns design use
167
+ (`src/analysis/design-usage.mts`) is pure and knows nothing about mocks, so an
168
+ application's own source can later be checked with the same code.
169
+
170
+ Groups organize files and showcase navigation. They are not reference
171
+ namespaces: profile names are globally unique, and references cross groups
172
+ without imports.
173
+
174
+ ### Themes, brands and input modality are token contexts
175
+
176
+ Token sheets set default values on `:root`. A theme or brand sets values again
177
+ on `:root[data-theme="…"]`, `:root[data-brand="…"]` or both. Themes and brands
178
+ are only value sets over the same token names. A theme sets the color mode and
179
+ a brand sets identity values. So a white-label product needs one brand per
180
+ customer, not one theme per customer and mode.
181
+
182
+ `foundation.ads.ts` declares the themes and brands in order; the first is the
183
+ default. It is the one list that checks, previews, the render audit, capture
184
+ and `ads_status` read.
185
+
186
+ Input modality is also a token context, not a recipe construct. A token sheet
187
+ that overrides size tokens under `@media (pointer: coarse)` gives touch screens
188
+ larger controls the same way `:root[data-theme]` gives a theme its colours.
189
+ The token checks evaluate the overrides of each `@media`/`@supports` condition
190
+ crossed with every theme and brand (`tokenDefinitionContexts`,
191
+ `src/design-foundation.mts`). So target size, contrast and token types are
192
+ proven for touch values too, and emission carries the overrides unchanged.
193
+ Owners read the same tokens and need no modality branch.
194
+
195
+ ### Theme and brand sections
196
+
197
+ Themes and brands are also ADS's subtree mechanism. With
198
+ `foundation({ sections: true })`, `data-theme` or `data-brand` on any element
199
+ switches every token below it. A dark footer on a light page is a nested theme
200
+ section, not a parallel set of "on dark" tokens or component variants.
201
+
202
+ A theme is the unit for sections because it is the unit the checks prove. Every
203
+ token sheet value is evaluated, and the contrast of every surface pair is
204
+ proven, in each theme, brand and brand × theme context. A section can therefore
205
+ only select a context whose whole colour mode already passes. ADS has no finer
206
+ construct, such as a surface that sets the colours its descendants read
207
+ (selected rows, tinted banners): it would need its own context in those proofs.
208
+ Explicit choices on the child cover those cases.
209
+
210
+ Sections are opt-in because of their cost: the section rules add CSS to every
211
+ owner sheet, and a design system that switches only `<html>` gains nothing from
212
+ them.
213
+
214
+ Authors write the contexts on `:root` only; emission applies them to sections
215
+ (`src/token-sections.mts`). The flag is part of the declared contexts, so it is
216
+ in the foundation's identity and an edit re-emits every sheet. Without the flag
217
+ the emitted bytes carry no toggle, section rule or section `color-scheme`.
218
+
219
+ - **Toggles.** Selectors cannot find the nearest ancestor on two independent
220
+ axes, so each axis travels as inherited toggle custom properties:
221
+ `--ads-theme-dark`, `--ads-brand-iris`, and `--ads-root-theme` for the base.
222
+ - **Selecting a state.** A section with the attribute, or the root without it
223
+ (following `followSystemTheme`), sets that state's toggle to the
224
+ guaranteed-invalid `initial` and the axis's other toggles to the empty value.
225
+ - **Alternatives.** One zero-specificity rule on `[data-theme], [data-brand]`
226
+ declares each context-dependent token, and each token that reads one, as one
227
+ alternative per state: `var(--ads-theme-dark, <dark value>)`. Theme
228
+ alternatives nest inside brand ones for a token that varies with both. Only
229
+ the selected state's fallback substitutes.
230
+ - **Values.** The values are written on the section element, so a token that
231
+ reads another resolves with the section's values. They are the cascade the
232
+ root gets (`contextDefinitions`, the same values the checks evaluate).
233
+ Conditional overrides sit in their own section rule under the same at-rules.
234
+ - **Reset.** The default theme and brand select the base state, so a default
235
+ section inside another context resets.
236
+ - **Placement.** Every owner sheet carries the toggles and section rules of its
237
+ own token closure, as it carries its root token rules. `foundation.css` adds
238
+ each theme's `color-scheme` on sections.
239
+
240
+ The namespaced emission (the showcase UI drawn inside a project's preview)
241
+ writes no section rules: the hosting document's sections belong to the project.
242
+
243
+ ### Token provenance
244
+
245
+ Token provenance is an authored-edge check. It is separate from
246
+ context-dependent value evaluation.
247
+
248
+ - `src/token-references.mts` owns the parsed expression and reference facts per
249
+ immutable foundation.
250
+ - `src/token-provenance.mts` applies role routes and operation/composite
251
+ positions to every declaration and fallback.
252
+ - `src/token-operations.mts` shares operation syntax between provenance and
253
+ emission. Value resolution and invariant quantum checks stay with their input
254
+ adapters.
255
+
256
+ The check needs no filesystem or semantic query. `tokenChecks()` caches the
257
+ report with the foundation. An owner edit reuses the report; changed captured
258
+ token bytes form a new foundation.
259
+
260
+ A reference that is declared nowhere uses the `token-css/token-missing`
261
+ identity, also for unused definitions. Derivative display duplicates are
262
+ suppressed. In inventories, shape facts stay unresolved; they are not labeled
263
+ valid.
264
+
265
+ ### What an owner declares
266
+
267
+ Components and patterns cannot author design measurements, paints or local
268
+ token aliases, and cannot read tokens directly.
269
+
270
+ **Runtime values.** What an owner can only know at runtime is declared in its
271
+ recipe:
272
+
273
+ - `measured` geometry, such as the position of an anchored popup or the track
274
+ of a splitter.
275
+ - `paints` chosen from data among a finite set of paint-role tokens, such as a
276
+ chart series.
277
+
278
+ Each compiles to an owner-private custom property that the owner writes through
279
+ a typed setter. The values therefore stay inside the checks: the property list,
280
+ profile conflicts, and the contrast of every declared paint.
281
+
282
+ **Interaction properties.** These are compile-time recipe fields with no
283
+ runtime:
284
+
285
+ - The `normalize` of a root or part declares a cursor, touch action or text
286
+ selection from a closed set.
287
+ - The arrangement of a scrolling element declares scroll snap.
288
+
289
+ Analysis reads them from the captured source, and lowering writes them as
290
+ ordinary atomic declarations.
291
+
292
+ **Runtime state.** Runtime state enters in two ways only. The owner's own state
293
+ attribute selects a `when` variant that is compiled beforehand
294
+ (`&[data-dragging="true"] > .grip`). The measured setters carry the geometry
295
+ that a drag computes.
296
+
297
+ **Scroll snap.** Snap follows ownership. The scrolling element takes
298
+ `scroll-snap-type`. The children it places take `scroll-snap-align` from its
299
+ arrangement, as a grid places its cells. A child never snaps itself.
300
+
301
+ **Root press.** A root press (`transition: ["scale"]` with the `scale` endpoint
302
+ of a root `when` entry) lowers like a glyph's press and joins the root's
303
+ transition set. Its review, `review/press-scale-large-surface`
304
+ (`src/press-scale.mts`), is the one press check that reads token values. It
305
+ reads them only for a `frame: "container"` root that presses. Other owners stay
306
+ token-independent, so their analyses survive token edits.
307
+
308
+ ### Composed contrast
309
+
310
+ Another owner often paints the backdrop of the text an owner renders.
311
+ `component-contrast` (`src/composed-contrast.mts`) checks text against the
312
+ backdrop it is rendered on. [ADS.md](ADS.md#composed-text-contrast) defines the
313
+ rule and its unresolved cases. This section explains how owners stay
314
+ independent.
315
+
316
+ **Composition facts.** Each owner's checked outcome carries plain composition
317
+ facts (`src/analysis/owner-composition.mts`), read from its captured AST after
318
+ its analysis accepted it:
319
+
320
+ - Every text position, prop it renders in place and component placement.
321
+ - The owned elements above each, in every reachable choice, enumerated jointly
322
+ over what those elements read: their surface profiles by name, text fields,
323
+ top-layer or covering-cell flow, `hidden`, `aria-disabled`, `disabled` and
324
+ `data-theme`.
325
+ - The literal arguments of each placement.
326
+
327
+ The child records what it offers; the parent records what it renders. No
328
+ owner's analysis reads another's facts. So no owner key gains another owner's
329
+ dependency (unlike the public rows `alignRows` reads), and owners stay
330
+ token-independent. A failed owner contributes no facts; its own error fails the
331
+ check.
332
+
333
+ **The join.** A revision-level join in the revision's memoized check follows
334
+ each text outward through slots and placements, and onto the document surface
335
+ for every component the barrel exports. It resolves the colour and backdrop in
336
+ every token context through the shared paint mechanism
337
+ (`src/paint-contrast.mts`). An element's `data-theme`/`data-brand` restricts its
338
+ subtree to that context only when the foundation declares `sections: true`;
339
+ either way `foundation.css` repaints the element with the document surface.
340
+
341
+ **Boundaries.** A boundary is a placement above which neither paint is known.
342
+ A pair that the elements below a boundary decide is checked; a side that
343
+ reaches it is `component-contrast-unresolved` at the placement.
344
+
345
+ - A component of the placing owner's own file is expanded only when its facts
346
+ show it passes its children through: it renders `children` in place, passes
347
+ it on, or spreads its props into a placement. Any other same-file component
348
+ ends the chain at its placement.
349
+ - Plain modules record no composition facts, only the design-system components
350
+ their markup places. These are read from the revision's program beside the
351
+ other plain-module checks, each revision, so no owner outcome changes. The
352
+ join ends those components' chains at each such placement.
353
+
354
+ A native control's pair is the user agent's, and skipped, only when neither its
355
+ colour nor any background between the text and its fill comes from the design
356
+ system.
357
+
358
+ ### Data and behavior ownership
359
+
360
+ Business data is a separate input. Each layer owns one kind of responsibility:
361
+
362
+ | Layer | Owns |
363
+ | --- | --- |
364
+ | Component | One cohesive UI capability: control semantics, input handling, focus, accessibility and state mechanics |
365
+ | Pattern | Reusable layout and mock: it arranges capabilities into a reusable structure or workflow |
366
+ | Application container | Domain data, routing, application effects and callbacks, supplied through public APIs |
367
+ | Application adapter | Live business-data loading, authentication, stores, routing, caching and refresh policy |
368
+
369
+ Import count, element count and implementation size do not decide the layer.
370
+
371
+ Components and patterns receive typed inputs and callbacks. They can invoke an
372
+ injected callback or service to request work, and present its loading and error
373
+ state. The consumer keeps ownership of the data source.
374
+
375
+ UI mechanics stay with their owner. Lazy implementation imports, asset loading,
376
+ measured geometry and cancellable layout workers are compatible with this
377
+ boundary.
378
+
379
+ A visual change preserves the interaction contract unless the behavior is
380
+ changed deliberately. A disabled control stays disabled across themes and
381
+ brands. A field keeps its label association and error semantics.
382
+
383
+ When a project adapts external UI, it uses its own text, spacing and other
384
+ profiles even when their values differ from the reference. It adds a shared
385
+ role or profile only for a missing design decision, and documents intentional
386
+ visual differences. Acceptance checks required behavior and project
387
+ consistency. Exact upstream pixels apply only when explicitly requested.
388
+
389
+ ## Owners compile to plain modules
390
+
391
+ `ads check` analyzes every owner the public barrel reaches, on one captured
392
+ revision. It reads the design inputs and type-checks the owners. It analyzes,
393
+ lowers and compiles each construction. Then it resolves the token CSS that the
394
+ construction uses.
395
+
396
+ Lowering turns a recipe into atomic declarations through one typed emission
397
+ boundary. The boundary rejects unregistered properties and normalizes competing
398
+ writes.
399
+
400
+ ### Extraction
401
+
402
+ ADS extracts the declarations to classes with the processor of
403
+ `@linaria/atomic`, called directly on the resolved CSS (`src/linaria/`). No
404
+ project module is generated, transformed or evaluated, and there is no
405
+ build-time tag resolver.
406
+
407
+ The processor runs only inside ADS's process:
408
+
409
+ - The build bundles the processor, with exactly the modules it imports, into
410
+ `dist/linaria/atomic-processor.mjs` (`scripts/linaria-processor-bundle.mjs`).
411
+ The published package therefore depends on no `@linaria` package.
412
+ - `postcss` stays external and resolves to ADS's own pinned dependency.
413
+ - The bundle reads no files and no environment. The package index of
414
+ `@wyw-in-js/shared` (with its module-resolution helpers) is replaced by the
415
+ five members the processor imports, and `debug` by a silent logger.
416
+ - A manifest beside the bundle records its SHA-256 and the reviewed fingerprint
417
+ of the bundled packages (`src/linaria/compatibility.json`).
418
+ - A source checkout loads the installed package instead of the bundle.
419
+
420
+ Extraction results are cached in memory and on disk
421
+ ([caching](CACHING.md#persisted-extraction-cache)).
422
+
423
+ ### Text layout
424
+
425
+ Text layout is part of lowering. It is decided at compile time without text
426
+ measurement:
427
+
428
+ - Wrapping.
429
+ - Balanced or pretty line breaks (`text-wrap`).
430
+ - One-line truncation.
431
+ - A multi-line clamp (`line-clamp` beside the `-webkit-box` form that browsers
432
+ implement).
433
+ - Reserved lines (`min-block-size` in `lh` of the part's own line height).
434
+
435
+ Each property is registered in the emission inventory
436
+ (`src/lowering-properties.mts`). `text-wrap` is a progressive enhancement: a
437
+ browser without it wraps normally, so ADS writes no fallback.
438
+
439
+ ADS cannot know the length of a text. So the cut-off content of a clamp is a
440
+ review fact: the full text must stay reachable. The rule against a clamp on a
441
+ control or its label reads the rendered elements in owner analysis.
442
+
443
+ ### What `ads emit` writes
444
+
445
+ `ads emit` writes what the check compiled ([file list](ADS.md#emission)). Each
446
+ owner's module has its class expressions replaced by compiled classes and a
447
+ side-effect import of its own stylesheet. `fonts.ts` is the declared fonts'
448
+ preload list. `app-icons.ts` holds the application icon's link tags and
449
+ manifest icons. `ads-contract.json` records every emitted file's digest and the
450
+ platform features the emitted CSS uses.
451
+
452
+ The output is plain TypeScript and CSS that an application builds with its own
453
+ bundler and without ADS. ADS owns the output folder, never reads it as an input,
454
+ writes only changed files and swaps the tree in whole. The
455
+ [guide](GUIDE.md#emitting-the-design-system) covers the folder, watch mode and
456
+ exit codes.
457
+
458
+ ### The foundation has a narrow styling role
459
+
460
+ `foundation.ads.ts` declares the document's shared responsibilities: the reset,
461
+ the `text` and `surface` profiles applied to the document, the default focus
462
+ indicator, the themes and brands, the generated palette and the application
463
+ icon ([fields](ADS.md#foundation-declaration)).
464
+
465
+ Emission writes them once as `foundation.css`. The sheet contains:
466
+
467
+ - One `@font-face` per declared font face.
468
+ - The reset.
469
+ - The text and surface fields on `body`. The surface is also on `[data-theme]`
470
+ and `[data-brand]`, so a nested context repaints.
471
+ - The focus indicator on `:focus-visible` at zero specificity.
472
+ - `color-scheme` per declared theme. With `followSystemTheme`, the rules of the
473
+ first light and first dark theme repeat for a root without `data-theme`,
474
+ under the matching `prefers-color-scheme`. With `sections: true`, each
475
+ theme's `color-scheme` is also on nested `data-theme` sections, with the
476
+ section rules of the token closure
477
+ ([sections](#theme-and-brand-sections)).
478
+ - The page scroll lock behind a modal dialog, when an owner needs it.
479
+ - The tokens that these rules use.
480
+
481
+ The emitted barrel imports `foundation.css` first. Components and patterns own
482
+ their layout, appearance, states and animations in their recipes. The
483
+ foundation holds no component treatment.
484
+
485
+ ### The platform feature inventory
486
+
487
+ `src/platform-features.mts` registers the platform feature inventory. Each
488
+ listed feature names:
489
+
490
+ - The CSS constructs that use it: properties, the value keywords it names,
491
+ at-rules, media features, pseudo-classes and pseudo-elements, units and
492
+ functions.
493
+ - Its vendor-prefixed forms. Prefixed companions (`PREFIXED_COMPANIONS`) are the
494
+ prefixed forms of their feature.
495
+ - How the output degrades in a browser without it.
496
+
497
+ The CSS core (CSS 2.1 and the long-established CSS3 modules) is a second,
498
+ unlisted set.
499
+
500
+ The contract builder reads the final emitted sheets with that registry. The
501
+ record therefore holds whatever lowering, the foundation sheet and the
502
+ project's own token values wrote, attributed to the owner beside each sheet. A
503
+ construct in neither set is recorded as unrecognized; it is not dropped.
504
+
505
+ Two controls stop a new lowered construct from shipping unlisted. A unit test
506
+ requires a classification for every property the lowering inventory registers.
507
+ The emitted starter and fixtures are held to the inventory in both directions.
508
+
509
+ The registry states facts, never browser versions. ADS has no declared browser
510
+ targets: the application checks the recorded features against its own targets.
511
+
512
+ ### Why compile at build time
513
+
514
+ The choice serves performance as well as ownership:
515
+
516
+ - Styles are compiled at build time. The browser does no render-time CSS
517
+ generation and no stylesheet injection.
518
+ - Each owner's stylesheet carries only the token CSS and atomic rules it uses.
519
+ The import of an owner's module loads the owner's own sheet.
520
+ - The output's `package.json` declares only the stylesheets as side effects. A
521
+ bundler that honours the declaration (measured with Vite) drops the sheet of
522
+ an unused owner with its module, even through the barrel. Bun.build keeps
523
+ every reached sheet.
524
+ - Atomic extraction deduplicates identical declarations.
525
+ - The browser applies theme and brand values to compiled rules, so a context
526
+ change needs no runtime CSS generator.
527
+ - CSS can be cached separately from JavaScript.
528
+
529
+ ### The generated palette
530
+
531
+ Code that draws on a canvas or with WebGL reads theme colors as values from
532
+ `palette.generated.ts`. This generated source holds every paint-role token
533
+ resolved in every declared context. It exists when `foundation.ads.ts` declares
534
+ `palette: true`. `ads check` reports a missing, stale or undeclared palette.
535
+ `ads sync` creates and regenerates it
536
+ ([guide](GUIDE.md#regenerating-generated-source)).
410
537
 
411
538
  ## Public APIs preserve the boundary
412
539
 
413
- The application and project-owned preview scenarios consume a project's public ADS entry. Components
414
- and patterns expose supported behavior and visual variants; internal styling
415
- blocks and external implementation dependencies stay with their owner.
540
+ The application and the project-owned preview scenarios consume the project's
541
+ public entry. The public entry is the authored barrel `index.ts`, which names
542
+ each public owner; `export *` is rejected.
543
+
544
+ Components and patterns expose supported behavior and visual variants. Internal
545
+ construction and external implementation dependencies stay with their owner.
546
+ An import that leaves the design-system folder is an error, because previews,
547
+ drafts and emitted packages read only that folder.
416
548
 
417
- That boundary lets the project replace or adapt an implementation while
418
- preserving compatible consumer APIs. Markup, accessibility, events, layout, and
419
- motion still need verification when an implementation changes. Imported or
420
- adapted source carries its credits and applicable notices in its local guide.
549
+ This boundary lets the project replace or adapt an implementation and keep
550
+ compatible consumer APIs. Markup, accessibility, events, layout and motion
551
+ still need verification when an implementation changes. Imported or adapted
552
+ source carries its credits and applicable notices in its local guide.
421
553
 
422
554
  ## Controllers own reusable behavior
423
555
 
424
- A private controller stays beside its component or pattern. Shared behavior uses
425
- `controllers/<Name>/` as an independent edit owner. Controllers may be plain
426
- functions/classes, framework hooks or context providers; sharing code does not
427
- implicitly share instances. Use the configured framework and declared project
428
- dependencies, with no runtime supplied by the MCP host. Shared controllers do not
429
- import styled consumers or introduce another skin layer. Existing measurement and
430
- style-write boundaries still apply.
431
-
432
- Projects can explicitly allow installed runtime packages with
433
- `"behaviorLibraries": ["@floating-ui/dom", "tabbable"]` in `ds.config.json`.
434
- Each name must also appear in `package.json` dependencies and be installed.
435
- Production ADS code may import those packages and their subpaths directly from
436
- components, patterns or controllers; extract a shared controller only when the
437
- behavior is shared. Other external runtime imports fail
438
- `behavior-library-undeclared`. Type-only imports and development roles retain
439
- their existing rules, as do the configured framework and Linaria exceptions.
440
- `ads check` reports import locations and the exact list to declare.
441
-
442
- This is project approval, not a recursive dependency audit or a guarantee about
443
- third-party internals. ADS reads installed versions without executing packages
444
- or scanning their dependency source or stylesheets. The declaration authorizes
445
- package imports and subpaths. Existing source styling and measured-geometry
446
- checks retain their scope; it introduces no new package-CSS certification gate. Use libraries as installed, with minimal lifecycle/event integration.
447
- For example, Floating UI's `computePosition` can supply `x` and `y` to an
448
- allowlisted producer's `style.setProperty("--ds-popover-x", ...)` and
449
- `style.setProperty("--ds-popover-y", ...)`; project Linaria owns positioning
450
- rules and visual treatment. Declare those exact properties in the owner contract's
451
- `styles.writes`. Clean up positioning observers on unmount.
452
- ADS's managed preview compiler bundles used library code into the normal MCP App
453
- resource graph; declarations alone do not load packages or change its sandbox.
454
-
455
- Optional `<Owner>.ads.contract.ts` modules identify public APIs or private
456
- implementation symbols, named guarantees and registered execution checks. Scenario
457
- `exercises` links public behavior APIs to reachable demonstrations; `covers`
458
- continues to describe rendered public UI. Controllers need no artificial standalone
459
- visual scenario. Static registration is separate from current passing evidence.
460
-
461
- Manifests, checks, scenarios and fixtures are development inputs; production
462
- imports only actual components/controllers and their styles. Browser checks can
463
- exercise the real isolated preview. React development StrictMode uses a project development
464
- harness, since production previews do not replay those effects. The
465
- [behavior contract](BEHAVIORS.md) defines profiles, execution and evidence freshness.
466
-
467
- The normal compiled import graph delivers controller dependencies through HTTP or MCP
468
- resources. There is no eager global controller registry. ESM splitting and selected
469
- asset loading remain in place; tree shaking depends on actual imports, exports and
470
- side effects, rather than the controller directory name.
556
+ A private controller stays beside its component or pattern. Shared behavior
557
+ uses `controllers/<Name>/` as an independent edit owner: a plain module that
558
+ the barrel exports, with no recipe or markup.
559
+
560
+ A controller can be a plain function or class, a framework hook or a context
561
+ provider. Shared code does not implicitly share instances. Controllers use the
562
+ configured framework and the declared project dependencies. The MCP host
563
+ supplies no runtime.
564
+
565
+ The normal compiled import graph delivers controller dependencies through HTTP
566
+ or MCP resources. There is no eager global controller registry. ESM splitting
567
+ and selected asset loading apply. Tree shaking depends on actual imports,
568
+ exports and side effects, not on the controller directory name.
569
+
570
+ ### Behavior checks
571
+
572
+ Behavior checks are development inputs. Production imports only the actual
573
+ components and controllers and their styles. Browser checks exercise the real
574
+ isolated preview.
575
+
576
+ ADS runs what owners register. It runs the built-in `unit`, `browser` and
577
+ `strict` profiles itself, with its own Bun and Playwright, and it owns evidence
578
+ freshness and investigations. The starter's form-field bridge
579
+ (`controllers/FormField`) registers unit checks.
580
+
581
+ A project that registers no behavior checks gets `{ status: "not-available",
582
+ reason: "no-behavior-checks", message }` from `ads behaviors`, `ads verify`,
583
+ the acceptance stage and `ads validate`. It never gets a pass. The
584
+ [behavior guide](BEHAVIORS.md#registered-checks-and-their-status) defines the
585
+ statuses, profiles and evidence.
471
586
 
472
587
  ## The showcase is the shared design workspace
473
588
 
589
+ Humans and coding agents inspect the same project through one ADS runtime.
590
+ Humans use the local showcase. Agents and external MCP Apps use MCP tools and
591
+ resources. Both reach the same services.
592
+
593
+ The shell belongs to tooling. Components, patterns, design values, scenario
594
+ inputs and the UI rendered inside Apps belong to the project. The tool is
595
+ therefore useful with an empty design system, and every implementation becomes
596
+ addressable when its scenario exists.
597
+
598
+ ### A preview scenario is the unit of review
599
+
600
+ A component export alone can need inputs, parent context, local state or
601
+ callbacks to produce useful UI. A scenario supplies that development context
602
+ around the real public implementation. It mounts independently: no showcase
603
+ page, application router, store or service must start first.
604
+
605
+ A scenario file is data and subjects (`scenario`: text, named states and
606
+ specimens whose `render` returns owners). It lays out nothing. ADS draws the
607
+ page with a pattern of its own showcase design system (`ScenarioPage` in
608
+ `showcase-ui/`, checked by ADS like any design system), so a page cannot break
609
+ because of scenario markup, and it looks the same in every project. The check
610
+ refuses markup in a scenario file (`scenario-markup`, `src/owner-scenarios.mts`).
611
+ What a subject needs around it comes from the scenario kit
612
+ (`@reqvire-org/ads/showcase`, typed in `src/scenario-kit.mts`), whose
613
+ components are also showcase-ui owners.
614
+
615
+ Larger scenarios live under `mocks/` and use the same public screen
616
+ patterns as production. Application adapters supply live data and effects.
617
+ Scenario adapters supply fixture data, local state and simulated services.
618
+
619
+ **Development boundary.** These are development-only: any `.ads.` scenario,
620
+ fixture or exports stub, every test, and everything under `mocks/`. This
621
+ holds even when the file is colocated with a production component.
622
+
623
+ - Emission never writes a development module.
624
+ - Runtime implementation, types and styles cannot import one through aliases or
625
+ barrels, and the public barrel cannot export one. A production import of a
626
+ development module fails the module graph.
627
+ - Previews compile development modules from source, beside the emitted
628
+ production modules. Only the closure of the selected scenario and its
629
+ fixtures enters a preview.
630
+ - Derived App audit data adds no ADS dependency to production components.
631
+
632
+ Browser tests still verify mounting, states, accessibility and visual parity.
633
+
634
+ **Registry.** The server discovers one path-derived scenario registry. The
635
+ showcase's sections browse that same registry through MCP results. Scenarios
636
+ register from the owners' `*.ads.scenario.tsx` files
637
+ (`src/owner-scenarios.mts`), read statically from the captured revision.
638
+ `ads check` reports their coverage.
639
+
640
+ In a project without scenarios the registry is empty, and everything that
641
+ renders scenarios (captures, the render audit, preview verification) reports
642
+ `{ status: "not-available", reason: "no-scenarios", message }` and does not
643
+ pass ([showcase contract](ADS.md#showcase-contract)).
644
+
645
+ ### Folder-derived navigation
646
+
647
+ The filesystem is the only grouping source:
648
+
649
+ - A nonempty container above an owner, whose non-hidden children are all real
650
+ directories, supplies its exact folder name as the group.
651
+ - An owner directory and a layer root never become groups.
652
+ - A direct file or symlink disqualifies a container.
653
+ - Nested qualifying containers form a path label such as `Forms / Selection`.
654
+ - Flat owners stay ungrouped, with no Default heading.
655
+
656
+ To reorganize groups, move the owners, and update imports and path-derived
657
+ identities where needed. No scenario or owner metadata can override the folder
658
+ rule.
659
+
660
+ Discovery adds an optional derived `group` to scenario results. One registry
661
+ feeds `ads_scenarios`, its searchable group labels, `ads://project/scenarios`
662
+ and the showcase. The browser only groups those results. It does not scan
663
+ folders and owns no second taxonomy.
664
+
665
+ Directory entries participate in discovery and build freshness. So the addition
666
+ or removal of a non-source file also updates the grouping, without a TSX edit.
667
+ Grouping grants no API visibility, render coverage or runtime behavior.
668
+
669
+ ### Drafts are tracked proposals
670
+
474
671
  Every MCP source change is a tracked proposal: `ads-drafts/` source in explicit
475
672
  `.ads` files, with canonical target mappings and baseline fingerprints. Only
476
673
  `ads_accept` of an exact draft revision writes accepted source. Production
477
- discovery/imports exclude drafts.
478
-
479
- Ownership makes drafts independent. Every authored file has one owner, and an owner
480
- is in at most one open draft, so concurrent clients edit different owners and drafts
481
- never share a file. A draft carries only its owners' files; a companion such as
482
- `ds.config.json` joins when the draft changes it. Shared entries are generated from
483
- owned files: the public barrel and review entry from each owner's
484
- `<Owner>.ads.exports.ts` (its named re-exports, copied with rebased paths, so a product
485
- build never includes an exports file), the styles entry from the canonical token sheets, the theme
486
- files from the token halves. Style permissions live in the owner's contract. ADS
487
- therefore never merges: if accepted source changes under a draft (a direct edit or a
488
- Git pull), acceptance reports a baseline conflict and the draft is recreated.
489
-
490
- Each connected project runtime owns one managed preview compiler process.
491
- Semantic analysis uses the shared host described above. Generated preview
492
- workspaces (`.ds/draft-previews/<id>/project`) retain the normal project layout and
493
- public imports while overlaying proposed owner files and declared draft dependencies,
494
- with the generated entries regenerated. The preview compiler process hosts each
495
- draft workspace as an in-process instance listed in a control file, and one scheduler
496
- runs their builds in turn: the viewed draft first, then the project, then background
497
- work. A draft's preview is a view of its workspace served by the project's showcase,
498
- in comparison (`?draft=<id>`) or alone (`/draft/<id>/`, the same client with that
499
- workspace's MCP endpoint). Only these workspaces skip acceptance validation for fast
500
- feedback. A draft's own edits and the viewed draft resync at once; other drafts
501
- behind an accepted-source change catch up in the background.
502
-
503
- Acceptance fences the exact reviewed revision, builds a candidate copy and rechecks
504
- live inputs before publication. When the draft's workspace holds the same inputs as
505
- the candidate, `ads check` and the browser renders run there, through the project's
506
- compiler and host, so a dry run followed by acceptance of the same revision reuses its
507
- check and audit results. Pattern/composition and token-group draft dependencies
508
- resolve to normal accepted source after promotion.
509
- The [draft guide](../skills/ads-designer/references/drafts.md) defines lifecycle,
510
- completion requirements, build integration and recovery.
511
-
512
- Humans and coding agents inspect the same project through one ADS runtime.
513
- The local showcase is a minimal HTTP shell. It discovers navigation and scoped
514
- preview actions through a narrow JSON adapter over the same services used by
515
- MCP. Agents and external MCP Apps retain MCP tools/resources; the HTTP browser
516
- bundle contains no MCP SDK or JSON-RPC implementation. The shell has no project
517
- implementation imports and does not execute project code.
518
-
519
- The local preview is one persistent opaque iframe on a separate loopback origin,
520
- without the extra MCP Apps proxy frame. Checked manifests use bounded revision
521
- reuse/deltas; immutable asset URLs refer to pinned, authorized graph bytes, never
522
- filesystem paths. Ordinary modules, CSS, fonts and images load over HTTP. Worker
523
- scripts and modules referring to them use verified Blob URLs because the opaque
524
- sandbox cannot directly create workers from another origin. External MCP Apps
525
- continue to use the existing resource adapter and sandbox proxy.
526
-
527
- HTTP build reports arrive over SSE. Connect/reconnect and visibility resume
528
- reconcile discovery and scoped build state; there is no periodic HTTP status
529
- poll. Interrupted connections mark retained previews potentially stale. Frame
530
- capabilities have a separate lifetime connection, a bounded reconnect grace,
531
- and immediate retirement on explicit close, scope removal or shutdown. The
532
- [HTTP design and measurements](HTTP-SHOWCASE-POC.md) record limits and historical
533
- comparisons. Captures and verification use the default local HTTP host while
534
- preserving exact viewport, revision, readiness and publication gates.
535
-
536
- Starting MCP starts the website; browser-only showcase starts the same runtime
537
- without stdio. All modes share the managed Bun compiler. Shutdown closes the
538
- website, streams, frame capabilities, connections and compiler.
539
-
540
- The ADS host gives inline App documents an `about:srcdoc` base when the App
541
- provides no explicit base URL. Fragment links then stay inside their own document
542
- with native scrolling, history and events. The sandbox permits this local base;
543
- external bases still require declared CSP origins. This belongs to document
544
- loading and changes no project link or scenario handler. External hosts control
545
- their own document-loading and CSP behavior.
546
-
547
- The proxy and App sandbox permit native forms (`allow-forms`). This lets browser constraint validation and `submit`
548
- handlers run for clicks, Enter and `requestSubmit()`. Client-side handlers retain
549
- their own `preventDefault()` behavior. The App stays opaque; CSP
550
- `form-action 'none'` blocks native action requests without suppressing submit
551
- handlers. Hosts outside ADS choose their own sandbox and CSP permissions.
552
-
553
- ADS's Bun preview compiler publishes a versioned dependency graph: shared runtime and
554
- foundation assets, plus independently addressable scenario modules. Inside the
555
- preview, the selected dependency closure loads from checked HTTP assets or
556
- verified MCP resources and mounts it using the project's framework adapter. Native
557
- ES modules preserve shared runtime identity, cycles and live bindings. Switching
558
- scenarios unmounts the previous view while keeping unchanged dependencies cached.
559
- Persistence is a host lifecycle choice; a new external widget loads the same
560
- resources independently. Resource sharing is scoped to an App instance.
561
-
562
- Resource IDs hash original bytes and the transitive graph of URLs they rewrite.
563
- Cyclic module groups share a deterministic fingerprint. This makes
564
- IDs independent of compiler filename hashing: rewriting a changed dependency
565
- cannot put different bytes behind an existing URI. Unrelated graph branches keep
566
- their IDs and caches. The App still verifies the digest of the final bytes and
567
- rejects any identity collision without partially registering the new graph.
568
-
569
- The showcase's resource bridge can recover a transient fetch failure with at most
570
- three read attempts and bounded backoff. This applies only to resource reads;
571
- tool calls, assertions and whole checks are never replayed. Cancellation,
572
- HTTP/protocol/content errors and integrity failures remain failures. Browser
573
- diagnostics record retries, and verification retains recovered startup reads in
574
- its case results. Persistent transport failures still block a mutation. External
575
- hosts own their transport recovery; the reusable App's integrity checks remain
576
- the same.
577
-
578
- Managed graph builders publish into `.ds/preview/sessions/<session>/`.
579
- Logical scenario IDs and resource URIs stay unchanged;
580
- standalone builds publish `.ds/preview/manifest.json` and cannot overwrite a live
581
- session's success record. Verified compiled snapshots form a bounded shared
582
- warm-start cache. Source, compiler, dependency and output hashes still gate reuse.
583
- Ordinary shutdown removes owned session output while retaining that cache.
674
+ discovery and imports exclude drafts.
675
+
676
+ **Ownership makes drafts independent.**
677
+
678
+ - Every authored file has one owner, and an owner is in at most one open draft.
679
+ Concurrent clients therefore edit different owners, and drafts never share a
680
+ file.
681
+ - A draft carries only the files of its owners. A companion such as
682
+ `ds.config.json` joins when the draft changes it.
683
+ - The public barrel and `foundation.ads.ts` belong to the foundation owner. The
684
+ token sheets belong to the tokens owner.
685
+ - ADS never merges. If accepted source changes under a draft (a direct edit or
686
+ a Git pull), acceptance reports a baseline conflict and the draft is
687
+ recreated.
688
+
689
+ **Draft workspaces.** A generated preview workspace
690
+ (`.ds/draft-previews/<id>/project`) keeps the normal project layout and public
691
+ imports. It overlays the proposed owner files and the declared draft
692
+ dependencies. The preview of a draft is a view of its workspace, served by the
693
+ project's showcase:
694
+
695
+ - In comparison: `?draft=<id>`.
696
+ - Alone: `/draft/<id>/`, the same client with the MCP endpoint of that
697
+ workspace.
698
+
699
+ Only these workspaces skip acceptance validation, for fast feedback. A draft's
700
+ own edits and the viewed draft resync at once. Other drafts that are behind an
701
+ accepted-source change catch up in the background.
702
+
703
+ **Acceptance.** Acceptance fences the exact reviewed revision, builds a
704
+ candidate copy, and checks live inputs again before publication.
705
+
706
+ - Acceptance regenerates `palette.generated.ts` in the candidate before its
707
+ check, so the published change includes it.
708
+ - When the draft's workspace holds the same inputs as the candidate,
709
+ `ads check` and the browser renders run there, through the project's compiler
710
+ and host. A dry run followed by acceptance of the same revision therefore
711
+ reuses its check and audit results.
712
+ - After promotion, pattern and mock draft dependencies resolve to normal
713
+ accepted source.
714
+ - Unless `compile.emitOnAccept` is `false`, the published revision is emitted.
715
+ The emit reuses the analysis of the acceptance check
716
+ ([MCP](MCP.md#emitting-from-mcp)).
717
+
718
+ The [draft guide](../skills/ads-designer/references/drafts.md) defines the
719
+ lifecycle, completion requirements, build integration and recovery.
720
+
721
+ ### The HTTP shell and the preview frame
722
+
723
+ The local showcase is a minimal HTTP shell. It uses HTTP for discovery, status,
724
+ events, preview actions and checked assets.
725
+
726
+ - The shell discovers navigation and scoped preview actions through a narrow
727
+ JSON adapter over the same services that MCP uses.
728
+ - The HTTP browser bundle contains no MCP SDK or JSON-RPC implementation.
729
+ - The shell imports no project implementation and executes no project code.
730
+
731
+ **The frame.** The local preview is one persistent opaque iframe on a separate
732
+ loopback origin, without the extra MCP Apps proxy frame. It preserves isolation
733
+ and viewport behavior.
734
+
735
+ - Checked manifests use bounded revision reuse and deltas.
736
+ - Immutable asset URLs refer to pinned, authorized graph bytes, never to
737
+ filesystem paths.
738
+ - Ordinary modules, CSS, fonts and images load over HTTP.
739
+ - Worker scripts, and modules that refer to them, use verified Blob URLs: the
740
+ opaque sandbox cannot create workers directly from another origin.
741
+ - External MCP Apps use the resource adapter and the sandbox proxy.
584
742
 
585
743
  ```mermaid
586
744
  flowchart LR
@@ -591,158 +749,295 @@ flowchart LR
591
749
  MCP --> Graph
592
750
  ```
593
751
 
594
- The shell belongs to tooling. Components, patterns, design values, scenario inputs
595
- and the UI rendered inside Apps belong to the project. This keeps the tool useful
596
- with an empty ADS while making every implementation addressable once its scenario
597
- exists.
752
+ **Events and connections.** HTTP build reports arrive over SSE; there is no
753
+ periodic HTTP status poll.
754
+
755
+ - Connect, reconnect and visibility resume reconcile discovery and scoped build
756
+ state. An interrupted connection marks retained previews potentially stale.
757
+ - Frame capabilities have a separate lifetime connection and a bounded
758
+ reconnect grace. They retire at once on explicit close, scope removal or
759
+ shutdown.
760
+ - Captures and verification use the default local HTTP host and preserve the
761
+ exact viewport, revision, readiness and publication gates.
762
+
763
+ **Modes.** A started MCP server also starts the website. A browser-only showcase
764
+ starts the same runtime without stdio. All modes share the managed Bun
765
+ compiler. Shutdown closes the website, streams, frame capabilities, connections
766
+ and compiler.
767
+
768
+ **Sandbox.** The sandbox keeps the App opaque and still lets a scenario behave
769
+ as a document: an `about:srcdoc` base for inline documents, native forms
770
+ (`allow-forms`, with CSP `form-action 'none'`), and bundled binary assets with
771
+ blob reads and WebAssembly compilation but no external network access,
772
+ JavaScript eval or host DOM access. These rules belong to document loading and
773
+ change no project link or scenario handler. External hosts choose their own
774
+ ([host boundary](MCP.md#host-boundary-and-compatibility)).
775
+
776
+ ### The preview resource graph
777
+
778
+ ADS's Bun preview compiler publishes a versioned dependency graph: shared
779
+ runtime and foundation assets, plus independently addressable scenario modules.
780
+ The MCP server serves compiled bytes and does not evaluate project TSX.
781
+
782
+ **Loading and mounting.** Inside the preview, the selected dependency closure
783
+ loads from checked HTTP assets or verified MCP resources. A mount that ADS
784
+ generates for the project's framework normalizes each entry to mount/unmount
785
+ with native framework semantics. The choice of a framework installs none into
786
+ the tooling host.
787
+
788
+ - The mount hands the scenario to `mountScenarioPage`
789
+ (`showcase-client/scenario-page.mts`, part of `@reqvire-org/ads/preview`). It
790
+ draws the page with the showcase UI bundle and gives each specimen's box
791
+ (`[data-slot="specimen"]`) to the framework, which renders that specimen's
792
+ `render` as a component with the chosen state's props. Each specimen is its
793
+ own framework root.
794
+ - The scenario kit is generated for the project's framework beside the mount
795
+ (`generatedKit`, `src/preview-source.mts`): each kit component is a host
796
+ element in which ADS draws its own component; a `Container` places its
797
+ children in that component's content slot through a portal.
798
+ - The frame's root is `createPreviewRoot` (`showcase-client/preview-root.mts`).
799
+ The frame module is `showcase-client/preview-frame.mts`, shipped as
800
+ `dist/showcase/preview-frame.mjs`; a checkout uses the built frame, because
801
+ the page needs the built UI bundle.
802
+ - The root also carries the layout-guide controls
803
+ (`showcase-client/guide-controls.mts`).
804
+ - ADS views render into the same root (`showcase-client/ads-views.mts`).
805
+
806
+ Native ES modules preserve shared runtime identity, cycles and live bindings. A
807
+ scenario switch unmounts the previous view and keeps unchanged dependencies
808
+ cached. Persistence is a host lifecycle choice: a new external widget loads the
809
+ same resources independently. Resource sharing is scoped to an App instance.
810
+
811
+ **One shared graph.** Previews build one shared multi-entry graph on first
812
+ preview demand or accepted-edit preparation, then reuse it across selections
813
+ and unchanged restarts. The App loads the selected scenario's static dependency
814
+ closure; dynamic imports stay lazy. Production bundles, workers and
815
+ cancellation stay project-owned.
816
+
817
+ **Code inside the frame.** The code that runs inside the frame lives in
818
+ `preview-client/`, as strict TypeScript with no Node APIs: one transport-neutral
819
+ runtime (`runtime.mts`) with its resource and HTTP loaders, hot-update runtime,
820
+ manifest cache, grid overlay and subject stage. The build bundles it per
821
+ delivery:
822
+
823
+ | Bundle | Delivery |
824
+ | --- | --- |
825
+ | `dist/mcp/preview-widget.bundle.js` | The MCP App (`preview-widget.mts`) |
826
+ | `dist/mcp/preview-http.bundle.js` | The HTTP showcase (`preview-http.mts`) |
827
+ | `dist/mcp/resource-loader.js` | The loader alone |
828
+
829
+ Page code that Playwright evaluates stays in `src/` as `*.page.mts` (the paint
830
+ audit in `src/verification/paint-audit.page.mts`).
831
+
832
+ **Resource identity.** A resource ID hashes the original bytes and the
833
+ transitive graph of URLs they rewrite. Cyclic module groups share a
834
+ deterministic fingerprint. IDs are therefore independent of compiler filename
835
+ hashing: the rewrite of a changed dependency cannot put different bytes behind
836
+ an existing URI, and unrelated graph branches keep their IDs and caches. The
837
+ App still verifies the digest of the final bytes, and rejects an identity
838
+ collision without partially registering the new graph.
839
+
840
+ **Transient read failures.** The showcase's resource bridge recovers a
841
+ transient fetch failure with at most three read attempts and bounded backoff.
842
+ Only resource reads are retried: tool calls, assertions and whole checks are
843
+ never replayed. Cancellation, HTTP, protocol and content errors and integrity
844
+ failures stay failures, and a persistent transport failure still blocks a
845
+ mutation. Browser diagnostics record retries, and verification keeps recovered
846
+ startup reads in its case results. External hosts own their transport
847
+ recovery; the reusable App's integrity checks are the same.
848
+
849
+ **Published output.** Managed graph builders publish into
850
+ `.ds/preview/sessions/<session>/`; logical scenario IDs and resource URIs do
851
+ not change. A standalone build publishes `.ds/preview/manifest.json` and cannot
852
+ overwrite a live session's success record. Verified compiled snapshots form a
853
+ bounded shared warm-start cache, gated by source, compiler, dependency and
854
+ output hashes, which ordinary shutdown keeps
855
+ ([output locations](MCP.md#output-locations-and-limits)).
856
+
857
+ ### ADS views
858
+
859
+ `src/ads-views.mts` declares the ADS views. Each names the part of the preview
860
+ tree's facts file its module embeds and what it brings into the frame.
861
+
862
+ A view is laid out by showcase-ui components, which ADS checks; the view module
863
+ sets only the inspected project's values on them. A token's sample is
864
+ `TokenSample`, a profile applied as a whole is `AppliedSample`, a motion
865
+ profile plays on `MotionSample` (through the Web Animations API, with the
866
+ profile's own timing), an asset is drawn in `ArtworkSample`, and a grid is
867
+ shown by `GridExample` and `MiniUnitSample`. Each exposes one element
868
+ (`[data-slot="value"]`, `"dot"` or `"drawing"`) for the project's value. A
869
+ view module holds no stylesheet and no CSS rule
870
+ (`tests/unit/view-modules.test.ts`). The one sheet a view adds is the grid's
871
+ own rules from the facts, written as they are by
872
+ `showcase-client/project-rules.mts`.
873
+
874
+ **Foundation** (`foundation`) embeds the grids and the public module, so every
875
+ owner's sheet is in its frame.
876
+
877
+ **Tokens** (`tokens`, `showcase-client/tokens-view.mts`):
878
+
879
+ - It embeds the facts' `tokens` (`src/token-view-facts.mts`): the token
880
+ inventory's builder given no owners, so the bytes depend on the foundation
881
+ alone.
882
+ - It imports only the document sheet and the tree's preview-only
883
+ `ads-preview-tokens.css` (the `tokenCss` of every token, since an emitted
884
+ sheet carries only the tokens its owner reaches).
885
+ - No owner is in its module graph: an owner-only edit leaves it unchanged, and
886
+ a token edit rebuilds it.
887
+
888
+ **Profiles** (`profiles`, `showcase-client/profiles-view.mts`):
889
+
890
+ - It embeds the facts' `profiles` (`src/profile-view-facts.mts`): each
891
+ profile's kind, declaration file, the profiles it builds on, every field with
892
+ the profile that states it and the tokens it reads, its choices, and the
893
+ profiles that build on it or select it in a slot. The foundation keeps this
894
+ in each profile's `declared` data.
895
+ - It takes the same frame as the tokens view, so a field that reads one token
896
+ draws that token's sample in the frame's theme and brand.
897
+ - It lists no owners, so an owner-only edit leaves it unchanged; a profile or
898
+ token edit rebuilds it.
899
+
900
+ **Artwork** (`assets`, `showcase-client/assets-view.mts`):
901
+
902
+ - It embeds the facts' `assets` (`src/asset-view-facts.mts`): every asset of
903
+ the asset catalog with its authored drawings as text, and every glyph set.
904
+ - It draws each asset with `sanitizeInspectedSvg` (`src/inspected-svg.mts`),
905
+ the one sanitizer for inspected SVG. A frame module may import a pure module
906
+ of `src/`; the build rewrites that import for the built tool.
907
+ - It takes the token-sheets frame, so a paint slot's token colours its drawing.
908
+ It lists no owners.
909
+ - It renders one token group at a time through showcase-ui's
910
+ `renderSpecimenSections`: choices, role sections, and a sample column that
911
+ the view fills with the token's own custom property, at most 100 rows per
912
+ page.
913
+ - It reads each value from the frame's computed style.
914
+ - It keeps the chosen group across a rebuild through the runtime's
915
+ navigate/focus round trip with the host.
916
+
917
+ The explorer's token category counts the `tokens` of the preview tree's facts,
918
+ the list the view renders, so a warm explorer read never walks the project's
919
+ inputs. Before any revision is previewed, the analysis worker's `token-summary`
920
+ operation counts them from the design inputs only.
598
921
 
599
- ### The foundation has a narrow styling role
922
+ ### Incremental compilation and refresh
600
923
 
601
- Shared token sheets define values on the document root, per-theme values as halves, and
602
- brand values on `[data-brand]`; the generated `themes.generated.css` resolves them. The
603
- import-only entry loads them in canonical order, the generated sheet last. `fonts.css` declares font faces;
604
- `base.css` establishes shared native defaults and normalization. Components and
605
- patterns own their layout, skin, states and animations in Linaria.
606
-
607
- `base.css` has a closed contract with three roles: root/body typography, canvas
608
- colors and theme behavior; limited native normalization; and global accessibility
609
- through focus indicators and reduced-motion rules. Selector, property and value
610
- checks reject component skins and layout even when they use native selectors and
611
- valid tokens. A `button` background or `body` grid belongs to a Linaria owner.
612
- Document defaults also cover shared text selection and document scrollbars;
613
- local control/scroll-container styling stays with its owner.
614
-
615
- Foundation CSS passes the ordinary token-reference and visual-value checks too.
616
- Parsed selectors reject component hooks, local shared-token overrides and
617
- contextual selectors, including hooks concealed in `:where()` or `:is()`. The
618
- policy describes CSS roles and normalization keywords, with no project classes,
619
- token catalogue or sample templates. Lower specificity cannot bypass ownership.
620
- Static gates establish this source contract; browser review still checks its
621
- actual effects and accessibility.
924
+ Each connected project runtime owns one managed preview compiler process.
925
+ Semantic analysis uses the [shared analysis host](#semantic-analysis), not this
926
+ process. TSX needs compilation, and there is one preview pipeline with
927
+ automatic updates.
622
928
 
623
- ### A preview scenario is the unit of review
929
+ The compiler process hosts each draft workspace as an in-process instance,
930
+ listed in a control file. One scheduler runs the builds in turn: the viewed
931
+ draft first, then the project, then background work.
624
932
 
625
- A component export alone may need inputs, parent context, local state or callbacks
626
- to produce useful UI. A scenario supplies that development context around the
627
- real public implementation. It mounts independently, without opening a showcase
628
- page or initializing the application's router, store or services first.
629
-
630
- Scenarios and their fixtures live beside the component or pattern they exercise.
631
- Demo framing belongs to development-only review helpers; component props describe
632
- intentional product behavior and visual variants.
633
- The token and brand views are tool-owned: ADS builds them from the token sheets,
634
- `tokens/catalog.ads.json` (groups and sample bindings) and `assets/brand/`. The project
635
- owns the data; ADS owns the presentation. The tool contains no project token list,
636
- sample values or assumed visual identity.
637
- Larger scenarios live under `composition/`. They use the same public screen
638
- patterns as production: application adapters supply live data and effects;
639
- scenario adapters supply fixture data, local state and simulated services.
640
- Reassembling a second screen from shared primitives still allows design drift.
641
-
642
- The server discovers one path-derived scenario registry. The showcase's scenario
643
- sections (Brand, Tokens, Components, Patterns and Composition) browse that same registry
644
- through MCP results. They do not initialize the entry or define
645
- its UI. Every preview uses `?scenario=<id>`; discovered `kind` selects its section. The host supplies theme and
646
- available space; the public implementation
647
- supplies presentation. Several related public parts may share a scenario with
648
- their required parent. Every declared token and every public renderable component
649
- and pattern needs addressable coverage. Token references must exist in the real
650
- foundation; claimed token/UI coverage must be reachable from the scenario entry.
651
- Types, constants and utilities do not require UI scenarios.
652
- Explicitly declared public children can share a parent's scenario when bounded
653
- source tracing reaches them through its returned JSX and selected props/defaults.
654
- Opaque conditional branches do not grant speculative coverage. Scenarios may
655
- consume deliberate public class helpers when their returned styles retain
656
- runtime-owned Linaria provenance; stable owner-authored hooks may accompany real
657
- styles. This preserves ownership rather than granting scenario styling freedom.
658
- A native element may provide semantics as the single direct child of a public
659
- runtime slot when source tracing proves it is cloned with that owner's props.
660
- This preserves polymorphic composition without allowing standalone scenario
661
- controls, scenario styling or name-based exceptions. Selector-based composition
662
- can establish the same ownership through actual returned DOM and attached runtime
663
- Linaria: a positive native-tag relationship, or a `:has` relationship to a marker
664
- declared by a real runtime-owned child. Broad selectors and scenario-authored
665
- lookalikes grant no permission. This source proof does not establish computed
666
- appearance, keyboard behavior or visual parity; browser checks remain necessary.
667
- The skill-local [scenario guide](../skills/ads-designer/references/scenarios.md)
668
- explains evidence, limits and diagnostics.
933
+ #### The emitted tree and complete revisions
669
934
 
670
- ### Folder-derived navigation
935
+ A preview compiles the emitted output of the design system:
671
936
 
672
- The filesystem is the only grouping source. A nonempty container above an owner,
673
- whose non-hidden children are all real directories, supplies its exact folder
674
- name. An owner directory and layer root never become groups; a direct file or
675
- symlink disqualifies a container. Nested qualifying containers form a path label
676
- such as `Forms / Selection`. Flat owners stay ungrouped with no Default heading.
677
- This applies to components, patterns, compositions and brand previews (`brand/`);
678
- token categories remain unchanged. Move owners to reorganize groups, updating imports and path-derived
679
- identities where needed. No scenario/owner metadata can override the folder rule.
680
-
681
- Discovery adds an optional derived `group` to scenario results. One registry feeds
682
- `ads_scenarios`, its searchable group labels, `ads://project/scenarios` and the
683
- showcase. The browser only groups those results; it does not scan folders or own a
684
- second taxonomy. Directory entries participate in discovery and build freshness,
685
- so adding/removing a non-source file also updates grouping without a TSX edit.
686
- Public catalogue preview IDs, edit-unit ownership and compiled
687
- resource selection continue to use the real owner/scenario paths. Grouping grants
688
- no API visibility, render coverage, styling permission or runtime behavior.
937
+ - Production modules come from a stable preview-owned tree
938
+ (`.ds/emitted/live/`). The tree holds the same bytes that `ads emit` writes.
939
+ - Scenarios, fixtures and other development files compile from source beside
940
+ the tree.
941
+ - Nothing is transformed.
942
+ - If a development file imports an authored production file that the tree does
943
+ not hold, the build fails. ADS never renders authored source silently.
689
944
 
690
- ### Incremental compilation and refresh
945
+ The compiler builds only when it is told that a complete revision is in place.
946
+ It never builds on file events in the tree, so it never builds a mix of two
947
+ revisions.
948
+
949
+ - An edit of a production module holds its builds until a tree holds the edit.
950
+ - A compiler that starts after such an edit also holds for it, from the sources
951
+ the tree records.
952
+ - MCP replays the emitter's latest revision (or its failure) to a restarted
953
+ compiler.
954
+ - A build that a newer revision supersedes is built again. It is never reported
955
+ as a failure.
691
956
 
692
- `runScenarioCompiler` remains the single scheduler for live feedback, source
957
+ #### Watched and complete builds
958
+
959
+ `runScenarioCompiler` is the single scheduler for live feedback, source
693
960
  validation, discovery, freshness and verified publication. Watched previews use
694
- `createIncrementalPreviewBuilder`: a private Vite module graph with the same ADS
695
- Linaria extraction, import optimization, spatial metadata and source identities
696
- as complete builds. React Refresh and native Prefresh supply component signatures
697
- and replacement. This is preview compilation, not a second analysis engine.
698
- Unwatched builds and acceptance preparation retain the complete Bun builder.
699
- The application retains its own production bundler.
700
-
701
- Vite runs in middleware mode without a listening server, filesystem routes or
702
- browser websocket. The builder snapshots transformed modules, CSS, local assets,
703
- literal lazy imports and self-contained Bun worker output into the existing
704
- immutable `ads://assets/…` graph. Module reads never compile live filesystem
705
- contents. The existing scheduler fences the source revision before publishing;
706
- project and draft roots own separate compiler sessions. The shared analysis
707
- service continues to supply discovery and checking.
708
-
709
- Watched manifests add optional `refresh: {version: 1, epoch}` and module metadata
710
- `hot: {id, source}`. The ID is stable within that compiler session; `source` hashes
711
- the lowered module before immutable dependency URI rewriting. This lets the
712
- loader distinguish changed code from a changed dependency address. A bounded
713
- rewrite cache avoids reparsing unchanged compiler output while still observing
714
- output membership and worker content changes.
715
-
716
- The existing sandboxed iframe remains alive for compatible updates. Its resource
717
- loader evaluates changed framework boundaries, updates styles, and preserves
718
- component state, input values, focus and selection where the framework permits.
719
- It tracks already executed lazy modules and visited views too; unopened lazy
720
- branches remain unloaded. Navigation still mounts the selected scenario normally.
721
- Changed hook signatures follow the framework's reset semantics. Removed or
722
- incompatible exports, compiler/configuration epoch changes, interrupted refresh,
723
- and restoration of an already evaluated old revision require a clean frame.
724
- A failed source check restores the last verified output and remains a failure;
725
- state retention is never a substitute for validation or acceptance.
726
-
727
- The internal graph is renewed when configuration/dependency manifests or the
728
- captured original inputs of optimized dependencies change, on source-directory
729
- membership changes that can alter resolution, or when
730
- its retained input/module count exceeds 4096 or retained lowered source/code
731
- exceeds 64 MiB. Browser retained module metadata is bounded at 4096 records and
732
- materialized resource bodies at 64 MiB, with a clean-frame reopen at the next
733
- mount. These are retention limits, not process RSS guarantees. Owned Vite,
734
- extraction, worker and temporary-directory lifetimes end with their builder.
735
- See [caching](CACHING.md#preview-restoration) for the content checks.
736
-
737
- The [preview benchmark](../scripts/benchmarks/preview/README.md) records the
738
- integrated measurement method and results. Frame removal, the V3/source-emission
739
- proposal and HTTP delivery remain outside this release. This integration does
740
- not claim to fix Chromium's raw corner pixels.
741
-
742
- New preview requests share one input-stamp capture per batch. After that
743
- asynchronous capture, scheduling reads the current candidate, publication and
744
- registry together. Candidate completion or replacement during capture cannot
745
- lose a requested view or reuse coverage from a retired candidate.
961
+ `createIncrementalPreviewBuilder`: a private Vite module graph with the same
962
+ import optimization and source identities as complete builds. Unwatched builds
963
+ and acceptance preparation use the complete Bun builder. React Refresh and
964
+ native Prefresh supply component signatures and replacement.
965
+
966
+ This is preview compilation, not a second analysis engine: the shared analysis
967
+ service supplies discovery and checking, and the application keeps its own
968
+ production bundler.
969
+
970
+ - Vite runs in middleware mode, without a listening server, filesystem routes
971
+ or a browser websocket.
972
+ - The builder snapshots modules, CSS, local assets, literal lazy imports and
973
+ self-contained Bun worker output into the immutable `ads://assets/…` graph.
974
+ Module reads never compile live filesystem contents.
975
+ - The scheduler fences the source revision before publication. Project and
976
+ draft roots own separate compiler sessions.
977
+ - A watched graph includes the requested scenario roots and their dependencies,
978
+ and preserves the roots that other mounted Apps use. Untouched entries are
979
+ not compiled until requested. Unwatched full builds keep complete entry
980
+ coverage.
981
+ - Worker bundle reuse and the pruning of generated output trees from watches
982
+ are described in [MCP.md](MCP.md#warming-and-the-job-queue). The worker build
983
+ cache is separate from source-validation evidence.
984
+
985
+ #### Hot updates
986
+
987
+ The sandboxed iframe stays alive for compatible updates and keeps component
988
+ state, input values, focus and selection where the framework permits.
989
+ [MCP.md](MCP.md#refresh-in-the-preview-frame) lists which change refreshes in
990
+ place and which reopens a clean frame.
991
+
992
+ - A watched manifest's `hot.source` hashes the lowered module before immutable
993
+ dependency URI rewriting, so the loader can tell changed code from a changed
994
+ dependency address ([fields](MCP.md#output-locations-and-limits)).
995
+ - A bounded rewrite cache avoids reparsing unchanged compiler output and still
996
+ observes output membership and worker content changes.
997
+ - Unopened lazy branches stay unloaded. Changed hook signatures follow the
998
+ framework's reset semantics.
999
+ - A failed source check restores the last verified output and stays a failure.
1000
+ State retention never substitutes for validation or acceptance.
1001
+
1002
+ Production modules refresh from the emitted tree and development files from
1003
+ the design system: the framework refresh transforms cover both directories. An
1004
+ owner edit therefore replaces the emitted owner in place even when its scenario
1005
+ module is no refresh boundary itself (it exports its `scenario` metadata).
1006
+ Otherwise the update would reach the scenario and reopen the frame.
1007
+
1008
+ **Fidelity guarantee.** A hot update renders exactly what a clean render of the
1009
+ same revision renders. `tests/browser/hot-update-fidelity.test.mjs` holds the
1010
+ guarantee in the default HTTP showcase with normal Chromium settings. It
1011
+ compares live views that received an owner source edit, and separately token
1012
+ sheet edits, as hot updates against a fresh page in a fresh browser context on
1013
+ the same revision, selections and interactions. The frames must match pixel for
1014
+ pixel. Every element's classes, interaction state and computed style, and the
1015
+ applied sheets and their order, must be equal.
1016
+
1017
+ The one explained difference is Chromium's own: a hovered rounded control whose
1018
+ radius changes in place keeps slightly different corner antialiasing than a
1019
+ fresh paint, until the pointer enters again. For that case the hot update must
1020
+ equal, pixel for pixel, a clean render whose page makes the same value change
1021
+ in place itself.
1022
+
1023
+ **Renewal and retention.** The internal graph is renewed when configuration or
1024
+ dependency manifests change, when the captured original inputs of optimized
1025
+ dependencies change, and on source-directory membership changes that can alter
1026
+ resolution ([builder graph](CACHING.md#builder-graph)). It is also renewed, and
1027
+ the frame reopened clean at the next mount, past the retention
1028
+ [limits](CACHING.md#limits): 4096 retained inputs, modules or metadata records,
1029
+ or 64 MiB of lowered source and code or of materialized resource bodies. These
1030
+ are retention limits, not process RSS guarantees. Owned Vite, worker and
1031
+ temporary-directory lifetimes end with their builder.
1032
+
1033
+ #### Validation and publication
1034
+
1035
+ Watched compilation gives immediate visual feedback. Validation and scenario
1036
+ inspection run in the background on the shared asynchronous analysis host, not
1037
+ on an inspector-owned worker. Rapid edits replace pending work, with one
1038
+ verification run in flight.
1039
+ [MCP.md](MCP.md#verified-and-live-graphs) states the contract of the two
1040
+ graphs.
746
1041
 
747
1042
  ```mermaid
748
1043
  flowchart LR
@@ -758,670 +1053,887 @@ flowchart LR
758
1053
  App --> Mount[Incompatible or rollback: clean frame]
759
1054
  ```
760
1055
 
761
- Watched compilation provides immediate visual feedback while validation and
762
- scenario inspection run in the background. Inspection uses the shared asynchronous
763
- analysis host, rather than an inspector-owned worker. Rapid edits replace pending work, with one
764
- verification run in flight. Production builds retain their own optimization.
765
-
766
- Preview discovery shares `.ds/scenario-registry.json` between the MCP host,
767
- draft selector and compiler processes. The snapshot contains scenario metadata
768
- and diagnostics, keyed to the full relevant source/dependency/directory revision
769
- and the loaded ADS code/runtime. Accepted and draft roots retain separate
770
- snapshots. A matching snapshot avoids repeating TypeScript analysis during
771
- startup; changed inputs or missing/corrupt snapshots trigger fresh discovery.
772
- Explicit catalogue reads fence their in-memory registry against current source,
773
- so edits and removals are visible before the next observation/reconciliation tick.
774
- Reopening an already known draft scenario retains its last discovered metadata
775
- while the shared asynchronous analysis service refreshes the catalogue.
776
- New/missing scenario identities await discovery; accepted comparison metadata
777
- is independently revision-fenced.
778
- The response's `discovery` distinguishes current, pending and failed metadata
779
- from the exact proposal revision and the actual preview build. Superseded worker
780
- results cannot replace newer requests; drop/shutdown removes owned discovery
781
- state and releases registered revisions. Preview analysis and checks share
782
- bounded native snapshots through `analysis/service.mjs`. Program acquisition
783
- delegates through `program-cache.mjs`; unchanged ASTs retain identity, and source,
784
- import and configuration edits invalidate the relevant snapshot. Watched graphs
785
- include requested scenario roots and their dependencies,
786
- preserving roots used by other mounted Apps; untouched catalogue entries are not
787
- compiled until requested. Unwatched full builds retain complete entry coverage.
788
- Snapshot publication fences source edits during inspection. This cache supplies
789
- no passing validation or behavior evidence: architecture and acceptance checks
790
- continue to inspect and validate source independently.
791
-
792
- Draft creation queues background compiler initialization. One prewarm runs at a
793
- time, newer pending drafts supersede unused queued work and reclaim an older
794
- unused speculative session, and explicit preview requests share the same startup.
795
- Explicitly opened sessions remain subject to the four-session bound.
796
- File events and MCP writes synchronize warm
797
- overlays after a short debounce; a slower periodic reconciliation recovers lost
798
- events and replaced directories. Closing ADS stops queued jobs, source watchers
799
- and every owned compiler.
800
-
801
- Draft build reports flow from their preview hosts into the parent build resource
802
- and proposal summaries. `ads://project/build.drafts` identifies active proposal
803
- builds, their scenario states, session/revision, freshness and scoped resource
804
- addresses; `ads_drafts` and relevant discovery/preview results carry compact
805
- status. Draft source edits immediately mark an existing preview queued/stale.
806
- Build transitions change the parent resource fingerprint and emit standard
807
- resource-update notifications for build/draft subscribers, including completion
808
- and failure without another edit. Active scoped build resources are listed and
809
- subscribable; removal emits a final invalidation and a resource-list change.
810
- Observers share draft events across connections, detach when closed and serialize
811
- refreshes so overlapping file events cannot replay older state. Native report-file
812
- events notify promptly; periodic observation also covers missed/replaced files.
813
- Stateless HTTP mutation handlers forward refreshes to those observers; they do
814
- not initialize fresh observation and misclassify each request as a source edit.
815
- Draft-only edits preserve accepted registry/catalogue snapshots. Capture updates
816
- reuse source-fenced discovery rather than allocating another semantic program.
817
- Explorer uses these reports for monochrome
818
- entry glyphs and refreshes its mounted Apps. Its notification scheduler keeps an
819
- already scheduled refresh's deadline; later build notices cannot postpone a
820
- catalogue update indefinitely. Refreshes run one at a time, and notices arriving
821
- during a refresh form one follow-up batch that retains any discovery request.
822
- A ready draft preview remains
823
- unaccepted; catalogue metadata or compiled feedback cannot establish acceptance.
824
-
825
- Live resources are fenced to the current source digest and managed session.
826
- They never update accepted artifacts, the successful graph cache or `current`.
827
- Only validation and compilation passing against unchanged source can publish the
828
- verified graph. Failure restores the last verified view; compilation errors are
829
- reported without waiting for a slow validation command. Files outside the compiled
830
- module graph still cause validation and build reconciliation. Normal compiler
831
- shutdown clears its current transform/worker caches and removes its scratch directory.
832
-
833
- The shared Bun builder reuses unchanged worker bundles using source, transitive
834
- dependency and configuration hashes. Workers compile sequentially in temporary
835
- Bun processes, which release their heaps before the next worker runs. This build
836
- cache is separate from source-validation evidence.
837
-
838
- Accepted MCP edits prepare previews even when no viewer has opened them. A
839
- matching checked candidate graph and scenario registry carry into the project's existing cache;
840
- otherwise the normal watcher builds it in the background. Builds tied to a
841
- temporary candidate location are rebuilt. Source, dependencies, compiler and
842
- output content determine reuse, with no expiry based on elapsed time.
843
- Cache recording checks the compiled source stamp before and after hashing
844
- dependencies. An edit racing publication cannot associate previous output with
845
- newer inputs; it leaves the previous cache intact and requires the next build.
846
- A transferred checked graph can refresh older watcher metadata without recompiling
847
- it, while a partial watched graph cannot replace the complete catalogue.
848
- Its full semantic registry snapshot transfers only when source revisions match,
849
- so reopening a compiler need not repeat discovery of accepted source.
850
- Shared dependency maps are stored once, with a fresh validation memo for each
851
- reuse operation. No file hash is retained across operations. Configuration input
852
- ordering is canonical; complete caches stay within the
853
- existing 8 MiB budget rather than silently writing an unreadable large file.
854
-
855
- Background acceptance, validation and architecture checks serialize independently
856
- of the accepted/draft preview lane. They never suspend Explorer's compiler or
857
- make a cold selection wait for a browser verification suite. Existing publications
858
- remain readable while interactive source changes compile.
1056
+ - **Two graphs.** Live resources are fenced to the current source digest and
1057
+ managed session and never update accepted artifacts, the successful graph
1058
+ cache or `current`. Only validation and compilation that both pass against
1059
+ unchanged source publish the verified graph; a failure restores the last
1060
+ verified view.
1061
+ - **Recovery.** Guarded publication invalidates the compiler explicitly.
1062
+ Content reconciliation recovers missed atomic file replacements, so OS watch
1063
+ delivery cannot establish freshness.
1064
+ - **Request batches.** New preview requests share one input-stamp capture per
1065
+ batch. After that asynchronous capture, scheduling reads the current
1066
+ candidate, publication and registry together. A candidate that completes or
1067
+ is replaced during capture cannot lose a requested view or lend coverage from
1068
+ a retired candidate.
1069
+ - **Waiting.** The built-in client waits only for compiled output on
1070
+ interactive selections; default MCP preview calls, captures and verification
1071
+ wait for verified output. A pending selection never reports App readiness as
1072
+ verified. Discovery notifications are reconciled after validation.
1073
+ - **Remount or retain.** A successful global revision does not remount an
1074
+ unchanged selected view. The App compares its static module, style and asset
1075
+ closure and keeps DOM, form and scroll state when it matches. When it
1076
+ changes, a watched graph refreshes compatible framework boundaries, and a
1077
+ complete bundled graph remounts through the generated mount.
1078
+ - **Framing.** The visible preview keeps its framing while replacement
1079
+ resources load. Kind and subject framing change only after a successful
1080
+ mount. Structural padding is resolved before paint, including delayed
1081
+ framework commits, and font readiness does not temporarily restore specimen
1082
+ padding during reloads. The subject stage takes its subjects by selector
1083
+ (a scenario's specimen boxes, a view's samples), measures their border
1084
+ boxes, and again when the document's theme or brand changes. So a change that
1085
+ only moves a subject, or changes its border or padding, still moves its
1086
+ stage.
1087
+ - **Status.** The showcase's header indicator exposes compilation, checking,
1088
+ reload and fallback status ([showcase client](MCP.md#built-in-showcase-client)).
1089
+ Messages from an older selection cannot end the loading transition of an
1090
+ entry switch.
1091
+ - **Lanes.** Background acceptance, validation and checks serialize
1092
+ independently of the accepted/draft preview lane. They never suspend
1093
+ Explorer's compiler or make a cold selection wait for a browser verification
1094
+ suite. Published graphs stay readable while source changes compile.
1095
+ - **Shutdown.** Normal compiler shutdown clears the current module and worker
1096
+ caches and removes the scratch directory.
1097
+
1098
+ #### Scenario discovery snapshots
1099
+
1100
+ Preview discovery shares `.ds/scenario-registry.json` between the MCP host, the
1101
+ draft selector and the compiler processes.
1102
+
1103
+ - The snapshot holds scenario metadata and diagnostics, keyed to the full
1104
+ relevant source, dependency and directory revision and to the loaded ADS code
1105
+ and runtime.
1106
+ - Accepted and draft roots have separate snapshots. Draft-only edits preserve
1107
+ accepted registry snapshots.
1108
+ - A matching snapshot avoids repeated discovery during startup. Changed inputs,
1109
+ or a missing or corrupt snapshot, trigger fresh discovery.
1110
+ - Explicit registry reads fence their in-memory registry against current
1111
+ source, so edits and removals are visible before the next observation or
1112
+ reconciliation tick.
1113
+ - Snapshot publication fences source edits during inspection.
1114
+
1115
+ For drafts:
1116
+
1117
+ - A reopened, already known draft scenario keeps its last discovered metadata
1118
+ while the shared analysis service refreshes the registry.
1119
+ - New or missing scenario identities wait for discovery. Accepted comparison
1120
+ metadata is revision-fenced independently.
1121
+ - The response's `discovery` distinguishes current, pending and failed metadata
1122
+ from the exact proposal revision and the actual preview build.
1123
+ - Superseded worker results cannot replace newer requests. Drop and shutdown
1124
+ remove owned discovery state and release registered revisions.
1125
+ - Capture updates reuse source-fenced discovery and allocate no other semantic
1126
+ program.
1127
+
1128
+ Preview analysis and checks share bounded native snapshots through
1129
+ `analysis/service.mts`. Program acquisition delegates through
1130
+ `program-cache.mts`. Unchanged ASTs keep their identity; source, import and
1131
+ configuration edits invalidate the relevant snapshot.
1132
+
1133
+ This cache supplies no passing validation or behavior evidence: checks and
1134
+ acceptance inspect and validate source independently.
1135
+
1136
+ #### Draft preview startup and build reports
1137
+
1138
+ **Startup.** Draft creation queues background compiler initialization.
1139
+
1140
+ - One prewarm runs at a time. Newer pending drafts supersede unused queued work
1141
+ and reclaim an older unused speculative session.
1142
+ - Explicit preview requests share the same startup. At most four draft preview
1143
+ sessions are starting at one time: one more retires the oldest starting
1144
+ session.
1145
+ - File events and MCP writes synchronize warm overlays after a short debounce.
1146
+ A slower periodic reconciliation recovers lost events and replaced
1147
+ directories.
1148
+ - Closing ADS stops queued jobs, source watchers and every owned compiler.
1149
+
1150
+ **Reports.** Draft build reports flow from their preview hosts into the parent
1151
+ build resource and the proposal summaries.
1152
+
1153
+ - `ads://project/build.drafts` identifies active proposal builds, their
1154
+ scenario states, session and revision, freshness and scoped resource
1155
+ addresses. `ads_drafts` and the relevant discovery and preview results carry
1156
+ compact status.
1157
+ - A draft source edit immediately marks an existing preview queued/stale.
1158
+ - A build transition changes the parent resource fingerprint and emits standard
1159
+ resource-update notifications for build and draft subscribers, including
1160
+ completion and failure without another edit.
1161
+ - Active scoped build resources are listed and subscribable. Removal emits a
1162
+ final invalidation and a resource-list change.
1163
+
1164
+ **Observers.** Observers share draft events across connections, detach when
1165
+ closed, and serialize refreshes so overlapping file events cannot replay older
1166
+ state. Native report-file events notify promptly; periodic observation covers
1167
+ missed or replaced files. Stateless HTTP mutation handlers forward refreshes to
1168
+ those observers. They do not initialize fresh observation, which would
1169
+ misclassify each request as a source edit.
1170
+
1171
+ **Explorer.** Explorer uses these reports for its monochrome entry glyphs and
1172
+ refreshes its mounted Apps. Its notification scheduler keeps an already
1173
+ scheduled refresh's deadline, so later build notices cannot postpone a registry
1174
+ update indefinitely. Refreshes run one at a time; notices that arrive during a
1175
+ refresh form one follow-up batch that keeps any discovery request.
1176
+
1177
+ A ready draft preview is still unaccepted: discovery metadata and compiled
1178
+ feedback cannot establish acceptance.
1179
+
1180
+ #### Previews after accepted edits
1181
+
1182
+ Accepted MCP edits prepare previews even when no viewer has opened them
1183
+ ([MCP](MCP.md#preparation-after-accepted-edits)).
1184
+
1185
+ - A matching checked candidate graph and scenario registry carry into the
1186
+ project's cache. Reuse follows content, never elapsed time.
1187
+ - A transferred checked graph can refresh older watcher metadata without a
1188
+ recompile, while a partial watched graph cannot replace the complete
1189
+ registry. Its full registry snapshot transfers only when the source revisions
1190
+ match, so a reopened compiler need not repeat discovery of accepted source.
1191
+ - Cache recording checks the compiled source stamp before and after it hashes
1192
+ dependencies. An edit that races publication therefore cannot associate
1193
+ previous output with newer inputs: it leaves the previous cache intact and
1194
+ requires the next build.
1195
+ - Shared dependency maps are stored once, with a fresh validation memo for each
1196
+ reuse operation. No file hash is kept across operations. Configuration input
1197
+ ordering is canonical.
1198
+ - A complete cache stays within the 8 MiB budget; ADS does not silently write
1199
+ an unreadable large file.
1200
+
1201
+ #### Production previews for acceptance
859
1202
 
860
1203
  For managed resource previews, ADS requests the scenarios in production mode
861
- through the reviewed draft's workspace, compiled by ADS's managed compiler and
862
- served by its host. Only a candidate without such a workspace gets a preview host
863
- of its own; its compiler is parked after production publication while the host
864
- continues serving that immutable graph to registered browser verification. Either
865
- way the incremental graph is closed before production compilation starts.
866
- Warming an already-current selection does not restart or wait for that compiler.
867
- Production reuse requires a successful production build of the exact inputs,
868
- not merely a previously compiled development graph. Project-owned additional
869
- commands still run as configured. Remove the standalone preview-build command
870
- from `acceptance.scripts`; keep it in the ordinary project build.
871
-
872
- Candidate architecture inspection shares the project's native compiler through
873
- an isolated snapshot rather than starting a compiler for each acceptance.
874
- Releasing a candidate drops its adapters, resolvers and snapshot leases while
875
- keeping live/sibling revisions valid. The service bounds active project/revision
876
- state and closes after idle time when no registered revision pins it. Direct
877
- library and syntax-only clients have their own short idle cleanup. Closing one
878
- scenario inspector cancels its requests without retiring other callers' shared
879
- compiler. Persisted registry metadata has separate content checks.
880
-
881
- After the selected view paints, a connected showcase can prefetch changed peers'
882
- static resources into the App's existing byte cache. This bounded, opportunistic
883
- work neither evaluates modules nor mounts hidden examples. Navigation remains
884
- independent of background preparation, and resource integrity checks still apply.
885
-
886
- A successful global revision does not require remounting an unchanged selected
887
- view. The App compares its static module/style/asset closure, retains DOM/form/
888
- scroll state when that closure matches, and reruns token/paint audits against the
889
- accepted manifest. Watched graphs refresh compatible framework boundaries when
890
- the selected closure changes; complete bundled graphs remount through the
891
- project's adapter. Native ESM resources still obey digest checks and the bounded
892
- revision lifecycle described above.
893
- The visible preview retains its framing while replacement resources load. Kind
894
- and subject framing change only after a successful mount; structural padding is
895
- resolved before paint, including delayed framework commits. Font readiness and
896
- the later audits do not temporarily restore specimen padding during reloads.
897
-
898
- Incremental compilation is separate from test selection. Preview refresh runs the
899
- adapter's validation callback. Draft acceptance executes the draft owners' own
900
- registered behavior checks when `acceptance.behavior` is enabled. `ads validate`
901
- selects affected behavior owners through registered input dependencies; a shared
902
- foundation change can select every owner. Configured project checks still run as
903
- authored; releases run the full test suite. ADS does not claim per-test-case
904
- selection or skip validation because a module transform was cached.
905
-
906
- Architecture inspection shares immutable ASTs/programs, native semantic queries
907
- and request-scoped facts. A new inspection still observes current source and
908
- configuration; successful reports are reused only for their exact input key.
909
- Source scans prepare generated-directory and source-root comparisons once per
910
- inventory. Every scan still discovers tests and hashes current input bytes.
911
-
912
- After source changes, validation and compilation must both succeed before a new
913
- graph becomes current. MCP announces build/resource updates.
914
- Build success records the project input digest captured before compilation;
915
- status reads independently verify that digest and the output bytes. Unchanged
916
- asset checks reuse bounded verification metadata keyed by the expected digest
917
- and file identity, size and nanosecond modification/change timestamps. Resource
918
- delivery still hashes the actual returned bytes. Guarded
919
- publication invalidates the compiler explicitly. Content reconciliation recovers
920
- missed atomic file replacements, so OS watch delivery cannot establish freshness.
921
- The built-in client uses `waitFor: compiled` for interactive selections, so it
922
- can browse compiled feedback or a retained verified graph while checks run.
923
- Default MCP preview calls, captures and verification still wait for verified
924
- output. Pending selections never report App readiness as verified. Discovery
925
- notifications are reconciled after validation through asynchronous discovery.
926
- The App retains or remounts its view
927
- according to its dependency closure. A quiet monochrome indicator in the
928
- showcase's upper-right header exposes compilation, checking, reload and fallback
929
- status through its accessible label, tooltip and details popover. Editing keeps
930
- the widget area interactive without overlays. Switching entries uses a temporary
931
- loading spinner until the selected App mounts; messages from an older selection
932
- cannot end that transition. External Apps hosts retain an in-App
933
- fallback. Invalid scenario metadata at startup and later source
934
- failures stay in the watcher's recoverable diagnostic path. Fixing source triggers validation again.
935
- If the compiler process exits, the next preview request starts one fresh child;
936
- MCP inspection remains available. Each child generation has its own status report,
937
- so independent MCP clients do not overwrite each other's build state.
938
- Standalone compilation writes `.ds/build-status.json`. Managed compilation uses
939
- `.ds/build-status-<session>.json`, selected through the internal
940
- `ADS_MCP_BUILD_STATUS` and `ADS_MCP_BUILD_SESSION` launch variables. Session identity
941
- separates revisions across restarts; source and artifact digests establish
942
- freshness independently of process state.
943
- Those source digests come from one content walk per read-only request: a tool
944
- call such as `ads_show_scenario` or `ads_status`, an accepted-project resource read
945
- (including the showcase's HTTP reads), one observation pass, or one preview wait.
946
- Discovery, the registry and build status within that request share it. While a
947
- request waits for a build, it walks again only after the compiler's status report
948
- changes. Discovery and capture fence long work with a fresh walk. Mutations, acceptance,
949
- validation, captures and draft resources keep their own fresh reads. Compiler
950
- children, timers and shared discovery tasks start outside any request's revision.
951
- Compilation remains necessary for TSX and Linaria;
952
- there is one preview pipeline with automatic updates.
953
-
954
- Scenario entries, adapters and fixtures are development source even when
955
- colocated with production components. Runtime imports and public-barrel exports
956
- cannot cross that boundary. Static checks require real public render references
957
- reachable from the scenario entry; browser tests still verify mounting, states,
958
- accessibility and visual parity.
959
-
960
- The working example and starter build one shared multi-entry graph on first
961
- preview demand or accepted-edit preparation, then reuse it across selections and
962
- unchanged restarts. The App loads the selected scenario's static dependency
963
- closure and may prefetch changed peers; dynamic imports remain lazy. Production
964
- bundles, workers and cancellation stay project-owned.
965
- The MCP server serves compiled bytes without evaluating project TSX. Compiler
966
- adapters normalize each entry to mount/unmount, retaining native React or Preact
967
- semantics; choosing a framework does not install one into the tooling host.
1204
+ through the workspace of the reviewed draft. ADS's managed compiler compiles
1205
+ them and its host serves them.
1206
+
1207
+ - Only a candidate without such a workspace gets a preview host of its own. Its
1208
+ compiler is parked after production publication, and the host keeps serving
1209
+ that immutable graph to registered browser verification.
1210
+ - In both cases the incremental graph is closed before production compilation
1211
+ starts.
1212
+ - Warming an already-current selection does not restart that compiler or wait
1213
+ for it.
1214
+ - Production reuse requires a successful production build of the exact inputs.
1215
+ A previously compiled development graph is not enough.
1216
+ - Project-owned additional commands run as configured. A standalone
1217
+ preview-build command belongs in the ordinary project build, not in
1218
+ `acceptance.scripts`.
1219
+
1220
+ Candidate inspection shares the project's native compiler through an isolated
1221
+ snapshot; no compiler starts per acceptance. The release of a candidate drops
1222
+ its adapters, resolvers and snapshot leases, and keeps live and sibling
1223
+ revisions valid.
1224
+
1225
+ #### The compiler process and its channel
1226
+
1227
+ If the compiler process exits, the next preview request starts one fresh child.
1228
+ MCP inspection stays available. Each child generation has its own status
1229
+ report, so independent MCP clients do not overwrite each other's build state.
1230
+
1231
+ Standalone compilation writes `.ds/build-status.json`. A compiler managed by
1232
+ MCP coordinates with its watcher over direct IPC
1233
+ (`src/mcp/compiler-channel.mts`):
1234
+
1235
+ - The channel is a private local socket: a Unix socket in a 0700 temporary
1236
+ directory, or a named pipe on Windows.
1237
+ - The socket is named with a per-launch token in the compiler's environment, so
1238
+ it works through any configured compiler command.
1239
+ - Requests and draft control go to the compiler. Build reports, full-build
1240
+ results and input digests come back, keyed by session and held in the MCP
1241
+ process.
1242
+ - The latest request and the draft list are replayed when a compiler connects
1243
+ or reconnects.
1244
+ - Nothing is exchanged through `.ds/` status files. Preview artifacts and
1245
+ resources keep their own transport.
1246
+
1247
+ Session identity separates revisions across restarts. Source and artifact
1248
+ digests establish freshness independently of process state.
1249
+
1250
+ **Build evidence.** Build success records the project input digest captured
1251
+ before compilation. Status reads verify that digest and the output bytes
1252
+ independently. Unchanged asset checks reuse bounded verification metadata,
1253
+ keyed by the expected digest and the file identity, size and nanosecond
1254
+ modification and change timestamps. Resource delivery still hashes the actual
1255
+ returned bytes.
1256
+
1257
+ #### Input sets
1258
+
1259
+ Two input sets decide freshness. Both hold only design-system inputs.
1260
+
1261
+ | Set | Used by | Contains |
1262
+ | --- | --- | --- |
1263
+ | Owned inputs | Source digests, compiled-preview cache keys; status, discovery and capture reads | `ds.config.json`, the design-system folder, and the package manifest and lockfile(s) |
1264
+ | Validation inputs (`validationInputFiles`) | Validation evidence and draft acceptance | The owned inputs, plus the TypeScript configuration chain, dependency-resolution configuration (`.npmrc`, `bunfig.toml`, `.yarnrc.yml`, patched dependencies, the installed-dependencies digest), the entry files of configured package scripts with their import closure, notices and `validation.inputs` |
1265
+
1266
+ The validation set is wider because validation and acceptance run the project's
1267
+ own scripts and copy what those scripts need into candidate workspaces. Draft
1268
+ preview workspaces are full copies of that set.
1269
+
1270
+ Neither set holds application source, public folders, the root `index.html` or
1271
+ tests outside `dsDir`. So an application, backend, native-toolchain or
1272
+ documentation edit never stales a validation, preview or acceptance revision.
1273
+ The emitted output folder is never an input.
1274
+
1275
+ Compiled-preview cache keys need no read of application source or
1276
+ `node_modules`. The preview compiler's own inputs are the TypeScript
1277
+ configuration chain and `bunfig.toml`.
1278
+
1279
+ **Widening and fences.**
1280
+
1281
+ - A change outside `dsDir` (configuration, manifest, lockfiles or tooling)
1282
+ widens changed-scope validation to everything.
1283
+ - Opaque commands declare additional files or directories through
1284
+ `validation.inputs`; these add to the mandatory scope.
1285
+ - During validation and acceptance, the source-change fence watches `dsDir`,
1286
+ `ds.config.json`, the manifest and lockfiles, and `validation.inputs`,
1287
+ alongside the captured configuration files.
1288
+ - Guarded edits also fence every patched file and both sides of a configuration
1289
+ change. Candidate commands cannot rewrite source while ADS checks it.
1290
+
1291
+ The [validation guide](../skills/ads-designer/references/validation.md) holds
1292
+ the operational details.
1293
+
1294
+ **The digest map.** The managed compiler is the one owner of the digest map of
1295
+ the owned inputs (`src/input-digests.mts`) and the only process that watches
1296
+ them.
1297
+
1298
+ - One full walk seeds the map.
1299
+ - File events on the owned folder, `ds.config.json` and the manifest and
1300
+ lockfiles name the files to read again. Equal size or modification time never
1301
+ counts as unchanged.
1302
+ - Additions, removals, renames, unnamed events, watcher errors and
1303
+ configuration changes force a full walk before the next answer. A periodic
1304
+ full walk (at most every 30 s) is the safety net.
1305
+ - The compiler sends each changed map to MCP, and marks the map pending the
1306
+ moment an event arrives.
1307
+
1308
+ Before a request answers from the map, MCP asks the compiler to flush: the
1309
+ compiler processes every file event already delivered, reads those files again
1310
+ and replies with its map. An edit made before a status read is therefore never
1311
+ reported as built. Without a reply within one second, the request walks the
1312
+ owned inputs.
1313
+
1314
+ MCP's status, discovery and capture reads use that map. Without a running
1315
+ managed compiler (CLI commands, a stopped or parked compiler) they walk the
1316
+ owned inputs.
1317
+
1318
+ **Draft workspaces.** Draft workspaces change only through MCP. The draft
1319
+ controller sends each written or removed file to the draft's hosted compiler
1320
+ instance over the same channel; neither the controller nor the draft instances
1321
+ watch files. Accepted-source changes reach open draft previews through the
1322
+ project map.
1323
+
1324
+ **One revision per request.** Within one read-only request (a tool call such as
1325
+ `ads_show_scenario`, an accepted-project resource read, an observation pass, a
1326
+ build-report change or a preview wait), every reader shares one revision. A
1327
+ wait reads it again only after the compiler's status report changes. Discovery
1328
+ and capture fence long work with a fresh walk. Compiler children, timers and
1329
+ shared discovery tasks start outside any request's revision.
1330
+
1331
+ #### Compilation is separate from test selection
1332
+
1333
+ A cached module never skips validation, and ADS does not claim per-test-case
1334
+ selection.
1335
+
1336
+ | Trigger | What runs |
1337
+ | --- | --- |
1338
+ | Preview refresh | The adapter's validation callback |
1339
+ | Draft acceptance | The draft owners' own registered behavior checks, when `acceptance.behavior` is enabled |
1340
+ | `ads validate` | The affected behavior owners, selected through registered input dependencies; a shared foundation change can select every owner |
1341
+
1342
+ Configured project checks run as authored. Releases run the full test suite.
1343
+
1344
+ Checks share immutable ASTs and programs, native semantic queries and
1345
+ request-scoped facts. A new check still observes current source and
1346
+ configuration. A successful report is reused only for its exact input key.
1347
+ Within a running process, an owner whose analysis inputs are unchanged keeps
1348
+ its analysis and emitted module
1349
+ ([caching](CACHING.md#owner-analysis-reuse)).
1350
+
1351
+ The analysis service bounds active project and revision state. It closes after
1352
+ idle time when no registered revision pins it. Direct library clients and
1353
+ syntax-only clients have their own short idle cleanup. A one-shot CLI command
1354
+ closes its clients when it has reported, so it exits without a wait for that
1355
+ idle period. When one scenario inspector closes, its requests are canceled and
1356
+ the shared compiler of other callers stays. Persisted registry metadata has
1357
+ separate content checks.
968
1358
 
969
1359
  ## On-demand visual evidence
970
1360
 
971
- The capture unit is a registered, independently mountable scenario or one of its
972
- project-declared `captureTargets`. Components, patterns, compositions and token
973
- previews use the same real isolated frame, fixtures and adapter as interactive review.
974
- Shared controllers/hooks need a visible demonstration. Capture introduces no
975
- tool-owned component templates, styling or fixture inference.
976
-
977
- ADS owns isolated preview hosting, App readiness and an owned Playwright process;
978
- the receiving project supplies Playwright and its installed browser. The capture
979
- host is the HTTP showcase with navigation hidden, giving the
980
- isolated preview the requested viewport. Project runtime, fonts and styles remain
981
- inside the App resource graph. The image excludes showcase chrome.
982
-
983
- Captures exist only when requested. `ads_capture` replaces current and removes any
984
- candidate for that scenario/target; with a draft and its exact revision it renders
985
- current and candidate under matching settings without changing live source.
986
- Acceptance and its dry run take no screenshots.
987
- A new scenario has no fabricated baseline. Final freshness/conflict checks precede
988
- image publication. Matching accepted source promotes candidate to current.
989
-
990
- There are at most two slots per target: current and candidate. Revisions/settings
991
- are metadata, not new resource identities. There is no previous slot, accumulating
992
- history or TTL. Stale source is identified explicitly; deleted targets are collected.
993
- PNG/pixel/store limits and explicit clearing bound generated storage. These images
994
- are visual evidence for one state, not passing behavioral guarantees.
995
-
996
- One MCP capture index and a PNG resource template expose stable image slots.
997
- Subscriptions receive resource updates when images change or disappear. The pair
998
- is published as one atomic generated record under `.ds/captures/` and stays outside
999
- source ownership and product bundles. Detailed usage lives in each portable skill's
1000
- [capture reference](../skills/ads-designer/references/captures.md).
1001
-
1002
- ## Brand assets and icons
1003
-
1004
- Brand artwork lives in `assets/brand/`: SVG masters, finished PNG/JPEG/WebP images and
1005
- delivered `.ico`/`.icns` files, each described with its use and license in the folder's
1006
- README. ADS generates the Brand view from those assets, including construction grids
1007
- and actual-size samples; projects do not author brand preview scenarios.
1008
-
1009
- `ads assets` makes three kinds of output. Web icons from `assets.iconSource` are rebuilt
1010
- into ignored `.ds/assets/` on every build, for the application's bundler. Committed targets
1011
- (`assets.targets`) are native and upload outputs that must exist without running ADS (a
1012
- Tauri bundle, a tray icon compiled into a binary, a file uploaded by hand): each copies or
1013
- renders one master to a project path, and the committed `assets/generated.json` records
1014
- its master hash, settings and output hash. A glyph set (`assets.glyphs`) turns a folder of
1015
- icon SVGs into one typed module. Freshness is checked by comparing recorded hashes, never by
1016
- rendering, so the result is the same on every machine; a finished image is never enlarged.
1017
- The starter's `Icon` and `IconButton` read that module: icons take `currentColor`, pair
1018
- their size with text, and an icon-only button always has a label. The showcase renders the
1019
- glyph set itself in its Icons tab, from the folder and the same default attributes the
1020
- module uses, so a set is reviewed without a project scenario. Other products' logos
1021
- live in `assets/logos/`, outside both the brand artwork and the glyph set: they keep their
1022
- owners' colors, render as images, and are never muted, tinted or recolored (a one-color mask
1023
- only where the owner's rules allow it, in the colors they name). ADS generates and checks
1024
- nothing there.
1025
-
1026
- ### Declared artwork/text lockups
1027
-
1028
- `@ads-lockup { artwork: .hook; text: .other-hook; size: --icon-sm; }` is an opt-in
1029
- construction on an owned row. It emits ordinary CSS for centered artwork, an intrinsic
1030
- aspect ratio, a baseline-aligned text group and font-metric trimming of the group's
1031
- native text runs. It does not impose a canvas shape, symmetric artwork, internal
1032
- padding or cap-height-sized logos. Older browsers without text trimming retain box
1033
- centering. The [branding guide](../skills/ads-designer/references/branding.md#aligning-artwork-with-text)
1034
- contains the complete authoring example and visual-review boundaries.
1035
-
1036
- The `lockup-construction` control is a blocking source check, shared by `ads check`,
1037
- validation and draft acceptance. It rejects malformed declarations, missing or
1038
- unresolved owned hooks, explicitly distorted inline SVGs and conflicting geometry,
1039
- alignment or text-trimming declarations across resolved class compositions. It
1040
- does not claim proof of painted-edge alignment or inspect opaque artwork internals.
1041
-
1042
- `src/construction-styles.cjs` runs the pure lockup and spatial transforms for both
1043
- checking and the public Linaria resolver, including preview compilation. The lockup
1044
- transform in `src/lockup-model.cjs` reads no files and needs no spatial model. Generated
1045
- declarations retain their rule identity for shared CSS override protection.
1046
- `src/lockup-composition.mjs` binds the declaration through the existing captured native
1047
- AST/class-composition analysis. It adds no compiler, source capture, disk reads or
1048
- persistent rule-local cache. Preview fingerprints include the transform modules;
1049
- changes cannot reuse previously compiled output. Optical review remains separate
1050
- from these source-only checks and benchmarks.
1051
-
1052
- ## Build checks keep the architecture in place
1053
-
1054
- The project build runs ADS checks before producing application or showcase
1055
- output. These checks enforce token use, source ownership, public imports,
1056
- showcase coverage, component state boundaries, and separation of runtime code from development
1057
- fixtures. Component-specific usage rules extend the shared checks when needed.
1058
-
1059
- Themes and brands are declared in `ds.config.json` and are only value sets: every theme and
1060
- brand shares the same token names. A theme sets the color mode and a brand sets identity
1061
- values (an accent ramp, a font), so a white-label product needs one brand per customer
1062
- rather than one theme per customer and mode. The declaration is the one list the showcase,
1063
- captures, preview host context, contrast review, render audit and token export read, so a
1064
- project can add a high-contrast theme or a brand without tool changes.
1065
-
1066
- A token that differs per theme is authored as one plain half per theme (`--x-light`,
1067
- `--x-dark`) on `:root`, and a brand re-sets its halves on `[data-brand]`. ADS generates
1068
- `themes.generated.css` from them: each `[data-theme]` sets inherited switch properties,
1069
- and each themed token resolves from its halves through those switches on every theme and
1070
- brand anchor. Custom properties inherit and resolve where they are declared, so every
1071
- element takes the halves of its nearest brand and the switch of its nearest theme, at any
1072
- nesting depth and in any order, with plain CSS variables. The same switches give display
1073
- switches (`--display-<theme>`, `--display-brand-<brand>`) for content that belongs to one
1074
- theme or brand. Theme and brand selectors are not used, in tokens or components, because
1075
- CSS resolves them by specificity and order, not by nearest ancestor.
1076
-
1077
- Because every themed value is a plain half, ADS also resolves every color token for every
1078
- theme and brand ahead of time into `themes.generated.ts`. Renderers that need colors as
1079
- values (Canvas, WebGL, SVG graphs) look them up there for the element's nearest context,
1080
- instead of asking the browser to normalize a color per drawn item.
1081
-
1082
- ADS findings are errors, review items or info items. An error is a rule ADS can decide: it
1083
- fails `ads check`, validation and acceptance, and no setting turns it off. Token, theme, brand,
1084
- glyph and accessibility rules read from tokens and source are errors: contrast between the
1085
- roles that meet on screen, declared component pairs and source-proven composed text/backdrop
1086
- pairs, in every theme and
1087
- brand, the 2 px spacing rhythm, fixed widths built from spacing tokens, theme and brand
1088
- coverage, brand artwork that is undescribed, unlicensed or unpreviewed, glyphs off the
1089
- shared viewBox or with fixed colors, controls padded off their size, target size, focus,
1090
- text resize, reduced motion, text spacing, image alternatives and icon-only controls. A
1091
- review item names something source analysis cannot settle (overlapping atomic declarations,
1092
- equal token values with possibly different roles, keyboard reach, unused artwork, color reads
1093
- in a render path); it is shown with guidance and never blocks. An info item notes an analysis
1094
- limit. Stale or hand-edited generated outputs are errors, since they ship.
1095
-
1096
- The [spatial check map](SPATIAL-CHECKS.md) records GC-01–GC-06 enforcement, supported
1097
- construction boundaries and focused evidence, including per-call container ancestry,
1098
- placement alternatives and protection of emitted geometry.
1099
-
1100
- Fixed minima use the spatial scale, mini/fine units, standard control/icon dimensions or
1101
- explicit `layout.widthTokens` roles; their resolved minimum must fit the spatial maximum.
1102
- Projects without a spatial definition may use their shared spacing primitives. The checker
1103
- follows private aliases and calculated expressions. Responsive, fractional and intrinsic
1104
- sizing remain supported; maximum sizes can cap otherwise fixed dimensions. Validated
1105
- `@ads-layout` fixed/hybrid tracks use their own local algebra. Declared fixed roles and
1106
- `layout.fixedWidthUnits` owners remain visible as review findings. The browser
1107
- audit adds what source cannot show: axe-core, non-text contrast of control borders and icons,
1108
- image shape and horizontal overflow at 390, 768 and 1280 px, by resizing each rendered scenario. It
1109
- also narrows components and patterns to a 240 px container: a set width above the browser review threshold of 96 px
1110
- that overflows it is a review item, since whether a part ever sits in a pane takes judgement.
1111
-
1112
- Audit previews retain the same subject framing and layout as showcase previews but disable
1113
- the decorative grey surround and clipped canvas layer before mounting. The preview root
1114
- therefore paints the project's theme/brand canvas directly, so axe and non-text contrast
1115
- resolve the real ancestor background. Authored surfaces remain intact. Image shape uses
1116
- untransformed CSS dimensions: explicit ratios respect `box-sizing`, while width/height
1117
- attribute ratios compare the content box, excluding border and padding.
1118
-
1119
- Each render waits, bounded, for its content to settle before anything is measured, and says so when it
1120
- did not. The audit also renders what a scenario shows only after someone acts on it. It opens what
1121
- `aria-haspopup` controls open, and hovers and focuses controls for contrast. Each worker lists what
1122
- every render could measure, then assigns targets in request order, so which render measures a shared
1123
- control does not depend on page speed. Its result states what it covered, and what it skipped is an
1124
- info item per reason. `mcp.auditPages` (1–16, default 4) sets how many pages render at once.
1125
-
1126
- The audit runs in both gates. Draft acceptance audits the draft owners' own UI
1127
- scenarios unless `acceptance.audit` is false. `ads validate` always audits every
1128
- scenario its change set reaches through imports: everything with scope `all`, and
1129
- with scope `changed` what changed since the last successful full run (all scenarios
1130
- after shared configuration, foundation or token changes). The cost of auditing what
1131
- a change reaches grows with how widely the owner is used, so it runs once for a
1132
- series of drafts, before a commit or release, rather than on every acceptance. A dry run's audit is remembered by candidate revision and selection,
1133
- so accepting that revision does not render again.
1134
-
1135
- Static errors split by what they stop. A preview session the audit starts renders despite policy
1136
- errors, records no pass, and reports them with the audit's findings; the audit still exits non-zero.
1137
- Only errors that stop rendering block it (source and CSS syntax, project structure, the styles entry,
1138
- scenario contracts). `ads check`, `ads compile`, validation and acceptance stop on every error.
1139
-
1140
- Fonts are read from `tokens/fonts.css` and `base.css`. `ads assets` generates a module naming the files
1141
- the first text uses, importing each plainly so that Vite, Bun and the preview compiler give the
1142
- stylesheet's URL. `ads check` holds declared faces against the weights CSS uses. ADS writes no HTML and
1143
- touches no hosting: the module's list, tags and header value are for the project to place.
1361
+ The capture unit is a registered, independently mountable scenario, or one of
1362
+ its project-declared `captureTargets`. Capture uses the same real isolated
1363
+ frame, fixtures and adapter as interactive review, for components, patterns
1364
+ and mocks. It introduces no tool-owned component templates, styling or
1365
+ fixture inference, so shared controllers and hooks need a visible
1366
+ demonstration. [MCP.md](MCP.md#screenshots-and-candidate-comparison) and each
1367
+ portable skill's
1368
+ [capture reference](../skills/ads-designer/references/captures.md) describe
1369
+ usage.
1370
+
1371
+ - **Hosting.** ADS owns the isolated preview hosting, App readiness and the
1372
+ Playwright process, with its own Playwright. The capture host is the HTTP
1373
+ showcase with navigation hidden, which gives the isolated preview the
1374
+ requested viewport. Project runtime, fonts and styles stay inside the App
1375
+ resource graph, and the image excludes showcase chrome.
1376
+ - **On request only.** Captures exist only when requested. Acceptance and its
1377
+ dry run take no screenshots. With no registered scenarios, `ads_capture`
1378
+ returns `ok: false` with `{ status: "not-available", reason: "no-scenarios",
1379
+ message }`.
1380
+ - **Two slots.** A target has at most two slots, current and candidate, with
1381
+ no previous slot, history or TTL. Revisions and settings are metadata, not
1382
+ new resource identities. A new scenario has no fabricated baseline. Stale
1383
+ source is identified explicitly, and deleted targets are collected. PNG,
1384
+ pixel and store limits and explicit clearing bound the generated storage.
1385
+ - **Publication.** Final freshness and conflict checks precede image
1386
+ publication. The pair is published as one atomic generated record under
1387
+ `.ds/captures/`, outside source ownership and product bundles.
1388
+ - **Resources.** One MCP capture index and a PNG resource template expose
1389
+ stable image slots. Subscriptions receive resource updates when images change
1390
+ or disappear.
1391
+
1392
+ These images are visual evidence for one state, not passing behavioral
1393
+ guarantees.
1394
+
1395
+ ## Checks keep the architecture in place
1396
+
1397
+ The project build runs `ads check` before it produces application output. One
1398
+ check of the captured revision covers:
1399
+
1400
+ - The structure of the design system: the barrel and `foundation.ads.ts`.
1401
+ - The design-system import closure.
1402
+ - Mock ownership.
1403
+ - Owner analysis of everything the barrel reaches.
1404
+ - The declared themes and brands.
1405
+ - The generated palette.
1406
+ - The integrity of the emitted output folder against its contract.
1407
+
1408
+ Every owner is analyzed, so one check reports each failing owner. An owner that
1409
+ depends on the grid rows of a failed owner is reported as blocked; it is not
1410
+ analyzed against unknown rows. Each owner-analysis failure carries a
1411
+ fine-grained code, its mistake group, a repair hint and the authored position.
1412
+ The repair plan orders the failures by group.
1413
+ [ADS.md](ADS.md#design-system-checks-and-emission) defines the contract.
1414
+
1415
+ ### Findings
1416
+
1417
+ ADS findings are errors, review items or info items
1418
+ ([finding kinds](ADS.md#finding-kinds)):
1419
+
1420
+ - An **error** is a rule ADS can decide. It fails `ads check`, validation and
1421
+ acceptance, and no setting turns it off.
1422
+ - A **review item** names something analysis cannot settle, such as a scroll
1423
+ container nothing focuses or truncated text without a `title`. It is shown
1424
+ with guidance and never blocks.
1425
+ - An **info item** notes an analysis limit or a blocked owner.
1426
+
1427
+ A stale `palette.generated.ts` and hand-edited emitted output are errors, since
1428
+ they ship. Output emitted from an earlier source revision is a
1429
+ `generated-stale` info item, since the next emit refreshes it.
1144
1430
 
1145
1431
  Static checks establish the policies and source formats they cover. Behavior
1146
1432
  tests and browser review verify the resulting accessibility, layout, themes,
1147
- states, and motion. Both forms of verification support agent-driven iteration.
1148
-
1149
- The CLI `ads validate` and MCP `ads_validate` share one audit engine, combining
1150
- architecture and test-boundary guards, configured project lint/check scripts
1151
- and behavior contracts. Full audits establish a content baseline. Changed audits
1152
- select affected behavior owners from that baseline; broad or unclassified changes
1153
- expand to full. Opaque project commands retain their declared scope.
1154
-
1155
- MCP executions share a process-wide exclusive lease spanning checks, guarded
1156
- mutations, child cleanup and durable result publication. Conflicting requests get
1157
- a structured `ADS_VALIDATION_LOCKED` response; Explorer and preview serving keep
1158
- their independent lane. Relevant source edits abort working-tree runs early,
1159
- recording changed paths and known/unknown attribution. Source-change interruption
1160
- cannot publish a successful baseline. A small run journal supports crash recovery;
1161
- immutable run results and exact-run investigations survive reconnects and subsequent
1162
- runs under bounded age/count/disk retention. Collection protects active work and
1163
- expires owned evidence with its result. See
1433
+ states and motion. Both support agent-driven iteration.
1434
+
1435
+ ### The browser render audit
1436
+
1437
+ The render audit adds what source cannot show. It also measures what the static
1438
+ composed check only reviews: unanalyzed wrappers, user-agent paint, opacity and
1439
+ scenario data. The [guide](GUIDE.md#checks-and-guards) lists each measurement
1440
+ and its exemptions.
1441
+
1442
+ - The audit page sets `__ADS_RENDER_AUDIT__` before the preview loads. The
1443
+ scenario page then mounts the specimens as the preview root's own content
1444
+ (`mountBare`, `showcase-client/scenario-page.mts`), with no showcase
1445
+ component around them; a lone subject fills the preview. Each named state is
1446
+ its own render: the audit page names the state before the preview loads
1447
+ (`__ADS_SCENARIO_STATE__`), and findings are built for each state's runs and
1448
+ merged (`findingsByState`, `src/render-audit.mts`).
1449
+ - It runs axe-core and measures non-text contrast of control borders and icons,
1450
+ image shape, layout shift and horizontal overflow at 390, 768 and 1280 px, by
1451
+ resizing each rendered scenario in every declared brand and theme.
1452
+ - Once per scenario it runs the [text passes](#text-passes).
1453
+ - It narrows components and patterns to a 240 px container. A set width above
1454
+ the browser review threshold of 96 px that overflows it is a review item.
1455
+ - Audit previews keep the subject framing and layout of showcase previews and
1456
+ disable the decorative surround, so axe and non-text contrast resolve the
1457
+ real ancestor background.
1458
+ - Image shape uses untransformed CSS dimensions: explicit ratios respect
1459
+ `box-sizing`, and width/height attribute ratios compare the content box.
1460
+ - Each render waits, bounded, for its content to settle, and the audit also
1461
+ renders interaction states (opened `aria-haspopup` overlays, hovered and
1462
+ focused controls).
1463
+ - Each worker lists what every render could measure, then assigns targets in
1464
+ request order, so which render measures a shared control does not depend on
1465
+ page speed.
1466
+ - The result states what was covered; what was skipped is an info item per
1467
+ reason.
1468
+ - `mcp.auditPages` (1–16, default 4) sets how many pages render at once.
1469
+
1470
+ **When it runs.** The audit runs in both gates
1471
+ ([stages](ADS.md#validation-and-acceptance-stages)): draft acceptance audits
1472
+ the draft owners' own UI scenarios, and `ads validate` audits every scenario
1473
+ its change set reaches through imports. With scope `changed` that is what
1474
+ changed since the last successful full run, and all scenarios after shared
1475
+ configuration, foundation or token changes. A dry run's audit is remembered by
1476
+ candidate revision and selection, so acceptance of that revision does not
1477
+ render again. An audit with nothing to render is not-available, never
1478
+ established.
1479
+
1480
+ Previews hold only a revision that passes `ads check`. So every static error
1481
+ stops the audit before it renders, as it stops `ads check`, `ads compile`,
1482
+ validation and acceptance. Review and info items never stop it: the audit
1483
+ renders and reports its own findings beside them.
1484
+
1485
+ #### Text passes
1486
+
1487
+ The text passes cover WCAG 2.2 1.4.4, 1.4.10 and 1.4.12. No static rule
1488
+ replaces them. 1.4.12 asks that content survives the reader's spacing
1489
+ overrides, not that tokens carry particular values, so there is no token-name
1490
+ rule for it. `a11y-text-resize` proves only that text sizes follow the root,
1491
+ not that the layout around them keeps up. The
1492
+ [guide](GUIDE.md#checks-and-guards) states the override values, the viewport
1493
+ sizes and what each finding kind means.
1494
+
1495
+ The passes extend the layout check the worker already runs:
1496
+ `src/render-audit/worker.mts` calls `layoutOverflow` from
1497
+ `src/render-audit/layout-overflow.page.mts` at each of `overflowWidths`. Their
1498
+ orchestration is `src/render-audit/text-scale.mts`; the overrides are in
1499
+ `src/render-audit/text-scale.page.mts`.
1500
+
1501
+ 1. One render per scenario runs them: the first theme and brand
1502
+ (`AuditApp.text`), since text does not follow colour. Its ordinary
1503
+ measurement at each width also measures block-axis fit
1504
+ (`layoutOverflow({ fit: true })`), the passes' baseline. Only its horizontal
1505
+ part is kept for `layout-overflow`.
1506
+ 2. At each width, before the next resize, the worker adds one override style
1507
+ (`font`, then `spacing`) as the document's last, `!important` standing in
1508
+ for the reader's stylesheet, measures, and removes it.
1509
+ 3. The viewport passes (`reflow`, then `zoom` to `textWidths.zoom`) resize the
1510
+ same page. Zoom scales px and rem alike, so layout there is the zoomed
1511
+ layout. The page returns to the widest width before the interaction states
1512
+ run.
1513
+ 4. `layoutOverflow`'s settling wait also follows heights under `fit`, which an
1514
+ override changes without changing a width. Fit adds the kinds
1515
+ `block-clipped`, `spilled`, `overlap` and `focus-clipped` over the same
1516
+ exemptions. Each counts past a tolerance of a quarter of the element's font
1517
+ size (at least 2 px), what a tight line height already lets a glyph out.
1518
+ For `focus-clipped`, only controls within 16 px of a clip edge are focused,
1519
+ at most twice the node limit, with focus restored.
1520
+ 5. `freshIssues` keeps only what rest does not show, by kind and selector. An
1521
+ override is compared against the same width. A viewport pass is compared
1522
+ against horizontal overflow at every width (already a `layout-overflow`
1523
+ finding) and fit at the widest width (the page before it was zoomed).
1524
+ 6. `AuditRun.textScale` carries `{ pass, width, issues, counts }`.
1525
+ `textScaleFindings` groups them per scenario, pass, kind and element set
1526
+ across widths, through the same grouping as `layoutOverflowFindings`.
1527
+
1528
+ `font` and `zoom` are `a11y-text-scale`, `spacing` is
1529
+ `a11y-text-spacing-override` and `reflow` is `a11y-reflow`: errors with the
1530
+ WCAG criterion, registered in `src/finding-rules.mts` and catalogued in
1531
+ `src/ads-errors.mts`.
1532
+
1533
+ ### Validation
1534
+
1535
+ The CLI `ads validate` and MCP `ads_validate` share one audit engine. It
1536
+ combines `ads check`, the configured project lint/check scripts, the registered
1537
+ behavior checks and the render audit.
1538
+
1539
+ - A stage with nothing to run is skipped with a not-available status and a
1540
+ reason code. It is never reported as passed.
1541
+ - A full audit establishes a content baseline. Only a successful full audit
1542
+ against unchanged source advances it.
1543
+ - A changed audit selects the affected behavior owners from that baseline.
1544
+ Broad or unclassified changes expand to full.
1545
+ - Opaque project commands keep their declared scope.
1546
+ - The baseline works without Git history and caches no individual test result.
1547
+
1548
+ Skills guide agents toward affected checks during editing, and toward full
1549
+ audits after ownership or runner migrations, before releases and for explicit
1550
+ complete validation.
1551
+
1552
+ **Freshness.** Freshness follows only the design-system project: the `dsDir`
1553
+ tree with its local import and asset dependencies and tests, and the
1554
+ configuration around it. [Input sets](#input-sets) defines the sets, their
1555
+ widening and their fences.
1556
+
1557
+ **Changed-scope selection.** Changed-scope validation follows shared source
1558
+ trees and native import resolution. Its successful full baseline also keeps
1559
+ plain dependency closures, so later selection includes consumers from both the
1560
+ previous and current revisions. Deleted inputs without previous evidence,
1561
+ unknown ownership, computed imports and shared configuration widen selection
1562
+ conservatively. Selection decides what to audit; it does not replace browser
1563
+ evidence or grant a passing result.
1564
+
1565
+ **Execution coordination.** MCP executions share a process-wide exclusive lease
1566
+ that spans checks, guarded mutations, child cleanup and durable result
1567
+ publication. A conflicting request gets a structured `ADS_VALIDATION_LOCKED`
1568
+ response, while Explorer and preview serving keep their independent lane. A
1569
+ relevant source edit aborts a working-tree run early, and such a run cannot
1570
+ publish a successful baseline. A small run journal supports crash recovery, and
1571
+ immutable run results and exact-run investigations survive reconnects and later
1572
+ runs under bounded retention. See
1164
1573
  [execution coordination](MCP.md#shared-process-execution-coordination).
1165
1574
 
1166
- Only a successful full audit against unchanged source advances the baseline.
1167
- This works without Git history and does not cache individual test results. Skills
1168
- guide agents toward affected checks during editing and full audits after ownership
1169
- or runner migrations, before releases and for explicit complete validation.
1170
-
1171
- Freshness follows the design system and consuming UI, their local import/asset
1172
- dependencies, registered build and guard configuration, and project test inputs.
1173
- Unrelated backend, native-toolchain and documentation edits do not invalidate an
1174
- ADS candidate. Opaque commands declare additional files or directories through
1175
- `validation.inputs`; these declarations add to the mandatory scope. Guarded edits
1176
- also fence every patched file and both sides of a configuration change. Candidate
1177
- commands still cannot rewrite source while checking it.
1178
-
1179
- Tests follow the same ownership boundaries as implementation: pure ADS tests stay
1180
- with their owners, marked behavior specs require registration, and private imports
1181
- cannot cross owners through helpers. Application integration tests stay with their
1182
- application subject. Static guards enforce these boundaries without claiming to
1183
- infer arbitrary assertion intent. Operational details live in the
1184
- [validation guide](../skills/ads-designer/references/validation.md).
1575
+ ### Semantic analysis
1185
1576
 
1186
- ## MCP makes the project ADS available to agents
1577
+ ADS semantic analysis uses its own pinned TypeScript 7.1 beta asynchronous
1578
+ native API from Bun. Analysis, orchestration and preview compilation all run on
1579
+ Bun. There is one compiler implementation.
1187
1580
 
1188
- The stdio server exposes the same token inspection and core architecture checks
1189
- as the CLI, alongside the project's public UI catalogue and source guides.
1190
- Bounded tools establish what exists; explicit resource reads provide detail.
1191
- Prompts and packaged skills explain how to reason through Data, UX and Skin and
1192
- how to inspect the real implementation before changing it.
1193
-
1194
- The MCP runtime owns its browser hosts and preview builder lifetime. Closing the
1195
- client connection releases them together; a separate ownership guard can stop
1196
- detached builders after abrupt owner death. A preview process must not outlive
1197
- its owner and continue publishing stale output.
1198
- HTTP request instances share a source observer instead of initializing another
1199
- source/build inspection for each resource read. Immutable resources retain byte
1200
- integrity checks; status, build and validation requests still establish freshness.
1201
- Build reports expose queued, validation, compilation and publication progress.
1202
- A timed-out preview request marks the builder stalled; the next explicit request
1203
- restarts it within the same MCP session. A running process alone is not freshness.
1204
-
1205
- Opt-in MCP editing makes validation part of the write operation. The agent edits a
1206
- draft of one or more owners (file contents or a Git unified diff) and accepts it. ADS
1207
- resolves file ownership, takes the draft's files as they are and validates a
1208
- temporary project copy with architecture checks and configured project
1209
- lint/validation scripts.
1210
- The temporary copy contains the relevant input graph and patched files, with room
1211
- for 100,000 files / 2 GiB. Unrelated native artifacts are not copied. Declared extra
1212
- inputs support project commands that read data outside the UI graph. When
1213
- `acceptance.behavior` is true (the default), the draft owners' own registered behavior
1214
- checks run in the isolated candidate project; the consumers of a changed shared
1215
- controller run in `ads validate`.
1216
- Architecture batch checks from the CLI and CI use the internal pinned Turbo runner
1217
- and its installed platform binary; no global Turbo or runtime dependency installer is
1218
- invoked. A task miss invokes the same asynchronous native analysis service.
1219
- The MCP server, its preview compiler and registered candidates use warm checks
1220
- (`check-service.mjs`) backed by that service. Native snapshots reuse unchanged
1221
- ASTs and query results; an exact input-key repeat can return a remembered passing
1222
- report. Local artifact
1223
- reuse is enabled by default and fenced by current input/tool/runtime/Git state;
1224
- gate results, browser evidence, locks and baselines are never task outputs.
1225
- Project scripts remain uncached without a known deterministic contract. The warm
1226
- Bun preview compiler retains its module cache; complete verified graph restoration
1227
- publishes fresh build-session evidence without semantic rediscovery. See
1228
- [cache controls and CI wiring](CACHING.md).
1229
-
1230
- `acceptance.scripts` and `validation.scripts` explicitly select project scripts; no
1231
- names are inferred, and `ads validate` runs both lists, so each script is listed
1232
- once. Direct edits invoke `ads validate --changed`; draft acceptance records no
1233
- baseline, so its owner-scoped evidence never satisfies a complete validation. The project owns its test code and runner policy;
1234
- ADS owns affected-check selection, candidate hosting, progress, evidence freshness
1235
- and process cleanup. One profile timeout bounds its entire runner process. Parallel
1236
- workers can share that candidate host with independent App state. Partial outcomes
1237
- remain diagnostic when execution is interrupted; they cannot approve a mutation.
1238
- Passing checks describe their registered assertions, not every natural-language claim.
1239
- Results distinguish architecture, project-build, transport, runner and assertion
1240
- boundaries with structured phase/code evidence; an unclassified test exception
1241
- does not become an assertion or a component defect. Acceptance explicitly lists
1242
- established and unverified scope. Verification retains one latest investigation
1243
- per registered check, including isolated candidates: exact input revision,
1244
- observed preview revision, failing step/source, observed startup viewport,
1245
- failed requests and available project-recorded artifacts. MCP exposes bounded
1246
- bundle/index resources and only registered, digest-checked artifact files.
1247
- Another run replaces that check's resource access; candidate evidence never
1248
- certifies live source. Detailed usage lives in the portable skill-local
1249
- [evidence guide](../skills/ads-designer/references/evidence.md).
1581
+ Registered application commands keep their explicit runtimes. Generated
1582
+ applications keep their own TypeScript dependency and their own `tsc`. ADS's
1583
+ compiler is a separate nested package when necessary.
1250
1584
 
1251
- MCP delivery is separate from validation: verification and mutation controllers
1252
- use complete results to decide acceptance. Their MCP replies contain counts,
1253
- bounded acceptance, at most three failure previews and a result ID in at most
1254
- 4 KiB of UTF-8 JSON. `ads_results` reads saved outcomes, diagnostics and other
1255
- sections without rerunning checks. Pages have at most 20 rows and 8 KiB of JSON;
1256
- truncated records support bounded text ranges. Discovery and investigation
1257
- sections use the same paging budget. Cursors bind the query and result/revision;
1258
- expired IDs fail explicitly instead of silently returning another run.
1259
- Immutable run snapshots persist under `.ds/tool-results/`, each at most 8 MiB,
1260
- with configurable age/count/disk retention and associated evidence collection. Oversized reports retain a summary with an
1261
- explicit unavailable-details warning. Storage/notification failure cannot change
1262
- an accepted edit's applied state. These are payload byte budgets, not tokenizer
1263
- estimates; MCP compatibility text may duplicate structured JSON on the wire.
1264
-
1265
- Edits stay focused without requiring entire file bodies in model context. Peer units and
1266
- unrelated owners remain outside the selected unit's edit boundary. Shared foundation,
1267
- branding and guides have their own units. Shared credits and text license notices
1268
- belong to the documentation unit, including conventional root notices and shared
1269
- `licenses/` collections. Colocated notices remain with their component or asset
1270
- owner. Documentation paths and UTF-8 validation do not grant code/configuration
1271
- ownership. Project configuration, registered guards
1272
- and compiler integration form an explicit configuration unit; their proposed
1273
- settings pass the same mandatory validation. Binary assets can travel as Git patch
1274
- artifacts without entering model context, and compiler configuration changes
1275
- replace the managed process while retaining the MCP connection. Normal build gates
1276
- remain in place for source changes made through other editors; preview review remains
1277
- necessary after either editing path.
1278
-
1279
- Genuinely coupled owners share one draft (up to 64 owners), validated as a single
1280
- complete candidate and published together. Token-sample reconciliation writes into
1281
- a draft, preserves project bindings and reports unresolved mappings; it never
1282
- changes live source or substitutes for rendered review and acceptance.
1283
-
1284
- No owner edits a shared entry. An owner's public names, its style permissions and its
1285
- token sheets are its own files; ADS regenerates the barrels and the styles entry in
1286
- the candidate, and deletes an empty `.gitkeep` itself when accepted source is added
1287
- beneath it. Coupled changes therefore need no companion edits or guard bypass.
1585
+ #### The analysis host
1586
+
1587
+ `src/analysis/service.mts` is the shared asynchronous entry point for
1588
+ acceptance, checks and emission, scenario discovery, behavior planning and
1589
+ audit selection.
1590
+
1591
+ - Each calling ADS process shares a Bun child host with plain-data IPC.
1592
+ - The host serializes analysis requests and owns bounded native project
1593
+ sessions.
1594
+ - One job is an inspection, check or selection request. A job can inspect many
1595
+ files.
1596
+ - Independent native queries inside a job can share pending promises and be
1597
+ batched.
1598
+ - Rendering and registered test commands execute outside this service.
1599
+
1600
+ Library inspection APIs are asynchronous and use the same native session
1601
+ implementation. Callers await `checkProject`, behavior inspection and import
1602
+ resolution. Direct library callers acquire a context through
1603
+ `analysis/standalone.mts`; they do not select a different engine. Syntax-only
1604
+ work uses the bounded source-file leases of the native API.
1605
+
1606
+ #### Snapshots, drafts and acceptance
1607
+
1608
+ Each project keeps an immutable live snapshot. Drafts branch from it with file
1609
+ deltas.
1610
+
1611
+ - Acceptance promotes the checked revision. Rejection releases it.
1612
+ - Sibling drafts cannot alter each other. A changed live generation prevents
1613
+ stale promotion.
1614
+ - Project input bytes are captured during the validation inventory read.
1615
+ - Imported dependencies, missing resolution targets, configuration and package
1616
+ changes invalidate the compiler state.
1617
+ - Content fences are required around operations that can overlap filesystem
1618
+ edits. Timestamps alone never establish freshness.
1619
+ - The beta compiler has an unsafe program-removal operation. ADS avoids it with
1620
+ bounded snapshot compaction within the same compiler process.
1621
+
1622
+ Relocated AST wrappers belong to a live project or to one draft, not to a
1623
+ global map of draft paths. Unchanged live trees keep their identity across
1624
+ revisions. The release of a draft releases its wrapper cache. Promotion creates
1625
+ live paths and does not mutate trees already returned to draft callers.
1626
+
1627
+ Production acceptance registers the file delta of the candidate against its
1628
+ live project before the check. The check, owner analysis and affected selection
1629
+ use that branch through the shared analysis service. Successful source
1630
+ publication promotes the checked snapshot. Rejected, abandoned and temporary
1631
+ branches are released. Configured scripts and browser evidence are separate
1632
+ acceptance stages with their own source-freshness requirements.
1633
+
1634
+ #### Captured inputs
1635
+
1636
+ Rules read the captured revision, never the live filesystem.
1637
+
1638
+ - Import resolution, with fixed compiler options, shares normalized specifiers
1639
+ by importing directory, including pending queries from sibling files. Its
1640
+ cache belongs to the current inventory or request. A new capture resolves
1641
+ against current package and configuration bytes and cannot inherit an earlier
1642
+ resolution by path alone.
1643
+ - Input capture shares compiler options and the import resolver with
1644
+ configuration discovery. `analysis/module-resolvers.mts` owns the native
1645
+ resolver leases for that capture, including pending queries. Cleanup drains
1646
+ them on success or failure. The syntax client stays alive until the capture
1647
+ releases its leases. No resolver that observes the live filesystem survives
1648
+ into the next capture.
1649
+ - Warm checks collect compiler source bytes while they compute the task input
1650
+ key, and pass them through `analyzeCaptured`. Registered draft branches stay
1651
+ authoritative. The independent post-check input capture still verifies
1652
+ freshness before the report is cached.
1653
+ - Draft preparation shares one inventory between inspection and workspace
1654
+ population, and keeps its targeted live conflict and path checks.
1655
+ - Optional inputs and immediate directory membership use `optionalSourceText`
1656
+ and `sourceDirectoryFiles`. Both observe the captured revision, including
1657
+ absence.
1658
+ - `sourceCss` shares read-only PostCSS trees across requests on the same
1659
+ captured revision. Transforms clone a tree before they modify it.
1660
+ - The pure grid model (`spatial-model.mts`, with `spatial-css.mts`) does no
1661
+ filesystem I/O. Owner analysis binds its facts through the captured native
1662
+ AST.
1663
+
1664
+ The spatial model borrows concepts from IBM Carbon's 2x Grid, and spacing
1665
+ borrows Adobe Spectrum's non-uniform scale. The
1666
+ [design references](DESIGN-REFERENCES.md) record what was adopted. Carbon's
1667
+ Sass and React grid packages are not dependencies.
1668
+
1669
+ #### Rules for rule code
1670
+
1671
+ [AGENTS.md](../AGENTS.md#extending-analysis-and-guards) states the rules for
1672
+ rule code and names the helpers: `analysis/helpers.mts` (`sourceAst`,
1673
+ `sourceText`, `symbolAt`, `valueSymbolAt`, `localValueDeclarations`, `walk`,
1674
+ `findNode`, `nodesOfKind`, `memoFact`, `memoProgram`), `cachedProgram`,
1675
+ `importResolver`, and `analysis/queries.mts` with `walkValuesAsync` and
1676
+ `walkAsync`. The reasons:
1677
+
1678
+ - A rule creates no compiler program, native client, path-keyed semantic cache
1679
+ or independent AST parser, so every rule reads the one captured revision. A
1680
+ boundary test prevents rule modules from constructing programs or importing
1681
+ native transports.
1682
+ - `memoFact` lives for one fenced request. `memoProgram` is only for facts
1683
+ determined by an immutable program/tree or captured revision, with weak
1684
+ ownership. A rule returns copies when it exposes cached mutable results.
1685
+ - `analysis/queries.mts` shares pending promises and batches independent
1686
+ symbol/type queries. Its ordered async helpers keep short-circuit checks and
1687
+ diagnostic order deterministic. Ordinary syntax predicates stay synchronous.
1688
+ - Named subjects resolve through `localValueDeclarations`, because enumerating
1689
+ all symbols in scope can load the compiler libraries and exhaust memory.
1690
+
1691
+ #### Verification and benchmarks
1692
+
1693
+ `bun run test:analysis` verifies native analysis, cache invalidation,
1694
+ production draft acceptance and compilation, without browser rendering or
1695
+ registered behavior execution. The
1696
+ [analysis benchmark](../scripts/benchmarks/analysis/README.md) measures the
1697
+ engine the same way: input capture, branching, checks and publication, without
1698
+ browser work. [AGENTS.md](../AGENTS.md#mandatory-analysis-benchmarks) states
1699
+ when it is required.
1700
+
1701
+ ## MCP makes the project ADS available to agents
1702
+
1703
+ The stdio server exposes the same checks as the CLI, alongside the project's
1704
+ public entry, units and source guides. Bounded tools establish what exists.
1705
+ Explicit resource reads provide detail. Prompts and packaged skills explain how
1706
+ to inspect the real implementation before a change.
1288
1707
 
1289
1708
  The architecture makes that inspection practical. A public export has an owning
1290
- source and addressable preview coverage. Token definitions expose its visual
1291
- vocabulary; local guides explain contracts when present. An agent can discover a
1292
- small set of relevant entities, read their source and mount a real scenario with
1293
- its fixture context. Humans can exercise the same entry in the showcase. This
1294
- keeps inspection connected to the implementation that will reach the application.
1709
+ source. Profiles and token sheets expose its visual vocabulary. Local guides
1710
+ explain contracts when present. An agent can discover a small set of relevant
1711
+ entities, read their source and mount a real scenario with its fixture context.
1712
+ Humans can exercise the same entry in the showcase. Inspection therefore stays
1713
+ connected to the implementation that reaches the application.
1295
1714
 
1296
1715
  MCP provides a progressive interface to those sources: structured listings,
1297
1716
  explicit detail reads, selectable workflows and rendered Apps where supported.
1298
1717
  Reported revisions and diagnostics make preview freshness inspectable after a
1299
1718
  change. Reading source, compiling it and interacting with it are separate forms
1300
- of evidence; source checks and metadata cannot establish visual or behavioral
1301
- correctness. Text/resource access and the normal showcase keep the workflow
1719
+ of evidence. Source checks and metadata cannot establish visual or behavioral
1720
+ correctness. Text and resource access and the normal showcase keep the workflow
1302
1721
  usable when a client lacks experimental presentation capabilities.
1303
1722
 
1304
- Experimental MCP Apps are another development review surface. Component, pattern and
1305
- composition views are project-built scenarios with the project's own extracted CSS and
1306
- public implementations; token and brand views are built by ADS from project definitions.
1307
- The server serves those artifacts; it does not interpret arbitrary component
1308
- code or introduce production UI dependencies. File-change notifications let
1309
- hosts refresh their views. ADS runs its Bun preview compiler itself, with no launch command.
1310
- Editing access is independent: direct editors can use MCP only for preview/checks,
1311
- while MCP-only editors use enabled mutation tools. Both use ADS's compiler. See the [editing workflows](../skills/ads-designer/references/workflows.md). Structured build reports distinguish running compilers
1312
- from successful, current previews; diagnostics remain readable even when a host
1313
- does not forward notifications. Older clients retain tools/resources/prompts;
1314
- native skill discovery and Apps presentation depend on the host's capabilities.
1315
- Concrete setup and compatibility evidence belong in the [MCP guide](MCP.md).
1316
-
1317
- For concrete instructions, use:
1318
-
1319
- - [ADS tooling contract](ADS.md) for naming, ownership rules, updates, and lint responsibilities.
1320
- - [Tool guide](GUIDE.md) for prerequisites, supported formats, configuration, and build wiring.
1321
- - [Starter/playground guide](../starters/README.md) for Linaria composition, extraction, and project commands.
1322
- - Component-local READMEs for APIs, lifecycle, tests, and provenance.
1323
-
1324
- Token preview completeness has two checks. Static guards validate the catalogue's explicit
1325
- bindings (`token`, CSS `property`, and project-selected `probe`; `foundation-catalog`). The
1326
- view then verifies rendered samples in the actual browser by probing those bindings and
1327
- restoring them. The tool supplies no token/property
1328
- classification or visual sample palette. A source build alone is not a rendered
1329
- verification, and the browser check does not judge design quality.
1330
-
1331
- The Data pillar has one shared design catalogue in the configured token foundation.
1332
- Components/patterns own mappings (`--ds-*`/`--ux-*`) and mechanics, not independent
1333
- value sheets or token namespaces. Private variables, fallbacks, themes and static
1334
- helper/import interpolation obey the same design-value source checks. Unknown
1335
- interpolation grants no permission. Intrinsic runtime geometry and typed instance
1336
- bindings keep their existing narrow contracts. Shared token previews consume the
1337
- same foundation through the project mount adapter.
1338
-
1339
- Shared tokens with identical normalized theme/condition definitions receive a
1340
- nonblocking `token-overlap-review` review item. Equal values do not establish equal
1341
- meaning; ownership/value-source violations remain errors. See the
1342
- [shared Data contract](ADS.md#shared-data-and-component-mappings).
1343
-
1344
- ## Static contracts and instance data
1345
-
1346
- Owner-local tooling declarations use optional `<Owner>.ads.contract.ts` modules.
1347
- ADS resolves their data and implementation symbols statically without executing
1348
- project imports. Behavior shares this contract with constrained paint
1349
- inputs, instance binding families and declarative parent/consumer relationships.
1350
- Declarative relationships form an acyclic graph: parts may have several parents
1351
- and contain nested parts, with every chain anchored at a rendering root. Exercise
1352
- metadata records reachable use; registered browser checks establish its effects.
1353
- Binding producers declare each direct/derived paint path explicitly. Private
1354
- visual implementation subjects are distinct from headless controller subjects.
1355
- Competing registrations fail. The
1356
- [contract reference](CONTRACTS.md) specifies the authoring and analysis limits.
1357
-
1358
- Any `.ads.` source is development-only. Runtime implementation/types/styles cannot
1359
- import it through aliases or barrels. Only the selected scenario/fixture/review
1360
- closure enters a preview; contracts and specs are not widget modules. Derived
1361
- App audit data adds no ADS dependency to production components. New starter
1362
- scenarios and fixtures use the marked names; existing IDs remain stable.
1363
-
1364
- Instance bindings are distinct from static tokens and arbitrary inline styles.
1365
- Source checks trace config origin, key validation, exact map construction and
1366
- attachment to an owner root. Shared token and private runtime-variable ownership and consumer permissions
1367
- remain enforced. Render audits inspect current scoped values, paint effects and
1368
- local SVG resources; registered checks must cover updates/removal, isolation and
1369
- relevant themes. Registration, source-demonstrated consumption and current browser
1370
- verification are separate evidence. Unknown paths establish no blanket permission.
1371
-
1372
- Declarative child APIs belong in `exercises`, while `covers` retains rendered UI.
1373
- Resolved child identity/prop consumption must reach the declared consumer through
1374
- a rendered parent. Metadata alone cannot turn a null-returning stub into verified
1375
- UI. Invalid scenario fields preserve independent valid coverage; unreadable
1376
- prerequisites report that coverage is not established.
1377
-
1378
- Shared token references remain visible across the project. Component state and
1379
- implementation variables retain their existing ownership boundaries. Project checks
1380
- may use `inspectTokenOrigins` to audit more specific shared alias relationships;
1381
- core Data/UX/Skin separation does not depend on opting into such a check. ADS does
1382
- not hardcode a spacing scale or palette.
1383
-
1384
- Preview scheduling prunes standard generated output trees before allocating OS
1385
- watches and computing source freshness. Explicit source roots retain priority;
1386
- custom outputs use `assets.generatedPaths`. Bundled binary assets are forwarded
1387
- as resources: the built-in Apps sandbox permits blob reads and WebAssembly
1388
- compilation without granting external network access, JavaScript eval or host
1389
- DOM access. External MCP hosts retain their own CSP policy.
1390
-
1391
- ### Pictogram ownership and evidence
1392
-
1393
- Pictograms are project-owned illustrative SVGs in `assets/pictograms/`, separate
1394
- from brand identity, glyphs and raster images. `catalog.ads.json` declares their
1395
- meaning, license, minimum drawn height and exact-theme/scheme/shared source
1396
- selection. See the [pictogram contract and examples](../skills/ads-designer/references/pictograms.md).
1397
-
1398
- `src/pictogram-model.mjs` is the pure catalogue/XML/geometry model;
1399
- `src/pictograms.mjs` is its captured-input adapter. Pictogram SVG text is retained during the
1400
- existing analysis input read; unrelated image assets are not added to the source tree. The adapter shares immutable results per request
1401
- and weakly per captured revision, including missing inputs; rules/discovery never
1402
- fall back to disk for a missing snapshot. No TypeScript program or parser is
1403
- created for asset metadata. The XML parser checks document structure without
1404
- executing SVG. Artwork is embedded as image data, never injected into gallery DOM.
1405
-
1406
- Discovery publishes tool-owned `pictograms/<id>` foundation views attached to the
1407
- `assets/pictograms` draft owner. CLI checks, MCP discovery, validation and acceptance
1408
- share the same diagnostics. The gallery resolves explicit theme variants, renders
1409
- clean/actual-size samples and a separate construction-grid card. Components keep
1410
- normal SVG imports and their own theme selection; no ADS runtime ships with them.
1411
-
1412
- The render audit receives the registry's checked digests and geometry, without
1413
- rereading sources. It identifies visible SVG images by digest, caches source
1414
- identities across viewport samples, and checks the active variant, accessibility
1415
- markup, drawn size and proportions. `data-ads-pictogram` disambiguates shared bytes
1416
- and detects wrong source substitutions. Inline SVG/CSS backgrounds, arbitrary
1417
- transformations, illustration meaning and optical quality remain outside this
1418
- image guard. Assets remain shared inputs for change selection, so their edits
1419
- widen verification to consuming UI. Browser measurements are not included in
1420
- analysis/acceptance performance benchmarks.
1421
-
1422
- ## HTTP showcase delivery
1423
-
1424
- The 0.4.5 local showcase uses HTTP for discovery, status, events, preview actions
1425
- and checked assets. Agents retain MCP against the same engine. See the
1426
- [scope, endpoint boundary and proof history](HTTP-SHOWCASE-POC.md). The persistent
1427
- preview iframe preserves isolation and viewport behavior.
1723
+ The [MCP guide](MCP.md) holds concrete setup and compatibility evidence.
1724
+
1725
+ ### Skills
1726
+
1727
+ Skills ship in the package and are served as an immutable snapshot, each file
1728
+ under `skill://ads/<name>/`, with each digest computed from the bytes served.
1729
+ ADS serves content; verification, approval and activation belong to the host.
1730
+ [MCP.md](MCP.md#skills) states what each protocol version gets.
1731
+
1732
+ ### Token inventory and public catalogue
1733
+
1734
+ The token inventory and the public catalogue have one implementation,
1735
+ `src/inventories.mts`, behind every surface: `ads tokens`, `ads_tokens`,
1736
+ `ads_catalog`, `ads://project/tokens`, `/tokens/dtcg` and `/catalog`, and the
1737
+ library's `inspectTokens`, `exportTokensDtcg` and `inspectCatalog`.
1738
+
1739
+ The analysis worker runs it as the `tokens`, `tokens-dtcg` and `catalog`
1740
+ operations on one captured revision. `token-summary` returns the token total
1741
+ and the groups the explorer's token category counts, from the design inputs
1742
+ alone. Nothing in them reads the disk.
1743
+
1744
+ **The catalogue** (`src/public-catalog.mts`) reads:
1745
+
1746
+ - The barrel's named exports through the scenario program (`publicApi` in
1747
+ `src/owner-scenarios.mts`), classified by the same API role that scenario
1748
+ `covers` and `exercises` use, with each export's signature printed by the
1749
+ checker (`src/api-signature.mts`).
1750
+ - The scenario registry and the public owners (`publicExports`).
1751
+ - The revision's owner analysis (`ownerRevision`, memoized on the revision and
1752
+ shared with `ads check`).
1753
+
1754
+ Each analyzed owner keeps its design (`src/owner-design.mts`): the profile
1755
+ selections its constructions' lowering read (`Lowered.profiles`, recorded by
1756
+ the profile access in `src/construction-output.mts`). So the catalogue reports
1757
+ what the owner renders, slot profiles included, not what its source mentions.
1758
+
1759
+ **The token inventory** (`src/token-inventory.mts`) reads the revision's
1760
+ foundation from the content-keyed design inputs:
1761
+
1762
+ - Values per context from `tokenDefinitionContexts`.
1763
+ - Declarations from the parsed sheets.
1764
+ - Profile bindings from the resolved profiles.
1765
+ - Value-shape status from the token checks, reused per foundation.
1766
+ - Owner reach from each analyzed owner's lowered constructions, followed
1767
+ through token references.
1768
+
1769
+ The DTCG export (`src/token-dtcg.mts`) is a pure, key-sorted function of the
1770
+ inventory. Paging and queries are shared (`src/inventory-query.mts`). The MCP
1771
+ view adds source and guide URIs, units and draft annotations. An empty
1772
+ inventory is `not-available`, never an empty match; design inputs that do not
1773
+ read are an error.
1774
+
1775
+ ### Runtime lifetime
1776
+
1777
+ The MCP runtime owns its browser hosts and the lifetime of its preview builder.
1778
+
1779
+ - When the client connection closes, they are released together. A separate
1780
+ ownership guard can stop detached builders after abrupt owner death. A
1781
+ preview process must not outlive its owner and continue to publish stale
1782
+ output.
1783
+ - HTTP request instances share a source observer. They do not initialize
1784
+ another source/build inspection for each resource read.
1785
+ - Immutable resources keep byte integrity checks. Status, build and validation
1786
+ requests still establish freshness.
1787
+ - Build reports expose queued, validation, compilation and publication
1788
+ progress.
1789
+ - A timed-out preview request marks the builder stalled. The next explicit
1790
+ request restarts it within the same MCP session. A running process alone is
1791
+ not freshness.
1792
+
1793
+ ### Guarded editing
1794
+
1795
+ Opt-in MCP editing makes validation part of the write operation
1796
+ ([MCP](MCP.md#guarded-editing)). The agent edits a draft of one or more owners
1797
+ (file contents or a Git unified diff) and accepts it. ADS resolves file
1798
+ ownership, takes the draft's files as they are, and validates a temporary
1799
+ project copy with `ads check` and the configured project lint/validation
1800
+ scripts.
1801
+
1802
+ - The copy contains the relevant input graph and the patched files, within
1803
+ bounds. Unrelated native artifacts are not copied. Declared extra inputs
1804
+ support project commands that read data outside the UI graph.
1805
+ - When `acceptance.behavior` is true (the default), the draft owners' own
1806
+ registered behavior checks run in the isolated candidate project. The
1807
+ consumers of a changed shared controller run in `ads validate`.
1808
+
1809
+ **Edit units.** Edits stay focused without entire file bodies in model context.
1810
+ Peer units and unrelated owners stay outside the selected unit's edit boundary.
1811
+
1812
+ - The foundation (the public barrel and `foundation.ads.ts`), the token sheets,
1813
+ asset groups, guides, documentation (shared credits and license notices) and
1814
+ configuration (project configuration, registered guards and compiler
1815
+ integration) have their own units ([units](MCP.md#guarded-editing)).
1816
+ - Colocated notices stay with their component or asset owner. Documentation
1817
+ paths and UTF-8 validation grant no code or configuration ownership.
1818
+ - Proposed configuration settings pass the same mandatory validation. A
1819
+ compiler configuration change replaces the managed process and keeps the MCP
1820
+ connection.
1821
+ - Binary assets can travel as Git patch artifacts without entering model
1822
+ context.
1823
+
1824
+ **Coupled owners.** Genuinely coupled owners share one draft, validated as a
1825
+ single complete candidate and published together. A new public owner is added
1826
+ to the barrel in the same draft as the foundation owner. ADS removes the
1827
+ design-system folders an accepted deletion leaves empty.
1828
+
1829
+ **Other editors.** Editing access is independent: a direct editor can use MCP
1830
+ only for preview and checks, and an MCP-only editor uses enabled mutation
1831
+ tools. Both use ADS's compiler
1832
+ ([editing workflows](../skills/ads-designer/references/workflows.md)). Normal
1833
+ build gates stay in place for source changes made through other editors, and
1834
+ preview review is necessary after either editing path.
1835
+
1836
+ ### Guarded deletion
1837
+
1838
+ Guarded deletion (`ads_delete`, `src/mcp/deletions.mts`) removes declared
1839
+ targets without a visible draft, through the same publication path as
1840
+ acceptance and not a second workflow ([MCP](MCP.md#guarded-deletion)).
1841
+
1842
+ 1. It checks the requested revision against `previewSourceRevision`, the
1843
+ accepted-source revision that drafts track.
1844
+ 2. It captures the project inputs once and runs the `deletion-plan` analysis
1845
+ operation (`src/deletion-plan.mts`) on exactly those bytes. Targets resolve
1846
+ against the revision's design inputs and unit inventory. Token removals edit
1847
+ a clone of the shared captured CSS tree. Profile and artwork removals cut
1848
+ statement ranges of the captured native AST, leaving neighbouring bytes
1849
+ untouched. The barrel drops the deleted owners' re-exports through the
1850
+ shared import resolver. Surviving references in the design inputs are
1851
+ listed.
1852
+ 3. Each planned file carries the digest it was derived from, and the mutation
1853
+ controller's candidate must hold exactly those bytes (`expectedDigest`).
1854
+ 4. A `beforeApply` fence requires the source revision to still be the requested
1855
+ one at publication.
1856
+
1857
+ Open drafts that hold a changed file or owner refuse the deletion.
1858
+ `MutationController.apply` checks and publishes the candidate. So the ordinary
1859
+ `ads check` over the candidate (every captured alternative) catches references
1860
+ the design-input scan does not see: recipes, bindings, imports and scenarios.
1861
+ Emission, cancellation, dry runs and rollback behave exactly as for acceptance.
1862
+ Protection covers the captured ADS graph only, never consumers outside it.
1863
+
1864
+ ### Checks, scripts and evidence
1865
+
1866
+ **Check execution.** Batch checks from the CLI and CI use the internal pinned
1867
+ Turbo runner. The MCP server, its preview compiler and registered candidates
1868
+ use warm checks (`check-service.mts`). Both use the same asynchronous native
1869
+ analysis service ([check paths](CACHING.md#check-paths)).
1870
+
1871
+ - Local artifact reuse is fenced by current input, tool, runtime and Git state.
1872
+ Gate results, browser evidence, locks and baselines are never task outputs.
1873
+ Project scripts stay uncached without a known deterministic contract.
1874
+ - The warm Bun preview compiler keeps its module cache. Complete verified graph
1875
+ restoration publishes fresh build-session evidence without semantic
1876
+ rediscovery.
1877
+
1878
+ **Scripts.** `acceptance.scripts` and `validation.scripts` explicitly select
1879
+ project scripts; no names are inferred. `ads validate` runs both lists, so each
1880
+ script is listed once. Direct edits invoke `ads validate --changed`. Draft
1881
+ acceptance records no baseline, so its owner-scoped evidence never satisfies a
1882
+ complete validation.
1883
+
1884
+ **Responsibilities.** The project owns its test code and runner policy. ADS
1885
+ owns affected-check selection, candidate hosting, progress, evidence freshness
1886
+ and process cleanup.
1887
+
1888
+ - One profile timeout bounds its entire runner process. Parallel workers can
1889
+ share the candidate host with independent App state.
1890
+ - Partial outcomes stay diagnostic when execution is interrupted; they cannot
1891
+ approve a mutation.
1892
+ - Passing checks describe their registered assertions, not every
1893
+ natural-language claim.
1894
+ - Results distinguish architecture, project-build, transport, runner and
1895
+ assertion boundaries with structured phase/code evidence. An unclassified
1896
+ test exception does not become an assertion or a component defect.
1897
+ - Acceptance explicitly lists established and unverified scope. A stage that
1898
+ ran nothing is listed as skipped with its not-available status, never as
1899
+ established, and does not block acceptance.
1900
+
1901
+ **Investigations.** Verification keeps one latest investigation per registered
1902
+ check, including isolated candidates
1903
+ ([contents](BEHAVIORS.md#investigate-a-failure)). MCP exposes bounded
1904
+ bundle/index resources and only registered, digest-checked artifact files.
1905
+ Another run replaces that check's resource access, and candidate evidence never
1906
+ certifies live source. See the
1907
+ [evidence guide](../skills/ads-designer/references/evidence.md).
1908
+
1909
+ ### Bounded results
1910
+
1911
+ MCP delivery is separate from validation: verification and mutation controllers
1912
+ use complete results to decide acceptance, and their replies are bounded
1913
+ summaries with a result ID. `ads_results` reads saved sections without
1914
+ rerunning checks. [BEHAVIORS.md](BEHAVIORS.md#read-results) states the reply,
1915
+ page and snapshot budgets.
1916
+
1917
+ - Cursors bind the query and the result/revision. An expired ID fails
1918
+ explicitly and never returns another run.
1919
+ - Run snapshots are immutable and persist under `.ds/tool-results/`. Evidence
1920
+ is collected with its result.
1921
+ - A storage or notification failure cannot change an accepted edit's applied
1922
+ state.
1923
+ - The budgets are payload bytes, not tokenizer estimates. MCP compatibility
1924
+ text can duplicate structured JSON on the wire.
1925
+
1926
+ ### Experimental MCP Apps
1927
+
1928
+ Experimental MCP Apps are another development review surface. Component,
1929
+ pattern and mock views are project scenarios, compiled with the
1930
+ project's emitted CSS and public implementations.
1931
+
1932
+ - The server serves those artifacts. It does not interpret arbitrary component
1933
+ code and introduces no production UI dependencies.
1934
+ - ADS runs its Bun preview compiler itself, with no launch command.
1935
+ - File-change notifications let hosts refresh their views. Structured build
1936
+ reports distinguish running compilers from successful, current previews, and
1937
+ diagnostics stay readable when a host does not forward notifications.
1938
+ - Older clients keep tools, resources and prompts. Native skill discovery and
1939
+ Apps presentation depend on the capabilities of the host.