@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
@@ -0,0 +1,467 @@
1
+ import { s as ValidationError } from "./errors-8YnH8WlF.js";
2
+ import { r as hashJson } from "./pre-registration-DakwTRXk.js";
3
+ import { n as observedScore } from "./reward-nw2xZGZG.js";
4
+ import { t as FAILURE_CLASSES } from "./schema-CRhEY1SO.js";
5
+ //#region src/agent-profile-cell.ts
6
+ var AgentProfileCellValidationError = class extends ValidationError {
7
+ path;
8
+ constructor(message, path = "") {
9
+ super(path ? `${message} (at ${path})` : message);
10
+ this.path = path;
11
+ }
12
+ };
13
+ const SHA256_HEX = /^[0-9a-f]{64}$/;
14
+ const CELL_ID = /^agent-profile-cell:sha256:[0-9a-f]{64}$/;
15
+ async function buildAgentProfileCell(input) {
16
+ const material = await normalizeAgentProfileCellInput(input);
17
+ const cellId = `agent-profile-cell:sha256:${await hashJson(material)}`;
18
+ return {
19
+ ...material,
20
+ cellId
21
+ };
22
+ }
23
+ function agentProfileCellHashMaterial(cell) {
24
+ const { cellId: _cellId, ...material } = cell;
25
+ return normalizeAgentProfileCell(material);
26
+ }
27
+ /**
28
+ * Verify an `AgentProfileCell`'s `cellId` matches the sha256 of its hash-material fields, confirming the record has not been tampered with.
29
+ */
30
+ async function verifyAgentProfileCell(cell) {
31
+ validateAgentProfileCell(cell);
32
+ return cell.cellId === `agent-profile-cell:sha256:${await hashJson(agentProfileCellHashMaterial(cell))}`;
33
+ }
34
+ function validateAgentProfileCell(input) {
35
+ if (input === null || typeof input !== "object") throw new AgentProfileCellValidationError("expected object");
36
+ const obj = input;
37
+ expectLiteral(obj.schemaVersion, "agent-profile-cell/v1", "schemaVersion");
38
+ if (typeof obj.cellId !== "string" || !CELL_ID.test(obj.cellId)) throw new AgentProfileCellValidationError("cellId must match agent-profile-cell:sha256:<64 lowercase hex chars>", "cellId");
39
+ expectString$1(obj.profileId, "profileId");
40
+ validateSource(obj.sourceProfile, "sourceProfile");
41
+ if (obj.harness !== void 0) validateHarness(obj.harness, "harness");
42
+ if (obj.model !== void 0) expectString$1(obj.model, "model");
43
+ if (obj.promptHash !== void 0) expectString$1(obj.promptHash, "promptHash");
44
+ if (obj.dimensions !== void 0) validateDimensions(obj.dimensions, "dimensions");
45
+ return input;
46
+ }
47
+ function requireAgentProfileCell(record) {
48
+ if (!record.agentProfile) throw new AgentProfileCellValidationError(`run "${record.runId}" is missing agentProfile; profile-cell grouping requires explicit profile identity`, "agentProfile");
49
+ return validateAgentProfileCell(record.agentProfile);
50
+ }
51
+ function agentProfileCellKey(record) {
52
+ return requireAgentProfileCell(record).cellId;
53
+ }
54
+ async function assertRunAgentProfileCell(record) {
55
+ const profile = requireAgentProfileCell(record);
56
+ if (!await verifyAgentProfileCell(profile)) throw new AgentProfileCellValidationError(`run "${record.runId}" has an agentProfile.cellId that does not match its content`, "agentProfile.cellId");
57
+ if (profile.model !== void 0 && profile.model !== record.model) throw new AgentProfileCellValidationError(`run "${record.runId}" agentProfile.model "${profile.model}" does not match model "${record.model}"`, "agentProfile.model");
58
+ if (profile.promptHash !== void 0 && profile.promptHash !== record.promptHash) throw new AgentProfileCellValidationError(`run "${record.runId}" agentProfile.promptHash "${profile.promptHash}" does not match promptHash "${record.promptHash}"`, "agentProfile.promptHash");
59
+ return profile;
60
+ }
61
+ function groupRunsByAgentProfileCell(records) {
62
+ const groups = /* @__PURE__ */ new Map();
63
+ for (const record of records) {
64
+ const key = agentProfileCellKey(record);
65
+ const bucket = groups.get(key);
66
+ if (bucket) bucket.push(record);
67
+ else groups.set(key, [record]);
68
+ }
69
+ return groups;
70
+ }
71
+ async function normalizeAgentProfileCellInput(input) {
72
+ return normalizeAgentProfileCell({
73
+ schemaVersion: "agent-profile-cell/v1",
74
+ profileId: input.profileId,
75
+ sourceProfile: await normalizeSourceInput(input.sourceProfile),
76
+ harness: input.harness,
77
+ model: input.model,
78
+ promptHash: input.promptHash,
79
+ dimensions: input.dimensions
80
+ });
81
+ }
82
+ function normalizeAgentProfileCell(input) {
83
+ return compactObject({
84
+ schemaVersion: "agent-profile-cell/v1",
85
+ profileId: requireNonEmpty(input.profileId, "profileId"),
86
+ sourceProfile: normalizeSource(input.sourceProfile),
87
+ harness: input.harness ? normalizeHarness(input.harness, "harness") : void 0,
88
+ model: optionalNonEmpty(input.model, "model"),
89
+ promptHash: optionalNonEmpty(input.promptHash, "promptHash"),
90
+ dimensions: input.dimensions ? nonEmptyRecord(normalizeDimensions(input.dimensions)) : void 0
91
+ });
92
+ }
93
+ async function normalizeSourceInput(input) {
94
+ const kind = requireNonEmpty(input.kind, "sourceProfile.kind");
95
+ if (input.hash !== void 0 && input.profile !== void 0) throw new AgentProfileCellValidationError("sourceProfile must provide either hash or profile, not both", "sourceProfile");
96
+ if (input.hash !== void 0) return {
97
+ kind,
98
+ hash: requireSha256Hex(input.hash, "sourceProfile.hash")
99
+ };
100
+ if (input.profile === void 0) throw new AgentProfileCellValidationError("sourceProfile must provide hash or profile", "sourceProfile");
101
+ assertJson(input.profile, "sourceProfile.profile");
102
+ return {
103
+ kind,
104
+ hash: await hashJson(input.profile)
105
+ };
106
+ }
107
+ function normalizeSource(input) {
108
+ return {
109
+ kind: requireNonEmpty(input.kind, "sourceProfile.kind"),
110
+ hash: requireSha256Hex(input.hash, "sourceProfile.hash")
111
+ };
112
+ }
113
+ function normalizeHarness(input, path) {
114
+ return compactObject({
115
+ id: requireNonEmpty(input.id, `${path}.id`),
116
+ version: optionalNonEmpty(input.version, `${path}.version`),
117
+ hash: optionalNonEmpty(input.hash, `${path}.hash`)
118
+ });
119
+ }
120
+ function normalizeDimensions(input) {
121
+ const out = {};
122
+ for (const key of Object.keys(input).sort()) {
123
+ const value = input[key];
124
+ requireNonEmpty(key, "dimensions.<key>");
125
+ if (value !== null && typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") throw new AgentProfileCellValidationError("expected primitive dimension value", `dimensions.${key}`);
126
+ if (typeof value === "number" && !Number.isFinite(value)) throw new AgentProfileCellValidationError("expected finite number", `dimensions.${key}`);
127
+ out[key] = value;
128
+ }
129
+ return out;
130
+ }
131
+ function compactObject(input) {
132
+ const out = {};
133
+ for (const [key, value] of Object.entries(input)) if (value !== void 0) out[key] = value;
134
+ return out;
135
+ }
136
+ function nonEmptyRecord(input) {
137
+ return Object.keys(input).length > 0 ? input : void 0;
138
+ }
139
+ function validateSource(value, path) {
140
+ if (value === null || typeof value !== "object" || Array.isArray(value)) throw new AgentProfileCellValidationError("expected object", path);
141
+ const rec = value;
142
+ expectString$1(rec.kind, `${path}.kind`);
143
+ requireSha256Hex(rec.hash, `${path}.hash`);
144
+ }
145
+ function validateHarness(value, path) {
146
+ if (value === null || typeof value !== "object" || Array.isArray(value)) throw new AgentProfileCellValidationError("expected object", path);
147
+ const rec = value;
148
+ expectString$1(rec.id, `${path}.id`);
149
+ if (rec.version !== void 0) expectString$1(rec.version, `${path}.version`);
150
+ if (rec.hash !== void 0) expectString$1(rec.hash, `${path}.hash`);
151
+ }
152
+ function validateDimensions(value, path) {
153
+ if (value === null || typeof value !== "object" || Array.isArray(value)) throw new AgentProfileCellValidationError("expected object", path);
154
+ normalizeDimensions(value);
155
+ }
156
+ function assertJson(value, path) {
157
+ if (value === null) return;
158
+ const type = typeof value;
159
+ if (type === "string" || type === "boolean") return;
160
+ if (type === "number") {
161
+ if (!Number.isFinite(value)) throw new AgentProfileCellValidationError("expected finite number", path);
162
+ return;
163
+ }
164
+ if (Array.isArray(value)) {
165
+ value.forEach((item, index) => {
166
+ assertJson(item, `${path}[${index}]`);
167
+ });
168
+ return;
169
+ }
170
+ if (type === "object") {
171
+ for (const [key, nested] of Object.entries(value)) {
172
+ requireNonEmpty(key, `${path}.<key>`);
173
+ assertJson(nested, `${path}.${key}`);
174
+ }
175
+ return;
176
+ }
177
+ throw new AgentProfileCellValidationError("expected JSON-compatible value", path);
178
+ }
179
+ function expectLiteral(value, expected, path) {
180
+ if (value !== expected) throw new AgentProfileCellValidationError(`expected ${expected}`, path);
181
+ }
182
+ function expectString$1(value, path) {
183
+ if (typeof value !== "string" || value.length === 0) throw new AgentProfileCellValidationError("expected non-empty string", path);
184
+ }
185
+ function requireNonEmpty(value, path) {
186
+ if (typeof value !== "string" || value.length === 0) throw new AgentProfileCellValidationError("expected non-empty string", path);
187
+ return value;
188
+ }
189
+ function optionalNonEmpty(value, path) {
190
+ if (value === void 0) return void 0;
191
+ return requireNonEmpty(value, path);
192
+ }
193
+ function requireSha256Hex(value, path) {
194
+ if (typeof value !== "string" || !SHA256_HEX.test(value)) throw new AgentProfileCellValidationError("expected 64 lowercase sha256 hex chars", path);
195
+ return value;
196
+ }
197
+ /** Canonical `sourceProfile.kind` values. Two products fingerprinting the
198
+ * same canonical profile MUST use the same kind for their cells to share
199
+ * `sourceProfile.hash`. Extend rather than create new strings — adding a
200
+ * new kind is a deliberate cross-product schema change. */
201
+ const AGENT_PROFILE_KINDS = {
202
+ /** A profile declared via `defineAgentProfile(...)` from
203
+ * `@tangle-network/agent-interface`. The default kind for router-backed
204
+ * and sandbox-backed products. */
205
+ AGENT_INTERFACE_PROFILE: "agent-interface-profile" };
206
+ /** Canonicalize an arbitrary value into `AgentProfileJson` by JSON
207
+ * round-trip. Throws when the value contains anything not representable
208
+ * as JSON (functions, BigInt, cycles) — non-portable profiles fail loud
209
+ * rather than silently dropping fields. */
210
+ function toAgentProfileJson(value) {
211
+ let serialized;
212
+ try {
213
+ serialized = JSON.stringify(value);
214
+ } catch (err) {
215
+ throw new AgentProfileCellValidationError(`agent profile must be JSON-serializable: ${err instanceof Error ? err.message : String(err)}`, "sourceProfile.profile");
216
+ }
217
+ if (serialized === void 0) throw new AgentProfileCellValidationError("agent profile must be JSON-serializable (got undefined after JSON.stringify)", "sourceProfile.profile");
218
+ return JSON.parse(serialized);
219
+ }
220
+ /** Higher-level helper that hard-codes the canonical
221
+ * `agent-interface-profile` kind plus the JSON canonicalization. Equivalent
222
+ * to calling `buildAgentProfileCell` with `profileId = \`${name}@${version}\``
223
+ * and `sourceProfile = { kind: AGENT_INTERFACE_PROFILE, profile: <round-tripped> }`.
224
+ *
225
+ * Use this from any product consuming an agent-interface `AgentProfile`; the
226
+ * manual `buildAgentProfileCell` call is reserved for advanced cases
227
+ * (custom kinds, pre-computed source hashes, alternate profileId
228
+ * conventions). */
229
+ async function buildAgentInterfaceProfileCell(profile, input) {
230
+ if (!profile || typeof profile !== "object") throw new AgentProfileCellValidationError("AgentProfile must be an object", "profile");
231
+ if (typeof profile.name !== "string" || profile.name.length === 0) throw new AgentProfileCellValidationError("AgentProfile must have a non-empty `name`", "profile.name");
232
+ if (typeof profile.version !== "string" || profile.version.length === 0) throw new AgentProfileCellValidationError("AgentProfile must have a non-empty `version`", "profile.version");
233
+ return buildAgentProfileCell({
234
+ ...input,
235
+ profileId: `${profile.name}@${profile.version}`,
236
+ sourceProfile: {
237
+ kind: AGENT_PROFILE_KINDS.AGENT_INTERFACE_PROFILE,
238
+ profile: toAgentProfileJson(profile)
239
+ }
240
+ });
241
+ }
242
+ //#endregion
243
+ //#region src/run-record.ts
244
+ /**
245
+ * Return task quality, preferring held-out evidence when both scores exist.
246
+ *
247
+ * RAW: no realness protection is applied. Built on `observedScore` rather
248
+ * than repeating the split derivation, so only `rollout/reward.ts` reads the
249
+ * raw fields. Anything that becomes training data must use `trainingScore` or
250
+ * `trainingReward` instead.
251
+ */
252
+ function runTaskScore(record) {
253
+ const score = observedScore(record);
254
+ return typeof score === "number" && Number.isFinite(score) ? score : void 0;
255
+ }
256
+ const MANDATORY_TOP_LEVEL = [
257
+ "runId",
258
+ "experimentId",
259
+ "candidateId",
260
+ "seed",
261
+ "model",
262
+ "promptHash",
263
+ "configHash",
264
+ "commitSha",
265
+ "wallMs",
266
+ "costUsd",
267
+ "costProvenance",
268
+ "tokenUsage",
269
+ "terminalOutcome",
270
+ "outcome",
271
+ "splitTag",
272
+ "scenarioId"
273
+ ];
274
+ const SPLIT_TAGS = [
275
+ "search",
276
+ "dev",
277
+ "holdout"
278
+ ];
279
+ const TERMINAL_OUTCOMES = [
280
+ "succeeded",
281
+ "failed",
282
+ "cancelled",
283
+ "incomplete",
284
+ "unknown"
285
+ ];
286
+ var RunRecordValidationError = class extends ValidationError {
287
+ path;
288
+ constructor(message, path = "") {
289
+ super(path ? `${message} (at ${path})` : message);
290
+ this.path = path;
291
+ }
292
+ };
293
+ /**
294
+ * Strict validator. Throws `RunRecordValidationError` on the first
295
+ * missing or wrongly-typed field. Returns the input cast to
296
+ * `RunRecord` on success — the validator does not coerce.
297
+ */
298
+ function validateRunRecord(input) {
299
+ if (input === null || typeof input !== "object") throw new RunRecordValidationError("expected object");
300
+ const obj = input;
301
+ for (const key of MANDATORY_TOP_LEVEL) if (!(key in obj)) throw new RunRecordValidationError(`missing mandatory field "${key}"`);
302
+ expectString(obj.runId, "runId");
303
+ expectString(obj.experimentId, "experimentId");
304
+ expectString(obj.candidateId, "candidateId");
305
+ expectFiniteNumber(obj.seed, "seed");
306
+ expectString(obj.model, "model");
307
+ expectString(obj.promptHash, "promptHash");
308
+ expectString(obj.configHash, "configHash");
309
+ expectString(obj.commitSha, "commitSha");
310
+ expectNonNegativeNumber(obj.wallMs, "wallMs");
311
+ if (obj.queueMs !== void 0) expectNonNegativeNumber(obj.queueMs, "queueMs");
312
+ validateCost(obj.costUsd, obj.costProvenance);
313
+ if (!modelHasSnapshot(obj.model)) throw new RunRecordValidationError(`model "${obj.model}" lacks a snapshot version (use 'name@YYYY-MM-DD' or 'name-YYYYMMDD')`, "model");
314
+ const tu = obj.tokenUsage;
315
+ if (tu === null || typeof tu !== "object") throw new RunRecordValidationError("tokenUsage must be an object", "tokenUsage");
316
+ const tuRec = tu;
317
+ expectNonNegativeNumber(tuRec.input, "tokenUsage.input");
318
+ expectNonNegativeNumber(tuRec.output, "tokenUsage.output");
319
+ if (tuRec.reasoning !== void 0) {
320
+ expectNonNegativeNumber(tuRec.reasoning, "tokenUsage.reasoning");
321
+ if (tuRec.reasoning > tuRec.output) throw new RunRecordValidationError("reasoning tokens must be a subset of output tokens", "tokenUsage.reasoning");
322
+ }
323
+ if (tuRec.cached !== void 0) expectNonNegativeNumber(tuRec.cached, "tokenUsage.cached");
324
+ if (tuRec.cacheWrite !== void 0) expectNonNegativeNumber(tuRec.cacheWrite, "tokenUsage.cacheWrite");
325
+ if (obj.judgeMetadata !== void 0) {
326
+ const jm = obj.judgeMetadata;
327
+ if (jm === null || typeof jm !== "object") throw new RunRecordValidationError("judgeMetadata must be an object", "judgeMetadata");
328
+ const jmRec = jm;
329
+ expectString(jmRec.model, "judgeMetadata.model");
330
+ expectString(jmRec.promptVersion, "judgeMetadata.promptVersion");
331
+ expectFiniteNumber(jmRec.confidence, "judgeMetadata.confidence");
332
+ if (typeof jmRec.fallback !== "boolean") throw new RunRecordValidationError("judgeMetadata.fallback must be boolean", "judgeMetadata.fallback");
333
+ }
334
+ const out = obj.outcome;
335
+ if (out === null || typeof out !== "object") throw new RunRecordValidationError("outcome must be an object", "outcome");
336
+ const outRec = out;
337
+ if (outRec.searchScore !== void 0) expectFiniteNumber(outRec.searchScore, "outcome.searchScore");
338
+ if (outRec.holdoutScore !== void 0) expectFiniteNumber(outRec.holdoutScore, "outcome.holdoutScore");
339
+ const raw = outRec.raw;
340
+ if (raw === null || typeof raw !== "object") throw new RunRecordValidationError("outcome.raw must be an object", "outcome.raw");
341
+ for (const [k, v] of Object.entries(raw)) expectFiniteNumber(v, `outcome.raw.${k}`);
342
+ if (outRec.realness !== void 0) {
343
+ const r = outRec.realness;
344
+ if (r === null || typeof r !== "object") throw new RunRecordValidationError("outcome.realness must be an object", "outcome.realness");
345
+ const rr = r;
346
+ expectFiniteNumber(rr.score, "outcome.realness.score");
347
+ if (typeof rr.gated !== "boolean") throw new RunRecordValidationError("outcome.realness.gated must be a boolean", "outcome.realness.gated");
348
+ }
349
+ if (outRec.judgeScores !== void 0) validateJudgeScores(outRec.judgeScores, "outcome.judgeScores");
350
+ if (obj.failureClass !== void 0 && (typeof obj.failureClass !== "string" || !FAILURE_CLASSES.includes(obj.failureClass))) throw new RunRecordValidationError(`failureClass must be one of ${FAILURE_CLASSES.join(", ")}`, "failureClass");
351
+ if (obj.failureMode !== void 0) {
352
+ expectString(obj.failureMode, "failureMode");
353
+ if (obj.failureClass === void 0 || obj.failureClass === "success") throw new RunRecordValidationError("failureMode requires a non-success failureClass", "failureMode");
354
+ }
355
+ if (typeof obj.terminalOutcome !== "string" || !TERMINAL_OUTCOMES.includes(obj.terminalOutcome)) throw new RunRecordValidationError(`terminalOutcome must be one of ${TERMINAL_OUTCOMES.join(", ")}`, "terminalOutcome");
356
+ if (obj.terminalFailureReason !== void 0) {
357
+ expectString(obj.terminalFailureReason, "terminalFailureReason");
358
+ if (obj.terminalOutcome !== "failed" && obj.terminalOutcome !== "cancelled" && obj.terminalOutcome !== "incomplete") throw new RunRecordValidationError("terminalFailureReason requires terminalOutcome failed, cancelled, or incomplete", "terminalFailureReason");
359
+ }
360
+ if (obj.agentProfile !== void 0) try {
361
+ const profile = validateAgentProfileCell(obj.agentProfile);
362
+ if (profile.model !== void 0 && profile.model !== obj.model) throw new RunRecordValidationError(`agentProfile.model "${profile.model}" does not match model "${obj.model}"`, "agentProfile.model");
363
+ if (profile.promptHash !== void 0 && profile.promptHash !== obj.promptHash) throw new RunRecordValidationError(`agentProfile.promptHash "${profile.promptHash}" does not match promptHash "${obj.promptHash}"`, "agentProfile.promptHash");
364
+ } catch (error) {
365
+ if (error instanceof RunRecordValidationError) throw error;
366
+ if (error instanceof Error) throw new RunRecordValidationError(error.message, "agentProfile");
367
+ throw error;
368
+ }
369
+ expectString(obj.scenarioId, "scenarioId");
370
+ if (typeof obj.splitTag !== "string" || !SPLIT_TAGS.includes(obj.splitTag)) throw new RunRecordValidationError(`splitTag must be one of ${SPLIT_TAGS.join(", ")}, got ${String(obj.splitTag)}`, "splitTag");
371
+ return input;
372
+ }
373
+ function validateCost(costUsd, provenance) {
374
+ if (provenance === null || typeof provenance !== "object") throw new RunRecordValidationError("costProvenance must be an object", "costProvenance");
375
+ const value = provenance;
376
+ if (value.kind !== "observed" && value.kind !== "estimated" && value.kind !== "uncaptured") throw new RunRecordValidationError("costProvenance.kind must be observed, estimated, or uncaptured", "costProvenance.kind");
377
+ if (value.kind === "uncaptured") {
378
+ if (value.usd !== null) throw new RunRecordValidationError("uncaptured costProvenance.usd must be null", "costProvenance.usd");
379
+ if (costUsd !== null) throw new RunRecordValidationError("uncaptured cost requires costUsd to be null", "costUsd");
380
+ return;
381
+ }
382
+ expectNonNegativeNumber(costUsd, "costUsd");
383
+ expectNonNegativeNumber(value.usd, "costProvenance.usd");
384
+ if (value.usd !== costUsd) throw new RunRecordValidationError("costProvenance.usd must equal costUsd", "costProvenance.usd");
385
+ }
386
+ /** Boolean validator — convenience for filtering arrays. */
387
+ function isRunRecord(input) {
388
+ try {
389
+ validateRunRecord(input);
390
+ return true;
391
+ } catch {
392
+ return false;
393
+ }
394
+ }
395
+ /** Non-throwing validator — returns a discriminated union. */
396
+ function parseRunRecordSafe(input) {
397
+ try {
398
+ return {
399
+ ok: true,
400
+ value: validateRunRecord(input)
401
+ };
402
+ } catch (e) {
403
+ if (e instanceof RunRecordValidationError) return {
404
+ ok: false,
405
+ error: e
406
+ };
407
+ throw e;
408
+ }
409
+ }
410
+ /** Round-trip helper — `JSON.parse(JSON.stringify(record))` then validate. */
411
+ function roundTripRunRecord(record) {
412
+ const json = JSON.stringify(record);
413
+ return validateRunRecord(JSON.parse(json));
414
+ }
415
+ function expectString(value, path) {
416
+ if (typeof value !== "string" || value.length === 0) throw new RunRecordValidationError(`expected non-empty string`, path);
417
+ }
418
+ function expectFiniteNumber(value, path) {
419
+ if (typeof value !== "number" || !Number.isFinite(value)) throw new RunRecordValidationError(`expected finite number`, path);
420
+ }
421
+ function expectNonNegativeNumber(value, path) {
422
+ expectFiniteNumber(value, path);
423
+ if (value < 0) throw new RunRecordValidationError("expected non-negative number", path);
424
+ }
425
+ function validateJudgeScores(value, path) {
426
+ if (value === null || typeof value !== "object") throw new RunRecordValidationError("judgeScores must be an object", path);
427
+ const rec = value;
428
+ const perJudge = rec.perJudge;
429
+ if (perJudge === null || typeof perJudge !== "object") throw new RunRecordValidationError("perJudge must be an object", `${path}.perJudge`);
430
+ for (const [judgeId, dims] of Object.entries(perJudge)) {
431
+ if (dims === null || typeof dims !== "object") throw new RunRecordValidationError("per-judge entry must be an object of dimension scores", `${path}.perJudge.${judgeId}`);
432
+ for (const [dim, score] of Object.entries(dims)) expectFiniteNumber(score, `${path}.perJudge.${judgeId}.${dim}`);
433
+ }
434
+ const perDimMean = rec.perDimMean;
435
+ if (perDimMean === null || typeof perDimMean !== "object") throw new RunRecordValidationError("perDimMean must be an object", `${path}.perDimMean`);
436
+ for (const [dim, mean] of Object.entries(perDimMean)) expectFiniteNumber(mean, `${path}.perDimMean.${dim}`);
437
+ expectFiniteNumber(rec.composite, `${path}.composite`);
438
+ if (rec.failedJudges !== void 0) {
439
+ if (!Array.isArray(rec.failedJudges)) throw new RunRecordValidationError("failedJudges must be an array of strings", `${path}.failedJudges`);
440
+ for (let i = 0; i < rec.failedJudges.length; i++) {
441
+ const id = rec.failedJudges[i];
442
+ if (typeof id !== "string" || id.length === 0) throw new RunRecordValidationError("failedJudges entry must be a non-empty string", `${path}.failedJudges[${i}]`);
443
+ }
444
+ }
445
+ if (rec.notes !== void 0 && typeof rec.notes !== "string") throw new RunRecordValidationError("notes must be a string", `${path}.notes`);
446
+ }
447
+ /**
448
+ * Heuristic snapshot check. Accepts:
449
+ * - `name@YYYY-MM-DD` (Anthropic style: `claude-sonnet-4-6@2025-04-15`)
450
+ * - `name-YYYYMMDD` (OpenAI style: `gpt-4o-2024-11-20`)
451
+ * - `name@<arbitrary-token>` (allow opaque snapshots like `@v3`)
452
+ * - explicit `:date-...` Vertex-style tags
453
+ *
454
+ * Rejects bare aliases like `claude-sonnet-4` or `gpt-4o` that remap
455
+ * silently as providers ship new snapshots.
456
+ */
457
+ function modelHasSnapshot(model) {
458
+ if (model.includes("@")) return true;
459
+ if (/-\d{8}$/.test(model)) return true;
460
+ if (/-\d{4}-\d{2}-\d{2}$/.test(model)) return true;
461
+ if (/:date-/.test(model)) return true;
462
+ return false;
463
+ }
464
+ //#endregion
465
+ export { toAgentProfileJson as _, roundTripRunRecord as a, AGENT_PROFILE_KINDS as c, agentProfileCellKey as d, assertRunAgentProfileCell as f, requireAgentProfileCell as g, groupRunsByAgentProfileCell as h, parseRunRecordSafe as i, AgentProfileCellValidationError as l, buildAgentProfileCell as m, isRunRecord as n, runTaskScore as o, buildAgentInterfaceProfileCell as p, modelHasSnapshot as r, validateRunRecord as s, RunRecordValidationError as t, agentProfileCellHashMaterial as u, validateAgentProfileCell as v, verifyAgentProfileCell as y };
466
+
467
+ //# sourceMappingURL=run-record-BuoE80Dq.js.map