@tangle-network/agent-eval 0.182.0 → 0.184.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 (227) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-cell-s__adRnK.d.ts → agent-profile-cell-BHcB-mZX.d.ts} +8 -9
  4. package/dist/{agent-profile-cell-s__adRnK.d.ts.map → agent-profile-cell-BHcB-mZX.d.ts.map} +1 -1
  5. package/dist/{agent-profile-cell-Cv6UA-W_.js → agent-profile-cell-DcFW4vOc.js} +16 -15
  6. package/dist/agent-profile-cell-DcFW4vOc.js.map +1 -0
  7. package/dist/{agent-profile-CivaSsSy.d.ts → agent-profile-uAIQK3Nr.d.ts} +3 -3
  8. package/dist/{agent-profile-CivaSsSy.d.ts.map → agent-profile-uAIQK3Nr.d.ts.map} +1 -1
  9. package/dist/analyst/index.d.ts +10 -10
  10. package/dist/analyst/index.js +10 -9
  11. package/dist/analyst/index.js.map +1 -1
  12. package/dist/{benchmark-DQKzykkO.js → benchmark-BeQJyrRC.js} +3 -3
  13. package/dist/{benchmark-DQKzykkO.js.map → benchmark-BeQJyrRC.js.map} +1 -1
  14. package/dist/{benchmark-command-7X7HPNHh.js → benchmark-command-DlSePljH.js} +16 -15
  15. package/dist/{benchmark-command-7X7HPNHh.js.map → benchmark-command-DlSePljH.js.map} +1 -1
  16. package/dist/benchmarks/index.d.ts +4 -4
  17. package/dist/benchmarks/index.js +3 -3
  18. package/dist/builder-eval/index.js +1 -1
  19. package/dist/campaign/index.d.ts +6 -5
  20. package/dist/campaign/index.js +9 -9
  21. package/dist/{campaign-B2U7WcFz.js → campaign-D6puiGFO.js} +16 -16
  22. package/dist/{campaign-B2U7WcFz.js.map → campaign-D6puiGFO.js.map} +1 -1
  23. package/dist/{campaign-evidence-PYPUftRy.js → campaign-evidence-aWEmfROB.js} +5 -5
  24. package/dist/{campaign-evidence-PYPUftRy.js.map → campaign-evidence-aWEmfROB.js.map} +1 -1
  25. package/dist/{canonical-DPyQ_rpt.js → canonical-BsZVgBhW.js} +2 -4
  26. package/dist/canonical-BsZVgBhW.js.map +1 -0
  27. package/dist/{chat-client-CkmjYlfB.js → chat-client-DqPqWzVV.js} +2 -2
  28. package/dist/{chat-client-CkmjYlfB.js.map → chat-client-DqPqWzVV.js.map} +1 -1
  29. package/dist/{chat-json-call-B_Xv2oJK.js → chat-json-call-C-DnDxEy.js} +2 -2
  30. package/dist/{chat-json-call-B_Xv2oJK.js.map → chat-json-call-C-DnDxEy.js.map} +1 -1
  31. package/dist/cli.js +4 -4
  32. package/dist/{client-kh2jOjTK.d.ts → client-Bc8LANCG.d.ts} +4 -4
  33. package/dist/{client-kh2jOjTK.d.ts.map → client-Bc8LANCG.d.ts.map} +1 -1
  34. package/dist/contract/index.d.ts +10 -10
  35. package/dist/contract/index.js +17 -17
  36. package/dist/{cost-ledger-B1qx30B4.js → cost-ledger-_IbkejCF.js} +2 -2
  37. package/dist/{cost-ledger-B1qx30B4.js.map → cost-ledger-_IbkejCF.js.map} +1 -1
  38. package/dist/{default-registry-DHWwIwa8.js → default-registry-CpLko4jB.js} +5 -4
  39. package/dist/{default-registry-DHWwIwa8.js.map → default-registry-CpLko4jB.js.map} +1 -1
  40. package/dist/{default-registry-BwDSWVzg.d.ts → default-registry-DYB4aHVn.d.ts} +6 -6
  41. package/dist/{default-registry-BwDSWVzg.d.ts.map → default-registry-DYB4aHVn.d.ts.map} +1 -1
  42. package/dist/{define-agent-eval-CwOWWQt_.d.ts → define-agent-eval-DE67ECH1.d.ts} +7 -7
  43. package/dist/{define-agent-eval-CwOWWQt_.d.ts.map → define-agent-eval-DE67ECH1.d.ts.map} +1 -1
  44. package/dist/{define-agent-eval-DSIPB4hi.js → define-agent-eval-RTekxhUE.js} +8 -8
  45. package/dist/{define-agent-eval-DSIPB4hi.js.map → define-agent-eval-RTekxhUE.js.map} +1 -1
  46. package/dist/{dspy-rlm-engine-S53V0HhE.js → dspy-rlm-engine-Da-l3CpD.js} +4 -4
  47. package/dist/{dspy-rlm-engine-S53V0HhE.js.map → dspy-rlm-engine-Da-l3CpD.js.map} +1 -1
  48. package/dist/{engine-DS1cysJy.d.ts → engine-D1ykrAKR.d.ts} +7 -7
  49. package/dist/{engine-DS1cysJy.d.ts.map → engine-D1ykrAKR.d.ts.map} +1 -1
  50. package/dist/{eval-campaign-CCEkwzoH.js → eval-campaign-XFHEpN86.js} +4 -4
  51. package/dist/{eval-campaign-CCEkwzoH.js.map → eval-campaign-XFHEpN86.js.map} +1 -1
  52. package/dist/evaluation.d.ts +75 -0
  53. package/dist/evaluation.d.ts.map +1 -0
  54. package/dist/evaluation.js +137 -0
  55. package/dist/evaluation.js.map +1 -0
  56. package/dist/{exact-types-BZDe0W2D.d.ts → exact-types-BEHN7tnq.d.ts} +2 -2
  57. package/dist/{exact-types-BZDe0W2D.d.ts.map → exact-types-BEHN7tnq.d.ts.map} +1 -1
  58. package/dist/experiment/index.d.ts +2 -2
  59. package/dist/experiment/index.js +5 -5
  60. package/dist/{experiment-tracker-C7PfnF4b.d.ts → experiment-tracker-URRGP9ek.d.ts} +2 -2
  61. package/dist/{experiment-tracker-C7PfnF4b.d.ts.map → experiment-tracker-URRGP9ek.d.ts.map} +1 -1
  62. package/dist/{exporters-Df7TgHFv.js → exporters-DEcXbvgO.js} +12 -4
  63. package/dist/exporters-DEcXbvgO.js.map +1 -0
  64. package/dist/{external-optimizer-process-QDRURJAM.js → external-optimizer-process-BbhvXTFx.js} +4 -4
  65. package/dist/{external-optimizer-process-QDRURJAM.js.map → external-optimizer-process-BbhvXTFx.js.map} +1 -1
  66. package/dist/{external-optimizer-subprocess-D4dzUBZI.js → external-optimizer-subprocess-DMgmqTB6.js} +5 -5
  67. package/dist/{external-optimizer-subprocess-D4dzUBZI.js.map → external-optimizer-subprocess-DMgmqTB6.js.map} +1 -1
  68. package/dist/{feedback-trajectory-CXmtITBo.d.ts → feedback-trajectory-CytTR7u4.d.ts} +3 -3
  69. package/dist/{feedback-trajectory-CXmtITBo.d.ts.map → feedback-trajectory-CytTR7u4.d.ts.map} +1 -1
  70. package/dist/fuzz.js +1 -1
  71. package/dist/{hf-dataset-D8_RNIis.js → hf-dataset-CRqtSjnR.js} +2 -2
  72. package/dist/{hf-dataset-D8_RNIis.js.map → hf-dataset-CRqtSjnR.js.map} +1 -1
  73. package/dist/hosted/index.d.ts +2 -2
  74. package/dist/{index-DoykkxW0.d.ts → index-58wex7KV.d.ts} +11 -11
  75. package/dist/{index-DoykkxW0.d.ts.map → index-58wex7KV.d.ts.map} +1 -1
  76. package/dist/{index-CJ3LhKIX.d.ts → index-CKZa_rnt.d.ts} +4 -271
  77. package/dist/index-CKZa_rnt.d.ts.map +1 -0
  78. package/dist/{index-DbG8QbH9.d.ts → index-DVrtLO5j.d.ts} +6 -6
  79. package/dist/{index-DbG8QbH9.d.ts.map → index-DVrtLO5j.d.ts.map} +1 -1
  80. package/dist/{index-Bp_6sj3x.d.ts → index-ww8736Am.d.ts} +20 -315
  81. package/dist/index-ww8736Am.d.ts.map +1 -0
  82. package/dist/index.d.ts +23 -22
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +29 -29
  85. package/dist/{insight-report-D1qa0HWs.d.ts → insight-report-C3Bfl762.d.ts} +3 -3
  86. package/dist/{insight-report-D1qa0HWs.d.ts.map → insight-report-C3Bfl762.d.ts.map} +1 -1
  87. package/dist/jev-protocol.d.ts +74 -0
  88. package/dist/jev-protocol.d.ts.map +1 -0
  89. package/dist/jev-protocol.js +91 -0
  90. package/dist/jev-protocol.js.map +1 -0
  91. package/dist/jev.d.ts +131 -0
  92. package/dist/jev.d.ts.map +1 -0
  93. package/dist/jev.js +312 -0
  94. package/dist/jev.js.map +1 -0
  95. package/dist/{journal-Cs9f7385.js → journal-BuRLm6ho.js} +2 -2
  96. package/dist/{journal-Cs9f7385.js.map → journal-BuRLm6ho.js.map} +1 -1
  97. package/dist/{kind-factory-D5HOW3R0.js → kind-factory-DE088Zhv.js} +5 -4
  98. package/dist/{kind-factory-D5HOW3R0.js.map → kind-factory-DE088Zhv.js.map} +1 -1
  99. package/dist/ledger-core/index.js +2 -2
  100. package/dist/{llm-client-CGlSi8sb.js → llm-client-DDhZ29Vm.js} +2 -2
  101. package/dist/{llm-client-CGlSi8sb.js.map → llm-client-DDhZ29Vm.js.map} +1 -1
  102. package/dist/{llm-judge-BPFR12VJ.js → llm-judge-C5wbADA5.js} +11 -11
  103. package/dist/{llm-judge-BPFR12VJ.js.map → llm-judge-C5wbADA5.js.map} +1 -1
  104. package/dist/{matrix-CyhW-vgJ.d.ts → matrix-CPKsRY8Y.d.ts} +2 -2
  105. package/dist/{matrix-CyhW-vgJ.d.ts.map → matrix-CPKsRY8Y.d.ts.map} +1 -1
  106. package/dist/meta-eval/index.d.ts +54 -2
  107. package/dist/meta-eval/index.d.ts.map +1 -1
  108. package/dist/meta-eval/index.js +52 -3
  109. package/dist/meta-eval/index.js.map +1 -1
  110. package/dist/{metrics-Qv-cpptD.js → metrics-DOMpkoeb.js} +5 -1
  111. package/dist/metrics-DOMpkoeb.js.map +1 -0
  112. package/dist/{mint-ySIIkKlV.js → mint-B4zgSAJW.js} +63 -14
  113. package/dist/mint-B4zgSAJW.js.map +1 -0
  114. package/dist/mint-BI14xehJ.d.ts +285 -0
  115. package/dist/mint-BI14xehJ.d.ts.map +1 -0
  116. package/dist/multishot/golden/index.d.ts +1 -1
  117. package/dist/multishot/index.d.ts +2 -2
  118. package/dist/multishot/index.js +1 -1
  119. package/dist/openapi.json +1 -1
  120. package/dist/pipelines/index.js +2 -2
  121. package/dist/{produced-state-CkoG43gI.js → produced-state-D3uWsY8t.js} +25 -21
  122. package/dist/{produced-state-CkoG43gI.js.map → produced-state-D3uWsY8t.js.map} +1 -1
  123. package/dist/profile-cell.d.ts +1 -1
  124. package/dist/profile-cell.js +1 -1
  125. package/dist/{promotion-policy-BKFrl7CC.js → promotion-policy-CD-bUeyR.js} +3 -3
  126. package/dist/{promotion-policy-BKFrl7CC.js.map → promotion-policy-CD-bUeyR.js.map} +1 -1
  127. package/dist/{query-D1nLIKt7.js → query-DlV0pdx4.js} +2 -2
  128. package/dist/{query-D1nLIKt7.js.map → query-DlV0pdx4.js.map} +1 -1
  129. package/dist/{registry-BRbB6Y0v.d.ts → registry-D5Ly3GRV.d.ts} +3 -3
  130. package/dist/{registry-BRbB6Y0v.d.ts.map → registry-D5Ly3GRV.d.ts.map} +1 -1
  131. package/dist/{release-confidence-BcqeQTHW.d.ts → release-confidence-DsETiO4f.d.ts} +3 -3
  132. package/dist/{release-confidence-BcqeQTHW.d.ts.map → release-confidence-DsETiO4f.d.ts.map} +1 -1
  133. package/dist/{release-confidence-DMg8n18l.js → release-confidence-RanRUXRW.js} +2 -2
  134. package/dist/{release-confidence-DMg8n18l.js.map → release-confidence-RanRUXRW.js.map} +1 -1
  135. package/dist/reporting.d.ts +3 -3
  136. package/dist/reporting.js +2 -2
  137. package/dist/{researcher-64T49THL.d.ts → researcher-CJkH-6Ty.d.ts} +4 -4
  138. package/dist/{researcher-64T49THL.d.ts.map → researcher-CJkH-6Ty.d.ts.map} +1 -1
  139. package/dist/{reward-hacking-uzO_ihep.d.ts → reward-hacking-BIQ2BWLG.d.ts} +2 -2
  140. package/dist/{reward-hacking-uzO_ihep.d.ts.map → reward-hacking-BIQ2BWLG.d.ts.map} +1 -1
  141. package/dist/rl.d.ts +35 -40
  142. package/dist/rl.d.ts.map +1 -1
  143. package/dist/rl.js +79 -61
  144. package/dist/rl.js.map +1 -1
  145. package/dist/rollout/index.d.ts +2 -1
  146. package/dist/rollout/index.js +4 -4
  147. package/dist/{rollout-BsN6pOU7.js → rollout-C0Ifk3vK.js} +4 -4
  148. package/dist/{rollout-BsN6pOU7.js.map → rollout-C0Ifk3vK.js.map} +1 -1
  149. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts → rubric-predictive-validity-CTU8y8Cv.d.ts} +2 -2
  150. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts.map → rubric-predictive-validity-CTU8y8Cv.d.ts.map} +1 -1
  151. package/dist/{run-record-DPa2PeHx.js → run-record-BhMVsHR1.js} +2 -2
  152. package/dist/{run-record-DPa2PeHx.js.map → run-record-BhMVsHR1.js.map} +1 -1
  153. package/dist/{run-record-BiTWauyO.d.ts → run-record-D9wS35fK.d.ts} +2 -2
  154. package/dist/{run-record-BiTWauyO.d.ts.map → run-record-D9wS35fK.d.ts.map} +1 -1
  155. package/dist/{run-record-DualPTn2.js → run-record-tg_5H2IK.js} +2 -2
  156. package/dist/{run-record-DualPTn2.js.map → run-record-tg_5H2IK.js.map} +1 -1
  157. package/dist/search-ledger-types-D7KDVg-o.d.ts +302 -0
  158. package/dist/search-ledger-types-D7KDVg-o.d.ts.map +1 -0
  159. package/dist/{semantic-concept-judge-Bm5JDEKO.js → semantic-concept-judge-5r9hDEBA.js} +7 -7
  160. package/dist/{semantic-concept-judge-Bm5JDEKO.js.map → semantic-concept-judge-5r9hDEBA.js.map} +1 -1
  161. package/dist/{sequential-D_xHrBZe.js → sequential-BfDkCBGo.js} +3 -3
  162. package/dist/{sequential-D_xHrBZe.js.map → sequential-BfDkCBGo.js.map} +1 -1
  163. package/dist/{server-D_cjseFN.js → server-DmpcFiVK.js} +4 -4
  164. package/dist/{server-D_cjseFN.js.map → server-DmpcFiVK.js.map} +1 -1
  165. package/dist/{skillopt-optimization-method-B2IEaCeF.js → skillopt-optimization-method-B2zxoDk0.js} +8 -8
  166. package/dist/{skillopt-optimization-method-B2IEaCeF.js.map → skillopt-optimization-method-B2zxoDk0.js.map} +1 -1
  167. package/dist/{statistical-heldout-CpVd6FmY.d.ts → statistical-heldout-Bu4oNOJh.d.ts} +3 -3
  168. package/dist/{statistical-heldout-CpVd6FmY.d.ts.map → statistical-heldout-Bu4oNOJh.d.ts.map} +1 -1
  169. package/dist/{store-otlp-DWGUwlyj.js → store-otlp-rU5PFlOB.js} +2 -2
  170. package/dist/{store-otlp-DWGUwlyj.js.map → store-otlp-rU5PFlOB.js.map} +1 -1
  171. package/dist/{store-tool-spans-Dt-YdAuE.d.ts → store-tool-spans-DwdokbHg.d.ts} +54 -6
  172. package/dist/store-tool-spans-DwdokbHg.d.ts.map +1 -0
  173. package/dist/{store-tool-spans-ceJoiUgS.js → store-tool-spans-zrtftcRe.js} +68 -6
  174. package/dist/store-tool-spans-zrtftcRe.js.map +1 -0
  175. package/dist/{summary-report-IGAOtgPd.js → summary-report-BMvou2oZ.js} +2 -2
  176. package/dist/{summary-report-IGAOtgPd.js.map → summary-report-BMvou2oZ.js.map} +1 -1
  177. package/dist/{summary-report-D1h4dlrK.d.ts → summary-report-BzFS5UhZ.d.ts} +2 -2
  178. package/dist/{summary-report-D1h4dlrK.d.ts.map → summary-report-BzFS5UhZ.d.ts.map} +1 -1
  179. package/dist/{task-failure-attributes-B072KO_n.js → task-failure-attributes-BOxjfbhr.js} +2 -2
  180. package/dist/{task-failure-attributes-B072KO_n.js.map → task-failure-attributes-BOxjfbhr.js.map} +1 -1
  181. package/dist/{tool-groups-B2bSNaJB.d.ts → tool-groups-qHMydbAH.d.ts} +3 -3
  182. package/dist/tool-groups-qHMydbAH.d.ts.map +1 -0
  183. package/dist/{tool-waste-C7MU9u1e.js → tool-waste-nbHPAxei.js} +2 -2
  184. package/dist/{tool-waste-C7MU9u1e.js.map → tool-waste-nbHPAxei.js.map} +1 -1
  185. package/dist/trace-repair/index.d.ts +2 -2
  186. package/dist/trace-repair/index.js +3 -3
  187. package/dist/traces.d.ts +5 -5
  188. package/dist/traces.js +7 -7
  189. package/dist/trajectory-replay/index.js +1 -1
  190. package/dist/{types-CS0qk_Yp.d.ts → types-BTRcIqFr.d.ts} +3 -3
  191. package/dist/{types-CS0qk_Yp.d.ts.map → types-BTRcIqFr.d.ts.map} +1 -1
  192. package/dist/{types-D7gEdPoQ.d.ts → types-BjB2wZM9.d.ts} +2 -2
  193. package/dist/{types-D7gEdPoQ.d.ts.map → types-BjB2wZM9.d.ts.map} +1 -1
  194. package/dist/types-C8VBbiw6.js +91 -0
  195. package/dist/types-C8VBbiw6.js.map +1 -0
  196. package/dist/{types-BvZoPTGa.d.ts → types-c3ZRTbw9.d.ts} +3 -3
  197. package/dist/{types-BvZoPTGa.d.ts.map → types-c3ZRTbw9.d.ts.map} +1 -1
  198. package/dist/{types-DQ0e2E7y.js → usage-receipt-Cx3xNeyB.js} +2 -89
  199. package/dist/usage-receipt-Cx3xNeyB.js.map +1 -0
  200. package/dist/{verdict-BQ3pCFf8.js → verdict-DhPoXApk.js} +2 -2
  201. package/dist/{verdict-BQ3pCFf8.js.map → verdict-DhPoXApk.js.map} +1 -1
  202. package/dist/{verdict-cache-B3eCVQtY.js → verdict-cache-BQEsVy9n.js} +2 -2
  203. package/dist/{verdict-cache-B3eCVQtY.js.map → verdict-cache-BQEsVy9n.js.map} +1 -1
  204. package/dist/wire/index.d.ts +1 -1
  205. package/dist/wire/index.js +1 -1
  206. package/docs/changes/evaluation-definition-identity.md +27 -0
  207. package/docs/changes/jev-evidence-review.md +18 -0
  208. package/docs/changes/jev-product-adoption.md +18 -0
  209. package/docs/changes/probability-policy-audit.md +81 -0
  210. package/docs/jev-behavior-review.md +174 -0
  211. package/docs/jev-integrations.md +50 -0
  212. package/docs/jev.md +140 -0
  213. package/docs/produced-state.md +13 -0
  214. package/docs/profile-json-identity.md +33 -0
  215. package/docs/public-api.md +111 -95
  216. package/package.json +16 -1
  217. package/dist/agent-profile-cell-Cv6UA-W_.js.map +0 -1
  218. package/dist/canonical-DPyQ_rpt.js.map +0 -1
  219. package/dist/exporters-Df7TgHFv.js.map +0 -1
  220. package/dist/index-Bp_6sj3x.d.ts.map +0 -1
  221. package/dist/index-CJ3LhKIX.d.ts.map +0 -1
  222. package/dist/metrics-Qv-cpptD.js.map +0 -1
  223. package/dist/mint-ySIIkKlV.js.map +0 -1
  224. package/dist/store-tool-spans-Dt-YdAuE.d.ts.map +0 -1
  225. package/dist/store-tool-spans-ceJoiUgS.js.map +0 -1
  226. package/dist/tool-groups-B2bSNaJB.d.ts.map +0 -1
  227. package/dist/types-DQ0e2E7y.js.map +0 -1
package/dist/rl.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { s as ValidationError } from "./errors-Dngq5h35.js";
2
- import { i as compareCodeUnits } from "./canonical-DPyQ_rpt.js";
2
+ import { i as compareCodeUnits } from "./canonical-BsZVgBhW.js";
3
3
  import { a as medianInPlace } from "./internal-BMFSR8Ns.js";
4
4
  import { t as mulberry32 } from "./random-Dn5fPWkt.js";
5
5
  import { l as wilcoxonSignedRank } from "./paired-arms-JSDcs2zx.js";
6
6
  import { r as pairedBootstrap } from "./paired-tests-C8iCsioC.js";
7
- import { a as campaignCellToRunRecord, s as decidePairedPromotion } from "./run-record-DPa2PeHx.js";
7
+ import { a as campaignCellToRunRecord, s as decidePairedPromotion } from "./run-record-BhMVsHR1.js";
8
8
  import { r as observedSplitScore, s as trainingScore } from "./reward-nw2xZGZG.js";
9
- import { s as runTaskScore } from "./run-record-DualPTn2.js";
9
+ import { s as runTaskScore } from "./run-record-tg_5H2IK.js";
10
10
  import { i as filterDeterministicallyRewarded, n as extractVerifiableReward, r as extractVerifiableRewardsFromRecords, t as detectRewardHacking } from "./reward-hacking-D0XwhVWE.js";
11
11
  import { n as InMemoryTraceStore } from "./store-DNe_Uv1Q.js";
12
- import { t as runEvalCampaign } from "./eval-campaign-CCEkwzoH.js";
12
+ import { t as runEvalCampaign } from "./eval-campaign-XFHEpN86.js";
13
13
  import { s as assertRewardGate } from "./schema-C1aaAxTf.js";
14
- import { t as isSplitEligible } from "./exporters-Df7TgHFv.js";
15
- import { t as mintRolloutRows } from "./mint-ySIIkKlV.js";
14
+ import { n as isTrainingLineEligible, s as toSftRows$1, t as isSplitEligible } from "./exporters-DEcXbvgO.js";
15
+ import { t as mintRolloutRows } from "./mint-B4zgSAJW.js";
16
16
  import { t as evaluateInterimReleaseConfidence } from "./sequential-CzK5DarL.js";
17
17
  import { n as assertUniqueObservationIds, s as validateOutcomeMetricSpecifications, t as rubricPredictiveValidity } from "./rubric-predictive-validity-CCK-1B7w.js";
18
18
  import { n as thompsonCurriculum, r as varianceBasedCurriculum, t as observationsFromRunRecords } from "./active-curriculum-OjIWgrUJ.js";
@@ -664,10 +664,12 @@ function admitUngatedByInvocation(items, idsOf, context, requirement, inspect) {
664
664
  * agent-eval's contract; without first-party exporters consumers reverse-
665
665
  * engineer the mapping every release. The exporters codify it.
666
666
  *
667
- * The exporters take callbacks for any field that isn't on the canonical
668
- * artifact (specifically: prompt + completion text, since the package
669
- * stores only their hashes by design — full text is the consumer's
670
- * trace store / raw event log).
667
+ * The text-only formats (DPO, GRPO, PRM) take callbacks for prompt and
668
+ * completion text, which the canonical artifact does not carry as flat fields —
669
+ * the consumer resolves them from its trace store / raw event log. SFT is the
670
+ * one format whose row IS the captured conversation, so it projects the line's
671
+ * inline `messages` through `rollout/exporters.toSftRows` and uses the text
672
+ * lookups only to recover a gap line (a line minted without a transcript).
671
673
  *
672
674
  * Every exporter that produces a training row accepts canonical minted rollout
673
675
  * lines. Convert run records once with `mintRolloutRows`; downstream transforms
@@ -749,7 +751,7 @@ async function toGrpoRows(lines, lookups) {
749
751
  async function grpoRowsFromLines(lines, lookups) {
750
752
  const grouped = /* @__PURE__ */ new Map();
751
753
  for (const line of lines) {
752
- if (!isSelectedSplit(line, lookups)) continue;
754
+ if (!isSplitEligible(line, lookups)) continue;
753
755
  const arr = grouped.get(line.task.instance_id) ?? [];
754
756
  arr.push(line);
755
757
  grouped.set(line.task.instance_id, arr);
@@ -796,62 +798,67 @@ function toGrpoJsonl(rows) {
796
798
  * pass `include` to filter further (e.g., keep only `reward >= 0.8` for
797
799
  * rejection-sampling SFT).
798
800
  *
799
- * Realness-gated lines are dropped outright, not zeroed. SFT is imitation
800
- * learning: unlike GRPO, where a 0 reward teaches "this trajectory was bad",
801
- * every row here is a target to copy, so a gamed trajectory must not be in the
802
- * file at all. Mirrors the waist filter in `rollout/exporters.toSftRows`.
803
- *
804
- * The exporter is fail-closed on the split, same rule as
805
- * `rollout/exporters.toSftRows` (`isSplitEligible`): `search` ships by
806
- * default, held-out lines need `allowHeldOutTrainingData: true`, `dev` and
807
- * `canary` never pass the default rule. A non-training bundle that wants an
808
- * explicit slice (e.g. a holdout-only eval bundle) names it with
809
- * `splitFilter: ['holdout']` — explicit selection replaces the default rule.
801
+ * Eligibility and the transcript projection belong to
802
+ * `rollout/exporters.toSftRows`: same fail-closed policy (realness-gated lines
803
+ * are dropped, not zeroed; `search` ships by default, held-out needs
804
+ * `allowHeldOutTrainingData`, `splitFilter` names an explicit slice) and the
805
+ * same copied-context drop. This adapter adds only the legacy text lookups: a
806
+ * line whose transcript was captured is exported as captured, tool turns
807
+ * included, and a gap line (empty `messages`, `provenance.gap` set) is
808
+ * recovered from `promptOf` / `completionOf` / `systemOf`. `meta.transcriptSource`
809
+ * says which path a row took. A captured transcript whose every turn is copied
810
+ * context yields no row rather than a lookup-built substitute.
810
811
  */
811
812
  async function toSftRows(lines, lookups) {
812
- return sftRowsFromLines(lines, lookups);
813
- }
814
- async function sftRowsFromLines(lines, lookups) {
813
+ for (const line of lines) assertRewardGate(line, "SFT export");
815
814
  const include = lookups.include ?? (() => true);
816
- const minimumQualityExclusive = lookups.minimumQualityExclusive ?? 0;
817
- if (!Number.isFinite(minimumQualityExclusive)) throw new Error("minimumQualityExclusive must be finite");
818
815
  const rows = [];
819
816
  for (const line of lines) {
820
- assertRewardGate(line, "SFT export");
821
- if (isLineRealnessGated(line)) continue;
822
- if (!isSelectedSplit(line, lookups)) continue;
823
- const score = trainableLineReward(line);
824
- if (score === null || score <= minimumQualityExclusive) continue;
825
- if (!line.outcome.is_completed || line.outcome.is_truncated || line.outcome.error !== null) continue;
826
- if (!include(line)) continue;
827
- const system = lookups.systemOf?.(line);
828
- const [prompt, completion] = await Promise.all([Promise.resolve(lookups.promptOf(line.run_id)), Promise.resolve(lookups.completionOf(line.run_id))]);
829
- const messages = [];
830
- if (system) messages.push({
831
- role: "system",
832
- content: system
833
- });
834
- messages.push({
835
- role: "user",
836
- content: prompt
837
- });
838
- messages.push({
839
- role: "assistant",
840
- content: completion
841
- });
817
+ if (!isTrainingLineEligible(line, lookups) || !include(line)) continue;
818
+ const captured = line.messages.length > 0;
819
+ const messages = captured ? line.messages : await recoveredTranscript(line, lookups);
820
+ const [row] = toSftRows$1([{
821
+ ...line,
822
+ messages
823
+ }], lookups);
824
+ if (row === void 0) continue;
842
825
  rows.push({
843
- messages,
826
+ messages: row.messages,
844
827
  meta: {
845
828
  runId: line.run_id,
829
+ rolloutId: line.rollout_id,
846
830
  candidateId: line.candidate_id ?? null,
847
831
  scenarioId: line.task.instance_id,
848
- score,
849
- model: line.policy.model
832
+ score: row.metadata.reward,
833
+ model: line.policy.model,
834
+ transcriptSource: captured ? "captured" : "lookups",
835
+ captureGap: line.provenance.gap ?? null,
836
+ realness_gated: row.metadata.realness_gated,
837
+ realness_screened: row.metadata.realness_screened
850
838
  }
851
839
  });
852
840
  }
853
841
  return rows;
854
842
  }
843
+ /** A gap line's transcript from the text lookups. Blank or non-string text is refused. */
844
+ async function recoveredTranscript(line, lookups) {
845
+ const system = lookups.systemOf?.(line);
846
+ const [prompt, completion] = await Promise.all([Promise.resolve(lookups.promptOf(line.run_id)), Promise.resolve(lookups.completionOf(line.run_id))]);
847
+ if (typeof prompt !== "string" || prompt.trim() === "" || typeof completion !== "string" || completion.trim() === "" || system != null && typeof system !== "string") throw new Error(`SFT export: rollout ${line.rollout_id} has invalid text lookups`);
848
+ const messages = [];
849
+ if (system) messages.push({
850
+ role: "system",
851
+ content: system
852
+ });
853
+ messages.push({
854
+ role: "user",
855
+ content: prompt
856
+ }, {
857
+ role: "assistant",
858
+ content: completion
859
+ });
860
+ return messages;
861
+ }
855
862
  function toSftJsonl(rows) {
856
863
  return rows.map((r) => JSON.stringify(r)).join("\n") + (rows.length > 0 ? "\n" : "");
857
864
  }
@@ -961,10 +968,6 @@ function stepRewardsToJsonl(stepRewards, context) {
961
968
  }));
962
969
  return rows.map((r) => JSON.stringify(r)).join("\n") + (rows.length > 0 ? "\n" : "");
963
970
  }
964
- function isSelectedSplit(line, options) {
965
- if (options.splitFilter !== void 0) return options.splitFilter.includes(line.task.split);
966
- return isSplitEligible(line, options);
967
- }
968
971
  //#endregion
969
972
  //#region src/rl/dataset.ts
970
973
  const DATASET_FORMAT_SET = /* @__PURE__ */ new Set([
@@ -1052,9 +1055,10 @@ function computeStatsFromLines(lines) {
1052
1055
  /**
1053
1056
  * Package graded rollout lines into a publishable RL dataset bundle: the
1054
1057
  * trainer-format JSONL files + a manifest + a datasheet. DPO requires
1055
- * pre-extracted preference triples (pass `preferences`); GRPO/SFT derive from
1056
- * the lines directly via the supplied lookups. Throws on an empty corpus —
1057
- * an empty dataset must never be published.
1058
+ * pre-extracted preference triples (pass `preferences`); GRPO derives from the
1059
+ * lines via the supplied text lookups; SFT ships each line's captured
1060
+ * transcript and uses the lookups only to recover gap lines. Throws on an
1061
+ * empty corpus — an empty dataset must never be published.
1058
1062
  */
1059
1063
  async function buildRlDataset(lines, lookups, config, preferences) {
1060
1064
  if (lines.length === 0) throw new Error("buildRlDataset: no rollout lines — refusing to package an empty dataset");
@@ -2058,12 +2062,25 @@ async function runRLCampaign(opts) {
2058
2062
  validateOutcomeMetricSpecifications(outcomeMetrics);
2059
2063
  }
2060
2064
  const splitTag = opts.splitTag ?? "search";
2065
+ const stores = /* @__PURE__ */ new Map();
2061
2066
  const campaign = await runEvalCampaign({
2062
2067
  ...opts,
2063
- splitTag
2068
+ splitTag,
2069
+ storeFactory: (params) => {
2070
+ const store = opts.storeFactory(params);
2071
+ stores.set(params.runId, store);
2072
+ return store;
2073
+ }
2064
2074
  });
2065
2075
  const rewardSignals = extractVerifiableRewardsFromRecords(campaign.runs, opts.verifiableReward ?? {});
2066
- const { rows: rolloutLines } = await mintRolloutRows(campaign.runs.filter((run) => runTaskScore(run) !== void 0), new InMemoryTraceStore());
2076
+ const scoredRuns = campaign.runs.filter((run) => runTaskScore(run) !== void 0);
2077
+ const rolloutLines = [];
2078
+ for (const run of scoredRuns) {
2079
+ const store = stores.get(run.runId);
2080
+ if (!store) throw new Error(`runRLCampaign: evaluation trace store missing for ${run.runId}`);
2081
+ const { rows } = await mintRolloutRows([run], store, opts.rollout);
2082
+ rolloutLines.push(...rows);
2083
+ }
2067
2084
  const preferences = extractPreferences(rolloutLines, {
2068
2085
  ...opts.preferences,
2069
2086
  strategy: opts.preferences?.strategy ?? "paired-by-scenario-and-seed",
@@ -2112,6 +2129,7 @@ async function runRLCampaign(opts) {
2112
2129
  });
2113
2130
  return {
2114
2131
  campaign,
2132
+ rolloutLines,
2115
2133
  rewardSignals,
2116
2134
  preferences,
2117
2135
  interimConfidence,