@ggui-ai/ui-gen 0.27.0 → 0.29.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 (315) hide show
  1. package/dist/{adapter-h4_V69LI.d.ts → adapter-DLQ-5COm.d.ts} +1 -1
  2. package/dist/adapters/base.js +2 -27
  3. package/dist/adapters/base.js.map +1 -1
  4. package/dist/adapters/generation-dispatch.d.ts +14 -6
  5. package/dist/adapters/generation-dispatch.js +40 -19095
  6. package/dist/adapters/generation-dispatch.js.map +1 -1
  7. package/dist/adapters/index.d.ts +1 -1
  8. package/dist/adapters/index.js +25 -3561
  9. package/dist/adapters/index.js.map +1 -1
  10. package/dist/adapters/types.js +2 -9
  11. package/dist/adapters/types.js.map +1 -1
  12. package/dist/advanced/index.d.ts +13 -12
  13. package/dist/advanced/index.js +63 -21789
  14. package/dist/advanced/index.js.map +1 -1
  15. package/dist/{bank-Ctdp3FUA.d.ts → bank-LWaiAtaA.d.ts} +1 -1
  16. package/dist/blueprint-validator.js +6 -2301
  17. package/dist/blueprint-validator.js.map +1 -1
  18. package/dist/boilerplate.d.ts +3 -2
  19. package/dist/boilerplate.js +6 -1867
  20. package/dist/boilerplate.js.map +1 -1
  21. package/dist/check/index.d.ts +3 -2
  22. package/dist/check/index.js +6 -1923
  23. package/dist/check/index.js.map +1 -1
  24. package/dist/chunk-33B3BAWS.js +24 -0
  25. package/dist/chunk-33B3BAWS.js.map +1 -0
  26. package/dist/chunk-3HSGA6NI.js +591 -0
  27. package/dist/chunk-3HSGA6NI.js.map +1 -0
  28. package/dist/chunk-3NNNGNTO.js +1707 -0
  29. package/dist/chunk-3NNNGNTO.js.map +1 -0
  30. package/dist/chunk-3T2HMTON.js +79 -0
  31. package/dist/chunk-3T2HMTON.js.map +1 -0
  32. package/dist/chunk-3ZSSDV3L.js +123 -0
  33. package/dist/chunk-3ZSSDV3L.js.map +1 -0
  34. package/dist/chunk-4MBR5GA3.js +99 -0
  35. package/dist/chunk-4MBR5GA3.js.map +1 -0
  36. package/dist/chunk-56NJFD55.js +337 -0
  37. package/dist/chunk-56NJFD55.js.map +1 -0
  38. package/dist/chunk-5AGTY555.js +26 -0
  39. package/dist/chunk-5AGTY555.js.map +1 -0
  40. package/dist/chunk-5EJM7EGY.js +115 -0
  41. package/dist/chunk-5EJM7EGY.js.map +1 -0
  42. package/dist/chunk-5KXCQLLR.js +529 -0
  43. package/dist/chunk-5KXCQLLR.js.map +1 -0
  44. package/dist/chunk-5VBXHVEH.js +171 -0
  45. package/dist/chunk-5VBXHVEH.js.map +1 -0
  46. package/dist/chunk-6KDDEING.js +515 -0
  47. package/dist/chunk-6KDDEING.js.map +1 -0
  48. package/dist/chunk-6VDRWAP6.js +123 -0
  49. package/dist/chunk-6VDRWAP6.js.map +1 -0
  50. package/dist/chunk-732IBFEJ.js +2400 -0
  51. package/dist/chunk-732IBFEJ.js.map +1 -0
  52. package/dist/chunk-73AURS3I.js +46 -0
  53. package/dist/chunk-73AURS3I.js.map +1 -0
  54. package/dist/chunk-77H5SKLX.js +8 -0
  55. package/dist/chunk-77H5SKLX.js.map +1 -0
  56. package/dist/chunk-7QE3AHLE.js +35 -0
  57. package/dist/chunk-7QE3AHLE.js.map +1 -0
  58. package/dist/chunk-A375NNWN.js +11 -0
  59. package/dist/chunk-A375NNWN.js.map +1 -0
  60. package/dist/chunk-AOU33EFS.js +140 -0
  61. package/dist/chunk-AOU33EFS.js.map +1 -0
  62. package/dist/chunk-BA4QYA6E.js +461 -0
  63. package/dist/chunk-BA4QYA6E.js.map +1 -0
  64. package/dist/chunk-DBP764GL.js +3 -0
  65. package/dist/chunk-DBP764GL.js.map +1 -0
  66. package/dist/chunk-DUU3ZJDQ.js +41 -0
  67. package/dist/chunk-DUU3ZJDQ.js.map +1 -0
  68. package/dist/chunk-DXKRBXNU.js +30 -0
  69. package/dist/chunk-DXKRBXNU.js.map +1 -0
  70. package/dist/chunk-FB7OEEAH.js +1467 -0
  71. package/dist/chunk-FB7OEEAH.js.map +1 -0
  72. package/dist/chunk-FLRNMZV2.js +18 -0
  73. package/dist/chunk-FLRNMZV2.js.map +1 -0
  74. package/dist/chunk-FWJIMKFZ.js +2032 -0
  75. package/dist/chunk-FWJIMKFZ.js.map +1 -0
  76. package/dist/chunk-FXRHWYIQ.js +163 -0
  77. package/dist/chunk-FXRHWYIQ.js.map +1 -0
  78. package/dist/chunk-G3PMV62Z.js +33 -0
  79. package/dist/chunk-G3PMV62Z.js.map +1 -0
  80. package/dist/chunk-GAJI7Y3P.js +13 -0
  81. package/dist/chunk-GAJI7Y3P.js.map +1 -0
  82. package/dist/chunk-GYINWMPR.js +2052 -0
  83. package/dist/chunk-GYINWMPR.js.map +1 -0
  84. package/dist/chunk-HD6ABIK7.js +484 -0
  85. package/dist/chunk-HD6ABIK7.js.map +1 -0
  86. package/dist/chunk-HDQVHYO6.js +100 -0
  87. package/dist/chunk-HDQVHYO6.js.map +1 -0
  88. package/dist/chunk-IHUT3SIW.js +7 -0
  89. package/dist/chunk-IHUT3SIW.js.map +1 -0
  90. package/dist/chunk-JDH5EGNZ.js +126 -0
  91. package/dist/chunk-JDH5EGNZ.js.map +1 -0
  92. package/dist/chunk-JMD4RGSV.js +37 -0
  93. package/dist/chunk-JMD4RGSV.js.map +1 -0
  94. package/dist/chunk-KJWGZL5B.js +33 -0
  95. package/dist/chunk-KJWGZL5B.js.map +1 -0
  96. package/dist/chunk-MKMDQFZ7.js +86 -0
  97. package/dist/chunk-MKMDQFZ7.js.map +1 -0
  98. package/dist/chunk-NF6JUZWF.js +85 -0
  99. package/dist/chunk-NF6JUZWF.js.map +1 -0
  100. package/dist/chunk-O2YC6XDC.js +1933 -0
  101. package/dist/chunk-O2YC6XDC.js.map +1 -0
  102. package/dist/chunk-OVLH5ICV.js +29 -0
  103. package/dist/chunk-OVLH5ICV.js.map +1 -0
  104. package/dist/chunk-PBOYHGSD.js +106 -0
  105. package/dist/chunk-PBOYHGSD.js.map +1 -0
  106. package/dist/chunk-PJFH7QWA.js +81 -0
  107. package/dist/chunk-PJFH7QWA.js.map +1 -0
  108. package/dist/chunk-PUH4CXGZ.js +284 -0
  109. package/dist/chunk-PUH4CXGZ.js.map +1 -0
  110. package/dist/chunk-QLXXPGTV.js +18 -0
  111. package/dist/chunk-QLXXPGTV.js.map +1 -0
  112. package/dist/chunk-R5GIGPW2.js +2845 -0
  113. package/dist/chunk-R5GIGPW2.js.map +1 -0
  114. package/dist/chunk-RH4IUSTO.js +83 -0
  115. package/dist/chunk-RH4IUSTO.js.map +1 -0
  116. package/dist/chunk-S2GVXKKY.js +153 -0
  117. package/dist/chunk-S2GVXKKY.js.map +1 -0
  118. package/dist/chunk-TVHGKFJS.js +58 -0
  119. package/dist/chunk-TVHGKFJS.js.map +1 -0
  120. package/dist/chunk-U7GALWLG.js +66 -0
  121. package/dist/chunk-U7GALWLG.js.map +1 -0
  122. package/dist/chunk-VTC263LT.js +256 -0
  123. package/dist/chunk-VTC263LT.js.map +1 -0
  124. package/dist/chunk-WEOXFEVE.js +739 -0
  125. package/dist/chunk-WEOXFEVE.js.map +1 -0
  126. package/dist/chunk-WYHP46LT.js +28 -0
  127. package/dist/chunk-WYHP46LT.js.map +1 -0
  128. package/dist/chunk-XGLO5LGG.js +274 -0
  129. package/dist/chunk-XGLO5LGG.js.map +1 -0
  130. package/dist/chunk-XRBCRKA2.js +29 -0
  131. package/dist/chunk-XRBCRKA2.js.map +1 -0
  132. package/dist/chunk-XW7ADFFV.js +340 -0
  133. package/dist/chunk-XW7ADFFV.js.map +1 -0
  134. package/dist/chunk-YIQ42IUX.js +34 -0
  135. package/dist/chunk-YIQ42IUX.js.map +1 -0
  136. package/dist/chunk-YJZTUY7B.js +101 -0
  137. package/dist/chunk-YJZTUY7B.js.map +1 -0
  138. package/dist/chunk-Z3CXME3K.js +107 -0
  139. package/dist/chunk-Z3CXME3K.js.map +1 -0
  140. package/dist/classifier/index.js +2 -527
  141. package/dist/classifier/index.js.map +1 -1
  142. package/dist/client-JBPCXU7W.js +4 -0
  143. package/dist/client-JBPCXU7W.js.map +1 -0
  144. package/dist/compose.js +3 -367
  145. package/dist/compose.js.map +1 -1
  146. package/dist/cost-tracker-HHGQ4FTW.js +67 -0
  147. package/dist/cost-tracker-HHGQ4FTW.js.map +1 -0
  148. package/dist/{create-ui-generator-BrZHF0cf.d.ts → create-ui-generator-BY-WeaPi.d.ts} +3 -3
  149. package/dist/{design-mode-DGWN_Gkm.d.ts → design-mode-XyOQmzE0.d.ts} +4 -3
  150. package/dist/{dispatch-B07TI30d.d.ts → dispatch-8LzTddKw.d.ts} +3 -2
  151. package/dist/dist-UALN6ZVB.js +543 -0
  152. package/dist/dist-UALN6ZVB.js.map +1 -0
  153. package/dist/dupe-break-X6K7QFIS.js +4 -0
  154. package/dist/dupe-break-X6K7QFIS.js.map +1 -0
  155. package/dist/evaluation/axis-checks/index.d.ts +5 -4
  156. package/dist/evaluation/axis-checks/index.js +6 -1818
  157. package/dist/evaluation/axis-checks/index.js.map +1 -1
  158. package/dist/evaluation/axis-checks/registry.d.ts +3 -2
  159. package/dist/evaluation/axis-checks/registry.js +3 -1748
  160. package/dist/evaluation/axis-checks/registry.js.map +1 -1
  161. package/dist/evaluation/index.d.ts +49 -132
  162. package/dist/evaluation/index.js +302 -6368
  163. package/dist/evaluation/index.js.map +1 -1
  164. package/dist/evaluation/types.d.ts +3 -2
  165. package/dist/evaluation/types.js +2 -5
  166. package/dist/evaluation/types.js.map +1 -1
  167. package/dist/fragments/index.js +2 -338
  168. package/dist/fragments/index.js.map +1 -1
  169. package/dist/{generate-tSO_shQ0.d.ts → generate-DQ4ci90s.d.ts} +1 -1
  170. package/dist/harness/check/runtime-render/index.d.ts +35 -15
  171. package/dist/harness/check/runtime-render/index.js +6 -2390
  172. package/dist/harness/check/runtime-render/index.js.map +1 -1
  173. package/dist/harness/check/runtime-render/render-check-worker.js +4 -1739
  174. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  175. package/dist/harness/index.d.ts +3 -2
  176. package/dist/harness/index.js +23 -5124
  177. package/dist/harness/index.js.map +1 -1
  178. package/dist/harness/llm-trace-sink.js +2 -24
  179. package/dist/harness/llm-trace-sink.js.map +1 -1
  180. package/dist/harness/prompts.d.ts +2 -2
  181. package/dist/harness/prompts.js +8 -324
  182. package/dist/harness/prompts.js.map +1 -1
  183. package/dist/harness/result-types.d.ts +18 -6
  184. package/dist/harness/result-types.js +2 -0
  185. package/dist/harness/result-types.js.map +1 -1
  186. package/dist/harness/runtime.d.ts +22 -5
  187. package/dist/harness/runtime.js +10 -2313
  188. package/dist/harness/runtime.js.map +1 -1
  189. package/dist/harness/types-public.d.ts +3 -2
  190. package/dist/harness/types-public.js +16 -2954
  191. package/dist/harness/types-public.js.map +1 -1
  192. package/dist/harness/validator-trace-sink.d.ts +3 -2
  193. package/dist/harness/validator-trace-sink.js +2 -26
  194. package/dist/harness/validator-trace-sink.js.map +1 -1
  195. package/dist/hash.js +2 -39
  196. package/dist/hash.js.map +1 -1
  197. package/dist/hashline-5OKREIRM.js +4 -0
  198. package/dist/hashline-5OKREIRM.js.map +1 -0
  199. package/dist/index.d.ts +51 -12
  200. package/dist/index.js +57 -21850
  201. package/dist/index.js.map +1 -1
  202. package/dist/llm-evaluator-PN3WFCS4.js +653 -0
  203. package/dist/llm-evaluator-PN3WFCS4.js.map +1 -0
  204. package/dist/magic-string.es-2NZTC4GZ.js +1307 -0
  205. package/dist/magic-string.es-2NZTC4GZ.js.map +1 -0
  206. package/dist/patch.d.ts +3 -2
  207. package/dist/patch.js +2 -56
  208. package/dist/patch.js.map +1 -1
  209. package/dist/policy-VCYKGSAC.js +5 -0
  210. package/dist/policy-VCYKGSAC.js.map +1 -0
  211. package/dist/policy.js +2 -35
  212. package/dist/policy.js.map +1 -1
  213. package/dist/primitive-index-2OF6F4TZ.js +131 -0
  214. package/dist/primitive-index-2OF6F4TZ.js.map +1 -0
  215. package/dist/primitive-slice-WTMBLYFJ.js +235 -0
  216. package/dist/primitive-slice-WTMBLYFJ.js.map +1 -0
  217. package/dist/{prompts-BhNUuRoZ.d.ts → prompts-CLZGywMP.d.ts} +1 -1
  218. package/dist/provider-adapter-contract.js +10407 -14204
  219. package/dist/provider-adapter-contract.js.map +1 -1
  220. package/dist/provider-adapter.js +2 -44
  221. package/dist/provider-adapter.js.map +1 -1
  222. package/dist/providers/index.d.ts +89 -1
  223. package/dist/providers/index.js +115 -44
  224. package/dist/providers/index.js.map +1 -1
  225. package/dist/raw-C6KBH5I3.js +141 -0
  226. package/dist/raw-C6KBH5I3.js.map +1 -0
  227. package/dist/raw-FXSBXQTZ.js +7 -0
  228. package/dist/raw-FXSBXQTZ.js.map +1 -0
  229. package/dist/raw-MURDUPGK.js +8 -0
  230. package/dist/raw-MURDUPGK.js.map +1 -0
  231. package/dist/raw-T3GW3UVX.js +8 -0
  232. package/dist/raw-T3GW3UVX.js.map +1 -0
  233. package/dist/render-check-host-ZNIS6BJ5.js +5 -0
  234. package/dist/render-check-host-ZNIS6BJ5.js.map +1 -0
  235. package/dist/sdk-4JNSDNSR.js +6 -0
  236. package/dist/sdk-4JNSDNSR.js.map +1 -0
  237. package/dist/sdk-DIVJMHCX.js +7 -0
  238. package/dist/sdk-DIVJMHCX.js.map +1 -0
  239. package/dist/sdk-QRJOCRTS.js +7 -0
  240. package/dist/sdk-QRJOCRTS.js.map +1 -0
  241. package/dist/tag-balance-CTHCTRJ7.js +123 -0
  242. package/dist/tag-balance-CTHCTRJ7.js.map +1 -0
  243. package/dist/tools/get-primitives-ts.d.ts +1 -1
  244. package/dist/tools/get-primitives-ts.js +3 -1
  245. package/dist/tools/get-primitives-ts.js.map +1 -1
  246. package/dist/tools/render-check-worker.js +3 -40
  247. package/dist/tools/render-check-worker.js.map +1 -1
  248. package/dist/{types-public-h8IMnYuh.d.ts → types-public-hYlrerZh.d.ts} +35 -2
  249. package/dist/validation/index.d.ts +2 -2
  250. package/dist/validation/index.js +3 -498
  251. package/dist/validation/index.js.map +1 -1
  252. package/dist/{visual-evaluator-C2strxqD.d.ts → visual-evaluator-KskajxD5.d.ts} +14 -4
  253. package/dist/visual-evaluator-TGEXYQTP.js +12 -0
  254. package/dist/visual-evaluator-TGEXYQTP.js.map +1 -0
  255. package/dist/workflows.d.ts +3 -2
  256. package/dist/workflows.js +2 -151
  257. package/dist/workflows.js.map +1 -1
  258. package/package.json +21 -17
  259. package/src/adapters/claude/sdk.ts +4 -2
  260. package/src/adapters/claude/tool-bridge.ts +2 -1
  261. package/src/adapters/generation-dispatch.ts +9 -0
  262. package/src/adapters/openai/raw.ts +4 -0
  263. package/src/adapters/openai/sdk.ts +6 -1
  264. package/src/adapters/openai/tokens.ts +21 -7
  265. package/src/adapters/provider-router.ts +1 -0
  266. package/src/adapters/tool-bridge.ts +1 -1
  267. package/src/adapters/tools.ts +1 -1
  268. package/src/advanced/feedback.ts +1 -2
  269. package/src/advanced/generator.ts +4 -3
  270. package/src/boilerplate/free-design-prompt.ts +7 -0
  271. package/src/boilerplate/generate.ts +18 -5
  272. package/src/boilerplate/hard-sections.ts +8 -3
  273. package/src/boilerplate/react-hooks.ts +56 -0
  274. package/src/boilerplate/system-prompt.ts +12 -3
  275. package/src/check/run-tier0.ts +233 -8
  276. package/src/check/type-checker.ts +128 -16
  277. package/src/coding-agent/tools.ts +26 -3
  278. package/src/create-ui-generator.ts +4 -2
  279. package/src/design-mode.ts +4 -9
  280. package/src/evaluation/axis-checks/checks/state-merge.ts +3 -5
  281. package/src/evaluation/axis-checks/checks/state-payload.ts +1 -28
  282. package/src/evaluation/axis-checks/checks/tint.ts +197 -0
  283. package/src/evaluation/axis-checks/helpers.ts +246 -0
  284. package/src/evaluation/axis-checks/registry.ts +2 -0
  285. package/src/evaluation/criteria/__fixtures__/edge-v2-draw2.json +4629 -0
  286. package/src/evaluation/criteria/bank.ts +1 -1
  287. package/src/evaluation/criteria/edge-instruments.ts +14 -0
  288. package/src/evaluation/criteria/edge-probe-v2.ts +352 -0
  289. package/src/evaluation/criteria/edge-v2.ts +242 -0
  290. package/src/evaluation/criteria/resolve.ts +24 -5
  291. package/src/evaluation/evaluator.ts +2 -2
  292. package/src/evaluation/index.ts +3 -5
  293. package/src/evaluation/llm-evaluator.ts +2 -2
  294. package/src/evaluation/mcp-server.ts +0 -50
  295. package/src/evaluation/types-public.ts +6 -1
  296. package/src/evaluation/visual-evaluator.ts +162 -31
  297. package/src/harness/check/runtime-render/index.ts +28 -4
  298. package/src/harness/check/runtime-render/render-check.ts +20 -21
  299. package/src/harness/claude-agent-sdk-loader.ts +93 -0
  300. package/src/harness/claude-code-login-query.ts +1 -1
  301. package/src/harness/coding/assemble-result.ts +1 -0
  302. package/src/harness/coding/dupe-break.ts +70 -0
  303. package/src/harness/coding/generate-task-runner.ts +6 -1
  304. package/src/harness/coding/run-coding-turn.ts +59 -1
  305. package/src/harness/coding/run-eval-round.ts +9 -0
  306. package/src/harness/llm-router.ts +50 -2
  307. package/src/harness/result-types.ts +12 -0
  308. package/src/harness/runtime.ts +17 -0
  309. package/src/index.ts +10 -1
  310. package/src/providers/anthropic-tool-call.ts +263 -0
  311. package/src/providers/index.ts +13 -0
  312. package/src/tools/get-primitives-ts.ts +1 -1
  313. package/src/tools/render-check.ts +4 -4
  314. package/src/validation/primitives.ts +2 -1
  315. package/src/evaluation/loop.ts +0 -218
@@ -0,0 +1,461 @@
1
+ import { runRenderCheck, RENDER_CHECK_KINDS, installProductionActShim } from './chunk-3NNNGNTO.js';
2
+ import { resolveRenderCheckHostBounds } from './chunk-FXRHWYIQ.js';
3
+
4
+ // src/harness/check/runtime-render/prepare-mockup.ts
5
+ function prepareMockupProps(input) {
6
+ const { contract, fixtureProps } = input;
7
+ const propsSpec = contract?.propsSpec;
8
+ const props = {};
9
+ const source = {};
10
+ const warnings = [];
11
+ if (!propsSpec || !propsSpec.properties) {
12
+ if (fixtureProps) {
13
+ Object.assign(props, fixtureProps);
14
+ for (const k of Object.keys(fixtureProps)) source[k] = "fixture";
15
+ }
16
+ return { props, source, warnings };
17
+ }
18
+ for (const [key, entry] of Object.entries(propsSpec.properties)) {
19
+ if (fixtureProps && Object.prototype.hasOwnProperty.call(fixtureProps, key)) {
20
+ props[key] = fixtureProps[key];
21
+ source[key] = "fixture";
22
+ continue;
23
+ }
24
+ const synth = synthesizePropValue(entry, key, warnings);
25
+ if (synth.kind === "ok") {
26
+ props[key] = synth.value;
27
+ source[key] = synth.source;
28
+ } else if (entry.required) {
29
+ warnings.push(`Required prop '${key}' could not be synthesized (${synth.reason})`);
30
+ }
31
+ }
32
+ return { props, source, warnings };
33
+ }
34
+ function synthesizePropValue(entry, fieldName, warnings) {
35
+ if (entry.example !== void 0) {
36
+ return { kind: "ok", value: entry.example, source: "entry-example" };
37
+ }
38
+ if (entry.default !== void 0) {
39
+ return { kind: "ok", value: entry.default, source: "entry-default" };
40
+ }
41
+ return synthesizeFromSchema(entry.schema, fieldName, warnings, 0);
42
+ }
43
+ var MAX_DEPTH = 6;
44
+ function synthesizeFromSchema(schema, hint, warnings, depth, ordinal) {
45
+ if (!schema) return { kind: "fail", reason: "no schema" };
46
+ if (depth > MAX_DEPTH) return { kind: "fail", reason: "schema too deep" };
47
+ if (schema.default !== void 0) {
48
+ return { kind: "ok", value: schema.default, source: "schema-default" };
49
+ }
50
+ if (schema.example !== void 0) {
51
+ return { kind: "ok", value: schema.example, source: "schema-example" };
52
+ }
53
+ if (schema.enum && schema.enum.length > 0) {
54
+ return { kind: "ok", value: schema.enum[0], source: "schema-enum" };
55
+ }
56
+ if (schema.oneOf && schema.oneOf.length > 0) {
57
+ return synthesizeFromSchema(schema.oneOf[0], hint, warnings, depth + 1, ordinal);
58
+ }
59
+ if (schema.anyOf && schema.anyOf.length > 0) {
60
+ return synthesizeFromSchema(schema.anyOf[0], hint, warnings, depth + 1, ordinal);
61
+ }
62
+ if (Array.isArray(schema.type)) {
63
+ const primary = schema.type.find((t) => t !== "null") ?? "null";
64
+ return synthesizeFromSchema({ ...schema, type: primary }, hint, warnings, depth + 1, ordinal);
65
+ }
66
+ switch (schema.type) {
67
+ case "string": {
68
+ switch (schema.format) {
69
+ case "date":
70
+ case "date-time":
71
+ return { kind: "ok", value: "2026-04-13T12:00:00Z", source: "schema-synth" };
72
+ case "email":
73
+ return { kind: "ok", value: "user@example.com", source: "schema-synth" };
74
+ case "uri":
75
+ case "url":
76
+ return { kind: "ok", value: "https://example.com", source: "schema-synth" };
77
+ case "uuid":
78
+ return { kind: "ok", value: "00000000-0000-0000-0000-000000000000", source: "schema-synth" };
79
+ default: {
80
+ const cap = hint.charAt(0).toUpperCase() + hint.slice(1);
81
+ const value = ordinal === void 0 ? `Sample ${cap}` : `Sample ${cap} ${ordinal}`;
82
+ return { kind: "ok", value, source: "schema-synth" };
83
+ }
84
+ }
85
+ }
86
+ case "integer":
87
+ case "number": {
88
+ const min = typeof schema.minimum === "number" ? schema.minimum : 1;
89
+ const max = typeof schema.maximum === "number" ? schema.maximum : 100;
90
+ const value = Math.min(max, Math.max(min, 42));
91
+ return { kind: "ok", value, source: "schema-synth" };
92
+ }
93
+ case "boolean":
94
+ return { kind: "ok", value: true, source: "schema-synth" };
95
+ case "null":
96
+ return { kind: "ok", value: null, source: "schema-synth" };
97
+ case "array": {
98
+ if (!schema.items) {
99
+ return { kind: "ok", value: [], source: "schema-synth" };
100
+ }
101
+ const items = [];
102
+ for (let i = 0; i < 2; i++) {
103
+ const itemHint = `${hint}Item${i + 1}`;
104
+ const itemSynth = synthesizeFromSchema(schema.items, itemHint, warnings, depth + 1, i + 1);
105
+ if (itemSynth.kind === "ok") {
106
+ if (itemSynth.value !== null && typeof itemSynth.value === "object" && !Array.isArray(itemSynth.value) && !("id" in itemSynth.value)) {
107
+ itemSynth.value.id = `${hint}-${i + 1}`;
108
+ }
109
+ items.push(itemSynth.value);
110
+ }
111
+ }
112
+ return { kind: "ok", value: items, source: "schema-synth" };
113
+ }
114
+ case "object": {
115
+ const obj = {};
116
+ const propsMap = schema.properties ?? {};
117
+ const required = new Set(schema.required ?? []);
118
+ for (const [k, sub] of Object.entries(propsMap)) {
119
+ const subSynth = synthesizeFromSchema(sub, k, warnings, depth + 1, ordinal);
120
+ if (subSynth.kind === "ok") {
121
+ obj[k] = subSynth.value;
122
+ } else if (required.has(k)) {
123
+ warnings.push(
124
+ `Required object field '${hint}.${k}' could not be synthesized (${subSynth.reason})`
125
+ );
126
+ }
127
+ }
128
+ return { kind: "ok", value: obj, source: "schema-synth" };
129
+ }
130
+ default:
131
+ return { kind: "fail", reason: `unsupported schema type: ${schema.type ?? "unknown"}` };
132
+ }
133
+ }
134
+
135
+ // src/harness/check/runtime-render/adapter.ts
136
+ function createSlotLimiter(maxConcurrent) {
137
+ if (maxConcurrent === void 0) return (task) => task(0);
138
+ if (!Number.isInteger(maxConcurrent) || maxConcurrent < 1) {
139
+ throw new RangeError(
140
+ `createRuntimeRenderCheck: maxConcurrent must be a positive integer, got ${maxConcurrent}`
141
+ );
142
+ }
143
+ let active = 0;
144
+ const waiting = [];
145
+ const acquire = () => {
146
+ if (active < maxConcurrent) {
147
+ active += 1;
148
+ return Promise.resolve(0);
149
+ }
150
+ const enqueuedAt = Date.now();
151
+ return new Promise((resolve) => {
152
+ waiting.push(() => {
153
+ active += 1;
154
+ resolve(Date.now() - enqueuedAt);
155
+ });
156
+ });
157
+ };
158
+ const release = () => {
159
+ active -= 1;
160
+ const next = waiting.shift();
161
+ if (next !== void 0) next();
162
+ };
163
+ return async (task) => {
164
+ const waitedMs = await acquire();
165
+ try {
166
+ return await task(waitedMs);
167
+ } finally {
168
+ release();
169
+ }
170
+ };
171
+ }
172
+ function queuedField(queuedMs) {
173
+ return queuedMs > 0 ? { queuedMs } : {};
174
+ }
175
+ function toRenderCheckOptions(config) {
176
+ if (config.timeoutMs === void 0 && config.heapMb === void 0) return void 0;
177
+ return {
178
+ bounds: {
179
+ ...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {},
180
+ ...config.heapMb !== void 0 ? { heapMb: config.heapMb } : {}
181
+ }
182
+ };
183
+ }
184
+ function createRuntimeRenderCheck(config = {}) {
185
+ const limit = createSlotLimiter(config.maxConcurrent);
186
+ const options = toRenderCheckOptions(config);
187
+ if (options !== void 0) resolveRenderCheckHostBounds(options.bounds);
188
+ return {
189
+ id: "runtime-render",
190
+ run: async (input) => {
191
+ const { sourceCode, compiledCode, contract, fixtureProps } = input;
192
+ if (compiledCode === null) {
193
+ return { status: "not-applicable", issues: [], reason: "no compiled code" };
194
+ }
195
+ if (!contract) {
196
+ return { status: "not-applicable", issues: [], reason: "no contract surface" };
197
+ }
198
+ const mockup = prepareMockupProps({ contract, fixtureProps });
199
+ let queuedMs = 0;
200
+ let t0 = Date.now();
201
+ let result;
202
+ try {
203
+ result = await limit((waitedMs) => {
204
+ queuedMs = waitedMs;
205
+ t0 = Date.now();
206
+ return runRenderCheck(
207
+ {
208
+ sourceCode,
209
+ mockupProps: mockup.props,
210
+ contract
211
+ },
212
+ options
213
+ );
214
+ });
215
+ } catch (e) {
216
+ const message = e instanceof Error ? e.message : String(e);
217
+ console.warn(`[runtime-render] probe skipped \u2014 infra failure: ${message}`);
218
+ return { status: "infra-skipped", issues: [], reason: message, elapsedMs: Date.now() - t0, ...queuedField(queuedMs) };
219
+ }
220
+ const hostLoad = result.stats.hostLoad;
221
+ const load = hostLoad !== void 0 ? { hostLoad } : {};
222
+ if (result.incomplete !== void 0) {
223
+ const { elapsedMs, boundMs } = result.incomplete;
224
+ const loadNote = hostLoad !== void 0 ? `; host load ${hostLoad.start.toFixed(1)} \u2192 ${hostLoad.end.toFixed(1)} on ${hostLoad.cores} CPUs` : "";
225
+ const reason = `render check did not finish within ${boundMs} ms (stopped at ${elapsedMs} ms)${loadNote}`;
226
+ console.warn(`[runtime-render] probe timed out \u2014 ${reason}`);
227
+ return { status: "timed-out", issues: [], reason, elapsedMs: Date.now() - t0, ...queuedField(queuedMs), ...load };
228
+ }
229
+ return {
230
+ status: "ran",
231
+ issues: result.issues.map(toEvalIssue).filter((x) => x !== null),
232
+ elapsedMs: Date.now() - t0,
233
+ ...queuedField(queuedMs),
234
+ renderMs: result.stats.renderMs,
235
+ ...load,
236
+ // ggui#1398: report-only — carried to the probe's meta for the bench, never an issue.
237
+ ...result.stats.pendingAffordance !== void 0 ? { pendingAffordance: result.stats.pendingAffordance } : {}
238
+ };
239
+ }
240
+ };
241
+ }
242
+ var DEFAULT_RUNTIME_RENDER_CHECK = createRuntimeRenderCheck();
243
+ var CLASS_SPECIFIC_PATTERNS = [
244
+ /too many re-renders/i,
245
+ /maximum update depth/i,
246
+ /infinite render loop/i,
247
+ /cannot access\s+'[^']+'\s+before initialization/i,
248
+ /\b\w+ is not defined\b/i,
249
+ /is not iterable/i,
250
+ /symbol\(symbol\.iterator\)/i,
251
+ /cannot read propert(?:y|ies) of (?:undefined|null)/i,
252
+ /undefined is not/i,
253
+ /null is not/i
254
+ ];
255
+ function isRecoverableRenderCrash(reason) {
256
+ return CLASS_SPECIFIC_PATTERNS.some((rx) => rx.test(reason));
257
+ }
258
+ function classifyRenderCrashFix(reason) {
259
+ const r = reason.toLowerCase();
260
+ if (r.includes("too many re-renders") || r.includes("maximum update depth") || r.includes("infinite render loop")) {
261
+ return "Find the setState/dispatch call in your render body or useEffect. Either: (a) move the setState into an event handler, (b) add a proper useEffect dependency array so it doesn't fire every render, or (c) guard the setState with an equality check `if (next !== current) setX(next)`. Do NOT call setState in render or useEffect-without-deps.";
262
+ }
263
+ if (r.includes("cannot access") && r.includes("before initialization")) {
264
+ const symMatch = reason.match(/'([^']+)'/);
265
+ const sym = symMatch ? symMatch[1] : "the variable";
266
+ return `Temporal-dead-zone error on \`${sym}\`. You're referencing ${sym} (likely in a useEffect dependency array or a default value) BEFORE its \`const\`/\`let\` declaration. Move the declaration of ${sym} to the top of the component body, before any useEffect/useMemo/useCallback that reads it.`;
267
+ }
268
+ if (r.includes("is not defined")) {
269
+ const symMatch = reason.match(/(\w+) is not defined/);
270
+ const sym = symMatch ? symMatch[1] : "the symbol";
271
+ return `ReferenceError: \`${sym}\` is used in JSX/expression but never declared. Either: (a) add a \`const ${sym} = ...\` declaration in the component body, (b) destructure it from props/state, or (c) fix the typo if you meant a similarly-named local.`;
272
+ }
273
+ if (r.includes("is not iterable") || r.includes("symbol(symbol.iterator)")) {
274
+ return "Render iterated over a non-array. Find the `for...of`, `[...spread]`, or `.map`/`.filter`/`.reduce` call that crashed and either: (a) default the value to `[]` (`const items = props.items ?? []`), or (b) check it's an array before iterating (`Array.isArray(x) && ...`).";
275
+ }
276
+ if (r.includes("cannot read") || r.includes("undefined is not") || r.includes("null is not")) {
277
+ return "Null/undefined access. Add optional chaining (`obj?.field`) and default values for optional props/state before reading nested fields. Check your destructure patterns \u2014 destructuring undefined throws.";
278
+ }
279
+ return "Add null guards on optional props, handle empty arrays/strings, and verify all hook outputs before destructuring.";
280
+ }
281
+ var RUNTIME_SUBCATEGORY_PREFIX = "runtime:";
282
+ function parseRuntimeSubcategory(subcategory) {
283
+ if (!subcategory.startsWith(RUNTIME_SUBCATEGORY_PREFIX)) return void 0;
284
+ const rest = subcategory.slice(RUNTIME_SUBCATEGORY_PREFIX.length);
285
+ const separator = rest.indexOf(":");
286
+ const check = separator === -1 ? rest : rest.slice(0, separator);
287
+ return RENDER_CHECK_KINDS.find((kind) => kind === check);
288
+ }
289
+ function toEvalIssue(issue) {
290
+ if (issue.outcome === "verified" || issue.outcome === "skipped") return null;
291
+ const result = issue.outcome === "failed" ? "fail" : "warn";
292
+ const subject = issue.subject ?? "";
293
+ const subcategory = subject ? `runtime:${issue.check}:${subject}` : `runtime:${issue.check}`;
294
+ const elementHint = issue.elementHint ? ` (element: ${issue.elementHint})` : "";
295
+ const diag = issue.diagnostics;
296
+ const diagParts = [];
297
+ if (diag?.observedNativeProps?.length) {
298
+ diagParts.push(`native props: ${diag.observedNativeProps.join(", ")}`);
299
+ }
300
+ if (diag?.observedCustomProps?.length) {
301
+ diagParts.push(`custom props: ${diag.observedCustomProps.join(", ")}`);
302
+ }
303
+ if (diag?.observedJsxElements?.length) {
304
+ diagParts.push(`elements: ${diag.observedJsxElements.slice(0, 4).join(", ")}`);
305
+ }
306
+ if (diag?.actionsFiredFromClicks?.length) {
307
+ diagParts.push(`other actions fired from clicks: ${diag.actionsFiredFromClicks.join(", ")}`);
308
+ }
309
+ if (diag?.inputPriming) {
310
+ diagParts.push(
311
+ "primed" in diag.inputPriming ? `input priming: ${diag.inputPriming.primed} control(s) filled before the click` : `input priming failed: ${diag.inputPriming.error}`
312
+ );
313
+ }
314
+ if (diag?.walk) {
315
+ const w = diag.walk;
316
+ const stopped = {
317
+ explored: "every reachable control pressed",
318
+ "press-cap": "stopped at the press cap",
319
+ deadline: "stopped at the time budget",
320
+ "no-mount": "the card could not be mounted for the walk"
321
+ }[w.stoppedBy];
322
+ const named = w.namedControlSeen ? "a control naming the action rendered, but pressing it did not dispatch the action" : "no screen rendered a control naming the action";
323
+ const last = w.lastPressed.length ? `; last pressed: ${w.lastPressed.join(", ")}` : "";
324
+ diagParts.push(`walk: ${w.presses} press(es) across ${w.screens} screen(s), ${stopped}; ${named}${last}`);
325
+ }
326
+ const diagSuffix = diagParts.length ? ` [observed: ${diagParts.join("; ")}]` : "";
327
+ switch (issue.check) {
328
+ case "render-no-throw":
329
+ return {
330
+ tier: 0,
331
+ result,
332
+ category: "crash",
333
+ subcategory,
334
+ severity: "critical",
335
+ description: `Component crashed at runtime: ${issue.reason}`,
336
+ fix: classifyRenderCrashFix(issue.reason)
337
+ };
338
+ case "optional-props-omitted":
339
+ return {
340
+ tier: 0,
341
+ result,
342
+ category: "crash",
343
+ subcategory,
344
+ severity: "critical",
345
+ description: `Component crashed when optional props were omitted: ${issue.reason}`,
346
+ fix: `Guard every optional prop before member access (props.${subject.split(",")[0]?.trim() ?? "x"}?.map(...), a default via destructuring, or an early empty-state return). Optional props (no \`required: true\` in the contract) may be absent at runtime even though the harness fills them.`
347
+ };
348
+ case "action-wiring": {
349
+ const fix = issue.outcome === "unverified" ? `Source shows the action callback flowing into a non-native or custom-component prop. If wiring is intentional (e.g., Dropdown.onChange, drag-drop), this warn is informational \u2014 manual/browser verification is required to confirm. Otherwise wire to a native onClick={() => ${subject}(payload)} on <button> or design-system <Button>.` : `Wire ${subject}() to a native event prop. Common fix: <Button onClick={() => ${subject}(payload)}>Label</Button>. Source-AST analysis didn't find this wiring in your JSX.`;
350
+ return {
351
+ tier: 0,
352
+ result,
353
+ category: "contract",
354
+ subcategory,
355
+ severity: result === "fail" ? "critical" : "major",
356
+ description: `${issue.reason}${elementHint}${diagSuffix}`,
357
+ fix
358
+ };
359
+ }
360
+ case "selection-identity":
361
+ return {
362
+ tier: 0,
363
+ result,
364
+ category: "contract",
365
+ subcategory,
366
+ severity: "critical",
367
+ description: `${issue.reason}${elementHint}${diagSuffix}`,
368
+ fix: `Key the action payload (and any selection state) on the item's ID from the data, never on its display text. Common fix: map over items and pass the item's id into the handler \u2014 onClick={() => ${subject}({ ...payload, id: item.id })} \u2014 and store selection as the id (setSelected(item.id)), not the label.`
369
+ };
370
+ case "prop-sensitivity":
371
+ return {
372
+ tier: 0,
373
+ result,
374
+ category: "contract",
375
+ subcategory,
376
+ severity: "critical",
377
+ description: `${issue.reason}${diagSuffix}`,
378
+ fix: `Derive the display AND any logic from props.${subject} \u2014 render {props.${subject}} and branch on the prop's value, never on the literal value the request happened to mention (e.g. props.${subject} ?? 'January' followed by January-special-cased logic bakes the request into the component). The contract delivers the value; trust it.`
379
+ };
380
+ case "prop-coverage":
381
+ return {
382
+ tier: 0,
383
+ result,
384
+ category: "contract",
385
+ subcategory,
386
+ description: `${issue.reason}${diagSuffix}`,
387
+ fix: `Render props.${subject} somewhere in the JSX (e.g., <Text>{props.${subject}}</Text>). If you display a derived/formatted version, this warn may be a false positive.`
388
+ };
389
+ case "stream-rerender":
390
+ return {
391
+ tier: 0,
392
+ result,
393
+ category: "contract",
394
+ subcategory,
395
+ description: `${issue.reason}${diagSuffix}`,
396
+ fix: `Subscribe with const ${subject} = useStream('${subject}'); render ${subject}.latest && <Text>{${subject}.latest.field}</Text> or .all.map(...).`
397
+ };
398
+ }
399
+ }
400
+
401
+ // src/harness/check/runtime-render/index.ts
402
+ async function warmupRuntimeRenderProbe() {
403
+ const start = Date.now();
404
+ let loaded = 0;
405
+ let missing = 0;
406
+ const tryLoad = async (specifier) => {
407
+ try {
408
+ await import(specifier);
409
+ loaded += 1;
410
+ } catch {
411
+ missing += 1;
412
+ }
413
+ };
414
+ installProductionActShim();
415
+ await Promise.all([
416
+ tryLoad("happy-dom"),
417
+ tryLoad("@testing-library/react"),
418
+ tryLoad("@testing-library/user-event"),
419
+ tryLoad("@ggui-ai/wire")
420
+ ]);
421
+ return { ms: Date.now() - start, loaded, missing };
422
+ }
423
+ var WARMUP_COMPONENT = "export default function Warmup() { return <div>warm</div>; }";
424
+ var RUNTIME_RENDER_WARMUP_FAILURE_KINDS = ["incomplete", "blocking", "spawn"];
425
+ async function warmupRuntimeRenderWorker(bounds) {
426
+ const start = Date.now();
427
+ try {
428
+ const { runRenderCheckViaWorker } = await import('./render-check-host-ZNIS6BJ5.js');
429
+ const result = await runRenderCheckViaWorker(
430
+ { sourceCode: WARMUP_COMPONENT, mockupProps: {}, contract: {} },
431
+ bounds !== void 0 ? { bounds } : {}
432
+ );
433
+ const ms = Date.now() - start;
434
+ if (result.incomplete !== void 0) {
435
+ return {
436
+ ok: false,
437
+ ms,
438
+ kind: "incomplete",
439
+ reason: `the warm-up check did not finish within ${result.incomplete.boundMs} ms (stopped at ${result.incomplete.elapsedMs} ms)`
440
+ };
441
+ }
442
+ const blocking = result.issues.find(
443
+ (i) => i.outcome === "failed" || i.outcome === "unverified"
444
+ );
445
+ if (blocking !== void 0) {
446
+ return { ok: false, ms, kind: "blocking", reason: `${blocking.check} ${blocking.outcome}: ${blocking.reason}` };
447
+ }
448
+ return { ok: true, ms };
449
+ } catch (err) {
450
+ return {
451
+ ok: false,
452
+ ms: Date.now() - start,
453
+ kind: "spawn",
454
+ reason: err instanceof Error ? err.message : String(err)
455
+ };
456
+ }
457
+ }
458
+
459
+ export { DEFAULT_RUNTIME_RENDER_CHECK, RUNTIME_RENDER_WARMUP_FAILURE_KINDS, classifyRenderCrashFix, createRuntimeRenderCheck, isRecoverableRenderCrash, parseRuntimeSubcategory, prepareMockupProps, warmupRuntimeRenderProbe, warmupRuntimeRenderWorker };
460
+ //# sourceMappingURL=chunk-BA4QYA6E.js.map
461
+ //# sourceMappingURL=chunk-BA4QYA6E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/harness/check/runtime-render/prepare-mockup.ts","../src/harness/check/runtime-render/adapter.ts","../src/harness/check/runtime-render/index.ts"],"names":[],"mappings":";;;;AAgEO,SAAS,mBAAmB,KAAA,EAA8C;AAC/E,EAAA,MAAM,EAAE,QAAA,EAAU,YAAA,EAAa,GAAI,KAAA;AACnC,EAAA,MAAM,YAAY,QAAA,EAAU,SAAA;AAE5B,EAAA,MAAM,QAAoB,EAAC;AAC3B,EAAA,MAAM,SAAuC,EAAC;AAC9C,EAAA,MAAM,WAAqB,EAAC;AAE5B,EAAA,IAAI,CAAC,SAAA,IAAa,CAAC,SAAA,CAAU,UAAA,EAAY;AAEvC,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,MAAA,CAAO,MAAA,CAAO,OAAO,YAAY,CAAA;AACjC,MAAA,KAAA,MAAW,KAAK,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,EAAG,MAAA,CAAO,CAAC,CAAA,GAAI,SAAA;AAAA,IACzD;AACA,IAAA,OAAO,EAAE,KAAA,EAAO,MAAA,EAAQ,QAAA,EAAS;AAAA,EACnC;AAEA,EAAA,KAAA,MAAW,CAAC,KAAK,KAAK,CAAA,IAAK,OAAO,OAAA,CAAQ,SAAA,CAAU,UAAU,CAAA,EAAG;AAE/D,IAAA,IAAI,gBAAgB,MAAA,CAAO,SAAA,CAAU,eAAe,IAAA,CAAK,YAAA,EAAc,GAAG,CAAA,EAAG;AAC3E,MAAA,KAAA,CAAM,GAAG,CA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OAAO,MAAA,CAAO,IAAA;AAAA,MAC7B,CAAC,CAAA,KAAM,CAAA,CAAE,OAAA,KAAY,QAAA,IAAY,EAAE,OAAA,KAAY;AAAA,KACjD;AACA,IAAA,IAAI,aAAa,KAAA,CAAA,EAAW;AAC1B,MAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,EAAA,EAAI,IAAA,EAAM,YAAY,MAAA,EAAQ,CAAA,EAAG,QAAA,CAAS,KAAK,IAAI,QAAA,CAAS,OAAO,CAAA,EAAA,EAAK,QAAA,CAAS,MAAM,CAAA,CAAA,EAAG;AAAA,IAChH;AACA,IAAA,OAAO,EAAE,EAAA,EAAI,IAAA,EAAM,EAAA,EAAG;AAAA,EACxB,SAAS,GAAA,EAAK;AAGZ,IAAA,OAAO;AAAA,MACL,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI,IAAA,CAAK,GAAA,EAAI,GAAI,KAAA;AAAA,MACjB,IAAA,EAAM,OAAA;AAAA,MACN,QAAQ,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,OAAO,GAAG;AAAA,KACzD;AAAA,EACF;AACF","file":"chunk-BA4QYA6E.js","sourcesContent":["// packages/ui-gen/src/harness/check/runtime-render/prepare-mockup.ts\n//\n// Schema-first mockup props for runtime render evaluation.\n//\n// Priority:\n// 1. Existing fixture props (commit/contract `props` field) — highest fidelity\n// 2. PropEntry.example\n// 3. PropEntry.default\n// 4. Deterministic schema synthesis from JSON Schema\n// (default → example → enum[0] → typed placeholder)\n// 5. LLM fallback (deferred — v2)\n// 6. Empty fallback ({}) if all else fails\n//\n// Output is validated against the contract's `properties` shape — if a field\n// is required and ends up missing, we surface that as a synthesis warning\n// (the render check will likely fail downstream, but with a clearer signal).\n\nimport type {\n DataContract,\n JsonObject,\n JsonSchema,\n JsonValue,\n PropEntry,\n PropsSpec,\n} from \"@ggui-ai/protocol\";\n\nexport interface MockupPropsResult {\n /** The synthesized props object — pass directly into render(<Component {...props} />). */\n readonly props: JsonObject;\n /** How each field was sourced — useful for debugging eval failures. */\n readonly source: Readonly<Record<string, MockupSource>>;\n /** Synthesis warnings (missing required fields, unsupported schemas, etc.). */\n readonly warnings: readonly string[];\n}\n\nexport type MockupSource =\n | \"fixture\"\n | \"entry-example\"\n | \"entry-default\"\n | \"schema-default\"\n | \"schema-example\"\n | \"schema-enum\"\n | \"schema-synth\"\n | \"empty\";\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Public entry point\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface PrepareMockupInput {\n readonly contract: DataContract | undefined;\n /**\n * Pre-supplied fixture props (e.g., from a benchmark commit's `props` field).\n * Wins over schema synthesis when keys match.\n */\n readonly fixtureProps?: JsonObject;\n}\n\n/**\n * Synthesize a JsonObject of props matching the contract.propsSpec shape.\n *\n * Deterministic — no LLM call. Returns even if the contract is missing\n * (in which case `props` is just the fixtureProps or `{}`).\n */\nexport function prepareMockupProps(input: PrepareMockupInput): MockupPropsResult {\n const { contract, fixtureProps } = input;\n const propsSpec = contract?.propsSpec as PropsSpec | undefined;\n\n const props: JsonObject = {};\n const source: Record<string, MockupSource> = {};\n const warnings: string[] = [];\n\n if (!propsSpec || !propsSpec.properties) {\n // No props contract — mirror the fixture if present, else empty.\n if (fixtureProps) {\n Object.assign(props, fixtureProps);\n for (const k of Object.keys(fixtureProps)) source[k] = \"fixture\";\n }\n return { props, source, warnings };\n }\n\n for (const [key, entry] of Object.entries(propsSpec.properties)) {\n // Priority 1: fixture wins\n if (fixtureProps && Object.prototype.hasOwnProperty.call(fixtureProps, key)) {\n props[key] = fixtureProps[key];\n source[key] = \"fixture\";\n continue;\n }\n\n const synth = synthesizePropValue(entry, key, warnings);\n if (synth.kind === \"ok\") {\n props[key] = synth.value;\n source[key] = synth.source;\n } else if (entry.required) {\n warnings.push(`Required prop '${key}' could not be synthesized (${synth.reason})`);\n }\n // Optional props that fail synthesis are simply omitted.\n }\n\n return { props, source, warnings };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Per-prop synthesis\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype SynthOk = { kind: \"ok\"; value: JsonValue; source: MockupSource };\ntype SynthFail = { kind: \"fail\"; reason: string };\n\nfunction synthesizePropValue(\n entry: PropEntry,\n fieldName: string,\n warnings: string[],\n): SynthOk | SynthFail {\n // PropEntry-level wins over schema-level\n if (entry.example !== undefined) {\n return { kind: \"ok\", value: entry.example, source: \"entry-example\" };\n }\n if (entry.default !== undefined) {\n return { kind: \"ok\", value: entry.default, source: \"entry-default\" };\n }\n return synthesizeFromSchema(entry.schema, fieldName, warnings, 0);\n}\n\nconst MAX_DEPTH = 6;\n\nfunction synthesizeFromSchema(\n schema: JsonSchema | undefined,\n hint: string,\n warnings: string[],\n depth: number,\n /**\n * 1-based position when the value belongs to an array element (inherited\n * by the element's own fields). Every synthesized string inside an element\n * carries it, so two elements never share an id or a visible label — the\n * runtime probe's selection-identity rule (\"clicking each fired the action\n * with the same id\") is undecidable on identical items and read a correct\n * component as broken (2026-09-10, the 1.6 hello: both quick replies were\n * `Sample Id` / `Sample Label`).\n */\n ordinal?: number,\n): SynthOk | SynthFail {\n if (!schema) return { kind: \"fail\", reason: \"no schema\" };\n if (depth > MAX_DEPTH) return { kind: \"fail\", reason: \"schema too deep\" };\n\n // Schema-level overrides\n if (schema.default !== undefined) {\n return { kind: \"ok\", value: schema.default, source: \"schema-default\" };\n }\n if (schema.example !== undefined) {\n return { kind: \"ok\", value: schema.example, source: \"schema-example\" };\n }\n if (schema.enum && schema.enum.length > 0) {\n return { kind: \"ok\", value: schema.enum[0]!, source: \"schema-enum\" };\n }\n\n // Union schemas — try first branch only\n if (schema.oneOf && schema.oneOf.length > 0) {\n return synthesizeFromSchema(schema.oneOf[0], hint, warnings, depth + 1, ordinal);\n }\n if (schema.anyOf && schema.anyOf.length > 0) {\n return synthesizeFromSchema(schema.anyOf[0], hint, warnings, depth + 1, ordinal);\n }\n\n // Draft-07 type array (`['string','null']` — the canonical nullable\n // form since draft-2026-08-19): synthesize from the first non-null\n // member ('null' only when it is the sole member). The depth guard\n // above bounds the recursion.\n if (Array.isArray(schema.type)) {\n const primary = schema.type.find((t) => t !== \"null\") ?? \"null\";\n return synthesizeFromSchema({ ...schema, type: primary }, hint, warnings, depth + 1, ordinal);\n }\n\n switch (schema.type) {\n case \"string\": {\n // Format-aware placeholder\n switch (schema.format) {\n case \"date\":\n case \"date-time\":\n return { kind: \"ok\", value: \"2026-04-13T12:00:00Z\", source: \"schema-synth\" };\n case \"email\":\n return { kind: \"ok\", value: \"user@example.com\", source: \"schema-synth\" };\n case \"uri\":\n case \"url\":\n return { kind: \"ok\", value: \"https://example.com\", source: \"schema-synth\" };\n case \"uuid\":\n return { kind: \"ok\", value: \"00000000-0000-0000-0000-000000000000\", source: \"schema-synth\" };\n default: {\n // Use field name as a hint so it appears in DOM and prop-coverage check sees it.\n // Capitalize first letter for natural-looking placeholder.\n const cap = hint.charAt(0).toUpperCase() + hint.slice(1);\n // Inside an array element every string is distinct per element.\n const value = ordinal === undefined ? `Sample ${cap}` : `Sample ${cap} ${ordinal}`;\n return { kind: \"ok\", value, source: \"schema-synth\" };\n }\n }\n }\n\n case \"integer\":\n case \"number\": {\n const min = typeof schema.minimum === \"number\" ? schema.minimum : 1;\n const max = typeof schema.maximum === \"number\" ? schema.maximum : 100;\n const value = Math.min(max, Math.max(min, 42));\n return { kind: \"ok\", value, source: \"schema-synth\" };\n }\n\n case \"boolean\":\n return { kind: \"ok\", value: true, source: \"schema-synth\" };\n\n case \"null\":\n return { kind: \"ok\", value: null, source: \"schema-synth\" };\n\n case \"array\": {\n if (!schema.items) {\n return { kind: \"ok\", value: [], source: \"schema-synth\" };\n }\n // Synthesize 2 items so list-rendering checks (length > 0) pass.\n const items: JsonValue[] = [];\n for (let i = 0; i < 2; i++) {\n const itemHint = `${hint}Item${i + 1}`;\n const itemSynth = synthesizeFromSchema(schema.items, itemHint, warnings, depth + 1, i + 1);\n if (itemSynth.kind === \"ok\") {\n // Inject an `id` for list-key purposes if the item is an object lacking one.\n if (\n itemSynth.value !== null &&\n typeof itemSynth.value === \"object\" &&\n !Array.isArray(itemSynth.value) &&\n !(\"id\" in itemSynth.value)\n ) {\n (itemSynth.value as JsonObject).id = `${hint}-${i + 1}`;\n }\n items.push(itemSynth.value);\n }\n }\n return { kind: \"ok\", value: items, source: \"schema-synth\" };\n }\n\n case \"object\": {\n const obj: JsonObject = {};\n const propsMap = schema.properties ?? {};\n const required = new Set(schema.required ?? []);\n for (const [k, sub] of Object.entries(propsMap)) {\n const subSynth = synthesizeFromSchema(sub, k, warnings, depth + 1, ordinal);\n if (subSynth.kind === \"ok\") {\n obj[k] = subSynth.value;\n } else if (required.has(k)) {\n warnings.push(\n `Required object field '${hint}.${k}' could not be synthesized (${subSynth.reason})`,\n );\n }\n }\n return { kind: \"ok\", value: obj, source: \"schema-synth\" };\n }\n\n default:\n return { kind: \"fail\", reason: `unsupported schema type: ${schema.type ?? \"unknown\"}` };\n }\n}\n","// packages/ui-gen/src/harness/check/runtime-render/adapter.ts\n//\n// Adapter: convert RenderCheckResult → EvalIssue[] so runtime-render\n// integrates with the rest of the eval pipeline (axisChecks, tierChecks,\n// llmEvaluator). Fits the RuntimeRenderCheck interface from harness/types.ts.\n\nimport type { EvalIssue } from \"../../../evaluation/types-public.js\";\nimport type { RuntimeRenderCheck } from \"../../types-public.js\";\nimport {\n RENDER_CHECK_KINDS,\n runRenderCheck,\n type RenderCheckIssue,\n type RenderCheckKind,\n type RunRenderCheckOptions,\n} from \"./render-check.js\";\nimport { resolveRenderCheckHostBounds } from \"./render-check-host.js\";\nimport { prepareMockupProps } from \"./prepare-mockup.js\";\n\n/**\n * How one runtime-render check instance runs its isolated worker\n * (ggui#1380). A serving deployment sets the probe's wall-clock bound,\n * worker heap and concurrency here; every field omitted is the evaluation\n * lane's behaviour — the host's default bounds and no concurrency cap.\n */\nexport interface RuntimeRenderProbeConfig {\n /** Wall-clock bound of one isolated check, ms. Default: the host's (30 000). */\n readonly timeoutMs?: number;\n /** V8 heap cap of the worker, MB. Default: the host's (512). */\n readonly heapMb?: number;\n /**\n * Live workers this instance may have at once. The (K+1)th check waits\n * in FIFO order and spawns only when a slot frees; a check that throws\n * releases its slot. Default: unbounded. Must be a positive integer.\n */\n readonly maxConcurrent?: number;\n}\n\n/**\n * K-slot FIFO limiter. `undefined` slots = no limiter (the task runs at\n * once). A slot is released in `finally`, so a rejected task never holds\n * one.\n */\nfunction createSlotLimiter(\n maxConcurrent: number | undefined\n): <T>(task: (waitedMs: number) => Promise<T>) => Promise<T> {\n if (maxConcurrent === undefined) return (task) => task(0);\n if (!Number.isInteger(maxConcurrent) || maxConcurrent < 1) {\n throw new RangeError(\n `createRuntimeRenderCheck: maxConcurrent must be a positive integer, got ${maxConcurrent}`\n );\n }\n let active = 0;\n const waiting: Array<() => void> = [];\n /** Resolves with the time the caller actually WAITED for a slot: 0 when one was free. */\n const acquire = (): Promise<number> => {\n if (active < maxConcurrent) {\n active += 1;\n return Promise.resolve(0);\n }\n const enqueuedAt = Date.now();\n return new Promise<number>((resolve) => {\n waiting.push(() => {\n active += 1;\n resolve(Date.now() - enqueuedAt);\n });\n });\n };\n const release = (): void => {\n active -= 1;\n const next = waiting.shift();\n if (next !== undefined) next();\n };\n return async (task) => {\n const waitedMs = await acquire();\n try {\n return await task(waitedMs);\n } finally {\n release();\n }\n };\n}\n\n/** `{ queuedMs }` when the check actually waited for a slot, `{}` when one was free. */\nfunction queuedField(queuedMs: number): { readonly queuedMs?: number } {\n return queuedMs > 0 ? { queuedMs } : {};\n}\n\n/** The `runRenderCheck` options a config maps to — `undefined` when no bound is set. */\nfunction toRenderCheckOptions(config: RuntimeRenderProbeConfig): RunRenderCheckOptions | undefined {\n if (config.timeoutMs === undefined && config.heapMb === undefined) return undefined;\n return {\n bounds: {\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n ...(config.heapMb !== undefined ? { heapMb: config.heapMb } : {}),\n },\n };\n}\n\n/**\n * Build a runtime-render check instance. One FIFO limiter per instance;\n * the bounds reach `runRenderCheck` on every run. `createRuntimeRenderCheck()`\n * with no config is {@link DEFAULT_RUNTIME_RENDER_CHECK}'s behaviour.\n */\nexport function createRuntimeRenderCheck(\n config: RuntimeRenderProbeConfig = {}\n): RuntimeRenderCheck {\n const limit = createSlotLimiter(config.maxConcurrent);\n const options = toRenderCheckOptions(config);\n // A bad bound is refused here, at construction, never at the first probe.\n if (options !== undefined) resolveRenderCheckHostBounds(options.bounds);\n return {\n id: \"runtime-render\",\n run: async (input) => {\n const { sourceCode, compiledCode, contract, fixtureProps } = input;\n\n // Nothing to render / no contract surface to verify — the probe has\n // no subject, which is different from the probe failing to run.\n if (compiledCode === null) {\n return { status: \"not-applicable\", issues: [], reason: \"no compiled code\" };\n }\n if (!contract) {\n return { status: \"not-applicable\", issues: [], reason: \"no contract surface\" };\n }\n\n const mockup = prepareMockupProps({ contract, fixtureProps });\n\n // ggui#1380 — the adapter's own clock around the check: every status\n // that reached the check (`ran`, `timed-out`, `infra-skipped`) reports\n // how long it took, so a reader of the probe meta can tell a 2 s probe\n // from a 30 s one on the same status. The two not-applicable returns\n // above carry nothing: nothing ran.\n // The clock starts when the slot is acquired, so `elapsedMs` is the\n // check's own wall-clock; the time the check actually WAITED for a slot\n // is `queuedMs` (present only when it queued) — a latency reader needs\n // the two apart exactly when a serving deployment queues more probes\n // than it has slots. A check that found a slot free carries no key.\n let queuedMs = 0;\n let t0 = Date.now();\n let result;\n try {\n result = await limit((waitedMs) => {\n queuedMs = waitedMs;\n t0 = Date.now();\n return runRenderCheck(\n {\n sourceCode,\n mockupProps: mockup.props,\n contract,\n },\n options\n );\n });\n } catch (e) {\n // Triad audit (2026-04-27): every error that escapes `runRenderCheck`\n // is an INFRA problem — happy-dom import failure, ESM/CJS interop\n // (`Dynamic require of \"events\"`), bundler name collision (`Window2\n // is not a constructor`), missing `@testing-library/react`, etc.\n // Component-level failures are caught and emitted as `RenderCheckIssue`\n // entries from inside `runRenderCheck`; they don't propagate out.\n //\n // An infra failure must never become an eval issue (the coding\n // agent can't fix the environment — pre-2026-04-27 that phantom\n // issue dragged every score-below-80 cell's eval-fix loop), but it\n // must also never be silent to scoring: ggui#403 found the bench\n // reporting `probe_pass 3/3` on cells where this branch fired on\n // every invocation. The `infra-skipped` status is the No-Silent-\n // Block channel — consumers surface it as did-not-run, never pass.\n const message = e instanceof Error ? e.message : String(e);\n console.warn(`[runtime-render] probe skipped — infra failure: ${message}`);\n return { status: \"infra-skipped\", issues: [], reason: message, elapsedMs: Date.now() - t0, ...queuedField(queuedMs) };\n }\n\n const hostLoad = result.stats.hostLoad;\n const load = hostLoad !== undefined ? { hostLoad } : {};\n\n // ggui#1299: a check that ran out of wall-clock time is not a verdict on\n // the component. It becomes the `timed-out` status (did-not-run, never a\n // pass, never a crash), never an eval issue — so the coding agent is never\n // told to fix a crash that did not happen.\n if (result.incomplete !== undefined) {\n const { elapsedMs, boundMs } = result.incomplete;\n const loadNote =\n hostLoad !== undefined\n ? `; host load ${hostLoad.start.toFixed(1)} → ${hostLoad.end.toFixed(1)} on ${hostLoad.cores} CPUs`\n : \"\";\n const reason = `render check did not finish within ${boundMs} ms (stopped at ${elapsedMs} ms)${loadNote}`;\n console.warn(`[runtime-render] probe timed out — ${reason}`);\n // One clock for every status that reached the worker: the adapter's\n // wall-clock around the check. The worker's own reading survives in\n // `reason` (\"stopped at N ms\").\n return { status: \"timed-out\", issues: [], reason, elapsedMs: Date.now() - t0, ...queuedField(queuedMs), ...load };\n }\n\n return {\n status: \"ran\",\n issues: result.issues.map(toEvalIssue).filter((x): x is EvalIssue => x !== null),\n elapsedMs: Date.now() - t0,\n ...queuedField(queuedMs),\n renderMs: result.stats.renderMs,\n ...load,\n // ggui#1398: report-only — carried to the probe's meta for the bench, never an issue.\n ...(result.stats.pendingAffordance !== undefined ? { pendingAffordance: result.stats.pendingAffordance } : {}),\n };\n },\n };\n}\n\n/** The evaluation lane's instance: the host's default bounds, no concurrency cap. */\nexport const DEFAULT_RUNTIME_RENDER_CHECK: RuntimeRenderCheck = createRuntimeRenderCheck();\n\n/**\n * Map a runtime-render crash reason to a class-specific fix string.\n *\n * The default fix (\"add null guards on optional props…\") is too generic\n * for the LLM to act on. Observed crash classes from n=3 benches:\n * - \"Too many re-renders\" / \"Maximum update depth exceeded\" — setState\n * during render, or in a useEffect with missing/unstable deps. The\n * diagnosis MUST point at useEffect/useState patterns, not null guards.\n * - \"Cannot access 'X' before initialization\" — TDZ, usually from\n * referencing a `let`/`const` in a useEffect deps array (or default\n * value) before its declaration line. Fix is reorder, not null-guard.\n * - \"X is not defined\" — typo or missing destructure. Fix is grep + fix\n * the symbol, not null-guard.\n * - \"X is not iterable\" / \"Cannot read property … of undefined/null\" —\n * defaulting/optional-chaining; the original generic fix applies.\n */\n/**\n * Public probe-classification surface for the in-loop runtime probe.\n *\n * Two helpers:\n * - `classifyRenderCrashFix(reason)` returns the class-specific fix\n * string. Exported so the eval-round runner can build a\n * `[runtime]` violation for the coding agent at exit-decision time.\n * - `isRecoverableRenderCrash(reason)` is a boolean variant — true\n * when `classifyRenderCrashFix` returns a CLASS-SPECIFIC string\n * (i.e., one of: re-render loop, TDZ, undeclared symbol, non-array\n * iteration, null/undefined access). False when the reason falls\n * through to the generic fallback.\n *\n * \"Recoverable\" is harness terminology, not a runtime certainty: it\n * means the LLM has a reasonable chance of fixing the crash given the\n * class-specific advice. The generic fallback (\"add null guards on\n * optional props…\") is too vague to recover from in one turn.\n */\nconst CLASS_SPECIFIC_PATTERNS: ReadonlyArray<RegExp> = [\n /too many re-renders/i,\n /maximum update depth/i,\n /infinite render loop/i,\n /cannot access\\s+'[^']+'\\s+before initialization/i,\n /\\b\\w+ is not defined\\b/i,\n /is not iterable/i,\n /symbol\\(symbol\\.iterator\\)/i,\n /cannot read propert(?:y|ies) of (?:undefined|null)/i,\n /undefined is not/i,\n /null is not/i,\n];\n\nexport function isRecoverableRenderCrash(reason: string): boolean {\n return CLASS_SPECIFIC_PATTERNS.some((rx) => rx.test(reason));\n}\n\nexport function classifyRenderCrashFix(reason: string): string {\n const r = reason.toLowerCase();\n if (\n r.includes(\"too many re-renders\") ||\n r.includes(\"maximum update depth\") ||\n r.includes(\"infinite render loop\")\n ) {\n return (\n \"Find the setState/dispatch call in your render body or useEffect. \" +\n \"Either: (a) move the setState into an event handler, (b) add a proper \" +\n \"useEffect dependency array so it doesn't fire every render, or (c) \" +\n \"guard the setState with an equality check `if (next !== current) setX(next)`. \" +\n \"Do NOT call setState in render or useEffect-without-deps.\"\n );\n }\n if (r.includes(\"cannot access\") && r.includes(\"before initialization\")) {\n const symMatch = reason.match(/'([^']+)'/);\n const sym = symMatch ? symMatch[1] : \"the variable\";\n return (\n `Temporal-dead-zone error on \\`${sym}\\`. You're referencing ${sym} ` +\n `(likely in a useEffect dependency array or a default value) BEFORE ` +\n `its \\`const\\`/\\`let\\` declaration. Move the declaration of ${sym} ` +\n `to the top of the component body, before any useEffect/useMemo/` +\n `useCallback that reads it.`\n );\n }\n if (r.includes(\"is not defined\")) {\n const symMatch = reason.match(/(\\w+) is not defined/);\n const sym = symMatch ? symMatch[1] : \"the symbol\";\n return (\n `ReferenceError: \\`${sym}\\` is used in JSX/expression but never ` +\n `declared. Either: (a) add a \\`const ${sym} = ...\\` declaration in ` +\n `the component body, (b) destructure it from props/state, or (c) ` +\n `fix the typo if you meant a similarly-named local.`\n );\n }\n if (r.includes(\"is not iterable\") || r.includes(\"symbol(symbol.iterator)\")) {\n return (\n \"Render iterated over a non-array. Find the `for...of`, `[...spread]`, \" +\n \"or `.map`/`.filter`/`.reduce` call that crashed and either: (a) \" +\n \"default the value to `[]` (`const items = props.items ?? []`), or \" +\n \"(b) check it's an array before iterating (`Array.isArray(x) && ...`).\"\n );\n }\n if (r.includes(\"cannot read\") || r.includes(\"undefined is not\") || r.includes(\"null is not\")) {\n return (\n \"Null/undefined access. Add optional chaining (`obj?.field`) and \" +\n \"default values for optional props/state before reading nested fields. \" +\n \"Check your destructure patterns — destructuring undefined throws.\"\n );\n }\n // Fallback for unrecognized crash classes — keep the original advice.\n return (\n \"Add null guards on optional props, handle empty arrays/strings, \" +\n \"and verify all hook outputs before destructuring.\"\n );\n}\n\n/** The prefix every probe issue's subcategory carries: `runtime:<check>[:<subject>]`. */\nconst RUNTIME_SUBCATEGORY_PREFIX = \"runtime:\";\n\n/**\n * The check a probe issue's subcategory names (ggui#1380) — the inverse of\n * the `runtime:<check>[:<subject>]` form {@link toEvalIssue} writes, so a\n * round can list WHICH checks failed from the issues alone. `undefined` for\n * anything that is not a probe subcategory naming a member of\n * {@link RENDER_CHECK_KINDS} (an axis check's subcategory, a did-not-run\n * code such as `runtime:probe-timeout`, a bare check name).\n */\nexport function parseRuntimeSubcategory(subcategory: string): RenderCheckKind | undefined {\n if (!subcategory.startsWith(RUNTIME_SUBCATEGORY_PREFIX)) return undefined;\n const rest = subcategory.slice(RUNTIME_SUBCATEGORY_PREFIX.length);\n const separator = rest.indexOf(\":\");\n const check = separator === -1 ? rest : rest.slice(0, separator);\n return RENDER_CHECK_KINDS.find((kind) => kind === check);\n}\n\n/**\n * One probe finding → the eval issue the loop feeds back and the metadata\n * counts. Exported for the pin that every switch case below is a member of\n * {@link RENDER_CHECK_KINDS} and round-trips through\n * {@link parseRuntimeSubcategory}.\n */\nexport function toEvalIssue(issue: RenderCheckIssue): EvalIssue | null {\n // verified → no issue (silent pass)\n if (issue.outcome === \"verified\" || issue.outcome === \"skipped\") return null;\n\n // unverified → warn (non-blocking — wiring may exist, just not deterministically simulable)\n // failed → fail (blocker — strong evidence the wiring should work but didn't)\n const result: \"fail\" | \"warn\" = issue.outcome === \"failed\" ? \"fail\" : \"warn\";\n\n const subject = issue.subject ?? \"\";\n const subcategory = subject ? `runtime:${issue.check}:${subject}` : `runtime:${issue.check}`;\n const elementHint = issue.elementHint ? ` (element: ${issue.elementHint})` : \"\";\n\n // Build a diagnostic suffix that gives the coding agent observable context.\n const diag = issue.diagnostics;\n const diagParts: string[] = [];\n if (diag?.observedNativeProps?.length) {\n diagParts.push(`native props: ${diag.observedNativeProps.join(\", \")}`);\n }\n if (diag?.observedCustomProps?.length) {\n diagParts.push(`custom props: ${diag.observedCustomProps.join(\", \")}`);\n }\n if (diag?.observedJsxElements?.length) {\n diagParts.push(`elements: ${diag.observedJsxElements.slice(0, 4).join(\", \")}`);\n }\n if (diag?.actionsFiredFromClicks?.length) {\n diagParts.push(`other actions fired from clicks: ${diag.actionsFiredFromClicks.join(\", \")}`);\n }\n if (diag?.inputPriming) {\n // ggui#1187: an input-gated action that \"did not dispatch\" reads\n // differently beside \"primed 0\" / a priming error than beside \"primed 1\".\n diagParts.push(\n \"primed\" in diag.inputPriming\n ? `input priming: ${diag.inputPriming.primed} control(s) filled before the click`\n : `input priming failed: ${diag.inputPriming.error}`\n );\n }\n if (diag?.walk) {\n // ggui#1652: how far the walk over the card's screens got, so a\n // multi-step card reads differently from a control that never rendered.\n const w = diag.walk;\n const stopped = {\n explored: \"every reachable control pressed\",\n \"press-cap\": \"stopped at the press cap\",\n deadline: \"stopped at the time budget\",\n \"no-mount\": \"the card could not be mounted for the walk\",\n }[w.stoppedBy];\n const named = w.namedControlSeen\n ? \"a control naming the action rendered, but pressing it did not dispatch the action\"\n : \"no screen rendered a control naming the action\";\n const last = w.lastPressed.length ? `; last pressed: ${w.lastPressed.join(\", \")}` : \"\";\n diagParts.push(`walk: ${w.presses} press(es) across ${w.screens} screen(s), ${stopped}; ${named}${last}`);\n }\n const diagSuffix = diagParts.length ? ` [observed: ${diagParts.join(\"; \")}]` : \"\";\n\n switch (issue.check) {\n case \"render-no-throw\":\n return {\n tier: 0,\n result,\n category: \"crash\",\n subcategory,\n severity: \"critical\",\n description: `Component crashed at runtime: ${issue.reason}`,\n fix: classifyRenderCrashFix(issue.reason),\n };\n\n case \"optional-props-omitted\":\n // Same crash class as render-no-throw, surfaced by the second\n // render pass with optional props stripped (ggui#528): the wire\n // gate only requires `required: true` props, so a legitimate\n // render may omit these and the component must survive it.\n return {\n tier: 0,\n result,\n category: \"crash\",\n subcategory,\n severity: \"critical\",\n description: `Component crashed when optional props were omitted: ${issue.reason}`,\n fix:\n `Guard every optional prop before member access (props.${subject.split(\",\")[0]?.trim() ?? \"x\"}?.map(...), ` +\n `a default via destructuring, or an early empty-state return). Optional props (no \\`required: true\\` in the contract) ` +\n `may be absent at runtime even though the harness fills them.`,\n };\n\n case \"action-wiring\": {\n const fix =\n issue.outcome === \"unverified\"\n ? `Source shows the action callback flowing into a non-native or custom-component prop. If wiring is intentional (e.g., Dropdown.onChange, drag-drop), this warn is informational — manual/browser verification is required to confirm. Otherwise wire to a native onClick={() => ${subject}(payload)} on <button> or design-system <Button>.`\n : `Wire ${subject}() to a native event prop. Common fix: <Button onClick={() => ${subject}(payload)}>Label</Button>. Source-AST analysis didn't find this wiring in your JSX.`;\n return {\n tier: 0,\n result,\n category: \"contract\",\n subcategory,\n severity: result === \"fail\" ? \"critical\" : \"major\",\n description: `${issue.reason}${elementHint}${diagSuffix}`,\n fix,\n };\n }\n\n case \"selection-identity\":\n return {\n tier: 0,\n result,\n category: \"contract\",\n subcategory,\n severity: \"critical\",\n description: `${issue.reason}${elementHint}${diagSuffix}`,\n fix:\n `Key the action payload (and any selection state) on the item's ID from the data, never on its display text. ` +\n `Common fix: map over items and pass the item's id into the handler — onClick={() => ${subject}({ ...payload, id: item.id })} — ` +\n `and store selection as the id (setSelected(item.id)), not the label.`,\n };\n\n case \"prop-sensitivity\":\n return {\n tier: 0,\n result,\n category: \"contract\",\n subcategory,\n severity: \"critical\",\n description: `${issue.reason}${diagSuffix}`,\n fix:\n `Derive the display AND any logic from props.${subject} — render {props.${subject}} and branch on the prop's value, ` +\n `never on the literal value the request happened to mention (e.g. props.${subject} ?? 'January' followed by ` +\n `January-special-cased logic bakes the request into the component). The contract delivers the value; trust it.`,\n };\n\n case \"prop-coverage\":\n return {\n tier: 0,\n result,\n category: \"contract\",\n subcategory,\n description: `${issue.reason}${diagSuffix}`,\n fix: `Render props.${subject} somewhere in the JSX (e.g., <Text>{props.${subject}}</Text>). If you display a derived/formatted version, this warn may be a false positive.`,\n };\n\n case \"stream-rerender\":\n return {\n tier: 0,\n result,\n category: \"contract\",\n subcategory,\n description: `${issue.reason}${diagSuffix}`,\n fix: `Subscribe with const ${subject} = useStream('${subject}'); render ${subject}.latest && <Text>{${subject}.latest.field}</Text> or .all.map(...).`,\n };\n }\n}\n","// packages/ui-gen/src/harness/check/runtime-render/index.ts\n//\n// Public surface for runtime render evaluation.\n//\n// runRenderCheck() takes a compiled component + mockup props + contract,\n// renders it in happy-dom with a probe-backed WireConfig, and verifies:\n// - it renders without throw (block)\n// - declared actions fire when the bound UI is clicked (block)\n// - declared props appear in the DOM (warn)\n// - declared stream events update the DOM when emitted (warn)\n\nimport { installProductionActShim } from \"./production-act-shim.js\";\nimport type { RenderCheckHostBounds } from \"./render-check-host.js\";\n\nexport {\n RENDER_CHECK_KINDS,\n runRenderCheck,\n type RenderCheckKind,\n type RenderCheckResult,\n type RenderCheckIssue,\n} from \"./render-check.js\";\nexport { createProbe, createProbeWireConfig, type Probe } from \"./probe.js\";\nexport { prepareMockupProps, type MockupPropsResult } from \"./prepare-mockup.js\";\nexport {\n DEFAULT_RUNTIME_RENDER_CHECK,\n classifyRenderCrashFix,\n createRuntimeRenderCheck,\n isRecoverableRenderCrash,\n parseRuntimeSubcategory,\n type RuntimeRenderProbeConfig,\n} from \"./adapter.js\";\nexport type { RenderCheckHostBounds, RenderCheckHostOptions } from \"./render-check-host.js\";\n\n/**\n * Pre-warm the runtime-render probe's runtime dependencies so the first\n * actual probe call hits a warm Node module cache.\n *\n * The probe lazily loads `happy-dom`, `@testing-library/react`,\n * `@testing-library/user-event`, and `@ggui-ai/wire` on first invocation\n * — total cold cost ~700-1500ms. Bench runners can call this once at\n * startup to amortize that cost; subsequent per-cell probe calls fall\n * to ~50-200ms.\n *\n * Resolves these specifiers from THIS module's filesystem location, so\n * Node walks up from `packages/ui-gen/dist/harness/check/runtime-render/`\n * to find them in `packages/ui-gen/node_modules/...`. Bench callers\n * cannot pre-import them directly — they aren't in the bench package's\n * own `node_modules`.\n *\n * Fire-and-forget. If a dep is missing the per-cell probe will surface\n * the error on first use; pre-warm just no-ops on import failure.\n *\n * Returns the wall-clock spent loading.\n */\nexport async function warmupRuntimeRenderProbe(): Promise<{\n ms: number;\n loaded: number;\n missing: number;\n}> {\n const start = Date.now();\n let loaded = 0;\n let missing = 0;\n const tryLoad = async (specifier: string) => {\n try {\n await import(specifier);\n loaded += 1;\n } catch {\n missing += 1;\n }\n };\n // Must run before RTL's first import in this process — hosts that\n // call this warmup at process start (server-side blueprint\n // validation) land RTL in the module cache, with its act snapshot\n // taken, here — long before the first real probe call. See\n // production-act-shim.ts's docstring for why.\n installProductionActShim();\n await Promise.all([\n tryLoad(\"happy-dom\"),\n tryLoad(\"@testing-library/react\"),\n tryLoad(\"@testing-library/user-event\"),\n tryLoad(\"@ggui-ai/wire\"),\n ]);\n return { ms: Date.now() - start, loaded, missing };\n}\n\n/**\n * The component the boot warm renders: a constant element, an empty\n * contract — nothing to click, nothing to cover, one compile and one\n * render in the worker.\n */\nconst WARMUP_COMPONENT = \"export default function Warmup() { return <div>warm</div>; }\";\n\n/**\n * Why a worker warm-up failed (ggui#1839), one kind per exit of\n * {@link warmupRuntimeRenderWorker}:\n *\n * - `incomplete`: the check started and ran out of its bound before it\n * finished. The worker may be fine and the machine slow (a cold node's\n * first spawn); it says nothing about whether a check can pass.\n * - `blocking`: the check ran to an end and reported a `failed` or\n * `unverified` issue: the worker cannot render a trivial component.\n * - `spawn`: the spawn layer refused to run the worker at all (an invalid\n * bound, a missing binary).\n *\n * Branch on this, never on `reason`, which is prose for a human.\n */\nexport const RUNTIME_RENDER_WARMUP_FAILURE_KINDS = [\"incomplete\", \"blocking\", \"spawn\"] as const;\nexport type RuntimeRenderWarmupFailureKind = (typeof RUNTIME_RENDER_WARMUP_FAILURE_KINDS)[number];\n\n/** The result of {@link warmupRuntimeRenderWorker}. */\nexport type RuntimeRenderWorkerWarmup =\n | { ok: true; ms: number }\n | { ok: false; ms: number; kind: RuntimeRenderWarmupFailureKind; reason: string };\n\n/**\n * Warm the PROCESS that runs every probe (ggui#1380): spawn one real check\n * worker on a trivial component through the same host every probe uses.\n * Afterwards the node binary, the worker's module tree and esbuild's\n * service have all run once on this machine (OS page cache warm), and the\n * result says whether that process can run a check at all — which\n * `warmupRuntimeRenderProbe` (an import in THIS process) cannot tell.\n *\n * `bounds` are the subprocess bounds for the one run; a serving deployment\n * passes the same bounds it will probe with. Never throws: a worker that\n * cannot run is `{ ok: false, kind, reason }`, so a boot sequence can log\n * it and decide by `kind`, instead of dying in a fire-and-forget.\n */\nexport async function warmupRuntimeRenderWorker(\n bounds?: Partial<RenderCheckHostBounds>\n): Promise<RuntimeRenderWorkerWarmup> {\n const start = Date.now();\n try {\n // Lazy: the host pulls `@ggui-ai/sandbox` (spawn machinery); keep it off\n // the import graph of everything that only needs the in-process check.\n const { runRenderCheckViaWorker } = await import(\"./render-check-host.js\");\n const result = await runRenderCheckViaWorker(\n { sourceCode: WARMUP_COMPONENT, mockupProps: {}, contract: {} },\n bounds !== undefined ? { bounds } : {}\n );\n const ms = Date.now() - start;\n if (result.incomplete !== undefined) {\n return {\n ok: false,\n ms,\n kind: \"incomplete\",\n reason: `the warm-up check did not finish within ${result.incomplete.boundMs} ms (stopped at ${result.incomplete.elapsedMs} ms)`,\n };\n }\n const blocking = result.issues.find(\n (i) => i.outcome === \"failed\" || i.outcome === \"unverified\"\n );\n if (blocking !== undefined) {\n return { ok: false, ms, kind: \"blocking\", reason: `${blocking.check} ${blocking.outcome}: ${blocking.reason}` };\n }\n return { ok: true, ms };\n } catch (err) {\n // The host itself never throws for a worker fault; what reaches here is\n // the spawn layer refusing to run at all (an invalid bound, no binary).\n return {\n ok: false,\n ms: Date.now() - start,\n kind: \"spawn\",\n reason: err instanceof Error ? err.message : String(err),\n };\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=chunk-DBP764GL.js.map
3
+ //# sourceMappingURL=chunk-DBP764GL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-DBP764GL.js"}
@@ -0,0 +1,41 @@
1
+ import { createHash } from 'crypto';
2
+
3
+ // src/hash.ts
4
+ function stableStringify(value) {
5
+ if (value === null) return "null";
6
+ if (typeof value === "number") return Number.isFinite(value) ? JSON.stringify(value) : "null";
7
+ if (typeof value === "string") return JSON.stringify(value);
8
+ if (typeof value === "boolean") return value ? "true" : "false";
9
+ if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
10
+ if (typeof value === "object") {
11
+ const keys = Object.keys(value).sort();
12
+ const parts = keys.map(
13
+ (k) => `${JSON.stringify(k)}:${stableStringify(value[k])}`
14
+ );
15
+ return `{${parts.join(",")}}`;
16
+ }
17
+ return "null";
18
+ }
19
+ function shortHash(input) {
20
+ return createHash("sha256").update(input).digest("hex").slice(0, 12);
21
+ }
22
+ function hashClassification(c) {
23
+ return shortHash(stableStringify({ vector: c.vector, riskTier: c.riskTier }));
24
+ }
25
+ function computeHarnessId(input) {
26
+ return shortHash(stableStringify(input));
27
+ }
28
+ function computeHarnessName(input) {
29
+ const v = input.classification.vector;
30
+ const dominantAxes = [];
31
+ if (v.state !== "none") dominantAxes.push(`state=${v.state}`);
32
+ if (v.writes !== "none") dominantAxes.push(`writes=${v.writes}`);
33
+ if (v.realtime !== "none") dominantAxes.push(`realtime=${v.realtime}`);
34
+ if (v.tooling !== "none") dominantAxes.push(`tooling=${v.tooling}`);
35
+ const axesPart = dominantAxes.length > 0 ? dominantAxes.join("+") : "passive";
36
+ return `${input.version}/${axesPart}/${input.workflowName}`;
37
+ }
38
+
39
+ export { computeHarnessId, computeHarnessName, hashClassification };
40
+ //# sourceMappingURL=chunk-DUU3ZJDQ.js.map
41
+ //# sourceMappingURL=chunk-DUU3ZJDQ.js.map