@tangle-network/agent-eval 0.129.0 → 0.130.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 (427) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -0
  3. package/dist/active-curriculum-C4mk67HP.js +214 -0
  4. package/dist/active-curriculum-C4mk67HP.js.map +1 -0
  5. package/dist/adversarial-smnADNFS.d.ts +21 -0
  6. package/dist/adversarial-smnADNFS.d.ts.map +1 -0
  7. package/dist/analyst/index.d.ts +81 -2872
  8. package/dist/analyst/index.d.ts.map +1 -0
  9. package/dist/analyst/index.js +319 -360
  10. package/dist/analyst/index.js.map +1 -1
  11. package/dist/analyst-BkTS3C58.d.ts +89 -0
  12. package/dist/analyst-BkTS3C58.d.ts.map +1 -0
  13. package/dist/analyst-LsnNpSkm.js +152 -0
  14. package/dist/analyst-LsnNpSkm.js.map +1 -0
  15. package/dist/analyze-runs-C1CavBMk.js +1067 -0
  16. package/dist/analyze-runs-C1CavBMk.js.map +1 -0
  17. package/dist/analyze-runs-FsgYCinh.d.ts +72 -0
  18. package/dist/analyze-runs-FsgYCinh.d.ts.map +1 -0
  19. package/dist/attribute-vocabulary-DLJ6303h.d.ts +54 -0
  20. package/dist/attribute-vocabulary-DLJ6303h.d.ts.map +1 -0
  21. package/dist/authenticity/index.d.ts +81 -79
  22. package/dist/authenticity/index.d.ts.map +1 -0
  23. package/dist/authenticity/index.js +209 -193
  24. package/dist/authenticity/index.js.map +1 -1
  25. package/dist/baseline-HsBvw_dk.js +550 -0
  26. package/dist/baseline-HsBvw_dk.js.map +1 -0
  27. package/dist/baseline-hG3K85h4.d.ts +125 -0
  28. package/dist/baseline-hG3K85h4.d.ts.map +1 -0
  29. package/dist/belief-state/index.d.ts +448 -1188
  30. package/dist/belief-state/index.d.ts.map +1 -0
  31. package/dist/belief-state/index.js +1617 -1709
  32. package/dist/belief-state/index.js.map +1 -1
  33. package/dist/benchmarks/index.d.ts +2 -891
  34. package/dist/benchmarks/index.js +2 -60
  35. package/dist/benchmarks-DviOvUNr.js +754 -0
  36. package/dist/benchmarks-DviOvUNr.js.map +1 -0
  37. package/dist/builder-eval/index.d.ts +150 -662
  38. package/dist/builder-eval/index.d.ts.map +1 -0
  39. package/dist/builder-eval/index.js +356 -345
  40. package/dist/builder-eval/index.js.map +1 -1
  41. package/dist/calibration-CNWWA6K8.js +94 -0
  42. package/dist/calibration-CNWWA6K8.js.map +1 -0
  43. package/dist/campaign/index.d.ts +5 -6381
  44. package/dist/campaign/index.js +3 -213
  45. package/dist/campaign-CBKZvQ1H.js +3885 -0
  46. package/dist/campaign-CBKZvQ1H.js.map +1 -0
  47. package/dist/cli.d.ts +1 -1
  48. package/dist/cli.js +164 -175
  49. package/dist/cli.js.map +1 -1
  50. package/dist/client-C97NMzqi.d.ts +581 -0
  51. package/dist/client-C97NMzqi.d.ts.map +1 -0
  52. package/dist/client-CYzbdJOZ.js +637 -0
  53. package/dist/client-CYzbdJOZ.js.map +1 -0
  54. package/dist/code-agent-session-BjkMTQ7H.js +1390 -0
  55. package/dist/code-agent-session-BjkMTQ7H.js.map +1 -0
  56. package/dist/code-agent-session-DqqgOJaz.d.ts +143 -0
  57. package/dist/code-agent-session-DqqgOJaz.d.ts.map +1 -0
  58. package/dist/concurrency-DIxRZF_J.js +85 -0
  59. package/dist/concurrency-DIxRZF_J.js.map +1 -0
  60. package/dist/contract/index.d.ts +645 -5565
  61. package/dist/contract/index.d.ts.map +1 -0
  62. package/dist/contract/index.js +1730 -1938
  63. package/dist/contract/index.js.map +1 -1
  64. package/dist/control.d.ts +3 -1030
  65. package/dist/control.js +2 -33
  66. package/dist/cost-ledger-DIgQUFZZ.js +801 -0
  67. package/dist/cost-ledger-DIgQUFZZ.js.map +1 -0
  68. package/dist/cost-ledger-Dye6jCgg.d.ts +236 -0
  69. package/dist/cost-ledger-Dye6jCgg.d.ts.map +1 -0
  70. package/dist/dataset-BvtnC8Dc.d.ts +115 -0
  71. package/dist/dataset-BvtnC8Dc.d.ts.map +1 -0
  72. package/dist/default-registry-C-vFCSEc.js +2579 -0
  73. package/dist/default-registry-C-vFCSEc.js.map +1 -0
  74. package/dist/default-registry-CNPo-Vsb.d.ts +540 -0
  75. package/dist/default-registry-CNPo-Vsb.d.ts.map +1 -0
  76. package/dist/emitter-CPBAhxum.js +266 -0
  77. package/dist/emitter-CPBAhxum.js.map +1 -0
  78. package/dist/emitter-DGQGoLyj.d.ts +113 -0
  79. package/dist/emitter-DGQGoLyj.d.ts.map +1 -0
  80. package/dist/errors-8YnH8WlF.js +64 -0
  81. package/dist/errors-8YnH8WlF.js.map +1 -0
  82. package/dist/errors-CEk209JS.d.ts +76 -0
  83. package/dist/errors-CEk209JS.d.ts.map +1 -0
  84. package/dist/eval-campaign-DEm6c8ru.js +349 -0
  85. package/dist/eval-campaign-DEm6c8ru.js.map +1 -0
  86. package/dist/execution-tracks-CpgFPpS5.js +93 -0
  87. package/dist/execution-tracks-CpgFPpS5.js.map +1 -0
  88. package/dist/exporters-q9iL-2Jf.js +148 -0
  89. package/dist/exporters-q9iL-2Jf.js.map +1 -0
  90. package/dist/extract-usage-BrQ8mCLX.js +155 -0
  91. package/dist/extract-usage-BrQ8mCLX.js.map +1 -0
  92. package/dist/failure-cluster-CqcvCcdR.d.ts +59 -0
  93. package/dist/failure-cluster-CqcvCcdR.d.ts.map +1 -0
  94. package/dist/feedback-trajectory-CVaeREXV.d.ts +340 -0
  95. package/dist/feedback-trajectory-CVaeREXV.d.ts.map +1 -0
  96. package/dist/fuzz.d.ts +320 -646
  97. package/dist/fuzz.d.ts.map +1 -0
  98. package/dist/fuzz.js +670 -618
  99. package/dist/fuzz.js.map +1 -1
  100. package/dist/hf-dataset-DBJXXoY1.js +763 -0
  101. package/dist/hf-dataset-DBJXXoY1.js.map +1 -0
  102. package/dist/hosted/index.d.ts +11 -831
  103. package/dist/hosted/index.d.ts.map +1 -0
  104. package/dist/hosted/index.js +2 -37
  105. package/dist/index-2JJSA6-r2.d.ts +926 -0
  106. package/dist/index-2JJSA6-r2.d.ts.map +1 -0
  107. package/dist/index-6N0aYmpW.d.ts +217 -0
  108. package/dist/index-6N0aYmpW.d.ts.map +1 -0
  109. package/dist/index-BAvgST_9.d.ts +131 -0
  110. package/dist/index-BAvgST_9.d.ts.map +1 -0
  111. package/dist/index-BvnJuTGD.d.ts +68 -0
  112. package/dist/index-BvnJuTGD.d.ts.map +1 -0
  113. package/dist/index-C61Wi7yg.d.ts +547 -0
  114. package/dist/index-C61Wi7yg.d.ts.map +1 -0
  115. package/dist/index-CAPUUKaM.d.ts +335 -0
  116. package/dist/index-CAPUUKaM.d.ts.map +1 -0
  117. package/dist/index-DE5fb3EC.d.ts +2244 -0
  118. package/dist/index-DE5fb3EC.d.ts.map +1 -0
  119. package/dist/index-DSC51roc.d.ts +102 -0
  120. package/dist/index-DSC51roc.d.ts.map +1 -0
  121. package/dist/index.d.ts +3755 -15555
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +11182 -11216
  124. package/dist/index.js.map +1 -1
  125. package/dist/integrity-BzRbCHzi.js +424 -0
  126. package/dist/integrity-BzRbCHzi.js.map +1 -0
  127. package/dist/integrity-rmVhXWA7.d.ts +61 -0
  128. package/dist/integrity-rmVhXWA7.d.ts.map +1 -0
  129. package/dist/judge-calibration-DFtEMlde.d.ts +146 -0
  130. package/dist/judge-calibration-DFtEMlde.d.ts.map +1 -0
  131. package/dist/ledger-core/index.d.ts +2 -0
  132. package/dist/ledger-core/index.js +2 -0
  133. package/dist/ledger-core-DtZz1RG0.js +388 -0
  134. package/dist/ledger-core-DtZz1RG0.js.map +1 -0
  135. package/dist/llm-client--GR4JbZE.js +687 -0
  136. package/dist/llm-client--GR4JbZE.js.map +1 -0
  137. package/dist/llm-client-B_nIBlYo.d.ts +290 -0
  138. package/dist/llm-client-B_nIBlYo.d.ts.map +1 -0
  139. package/dist/matrix/index.d.ts +3 -155
  140. package/dist/matrix/index.js +2 -8
  141. package/dist/matrix-BzQnu2S6.js +270 -0
  142. package/dist/matrix-BzQnu2S6.js.map +1 -0
  143. package/dist/meta-eval/index.d.ts +4 -1027
  144. package/dist/meta-eval/index.js +393 -390
  145. package/dist/meta-eval/index.js.map +1 -1
  146. package/dist/metrics-C9YY1OcL.js +239 -0
  147. package/dist/metrics-C9YY1OcL.js.map +1 -0
  148. package/dist/mint-yN2M2eh0.js +201 -0
  149. package/dist/mint-yN2M2eh0.js.map +1 -0
  150. package/dist/multi-layer-verifier-BHY1gWAc.d.ts +138 -0
  151. package/dist/multi-layer-verifier-BHY1gWAc.d.ts.map +1 -0
  152. package/dist/multishot/index.d.ts +273 -480
  153. package/dist/multishot/index.d.ts.map +1 -0
  154. package/dist/multishot/index.js +595 -548
  155. package/dist/multishot/index.js.map +1 -1
  156. package/dist/off-policy-DvgzvtIx.js +220 -0
  157. package/dist/off-policy-DvgzvtIx.js.map +1 -0
  158. package/dist/off-policy-mskQw8Mb.d.ts +153 -0
  159. package/dist/off-policy-mskQw8Mb.d.ts.map +1 -0
  160. package/dist/openapi.json +1 -1
  161. package/dist/opencode-sqlite-BGrHeDu3.js +318 -0
  162. package/dist/opencode-sqlite-BGrHeDu3.js.map +1 -0
  163. package/dist/outcome-store-BYHIuO0e.d.ts +65 -0
  164. package/dist/outcome-store-BYHIuO0e.d.ts.map +1 -0
  165. package/dist/outcome-store-ChBKlTd_.js +75 -0
  166. package/dist/outcome-store-ChBKlTd_.js.map +1 -0
  167. package/dist/paired-arms-D9D0wXj2.js +260 -0
  168. package/dist/paired-arms-D9D0wXj2.js.map +1 -0
  169. package/dist/pipelines/index.d.ts +95 -532
  170. package/dist/pipelines/index.d.ts.map +1 -0
  171. package/dist/pipelines/index.js +497 -478
  172. package/dist/pipelines/index.js.map +1 -1
  173. package/dist/pre-registration-DakwTRXk.js +96 -0
  174. package/dist/pre-registration-DakwTRXk.js.map +1 -0
  175. package/dist/propose-review-control-LhIWGzHl.js +1458 -0
  176. package/dist/propose-review-control-LhIWGzHl.js.map +1 -0
  177. package/dist/query-CJ_DX8vl.d.ts +28 -0
  178. package/dist/query-CJ_DX8vl.d.ts.map +1 -0
  179. package/dist/query-Di7eEQ79.js +83 -0
  180. package/dist/query-Di7eEQ79.js.map +1 -0
  181. package/dist/raw-provider-sink-BQd7mzyT.js +201 -0
  182. package/dist/raw-provider-sink-BQd7mzyT.js.map +1 -0
  183. package/dist/raw-provider-sink-BU29Sh8h.d.ts +134 -0
  184. package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +1 -0
  185. package/dist/redact-7Aq1ukl-.js +107 -0
  186. package/dist/redact-7Aq1ukl-.js.map +1 -0
  187. package/dist/release-report-Cz9NKH39.js +603 -0
  188. package/dist/release-report-Cz9NKH39.js.map +1 -0
  189. package/dist/release-report-mvB2G4_J.d.ts +244 -0
  190. package/dist/release-report-mvB2G4_J.d.ts.map +1 -0
  191. package/dist/replay-GnyotH0J.js +1741 -0
  192. package/dist/replay-GnyotH0J.js.map +1 -0
  193. package/dist/replay-OoidtG1E.d.ts +749 -0
  194. package/dist/replay-OoidtG1E.d.ts.map +1 -0
  195. package/dist/reporting.d.ts +6 -1312
  196. package/dist/reporting.js +6 -51
  197. package/dist/researcher-CwTdwXG1.d.ts +314 -0
  198. package/dist/researcher-CwTdwXG1.d.ts.map +1 -0
  199. package/dist/reward-hacking-eAnOsynk.d.ts +224 -0
  200. package/dist/reward-hacking-eAnOsynk.d.ts.map +1 -0
  201. package/dist/reward-hacking-qipEpKvY.js +596 -0
  202. package/dist/reward-hacking-qipEpKvY.js.map +1 -0
  203. package/dist/reward-nw2xZGZG.js +137 -0
  204. package/dist/reward-nw2xZGZG.js.map +1 -0
  205. package/dist/rl.d.ts +760 -4010
  206. package/dist/rl.d.ts.map +1 -0
  207. package/dist/rl.js +2325 -1958
  208. package/dist/rl.js.map +1 -1
  209. package/dist/rolldown-runtime-8H4AJuhK.js +14 -0
  210. package/dist/rollout/index.d.ts +3 -2087
  211. package/dist/rollout/index.js +8 -168
  212. package/dist/rollout-BOYjemfR.js +624 -0
  213. package/dist/rollout-BOYjemfR.js.map +1 -0
  214. package/dist/rubric-predictive-validity-B3xmbmS1.js +141 -0
  215. package/dist/rubric-predictive-validity-B3xmbmS1.js.map +1 -0
  216. package/dist/rubric-predictive-validity-Ku_clp_1.d.ts +74 -0
  217. package/dist/rubric-predictive-validity-Ku_clp_1.d.ts.map +1 -0
  218. package/dist/run-evidence-ClRX_8A9.d.ts +225 -0
  219. package/dist/run-evidence-ClRX_8A9.d.ts.map +1 -0
  220. package/dist/run-record-BuoE80Dq.js +467 -0
  221. package/dist/{chunk-56TAVBOK.js.map → run-record-BuoE80Dq.js.map} +1 -1
  222. package/dist/run-record-CnZu_gjl.d.ts +357 -0
  223. package/dist/run-record-CnZu_gjl.d.ts.map +1 -0
  224. package/dist/run-score-iEEAWiBY.js +41 -0
  225. package/dist/run-score-iEEAWiBY.js.map +1 -0
  226. package/dist/runtime-trajectory-1gyaTOoC.js +93 -0
  227. package/dist/runtime-trajectory-1gyaTOoC.js.map +1 -0
  228. package/dist/runtime-trajectory-BvSZcCHD.d.ts +50 -0
  229. package/dist/runtime-trajectory-BvSZcCHD.d.ts.map +1 -0
  230. package/dist/schema-BtVldJ3T.d.ts +206 -0
  231. package/dist/schema-BtVldJ3T.d.ts.map +1 -0
  232. package/dist/schema-C6DW4ZHR.js +821 -0
  233. package/dist/schema-C6DW4ZHR.js.map +1 -0
  234. package/dist/schema-CRhEY1SO.js +69 -0
  235. package/dist/schema-CRhEY1SO.js.map +1 -0
  236. package/dist/schema-Cef2cFmb.d.ts +408 -0
  237. package/dist/schema-Cef2cFmb.d.ts.map +1 -0
  238. package/dist/semantic-concept-judge-B6cWNJ2K.js +725 -0
  239. package/dist/semantic-concept-judge-B6cWNJ2K.js.map +1 -0
  240. package/dist/sequential-Br0mAPHA.js +148 -0
  241. package/dist/sequential-Br0mAPHA.js.map +1 -0
  242. package/dist/sequential-CYwq6Ff_.d.ts +141 -0
  243. package/dist/sequential-CYwq6Ff_.d.ts.map +1 -0
  244. package/dist/series-convergence-CjO2QdRW.js +43 -0
  245. package/dist/series-convergence-CjO2QdRW.js.map +1 -0
  246. package/dist/series-convergence-ofsqPWhs.d.ts +35 -0
  247. package/dist/series-convergence-ofsqPWhs.d.ts.map +1 -0
  248. package/dist/server-m5D9cvnG.js +1040 -0
  249. package/dist/server-m5D9cvnG.js.map +1 -0
  250. package/dist/skill-usage-C_pXm7lP.d.ts +534 -0
  251. package/dist/skill-usage-C_pXm7lP.d.ts.map +1 -0
  252. package/dist/skillopt-optimization-method-B7wX7XkF.d.ts +1739 -0
  253. package/dist/skillopt-optimization-method-B7wX7XkF.d.ts.map +1 -0
  254. package/dist/skillopt-optimization-method-D4ODwFVV.js +7712 -0
  255. package/dist/skillopt-optimization-method-D4ODwFVV.js.map +1 -0
  256. package/dist/statistics-Cmj6nynr.d.ts +514 -0
  257. package/dist/statistics-Cmj6nynr.d.ts.map +1 -0
  258. package/dist/statistics-CnnxdpOg.js +1437 -0
  259. package/dist/statistics-CnnxdpOg.js.map +1 -0
  260. package/dist/store-CT9YIIve.d.ts +117 -0
  261. package/dist/store-CT9YIIve.d.ts.map +1 -0
  262. package/dist/store-CxJry_cs.d.ts +229 -0
  263. package/dist/store-CxJry_cs.d.ts.map +1 -0
  264. package/dist/storyboard/index.d.ts +84 -203
  265. package/dist/storyboard/index.d.ts.map +1 -0
  266. package/dist/storyboard/index.js +609 -542
  267. package/dist/storyboard/index.js.map +1 -1
  268. package/dist/summary-report-BNs5nmXI.js +862 -0
  269. package/dist/summary-report-BNs5nmXI.js.map +1 -0
  270. package/dist/summary-report-Cj9gdw4i.d.ts +407 -0
  271. package/dist/summary-report-Cj9gdw4i.d.ts.map +1 -0
  272. package/dist/supervisor-run/index.d.ts +2 -959
  273. package/dist/supervisor-run/index.js +2 -65
  274. package/dist/supervisor-run-_lnTLM3z.js +1679 -0
  275. package/dist/supervisor-run-_lnTLM3z.js.map +1 -0
  276. package/dist/task-failure-attributes-CQZlB3et.js +311 -0
  277. package/dist/task-failure-attributes-CQZlB3et.js.map +1 -0
  278. package/dist/test-graded-scenario-BsqWLmPt.js +318 -0
  279. package/dist/test-graded-scenario-BsqWLmPt.js.map +1 -0
  280. package/dist/test-graded-scenario-D1TaI2va.d.ts +141 -0
  281. package/dist/test-graded-scenario-D1TaI2va.d.ts.map +1 -0
  282. package/dist/tools-BmuN627J.js +1085 -0
  283. package/dist/tools-BmuN627J.js.map +1 -0
  284. package/dist/trace-attributes.d.ts +2 -52
  285. package/dist/trace-attributes.js +131 -61
  286. package/dist/trace-attributes.js.map +1 -1
  287. package/dist/traces.d.ts +12 -2365
  288. package/dist/traces.js +12 -252
  289. package/dist/trajectory-D_7rLrvE.js +56 -0
  290. package/dist/trajectory-D_7rLrvE.js.map +1 -0
  291. package/dist/types-DGsxbAEd.d.ts +387 -0
  292. package/dist/types-DGsxbAEd.d.ts.map +1 -0
  293. package/dist/types-k9tZGKUg.d.ts +640 -0
  294. package/dist/types-k9tZGKUg.d.ts.map +1 -0
  295. package/dist/verdict-Dps8_okt.d.ts +37 -0
  296. package/dist/verdict-Dps8_okt.d.ts.map +1 -0
  297. package/dist/wire/index.d.ts +702 -1173
  298. package/dist/wire/index.d.ts.map +1 -0
  299. package/dist/wire/index.js +2 -81
  300. package/package.json +17 -9
  301. package/dist/benchmarks/index.js.map +0 -1
  302. package/dist/campaign/index.js.map +0 -1
  303. package/dist/chunk-2QU3YOPR.js +0 -7374
  304. package/dist/chunk-2QU3YOPR.js.map +0 -1
  305. package/dist/chunk-3OCR4R5I.js +0 -728
  306. package/dist/chunk-3OCR4R5I.js.map +0 -1
  307. package/dist/chunk-3RF76KTD.js +0 -84
  308. package/dist/chunk-3RF76KTD.js.map +0 -1
  309. package/dist/chunk-56TAVBOK.js +0 -698
  310. package/dist/chunk-5DTSBUL2.js +0 -159
  311. package/dist/chunk-5DTSBUL2.js.map +0 -1
  312. package/dist/chunk-7FO3TNPI.js +0 -232
  313. package/dist/chunk-7FO3TNPI.js.map +0 -1
  314. package/dist/chunk-7ZZMD7UK.js +0 -386
  315. package/dist/chunk-7ZZMD7UK.js.map +0 -1
  316. package/dist/chunk-BOD4O7OF.js +0 -40
  317. package/dist/chunk-BOD4O7OF.js.map +0 -1
  318. package/dist/chunk-BSO5JDQH.js +0 -2335
  319. package/dist/chunk-BSO5JDQH.js.map +0 -1
  320. package/dist/chunk-C6LXANRU.js +0 -1550
  321. package/dist/chunk-C6LXANRU.js.map +0 -1
  322. package/dist/chunk-DODXQREJ.js +0 -752
  323. package/dist/chunk-DODXQREJ.js.map +0 -1
  324. package/dist/chunk-DRYIUNWY.js +0 -622
  325. package/dist/chunk-DRYIUNWY.js.map +0 -1
  326. package/dist/chunk-E7QXT7SX.js +0 -183
  327. package/dist/chunk-E7QXT7SX.js.map +0 -1
  328. package/dist/chunk-EG66UGL4.js +0 -341
  329. package/dist/chunk-EG66UGL4.js.map +0 -1
  330. package/dist/chunk-FXTVJPYD.js +0 -576
  331. package/dist/chunk-FXTVJPYD.js.map +0 -1
  332. package/dist/chunk-G7MGMCZD.js +0 -153
  333. package/dist/chunk-G7MGMCZD.js.map +0 -1
  334. package/dist/chunk-GGE4NNQT.js +0 -65
  335. package/dist/chunk-GGE4NNQT.js.map +0 -1
  336. package/dist/chunk-H23X7XKK.js +0 -181
  337. package/dist/chunk-H23X7XKK.js.map +0 -1
  338. package/dist/chunk-HHWE3POT.js +0 -94
  339. package/dist/chunk-HHWE3POT.js.map +0 -1
  340. package/dist/chunk-HPWUNB47.js +0 -289
  341. package/dist/chunk-HPWUNB47.js.map +0 -1
  342. package/dist/chunk-IYCLP2N2.js +0 -766
  343. package/dist/chunk-IYCLP2N2.js.map +0 -1
  344. package/dist/chunk-JHCHEVET.js +0 -274
  345. package/dist/chunk-JHCHEVET.js.map +0 -1
  346. package/dist/chunk-JQSF5DQT.js +0 -701
  347. package/dist/chunk-JQSF5DQT.js.map +0 -1
  348. package/dist/chunk-K4DBDHLK.js +0 -158
  349. package/dist/chunk-K4DBDHLK.js.map +0 -1
  350. package/dist/chunk-K6N6XJJX.js +0 -306
  351. package/dist/chunk-K6N6XJJX.js.map +0 -1
  352. package/dist/chunk-M4YBQKIJ.js +0 -1040
  353. package/dist/chunk-M4YBQKIJ.js.map +0 -1
  354. package/dist/chunk-MA6HLL3S.js +0 -65
  355. package/dist/chunk-MA6HLL3S.js.map +0 -1
  356. package/dist/chunk-MAZ26DC7.js +0 -99
  357. package/dist/chunk-MAZ26DC7.js.map +0 -1
  358. package/dist/chunk-NPCTHQIO.js +0 -91
  359. package/dist/chunk-NPCTHQIO.js.map +0 -1
  360. package/dist/chunk-NY44NC4A.js +0 -1056
  361. package/dist/chunk-NY44NC4A.js.map +0 -1
  362. package/dist/chunk-OIUOT4QD.js +0 -44
  363. package/dist/chunk-OIUOT4QD.js.map +0 -1
  364. package/dist/chunk-ONWEPEDO.js +0 -57
  365. package/dist/chunk-ONWEPEDO.js.map +0 -1
  366. package/dist/chunk-OWN5NPMC.js +0 -152
  367. package/dist/chunk-OWN5NPMC.js.map +0 -1
  368. package/dist/chunk-P6FYH6K4.js +0 -1161
  369. package/dist/chunk-P6FYH6K4.js.map +0 -1
  370. package/dist/chunk-PC4UYEBM.js +0 -166
  371. package/dist/chunk-PC4UYEBM.js.map +0 -1
  372. package/dist/chunk-PC5DOSM7.js +0 -579
  373. package/dist/chunk-PC5DOSM7.js.map +0 -1
  374. package/dist/chunk-PXE2VKMX.js +0 -140
  375. package/dist/chunk-PXE2VKMX.js.map +0 -1
  376. package/dist/chunk-PZ5AY32C.js +0 -10
  377. package/dist/chunk-PZ5AY32C.js.map +0 -1
  378. package/dist/chunk-QB6BDBP2.js +0 -4464
  379. package/dist/chunk-QB6BDBP2.js.map +0 -1
  380. package/dist/chunk-RXHCETDZ.js +0 -536
  381. package/dist/chunk-RXHCETDZ.js.map +0 -1
  382. package/dist/chunk-RZTMDUO7.js +0 -49
  383. package/dist/chunk-RZTMDUO7.js.map +0 -1
  384. package/dist/chunk-SFLLL76A.js +0 -669
  385. package/dist/chunk-SFLLL76A.js.map +0 -1
  386. package/dist/chunk-SZLVEKMJ.js +0 -1446
  387. package/dist/chunk-SZLVEKMJ.js.map +0 -1
  388. package/dist/chunk-T4SQEITX.js +0 -95
  389. package/dist/chunk-T4SQEITX.js.map +0 -1
  390. package/dist/chunk-T6RLYGAD.js +0 -158
  391. package/dist/chunk-T6RLYGAD.js.map +0 -1
  392. package/dist/chunk-TJVT4QFF.js +0 -911
  393. package/dist/chunk-TJVT4QFF.js.map +0 -1
  394. package/dist/chunk-TQ7LNKZ3.js +0 -136
  395. package/dist/chunk-TQ7LNKZ3.js.map +0 -1
  396. package/dist/chunk-U4L7JRPZ.js +0 -1706
  397. package/dist/chunk-U4L7JRPZ.js.map +0 -1
  398. package/dist/chunk-U4PHLT2N.js +0 -419
  399. package/dist/chunk-U4PHLT2N.js.map +0 -1
  400. package/dist/chunk-VCZ5FQYW.js +0 -928
  401. package/dist/chunk-VCZ5FQYW.js.map +0 -1
  402. package/dist/chunk-VI2UW6B6.js +0 -162
  403. package/dist/chunk-VI2UW6B6.js.map +0 -1
  404. package/dist/chunk-VQMK5FMP.js +0 -247
  405. package/dist/chunk-VQMK5FMP.js.map +0 -1
  406. package/dist/chunk-WGXIEX7P.js +0 -116
  407. package/dist/chunk-WGXIEX7P.js.map +0 -1
  408. package/dist/chunk-WVATSFCP.js +0 -1553
  409. package/dist/chunk-WVATSFCP.js.map +0 -1
  410. package/dist/chunk-X4YIBDER.js +0 -1662
  411. package/dist/chunk-X4YIBDER.js.map +0 -1
  412. package/dist/chunk-YQN4ICPP.js +0 -355
  413. package/dist/chunk-YQN4ICPP.js.map +0 -1
  414. package/dist/chunk-ZET2UAYW.js +0 -89
  415. package/dist/chunk-ZET2UAYW.js.map +0 -1
  416. package/dist/chunk-ZHTZ4EYI.js +0 -1212
  417. package/dist/chunk-ZHTZ4EYI.js.map +0 -1
  418. package/dist/control.js.map +0 -1
  419. package/dist/hosted/index.js.map +0 -1
  420. package/dist/matrix/index.js.map +0 -1
  421. package/dist/reporting.js.map +0 -1
  422. package/dist/rollout/index.js.map +0 -1
  423. package/dist/run-campaign-OJJ7CZF4.js +0 -18
  424. package/dist/run-campaign-OJJ7CZF4.js.map +0 -1
  425. package/dist/supervisor-run/index.js.map +0 -1
  426. package/dist/traces.js.map +0 -1
  427. package/dist/wire/index.js.map +0 -1
@@ -1,366 +1,377 @@
1
- import {
2
- SandboxHarness,
3
- runTestGradedScenario
4
- } from "../chunk-K6N6XJJX.js";
5
- import {
6
- pearsonR,
7
- spearmanR
8
- } from "../chunk-ZHTZ4EYI.js";
9
- import {
10
- judgeSpans
11
- } from "../chunk-ZET2UAYW.js";
12
- import {
13
- TraceEmitter
14
- } from "../chunk-VQMK5FMP.js";
15
- import "../chunk-MA6HLL3S.js";
16
- import "../chunk-ONWEPEDO.js";
17
- import "../chunk-PZ5AY32C.js";
18
-
19
- // src/builder-eval/builder-session.ts
1
+ import { A as spearmanR, E as pearsonR } from "../statistics-CnnxdpOg.js";
2
+ import { t as TraceEmitter } from "../emitter-CPBAhxum.js";
3
+ import { a as judgeSpans } from "../query-Di7eEQ79.js";
4
+ import { r as SandboxHarness, t as runTestGradedScenario } from "../test-graded-scenario-BsqWLmPt.js";
5
+ //#region src/builder-eval/builder-session.ts
20
6
  var BuilderSession = class {
21
- store;
22
- builderEmitter;
23
- projectId;
24
- chatId;
25
- builderRunId;
26
- lastBuildRunId;
27
- defaultDriver;
28
- constructor(store, init, driver) {
29
- this.store = store;
30
- this.projectId = init.projectId;
31
- this.chatId = init.chatId ?? cryptoId();
32
- this.defaultDriver = driver;
33
- this.builderEmitter = new TraceEmitter(store);
34
- }
35
- /** Start the builder (L0) run for this chat. Returns the runId. */
36
- async startChat(scenarioId = `${this.projectId}/chat`) {
37
- await this.builderEmitter.startRun({
38
- scenarioId,
39
- projectId: this.projectId,
40
- chatId: this.chatId,
41
- layer: "builder"
42
- });
43
- this.builderRunId = this.builderEmitter.runId;
44
- return this.builderRunId;
45
- }
46
- /** The emitter for builder-level spans (edits, LLM calls, tool invocations). */
47
- get emitter() {
48
- if (!this.builderRunId) throw new Error("BuilderSession.emitter: call startChat() first");
49
- return this.builderEmitter;
50
- }
51
- /**
52
- * Ship the project's generated app: run the sandbox harness as a child
53
- * Run (`layer='app-build'`). Returns the build result + runId.
54
- */
55
- async ship(options) {
56
- if (!this.builderRunId) throw new Error("BuilderSession.ship: call startChat() first");
57
- const buildEmitter = new TraceEmitter(this.store);
58
- await buildEmitter.startRun({
59
- scenarioId: options.scenarioId ?? `${this.projectId}/build`,
60
- projectId: this.projectId,
61
- chatId: this.chatId,
62
- parentRunId: this.builderRunId,
63
- layer: "app-build"
64
- });
65
- const harness = new SandboxHarness(options.driver ?? this.defaultDriver);
66
- const result = await harness.run(options.harness, buildEmitter);
67
- await buildEmitter.endRun({
68
- pass: result.passed,
69
- score: result.score,
70
- failureClass: result.passed ? "success" : "sandbox_failure"
71
- });
72
- this.lastBuildRunId = buildEmitter.runId;
73
- return { runId: buildEmitter.runId, result };
74
- }
75
- /**
76
- * Run a domain scenario against the just-built app as a grandchild Run
77
- * (`layer='app-runtime'`). The `ship` call must precede this so the
78
- * parent is set correctly; if no build exists yet the session attaches
79
- * directly to the builder run (useful for prototypes).
80
- */
81
- async runAppScenario(options) {
82
- const parentRunId = this.lastBuildRunId ?? this.builderRunId;
83
- if (!parentRunId)
84
- throw new Error("BuilderSession.runAppScenario: call startChat() + ship() first");
85
- const { scenario, driver } = options;
86
- const result = await runTestGradedScenario(scenario, this.store, {
87
- driver: driver ?? this.defaultDriver,
88
- provenance: { codeSha: void 0, promptSha: void 0, modelFingerprint: void 0 }
89
- });
90
- await this.store.updateRun(result.runId, {
91
- parentRunId,
92
- projectId: this.projectId,
93
- chatId: this.chatId,
94
- layer: "app-runtime"
95
- });
96
- return result;
97
- }
98
- /** Record an end-of-chat meta score (judge verdict on whether the builder
99
- * served the user's intent). Accepts a numeric score + optional rationale. */
100
- async recordMetaScore(score, rationale) {
101
- if (!this.builderRunId)
102
- throw new Error("BuilderSession.recordMetaScore: call startChat() first");
103
- await this.builderEmitter.recordJudge({
104
- judgeId: "builder-meta",
105
- targetSpanId: this.builderRunId,
106
- // attach to the builder run itself
107
- dimension: "user_intent_satisfaction",
108
- score,
109
- rationale,
110
- name: "builder-meta"
111
- });
112
- }
113
- /** Close the builder Run with a final outcome. */
114
- async endChat(outcome) {
115
- await this.builderEmitter.endRun({
116
- pass: outcome.pass,
117
- score: outcome.score,
118
- notes: outcome.notes
119
- });
120
- }
121
- /**
122
- * Inline app-runtime run — for cases where the "scenario" isn't a
123
- * SWE-bench-style test suite but a live agent interaction (LLM chat,
124
- * domain flow). Returns an emitter bound to a fresh Run in the
125
- * `app-runtime` layer; caller emits spans inside and calls
126
- * `.endRun()` with the final verdict.
127
- */
128
- async startAppRuntime(scenarioId) {
129
- const parentRunId = this.lastBuildRunId ?? this.builderRunId;
130
- if (!parentRunId)
131
- throw new Error(
132
- "BuilderSession.startAppRuntime: call startChat() + (optionally) ship() first"
133
- );
134
- const emitter = new TraceEmitter(this.store);
135
- await emitter.startRun({
136
- scenarioId,
137
- projectId: this.projectId,
138
- chatId: this.chatId,
139
- parentRunId,
140
- layer: "app-runtime"
141
- });
142
- return emitter;
143
- }
144
- /**
145
- * Lightweight "ship marker" — record an app-build Run with a caller-
146
- * provided verdict. Use when there isn't a sandbox harness to run but
147
- * you still want to mark the build state at publish time.
148
- */
149
- async recordShipMarker(args) {
150
- if (!this.builderRunId)
151
- throw new Error("BuilderSession.recordShipMarker: call startChat() first");
152
- const emitter = new TraceEmitter(this.store);
153
- await emitter.startRun({
154
- scenarioId: args.scenarioId ?? `${this.projectId}/ship`,
155
- projectId: this.projectId,
156
- chatId: this.chatId,
157
- parentRunId: this.builderRunId,
158
- layer: "app-build"
159
- });
160
- await emitter.endRun({
161
- pass: args.pass,
162
- score: args.score,
163
- failureClass: args.pass ? "success" : "sandbox_failure",
164
- notes: args.notes
165
- });
166
- this.lastBuildRunId = emitter.runId;
167
- return emitter.runId;
168
- }
169
- get lastBuildRunIdValue() {
170
- return this.lastBuildRunId;
171
- }
172
- get builderRunIdValue() {
173
- return this.builderRunId;
174
- }
7
+ store;
8
+ builderEmitter;
9
+ projectId;
10
+ chatId;
11
+ builderRunId;
12
+ lastBuildRunId;
13
+ defaultDriver;
14
+ constructor(store, init, driver) {
15
+ this.store = store;
16
+ this.projectId = init.projectId;
17
+ this.chatId = init.chatId ?? cryptoId();
18
+ this.defaultDriver = driver;
19
+ this.builderEmitter = new TraceEmitter(store);
20
+ }
21
+ /** Start the builder (L0) run for this chat. Returns the runId. */
22
+ async startChat(scenarioId = `${this.projectId}/chat`) {
23
+ await this.builderEmitter.startRun({
24
+ scenarioId,
25
+ projectId: this.projectId,
26
+ chatId: this.chatId,
27
+ layer: "builder"
28
+ });
29
+ this.builderRunId = this.builderEmitter.runId;
30
+ return this.builderRunId;
31
+ }
32
+ /** The emitter for builder-level spans (edits, LLM calls, tool invocations). */
33
+ get emitter() {
34
+ if (!this.builderRunId) throw new Error("BuilderSession.emitter: call startChat() first");
35
+ return this.builderEmitter;
36
+ }
37
+ /**
38
+ * Ship the project's generated app: run the sandbox harness as a child
39
+ * Run (`layer='app-build'`). Returns the build result + runId.
40
+ */
41
+ async ship(options) {
42
+ if (!this.builderRunId) throw new Error("BuilderSession.ship: call startChat() first");
43
+ const buildEmitter = new TraceEmitter(this.store);
44
+ await buildEmitter.startRun({
45
+ scenarioId: options.scenarioId ?? `${this.projectId}/build`,
46
+ projectId: this.projectId,
47
+ chatId: this.chatId,
48
+ parentRunId: this.builderRunId,
49
+ layer: "app-build"
50
+ });
51
+ const result = await new SandboxHarness(options.driver ?? this.defaultDriver).run(options.harness, buildEmitter);
52
+ await buildEmitter.endRun({
53
+ pass: result.passed,
54
+ score: result.score,
55
+ failureClass: result.passed ? "success" : "sandbox_failure"
56
+ });
57
+ this.lastBuildRunId = buildEmitter.runId;
58
+ return {
59
+ runId: buildEmitter.runId,
60
+ result
61
+ };
62
+ }
63
+ /**
64
+ * Run a domain scenario against the just-built app as a grandchild Run
65
+ * (`layer='app-runtime'`). The `ship` call must precede this so the
66
+ * parent is set correctly; if no build exists yet the session attaches
67
+ * directly to the builder run (useful for prototypes).
68
+ */
69
+ async runAppScenario(options) {
70
+ const parentRunId = this.lastBuildRunId ?? this.builderRunId;
71
+ if (!parentRunId) throw new Error("BuilderSession.runAppScenario: call startChat() + ship() first");
72
+ const { scenario, driver } = options;
73
+ const result = await runTestGradedScenario(scenario, this.store, {
74
+ driver: driver ?? this.defaultDriver,
75
+ provenance: {
76
+ codeSha: void 0,
77
+ promptSha: void 0,
78
+ modelFingerprint: void 0
79
+ }
80
+ });
81
+ await this.store.updateRun(result.runId, {
82
+ parentRunId,
83
+ projectId: this.projectId,
84
+ chatId: this.chatId,
85
+ layer: "app-runtime"
86
+ });
87
+ return result;
88
+ }
89
+ /** Record an end-of-chat meta score (judge verdict on whether the builder
90
+ * served the user's intent). Accepts a numeric score + optional rationale. */
91
+ async recordMetaScore(score, rationale) {
92
+ if (!this.builderRunId) throw new Error("BuilderSession.recordMetaScore: call startChat() first");
93
+ await this.builderEmitter.recordJudge({
94
+ judgeId: "builder-meta",
95
+ targetSpanId: this.builderRunId,
96
+ dimension: "user_intent_satisfaction",
97
+ score,
98
+ rationale,
99
+ name: "builder-meta"
100
+ });
101
+ }
102
+ /** Close the builder Run with a final outcome. */
103
+ async endChat(outcome) {
104
+ await this.builderEmitter.endRun({
105
+ pass: outcome.pass,
106
+ score: outcome.score,
107
+ notes: outcome.notes
108
+ });
109
+ }
110
+ /**
111
+ * Inline app-runtime run for cases where the "scenario" isn't a
112
+ * SWE-bench-style test suite but a live agent interaction (LLM chat,
113
+ * domain flow). Returns an emitter bound to a fresh Run in the
114
+ * `app-runtime` layer; caller emits spans inside and calls
115
+ * `.endRun()` with the final verdict.
116
+ */
117
+ async startAppRuntime(scenarioId) {
118
+ const parentRunId = this.lastBuildRunId ?? this.builderRunId;
119
+ if (!parentRunId) throw new Error("BuilderSession.startAppRuntime: call startChat() + (optionally) ship() first");
120
+ const emitter = new TraceEmitter(this.store);
121
+ await emitter.startRun({
122
+ scenarioId,
123
+ projectId: this.projectId,
124
+ chatId: this.chatId,
125
+ parentRunId,
126
+ layer: "app-runtime"
127
+ });
128
+ return emitter;
129
+ }
130
+ /**
131
+ * Lightweight "ship marker" — record an app-build Run with a caller-
132
+ * provided verdict. Use when there isn't a sandbox harness to run but
133
+ * you still want to mark the build state at publish time.
134
+ */
135
+ async recordShipMarker(args) {
136
+ if (!this.builderRunId) throw new Error("BuilderSession.recordShipMarker: call startChat() first");
137
+ const emitter = new TraceEmitter(this.store);
138
+ await emitter.startRun({
139
+ scenarioId: args.scenarioId ?? `${this.projectId}/ship`,
140
+ projectId: this.projectId,
141
+ chatId: this.chatId,
142
+ parentRunId: this.builderRunId,
143
+ layer: "app-build"
144
+ });
145
+ await emitter.endRun({
146
+ pass: args.pass,
147
+ score: args.score,
148
+ failureClass: args.pass ? "success" : "sandbox_failure",
149
+ notes: args.notes
150
+ });
151
+ this.lastBuildRunId = emitter.runId;
152
+ return emitter.runId;
153
+ }
154
+ get lastBuildRunIdValue() {
155
+ return this.lastBuildRunId;
156
+ }
157
+ get builderRunIdValue() {
158
+ return this.builderRunId;
159
+ }
175
160
  };
161
+ /**
162
+ * Reconstruct the most recent BuilderSession state for a given project —
163
+ * returns { builderRunId, lastBuildRunId, chatRuns }. For chat-first UIs
164
+ * this is how a resumed session finds its place in the edit history.
165
+ */
176
166
  async function resumeBuilderSession(store, projectId) {
177
- const runs = await store.listRuns({ projectId });
178
- const chatRuns = runs.filter((r) => r.layer === "builder").sort((a, b) => b.startedAt - a.startedAt);
179
- const buildRuns = runs.filter((r) => r.layer === "app-build").sort((a, b) => b.startedAt - a.startedAt);
180
- const appRuntimeRuns = runs.filter((r) => r.layer === "app-runtime").sort((a, b) => b.startedAt - a.startedAt);
181
- return {
182
- projectId,
183
- chatRuns,
184
- lastBuilderRun: chatRuns[0],
185
- lastBuildRun: buildRuns[0],
186
- lastAppRuntimeRuns: appRuntimeRuns
187
- };
167
+ const runs = await store.listRuns({ projectId });
168
+ const chatRuns = runs.filter((r) => r.layer === "builder").sort((a, b) => b.startedAt - a.startedAt);
169
+ const buildRuns = runs.filter((r) => r.layer === "app-build").sort((a, b) => b.startedAt - a.startedAt);
170
+ const appRuntimeRuns = runs.filter((r) => r.layer === "app-runtime").sort((a, b) => b.startedAt - a.startedAt);
171
+ return {
172
+ projectId,
173
+ chatRuns,
174
+ lastBuilderRun: chatRuns[0],
175
+ lastBuildRun: buildRuns[0],
176
+ lastAppRuntimeRuns: appRuntimeRuns
177
+ };
188
178
  }
189
179
  function cryptoId() {
190
- if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
191
- return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
180
+ if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
181
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
192
182
  }
193
-
194
- // src/builder-eval/correlation.ts
183
+ //#endregion
184
+ //#region src/builder-eval/correlation.ts
185
+ /**
186
+ * Meta-eval correlation — the highest-leverage signal in the framework.
187
+ *
188
+ * Given a corpus of three-layer project reports, compute how well each
189
+ * pair of layers correlates. The question we care about most:
190
+ *
191
+ * Does `metaScore` (what the builder thinks it did) predict
192
+ * `runtimeScore` (what the user actually gets)?
193
+ *
194
+ * If r < ~0.4, the builder's self-scoring is broken — it's optimizing
195
+ * for something other than real-world success. If r > 0.7, meta_score
196
+ * is a usable proxy and can drive CI gates cheaply.
197
+ *
198
+ * Non-parametric rank correlation (Spearman) is also reported because
199
+ * meta scores are often ordinal-ish.
200
+ */
195
201
  function correlateLayers(reports) {
196
- const completeProjects = reports.filter((r) => r.complete).length;
197
- return {
198
- metaVsBuild: pairwise(
199
- reports,
200
- (r) => r.metaScore,
201
- (r) => r.buildScore
202
- ),
203
- metaVsRuntime: pairwise(
204
- reports,
205
- (r) => r.metaScore,
206
- (r) => r.runtimeScore
207
- ),
208
- buildVsRuntime: pairwise(
209
- reports,
210
- (r) => r.buildScore,
211
- (r) => r.runtimeScore
212
- ),
213
- completeProjects
214
- };
202
+ const completeProjects = reports.filter((r) => r.complete).length;
203
+ return {
204
+ metaVsBuild: pairwise(reports, (r) => r.metaScore, (r) => r.buildScore),
205
+ metaVsRuntime: pairwise(reports, (r) => r.metaScore, (r) => r.runtimeScore),
206
+ buildVsRuntime: pairwise(reports, (r) => r.buildScore, (r) => r.runtimeScore),
207
+ completeProjects
208
+ };
215
209
  }
216
210
  function pairwise(reports, a, b) {
217
- const xs = [];
218
- const ys = [];
219
- for (const r of reports) {
220
- const x = a(r);
221
- const y = b(r);
222
- if (x !== null && y !== null && Number.isFinite(x) && Number.isFinite(y)) {
223
- xs.push(x);
224
- ys.push(y);
225
- }
226
- }
227
- if (xs.length < 2) return void 0;
228
- return {
229
- n: xs.length,
230
- pearson: pearsonR(xs, ys),
231
- spearman: spearmanR(xs, ys)
232
- };
211
+ const xs = [];
212
+ const ys = [];
213
+ for (const r of reports) {
214
+ const x = a(r);
215
+ const y = b(r);
216
+ if (x !== null && y !== null && Number.isFinite(x) && Number.isFinite(y)) {
217
+ xs.push(x);
218
+ ys.push(y);
219
+ }
220
+ }
221
+ if (xs.length < 2) return void 0;
222
+ return {
223
+ n: xs.length,
224
+ pearson: pearsonR(xs, ys),
225
+ spearman: spearmanR(xs, ys)
226
+ };
233
227
  }
234
-
235
- // src/builder-eval/project-registry.ts
228
+ //#endregion
229
+ //#region src/builder-eval/project-registry.ts
236
230
  var ProjectRegistry = class {
237
- constructor(store) {
238
- this.store = store;
239
- }
240
- store;
241
- async listProjects() {
242
- const runs = await this.store.listRuns();
243
- const byProject = /* @__PURE__ */ new Map();
244
- for (const r of runs) {
245
- if (!r.projectId) continue;
246
- const arr = byProject.get(r.projectId) ?? [];
247
- arr.push(r);
248
- byProject.set(r.projectId, arr);
249
- }
250
- const summaries = [];
251
- for (const [projectId, projectRuns] of byProject) {
252
- const sorted = projectRuns.slice().sort((a, b) => b.startedAt - a.startedAt);
253
- const chats = projectRuns.filter((r) => r.layer === "builder");
254
- const builds = projectRuns.filter((r) => r.layer === "app-build");
255
- const runtimes = projectRuns.filter((r) => r.layer === "app-runtime");
256
- const latest = sorted[0];
257
- if (!latest) continue;
258
- summaries.push({
259
- projectId,
260
- chatCount: chats.length,
261
- buildCount: builds.length,
262
- appRuntimeCount: runtimes.length,
263
- lastActivityAt: latest.startedAt,
264
- latestChatId: chats[0]?.chatId,
265
- latestOutcome: latest.outcome ? { pass: latest.outcome.pass ?? false, score: latest.outcome.score } : void 0
266
- });
267
- }
268
- return summaries.sort((a, b) => b.lastActivityAt - a.lastActivityAt);
269
- }
270
- async projectTimeline(projectId) {
271
- const runs = await this.store.listRuns({ projectId });
272
- const ordered = runs.slice().sort((a, b) => a.startedAt - b.startedAt);
273
- return ordered.map((run) => ({
274
- run,
275
- layerBucket: run.layer === "builder" ? "chat" : run.layer === "app-build" ? "build" : run.layer === "app-runtime" ? "runtime" : "other"
276
- }));
277
- }
278
- async projectChats(projectId) {
279
- const builderRuns = (await this.store.listRuns({ projectId, layer: "builder" })).sort(
280
- (a, b) => b.startedAt - a.startedAt
281
- );
282
- const childrenFor = async (runId) => this.store.listRuns({ parentRunId: runId });
283
- const out = [];
284
- for (const run of builderRuns) {
285
- const spans = await this.store.spans({ runId: run.runId });
286
- const children = await childrenFor(run.runId);
287
- const build = children.find((c) => c.layer === "app-build");
288
- const runtime = [];
289
- if (build) {
290
- const grands = await childrenFor(build.runId);
291
- for (const g of grands) if (g.layer === "app-runtime") runtime.push(g.runId);
292
- }
293
- for (const c of children) if (c.layer === "app-runtime") runtime.push(c.runId);
294
- out.push({
295
- chatId: run.chatId ?? run.runId,
296
- projectId,
297
- builderRunId: run.runId,
298
- startedAt: run.startedAt,
299
- endedAt: run.endedAt,
300
- status: run.status,
301
- outcome: run.outcome,
302
- llmTurns: spans.filter((s) => s.kind === "llm").length,
303
- toolCalls: spans.filter((s) => s.kind === "tool").length,
304
- buildRunId: build?.runId,
305
- appRuntimeRunIds: runtime
306
- });
307
- }
308
- return out;
309
- }
231
+ store;
232
+ constructor(store) {
233
+ this.store = store;
234
+ }
235
+ async listProjects() {
236
+ const runs = await this.store.listRuns();
237
+ const byProject = /* @__PURE__ */ new Map();
238
+ for (const r of runs) {
239
+ if (!r.projectId) continue;
240
+ const arr = byProject.get(r.projectId) ?? [];
241
+ arr.push(r);
242
+ byProject.set(r.projectId, arr);
243
+ }
244
+ const summaries = [];
245
+ for (const [projectId, projectRuns] of byProject) {
246
+ const sorted = projectRuns.slice().sort((a, b) => b.startedAt - a.startedAt);
247
+ const chats = projectRuns.filter((r) => r.layer === "builder");
248
+ const builds = projectRuns.filter((r) => r.layer === "app-build");
249
+ const runtimes = projectRuns.filter((r) => r.layer === "app-runtime");
250
+ const latest = sorted[0];
251
+ if (!latest) continue;
252
+ summaries.push({
253
+ projectId,
254
+ chatCount: chats.length,
255
+ buildCount: builds.length,
256
+ appRuntimeCount: runtimes.length,
257
+ lastActivityAt: latest.startedAt,
258
+ latestChatId: chats[0]?.chatId,
259
+ latestOutcome: latest.outcome ? {
260
+ pass: latest.outcome.pass ?? false,
261
+ score: latest.outcome.score
262
+ } : void 0
263
+ });
264
+ }
265
+ return summaries.sort((a, b) => b.lastActivityAt - a.lastActivityAt);
266
+ }
267
+ async projectTimeline(projectId) {
268
+ return (await this.store.listRuns({ projectId })).slice().sort((a, b) => a.startedAt - b.startedAt).map((run) => ({
269
+ run,
270
+ layerBucket: run.layer === "builder" ? "chat" : run.layer === "app-build" ? "build" : run.layer === "app-runtime" ? "runtime" : "other"
271
+ }));
272
+ }
273
+ async projectChats(projectId) {
274
+ const builderRuns = (await this.store.listRuns({
275
+ projectId,
276
+ layer: "builder"
277
+ })).sort((a, b) => b.startedAt - a.startedAt);
278
+ const childrenFor = async (runId) => this.store.listRuns({ parentRunId: runId });
279
+ const out = [];
280
+ for (const run of builderRuns) {
281
+ const spans = await this.store.spans({ runId: run.runId });
282
+ const children = await childrenFor(run.runId);
283
+ const build = children.find((c) => c.layer === "app-build");
284
+ const runtime = [];
285
+ if (build) {
286
+ const grands = await childrenFor(build.runId);
287
+ for (const g of grands) if (g.layer === "app-runtime") runtime.push(g.runId);
288
+ }
289
+ for (const c of children) if (c.layer === "app-runtime") runtime.push(c.runId);
290
+ out.push({
291
+ chatId: run.chatId ?? run.runId,
292
+ projectId,
293
+ builderRunId: run.runId,
294
+ startedAt: run.startedAt,
295
+ endedAt: run.endedAt,
296
+ status: run.status,
297
+ outcome: run.outcome,
298
+ llmTurns: spans.filter((s) => s.kind === "llm").length,
299
+ toolCalls: spans.filter((s) => s.kind === "tool").length,
300
+ buildRunId: build?.runId,
301
+ appRuntimeRunIds: runtime
302
+ });
303
+ }
304
+ return out;
305
+ }
310
306
  };
311
-
312
- // src/builder-eval/three-layer-eval.ts
307
+ //#endregion
308
+ //#region src/builder-eval/three-layer-eval.ts
309
+ /**
310
+ * Three-layer evaluation — the canonical scoring breakdown for
311
+ * builder-of-builders workflows.
312
+ *
313
+ * meta_score: did the builder understand + satisfy user intent?
314
+ * (judge verdict attached to the builder run)
315
+ * build_score: did the generated scaffold build + pass its own tests?
316
+ * (outcome.score on the app-build child run)
317
+ * runtime_score: did the generated agent pass its domain scenarios?
318
+ * (mean outcome.score over app-runtime grandchild runs)
319
+ *
320
+ * Returns a structured report per project. The cross-layer correlation
321
+ * is the highest-leverage signal the framework computes — if
322
+ * meta_score doesn't predict runtime_score, the builder's self-scoring
323
+ * is broken.
324
+ *
325
+ * Scaffold-only mode: when a project has no `app-runtime` runs (e.g. a
326
+ * scaffold-builder eval that grades compose + build without driving a
327
+ * runtime scenario), `kind` is `'scaffold-only'` and `complete` measures
328
+ * meta + build only. Consumers can tell the two apart without having to
329
+ * interpret null-runtime as either "not yet computed" or "N/A for this
330
+ * project shape".
331
+ */
313
332
  async function scoreProject(store, projectId) {
314
- const allRuns = await store.listRuns({ projectId });
315
- const builder = latestByLayer(allRuns, "builder");
316
- const build = latestByLayer(allRuns, "app-build");
317
- const runtime = allRuns.filter((r) => r.layer === "app-runtime");
318
- const metaScore = builder ? await extractMetaScore(store, builder.runId) : null;
319
- const buildScore = build?.outcome?.score ?? null;
320
- const runtimeScores = runtime.map((r) => r.outcome?.score).filter((s) => typeof s === "number");
321
- const runtimeScore = runtimeScores.length > 0 ? runtimeScores.reduce((a, b) => a + b, 0) / runtimeScores.length : null;
322
- const runtimePassed = runtime.filter((r) => r.outcome?.pass === true).length;
323
- const runtimePassRate = runtime.length > 0 ? runtimePassed / runtime.length : null;
324
- const kind = runtime.length === 0 ? "scaffold-only" : "full";
325
- const complete = kind === "scaffold-only" ? metaScore !== null && buildScore !== null : metaScore !== null && buildScore !== null && runtimeScore !== null;
326
- return {
327
- projectId,
328
- kind,
329
- builderRunId: builder?.runId,
330
- metaScore,
331
- buildRunId: build?.runId,
332
- buildScore,
333
- appRuntimeRunIds: runtime.map((r) => r.runId),
334
- runtimeScore,
335
- runtimePassRate,
336
- complete
337
- };
333
+ const allRuns = await store.listRuns({ projectId });
334
+ const builder = latestByLayer(allRuns, "builder");
335
+ const build = latestByLayer(allRuns, "app-build");
336
+ const runtime = allRuns.filter((r) => r.layer === "app-runtime");
337
+ const metaScore = builder ? await extractMetaScore(store, builder.runId) : null;
338
+ const buildScore = build?.outcome?.score ?? null;
339
+ const runtimeScores = runtime.map((r) => r.outcome?.score).filter((s) => typeof s === "number");
340
+ const runtimeScore = runtimeScores.length > 0 ? runtimeScores.reduce((a, b) => a + b, 0) / runtimeScores.length : null;
341
+ const runtimePassed = runtime.filter((r) => r.outcome?.pass === true).length;
342
+ const runtimePassRate = runtime.length > 0 ? runtimePassed / runtime.length : null;
343
+ const kind = runtime.length === 0 ? "scaffold-only" : "full";
344
+ const complete = kind === "scaffold-only" ? metaScore !== null && buildScore !== null : metaScore !== null && buildScore !== null && runtimeScore !== null;
345
+ return {
346
+ projectId,
347
+ kind,
348
+ builderRunId: builder?.runId,
349
+ metaScore,
350
+ buildRunId: build?.runId,
351
+ buildScore,
352
+ appRuntimeRunIds: runtime.map((r) => r.runId),
353
+ runtimeScore,
354
+ runtimePassRate,
355
+ complete
356
+ };
338
357
  }
358
+ /** Aggregate scoring across every project in a corpus. */
339
359
  async function scoreAllProjects(store) {
340
- const runs = await store.listRuns();
341
- const projectIds = [...new Set(runs.map((r) => r.projectId).filter((p) => !!p))];
342
- return Promise.all(projectIds.map((p) => scoreProject(store, p)));
360
+ const runs = await store.listRuns();
361
+ const projectIds = [...new Set(runs.map((r) => r.projectId).filter((p) => !!p))];
362
+ return Promise.all(projectIds.map((p) => scoreProject(store, p)));
343
363
  }
344
364
  function latestByLayer(runs, layer) {
345
- const filtered = runs.filter((r) => r.layer === layer).sort((a, b) => b.startedAt - a.startedAt);
346
- return filtered[0];
365
+ return runs.filter((r) => r.layer === layer).sort((a, b) => b.startedAt - a.startedAt)[0];
347
366
  }
348
367
  async function extractMetaScore(store, builderRunId) {
349
- const js = await judgeSpans(store, builderRunId);
350
- const meta = js.find(
351
- (s) => s.judgeId === "builder-meta" && s.dimension === "user_intent_satisfaction"
352
- );
353
- if (!meta) return null;
354
- if (meta.score >= 0 && meta.score <= 1) return meta.score;
355
- if (meta.score >= 0 && meta.score <= 10) return meta.score / 10;
356
- return null;
368
+ const meta = (await judgeSpans(store, builderRunId)).find((s) => s.judgeId === "builder-meta" && s.dimension === "user_intent_satisfaction");
369
+ if (!meta) return null;
370
+ if (meta.score >= 0 && meta.score <= 1) return meta.score;
371
+ if (meta.score >= 0 && meta.score <= 10) return meta.score / 10;
372
+ return null;
357
373
  }
358
- export {
359
- BuilderSession,
360
- ProjectRegistry,
361
- correlateLayers,
362
- resumeBuilderSession,
363
- scoreAllProjects,
364
- scoreProject
365
- };
374
+ //#endregion
375
+ export { BuilderSession, ProjectRegistry, correlateLayers, resumeBuilderSession, scoreAllProjects, scoreProject };
376
+
366
377
  //# sourceMappingURL=index.js.map