@tangle-network/agent-eval 0.128.2 → 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 (424) hide show
  1. package/CHANGELOG.md +279 -0
  2. package/README.md +19 -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 +83 -2932
  8. package/dist/analyst/index.d.ts.map +1 -0
  9. package/dist/analyst/index.js +319 -364
  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 -1205
  30. package/dist/belief-state/index.d.ts.map +1 -0
  31. package/dist/belief-state/index.js +1617 -1710
  32. package/dist/belief-state/index.js.map +1 -1
  33. package/dist/benchmarks/index.d.ts +2 -894
  34. package/dist/benchmarks/index.js +2 -59
  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 -6390
  44. package/dist/campaign/index.js +3 -212
  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 -174
  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 -5605
  61. package/dist/contract/index.d.ts.map +1 -0
  62. package/dist/contract/index.js +1730 -1937
  63. package/dist/contract/index.js.map +1 -1
  64. package/dist/control.d.ts +3 -1030
  65. package/dist/control.js +2 -32
  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 -617
  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 +3776 -15120
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +11185 -11191
  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 -481
  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 -1298
  196. package/dist/reporting.js +6 -50
  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 +916 -3596
  206. package/dist/rl.d.ts.map +1 -0
  207. package/dist/rl.js +2362 -1751
  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 -1048
  211. package/dist/rollout/index.js +8 -110
  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/run-record-BuoE80Dq.js.map +1 -0
  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 -849
  273. package/dist/supervisor-run/index.js +2 -64
  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 -251
  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 -1174
  298. package/dist/wire/index.d.ts.map +1 -0
  299. package/dist/wire/index.js +2 -81
  300. package/docs/feature-guide.md +1 -1
  301. package/docs/rollout.md +116 -2
  302. package/package.json +18 -10
  303. package/dist/benchmarks/index.js.map +0 -1
  304. package/dist/campaign/index.js.map +0 -1
  305. package/dist/chunk-2JX3CFMB.js +0 -695
  306. package/dist/chunk-2JX3CFMB.js.map +0 -1
  307. package/dist/chunk-2MKQIFS4.js +0 -183
  308. package/dist/chunk-2MKQIFS4.js.map +0 -1
  309. package/dist/chunk-3RF76KTD.js +0 -84
  310. package/dist/chunk-3RF76KTD.js.map +0 -1
  311. package/dist/chunk-5DTSBUL2.js +0 -159
  312. package/dist/chunk-5DTSBUL2.js.map +0 -1
  313. package/dist/chunk-7ZZMD7UK.js +0 -386
  314. package/dist/chunk-7ZZMD7UK.js.map +0 -1
  315. package/dist/chunk-BOD4O7OF.js +0 -40
  316. package/dist/chunk-BOD4O7OF.js.map +0 -1
  317. package/dist/chunk-BYT7ELPS.js +0 -1553
  318. package/dist/chunk-BYT7ELPS.js.map +0 -1
  319. package/dist/chunk-DJKY2TSY.js +0 -2428
  320. package/dist/chunk-DJKY2TSY.js.map +0 -1
  321. package/dist/chunk-DPUHNQLN.js +0 -232
  322. package/dist/chunk-DPUHNQLN.js.map +0 -1
  323. package/dist/chunk-DRYIUNWY.js +0 -622
  324. package/dist/chunk-DRYIUNWY.js.map +0 -1
  325. package/dist/chunk-EJGRPCO3.js +0 -617
  326. package/dist/chunk-EJGRPCO3.js.map +0 -1
  327. package/dist/chunk-EOSZT7PL.js +0 -2001
  328. package/dist/chunk-EOSZT7PL.js.map +0 -1
  329. package/dist/chunk-EZJEIH2R.js +0 -1559
  330. package/dist/chunk-EZJEIH2R.js.map +0 -1
  331. package/dist/chunk-GGE4NNQT.js +0 -65
  332. package/dist/chunk-GGE4NNQT.js.map +0 -1
  333. package/dist/chunk-HHWE3POT.js +0 -94
  334. package/dist/chunk-HHWE3POT.js.map +0 -1
  335. package/dist/chunk-IHQDPH7D.js +0 -171
  336. package/dist/chunk-IHQDPH7D.js.map +0 -1
  337. package/dist/chunk-JHCHEVET.js +0 -274
  338. package/dist/chunk-JHCHEVET.js.map +0 -1
  339. package/dist/chunk-K4DBDHLK.js +0 -158
  340. package/dist/chunk-K4DBDHLK.js.map +0 -1
  341. package/dist/chunk-K6N6XJJX.js +0 -306
  342. package/dist/chunk-K6N6XJJX.js.map +0 -1
  343. package/dist/chunk-MA6HLL3S.js +0 -65
  344. package/dist/chunk-MA6HLL3S.js.map +0 -1
  345. package/dist/chunk-MAZ26DC7.js +0 -99
  346. package/dist/chunk-MAZ26DC7.js.map +0 -1
  347. package/dist/chunk-MHELPNRP.js +0 -1212
  348. package/dist/chunk-MHELPNRP.js.map +0 -1
  349. package/dist/chunk-NACAGYSY.js +0 -1040
  350. package/dist/chunk-NACAGYSY.js.map +0 -1
  351. package/dist/chunk-NKAGIDE2.js +0 -7633
  352. package/dist/chunk-NKAGIDE2.js.map +0 -1
  353. package/dist/chunk-NPCTHQIO.js +0 -91
  354. package/dist/chunk-NPCTHQIO.js.map +0 -1
  355. package/dist/chunk-NYLOYM6N.js +0 -332
  356. package/dist/chunk-NYLOYM6N.js.map +0 -1
  357. package/dist/chunk-ONWEPEDO.js +0 -57
  358. package/dist/chunk-ONWEPEDO.js.map +0 -1
  359. package/dist/chunk-P5W7RQKK.js +0 -576
  360. package/dist/chunk-P5W7RQKK.js.map +0 -1
  361. package/dist/chunk-P6FYH6K4.js +0 -1161
  362. package/dist/chunk-P6FYH6K4.js.map +0 -1
  363. package/dist/chunk-PBE2LOSS.js +0 -669
  364. package/dist/chunk-PBE2LOSS.js.map +0 -1
  365. package/dist/chunk-PC4UYEBM.js +0 -166
  366. package/dist/chunk-PC4UYEBM.js.map +0 -1
  367. package/dist/chunk-PXE2VKMX.js +0 -140
  368. package/dist/chunk-PXE2VKMX.js.map +0 -1
  369. package/dist/chunk-PZ5AY32C.js +0 -10
  370. package/dist/chunk-PZ5AY32C.js.map +0 -1
  371. package/dist/chunk-RZTMDUO7.js +0 -49
  372. package/dist/chunk-RZTMDUO7.js.map +0 -1
  373. package/dist/chunk-S5YLIBFX.js +0 -136
  374. package/dist/chunk-S5YLIBFX.js.map +0 -1
  375. package/dist/chunk-SZLVEKMJ.js +0 -1446
  376. package/dist/chunk-SZLVEKMJ.js.map +0 -1
  377. package/dist/chunk-T4SQEITX.js +0 -95
  378. package/dist/chunk-T4SQEITX.js.map +0 -1
  379. package/dist/chunk-TBL77AUT.js +0 -355
  380. package/dist/chunk-TBL77AUT.js.map +0 -1
  381. package/dist/chunk-TSN7JT6D.js +0 -1646
  382. package/dist/chunk-TSN7JT6D.js.map +0 -1
  383. package/dist/chunk-TT4KNT67.js +0 -124
  384. package/dist/chunk-TT4KNT67.js.map +0 -1
  385. package/dist/chunk-UB2LOJ6Q.js +0 -4461
  386. package/dist/chunk-UB2LOJ6Q.js.map +0 -1
  387. package/dist/chunk-UWZZKKU7.js +0 -237
  388. package/dist/chunk-UWZZKKU7.js.map +0 -1
  389. package/dist/chunk-VBQ3CRKH.js +0 -291
  390. package/dist/chunk-VBQ3CRKH.js.map +0 -1
  391. package/dist/chunk-VGRCHJON.js +0 -163
  392. package/dist/chunk-VGRCHJON.js.map +0 -1
  393. package/dist/chunk-VI2UW6B6.js +0 -162
  394. package/dist/chunk-VI2UW6B6.js.map +0 -1
  395. package/dist/chunk-VLOATJQ2.js +0 -908
  396. package/dist/chunk-VLOATJQ2.js.map +0 -1
  397. package/dist/chunk-VQMK5FMP.js +0 -247
  398. package/dist/chunk-VQMK5FMP.js.map +0 -1
  399. package/dist/chunk-VZSRQ272.js +0 -149
  400. package/dist/chunk-VZSRQ272.js.map +0 -1
  401. package/dist/chunk-WGXIEX7P.js +0 -116
  402. package/dist/chunk-WGXIEX7P.js.map +0 -1
  403. package/dist/chunk-WS3NZZQQ.js +0 -929
  404. package/dist/chunk-WS3NZZQQ.js.map +0 -1
  405. package/dist/chunk-XDWDC2MP.js +0 -695
  406. package/dist/chunk-XDWDC2MP.js.map +0 -1
  407. package/dist/chunk-XPRT64IE.js +0 -766
  408. package/dist/chunk-XPRT64IE.js.map +0 -1
  409. package/dist/chunk-YJBNWCAA.js +0 -1056
  410. package/dist/chunk-YJBNWCAA.js.map +0 -1
  411. package/dist/chunk-ZET2UAYW.js +0 -89
  412. package/dist/chunk-ZET2UAYW.js.map +0 -1
  413. package/dist/chunk-ZUUWPZCV.js +0 -752
  414. package/dist/chunk-ZUUWPZCV.js.map +0 -1
  415. package/dist/control.js.map +0 -1
  416. package/dist/hosted/index.js.map +0 -1
  417. package/dist/matrix/index.js.map +0 -1
  418. package/dist/reporting.js.map +0 -1
  419. package/dist/rollout/index.js.map +0 -1
  420. package/dist/run-campaign-ISHFZ7FJ.js +0 -17
  421. package/dist/run-campaign-ISHFZ7FJ.js.map +0 -1
  422. package/dist/supervisor-run/index.js.map +0 -1
  423. package/dist/traces.js.map +0 -1
  424. package/dist/wire/index.js.map +0 -1
@@ -1,695 +0,0 @@
1
- import {
2
- FAILURE_CLASSES
3
- } from "./chunk-MA6HLL3S.js";
4
- import {
5
- ValidationError
6
- } from "./chunk-ONWEPEDO.js";
7
-
8
- // src/pre-registration.ts
9
- function canonicalize(v) {
10
- if (v === null || typeof v !== "object") return v;
11
- if (Array.isArray(v)) return v.map(canonicalize);
12
- const keys = Object.keys(v).sort();
13
- const out = {};
14
- for (const k of keys) out[k] = canonicalize(v[k]);
15
- return out;
16
- }
17
- async function hashJson(obj) {
18
- const canonical = canonicalize(obj);
19
- const bytes = new TextEncoder().encode(JSON.stringify(canonical));
20
- const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
21
- return Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, "0")).join("");
22
- }
23
- async function signManifest(m) {
24
- const hash = await hashJson(m);
25
- return { ...m, contentHash: hash, algo: "sha256-content" };
26
- }
27
- async function verifyManifest(m) {
28
- const { contentHash, algo: _algo, ...rest } = m;
29
- void _algo;
30
- const resigned = await signManifest(rest);
31
- return resigned.contentHash === contentHash;
32
- }
33
- async function evaluateHypothesis(manifest, observed) {
34
- if (!await verifyManifest(manifest)) {
35
- throw new Error("evaluateHypothesis: manifest content hash mismatch (tampered)");
36
- }
37
- const reasons = [];
38
- const directionOk = manifest.direction === "increase" ? observed.effect > 0 : observed.effect < 0;
39
- if (!directionOk) reasons.push("wrong_direction");
40
- if (Math.abs(observed.effect) < manifest.minEffect) reasons.push("effect_too_small");
41
- if (observed.pValue >= manifest.alpha) reasons.push("not_significant");
42
- if (observed.n < manifest.preRegisteredN) reasons.push("undersampled");
43
- return {
44
- manifest,
45
- observedN: observed.n,
46
- observedEffect: observed.effect,
47
- observedPValue: observed.pValue,
48
- confirmed: reasons.length === 0,
49
- rejectionReasons: reasons
50
- };
51
- }
52
-
53
- // src/agent-profile-cell.ts
54
- var AgentProfileCellValidationError = class extends ValidationError {
55
- path;
56
- constructor(message, path = "") {
57
- super(path ? `${message} (at ${path})` : message);
58
- this.path = path;
59
- }
60
- };
61
- var SHA256_HEX = /^[0-9a-f]{64}$/;
62
- var CELL_ID = /^agent-profile-cell:sha256:[0-9a-f]{64}$/;
63
- async function buildAgentProfileCell(input) {
64
- const material = await normalizeAgentProfileCellInput(input);
65
- const cellId = `agent-profile-cell:sha256:${await hashJson(material)}`;
66
- return { ...material, cellId };
67
- }
68
- function agentProfileCellHashMaterial(cell) {
69
- const { cellId: _cellId, ...material } = cell;
70
- void _cellId;
71
- return normalizeAgentProfileCell(material);
72
- }
73
- async function verifyAgentProfileCell(cell) {
74
- validateAgentProfileCell(cell);
75
- return cell.cellId === `agent-profile-cell:sha256:${await hashJson(agentProfileCellHashMaterial(cell))}`;
76
- }
77
- function validateAgentProfileCell(input) {
78
- if (input === null || typeof input !== "object") {
79
- throw new AgentProfileCellValidationError("expected object");
80
- }
81
- const obj = input;
82
- expectLiteral(obj.schemaVersion, "agent-profile-cell/v1", "schemaVersion");
83
- if (typeof obj.cellId !== "string" || !CELL_ID.test(obj.cellId)) {
84
- throw new AgentProfileCellValidationError(
85
- "cellId must match agent-profile-cell:sha256:<64 lowercase hex chars>",
86
- "cellId"
87
- );
88
- }
89
- expectString(obj.profileId, "profileId");
90
- validateSource(obj.sourceProfile, "sourceProfile");
91
- if (obj.harness !== void 0) validateHarness(obj.harness, "harness");
92
- if (obj.model !== void 0) expectString(obj.model, "model");
93
- if (obj.promptHash !== void 0) expectString(obj.promptHash, "promptHash");
94
- if (obj.dimensions !== void 0) validateDimensions(obj.dimensions, "dimensions");
95
- return input;
96
- }
97
- function requireAgentProfileCell(record) {
98
- if (!record.agentProfile) {
99
- throw new AgentProfileCellValidationError(
100
- `run "${record.runId}" is missing agentProfile; profile-cell grouping requires explicit profile identity`,
101
- "agentProfile"
102
- );
103
- }
104
- return validateAgentProfileCell(record.agentProfile);
105
- }
106
- function agentProfileCellKey(record) {
107
- return requireAgentProfileCell(record).cellId;
108
- }
109
- async function assertRunAgentProfileCell(record) {
110
- const profile = requireAgentProfileCell(record);
111
- if (!await verifyAgentProfileCell(profile)) {
112
- throw new AgentProfileCellValidationError(
113
- `run "${record.runId}" has an agentProfile.cellId that does not match its content`,
114
- "agentProfile.cellId"
115
- );
116
- }
117
- if (profile.model !== void 0 && profile.model !== record.model) {
118
- throw new AgentProfileCellValidationError(
119
- `run "${record.runId}" agentProfile.model "${profile.model}" does not match model "${record.model}"`,
120
- "agentProfile.model"
121
- );
122
- }
123
- if (profile.promptHash !== void 0 && profile.promptHash !== record.promptHash) {
124
- throw new AgentProfileCellValidationError(
125
- `run "${record.runId}" agentProfile.promptHash "${profile.promptHash}" does not match promptHash "${record.promptHash}"`,
126
- "agentProfile.promptHash"
127
- );
128
- }
129
- return profile;
130
- }
131
- function groupRunsByAgentProfileCell(records) {
132
- const groups = /* @__PURE__ */ new Map();
133
- for (const record of records) {
134
- const key = agentProfileCellKey(record);
135
- const bucket = groups.get(key);
136
- if (bucket) bucket.push(record);
137
- else groups.set(key, [record]);
138
- }
139
- return groups;
140
- }
141
- async function normalizeAgentProfileCellInput(input) {
142
- return normalizeAgentProfileCell({
143
- schemaVersion: "agent-profile-cell/v1",
144
- profileId: input.profileId,
145
- sourceProfile: await normalizeSourceInput(input.sourceProfile),
146
- harness: input.harness,
147
- model: input.model,
148
- promptHash: input.promptHash,
149
- dimensions: input.dimensions
150
- });
151
- }
152
- function normalizeAgentProfileCell(input) {
153
- return compactObject({
154
- schemaVersion: "agent-profile-cell/v1",
155
- profileId: requireNonEmpty(input.profileId, "profileId"),
156
- sourceProfile: normalizeSource(input.sourceProfile),
157
- harness: input.harness ? normalizeHarness(input.harness, "harness") : void 0,
158
- model: optionalNonEmpty(input.model, "model"),
159
- promptHash: optionalNonEmpty(input.promptHash, "promptHash"),
160
- dimensions: input.dimensions ? nonEmptyRecord(normalizeDimensions(input.dimensions)) : void 0
161
- });
162
- }
163
- async function normalizeSourceInput(input) {
164
- const kind = requireNonEmpty(input.kind, "sourceProfile.kind");
165
- if (input.hash !== void 0 && input.profile !== void 0) {
166
- throw new AgentProfileCellValidationError(
167
- "sourceProfile must provide either hash or profile, not both",
168
- "sourceProfile"
169
- );
170
- }
171
- if (input.hash !== void 0) {
172
- return { kind, hash: requireSha256Hex(input.hash, "sourceProfile.hash") };
173
- }
174
- if (input.profile === void 0) {
175
- throw new AgentProfileCellValidationError(
176
- "sourceProfile must provide hash or profile",
177
- "sourceProfile"
178
- );
179
- }
180
- assertJson(input.profile, "sourceProfile.profile");
181
- return { kind, hash: await hashJson(input.profile) };
182
- }
183
- function normalizeSource(input) {
184
- return {
185
- kind: requireNonEmpty(input.kind, "sourceProfile.kind"),
186
- hash: requireSha256Hex(input.hash, "sourceProfile.hash")
187
- };
188
- }
189
- function normalizeHarness(input, path) {
190
- return compactObject({
191
- id: requireNonEmpty(input.id, `${path}.id`),
192
- version: optionalNonEmpty(input.version, `${path}.version`),
193
- hash: optionalNonEmpty(input.hash, `${path}.hash`)
194
- });
195
- }
196
- function normalizeDimensions(input) {
197
- const out = {};
198
- for (const key of Object.keys(input).sort()) {
199
- const value = input[key];
200
- requireNonEmpty(key, "dimensions.<key>");
201
- if (value !== null && typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
202
- throw new AgentProfileCellValidationError(
203
- "expected primitive dimension value",
204
- `dimensions.${key}`
205
- );
206
- }
207
- if (typeof value === "number" && !Number.isFinite(value)) {
208
- throw new AgentProfileCellValidationError("expected finite number", `dimensions.${key}`);
209
- }
210
- out[key] = value;
211
- }
212
- return out;
213
- }
214
- function compactObject(input) {
215
- const out = {};
216
- for (const [key, value] of Object.entries(input)) {
217
- if (value !== void 0) out[key] = value;
218
- }
219
- return out;
220
- }
221
- function nonEmptyRecord(input) {
222
- return Object.keys(input).length > 0 ? input : void 0;
223
- }
224
- function validateSource(value, path) {
225
- if (value === null || typeof value !== "object" || Array.isArray(value)) {
226
- throw new AgentProfileCellValidationError("expected object", path);
227
- }
228
- const rec = value;
229
- expectString(rec.kind, `${path}.kind`);
230
- requireSha256Hex(rec.hash, `${path}.hash`);
231
- }
232
- function validateHarness(value, path) {
233
- if (value === null || typeof value !== "object" || Array.isArray(value)) {
234
- throw new AgentProfileCellValidationError("expected object", path);
235
- }
236
- const rec = value;
237
- expectString(rec.id, `${path}.id`);
238
- if (rec.version !== void 0) expectString(rec.version, `${path}.version`);
239
- if (rec.hash !== void 0) expectString(rec.hash, `${path}.hash`);
240
- }
241
- function validateDimensions(value, path) {
242
- if (value === null || typeof value !== "object" || Array.isArray(value)) {
243
- throw new AgentProfileCellValidationError("expected object", path);
244
- }
245
- normalizeDimensions(value);
246
- }
247
- function assertJson(value, path) {
248
- if (value === null) return;
249
- const type = typeof value;
250
- if (type === "string" || type === "boolean") return;
251
- if (type === "number") {
252
- if (!Number.isFinite(value)) {
253
- throw new AgentProfileCellValidationError("expected finite number", path);
254
- }
255
- return;
256
- }
257
- if (Array.isArray(value)) {
258
- value.forEach((item, index) => {
259
- assertJson(item, `${path}[${index}]`);
260
- });
261
- return;
262
- }
263
- if (type === "object") {
264
- for (const [key, nested] of Object.entries(value)) {
265
- requireNonEmpty(key, `${path}.<key>`);
266
- assertJson(nested, `${path}.${key}`);
267
- }
268
- return;
269
- }
270
- throw new AgentProfileCellValidationError("expected JSON-compatible value", path);
271
- }
272
- function expectLiteral(value, expected, path) {
273
- if (value !== expected) {
274
- throw new AgentProfileCellValidationError(`expected ${expected}`, path);
275
- }
276
- }
277
- function expectString(value, path) {
278
- if (typeof value !== "string" || value.length === 0) {
279
- throw new AgentProfileCellValidationError("expected non-empty string", path);
280
- }
281
- }
282
- function requireNonEmpty(value, path) {
283
- if (typeof value !== "string" || value.length === 0) {
284
- throw new AgentProfileCellValidationError("expected non-empty string", path);
285
- }
286
- return value;
287
- }
288
- function optionalNonEmpty(value, path) {
289
- if (value === void 0) return void 0;
290
- return requireNonEmpty(value, path);
291
- }
292
- function requireSha256Hex(value, path) {
293
- if (typeof value !== "string" || !SHA256_HEX.test(value)) {
294
- throw new AgentProfileCellValidationError("expected 64 lowercase sha256 hex chars", path);
295
- }
296
- return value;
297
- }
298
- var AGENT_PROFILE_KINDS = {
299
- /** A profile declared via `defineAgentProfile(...)` from
300
- * `@tangle-network/agent-interface`. The default kind for router-backed
301
- * and sandbox-backed products. */
302
- AGENT_INTERFACE_PROFILE: "agent-interface-profile"
303
- };
304
- function toAgentProfileJson(value) {
305
- let serialized;
306
- try {
307
- serialized = JSON.stringify(value);
308
- } catch (err) {
309
- throw new AgentProfileCellValidationError(
310
- `agent profile must be JSON-serializable: ${err instanceof Error ? err.message : String(err)}`,
311
- "sourceProfile.profile"
312
- );
313
- }
314
- if (serialized === void 0) {
315
- throw new AgentProfileCellValidationError(
316
- "agent profile must be JSON-serializable (got undefined after JSON.stringify)",
317
- "sourceProfile.profile"
318
- );
319
- }
320
- return JSON.parse(serialized);
321
- }
322
- async function buildAgentInterfaceProfileCell(profile, input) {
323
- if (!profile || typeof profile !== "object") {
324
- throw new AgentProfileCellValidationError("AgentProfile must be an object", "profile");
325
- }
326
- if (typeof profile.name !== "string" || profile.name.length === 0) {
327
- throw new AgentProfileCellValidationError(
328
- "AgentProfile must have a non-empty `name`",
329
- "profile.name"
330
- );
331
- }
332
- if (typeof profile.version !== "string" || profile.version.length === 0) {
333
- throw new AgentProfileCellValidationError(
334
- "AgentProfile must have a non-empty `version`",
335
- "profile.version"
336
- );
337
- }
338
- return buildAgentProfileCell({
339
- ...input,
340
- profileId: `${profile.name}@${profile.version}`,
341
- sourceProfile: {
342
- kind: AGENT_PROFILE_KINDS.AGENT_INTERFACE_PROFILE,
343
- profile: toAgentProfileJson(profile)
344
- }
345
- });
346
- }
347
-
348
- // src/run-record.ts
349
- function runTaskScore(record) {
350
- const score = record.outcome.holdoutScore ?? record.outcome.searchScore;
351
- return typeof score === "number" && Number.isFinite(score) ? score : void 0;
352
- }
353
- var MANDATORY_TOP_LEVEL = [
354
- "runId",
355
- "experimentId",
356
- "candidateId",
357
- "seed",
358
- "model",
359
- "promptHash",
360
- "configHash",
361
- "commitSha",
362
- "wallMs",
363
- "costUsd",
364
- "costProvenance",
365
- "tokenUsage",
366
- "terminalOutcome",
367
- "outcome",
368
- "splitTag",
369
- "scenarioId"
370
- ];
371
- var SPLIT_TAGS = ["search", "dev", "holdout"];
372
- var TERMINAL_OUTCOMES = [
373
- "succeeded",
374
- "failed",
375
- "cancelled",
376
- "incomplete",
377
- "unknown"
378
- ];
379
- var RunRecordValidationError = class extends ValidationError {
380
- path;
381
- constructor(message, path = "") {
382
- super(path ? `${message} (at ${path})` : message);
383
- this.path = path;
384
- }
385
- };
386
- function validateRunRecord(input) {
387
- if (input === null || typeof input !== "object") {
388
- throw new RunRecordValidationError("expected object");
389
- }
390
- const obj = input;
391
- for (const key of MANDATORY_TOP_LEVEL) {
392
- if (!(key in obj)) {
393
- throw new RunRecordValidationError(`missing mandatory field "${key}"`);
394
- }
395
- }
396
- expectString2(obj.runId, "runId");
397
- expectString2(obj.experimentId, "experimentId");
398
- expectString2(obj.candidateId, "candidateId");
399
- expectFiniteNumber(obj.seed, "seed");
400
- expectString2(obj.model, "model");
401
- expectString2(obj.promptHash, "promptHash");
402
- expectString2(obj.configHash, "configHash");
403
- expectString2(obj.commitSha, "commitSha");
404
- expectNonNegativeNumber(obj.wallMs, "wallMs");
405
- if (obj.queueMs !== void 0) expectNonNegativeNumber(obj.queueMs, "queueMs");
406
- validateCost(obj.costUsd, obj.costProvenance);
407
- if (!modelHasSnapshot(obj.model)) {
408
- throw new RunRecordValidationError(
409
- `model "${obj.model}" lacks a snapshot version (use 'name@YYYY-MM-DD' or 'name-YYYYMMDD')`,
410
- "model"
411
- );
412
- }
413
- const tu = obj.tokenUsage;
414
- if (tu === null || typeof tu !== "object") {
415
- throw new RunRecordValidationError("tokenUsage must be an object", "tokenUsage");
416
- }
417
- const tuRec = tu;
418
- expectNonNegativeNumber(tuRec.input, "tokenUsage.input");
419
- expectNonNegativeNumber(tuRec.output, "tokenUsage.output");
420
- if (tuRec.reasoning !== void 0) {
421
- expectNonNegativeNumber(tuRec.reasoning, "tokenUsage.reasoning");
422
- if (tuRec.reasoning > tuRec.output) {
423
- throw new RunRecordValidationError(
424
- "reasoning tokens must be a subset of output tokens",
425
- "tokenUsage.reasoning"
426
- );
427
- }
428
- }
429
- if (tuRec.cached !== void 0) expectNonNegativeNumber(tuRec.cached, "tokenUsage.cached");
430
- if (tuRec.cacheWrite !== void 0) {
431
- expectNonNegativeNumber(tuRec.cacheWrite, "tokenUsage.cacheWrite");
432
- }
433
- if (obj.judgeMetadata !== void 0) {
434
- const jm = obj.judgeMetadata;
435
- if (jm === null || typeof jm !== "object") {
436
- throw new RunRecordValidationError("judgeMetadata must be an object", "judgeMetadata");
437
- }
438
- const jmRec = jm;
439
- expectString2(jmRec.model, "judgeMetadata.model");
440
- expectString2(jmRec.promptVersion, "judgeMetadata.promptVersion");
441
- expectFiniteNumber(jmRec.confidence, "judgeMetadata.confidence");
442
- if (typeof jmRec.fallback !== "boolean") {
443
- throw new RunRecordValidationError(
444
- "judgeMetadata.fallback must be boolean",
445
- "judgeMetadata.fallback"
446
- );
447
- }
448
- }
449
- const out = obj.outcome;
450
- if (out === null || typeof out !== "object") {
451
- throw new RunRecordValidationError("outcome must be an object", "outcome");
452
- }
453
- const outRec = out;
454
- if (outRec.searchScore !== void 0)
455
- expectFiniteNumber(outRec.searchScore, "outcome.searchScore");
456
- if (outRec.holdoutScore !== void 0)
457
- expectFiniteNumber(outRec.holdoutScore, "outcome.holdoutScore");
458
- const raw = outRec.raw;
459
- if (raw === null || typeof raw !== "object") {
460
- throw new RunRecordValidationError("outcome.raw must be an object", "outcome.raw");
461
- }
462
- for (const [k, v] of Object.entries(raw)) {
463
- expectFiniteNumber(v, `outcome.raw.${k}`);
464
- }
465
- if (outRec.realness !== void 0) {
466
- const r = outRec.realness;
467
- if (r === null || typeof r !== "object") {
468
- throw new RunRecordValidationError("outcome.realness must be an object", "outcome.realness");
469
- }
470
- const rr = r;
471
- expectFiniteNumber(rr.score, "outcome.realness.score");
472
- if (typeof rr.gated !== "boolean") {
473
- throw new RunRecordValidationError(
474
- "outcome.realness.gated must be a boolean",
475
- "outcome.realness.gated"
476
- );
477
- }
478
- }
479
- if (outRec.judgeScores !== void 0) {
480
- validateJudgeScores(outRec.judgeScores, "outcome.judgeScores");
481
- }
482
- if (obj.failureClass !== void 0 && (typeof obj.failureClass !== "string" || !FAILURE_CLASSES.includes(obj.failureClass))) {
483
- throw new RunRecordValidationError(
484
- `failureClass must be one of ${FAILURE_CLASSES.join(", ")}`,
485
- "failureClass"
486
- );
487
- }
488
- if (obj.failureMode !== void 0) {
489
- expectString2(obj.failureMode, "failureMode");
490
- if (obj.failureClass === void 0 || obj.failureClass === "success") {
491
- throw new RunRecordValidationError(
492
- "failureMode requires a non-success failureClass",
493
- "failureMode"
494
- );
495
- }
496
- }
497
- if (typeof obj.terminalOutcome !== "string" || !TERMINAL_OUTCOMES.includes(obj.terminalOutcome)) {
498
- throw new RunRecordValidationError(
499
- `terminalOutcome must be one of ${TERMINAL_OUTCOMES.join(", ")}`,
500
- "terminalOutcome"
501
- );
502
- }
503
- if (obj.terminalFailureReason !== void 0) {
504
- expectString2(obj.terminalFailureReason, "terminalFailureReason");
505
- if (obj.terminalOutcome !== "failed" && obj.terminalOutcome !== "cancelled" && obj.terminalOutcome !== "incomplete") {
506
- throw new RunRecordValidationError(
507
- "terminalFailureReason requires terminalOutcome failed, cancelled, or incomplete",
508
- "terminalFailureReason"
509
- );
510
- }
511
- }
512
- if (obj.agentProfile !== void 0) {
513
- try {
514
- const profile = validateAgentProfileCell(obj.agentProfile);
515
- if (profile.model !== void 0 && profile.model !== obj.model) {
516
- throw new RunRecordValidationError(
517
- `agentProfile.model "${profile.model}" does not match model "${obj.model}"`,
518
- "agentProfile.model"
519
- );
520
- }
521
- if (profile.promptHash !== void 0 && profile.promptHash !== obj.promptHash) {
522
- throw new RunRecordValidationError(
523
- `agentProfile.promptHash "${profile.promptHash}" does not match promptHash "${obj.promptHash}"`,
524
- "agentProfile.promptHash"
525
- );
526
- }
527
- } catch (error) {
528
- if (error instanceof RunRecordValidationError) throw error;
529
- if (error instanceof Error) {
530
- throw new RunRecordValidationError(error.message, "agentProfile");
531
- }
532
- throw error;
533
- }
534
- }
535
- expectString2(obj.scenarioId, "scenarioId");
536
- if (typeof obj.splitTag !== "string" || !SPLIT_TAGS.includes(obj.splitTag)) {
537
- throw new RunRecordValidationError(
538
- `splitTag must be one of ${SPLIT_TAGS.join(", ")}, got ${String(obj.splitTag)}`,
539
- "splitTag"
540
- );
541
- }
542
- return input;
543
- }
544
- function validateCost(costUsd, provenance) {
545
- if (provenance === null || typeof provenance !== "object") {
546
- throw new RunRecordValidationError("costProvenance must be an object", "costProvenance");
547
- }
548
- const value = provenance;
549
- if (value.kind !== "observed" && value.kind !== "estimated" && value.kind !== "uncaptured") {
550
- throw new RunRecordValidationError(
551
- "costProvenance.kind must be observed, estimated, or uncaptured",
552
- "costProvenance.kind"
553
- );
554
- }
555
- if (value.kind === "uncaptured") {
556
- if (value.usd !== null) {
557
- throw new RunRecordValidationError(
558
- "uncaptured costProvenance.usd must be null",
559
- "costProvenance.usd"
560
- );
561
- }
562
- if (costUsd !== null) {
563
- throw new RunRecordValidationError("uncaptured cost requires costUsd to be null", "costUsd");
564
- }
565
- return;
566
- }
567
- expectNonNegativeNumber(costUsd, "costUsd");
568
- expectNonNegativeNumber(value.usd, "costProvenance.usd");
569
- if (value.usd !== costUsd) {
570
- throw new RunRecordValidationError(
571
- "costProvenance.usd must equal costUsd",
572
- "costProvenance.usd"
573
- );
574
- }
575
- }
576
- function isRunRecord(input) {
577
- try {
578
- validateRunRecord(input);
579
- return true;
580
- } catch {
581
- return false;
582
- }
583
- }
584
- function parseRunRecordSafe(input) {
585
- try {
586
- return { ok: true, value: validateRunRecord(input) };
587
- } catch (e) {
588
- if (e instanceof RunRecordValidationError) return { ok: false, error: e };
589
- throw e;
590
- }
591
- }
592
- function roundTripRunRecord(record) {
593
- const json = JSON.stringify(record);
594
- return validateRunRecord(JSON.parse(json));
595
- }
596
- function expectString2(value, path) {
597
- if (typeof value !== "string" || value.length === 0) {
598
- throw new RunRecordValidationError(`expected non-empty string`, path);
599
- }
600
- }
601
- function expectFiniteNumber(value, path) {
602
- if (typeof value !== "number" || !Number.isFinite(value)) {
603
- throw new RunRecordValidationError(`expected finite number`, path);
604
- }
605
- }
606
- function expectNonNegativeNumber(value, path) {
607
- expectFiniteNumber(value, path);
608
- if (value < 0) {
609
- throw new RunRecordValidationError("expected non-negative number", path);
610
- }
611
- }
612
- function validateJudgeScores(value, path) {
613
- if (value === null || typeof value !== "object") {
614
- throw new RunRecordValidationError("judgeScores must be an object", path);
615
- }
616
- const rec = value;
617
- const perJudge = rec.perJudge;
618
- if (perJudge === null || typeof perJudge !== "object") {
619
- throw new RunRecordValidationError("perJudge must be an object", `${path}.perJudge`);
620
- }
621
- for (const [judgeId, dims] of Object.entries(perJudge)) {
622
- if (dims === null || typeof dims !== "object") {
623
- throw new RunRecordValidationError(
624
- "per-judge entry must be an object of dimension scores",
625
- `${path}.perJudge.${judgeId}`
626
- );
627
- }
628
- for (const [dim, score] of Object.entries(dims)) {
629
- expectFiniteNumber(score, `${path}.perJudge.${judgeId}.${dim}`);
630
- }
631
- }
632
- const perDimMean = rec.perDimMean;
633
- if (perDimMean === null || typeof perDimMean !== "object") {
634
- throw new RunRecordValidationError("perDimMean must be an object", `${path}.perDimMean`);
635
- }
636
- for (const [dim, mean] of Object.entries(perDimMean)) {
637
- expectFiniteNumber(mean, `${path}.perDimMean.${dim}`);
638
- }
639
- expectFiniteNumber(rec.composite, `${path}.composite`);
640
- if (rec.failedJudges !== void 0) {
641
- if (!Array.isArray(rec.failedJudges)) {
642
- throw new RunRecordValidationError(
643
- "failedJudges must be an array of strings",
644
- `${path}.failedJudges`
645
- );
646
- }
647
- for (let i = 0; i < rec.failedJudges.length; i++) {
648
- const id = rec.failedJudges[i];
649
- if (typeof id !== "string" || id.length === 0) {
650
- throw new RunRecordValidationError(
651
- "failedJudges entry must be a non-empty string",
652
- `${path}.failedJudges[${i}]`
653
- );
654
- }
655
- }
656
- }
657
- if (rec.notes !== void 0 && typeof rec.notes !== "string") {
658
- throw new RunRecordValidationError("notes must be a string", `${path}.notes`);
659
- }
660
- }
661
- function modelHasSnapshot(model) {
662
- if (model.includes("@")) return true;
663
- if (/-\d{8}$/.test(model)) return true;
664
- if (/-\d{4}-\d{2}-\d{2}$/.test(model)) return true;
665
- if (/:date-/.test(model)) return true;
666
- return false;
667
- }
668
-
669
- export {
670
- canonicalize,
671
- hashJson,
672
- signManifest,
673
- verifyManifest,
674
- evaluateHypothesis,
675
- AgentProfileCellValidationError,
676
- buildAgentProfileCell,
677
- agentProfileCellHashMaterial,
678
- verifyAgentProfileCell,
679
- validateAgentProfileCell,
680
- requireAgentProfileCell,
681
- agentProfileCellKey,
682
- assertRunAgentProfileCell,
683
- groupRunsByAgentProfileCell,
684
- AGENT_PROFILE_KINDS,
685
- toAgentProfileJson,
686
- buildAgentInterfaceProfileCell,
687
- runTaskScore,
688
- RunRecordValidationError,
689
- validateRunRecord,
690
- isRunRecord,
691
- parseRunRecordSafe,
692
- roundTripRunRecord,
693
- modelHasSnapshot
694
- };
695
- //# sourceMappingURL=chunk-2JX3CFMB.js.map