ui-gateway 0.1.0 → 0.1.2

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 (362) hide show
  1. package/AGENTS.md +41 -6
  2. package/BENCHMARK.md +141 -0
  3. package/CHANGELOG.md +200 -2
  4. package/CONTRIBUTING.md +48 -6
  5. package/NON-GOALS.md +9 -6
  6. package/README.md +148 -38
  7. package/SECURITY.md +22 -1
  8. package/SKILL.md +71 -17
  9. package/action.yml +90 -0
  10. package/dist/evals/src/baseline.d.ts +4 -1
  11. package/dist/evals/src/baseline.d.ts.map +1 -1
  12. package/dist/evals/src/baseline.js +28 -6
  13. package/dist/evals/src/baseline.js.map +1 -1
  14. package/dist/evals/src/metrics.d.ts +35 -0
  15. package/dist/evals/src/metrics.d.ts.map +1 -1
  16. package/dist/evals/src/metrics.js +24 -0
  17. package/dist/evals/src/metrics.js.map +1 -1
  18. package/dist/packages/adapters/src/angular/index.js +2 -2
  19. package/dist/packages/adapters/src/angular/manifest.d.ts.map +1 -1
  20. package/dist/packages/adapters/src/angular/manifest.js +2 -8
  21. package/dist/packages/adapters/src/angular/manifest.js.map +1 -1
  22. package/dist/packages/adapters/src/antd/index.js +2 -2
  23. package/dist/packages/adapters/src/antd/manifest.d.ts.map +1 -1
  24. package/dist/packages/adapters/src/antd/manifest.js +2 -8
  25. package/dist/packages/adapters/src/antd/manifest.js.map +1 -1
  26. package/dist/packages/adapters/src/bootstrap/index.js +2 -2
  27. package/dist/packages/adapters/src/bootstrap/manifest.d.ts.map +1 -1
  28. package/dist/packages/adapters/src/bootstrap/manifest.js +2 -8
  29. package/dist/packages/adapters/src/bootstrap/manifest.js.map +1 -1
  30. package/dist/packages/adapters/src/chakra/index.d.ts.map +1 -1
  31. package/dist/packages/adapters/src/chakra/index.js +30 -5
  32. package/dist/packages/adapters/src/chakra/index.js.map +1 -1
  33. package/dist/packages/adapters/src/chakra/manifest.d.ts.map +1 -1
  34. package/dist/packages/adapters/src/chakra/manifest.js +309 -10
  35. package/dist/packages/adapters/src/chakra/manifest.js.map +1 -1
  36. package/dist/packages/adapters/src/index.d.ts +4 -0
  37. package/dist/packages/adapters/src/index.d.ts.map +1 -1
  38. package/dist/packages/adapters/src/index.js +18 -14
  39. package/dist/packages/adapters/src/index.js.map +1 -1
  40. package/dist/packages/adapters/src/local.d.ts.map +1 -1
  41. package/dist/packages/adapters/src/local.js +4 -2
  42. package/dist/packages/adapters/src/local.js.map +1 -1
  43. package/dist/packages/adapters/src/mantine/index.js +3 -3
  44. package/dist/packages/adapters/src/mantine/manifest.d.ts.map +1 -1
  45. package/dist/packages/adapters/src/mantine/manifest.js +8 -21
  46. package/dist/packages/adapters/src/mantine/manifest.js.map +1 -1
  47. package/dist/packages/adapters/src/mui/index.js +3 -3
  48. package/dist/packages/adapters/src/mui/manifest.d.ts.map +1 -1
  49. package/dist/packages/adapters/src/mui/manifest.js +2 -11
  50. package/dist/packages/adapters/src/mui/manifest.js.map +1 -1
  51. package/dist/packages/adapters/src/nuxt-ui/index.d.ts +5 -0
  52. package/dist/packages/adapters/src/nuxt-ui/index.d.ts.map +1 -0
  53. package/dist/packages/adapters/src/nuxt-ui/index.js +79 -0
  54. package/dist/packages/adapters/src/nuxt-ui/index.js.map +1 -0
  55. package/dist/packages/adapters/src/nuxt-ui/manifest.d.ts +3 -0
  56. package/dist/packages/adapters/src/nuxt-ui/manifest.d.ts.map +1 -0
  57. package/dist/packages/adapters/src/nuxt-ui/manifest.js +295 -0
  58. package/dist/packages/adapters/src/nuxt-ui/manifest.js.map +1 -0
  59. package/dist/packages/adapters/src/radix/index.d.ts +5 -0
  60. package/dist/packages/adapters/src/radix/index.d.ts.map +1 -0
  61. package/dist/packages/adapters/src/radix/index.js +71 -0
  62. package/dist/packages/adapters/src/radix/index.js.map +1 -0
  63. package/dist/packages/adapters/src/radix/manifest.d.ts +3 -0
  64. package/dist/packages/adapters/src/radix/manifest.d.ts.map +1 -0
  65. package/dist/packages/adapters/src/radix/manifest.js +331 -0
  66. package/dist/packages/adapters/src/radix/manifest.js.map +1 -0
  67. package/dist/packages/adapters/src/registry.d.ts +1 -1
  68. package/dist/packages/adapters/src/registry.d.ts.map +1 -1
  69. package/dist/packages/adapters/src/registry.js +16 -12
  70. package/dist/packages/adapters/src/registry.js.map +1 -1
  71. package/dist/packages/adapters/src/shadcn/index.js +3 -3
  72. package/dist/packages/adapters/src/shadcn/manifest.d.ts.map +1 -1
  73. package/dist/packages/adapters/src/shadcn/manifest.js +2 -11
  74. package/dist/packages/adapters/src/shadcn/manifest.js.map +1 -1
  75. package/dist/packages/adapters/src/solid/index.js +2 -2
  76. package/dist/packages/adapters/src/solid/manifest.d.ts.map +1 -1
  77. package/dist/packages/adapters/src/solid/manifest.js +2 -8
  78. package/dist/packages/adapters/src/solid/manifest.js.map +1 -1
  79. package/dist/packages/adapters/src/svelte/index.js +2 -2
  80. package/dist/packages/adapters/src/svelte/manifest.d.ts.map +1 -1
  81. package/dist/packages/adapters/src/svelte/manifest.js +2 -8
  82. package/dist/packages/adapters/src/svelte/manifest.js.map +1 -1
  83. package/dist/packages/adapters/src/vue/index.js +2 -2
  84. package/dist/packages/adapters/src/vue/manifest.d.ts.map +1 -1
  85. package/dist/packages/adapters/src/vue/manifest.js +2 -8
  86. package/dist/packages/adapters/src/vue/manifest.js.map +1 -1
  87. package/dist/packages/design-md/src/compile.js +2 -2
  88. package/dist/packages/design-md/src/derive.d.ts +41 -0
  89. package/dist/packages/design-md/src/derive.d.ts.map +1 -0
  90. package/dist/packages/design-md/src/derive.js +341 -0
  91. package/dist/packages/design-md/src/derive.js.map +1 -0
  92. package/dist/packages/design-md/src/index.d.ts +1 -0
  93. package/dist/packages/design-md/src/index.d.ts.map +1 -1
  94. package/dist/packages/design-md/src/index.js +6 -5
  95. package/dist/packages/design-md/src/index.js.map +1 -1
  96. package/dist/packages/gateway/src/confidence.d.ts +51 -1
  97. package/dist/packages/gateway/src/confidence.d.ts.map +1 -1
  98. package/dist/packages/gateway/src/confidence.js +198 -6
  99. package/dist/packages/gateway/src/confidence.js.map +1 -1
  100. package/dist/packages/gateway/src/gateway.d.ts +10 -2
  101. package/dist/packages/gateway/src/gateway.d.ts.map +1 -1
  102. package/dist/packages/gateway/src/gateway.js +190 -14
  103. package/dist/packages/gateway/src/gateway.js.map +1 -1
  104. package/dist/packages/gateway/src/index.d.ts +1 -0
  105. package/dist/packages/gateway/src/index.d.ts.map +1 -1
  106. package/dist/packages/gateway/src/index.js +7 -6
  107. package/dist/packages/gateway/src/index.js.map +1 -1
  108. package/dist/packages/gateway/src/preview.d.ts +12 -0
  109. package/dist/packages/gateway/src/preview.d.ts.map +1 -0
  110. package/dist/packages/gateway/src/preview.js +113 -0
  111. package/dist/packages/gateway/src/preview.js.map +1 -0
  112. package/dist/packages/gateway/src/validate.d.ts +5 -2
  113. package/dist/packages/gateway/src/validate.d.ts.map +1 -1
  114. package/dist/packages/gateway/src/validate.js +46 -18
  115. package/dist/packages/gateway/src/validate.js.map +1 -1
  116. package/dist/packages/kb/src/bundle-size.d.ts +8 -9
  117. package/dist/packages/kb/src/bundle-size.d.ts.map +1 -1
  118. package/dist/packages/kb/src/bundle-size.js +14 -12
  119. package/dist/packages/kb/src/bundle-size.js.map +1 -1
  120. package/dist/packages/kb/src/entry.d.ts +19 -1
  121. package/dist/packages/kb/src/entry.d.ts.map +1 -1
  122. package/dist/packages/kb/src/entry.js +13 -1
  123. package/dist/packages/kb/src/entry.js.map +1 -1
  124. package/dist/packages/kb/src/freshness.d.ts +76 -0
  125. package/dist/packages/kb/src/freshness.d.ts.map +1 -0
  126. package/dist/packages/kb/src/freshness.js +186 -0
  127. package/dist/packages/kb/src/freshness.js.map +1 -0
  128. package/dist/packages/kb/src/index.d.ts +2 -1
  129. package/dist/packages/kb/src/index.d.ts.map +1 -1
  130. package/dist/packages/kb/src/index.js +6 -5
  131. package/dist/packages/kb/src/index.js.map +1 -1
  132. package/dist/packages/kb/src/ingest.d.ts +3 -0
  133. package/dist/packages/kb/src/ingest.d.ts.map +1 -1
  134. package/dist/packages/kb/src/ingest.js +7 -1
  135. package/dist/packages/kb/src/ingest.js.map +1 -1
  136. package/dist/packages/kb/src/kb.d.ts +5 -0
  137. package/dist/packages/kb/src/kb.d.ts.map +1 -1
  138. package/dist/packages/kb/src/kb.js +5 -2
  139. package/dist/packages/kb/src/kb.js.map +1 -1
  140. package/dist/packages/matcher/src/anthropic.js +1 -1
  141. package/dist/packages/matcher/src/index.d.ts +8 -1
  142. package/dist/packages/matcher/src/index.d.ts.map +1 -1
  143. package/dist/packages/matcher/src/index.js +21 -11
  144. package/dist/packages/matcher/src/index.js.map +1 -1
  145. package/dist/packages/matcher/src/scaffold.d.ts.map +1 -1
  146. package/dist/packages/matcher/src/scaffold.js +62 -19
  147. package/dist/packages/matcher/src/scaffold.js.map +1 -1
  148. package/dist/packages/matcher/src/score.d.ts +8 -1
  149. package/dist/packages/matcher/src/score.d.ts.map +1 -1
  150. package/dist/packages/matcher/src/score.js +90 -25
  151. package/dist/packages/matcher/src/score.js.map +1 -1
  152. package/dist/packages/matcher/src/select.d.ts +15 -1
  153. package/dist/packages/matcher/src/select.d.ts.map +1 -1
  154. package/dist/packages/matcher/src/select.js +53 -3
  155. package/dist/packages/matcher/src/select.js.map +1 -1
  156. package/dist/packages/orchestrator/src/figma.d.ts +12 -0
  157. package/dist/packages/orchestrator/src/figma.d.ts.map +1 -0
  158. package/dist/packages/orchestrator/src/figma.js +102 -0
  159. package/dist/packages/orchestrator/src/figma.js.map +1 -0
  160. package/dist/packages/orchestrator/src/index.d.ts +1 -0
  161. package/dist/packages/orchestrator/src/index.d.ts.map +1 -1
  162. package/dist/packages/orchestrator/src/index.js +3 -2
  163. package/dist/packages/orchestrator/src/index.js.map +1 -1
  164. package/dist/packages/orchestrator/src/orchestrator.d.ts.map +1 -1
  165. package/dist/packages/orchestrator/src/orchestrator.js +14 -3
  166. package/dist/packages/orchestrator/src/orchestrator.js.map +1 -1
  167. package/dist/packages/profile/src/detect.d.ts +9 -0
  168. package/dist/packages/profile/src/detect.d.ts.map +1 -1
  169. package/dist/packages/profile/src/detect.js +52 -5
  170. package/dist/packages/profile/src/detect.js.map +1 -1
  171. package/dist/packages/profile/src/index.js +7 -7
  172. package/dist/packages/profile/src/local-components.d.ts.map +1 -1
  173. package/dist/packages/profile/src/local-components.js +70 -1
  174. package/dist/packages/profile/src/local-components.js.map +1 -1
  175. package/dist/packages/profile/src/registry.d.ts.map +1 -1
  176. package/dist/packages/profile/src/registry.js +3 -1
  177. package/dist/packages/profile/src/registry.js.map +1 -1
  178. package/dist/packages/profile/src/skills.js +1 -1
  179. package/dist/packages/protocol/src/errors.js +1 -1
  180. package/dist/packages/protocol/src/errors.js.map +1 -1
  181. package/dist/packages/protocol/src/event-log.d.ts.map +1 -1
  182. package/dist/packages/protocol/src/event-log.js +11 -5
  183. package/dist/packages/protocol/src/event-log.js.map +1 -1
  184. package/dist/packages/protocol/src/events.js +5 -5
  185. package/dist/packages/protocol/src/hashing.d.ts +6 -0
  186. package/dist/packages/protocol/src/hashing.d.ts.map +1 -1
  187. package/dist/packages/protocol/src/hashing.js +8 -2
  188. package/dist/packages/protocol/src/hashing.js.map +1 -1
  189. package/dist/packages/protocol/src/index.js +12 -12
  190. package/dist/packages/protocol/src/lease.js +2 -2
  191. package/dist/packages/protocol/src/schemas.d.ts +2803 -116
  192. package/dist/packages/protocol/src/schemas.d.ts.map +1 -1
  193. package/dist/packages/protocol/src/schemas.js +54 -4
  194. package/dist/packages/protocol/src/schemas.js.map +1 -1
  195. package/dist/packages/protocol/src/semantic.js +1 -1
  196. package/dist/packages/protocol/src/state-machine.js +1 -1
  197. package/dist/packages/transports/src/check.d.ts +30 -0
  198. package/dist/packages/transports/src/check.d.ts.map +1 -0
  199. package/dist/packages/transports/src/check.js +190 -0
  200. package/dist/packages/transports/src/check.js.map +1 -0
  201. package/dist/packages/transports/src/cli.d.ts +1 -1
  202. package/dist/packages/transports/src/cli.js +278 -25
  203. package/dist/packages/transports/src/cli.js.map +1 -1
  204. package/dist/packages/transports/src/exit-codes.d.ts +8 -0
  205. package/dist/packages/transports/src/exit-codes.d.ts.map +1 -0
  206. package/dist/packages/transports/src/exit-codes.js +19 -0
  207. package/dist/packages/transports/src/exit-codes.js.map +1 -0
  208. package/dist/packages/transports/src/http.js +2 -2
  209. package/dist/packages/transports/src/http.js.map +1 -1
  210. package/dist/packages/transports/src/index.d.ts +5 -0
  211. package/dist/packages/transports/src/index.d.ts.map +1 -1
  212. package/dist/packages/transports/src/index.js +11 -6
  213. package/dist/packages/transports/src/index.js.map +1 -1
  214. package/dist/packages/transports/src/init.d.ts +32 -0
  215. package/dist/packages/transports/src/init.d.ts.map +1 -0
  216. package/dist/packages/transports/src/init.js +110 -0
  217. package/dist/packages/transports/src/init.js.map +1 -0
  218. package/dist/packages/transports/src/mcp-config.d.ts +27 -0
  219. package/dist/packages/transports/src/mcp-config.d.ts.map +1 -0
  220. package/dist/packages/transports/src/mcp-config.js +99 -0
  221. package/dist/packages/transports/src/mcp-config.js.map +1 -0
  222. package/dist/packages/transports/src/mcp.js +3 -3
  223. package/dist/packages/transports/src/paths.d.ts +9 -0
  224. package/dist/packages/transports/src/paths.d.ts.map +1 -0
  225. package/dist/packages/transports/src/paths.js +32 -0
  226. package/dist/packages/transports/src/paths.js.map +1 -0
  227. package/dist/packages/transports/src/receipt.d.ts +8 -0
  228. package/dist/packages/transports/src/receipt.d.ts.map +1 -0
  229. package/dist/packages/transports/src/receipt.js +87 -0
  230. package/dist/packages/transports/src/receipt.js.map +1 -0
  231. package/dist/packages/transports/src/resources.js +3 -3
  232. package/dist/packages/transports/src/resources.js.map +1 -1
  233. package/dist/packages/transports/src/tools.d.ts.map +1 -1
  234. package/dist/packages/transports/src/tools.js +284 -10
  235. package/dist/packages/transports/src/tools.js.map +1 -1
  236. package/dist/packages/verifier/src/index.js +7 -7
  237. package/dist/packages/verifier/src/lint.js +1 -1
  238. package/dist/packages/verifier/src/page.js +2 -2
  239. package/dist/packages/verifier/src/render-axe.js +1 -1
  240. package/dist/packages/verifier/src/verify.js +4 -4
  241. package/dist/scripts/build-site.d.ts +2 -0
  242. package/dist/scripts/build-site.d.ts.map +1 -0
  243. package/dist/scripts/build-site.js +254 -0
  244. package/dist/scripts/build-site.js.map +1 -0
  245. package/dist/scripts/calibration.js +33 -2
  246. package/dist/scripts/calibration.js.map +1 -1
  247. package/dist/scripts/fix-imports.js +32 -2
  248. package/dist/scripts/fix-imports.js.map +1 -1
  249. package/dist/scripts/generate-kb.d.ts +3 -0
  250. package/dist/scripts/generate-kb.d.ts.map +1 -0
  251. package/dist/scripts/generate-kb.js +195 -0
  252. package/dist/scripts/generate-kb.js.map +1 -0
  253. package/dist/scripts/generate-refusal-catalog.d.ts +3 -0
  254. package/dist/scripts/generate-refusal-catalog.d.ts.map +1 -0
  255. package/dist/scripts/generate-refusal-catalog.js +50 -0
  256. package/dist/scripts/generate-refusal-catalog.js.map +1 -0
  257. package/dist/scripts/generate-tool-docs.d.ts +3 -0
  258. package/dist/scripts/generate-tool-docs.d.ts.map +1 -0
  259. package/dist/scripts/generate-tool-docs.js +24 -0
  260. package/dist/scripts/generate-tool-docs.js.map +1 -0
  261. package/dist/scripts/mcp-config.js +28 -60
  262. package/dist/scripts/mcp-config.js.map +1 -1
  263. package/docs/archive/UI Gateway Final Project Roadmap.md +285 -0
  264. package/docs/benchmarks/external-repos.json +26 -0
  265. package/docs/benchmarks/local-gemma3-1b-stride32.json +455 -0
  266. package/docs/calibration.svg +44 -0
  267. package/docs/design-import.md +19 -0
  268. package/docs/design-md.md +109 -0
  269. package/docs/distribution.md +41 -0
  270. package/docs/engineering-principles.md +152 -0
  271. package/docs/layers-plan.md +372 -0
  272. package/docs/metrics.md +153 -0
  273. package/docs/modes.md +22 -0
  274. package/docs/parking-lot.md +25 -0
  275. package/docs/quickstart.md +72 -0
  276. package/docs/refusal-catalog.md +32 -0
  277. package/docs/spike-source-discovery.md +36 -0
  278. package/docs/telemetry.md +26 -0
  279. package/evals/fixtures/external-repos.json +55 -0
  280. package/evals/fixtures/kb-generated/angular.json +72 -0
  281. package/evals/fixtures/kb-generated/antd.json +72 -0
  282. package/evals/fixtures/kb-generated/bootstrap.json +72 -0
  283. package/evals/fixtures/kb-generated/chakra.json +14939 -0
  284. package/evals/fixtures/kb-generated/mantine.json +192 -0
  285. package/evals/fixtures/kb-generated/mui.json +8997 -0
  286. package/evals/fixtures/kb-generated/shadcn.json +192 -0
  287. package/evals/fixtures/kb-generated/solid.json +72 -0
  288. package/evals/fixtures/kb-generated/svelte.json +72 -0
  289. package/evals/fixtures/kb-generated/vue.json +72 -0
  290. package/evals/fixtures/projects/existing-chakra-v3/package.json +10 -0
  291. package/evals/fixtures/projects/existing-nuxt-ui/package.json +9 -0
  292. package/evals/fixtures/projects/existing-radix/package.json +9 -0
  293. package/evals/out/agent-report.json +190 -11
  294. package/evals/out/baseline-report.json +1441 -387
  295. package/evals/out/calibration.json +387 -42
  296. package/evals/out/external-repos-report.json +112 -0
  297. package/evals/out/local-benchmark-report.json +455 -0
  298. package/evals/src/agent-eval.test.ts +3 -0
  299. package/evals/src/agent-eval.ts +26 -4
  300. package/evals/src/baseline.ts +48 -7
  301. package/evals/src/blind-labeling-cli.ts +5 -0
  302. package/evals/src/blind-labeling.ts +46 -0
  303. package/evals/src/external-repos.ts +179 -0
  304. package/evals/src/metrics.ts +70 -0
  305. package/evals/src/mutations.ts +6 -6
  306. package/evals/src/page-a11y-eval.ts +37 -36
  307. package/evals/src/page-real-eval.ts +8 -7
  308. package/evals/src/plain-agent.test.ts +14 -0
  309. package/evals/src/plain-agent.ts +240 -0
  310. package/evals/src/run-agent-evals.ts +3 -0
  311. package/evals/src/run-external-repos.ts +43 -0
  312. package/evals/src/run-local-benchmark.ts +105 -0
  313. package/evals/src/run-plain-agent.ts +81 -0
  314. package/examples/README.md +32 -0
  315. package/examples/build-handoff.ts +106 -0
  316. package/examples/design-md.md +24 -0
  317. package/examples/handoff-input.json +59 -0
  318. package/examples/handoff.json +216 -0
  319. package/examples/layer-operations.json +18 -0
  320. package/examples/website-demo-handoff.json +580 -0
  321. package/package.json +30 -7
  322. package/references/design-md.md +3 -1
  323. package/references/errors.md +1 -1
  324. package/references/handoff.md +16 -1
  325. package/references/outcomes.md +60 -11
  326. package/references/patterns.md +3 -3
  327. package/references/tools.md +86 -27
  328. package/scripts/action-review.mjs +59 -0
  329. package/scripts/bench-latency.ts +90 -0
  330. package/scripts/build-site.ts +324 -0
  331. package/scripts/calibration.ts +50 -14
  332. package/scripts/fix-imports.ts +31 -2
  333. package/scripts/generate-kb.ts +214 -0
  334. package/scripts/generate-refusal-catalog.ts +58 -0
  335. package/scripts/generate-tool-docs.ts +31 -0
  336. package/scripts/mcp-config.ts +26 -83
  337. package/scripts/package-plugin.mjs +50 -0
  338. package/scripts/sbom.mjs +46 -0
  339. package/scripts/visual-diff.mjs +52 -0
  340. package/site/data.json +187 -0
  341. package/site/index.html +151 -0
  342. package/skills/ui-gateway-cli/SKILL.md +41 -0
  343. package/templates/next-shadcn/.github/workflows/ui-check.yml +14 -0
  344. package/templates/next-shadcn/.mcp.json +8 -0
  345. package/templates/next-shadcn/DESIGN.md +35 -0
  346. package/templates/next-shadcn/README.md +14 -0
  347. package/templates/next-shadcn/app/page.tsx +8 -0
  348. package/templates/next-shadcn/package.json +19 -0
  349. package/templates/vite-mantine/.github/workflows/ui-check.yml +14 -0
  350. package/templates/vite-mantine/.mcp.json +8 -0
  351. package/templates/vite-mantine/DESIGN.md +30 -0
  352. package/templates/vite-mantine/README.md +7 -0
  353. package/templates/vite-mantine/package.json +21 -0
  354. package/templates/vite-mantine/src/App.tsx +10 -0
  355. package/templates/vite-mui/.github/workflows/ui-check.yml +14 -0
  356. package/templates/vite-mui/.mcp.json +8 -0
  357. package/templates/vite-mui/DESIGN.md +30 -0
  358. package/templates/vite-mui/README.md +8 -0
  359. package/templates/vite-mui/package.json +22 -0
  360. package/templates/vite-mui/src/App.tsx +12 -0
  361. package/scripts/fetch-bundle-sizes.ts +0 -106
  362. package/scripts/test-bundlephobia.ts +0 -11
@@ -0,0 +1,455 @@
1
+ {
2
+ "generated_at": "2026-11-28T17:43:15.612Z",
3
+ "model_info": {
4
+ "provider": "ollama",
5
+ "id": "gemma3:1b",
6
+ "base_url": "http://localhost:11434"
7
+ },
8
+ "sample": {
9
+ "stride": 32,
10
+ "gateway_items": 6,
11
+ "plain_agent_items": 6,
12
+ "note": "Stratified subset, not the full 172-item set. These are local Ollama numbers; they are not DeepSeek or Claude numbers."
13
+ },
14
+ "gateway": {
15
+ "thresholds_passed": false,
16
+ "arms": [
17
+ {
18
+ "name": "full_skill",
19
+ "metrics": {
20
+ "n": 6,
21
+ "schema_validity": 1,
22
+ "hallucination_rate": 0,
23
+ "constraint_violation_rate": 0,
24
+ "acceptable_set_hit_rate": 0.667,
25
+ "acceptable_set_hit_interval": {
26
+ "low": 0.3,
27
+ "high": 0.903,
28
+ "center": 0.602
29
+ },
30
+ "silent_wrong_rate": 0,
31
+ "abstention_rate": 0.333,
32
+ "invalid_import_rate": 0,
33
+ "invalid_prop_rate": 0,
34
+ "turns_to_green": 0,
35
+ "refusal_precision": 1,
36
+ "unsafe_accept_rate": 0,
37
+ "counts": {
38
+ "hits": 4,
39
+ "hallucinations": 0,
40
+ "predicted": 4,
41
+ "silent_wrong": 0,
42
+ "abstained": 2,
43
+ "invalid_imports": 0,
44
+ "invalid_props": 0,
45
+ "refusals": 0,
46
+ "correct_refusals": 0,
47
+ "unsafe_accepts": 0
48
+ }
49
+ }
50
+ },
51
+ {
52
+ "name": "no_retrieval",
53
+ "metrics": {
54
+ "n": 6,
55
+ "schema_validity": 1,
56
+ "hallucination_rate": 0,
57
+ "constraint_violation_rate": 0,
58
+ "acceptable_set_hit_rate": 0,
59
+ "acceptable_set_hit_interval": {
60
+ "low": 0,
61
+ "high": 0.39,
62
+ "center": 0.195
63
+ },
64
+ "silent_wrong_rate": 0,
65
+ "abstention_rate": 1,
66
+ "invalid_import_rate": 0,
67
+ "invalid_prop_rate": 0,
68
+ "turns_to_green": 0,
69
+ "refusal_precision": 0,
70
+ "unsafe_accept_rate": 0,
71
+ "counts": {
72
+ "hits": 0,
73
+ "hallucinations": 0,
74
+ "predicted": 0,
75
+ "silent_wrong": 0,
76
+ "abstained": 6,
77
+ "invalid_imports": 0,
78
+ "invalid_props": 0,
79
+ "refusals": 6,
80
+ "correct_refusals": 0,
81
+ "unsafe_accepts": 0
82
+ }
83
+ }
84
+ },
85
+ {
86
+ "name": "plain_generation",
87
+ "metrics": {
88
+ "n": 6,
89
+ "schema_validity": 1,
90
+ "hallucination_rate": 1,
91
+ "constraint_violation_rate": 0,
92
+ "acceptable_set_hit_rate": 0,
93
+ "acceptable_set_hit_interval": {
94
+ "low": 0,
95
+ "high": 0.39,
96
+ "center": 0.195
97
+ },
98
+ "silent_wrong_rate": 1,
99
+ "abstention_rate": 0,
100
+ "invalid_import_rate": 0,
101
+ "invalid_prop_rate": 0,
102
+ "turns_to_green": 0,
103
+ "refusal_precision": 1,
104
+ "unsafe_accept_rate": 1,
105
+ "counts": {
106
+ "hits": 0,
107
+ "hallucinations": 6,
108
+ "predicted": 6,
109
+ "silent_wrong": 6,
110
+ "abstained": 0,
111
+ "invalid_imports": 0,
112
+ "invalid_props": 0,
113
+ "refusals": 0,
114
+ "correct_refusals": 0,
115
+ "unsafe_accepts": 6
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "name": "vendor_mcp_tsc",
121
+ "metrics": {
122
+ "n": 6,
123
+ "schema_validity": 1,
124
+ "hallucination_rate": 0,
125
+ "constraint_violation_rate": 0,
126
+ "acceptable_set_hit_rate": 0,
127
+ "acceptable_set_hit_interval": {
128
+ "low": 0,
129
+ "high": 0.39,
130
+ "center": 0.195
131
+ },
132
+ "silent_wrong_rate": 1,
133
+ "abstention_rate": 0,
134
+ "invalid_import_rate": 0,
135
+ "invalid_prop_rate": 0,
136
+ "turns_to_green": 1,
137
+ "refusal_precision": 1,
138
+ "unsafe_accept_rate": 1,
139
+ "counts": {
140
+ "hits": 0,
141
+ "hallucinations": 0,
142
+ "predicted": 6,
143
+ "silent_wrong": 6,
144
+ "abstained": 0,
145
+ "invalid_imports": 0,
146
+ "invalid_props": 0,
147
+ "refusals": 0,
148
+ "correct_refusals": 0,
149
+ "unsafe_accepts": 6
150
+ }
151
+ }
152
+ }
153
+ ],
154
+ "task_outcomes": {
155
+ "n": 6,
156
+ "compile_rate": 1,
157
+ "compile_interval": {
158
+ "low": 0.51,
159
+ "high": 1,
160
+ "center": 0.755
161
+ },
162
+ "lint_clean_rate": 1,
163
+ "a11y_clean_rate": 1,
164
+ "constraint_free_rate": 1,
165
+ "library_compliance_rate": 1,
166
+ "token_match_rate": null,
167
+ "acceptable_set_hit_rate": 0.667,
168
+ "mean_tool_calls": 1,
169
+ "mean_tokens": null,
170
+ "mean_wall_ms": 5629.167
171
+ },
172
+ "calibration": {
173
+ "total": 6,
174
+ "answered": 4,
175
+ "abstained": 2,
176
+ "coverage": 0.667,
177
+ "bins": [
178
+ {
179
+ "lower": 0,
180
+ "upper": 0.1,
181
+ "count": 0,
182
+ "count_correct": 0,
183
+ "count_incorrect": 0,
184
+ "mean_confidence": null,
185
+ "accuracy": null,
186
+ "gap": null
187
+ },
188
+ {
189
+ "lower": 0.1,
190
+ "upper": 0.2,
191
+ "count": 0,
192
+ "count_correct": 0,
193
+ "count_incorrect": 0,
194
+ "mean_confidence": null,
195
+ "accuracy": null,
196
+ "gap": null
197
+ },
198
+ {
199
+ "lower": 0.2,
200
+ "upper": 0.3,
201
+ "count": 0,
202
+ "count_correct": 0,
203
+ "count_incorrect": 0,
204
+ "mean_confidence": null,
205
+ "accuracy": null,
206
+ "gap": null
207
+ },
208
+ {
209
+ "lower": 0.3,
210
+ "upper": 0.4,
211
+ "count": 0,
212
+ "count_correct": 0,
213
+ "count_incorrect": 0,
214
+ "mean_confidence": null,
215
+ "accuracy": null,
216
+ "gap": null
217
+ },
218
+ {
219
+ "lower": 0.4,
220
+ "upper": 0.5,
221
+ "count": 0,
222
+ "count_correct": 0,
223
+ "count_incorrect": 0,
224
+ "mean_confidence": null,
225
+ "accuracy": null,
226
+ "gap": null
227
+ },
228
+ {
229
+ "lower": 0.5,
230
+ "upper": 0.6,
231
+ "count": 0,
232
+ "count_correct": 0,
233
+ "count_incorrect": 0,
234
+ "mean_confidence": null,
235
+ "accuracy": null,
236
+ "gap": null
237
+ },
238
+ {
239
+ "lower": 0.6,
240
+ "upper": 0.7,
241
+ "count": 0,
242
+ "count_correct": 0,
243
+ "count_incorrect": 0,
244
+ "mean_confidence": null,
245
+ "accuracy": null,
246
+ "gap": null
247
+ },
248
+ {
249
+ "lower": 0.7,
250
+ "upper": 0.8,
251
+ "count": 0,
252
+ "count_correct": 0,
253
+ "count_incorrect": 0,
254
+ "mean_confidence": null,
255
+ "accuracy": null,
256
+ "gap": null
257
+ },
258
+ {
259
+ "lower": 0.8,
260
+ "upper": 0.9,
261
+ "count": 0,
262
+ "count_correct": 0,
263
+ "count_incorrect": 0,
264
+ "mean_confidence": null,
265
+ "accuracy": null,
266
+ "gap": null
267
+ },
268
+ {
269
+ "lower": 0.9,
270
+ "upper": 1,
271
+ "count": 4,
272
+ "count_correct": 4,
273
+ "count_incorrect": 0,
274
+ "mean_confidence": 0.948,
275
+ "accuracy": 1,
276
+ "gap": 0.052
277
+ }
278
+ ],
279
+ "ece": 0.052,
280
+ "brier": 0.003,
281
+ "mean_confidence": 0.948,
282
+ "accuracy": 1
283
+ },
284
+ "n_sample_agreement": {
285
+ "total_blind_items": 0,
286
+ "samples_per_item": 1,
287
+ "agreements": [],
288
+ "overall_agreement_rate": 1,
289
+ "notes": [
290
+ "No blind items found in golden set; self-agreement not measured."
291
+ ]
292
+ }
293
+ },
294
+ "plain_agent": {
295
+ "arm": "plain_agent_no_gateway",
296
+ "description": "Same model, same project and normal read/write/tsc toolset, no gateway; outcome measured by the project verifier",
297
+ "generated_at": "2026-11-28T17:43:15.611Z",
298
+ "n": 6,
299
+ "outcomes": {
300
+ "n": 6,
301
+ "compile_rate": 0.167,
302
+ "compile_interval": {
303
+ "low": 0.03,
304
+ "high": 0.564,
305
+ "center": 0.297
306
+ },
307
+ "lint_clean_rate": 0.167,
308
+ "a11y_clean_rate": 0.5,
309
+ "constraint_free_rate": 0.833,
310
+ "library_compliance_rate": 1,
311
+ "token_match_rate": 0.167,
312
+ "acceptable_set_hit_rate": 0,
313
+ "mean_tool_calls": 1,
314
+ "mean_tokens": null,
315
+ "mean_wall_ms": 24268.167
316
+ },
317
+ "records": [
318
+ {
319
+ "item_id": "dev-01",
320
+ "compiles": false,
321
+ "lint_clean": false,
322
+ "a11y_clean": false,
323
+ "constraints_ok": true,
324
+ "libraries_allowed": true,
325
+ "tokens_matched": false,
326
+ "tool_calls": 1,
327
+ "tokens": null,
328
+ "wall_ms": 11956,
329
+ "predicted": [],
330
+ "acceptable": [
331
+ "shadcn/button"
332
+ ],
333
+ "code": "import React from 'react';\nimport { Button } from '@/components/ui';\n\nfunction SubmitButton({ title, onClick, children }) {\n return (\n <Button onClick={onClick}>\n {children}\n </Button>\n );\n}\n\nexport default SubmitButton;",
334
+ "issues": [
335
+ "UNUSED_IMPORT: \"React\" is imported from \"react\" but never used",
336
+ "UNLABELED_CONTROL: <Button> has no accessible name (add text, aria-label or aria-labelledby)",
337
+ "COMPILE_ERROR: tsc reported errors in generated scaffolds; first diagnostic: Component.tsx(4,25): error TS7031: Binding element 'title' implicitly has an 'any' type."
338
+ ]
339
+ },
340
+ {
341
+ "item_id": "dev-28",
342
+ "compiles": false,
343
+ "lint_clean": false,
344
+ "a11y_clean": true,
345
+ "constraints_ok": true,
346
+ "libraries_allowed": true,
347
+ "tokens_matched": false,
348
+ "tool_calls": 1,
349
+ "tokens": null,
350
+ "wall_ms": 12993,
351
+ "predicted": [],
352
+ "acceptable": [
353
+ "shadcn/textarea"
354
+ ],
355
+ "code": "import React from 'react';\nimport { Input, Style } from '@/components/ui';\n\nfunction DeliveryInstructionsForm({ deliveryNotes }) {\n return (\n <Style>\n <Input\n type=\"text\"\n placeholder=\"Delivery Notes\"\n value={deliveryNotes}\n onChange={(e) => {\n // Placeholder for handling input changes\n console.log('Input value:', e.target.value);\n }}\n />\n </Style>\n );\n}\n\nexport default DeliveryInstructionsForm;",
356
+ "issues": [
357
+ "UNUSED_IMPORT: \"React\" is imported from \"react\" but never used",
358
+ "COMPILE_ERROR: tsc reported errors in generated scaffolds; first diagnostic: Component.tsx(4,37): error TS7031: Binding element 'deliveryNotes' implicitly has an 'any' type."
359
+ ]
360
+ },
361
+ {
362
+ "item_id": "dev-60",
363
+ "compiles": false,
364
+ "lint_clean": false,
365
+ "a11y_clean": false,
366
+ "constraints_ok": true,
367
+ "libraries_allowed": true,
368
+ "tokens_matched": false,
369
+ "tool_calls": 1,
370
+ "tokens": null,
371
+ "wall_ms": 25718,
372
+ "predicted": [],
373
+ "acceptable": [
374
+ "shadcn/badge"
375
+ ],
376
+ "code": "import React from 'react';\nimport { Style } from '@/components/ui';\n\nfunction Badge({ content, attributes }) {\n return (\n <Style>\n <div style={{ color: attributes.color.primary, fontSize: '16px', padding: '16px' }}>\n <div style={{ color: attributes.color.muted, fontSize: '16px', padding: '16px' }}>\n <div style={{ color: attributes.color.surface, fontSize: '16px', padding: '16px' }}>\n <div style={{ color: attributes.color.text, fontSize: '16px', padding: '16px' }}>\n <div style={{ color: attributes.color.surface, fontSize: '16px', padding: '16px' }}>\n <div style={{ color: attributes.color.muted, fontSize: '16px', padding: '16px' }}>\n <div style={{ color: attributes.color.primary, fontSize: '16px', padding: '16px' }}>\n Badge\n </div>\n </div>\n </div>\n </div>\n </div>\n </Style>\n </div>\n </Style>\n );\n}\n\nexport default Badge;",
377
+ "issues": [
378
+ "SYNTAX_ERROR: Expected corresponding JSX closing tag for 'div'.",
379
+ "UNUSED_IMPORT: \"React\" is imported from \"react\" but never used",
380
+ "COMPILE_ERROR: tsc reported errors in generated scaffolds; first diagnostic: Component.tsx(20,11): error TS17002: Expected corresponding JSX closing tag for 'div'."
381
+ ]
382
+ },
383
+ {
384
+ "item_id": "test-17",
385
+ "compiles": false,
386
+ "lint_clean": false,
387
+ "a11y_clean": true,
388
+ "constraints_ok": true,
389
+ "libraries_allowed": true,
390
+ "tokens_matched": false,
391
+ "tool_calls": 1,
392
+ "tokens": null,
393
+ "wall_ms": 11373,
394
+ "predicted": [],
395
+ "acceptable": [
396
+ "shadcn/avatar"
397
+ ],
398
+ "code": "import React from 'react';\n\nfunction AssigneeAvatar({ contentSize }) {\n return (\n <img src={contentSize} alt=\"Avatar\" width=\"50\" height=\"50\" />\n );\n}\n\nexport default AssigneeAvatar;",
399
+ "issues": [
400
+ "UNUSED_IMPORT: \"React\" is imported from \"react\" but never used",
401
+ "COMPILE_ERROR: tsc reported errors in generated scaffolds; first diagnostic: Component.tsx(3,27): error TS7031: Binding element 'contentSize' implicitly has an 'any' type."
402
+ ]
403
+ },
404
+ {
405
+ "item_id": "dev-97",
406
+ "compiles": false,
407
+ "lint_clean": false,
408
+ "a11y_clean": false,
409
+ "constraints_ok": false,
410
+ "libraries_allowed": true,
411
+ "tokens_matched": true,
412
+ "tool_calls": 1,
413
+ "tokens": null,
414
+ "wall_ms": 75546,
415
+ "predicted": [],
416
+ "acceptable": [
417
+ "mui/app-bar"
418
+ ],
419
+ "code": "```typescript\nimport React from 'react';\n\nfunction AppBarHeader() {\n return (\n <div style={{ width: '100%', padding: '20px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#ffffff', border: '1px solid #1565c0', borderRadius: '4px' }}>\n <div style={{ width: '100%', backgroundColor: '#1565c0', border: '",
420
+ "issues": [
421
+ "SYNTAX_ERROR: Unterminated template literal.",
422
+ "COMPILE_ERROR: tsc reported errors in generated scaffolds; first diagnostic: Component.tsx(34,128): error TS1160: Unterminated template literal.",
423
+ "FORBIDDEN_PATTERN: inline-style"
424
+ ]
425
+ },
426
+ {
427
+ "item_id": "dev-157",
428
+ "compiles": true,
429
+ "lint_clean": true,
430
+ "a11y_clean": true,
431
+ "constraints_ok": true,
432
+ "libraries_allowed": true,
433
+ "tokens_matched": false,
434
+ "tool_calls": 1,
435
+ "tokens": null,
436
+ "wall_ms": 8023,
437
+ "predicted": [],
438
+ "acceptable": [
439
+ "mantine/checkbox"
440
+ ],
441
+ "code": "import React from 'react';\n\nfunction IncludeArchived() {\n const [include, setInclude] = React.useState(false);\n\n const handleToggle = () => {\n setInclude(!include);\n };\n\n return (\n <div>\n <label>\n <input\n type=\"checkbox\"\n checked={include}\n onChange={handleToggle}\n />\n Archived Tickets\n </label>\n </div>\n );\n}\n\nexport default IncludeArchived;",
442
+ "issues": []
443
+ }
444
+ ],
445
+ "model_info": {
446
+ "provider": "ollama",
447
+ "id": "gemma3:1b"
448
+ },
449
+ "notes": [
450
+ "This arm is the competitor: it may import any installed library and write any code.",
451
+ "compiles is the project verifier's TypeScript sandbox result; lint/a11y/constraints come from the same verifier.",
452
+ "token_match means at least half of the Design MD token values sampled appear in the generated code."
453
+ ]
454
+ }
455
+ }
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="760" height="500" viewBox="0 0 760 500" role="img" aria-labelledby="cal-title cal-desc">
3
+ <title id="cal-title">Confidence calibration — full_skill</title>
4
+ <desc id="cal-desc">n=161 answered · abstained=11 · coverage=0.936 · ECE=0.036 · Brier=0.014</desc>
5
+ <style>
6
+ .bg { fill: #ffffff; }
7
+ .frame { fill: none; stroke: #94a3b8; stroke-width: 1; }
8
+ .grid { stroke: #e2e8f0; stroke-width: 1; }
9
+ .tick { fill: #475569; font: 12px ui-sans-serif, system-ui, sans-serif; }
10
+ .axis { fill: #334155; font: 13px ui-sans-serif, system-ui, sans-serif; }
11
+ .title { fill: #0f172a; font: 600 18px ui-sans-serif, system-ui, sans-serif; }
12
+ .subtitle { fill: #475569; font: 12px ui-sans-serif, system-ui, sans-serif; }
13
+ .perfect { stroke: #94a3b8; stroke-width: 1.5; stroke-dasharray: 6 5; }
14
+ .observed { fill: none; stroke: #2563eb; stroke-width: 2; }
15
+ .point { fill: #2563eb; fill-opacity: 0.9; stroke: #ffffff; stroke-width: 1.5; }
16
+ .count { fill: #1d4ed8; font: 11px ui-sans-serif, system-ui, sans-serif; }
17
+ .legend { fill: #334155; font: 12px ui-sans-serif, system-ui, sans-serif; }
18
+ .note { fill: #64748b; font: 11px ui-sans-serif, system-ui, sans-serif; }
19
+ </style>
20
+ <rect class="bg" x="0" y="0" width="760" height="500"/>
21
+ <text x="84" y="32" class="title">Confidence calibration — full_skill</text>
22
+ <text x="84" y="54" class="subtitle">n=161 answered · abstained=11 · coverage=0.936 · ECE=0.036 · Brier=0.014</text>
23
+
24
+ <line x1="84.0" y1="78" x2="84.0" y2="402" class="grid"/><line x1="84" y1="402.0" x2="724" y2="402.0" class="grid"/><text x="84.0" y="424" text-anchor="middle" class="tick">0.0</text><text x="70" y="406.0" text-anchor="end" class="tick">0.0</text>
25
+ <line x1="212.0" y1="78" x2="212.0" y2="402" class="grid"/><line x1="84" y1="337.2" x2="724" y2="337.2" class="grid"/><text x="212.0" y="424" text-anchor="middle" class="tick">0.2</text><text x="70" y="341.2" text-anchor="end" class="tick">0.2</text>
26
+ <line x1="340.0" y1="78" x2="340.0" y2="402" class="grid"/><line x1="84" y1="272.4" x2="724" y2="272.4" class="grid"/><text x="340.0" y="424" text-anchor="middle" class="tick">0.4</text><text x="70" y="276.4" text-anchor="end" class="tick">0.4</text>
27
+ <line x1="468.0" y1="78" x2="468.0" y2="402" class="grid"/><line x1="84" y1="207.6" x2="724" y2="207.6" class="grid"/><text x="468.0" y="424" text-anchor="middle" class="tick">0.6</text><text x="70" y="211.6" text-anchor="end" class="tick">0.6</text>
28
+ <line x1="596.0" y1="78" x2="596.0" y2="402" class="grid"/><line x1="84" y1="142.8" x2="724" y2="142.8" class="grid"/><text x="596.0" y="424" text-anchor="middle" class="tick">0.8</text><text x="70" y="146.8" text-anchor="end" class="tick">0.8</text>
29
+ <line x1="724.0" y1="78" x2="724.0" y2="402" class="grid"/><line x1="84" y1="78.0" x2="724" y2="78.0" class="grid"/><text x="724.0" y="424" text-anchor="middle" class="tick">1.0</text><text x="70" y="82.0" text-anchor="end" class="tick">1.0</text>
30
+ <rect class="frame" x="84" y="78" width="640" height="324"/>
31
+ <line class="perfect" x1="84" y1="402" x2="724" y2="78"/>
32
+ <polyline class="observed" points="692.6,81.9"/>
33
+ <circle cx="692.6" cy="81.9" r="8.0" class="point"><title>95% confidence · 98.8% accuracy · n=161</title></circle><text x="705.6" y="85.9" class="count">n=161</text>
34
+
35
+ <text x="404" y="454" text-anchor="middle" class="axis">Predicted confidence</text>
36
+ <text x="26" y="240" text-anchor="middle" transform="rotate(-90 26 240)" class="axis">Observed accuracy</text>
37
+
38
+ <line x1="514" y1="92" x2="538" y2="92" class="perfect"/>
39
+ <text x="546" y="96" class="legend">perfect calibration</text>
40
+ <circle cx="526" cy="116" r="4" class="point"/>
41
+ <text x="546" y="120" class="legend">observed bins</text>
42
+
43
+ <text x="84" y="480" class="note">Full-skill arm only. Abstentions carry no top prediction and are excluded from the bins.</text>
44
+ </svg>
@@ -0,0 +1,19 @@
1
+ # Design import
2
+
3
+ `ui-gateway import-figma <frame.json>` converts a Figma REST/plugin JSON export
4
+ into intents deterministically. It is not a vision model: it reads the layer
5
+ tree, names and text characters, and classifies each leaf/component into an
6
+ intent type (navigation, form, data_display, overlay, action, feedback, media,
7
+ layout, content).
8
+
9
+ ```bash
10
+ ui-gateway import-figma frame.json --out intents.json
11
+ ```
12
+
13
+ Then merge the intents into a `build_handoff` input or pass them to `map_ui`.
14
+ The caller still owns the Design MD. Because Figma text is untrusted data, layer
15
+ names are escaped into intent descriptions and never become instructions or
16
+ code.
17
+
18
+ For screenshots rather than JSON, a vision model can produce the same intent
19
+ list; label that input as model-generated and review it before submission.
@@ -0,0 +1,109 @@
1
+ # Design MD format
2
+
3
+ The Design MD is the constraint authority in a handoff. It is parsed strictly: unknown sections, keys and values are errors, because the gateway cannot enforce what it did not understand. Meaning is never guessed; every deterministic normalization is recorded in `normalizations`.
4
+
5
+ ## Example
6
+
7
+ ```markdown
8
+ # Design MD: Operations Dashboard
9
+
10
+ ## Tokens
11
+ - color.primary: #0F172A
12
+ - color.surface: #ffffff
13
+ - color.text: #0f172a
14
+ - radius.md: 8px
15
+ - font.sans: Inter
16
+ - space.md: 16px
17
+ - mode: light
18
+
19
+ ## Preferences
20
+ - preferred_libraries: shadcn
21
+ - reuse_order: local, installed, new
22
+ - new_dependencies: allow
23
+ - on_conflict: ask
24
+
25
+ ## Hard constraints
26
+ - forbid_pattern: gradient
27
+ - forbid_library: antd
28
+ - max_new_dependencies: 2
29
+ - require_token: color.primary
30
+
31
+ ## Soft constraints
32
+ - preferred_library: shadcn
33
+ ```
34
+
35
+ ## Sections
36
+
37
+ | Heading | Recognised as |
38
+ | --- | --- |
39
+ | `Tokens` / `Design tokens` | token definitions |
40
+ | `Preferences` / `Policy` / `Preferences and policy` | policy and preferred libraries |
41
+ | `Hard constraints` / `Hard` | hard constraints |
42
+ | `Soft constraints` / `Soft` | soft preferences |
43
+
44
+ Sub-headings (`###`) are ignored and recorded as normalizations. Prose outside a section is ignored and recorded. Anything else is an error.
45
+
46
+ ## Tokens
47
+
48
+ Token names are free-form namespaced keys (`color.primary`, `radius.md`, `shadow.card`) but the prefix decides validation:
49
+
50
+ | Prefix | Kind | Accepted values |
51
+ | --- | --- | --- |
52
+ | `color` | color | 3, 6 or 8 digit hex; lowercased and 3-digit shorthand expanded |
53
+ | `font` | font | any string |
54
+ | `radius`, `space`, `spacing` | length | `<number>px` or `<number>rem` |
55
+ | `mode` | mode | `light` or `dark` |
56
+ | anything else | other | any string |
57
+
58
+ Normalizations are recorded, never inferred: `#0F172A` becomes `#0f172a` with a note; `#abc` becomes `#aabbcc` with a note. A color that is not hex is an `INVALID_VALUE` error.
59
+
60
+ Duplicate tokens are preserved in `token_definitions`; two different values for one token are an `UNSATISFIABLE_CONSTRAINTS` contradiction naming both.
61
+
62
+ ## Preferences
63
+
64
+ | Key | Values | Default (recorded) |
65
+ | --- | --- | --- |
66
+ | `preferred_libraries` | comma-separated library ids | none |
67
+ | `reuse_order` | subset of `local, installed, new` | `local, installed, new` |
68
+ | `new_dependencies` | `forbid` \| `ask` \| `allow` | `ask` |
69
+ | `on_conflict` | `project` \| `design_md` \| `ask` | `ask` |
70
+
71
+ Policy precedence: a field the Design MD sets explicitly wins. Otherwise the handoff's `project_context.policy` applies.
72
+
73
+ ## Constraints
74
+
75
+ | Key | Meaning | Enforcement |
76
+ | --- | --- | --- |
77
+ | `forbid_pattern` | forbidden visual technique | lint on generated code |
78
+ | `forbid_library` | library may not be used | candidate filter + import lint |
79
+ | `preferred_library` | soft ordering hint | ranking only |
80
+ | `max_new_dependencies` | cap on new packages | satisfiability + acceptance |
81
+ | `require_token` | token must exist | satisfiability |
82
+
83
+ Supported patterns: `gradient`, `inline-style`, `arbitrary-tailwind`, `important`, `animation`, `shadow`. Anything else is a compile error rather than a rule the gateway pretends to enforce.
84
+
85
+ Soft constraints use the same keys. They never fail verifier checks; they are reported and used only for preference.
86
+
87
+ ## Satisfiability
88
+
89
+ Before matching, the gateway checks the Design MD against itself and the project profile. Each failure names the pair:
90
+
91
+ - a preferred library that is also forbidden;
92
+ - a required token that is not defined;
93
+ - two different values for one token;
94
+ - `max_new_dependencies: 0` in an existing project where no preferred library is installed;
95
+ - a preferred library with no adapter (`UNSUPPORTED`).
96
+
97
+ ## Token mapping
98
+
99
+ Adapters translate tokens into their own theme surface:
100
+
101
+ - shadcn: `color.primary` → `--primary` CSS variable, `radius.md` → `--radius`, and so on.
102
+ - MUI: `color.primary` → `palette.primary.main`, `radius.md` → `shape.borderRadius`.
103
+ - Chakra UI v2: `color.primary` → `colors.primary.500`, `radius.md` → `radii.md`. Chakra v3 uses the same theme paths; component names are version-filtered.
104
+ - Mantine: `color.primary` → `colors.blue[6]`, `radius.md` → `radius.md` (theme paths).
105
+ - Nuxt UI: `color.primary` → `--ui-primary`, `radius.md` → `--ui-radius` (CSS variables).
106
+ - Unified Radix: `project-tokens` strategy; primitives are unstyled and the project owns the CSS.
107
+ - Local components: `project-tokens` strategy, no remote theme.
108
+
109
+ Unknown tokens are kept and reported; they are not silently dropped into a library theme.