@tangle-network/agent-eval 0.129.0 → 0.130.1

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 (428) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +2 -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-BJgDGkAD.js +754 -0
  36. package/dist/benchmarks-BJgDGkAD.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-aKJt6emI.js +3886 -0
  46. package/dist/campaign-aKJt6emI.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-CD_WZ_Xr.d.ts +2250 -0
  116. package/dist/index-CD_WZ_Xr.d.ts.map +1 -0
  117. package/dist/index-DSC51roc.d.ts +102 -0
  118. package/dist/index-DSC51roc.d.ts.map +1 -0
  119. package/dist/index-Em67JBjs.d.ts +335 -0
  120. package/dist/index-Em67JBjs.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-CUmHkGbI.js +7718 -0
  253. package/dist/skillopt-optimization-method-CUmHkGbI.js.map +1 -0
  254. package/dist/skillopt-optimization-method-CWKVTnks.d.ts +1740 -0
  255. package/dist/skillopt-optimization-method-CWKVTnks.d.ts.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/docs/campaign-proposers.md +1 -0
  301. package/package.json +17 -9
  302. package/dist/benchmarks/index.js.map +0 -1
  303. package/dist/campaign/index.js.map +0 -1
  304. package/dist/chunk-2QU3YOPR.js +0 -7374
  305. package/dist/chunk-2QU3YOPR.js.map +0 -1
  306. package/dist/chunk-3OCR4R5I.js +0 -728
  307. package/dist/chunk-3OCR4R5I.js.map +0 -1
  308. package/dist/chunk-3RF76KTD.js +0 -84
  309. package/dist/chunk-3RF76KTD.js.map +0 -1
  310. package/dist/chunk-56TAVBOK.js +0 -698
  311. package/dist/chunk-5DTSBUL2.js +0 -159
  312. package/dist/chunk-5DTSBUL2.js.map +0 -1
  313. package/dist/chunk-7FO3TNPI.js +0 -232
  314. package/dist/chunk-7FO3TNPI.js.map +0 -1
  315. package/dist/chunk-7ZZMD7UK.js +0 -386
  316. package/dist/chunk-7ZZMD7UK.js.map +0 -1
  317. package/dist/chunk-BOD4O7OF.js +0 -40
  318. package/dist/chunk-BOD4O7OF.js.map +0 -1
  319. package/dist/chunk-BSO5JDQH.js +0 -2335
  320. package/dist/chunk-BSO5JDQH.js.map +0 -1
  321. package/dist/chunk-C6LXANRU.js +0 -1550
  322. package/dist/chunk-C6LXANRU.js.map +0 -1
  323. package/dist/chunk-DODXQREJ.js +0 -752
  324. package/dist/chunk-DODXQREJ.js.map +0 -1
  325. package/dist/chunk-DRYIUNWY.js +0 -622
  326. package/dist/chunk-DRYIUNWY.js.map +0 -1
  327. package/dist/chunk-E7QXT7SX.js +0 -183
  328. package/dist/chunk-E7QXT7SX.js.map +0 -1
  329. package/dist/chunk-EG66UGL4.js +0 -341
  330. package/dist/chunk-EG66UGL4.js.map +0 -1
  331. package/dist/chunk-FXTVJPYD.js +0 -576
  332. package/dist/chunk-FXTVJPYD.js.map +0 -1
  333. package/dist/chunk-G7MGMCZD.js +0 -153
  334. package/dist/chunk-G7MGMCZD.js.map +0 -1
  335. package/dist/chunk-GGE4NNQT.js +0 -65
  336. package/dist/chunk-GGE4NNQT.js.map +0 -1
  337. package/dist/chunk-H23X7XKK.js +0 -181
  338. package/dist/chunk-H23X7XKK.js.map +0 -1
  339. package/dist/chunk-HHWE3POT.js +0 -94
  340. package/dist/chunk-HHWE3POT.js.map +0 -1
  341. package/dist/chunk-HPWUNB47.js +0 -289
  342. package/dist/chunk-HPWUNB47.js.map +0 -1
  343. package/dist/chunk-IYCLP2N2.js +0 -766
  344. package/dist/chunk-IYCLP2N2.js.map +0 -1
  345. package/dist/chunk-JHCHEVET.js +0 -274
  346. package/dist/chunk-JHCHEVET.js.map +0 -1
  347. package/dist/chunk-JQSF5DQT.js +0 -701
  348. package/dist/chunk-JQSF5DQT.js.map +0 -1
  349. package/dist/chunk-K4DBDHLK.js +0 -158
  350. package/dist/chunk-K4DBDHLK.js.map +0 -1
  351. package/dist/chunk-K6N6XJJX.js +0 -306
  352. package/dist/chunk-K6N6XJJX.js.map +0 -1
  353. package/dist/chunk-M4YBQKIJ.js +0 -1040
  354. package/dist/chunk-M4YBQKIJ.js.map +0 -1
  355. package/dist/chunk-MA6HLL3S.js +0 -65
  356. package/dist/chunk-MA6HLL3S.js.map +0 -1
  357. package/dist/chunk-MAZ26DC7.js +0 -99
  358. package/dist/chunk-MAZ26DC7.js.map +0 -1
  359. package/dist/chunk-NPCTHQIO.js +0 -91
  360. package/dist/chunk-NPCTHQIO.js.map +0 -1
  361. package/dist/chunk-NY44NC4A.js +0 -1056
  362. package/dist/chunk-NY44NC4A.js.map +0 -1
  363. package/dist/chunk-OIUOT4QD.js +0 -44
  364. package/dist/chunk-OIUOT4QD.js.map +0 -1
  365. package/dist/chunk-ONWEPEDO.js +0 -57
  366. package/dist/chunk-ONWEPEDO.js.map +0 -1
  367. package/dist/chunk-OWN5NPMC.js +0 -152
  368. package/dist/chunk-OWN5NPMC.js.map +0 -1
  369. package/dist/chunk-P6FYH6K4.js +0 -1161
  370. package/dist/chunk-P6FYH6K4.js.map +0 -1
  371. package/dist/chunk-PC4UYEBM.js +0 -166
  372. package/dist/chunk-PC4UYEBM.js.map +0 -1
  373. package/dist/chunk-PC5DOSM7.js +0 -579
  374. package/dist/chunk-PC5DOSM7.js.map +0 -1
  375. package/dist/chunk-PXE2VKMX.js +0 -140
  376. package/dist/chunk-PXE2VKMX.js.map +0 -1
  377. package/dist/chunk-PZ5AY32C.js +0 -10
  378. package/dist/chunk-PZ5AY32C.js.map +0 -1
  379. package/dist/chunk-QB6BDBP2.js +0 -4464
  380. package/dist/chunk-QB6BDBP2.js.map +0 -1
  381. package/dist/chunk-RXHCETDZ.js +0 -536
  382. package/dist/chunk-RXHCETDZ.js.map +0 -1
  383. package/dist/chunk-RZTMDUO7.js +0 -49
  384. package/dist/chunk-RZTMDUO7.js.map +0 -1
  385. package/dist/chunk-SFLLL76A.js +0 -669
  386. package/dist/chunk-SFLLL76A.js.map +0 -1
  387. package/dist/chunk-SZLVEKMJ.js +0 -1446
  388. package/dist/chunk-SZLVEKMJ.js.map +0 -1
  389. package/dist/chunk-T4SQEITX.js +0 -95
  390. package/dist/chunk-T4SQEITX.js.map +0 -1
  391. package/dist/chunk-T6RLYGAD.js +0 -158
  392. package/dist/chunk-T6RLYGAD.js.map +0 -1
  393. package/dist/chunk-TJVT4QFF.js +0 -911
  394. package/dist/chunk-TJVT4QFF.js.map +0 -1
  395. package/dist/chunk-TQ7LNKZ3.js +0 -136
  396. package/dist/chunk-TQ7LNKZ3.js.map +0 -1
  397. package/dist/chunk-U4L7JRPZ.js +0 -1706
  398. package/dist/chunk-U4L7JRPZ.js.map +0 -1
  399. package/dist/chunk-U4PHLT2N.js +0 -419
  400. package/dist/chunk-U4PHLT2N.js.map +0 -1
  401. package/dist/chunk-VCZ5FQYW.js +0 -928
  402. package/dist/chunk-VCZ5FQYW.js.map +0 -1
  403. package/dist/chunk-VI2UW6B6.js +0 -162
  404. package/dist/chunk-VI2UW6B6.js.map +0 -1
  405. package/dist/chunk-VQMK5FMP.js +0 -247
  406. package/dist/chunk-VQMK5FMP.js.map +0 -1
  407. package/dist/chunk-WGXIEX7P.js +0 -116
  408. package/dist/chunk-WGXIEX7P.js.map +0 -1
  409. package/dist/chunk-WVATSFCP.js +0 -1553
  410. package/dist/chunk-WVATSFCP.js.map +0 -1
  411. package/dist/chunk-X4YIBDER.js +0 -1662
  412. package/dist/chunk-X4YIBDER.js.map +0 -1
  413. package/dist/chunk-YQN4ICPP.js +0 -355
  414. package/dist/chunk-YQN4ICPP.js.map +0 -1
  415. package/dist/chunk-ZET2UAYW.js +0 -89
  416. package/dist/chunk-ZET2UAYW.js.map +0 -1
  417. package/dist/chunk-ZHTZ4EYI.js +0 -1212
  418. package/dist/chunk-ZHTZ4EYI.js.map +0 -1
  419. package/dist/control.js.map +0 -1
  420. package/dist/hosted/index.js.map +0 -1
  421. package/dist/matrix/index.js.map +0 -1
  422. package/dist/reporting.js.map +0 -1
  423. package/dist/rollout/index.js.map +0 -1
  424. package/dist/run-campaign-OJJ7CZF4.js +0 -18
  425. package/dist/run-campaign-OJJ7CZF4.js.map +0 -1
  426. package/dist/supervisor-run/index.js.map +0 -1
  427. package/dist/traces.js.map +0 -1
  428. package/dist/wire/index.js.map +0 -1
@@ -1,579 +0,0 @@
1
- // src/rollout/gate-checks.ts
2
- var GATE_CHECK_IDS = [
3
- "reward-relationship",
4
- "gated-evidence",
5
- "undeclared-step-payload",
6
- "unscreened-reward"
7
- ];
8
- var field = (subject, name) => subject.outcome?.[name];
9
- function readReward(value) {
10
- if (value === null || value === void 0) return { kind: "absent" };
11
- if (typeof value === "number") {
12
- if (Number.isNaN(value)) return { kind: "unreadable", shown: "NaN" };
13
- return value > 0 ? { kind: "positive", shown: String(value) } : { kind: "cleared" };
14
- }
15
- return {
16
- kind: "unreadable",
17
- shown: `${JSON.stringify(value) ?? String(value)} (${typeof value})`
18
- };
19
- }
20
- var isPlainRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
21
- function payloadIsPopulated(value) {
22
- if (value === void 0 || value === null) return false;
23
- if (isPlainRecord(value)) return Object.keys(value).length > 0;
24
- return true;
25
- }
26
- var DECLARED_STEP_KEYS = {
27
- kind: true,
28
- name: true,
29
- input: true,
30
- output: true,
31
- status: true,
32
- durationMs: true,
33
- llm_call_count: true,
34
- prompt_token_ids: true,
35
- completion_token_ids: true,
36
- logprobs: true
37
- };
38
- function undeclaredStepPayload(steps) {
39
- if (steps === void 0 || steps === null) return void 0;
40
- if (!Array.isArray(steps)) return steps;
41
- const extras = [];
42
- let found = false;
43
- for (const step of steps) {
44
- const extra = {};
45
- if (isPlainRecord(step)) {
46
- for (const [key, value] of Object.entries(step)) {
47
- if (key in DECLARED_STEP_KEYS) continue;
48
- extra[key] = value;
49
- found = true;
50
- }
51
- } else if (step !== void 0 && step !== null) {
52
- extras.push({ step });
53
- found = true;
54
- continue;
55
- }
56
- extras.push(extra);
57
- }
58
- return found ? extras : void 0;
59
- }
60
- function declaredSteps(steps) {
61
- if (!Array.isArray(steps)) return void 0;
62
- const kept = [];
63
- for (const step of steps) {
64
- if (!isPlainRecord(step)) continue;
65
- const projected = {};
66
- for (const [key, value] of Object.entries(step)) {
67
- if (key in DECLARED_STEP_KEYS) projected[key] = value;
68
- }
69
- kept.push(projected);
70
- }
71
- return kept;
72
- }
73
- var rewardRelationship = {
74
- id: "reward-relationship",
75
- refuses: "a positive \u2014 or unreadable \u2014 reward on a line the authenticity screen flagged as gamed",
76
- tripwires: [
77
- { outcome: { reward: 0.95, realness_gated: true } },
78
- // The second population, stated separately because the check held for the
79
- // first while passing this one for a full round.
80
- { outcome: { reward: "0.95", realness_gated: true } }
81
- ],
82
- errors: (subject) => {
83
- if (field(subject, "realness_gated") !== true) return [];
84
- const reading = readReward(field(subject, "reward"));
85
- if (reading.kind === "absent" || reading.kind === "cleared") return [];
86
- if (reading.kind === "unreadable") {
87
- return [
88
- `outcome.reward: ${reading.shown} with outcome.realness_gated: true \u2014 the wire format declares this field \`number | null\`, so the gate cannot read this value as a number and cannot establish that the reward was cleared. On a run flagged as gamed that is not evidence of a zero, it is the absence of it, and a consumer that coerces the value (\`"0.95"\`, \`"2"\`) reads a positive reward off a faked success. Emit a number or null \u2014 \`trainingReward\` / \`trainingScore\` from \`rollout/reward.ts\` produce one.`
89
- ];
90
- }
91
- return [
92
- `outcome.reward: ${reading.shown} with outcome.realness_gated: true \u2014 a run flagged as gamed may not carry a positive reward. The anti-Goodhart gate forces the reward to 0 (a real verdict: the gate decided) before the line is written, so a fine-tune cannot learn from a faked success. Derive the reward with \`trainingReward\` / \`trainingScore\` from \`rollout/reward.ts\`, or drop the line.`
93
- ];
94
- }
95
- };
96
- function gatedEvidenceOf(subject) {
97
- const evidence = {};
98
- const metrics = field(subject, "metrics");
99
- if (payloadIsPopulated(metrics)) evidence.metrics = metrics;
100
- const verdict = field(subject, "verdict");
101
- if (verdict !== null && verdict !== void 0) evidence.verdict = verdict;
102
- const steps = undeclaredStepPayload(subject.steps);
103
- if (steps !== void 0) evidence.steps = steps;
104
- return evidence.metrics === void 0 && evidence.verdict === void 0 && steps === void 0 ? void 0 : evidence;
105
- }
106
- var gatedEvidence = {
107
- id: "gated-evidence",
108
- refuses: "the numbers a fabricated reward was computed from, riding along at reward 0",
109
- tripwires: [
110
- { outcome: { reward: 0, realness_gated: true, metrics: { "layer.tests": 1 } } },
111
- // A PRIMITIVE `metrics`: `Object.keys(0.95)` is `[]`, so the emptiness test
112
- // this check used to run reported it clean and the verifiers format shipped
113
- // it as its per-rubric score dict.
114
- { outcome: { reward: 0, realness_gated: true, metrics: 0.95 } }
115
- ],
116
- errors: (subject) => {
117
- if (field(subject, "realness_gated") !== true) return [];
118
- const evidence = gatedEvidenceOf(subject);
119
- if (evidence === void 0) return [];
120
- if (evidence.metrics === void 0 && evidence.verdict === void 0) return [];
121
- const path = evidence.metrics !== void 0 ? "outcome.metrics" : "outcome.verdict";
122
- return [
123
- `${path} is populated with outcome.realness_gated: true \u2014 a run flagged as gamed may not ship the numbers its fabricated reward was computed from, even at reward 0. The per-layer scores in \`metrics\` ARE the reward signal in the verifiers format, and \`verdict\` is the record that claimed the success. Mint through \`assertMinted\`, which relocates both to \`provenance.gated_evidence\` (see \`gateGamedOutcome\`), or drop the line.`
124
- ];
125
- }
126
- };
127
- var undeclaredStepPayloadCheck = {
128
- id: "undeclared-step-payload",
129
- refuses: "per-step reward signal hung on a gated line\u2019s steps, outside every field the gate read",
130
- tripwires: [
131
- {
132
- outcome: { reward: 0, realness_gated: true },
133
- steps: [{ kind: "tool", name: "edit", reward: 0.9 }]
134
- }
135
- ],
136
- errors: (subject) => {
137
- if (field(subject, "realness_gated") !== true) return [];
138
- const extra = undeclaredStepPayload(subject.steps);
139
- if (extra === void 0) return [];
140
- return [
141
- `steps[] carries fields \`${ROLLOUT_SCHEMA_NAME}\` does not declare (${JSON.stringify(extra).slice(0, 120)}) with outcome.realness_gated: true \u2014 a per-step reward is training signal exactly like the scalar, and the exporters copy \`steps\` through verbatim, so zeroing \`outcome.reward\` while leaving it in place ships the gamed run\u2019s step-level credit assignment at full value. Mint through \`assertMinted\`, which projects the steps down to the declared keys and relocates the rest to \`provenance.gated_evidence.steps\` (see \`gateGamedOutcome\`).`
142
- ];
143
- }
144
- };
145
- var ROLLOUT_SCHEMA_NAME = "tangle.rollout.v1";
146
- var unscreenedReward = {
147
- id: "unscreened-reward",
148
- refuses: "a positive reward whose producer declares that no authenticity screen ever ran",
149
- tripwires: [
150
- { outcome: { reward: 1, realness_gated: false, realness_screened: false } },
151
- {
152
- outcome: {
153
- reward: "2",
154
- realness_gated: false,
155
- realness_screened: false
156
- }
157
- }
158
- ],
159
- errors: (subject) => {
160
- if (field(subject, "realness_screened") !== false) return [];
161
- const reading = readReward(field(subject, "reward"));
162
- if (reading.kind === "absent" || reading.kind === "cleared") return [];
163
- return [
164
- `outcome.reward: ${reading.shown} with outcome.realness_screened: false \u2014 this producer declares that NO authenticity screen ran on this reward, so nothing has established the success is real, and an unscreened positive reward is exactly the signal the anti-Goodhart gate exists to qualify. Screen the run and write the verdict (\`rolloutRewardFields\` from a \`RunRecord\` carrying \`outcome.realness\`), or emit \`reward: null\` \u2014 an unqualified verdict is a labeled gap, not a measured success.`
165
- ];
166
- }
167
- };
168
- var GATE_CHECKS = {
169
- "reward-relationship": rewardRelationship,
170
- "gated-evidence": gatedEvidence,
171
- "undeclared-step-payload": undeclaredStepPayloadCheck,
172
- "unscreened-reward": unscreenedReward
173
- };
174
- var enforced = { kind: "enforce" };
175
- var repairedBy = (by) => ({ kind: "repair", by });
176
- var omittedBecause = (because) => ({
177
- kind: "omit",
178
- because
179
- });
180
- var GATE_POLICIES = {
181
- /**
182
- * The schema validator. Rejects the reward relationship and NOTHING ELSE, on
183
- * purpose: it runs on every line read off disk, and the other two conditions
184
- * describe artifacts that already exist.
185
- */
186
- validateRolloutLine: {
187
- // Stays a REJECTION rather than a transformation. A caller emitting
188
- // `{reward: 0.95, realness_gated: true}` is a producer defect and has to
189
- // fail loudly; laundering it into `reward: 0` here would hide the producer,
190
- // which is the actual bug.
191
- "reward-relationship": enforced,
192
- "gated-evidence": omittedBecause(
193
- "a ledger written before the relocation existed carries `metrics` on its gated lines; rejecting those would make every already-published artifact unreadable. The condition is REPAIRED at `assertMinted` (`gateGamedOutcome`) instead, which is the only door into the training path, so the artifact stays readable and the leak still closes."
194
- ),
195
- "undeclared-step-payload": omittedBecause(
196
- "identical reasoning to `gated-evidence`, one field over: a foreign or pre-unification ledger may carry producer-invented keys on its steps, and refusing to READ those files buys nothing the relocation at `assertMinted` does not already buy. Promotion into training is where it closes."
197
- ),
198
- "unscreened-reward": omittedBecause(
199
- "supervision-journal rows legitimately carry an unscreened positive reward (there is no `RunRecord.outcome.realness` behind them) and must stay writable, readable and reportable. Only PROMOTION into training is closed, at `assertMinted`."
200
- )
201
- },
202
- /**
203
- * The mint funnel — the single door every `MintedRolloutLine` passes. Validates
204
- * first (so the reward relationship has already been rejected), then refuses
205
- * what cannot be repaired, then repairs what can.
206
- */
207
- assertMinted: {
208
- // Re-run after `assertRolloutLine`, which already rejected it. Cheap, and it
209
- // makes this entry point independently complete rather than complete only
210
- // because of what it happens to call first.
211
- "reward-relationship": enforced,
212
- "gated-evidence": repairedBy("gateGamedOutcome"),
213
- "undeclared-step-payload": repairedBy("gateGamedOutcome"),
214
- "unscreened-reward": enforced
215
- },
216
- /**
217
- * The runtime backstop, and the one entry point with no license to omit
218
- * anything: it exists for callers the type system never saw (plain JavaScript
219
- * handing an object literal to a published exporter), so a check it skips is a
220
- * check that does not run at all for them. This is where the fourth leak was.
221
- */
222
- assertRewardGate: {
223
- "reward-relationship": enforced,
224
- "gated-evidence": enforced,
225
- "undeclared-step-payload": enforced,
226
- "unscreened-reward": enforced
227
- },
228
- /**
229
- * The release certifier. Same checks, measured over the rows a release is
230
- * ABOUT TO WRITE rather than over one line's outcome — see `REPORT_MEASURES`
231
- * in `release/gate-report.ts`, which is the second total map this policy
232
- * drives.
233
- */
234
- assertGateReport: {
235
- "reward-relationship": enforced,
236
- "gated-evidence": enforced,
237
- "undeclared-step-payload": enforced,
238
- "unscreened-reward": enforced
239
- }
240
- };
241
- function gateErrors(subject, policy) {
242
- const errors = [];
243
- for (const id of GATE_CHECK_IDS) {
244
- if (policy[id].kind !== "enforce") continue;
245
- errors.push(...GATE_CHECKS[id].errors(subject));
246
- }
247
- return errors;
248
- }
249
-
250
- // src/rollout/schema.ts
251
- var ROLLOUT_SCHEMA = "tangle.rollout.v1";
252
- var ROLLOUT_ROLES = [
253
- "agent",
254
- "supervisor",
255
- "worker",
256
- "proposer",
257
- "judge",
258
- "analyst"
259
- ];
260
- var ROLLOUT_SPLITS = ["search", "dev", "holdout", "canary"];
261
- var TRAINABLE_SPLITS = ["search"];
262
- function isTrainableSplit(split) {
263
- return TRAINABLE_SPLITS.includes(split);
264
- }
265
- var ROLLOUT_CAPTURES = ["mint", "settle-time", "backfill"];
266
- var CHAT_ROLES = ["system", "user", "assistant", "tool"];
267
- var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
268
- var isNumberOrNull = (v) => v === null || typeof v === "number";
269
- var isNumberArray = (v) => Array.isArray(v) && v.every((n) => typeof n === "number" && Number.isFinite(n));
270
- var isIntegerArray = (v) => Array.isArray(v) && v.every((n) => Number.isInteger(n));
271
- var isStringOrNull = (v) => v === null || typeof v === "string";
272
- var isIntegerOrNull = (v) => v === null || Number.isInteger(v);
273
- function validateChatMessage(value, path, errors) {
274
- if (!isRecord(value)) {
275
- errors.push(`${path}: not an object`);
276
- return;
277
- }
278
- if (!CHAT_ROLES.includes(value.role))
279
- errors.push(`${path}.role: invalid role ${String(value.role)}`);
280
- if (!isStringOrNull(value.content)) errors.push(`${path}.content: must be string|null`);
281
- if (value.reasoning_content !== void 0 && typeof value.reasoning_content !== "string") {
282
- errors.push(`${path}.reasoning_content: must be string when present`);
283
- }
284
- if (value.tool_call_id !== void 0 && typeof value.tool_call_id !== "string") {
285
- errors.push(`${path}.tool_call_id: must be string when present`);
286
- }
287
- if (value.role === "tool" && typeof value.tool_call_id !== "string") {
288
- errors.push(`${path}.tool_call_id: required on role:"tool"`);
289
- }
290
- if (value.is_copied_context !== void 0 && typeof value.is_copied_context !== "boolean") {
291
- errors.push(`${path}.is_copied_context: must be boolean when present`);
292
- }
293
- if (value.tool_calls !== void 0) {
294
- if (!Array.isArray(value.tool_calls)) {
295
- errors.push(`${path}.tool_calls: must be an array when present`);
296
- } else {
297
- value.tool_calls.forEach((call, i) => {
298
- if (!isRecord(call) || typeof call.id !== "string" || call.type !== "function") {
299
- errors.push(`${path}.tool_calls[${i}]: must be {id, type:"function", function}`);
300
- return;
301
- }
302
- const fn = call.function;
303
- if (!isRecord(fn) || typeof fn.name !== "string" || typeof fn.arguments !== "string") {
304
- errors.push(
305
- `${path}.tool_calls[${i}].function: must be {name: string, arguments: string}`
306
- );
307
- }
308
- });
309
- }
310
- }
311
- }
312
- function validateSection(value, path, fields, errors) {
313
- if (!isRecord(value)) {
314
- errors.push(`${path}: not an object`);
315
- return;
316
- }
317
- for (const [name, check, expect] of fields) {
318
- if (!check(value[name])) errors.push(`${path}.${name}: expected ${expect}`);
319
- }
320
- }
321
- function gateGamedOutcome(line) {
322
- if (line.outcome.realness_gated !== true) return line;
323
- const moved = gatedEvidenceOf(line);
324
- if (moved === void 0) return line;
325
- const kept = line.provenance.gated_evidence;
326
- const evidence = {};
327
- const metrics = { ...kept?.metrics, ...moved.metrics };
328
- if (Object.keys(metrics).length > 0) evidence.metrics = metrics;
329
- if (moved.verdict !== void 0) evidence.verdict = moved.verdict;
330
- else if (kept?.verdict !== void 0) evidence.verdict = kept.verdict;
331
- if (moved.steps !== void 0) evidence.steps = moved.steps;
332
- else if (kept?.steps !== void 0) evidence.steps = kept.steps;
333
- const steps = moved.steps === void 0 ? line.steps : declaredSteps(line.steps);
334
- return {
335
- ...line,
336
- ...steps === void 0 ? {} : { steps },
337
- outcome: { ...line.outcome, metrics: {}, verdict: null },
338
- provenance: { ...line.provenance, gated_evidence: evidence }
339
- };
340
- }
341
- function assertRewardGate(line, context) {
342
- const errors = gateErrors(line, GATE_POLICIES.assertRewardGate);
343
- if (errors.length > 0) {
344
- throw new Error(`${context}: rollout ${line.rollout_id} \u2014 ${errors[0]}`);
345
- }
346
- }
347
- function validateRolloutLine(value) {
348
- const errors = [];
349
- if (!isRecord(value)) return ["line: not an object"];
350
- if (value.schema !== ROLLOUT_SCHEMA) errors.push(`schema: expected "${ROLLOUT_SCHEMA}"`);
351
- if (typeof value.rollout_id !== "string" || value.rollout_id.length === 0)
352
- errors.push("rollout_id: expected non-empty string");
353
- if (!isStringOrNull(value.parent_rollout_id))
354
- errors.push("parent_rollout_id: expected string|null");
355
- if (typeof value.run_id !== "string" || value.run_id.length === 0)
356
- errors.push("run_id: expected non-empty string");
357
- if (!isStringOrNull(value.experiment_id)) errors.push("experiment_id: expected string|null");
358
- if (!isStringOrNull(value.candidate_id)) errors.push("candidate_id: expected string|null");
359
- if (!isIntegerOrNull(value.generation)) errors.push("generation: expected integer|null");
360
- if (!isIntegerOrNull(value.candidate_index)) errors.push("candidate_index: expected integer|null");
361
- if (!ROLLOUT_ROLES.includes(value.role))
362
- errors.push(`role: invalid role ${String(value.role)}`);
363
- validateSection(
364
- value.task,
365
- "task",
366
- [
367
- ["suite", (v) => typeof v === "string" && v.length > 0, "non-empty string"],
368
- ["instance_id", (v) => typeof v === "string" && v.length > 0, "non-empty string"],
369
- [
370
- "split",
371
- (v) => ROLLOUT_SPLITS.includes(v),
372
- `one of ${ROLLOUT_SPLITS.join("|")}`
373
- ],
374
- ["seed", isNumberOrNull, "number|null"],
375
- ["rep", (v) => Number.isInteger(v), "integer"]
376
- ],
377
- errors
378
- );
379
- validateSection(
380
- value.policy,
381
- "policy",
382
- [
383
- ["harness", isStringOrNull, "string|null"],
384
- ["harness_version", isStringOrNull, "string|null"],
385
- ["model", isStringOrNull, "string|null"],
386
- ["provider", isStringOrNull, "string|null"],
387
- ["profile_commit", isStringOrNull, "string|null"],
388
- ["sampling", (v) => v === null || isRecord(v), "object|null"]
389
- ],
390
- errors
391
- );
392
- if (isRecord(value.policy)) {
393
- for (const key of ["prompt_hash", "config_hash", "agent_profile_cell_id"]) {
394
- if (value.policy[key] !== void 0 && !isStringOrNull(value.policy[key])) {
395
- errors.push(`policy.${key}: expected string|null when present`);
396
- }
397
- }
398
- }
399
- if (!Array.isArray(value.messages)) {
400
- errors.push("messages: expected array");
401
- } else {
402
- for (const [i, m] of value.messages.entries()) validateChatMessage(m, `messages[${i}]`, errors);
403
- }
404
- if (!Array.isArray(value.tool_defs)) {
405
- errors.push("tool_defs: expected array");
406
- } else {
407
- value.tool_defs.forEach((d, i) => {
408
- if (!isRecord(d) || d.type !== "function" || !isRecord(d.function) || typeof d.function.name !== "string") {
409
- errors.push(`tool_defs[${i}]: must be {type:"function", function:{name}}`);
410
- }
411
- });
412
- }
413
- if (value.steps !== void 0) {
414
- if (!Array.isArray(value.steps)) {
415
- errors.push("steps: expected array when present");
416
- } else {
417
- value.steps.forEach((s, i) => {
418
- if (!isRecord(s) || typeof s.kind !== "string" || typeof s.name !== "string") {
419
- errors.push(`steps[${i}]: must be {kind: string, name: string, \u2026}`);
420
- return;
421
- }
422
- if (s.llm_call_count !== void 0 && !Number.isInteger(s.llm_call_count)) {
423
- errors.push(`steps[${i}].llm_call_count: expected integer when present`);
424
- }
425
- for (const key of ["prompt_token_ids", "completion_token_ids"]) {
426
- if (s[key] !== void 0 && !isIntegerArray(s[key])) {
427
- errors.push(`steps[${i}].${key}: expected integer[] when present`);
428
- }
429
- }
430
- if (s.logprobs !== void 0 && !isNumberArray(s.logprobs)) {
431
- errors.push(`steps[${i}].logprobs: expected number[] when present`);
432
- }
433
- });
434
- }
435
- }
436
- validateSection(
437
- value.outcome,
438
- "outcome",
439
- [
440
- ["reward", isNumberOrNull, "number|null"],
441
- ["reward_source", isStringOrNull, "string|null"],
442
- ["metrics", isRecord, "object"],
443
- ["is_completed", (v) => typeof v === "boolean", "boolean"],
444
- ["is_truncated", (v) => typeof v === "boolean", "boolean"],
445
- ["error", isStringOrNull, "string|null"]
446
- ],
447
- errors
448
- );
449
- if (isRecord(value.outcome)) {
450
- if (!("verdict" in value.outcome)) errors.push("outcome.verdict: field required (may be null)");
451
- if (typeof value.outcome.realness_gated !== "boolean") {
452
- errors.push("outcome.realness_gated: expected boolean");
453
- }
454
- if (value.outcome.realness_screened !== void 0 && typeof value.outcome.realness_screened !== "boolean") {
455
- errors.push("outcome.realness_screened: expected boolean when present");
456
- }
457
- errors.push(
458
- ...gateErrors(
459
- { outcome: value.outcome, steps: value.steps },
460
- GATE_POLICIES.validateRolloutLine
461
- )
462
- );
463
- }
464
- validateSection(
465
- value.cost,
466
- "cost",
467
- [
468
- ["usd", isNumberOrNull, "number|null"],
469
- ["tokens_in", isNumberOrNull, "number|null"],
470
- ["tokens_out", isNumberOrNull, "number|null"],
471
- ["tokens_reasoning", isNumberOrNull, "number|null"],
472
- ["cache_read", isNumberOrNull, "number|null"],
473
- ["cache_write", isNumberOrNull, "number|null"],
474
- ["wall_s", isNumberOrNull, "number|null"]
475
- ],
476
- errors
477
- );
478
- if (isRecord(value.cost) && value.cost.llm_call_count !== void 0 && !(value.cost.llm_call_count === null || Number.isInteger(value.cost.llm_call_count))) {
479
- errors.push("cost.llm_call_count: expected integer|null when present");
480
- }
481
- validateSection(
482
- value.artifacts,
483
- "artifacts",
484
- [
485
- ["patch_path", isStringOrNull, "string|null"],
486
- ["run_dir", isStringOrNull, "string|null"],
487
- ["transcript_ref", isStringOrNull, "string|null"]
488
- ],
489
- errors
490
- );
491
- validateSection(
492
- value.provenance,
493
- "provenance",
494
- [
495
- [
496
- "captured_at",
497
- (v) => typeof v === "string" && !Number.isNaN(Date.parse(v)),
498
- "ISO-8601 timestamp"
499
- ],
500
- [
501
- "capture",
502
- (v) => ROLLOUT_CAPTURES.includes(v),
503
- `one of ${ROLLOUT_CAPTURES.join("|")}`
504
- ]
505
- ],
506
- errors
507
- );
508
- if (isRecord(value.provenance)) {
509
- if (value.provenance.gap !== void 0 && typeof value.provenance.gap !== "string") {
510
- errors.push("provenance.gap: must be string when present");
511
- }
512
- const evidence = value.provenance.gated_evidence;
513
- if (evidence !== void 0) {
514
- if (!isRecord(evidence)) {
515
- errors.push("provenance.gated_evidence: must be an object when present");
516
- } else if (evidence.metrics !== void 0 && !isRecord(evidence.metrics)) {
517
- errors.push("provenance.gated_evidence.metrics: must be an object when present");
518
- }
519
- }
520
- }
521
- if (Array.isArray(value.messages) && isRecord(value.provenance)) {
522
- if (value.messages.length === 0 && typeof value.provenance.gap !== "string") {
523
- errors.push("provenance.gap: required when messages is empty");
524
- }
525
- }
526
- return errors;
527
- }
528
- function assertRolloutLine(value, context = "rollout line") {
529
- const errors = validateRolloutLine(value);
530
- if (errors.length > 0) {
531
- throw new Error(`invalid ${context}:
532
- ${errors.join("\n ")}`);
533
- }
534
- }
535
- function isRolloutLine(value) {
536
- return validateRolloutLine(value).length === 0;
537
- }
538
- function assertMinted(value, context = "rollout line") {
539
- assertRolloutLine(value, context);
540
- const refused = gateErrors(value, GATE_POLICIES.assertMinted);
541
- if (refused.length > 0) {
542
- throw new Error(`invalid ${context}: rollout ${value.rollout_id} \u2014 ${refused[0]}`);
543
- }
544
- const gated = gateGamedOutcome(value);
545
- if (gated.outcome.realness_gated === void 0) {
546
- return {
547
- ...gated,
548
- outcome: { ...gated.outcome, realness_gated: false }
549
- };
550
- }
551
- return gated;
552
- }
553
- function assertMintedLines(values, context = "rollout line") {
554
- return values.map((value, i) => assertMinted(value, `${context} [${i}]`));
555
- }
556
-
557
- export {
558
- GATE_CHECK_IDS,
559
- undeclaredStepPayload,
560
- gatedEvidenceOf,
561
- GATE_CHECKS,
562
- GATE_POLICIES,
563
- gateErrors,
564
- ROLLOUT_SCHEMA,
565
- ROLLOUT_ROLES,
566
- ROLLOUT_SPLITS,
567
- TRAINABLE_SPLITS,
568
- isTrainableSplit,
569
- ROLLOUT_CAPTURES,
570
- CHAT_ROLES,
571
- gateGamedOutcome,
572
- assertRewardGate,
573
- validateRolloutLine,
574
- assertRolloutLine,
575
- isRolloutLine,
576
- assertMinted,
577
- assertMintedLines
578
- };
579
- //# sourceMappingURL=chunk-PC5DOSM7.js.map