@tangle-network/agent-eval 0.217.1 → 0.219.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 (258) hide show
  1. package/CHANGELOG.md +57 -1
  2. package/dist/adapters/http.d.ts +3 -3
  3. package/dist/adapters/http.d.ts.map +1 -1
  4. package/dist/adapters/http.js +1 -0
  5. package/dist/adapters/http.js.map +1 -1
  6. package/dist/{agent-profile-DTt8uGP9.d.ts → agent-profile-D01Io2Xw.d.ts} +4 -4
  7. package/dist/{agent-profile-DTt8uGP9.d.ts.map → agent-profile-D01Io2Xw.d.ts.map} +1 -1
  8. package/dist/analyst/index.d.ts +13 -13
  9. package/dist/analyst/index.d.ts.map +1 -1
  10. package/dist/analyst/index.js +10 -10
  11. package/dist/analyst/index.js.map +1 -1
  12. package/dist/{analyze-runs-DyeNcenW.d.ts → analyze-runs-BWAHBDAw.d.ts} +4 -4
  13. package/dist/{analyze-runs-DyeNcenW.d.ts.map → analyze-runs-BWAHBDAw.d.ts.map} +1 -1
  14. package/dist/{benchmark-command-xQK8nOI6.js → benchmark-command-BzmMTnvC.js} +664 -565
  15. package/dist/benchmark-command-BzmMTnvC.js.map +1 -0
  16. package/dist/benchmarks/index.d.ts +5 -5
  17. package/dist/benchmarks/index.js +3 -3
  18. package/dist/benchmarks/index.js.map +1 -1
  19. package/dist/campaign/index.d.ts +8 -8
  20. package/dist/campaign/index.js +11 -11
  21. package/dist/{campaign-CJGkxAQ6.js → campaign-BVPC6ODQ.js} +452 -282
  22. package/dist/campaign-BVPC6ODQ.js.map +1 -0
  23. package/dist/{campaign-evidence-CQYw8_0H.js → campaign-evidence-DunzcJGv.js} +2 -2
  24. package/dist/campaign-evidence-DunzcJGv.js.map +1 -0
  25. package/dist/{chat-client-ldqxYYTN.js → chat-client-CMQ8_h4J.js} +2 -2
  26. package/dist/{chat-client-ldqxYYTN.js.map → chat-client-CMQ8_h4J.js.map} +1 -1
  27. package/dist/{chat-json-call-DavzexSp.js → chat-json-call-BrZKn0L3.js} +2 -2
  28. package/dist/{chat-json-call-DavzexSp.js.map → chat-json-call-BrZKn0L3.js.map} +1 -1
  29. package/dist/cli.js +10 -10
  30. package/dist/{completion-verifier-B_jw6C9p.js → completion-verifier-Cigap8CG.js} +5 -5
  31. package/dist/{completion-verifier-B_jw6C9p.js.map → completion-verifier-Cigap8CG.js.map} +1 -1
  32. package/dist/contract/index.d.ts +11 -11
  33. package/dist/contract/index.js +91 -11
  34. package/dist/contract/index.js.map +1 -1
  35. package/dist/{cost-ledger-D0352Z4d.js → cost-ledger-BGZB6yY2.js} +75 -2
  36. package/dist/cost-ledger-BGZB6yY2.js.map +1 -0
  37. package/dist/{cost-ledger-Jk62OBfF.d.ts → cost-ledger-C1W3ICmP.d.ts} +26 -2
  38. package/dist/cost-ledger-C1W3ICmP.d.ts.map +1 -0
  39. package/dist/{default-registry-ClYjq3QE.js → default-registry-BrKmT01n.js} +310 -278
  40. package/dist/{default-registry-ClYjq3QE.js.map → default-registry-BrKmT01n.js.map} +1 -1
  41. package/dist/{default-registry-DXgLmoDI.d.ts → default-registry-Cwg_QN3d.d.ts} +6 -6
  42. package/dist/{default-registry-DXgLmoDI.d.ts.map → default-registry-Cwg_QN3d.d.ts.map} +1 -1
  43. package/dist/{define-agent-eval-BIkH_gAR.d.ts → define-agent-eval-C2nFhHPu.d.ts} +8 -8
  44. package/dist/{define-agent-eval-BIkH_gAR.d.ts.map → define-agent-eval-C2nFhHPu.d.ts.map} +1 -1
  45. package/dist/{define-agent-eval-BDxNlP3D.js → define-agent-eval-UQY3VbJ2.js} +165 -105
  46. package/dist/define-agent-eval-UQY3VbJ2.js.map +1 -0
  47. package/dist/diagnosis/index.d.ts +2 -2
  48. package/dist/{dspy-rlm-engine-DhdCr1Dc.js → dspy-rlm-engine-Bn_Mt_LW.js} +3 -3
  49. package/dist/{dspy-rlm-engine-DhdCr1Dc.js.map → dspy-rlm-engine-Bn_Mt_LW.js.map} +1 -1
  50. package/dist/{engine-BvZ0R-36.d.ts → engine-BpGGw6cd.d.ts} +3 -3
  51. package/dist/{engine-BvZ0R-36.d.ts.map → engine-BpGGw6cd.d.ts.map} +1 -1
  52. package/dist/eval-campaign-BUMIxKTE.js +393 -0
  53. package/dist/eval-campaign-BUMIxKTE.js.map +1 -0
  54. package/dist/{evaluation-jTjC_QQD.d.ts → evaluation-CBdQt_kr.d.ts} +4 -4
  55. package/dist/{evaluation-jTjC_QQD.d.ts.map → evaluation-CBdQt_kr.d.ts.map} +1 -1
  56. package/dist/evaluation.d.ts +1 -1
  57. package/dist/evaluation.js +1 -1
  58. package/dist/{exact-types-CflbJ9f3.d.ts → exact-types-BYFmYq44.d.ts} +2 -2
  59. package/dist/{exact-types-CflbJ9f3.d.ts.map → exact-types-BYFmYq44.d.ts.map} +1 -1
  60. package/dist/experiment/index.d.ts +24 -1
  61. package/dist/experiment/index.d.ts.map +1 -1
  62. package/dist/experiment/index.js +110 -71
  63. package/dist/experiment/index.js.map +1 -1
  64. package/dist/{exporters-Cl6IeNAu.js → exporters-DWvM16LE.js} +2 -2
  65. package/dist/{exporters-Cl6IeNAu.js.map → exporters-DWvM16LE.js.map} +1 -1
  66. package/dist/{external-optimizer-process-KVFGvYX1.js → external-optimizer-process-wOLfzsCC.js} +2 -2
  67. package/dist/{external-optimizer-process-KVFGvYX1.js.map → external-optimizer-process-wOLfzsCC.js.map} +1 -1
  68. package/dist/{external-optimizer-subprocess-XIHBOSKt.js → external-optimizer-subprocess-D670Oxf2.js} +4 -4
  69. package/dist/{external-optimizer-subprocess-XIHBOSKt.js.map → external-optimizer-subprocess-D670Oxf2.js.map} +1 -1
  70. package/dist/{feedback-trajectory-BWmhRBGu.d.ts → feedback-trajectory-DhB9WzYg.d.ts} +3 -3
  71. package/dist/{feedback-trajectory-BWmhRBGu.d.ts.map → feedback-trajectory-DhB9WzYg.d.ts.map} +1 -1
  72. package/dist/{findings-store-BMVQtEsm.js → findings-store-CvNo712L.js} +6 -6
  73. package/dist/{findings-store-BMVQtEsm.js.map → findings-store-CvNo712L.js.map} +1 -1
  74. package/dist/fuzz.d.ts +1 -1
  75. package/dist/fuzz.js +1 -1
  76. package/dist/{hf-dataset-D9f7-oX7.js → hf-dataset-CKxIJQba.js} +3 -3
  77. package/dist/{hf-dataset-D9f7-oX7.js.map → hf-dataset-CKxIJQba.js.map} +1 -1
  78. package/dist/hosted/index.js +1 -1
  79. package/dist/{index-CX-GAUpw.d.ts → index-CHxwfW5g.d.ts} +2 -2
  80. package/dist/{index-CX-GAUpw.d.ts.map → index-CHxwfW5g.d.ts.map} +1 -1
  81. package/dist/{index-BLGqZ81N.d.ts → index-CVFStrQD.d.ts} +8 -8
  82. package/dist/{index-BLGqZ81N.d.ts.map → index-CVFStrQD.d.ts.map} +1 -1
  83. package/dist/{index-9jJ2fKSX.d.ts → index-CalAsXMR.d.ts} +7 -5
  84. package/dist/index-CalAsXMR.d.ts.map +1 -0
  85. package/dist/{index-CiRwLv2R.d.ts → index-D7fmC-1K.d.ts} +3 -4
  86. package/dist/index-D7fmC-1K.d.ts.map +1 -0
  87. package/dist/{index-BiT6RtNH.d.ts → index-DAXfpVf7.d.ts} +10 -10
  88. package/dist/{index-BiT6RtNH.d.ts.map → index-DAXfpVf7.d.ts.map} +1 -1
  89. package/dist/{index-ZuWx52WG.d.ts → index-Q6DvdcwI.d.ts} +67 -24
  90. package/dist/index-Q6DvdcwI.d.ts.map +1 -0
  91. package/dist/index.d.ts +26 -26
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +615 -692
  94. package/dist/index.js.map +1 -1
  95. package/dist/{integrity-DOd9Q86O.js → integrity-C8oUeB0g.js} +322 -197
  96. package/dist/integrity-C8oUeB0g.js.map +1 -0
  97. package/dist/{integrity-_qgZLA5p.d.ts → integrity-CCwvezWS.d.ts} +2 -2
  98. package/dist/{integrity-_qgZLA5p.d.ts.map → integrity-CCwvezWS.d.ts.map} +1 -1
  99. package/dist/{journal-CR4QikYp.js → journal-C7om8Gum.js} +48 -38
  100. package/dist/journal-C7om8Gum.js.map +1 -0
  101. package/dist/judge-gate-Co5tuh57.js.map +1 -1
  102. package/dist/{judge-gate-DsL0yFcb.d.ts → judge-gate-Dc_mXQsL.d.ts} +2 -2
  103. package/dist/judge-gate-Dc_mXQsL.d.ts.map +1 -0
  104. package/dist/{kind-factory-Gy4fXixd.js → kind-factory-BhxbtUsQ.js} +2 -2
  105. package/dist/{kind-factory-Gy4fXixd.js.map → kind-factory-BhxbtUsQ.js.map} +1 -1
  106. package/dist/ledger-core/index.d.ts +1 -1
  107. package/dist/ledger-core/index.js +2 -2
  108. package/dist/ledger-core/lock-holder.d.ts +2 -0
  109. package/dist/ledger-core/lock-holder.js +181 -0
  110. package/dist/ledger-core/lock-holder.js.map +1 -0
  111. package/dist/{ledger-core-DrJhbms9.js → ledger-core-CAxUdDk0.js} +2 -2
  112. package/dist/{ledger-core-DrJhbms9.js.map → ledger-core-CAxUdDk0.js.map} +1 -1
  113. package/dist/{llm-client-BshCREn6.js → llm-client-DXuOTseU.js} +239 -249
  114. package/dist/llm-client-DXuOTseU.js.map +1 -0
  115. package/dist/{llm-judge-C8jMTNNG.js → llm-judge-Cc8vDJh_.js} +648 -459
  116. package/dist/llm-judge-Cc8vDJh_.js.map +1 -0
  117. package/dist/lock-holder-DaJbfpci.d.ts +86 -0
  118. package/dist/lock-holder-DaJbfpci.d.ts.map +1 -0
  119. package/dist/matrix/index.d.ts +2 -2
  120. package/dist/{matrix-DHe-dwVJ.d.ts → matrix-Cf-AGxGh.d.ts} +4 -4
  121. package/dist/{matrix-DHe-dwVJ.d.ts.map → matrix-Cf-AGxGh.d.ts.map} +1 -1
  122. package/dist/meta-eval/index.d.ts +2 -2
  123. package/dist/{mint-zszyYlpA.js → mint-CbdwjTPW.js} +2 -2
  124. package/dist/{mint-zszyYlpA.js.map → mint-CbdwjTPW.js.map} +1 -1
  125. package/dist/{mint-BRZXuwRi.d.ts → mint-CkzpVPdz.d.ts} +3 -3
  126. package/dist/{mint-BRZXuwRi.d.ts.map → mint-CkzpVPdz.d.ts.map} +1 -1
  127. package/dist/multishot/golden/index.d.ts +1 -1
  128. package/dist/multishot/index.d.ts +2 -2
  129. package/dist/multishot/index.js.map +1 -1
  130. package/dist/openapi.json +1 -1
  131. package/dist/{pareto-BzsxidFD.js → pareto-BiBnQXAE.js} +306 -212
  132. package/dist/pareto-BiBnQXAE.js.map +1 -0
  133. package/dist/pipelines/index.d.ts.map +1 -1
  134. package/dist/pipelines/index.js.map +1 -1
  135. package/dist/{prime-protocol-BWG2DQIk.d.ts → prime-protocol-CckHBxGu.d.ts} +3 -3
  136. package/dist/{prime-protocol-BWG2DQIk.d.ts.map → prime-protocol-CckHBxGu.d.ts.map} +1 -1
  137. package/dist/{promotion-gate-DaY95yU6.d.ts → promotion-gate-CkVZHagC.d.ts} +3 -3
  138. package/dist/{promotion-gate-DaY95yU6.d.ts.map → promotion-gate-CkVZHagC.d.ts.map} +1 -1
  139. package/dist/{proposal-findings-BbWidvUk.js → proposal-findings-E1aSC_cU.js} +2 -2
  140. package/dist/{proposal-findings-BbWidvUk.js.map → proposal-findings-E1aSC_cU.js.map} +1 -1
  141. package/dist/{registry-ssNoHzwD.d.ts → registry-B_yG-1jh.d.ts} +5 -5
  142. package/dist/{registry-ssNoHzwD.d.ts.map → registry-B_yG-1jh.d.ts.map} +1 -1
  143. package/dist/{render-C-w2EZ6p.js → render-Cs34y0iX.js} +404 -208
  144. package/dist/render-Cs34y0iX.js.map +1 -0
  145. package/dist/reporting.d.ts +3 -3
  146. package/dist/{researcher-0ABVIdGa.d.ts → researcher-H0p44OYC.d.ts} +5 -5
  147. package/dist/{researcher-0ABVIdGa.d.ts.map → researcher-H0p44OYC.d.ts.map} +1 -1
  148. package/dist/{reward-DrZ71vnf.d.ts → reward-BeUgVVC_.d.ts} +2 -2
  149. package/dist/{reward-DrZ71vnf.d.ts.map → reward-BeUgVVC_.d.ts.map} +1 -1
  150. package/dist/{reward-hacking-E52wq86n.d.ts → reward-hacking-WTxUbtbb.d.ts} +2 -2
  151. package/dist/{reward-hacking-E52wq86n.d.ts.map → reward-hacking-WTxUbtbb.d.ts.map} +1 -1
  152. package/dist/rl.d.ts +8 -8
  153. package/dist/rl.js +4 -4
  154. package/dist/rollout/index.d.ts +3 -3
  155. package/dist/rollout/index.js +5 -5
  156. package/dist/{rollout-D6C50mfA.js → rollout-Dd1ucT_M.js} +5 -5
  157. package/dist/{rollout-D6C50mfA.js.map → rollout-Dd1ucT_M.js.map} +1 -1
  158. package/dist/{rubric-predictive-validity-DiwT8PbL.d.ts → rubric-predictive-validity-noY7uE03.d.ts} +2 -2
  159. package/dist/{rubric-predictive-validity-DiwT8PbL.d.ts.map → rubric-predictive-validity-noY7uE03.d.ts.map} +1 -1
  160. package/dist/{run-record-CaxbLq6Y.d.ts → run-record-C3awiXPf.d.ts} +2 -2
  161. package/dist/{run-record-CaxbLq6Y.d.ts.map → run-record-C3awiXPf.d.ts.map} +1 -1
  162. package/dist/schema-C-ziyJD7.d.ts.map +1 -1
  163. package/dist/{schema-DxcKTzbi.js → schema-CvhfLjtZ.js} +77 -47
  164. package/dist/schema-CvhfLjtZ.js.map +1 -0
  165. package/dist/search/index.d.ts +2 -2
  166. package/dist/search/index.d.ts.map +1 -1
  167. package/dist/search/index.js +2 -2
  168. package/dist/{search-kernel-DxqjBxA-.d.ts → search-kernel-Dloxd6gs.d.ts} +5 -5
  169. package/dist/{search-kernel-DxqjBxA-.d.ts.map → search-kernel-Dloxd6gs.d.ts.map} +1 -1
  170. package/dist/{search-ledger-TUvB5gWH.js → search-ledger-CZRqtFbW.js} +252 -245
  171. package/dist/search-ledger-CZRqtFbW.js.map +1 -0
  172. package/dist/{search-ledger-file-UKCO2r8a.js → search-ledger-file-Bd5Tioq6.js} +3 -3
  173. package/dist/{search-ledger-file-UKCO2r8a.js.map → search-ledger-file-Bd5Tioq6.js.map} +1 -1
  174. package/dist/{search-shipper-Cw2z3-td.js → search-shipper-Dn3NLsuH.js} +3 -3
  175. package/dist/{search-shipper-Cw2z3-td.js.map → search-shipper-Dn3NLsuH.js.map} +1 -1
  176. package/dist/{search-summary-DQIvJsSB.js → search-summary-D4bwYnAE.js} +3 -3
  177. package/dist/{search-summary-DQIvJsSB.js.map → search-summary-D4bwYnAE.js.map} +1 -1
  178. package/dist/{server-DoVbqqtJ.js → server-8TS8XCvg.js} +3 -3
  179. package/dist/{server-DoVbqqtJ.js.map → server-8TS8XCvg.js.map} +1 -1
  180. package/dist/{single-run-lock-U58yf8N6.js → single-run-lock-Dekd8_Wv.js} +7 -7
  181. package/dist/single-run-lock-Dekd8_Wv.js.map +1 -0
  182. package/dist/{skillopt-optimization-method-kyL94-ri.js → skillopt-optimization-method-DLKqdhcR.js} +1384 -1059
  183. package/dist/skillopt-optimization-method-DLKqdhcR.js.map +1 -0
  184. package/dist/{statistical-heldout-C9AbgREN.d.ts → statistical-heldout-3z3I-kJN.d.ts} +3 -3
  185. package/dist/{statistical-heldout-C9AbgREN.d.ts.map → statistical-heldout-3z3I-kJN.d.ts.map} +1 -1
  186. package/dist/{store-otlp-BteDAbHK.js → store-otlp-dyWE3wAG.js} +2 -2
  187. package/dist/{store-otlp-BteDAbHK.js.map → store-otlp-dyWE3wAG.js.map} +1 -1
  188. package/dist/{store-tool-spans-D5l_OfTJ.js → store-tool-spans-DIUgZbzu.js} +3 -3
  189. package/dist/{store-tool-spans-D5l_OfTJ.js.map → store-tool-spans-DIUgZbzu.js.map} +1 -1
  190. package/dist/{store-tool-spans-DZS0HWVf.d.ts → store-tool-spans-DPwXHQkH.d.ts} +7 -7
  191. package/dist/{store-tool-spans-DZS0HWVf.d.ts.map → store-tool-spans-DPwXHQkH.d.ts.map} +1 -1
  192. package/dist/{summary-report-DM7tlml1.d.ts → summary-report-C8V49Jt3.d.ts} +18 -3
  193. package/dist/summary-report-C8V49Jt3.d.ts.map +1 -0
  194. package/dist/supervisor-run/index.d.ts.map +1 -1
  195. package/dist/supervisor-run/index.js +3 -3
  196. package/dist/{systemone-Bp_Ac0p1.d.ts → systemone-DVA7t76V.d.ts} +6 -6
  197. package/dist/{systemone-Bp_Ac0p1.d.ts.map → systemone-DVA7t76V.d.ts.map} +1 -1
  198. package/dist/{systemone-review-CwE6JGIp.d.ts → systemone-review-CUBMuTLi.d.ts} +2 -2
  199. package/dist/{systemone-review-CwE6JGIp.d.ts.map → systemone-review-CUBMuTLi.d.ts.map} +1 -1
  200. package/dist/systemone.d.ts +3 -3
  201. package/dist/{terminal-record-78g6E4vh.js → terminal-record-D4Rv-j1W.js} +241 -193
  202. package/dist/{terminal-record-78g6E4vh.js.map → terminal-record-D4Rv-j1W.js.map} +1 -1
  203. package/dist/{tool-groups-DyNz2JZ_.d.ts → tool-groups-LISbBWCg.d.ts} +3 -3
  204. package/dist/tool-groups-LISbBWCg.d.ts.map +1 -0
  205. package/dist/{trace-questions-xxwgsuMi.d.ts → trace-questions-C42fYEE4.d.ts} +4 -4
  206. package/dist/{trace-questions-xxwgsuMi.d.ts.map → trace-questions-C42fYEE4.d.ts.map} +1 -1
  207. package/dist/trace-repair/index.d.ts +3 -3
  208. package/dist/traces.d.ts +6 -6
  209. package/dist/traces.js +3 -3
  210. package/dist/trajectory-replay/index.d.ts +4 -1
  211. package/dist/trajectory-replay/index.d.ts.map +1 -1
  212. package/dist/trajectory-replay/index.js +854 -823
  213. package/dist/trajectory-replay/index.js.map +1 -1
  214. package/dist/{tree-BGRglkKd.js → tree-DSqwJpL9.js} +122 -14
  215. package/dist/tree-DSqwJpL9.js.map +1 -0
  216. package/dist/{types-CW8ewATZ.d.ts → types-8yQzNm8u.d.ts} +4 -4
  217. package/dist/{types-CW8ewATZ.d.ts.map → types-8yQzNm8u.d.ts.map} +1 -1
  218. package/dist/{types-D8GhJoHk.d.ts → types-CHfn1zg5.d.ts} +70 -72
  219. package/dist/types-CHfn1zg5.d.ts.map +1 -0
  220. package/dist/{types-DtMbFw6U.d.ts → types-D8GXK9Z5.d.ts} +3 -3
  221. package/dist/{types-DtMbFw6U.d.ts.map → types-D8GXK9Z5.d.ts.map} +1 -1
  222. package/dist/{types-D-mgRzlh.d.ts → types-eMhdacVp.d.ts} +2 -2
  223. package/dist/{types-D-mgRzlh.d.ts.map → types-eMhdacVp.d.ts.map} +1 -1
  224. package/dist/wire/index.d.ts +3 -3
  225. package/dist/wire/index.js +1 -1
  226. package/docs/campaign-proposers.md +16 -0
  227. package/docs/concepts.md +31 -0
  228. package/docs/design/statistics-decisions.md +1 -1
  229. package/docs/eval-surface-map.md +1 -0
  230. package/docs/profile-json-identity.md +1 -2
  231. package/docs/public-api.md +100 -88
  232. package/package.json +8 -6
  233. package/dist/benchmark-command-xQK8nOI6.js.map +0 -1
  234. package/dist/campaign-CJGkxAQ6.js.map +0 -1
  235. package/dist/campaign-evidence-CQYw8_0H.js.map +0 -1
  236. package/dist/cost-ledger-D0352Z4d.js.map +0 -1
  237. package/dist/cost-ledger-Jk62OBfF.d.ts.map +0 -1
  238. package/dist/define-agent-eval-BDxNlP3D.js.map +0 -1
  239. package/dist/eval-campaign-BLEfBGbA.js +0 -343
  240. package/dist/eval-campaign-BLEfBGbA.js.map +0 -1
  241. package/dist/index-9jJ2fKSX.d.ts.map +0 -1
  242. package/dist/index-CiRwLv2R.d.ts.map +0 -1
  243. package/dist/index-ZuWx52WG.d.ts.map +0 -1
  244. package/dist/integrity-DOd9Q86O.js.map +0 -1
  245. package/dist/journal-CR4QikYp.js.map +0 -1
  246. package/dist/judge-gate-DsL0yFcb.d.ts.map +0 -1
  247. package/dist/llm-client-BshCREn6.js.map +0 -1
  248. package/dist/llm-judge-C8jMTNNG.js.map +0 -1
  249. package/dist/pareto-BzsxidFD.js.map +0 -1
  250. package/dist/render-C-w2EZ6p.js.map +0 -1
  251. package/dist/schema-DxcKTzbi.js.map +0 -1
  252. package/dist/search-ledger-TUvB5gWH.js.map +0 -1
  253. package/dist/single-run-lock-U58yf8N6.js.map +0 -1
  254. package/dist/skillopt-optimization-method-kyL94-ri.js.map +0 -1
  255. package/dist/summary-report-DM7tlml1.d.ts.map +0 -1
  256. package/dist/tool-groups-DyNz2JZ_.d.ts.map +0 -1
  257. package/dist/tree-BGRglkKd.js.map +0 -1
  258. package/dist/types-D8GhJoHk.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { c as unscreenedRewardFields } from "./reward-nw2xZGZG.js";
2
2
  import { n as isRecord } from "./json-BhdsJaOQ.js";
3
- import { f as validateRolloutLine, r as ROLLOUT_SCHEMA, u as isRolloutLine } from "./schema-DxcKTzbi.js";
4
- import { a as nonEmptyString, c as parseSupervisorTree, i as asRecord, m as isUnavailable, o as parseJsonRecord, r as readTerminalRecord } from "./terminal-record-78g6E4vh.js";
3
+ import { f as validateRolloutLine, r as ROLLOUT_SCHEMA, u as isRolloutLine } from "./schema-CvhfLjtZ.js";
4
+ import { a as nonEmptyString, c as parseSupervisorTree, i as asRecord, m as isUnavailable, o as parseJsonRecord, r as readTerminalRecord } from "./terminal-record-D4Rv-j1W.js";
5
5
  //#region src/supervisor-run/integrity-issues.ts
6
6
  function evidence(path, value) {
7
7
  return {
@@ -180,7 +180,7 @@ function steerIssues(joined, rootCompleted) {
180
180
  * workers with a terminal event, because a live worker's current turn and session are still
181
181
  * being written. A worker whose store records neither fact is not counted either way.
182
182
  */
183
- function transcriptIssues(source, facts) {
183
+ function transcriptIssues$1(source, facts) {
184
184
  if (source.workers === null) return [];
185
185
  const closed = new Set(facts.closes.map((close) => close.id).filter((id) => id.length > 0));
186
186
  const closedWorkers = source.workers.filter((worker) => worker.workerId !== void 0 && closed.has(worker.workerId));
@@ -439,7 +439,7 @@ function sourceIssues(source, facts, tree) {
439
439
  }));
440
440
  return out;
441
441
  }
442
- out.push(...transcriptIssues(source, facts));
442
+ out.push(...transcriptIssues$1(source, facts));
443
443
  const joined = joinWorkerControls(facts);
444
444
  if (joined.issue !== null) out.push(joined.issue);
445
445
  const rootCompleted = tree.rootId !== null && tree.nodes.filter((node) => node.rollout_id === tree.rootId).length === 1 && tree.nodes.find((node) => node.rollout_id === tree.rootId)?.outcome.is_completed === true;
@@ -504,10 +504,30 @@ function unavailableNodeChecks(record) {
504
504
  if (!isRecord(record.raw.outcome)) checks.push("timing", "terminal-state");
505
505
  return [...new Set(checks)];
506
506
  }
507
- function treeIssues(tree, uncertainty = {}) {
508
- const out = [];
507
+ function buildTreeView(tree, uncertainty) {
509
508
  const records = tree.nodes.map(nodeRecord);
510
509
  const malformedSourceRows = tree.gaps.filter((gap) => gap.code === "source-row-malformed").reduce((count, gap) => count + (gap.count ?? 1), 0);
510
+ const byId = /* @__PURE__ */ new Map();
511
+ for (const record of records) {
512
+ if (record.id === null) continue;
513
+ const matches = byId.get(record.id) ?? [];
514
+ matches.push(record);
515
+ byId.set(record.id, matches);
516
+ }
517
+ const unknownIdentityRows = records.filter((record) => record.id === null).length + Math.max(malformedSourceRows, uncertainty.unknownIdentityRows ?? 0);
518
+ return {
519
+ tree,
520
+ uncertainty,
521
+ records,
522
+ byId,
523
+ unique: records.filter((record) => record.id !== null && byId.get(record.id)?.length === 1),
524
+ unknownIdentityRows
525
+ };
526
+ }
527
+ /** Nodes that fail canonical rollout validation, and the checks that cannot run for them. */
528
+ function schemaIssues(view) {
529
+ const { records } = view;
530
+ const out = [];
511
531
  for (const record of records) {
512
532
  if (record.errors.length === 0) continue;
513
533
  out.push(issue({
@@ -538,13 +558,12 @@ function treeIssues(tree, uncertainty = {}) {
538
558
  }
539
559
  }));
540
560
  }
541
- const byId = /* @__PURE__ */ new Map();
542
- for (const record of records) {
543
- if (record.id === null) continue;
544
- const matches = byId.get(record.id) ?? [];
545
- matches.push(record);
546
- byId.set(record.id, matches);
547
- }
561
+ return out;
562
+ }
563
+ /** Rollout ids claimed by more than one node. */
564
+ function duplicateIdIssues(view) {
565
+ const { byId } = view;
566
+ const out = [];
548
567
  for (const [rolloutId, matches] of byId) {
549
568
  if (matches.length < 2) continue;
550
569
  out.push(issue({
@@ -562,8 +581,12 @@ function treeIssues(tree, uncertainty = {}) {
562
581
  recommendedAction: "Give every invocation one stable rollout id and regenerate the tree."
563
582
  }));
564
583
  }
565
- const unknownIdentityRows = records.filter((record) => record.id === null).length + Math.max(malformedSourceRows, uncertainty.unknownIdentityRows ?? 0);
566
- const unique = records.filter((record) => record.id !== null && byId.get(record.id)?.length === 1);
584
+ return out;
585
+ }
586
+ /** Whether the declared root exists and is unambiguous; returns the root row when it does. */
587
+ function rootIssues(view) {
588
+ const { tree, records, byId, unknownIdentityRows } = view;
589
+ const out = [];
567
590
  let root;
568
591
  if (tree.rootId === null) out.push(issue({
569
592
  code: "root-unavailable",
@@ -607,6 +630,15 @@ function treeIssues(tree, uncertainty = {}) {
607
630
  recommendedAction: "Restore the root rollout row or correct rootId."
608
631
  }));
609
632
  }
633
+ return {
634
+ issues: out,
635
+ root
636
+ };
637
+ }
638
+ /** The root must be parentless and labeled a supervisor. */
639
+ function rootShapeIssues(view, root) {
640
+ const { tree } = view;
641
+ const out = [];
610
642
  if (root !== void 0) {
611
643
  if (root.parent !== void 0 && root.parent !== null) out.push(issue({
612
644
  code: "root-has-parent",
@@ -629,6 +661,12 @@ function treeIssues(tree, uncertainty = {}) {
629
661
  recommendedAction: "Preserve the root invocation role as supervisor when minting rollout rows."
630
662
  }));
631
663
  }
664
+ return out;
665
+ }
666
+ /** Parent-child edges: detached nodes, missing parents, cross-run edges and impossible orderings. */
667
+ function edgeIssues(view) {
668
+ const { tree, uncertainty, byId, unique, unknownIdentityRows } = view;
669
+ const out = [];
632
670
  for (const record of unique) {
633
671
  if (record.parent === void 0) continue;
634
672
  if (record.parent === null) {
@@ -712,6 +750,12 @@ function treeIssues(tree, uncertainty = {}) {
712
750
  recommendedAction: "Correct the causal timestamps or attach the child to its actual spawner."
713
751
  }));
714
752
  }
753
+ return out;
754
+ }
755
+ /** Invocations timestamped as closing before they started. */
756
+ function closeBeforeStartIssues(view) {
757
+ const { unique } = view;
758
+ const out = [];
715
759
  for (const record of unique) {
716
760
  const start = metric(record, ["spawned_at", "started_at"]);
717
761
  const close = metric(record, [
@@ -731,6 +775,12 @@ function treeIssues(tree, uncertainty = {}) {
731
775
  recommendedAction: "Correct the event ordering or retain clock-domain metadata."
732
776
  }));
733
777
  }
778
+ return out;
779
+ }
780
+ /** Parent cycles, each reported once. */
781
+ function parentCycleIssues(view) {
782
+ const { byId, unique } = view;
783
+ const out = [];
734
784
  const emittedCycles = /* @__PURE__ */ new Set();
735
785
  const resolved = /* @__PURE__ */ new Set();
736
786
  for (const start of unique) {
@@ -773,6 +823,12 @@ function treeIssues(tree, uncertainty = {}) {
773
823
  }
774
824
  for (const id of path) resolved.add(id);
775
825
  }
826
+ return out;
827
+ }
828
+ /** A completed run whose children never recorded a terminal outcome. */
829
+ function childTerminalIssues(view, root) {
830
+ const { unique } = view;
831
+ const out = [];
776
832
  if (root?.completed === true) {
777
833
  const missingTerminal = unique.filter((record) => record.id !== root?.id && record.terminal === false);
778
834
  if (missingTerminal.length > 0) out.push(issue({
@@ -790,6 +846,12 @@ function treeIssues(tree, uncertainty = {}) {
790
846
  }
791
847
  }));
792
848
  }
849
+ return out;
850
+ }
851
+ /** Rows with neither inlined messages nor a retained transcript. */
852
+ function transcriptIssues(view) {
853
+ const { records } = view;
854
+ const out = [];
793
855
  const uninlined = records.filter((record) => record.messages?.length === 0);
794
856
  const missingTranscripts = uninlined.filter((record) => record.transcriptRef === null);
795
857
  if (missingTranscripts.length > 0) out.push(issue({
@@ -807,6 +869,12 @@ function treeIssues(tree, uncertainty = {}) {
807
869
  retained_by_reference_count: uninlined.length - missingTranscripts.length
808
870
  }
809
871
  }));
872
+ return out;
873
+ }
874
+ /** Rows without the canonical agent-profile identity. */
875
+ function profileIssues(view) {
876
+ const { records } = view;
877
+ const out = [];
810
878
  const missingProfiles = records.filter((record) => record.profileId === null);
811
879
  if (missingProfiles.length > 0) out.push(issue({
812
880
  code: "profile-id-unavailable",
@@ -824,6 +892,22 @@ function treeIssues(tree, uncertainty = {}) {
824
892
  }));
825
893
  return out;
826
894
  }
895
+ function treeIssues(tree, uncertainty = {}) {
896
+ const view = buildTreeView(tree, uncertainty);
897
+ const { issues: rootProblems, root } = rootIssues(view);
898
+ return [
899
+ ...schemaIssues(view),
900
+ ...duplicateIdIssues(view),
901
+ ...rootProblems,
902
+ ...rootShapeIssues(view, root),
903
+ ...edgeIssues(view),
904
+ ...closeBeforeStartIssues(view),
905
+ ...parentCycleIssues(view),
906
+ ...childTerminalIssues(view, root),
907
+ ...transcriptIssues(view),
908
+ ...profileIssues(view)
909
+ ];
910
+ }
827
911
  //#endregion
828
912
  //#region src/supervisor-run/integrity-types.ts
829
913
  const SUPERVISOR_RUN_INTEGRITY_SCHEMA = "tangle.supervisor-run-integrity@1";
@@ -873,26 +957,8 @@ function hasWorkerId(worker) {
873
957
  function supervisorRunRolloutLines(src, opts = {}) {
874
958
  return supervisorRunRolloutLinesFromFacts(src, parseSupervisorTree(src), opts);
875
959
  }
876
- /** Mint rollout rows from an already parsed source without reading its JSONL again. */
877
- function supervisorRunRolloutLinesFromFacts(src, tree, opts = {}) {
878
- const gaps = [];
879
- if (src.journal === null) {
880
- gaps.push({
881
- code: "journal-unavailable",
882
- message: `${src.supRunDir === null ? "no supervisor run dir" : "journal absent"}; no nodes recoverable`
883
- });
884
- return {
885
- rootId: null,
886
- nodes: [],
887
- gaps
888
- };
889
- }
890
- const malformedSourceRows = tree.journalInvalidRows + tree.spawns.filter((spawn) => !spawn.valid).length;
891
- if (malformedSourceRows > 0) gaps.push({
892
- code: "source-row-malformed",
893
- message: `${malformedSourceRows} of ${tree.journalRows} journal row(s) were unusable and excluded from the tree`,
894
- count: malformedSourceRows
895
- });
960
+ /** What the root and worker rows share: the parsed run record, the row template and the gap collector. */
961
+ function rolloutContext(src, tree, opts, gaps) {
896
962
  const state = tree.state;
897
963
  const result = parseJsonRecord(src.result);
898
964
  const judge = parseJsonRecord(src.judge);
@@ -925,7 +991,6 @@ function supervisorRunRolloutLinesFromFacts(src, tree, opts = {}) {
925
991
  messages: [],
926
992
  tool_defs: []
927
993
  };
928
- const nodes = [];
929
994
  const noteCaptureGaps = (owner, nodeId, captures) => {
930
995
  if (captures === null || captures?.length === 0) {
931
996
  gaps.push({
@@ -949,173 +1014,233 @@ function supervisorRunRolloutLinesFromFacts(src, tree, opts = {}) {
949
1014
  }
950
1015
  return incomplete ? "workspace capture evidence incomplete" : null;
951
1016
  };
952
- if (rootId !== null) {
953
- const rootSpawn = tree.spawns.find((spawn) => spawn.valid && spawn.id === rootId);
954
- const judgeResolved = typeof judge?.resolved === "boolean" ? judge.resolved : null;
955
- const reward = (typeof judge?.score === "number" ? judge.score : null) ?? (judgeResolved === null ? null : judgeResolved ? 1 : 0);
956
- if (reward === null) gaps.push({
957
- code: "root-reward-unavailable",
958
- message: "no judge verdict for this run",
959
- nodeId: rootId
960
- });
961
- const wallMs = tree.startedAt !== null && tree.completedAt !== null && tree.completedAt >= tree.startedAt ? tree.completedAt - tree.startedAt : null;
962
- const captures = src.rootWorkspaceCaptures;
963
- const captureGap = noteCaptureGaps(`root ${JSON.stringify(rootId)}`, rootId, captures);
964
- nodes.push({
965
- ...base,
966
- rollout_id: rootId,
967
- parent_rollout_id: null,
968
- role: rootSpawn?.role ?? "supervisor",
969
- policy: {
970
- harness: opts.supervisorHarness ?? null,
971
- harness_version: null,
972
- model: opts.supervisorModel ?? null,
973
- provider: null,
974
- profile_commit: null,
975
- agent_profile_cell_id: rootSpawn?.profileDigest ?? null,
976
- sampling: null
977
- },
978
- outcome: {
979
- ...unscreenedRewardFields(reward),
980
- reward_source: src.judgeSource,
981
- verdict: judge ?? null,
982
- metrics: {
983
- arm: src.arm,
984
- sup_status: isUnavailable(terminal.supStatus) ? null : terminal.supStatus,
985
- sup_verdict: typeof state?.verdict === "string" ? state.verdict : null,
986
- delivered: typeof stateResult.delivered === "boolean" ? stateResult.delivered : null,
987
- verify_pass: typeof result?.verify_pass === "boolean" ? result.verify_pass : null,
988
- started_at: tree.startedAt,
989
- completed_at: tree.completedAt,
990
- workers_spawned: tree.workerSpawns.length,
991
- brain_metered_events: tree.brain.meteredCount,
992
- runtime: rootSpawn?.runtime ?? null,
993
- profile_digest: rootSpawn?.profileDigest ?? null
994
- },
995
- is_completed: terminal.completed === true,
996
- is_truncated: false,
997
- error: terminal.completed !== false ? null : !isUnavailable(terminal.supReason) && terminal.supReason !== null ? terminal.supReason : !isUnavailable(terminal.failure) && terminal.failure !== null ? terminal.failure.message ?? terminal.failure.name : null,
998
- realness_gated: false
999
- },
1000
- cost: {
1001
- ...EMPTY_COST,
1002
- usd: src.limits.spendUsd !== null ? null : typeof stateResult.spentUsd === "number" ? stateResult.spentUsd : tree.brain.usd,
1003
- tokens_in: src.limits.managerTokens === null ? tree.brain.tokensIn : null,
1004
- tokens_out: src.limits.managerTokens === null ? tree.brain.tokensOut : null,
1005
- cache_read: src.limits.managerTokens === null && tree.brain.hasCache ? tree.brain.cacheRead : null,
1006
- cache_write: src.limits.managerTokens === null && tree.brain.hasCache ? tree.brain.cacheWrite : null,
1007
- wall_s: wallMs === null ? null : wallMs / 1e3
1008
- },
1009
- artifacts: {
1010
- patch_path: typeof result?.patchPath === "string" ? result.patchPath : null,
1011
- run_dir: src.supRunDir,
1012
- transcript_ref: src.rootTranscriptRef ?? null
1013
- },
1014
- provenance: {
1015
- captured_at: capturedAt,
1016
- capture: "backfill",
1017
- lossy_projection: true,
1018
- ...captures === void 0 ? {} : { workspace_captures: captures },
1019
- gap: [src.rootTranscriptRef == null ? "supervision journal carries structure and spend, not the brain transcript" : "brain transcript retained by reference; messages not inlined into this row", captureGap].filter((reason) => reason !== null).join("; ")
1020
- }
1017
+ return {
1018
+ src,
1019
+ tree,
1020
+ opts,
1021
+ gaps,
1022
+ state,
1023
+ result,
1024
+ judge,
1025
+ stateResult,
1026
+ terminal,
1027
+ rootId,
1028
+ capturedAt,
1029
+ base,
1030
+ noteCaptureGaps
1031
+ };
1032
+ }
1033
+ /** The supervisor invocation row, or nothing when the journal never named a root. */
1034
+ function rootRolloutNode(ctx) {
1035
+ const { src, tree, opts, gaps, state, result, judge, stateResult, terminal, rootId, capturedAt, noteCaptureGaps, base } = ctx;
1036
+ if (rootId === null) {
1037
+ gaps.push({
1038
+ code: "root-spawn-unavailable",
1039
+ message: "no parentless spawned event in the journal"
1021
1040
  });
1022
- } else gaps.push({
1023
- code: "root-spawn-unavailable",
1024
- message: "no parentless spawned event in the journal"
1041
+ return null;
1042
+ }
1043
+ const rootSpawn = tree.spawns.find((spawn) => spawn.valid && spawn.id === rootId);
1044
+ const judgeResolved = typeof judge?.resolved === "boolean" ? judge.resolved : null;
1045
+ const reward = (typeof judge?.score === "number" ? judge.score : null) ?? (judgeResolved === null ? null : judgeResolved ? 1 : 0);
1046
+ if (reward === null) gaps.push({
1047
+ code: "root-reward-unavailable",
1048
+ message: "no judge verdict for this run",
1049
+ nodeId: rootId
1025
1050
  });
1026
- const closeById = new Map(tree.closes.map((c) => [c.id, c]));
1027
- const sourceById = new Map((src.workers ?? []).filter(hasWorkerId).map((worker) => [worker.workerId, worker]));
1028
- const fallbackSourceByLabel = new Map((src.workers ?? []).filter((worker) => worker.workerId === void 0).map((worker) => [worker.label, worker]));
1029
- for (const spawn of tree.workerSpawns) {
1030
- if (spawn.role === null) {
1031
- gaps.push({
1032
- code: "node-role-unavailable",
1033
- message: `child ${JSON.stringify(spawn.label)} has no explicit invocation role`,
1034
- nodeId: spawn.id
1035
- });
1036
- continue;
1051
+ const wallMs = tree.startedAt !== null && tree.completedAt !== null && tree.completedAt >= tree.startedAt ? tree.completedAt - tree.startedAt : null;
1052
+ const captures = src.rootWorkspaceCaptures;
1053
+ const captureGap = noteCaptureGaps(`root ${JSON.stringify(rootId)}`, rootId, captures);
1054
+ return {
1055
+ ...base,
1056
+ rollout_id: rootId,
1057
+ parent_rollout_id: null,
1058
+ role: rootSpawn?.role ?? "supervisor",
1059
+ policy: {
1060
+ harness: opts.supervisorHarness ?? null,
1061
+ harness_version: null,
1062
+ model: opts.supervisorModel ?? null,
1063
+ provider: null,
1064
+ profile_commit: null,
1065
+ agent_profile_cell_id: rootSpawn?.profileDigest ?? null,
1066
+ sampling: null
1067
+ },
1068
+ outcome: {
1069
+ ...unscreenedRewardFields(reward),
1070
+ reward_source: src.judgeSource,
1071
+ verdict: judge ?? null,
1072
+ metrics: {
1073
+ arm: src.arm,
1074
+ sup_status: isUnavailable(terminal.supStatus) ? null : terminal.supStatus,
1075
+ sup_verdict: typeof state?.verdict === "string" ? state.verdict : null,
1076
+ delivered: typeof stateResult.delivered === "boolean" ? stateResult.delivered : null,
1077
+ verify_pass: typeof result?.verify_pass === "boolean" ? result.verify_pass : null,
1078
+ started_at: tree.startedAt,
1079
+ completed_at: tree.completedAt,
1080
+ workers_spawned: tree.workerSpawns.length,
1081
+ brain_metered_events: tree.brain.meteredCount,
1082
+ runtime: rootSpawn?.runtime ?? null,
1083
+ profile_digest: rootSpawn?.profileDigest ?? null
1084
+ },
1085
+ is_completed: terminal.completed === true,
1086
+ is_truncated: false,
1087
+ error: terminal.completed !== false ? null : !isUnavailable(terminal.supReason) && terminal.supReason !== null ? terminal.supReason : !isUnavailable(terminal.failure) && terminal.failure !== null ? terminal.failure.message ?? terminal.failure.name : null,
1088
+ realness_gated: false
1089
+ },
1090
+ cost: {
1091
+ ...EMPTY_COST,
1092
+ usd: src.limits.spendUsd !== null ? null : typeof stateResult.spentUsd === "number" ? stateResult.spentUsd : tree.brain.usd,
1093
+ tokens_in: src.limits.managerTokens === null ? tree.brain.tokensIn : null,
1094
+ tokens_out: src.limits.managerTokens === null ? tree.brain.tokensOut : null,
1095
+ cache_read: src.limits.managerTokens === null && tree.brain.hasCache ? tree.brain.cacheRead : null,
1096
+ cache_write: src.limits.managerTokens === null && tree.brain.hasCache ? tree.brain.cacheWrite : null,
1097
+ wall_s: wallMs === null ? null : wallMs / 1e3
1098
+ },
1099
+ artifacts: {
1100
+ patch_path: typeof result?.patchPath === "string" ? result.patchPath : null,
1101
+ run_dir: src.supRunDir,
1102
+ transcript_ref: src.rootTranscriptRef ?? null
1103
+ },
1104
+ provenance: {
1105
+ captured_at: capturedAt,
1106
+ capture: "backfill",
1107
+ lossy_projection: true,
1108
+ ...captures === void 0 ? {} : { workspace_captures: captures },
1109
+ gap: [src.rootTranscriptRef == null ? "supervision journal carries structure and spend, not the brain transcript" : "brain transcript retained by reference; messages not inlined into this row", captureGap].filter((reason) => reason !== null).join("; ")
1037
1110
  }
1038
- const close = closeById.get(spawn.id) ?? null;
1039
- const workerSource = sourceById.get(spawn.id) ?? fallbackSourceByLabel.get(spawn.label) ?? null;
1040
- const facts = tree.workerLogs.get(workerSource?.workerId ?? workerSource?.label ?? spawn.label) ?? null;
1041
- const wallMs = facts?.started != null && facts.finishedAt != null ? facts.finishedAt - facts.started : null;
1042
- const score = close?.score ?? facts?.score ?? null;
1043
- const passed = close?.valid ?? facts?.passed ?? null;
1044
- const reward = score ?? (passed === null ? null : passed ? 1 : 0);
1045
- if (reward === null) gaps.push({
1046
- code: "child-reward-unavailable",
1047
- message: `child ${JSON.stringify(spawn.label)} has no verify verdict`,
1111
+ };
1112
+ }
1113
+ /** The journal closes and the reader's worker sources, joined to spawns by stable id first and by label only as a fallback. */
1114
+ function workerLookups(ctx) {
1115
+ const { src, tree } = ctx;
1116
+ return {
1117
+ closeById: new Map(tree.closes.map((c) => [c.id, c])),
1118
+ sourceById: new Map((src.workers ?? []).filter(hasWorkerId).map((worker) => [worker.workerId, worker])),
1119
+ fallbackSourceByLabel: new Map((src.workers ?? []).filter((worker) => worker.workerId === void 0).map((worker) => [worker.label, worker]))
1120
+ };
1121
+ }
1122
+ /** One worker row, or nothing when its spawn has no explicit role. */
1123
+ function workerRolloutNode(ctx, lookups, spawn) {
1124
+ const { src, tree, opts, gaps, capturedAt, noteCaptureGaps, base } = ctx;
1125
+ const { closeById, sourceById, fallbackSourceByLabel } = lookups;
1126
+ if (spawn.role === null) {
1127
+ gaps.push({
1128
+ code: "node-role-unavailable",
1129
+ message: `child ${JSON.stringify(spawn.label)} has no explicit invocation role`,
1048
1130
  nodeId: spawn.id
1049
1131
  });
1050
- const isSupervisor = spawn.role === "supervisor";
1051
- const captures = workerSource?.workspaceCaptures;
1052
- const captureGap = noteCaptureGaps(`child ${JSON.stringify(spawn.label)}`, spawn.id, captures);
1053
- nodes.push({
1054
- ...base,
1055
- rollout_id: spawn.id,
1056
- parent_rollout_id: spawn.parent,
1057
- role: spawn.role,
1058
- policy: {
1059
- harness: isSupervisor ? opts.supervisorHarness ?? null : opts.workerHarness ?? null,
1060
- harness_version: null,
1061
- model: isSupervisor ? opts.supervisorModel ?? null : opts.workerModel ?? null,
1062
- provider: null,
1063
- profile_commit: null,
1064
- agent_profile_cell_id: spawn.profileDigest,
1065
- sampling: null
1066
- },
1067
- outcome: {
1068
- ...unscreenedRewardFields(reward),
1069
- reward_source: reward === null ? null : score === null ? "worker-self-verify" : "worker-verdict-score",
1070
- verdict: close === null ? null : {
1071
- kind: close.kind,
1072
- status: close.status,
1073
- verdict: close.rawVerdict,
1074
- valid: close.valid,
1075
- score: close.score
1076
- },
1077
- metrics: {
1078
- label: spawn.label,
1079
- spawned_at: spawn.at,
1080
- settled_at: close?.at ?? null,
1081
- started_at: facts?.started ?? null,
1082
- finished_at: facts?.finishedAt ?? null,
1083
- wall_ms: wallMs,
1084
- patch_bytes: workerSource?.patchBytes ?? facts?.finishedPatchBytes ?? null,
1085
- evidence_bytes: facts?.evidenceBytes ?? null,
1086
- steers_queued: facts?.steersQueued ?? null,
1087
- steers_delivered: facts?.steersDelivered ?? null,
1088
- questions: facts?.questions ?? null,
1089
- runtime: spawn.runtime,
1090
- profile_digest: spawn.profileDigest
1091
- },
1092
- is_completed: close?.kind === "settled" && close.status === "done",
1093
- is_truncated: close?.kind === "cancelled",
1094
- error: close?.kind === "cancelled" ? close.reason ?? "cancelled" : close?.status === "down" ? close.reason ?? "child down" : null,
1095
- realness_gated: false
1096
- },
1097
- cost: {
1098
- ...EMPTY_COST,
1099
- usd: src.limits.spendUsd !== null || !close?.hasSpend ? null : close.spend.usd,
1100
- tokens_in: workerSource?.tokensIn ?? (close?.hasSpend ? close.spend.tokens.input : null),
1101
- tokens_out: workerSource?.tokensOut ?? (close?.hasSpend ? close.spend.tokens.output : null),
1102
- cache_read: workerSource?.cacheRead ?? (close?.hasSpend && close.spend.tokens.hasCache ? close.spend.tokens.cacheRead : null),
1103
- cache_write: workerSource?.cacheWrite ?? (close?.hasSpend && close.spend.tokens.hasCache ? close.spend.tokens.cacheWrite : null),
1104
- wall_s: wallMs === null ? null : wallMs / 1e3
1132
+ return null;
1133
+ }
1134
+ const close = closeById.get(spawn.id) ?? null;
1135
+ const workerSource = sourceById.get(spawn.id) ?? fallbackSourceByLabel.get(spawn.label) ?? null;
1136
+ const facts = tree.workerLogs.get(workerSource?.workerId ?? workerSource?.label ?? spawn.label) ?? null;
1137
+ const wallMs = facts?.started != null && facts.finishedAt != null ? facts.finishedAt - facts.started : null;
1138
+ const score = close?.score ?? facts?.score ?? null;
1139
+ const passed = close?.valid ?? facts?.passed ?? null;
1140
+ const reward = score ?? (passed === null ? null : passed ? 1 : 0);
1141
+ if (reward === null) gaps.push({
1142
+ code: "child-reward-unavailable",
1143
+ message: `child ${JSON.stringify(spawn.label)} has no verify verdict`,
1144
+ nodeId: spawn.id
1145
+ });
1146
+ const isSupervisor = spawn.role === "supervisor";
1147
+ const captures = workerSource?.workspaceCaptures;
1148
+ const captureGap = noteCaptureGaps(`child ${JSON.stringify(spawn.label)}`, spawn.id, captures);
1149
+ return {
1150
+ ...base,
1151
+ rollout_id: spawn.id,
1152
+ parent_rollout_id: spawn.parent,
1153
+ role: spawn.role,
1154
+ policy: {
1155
+ harness: isSupervisor ? opts.supervisorHarness ?? null : opts.workerHarness ?? null,
1156
+ harness_version: null,
1157
+ model: isSupervisor ? opts.supervisorModel ?? null : opts.workerModel ?? null,
1158
+ provider: null,
1159
+ profile_commit: null,
1160
+ agent_profile_cell_id: spawn.profileDigest,
1161
+ sampling: null
1162
+ },
1163
+ outcome: {
1164
+ ...unscreenedRewardFields(reward),
1165
+ reward_source: reward === null ? null : score === null ? "worker-self-verify" : "worker-verdict-score",
1166
+ verdict: close === null ? null : {
1167
+ kind: close.kind,
1168
+ status: close.status,
1169
+ verdict: close.rawVerdict,
1170
+ valid: close.valid,
1171
+ score: close.score
1105
1172
  },
1106
- artifacts: {
1107
- patch_path: workerSource?.patchPath ?? null,
1108
- run_dir: src.supRunDir,
1109
- transcript_ref: workerSource?.transcriptRef ?? null
1173
+ metrics: {
1174
+ label: spawn.label,
1175
+ spawned_at: spawn.at,
1176
+ settled_at: close?.at ?? null,
1177
+ started_at: facts?.started ?? null,
1178
+ finished_at: facts?.finishedAt ?? null,
1179
+ wall_ms: wallMs,
1180
+ patch_bytes: workerSource?.patchBytes ?? facts?.finishedPatchBytes ?? null,
1181
+ evidence_bytes: facts?.evidenceBytes ?? null,
1182
+ steers_queued: facts?.steersQueued ?? null,
1183
+ steers_delivered: facts?.steersDelivered ?? null,
1184
+ questions: facts?.questions ?? null,
1185
+ runtime: spawn.runtime,
1186
+ profile_digest: spawn.profileDigest
1110
1187
  },
1111
- provenance: {
1112
- captured_at: capturedAt,
1113
- capture: "backfill",
1114
- lossy_projection: true,
1115
- ...captures === void 0 ? {} : { workspace_captures: captures },
1116
- gap: [workerSource?.transcriptRef == null ? "no worker transcript was retained; messages unavailable" : "worker transcript retained by reference; messages not inlined into this row", captureGap].filter((reason) => reason !== null).join("; ")
1117
- }
1188
+ is_completed: close?.kind === "settled" && close.status === "done",
1189
+ is_truncated: close?.kind === "cancelled",
1190
+ error: close?.kind === "cancelled" ? close.reason ?? "cancelled" : close?.status === "down" ? close.reason ?? "child down" : null,
1191
+ realness_gated: false
1192
+ },
1193
+ cost: {
1194
+ ...EMPTY_COST,
1195
+ usd: src.limits.spendUsd !== null || !close?.hasSpend ? null : close.spend.usd,
1196
+ tokens_in: workerSource?.tokensIn ?? (close?.hasSpend ? close.spend.tokens.input : null),
1197
+ tokens_out: workerSource?.tokensOut ?? (close?.hasSpend ? close.spend.tokens.output : null),
1198
+ cache_read: workerSource?.cacheRead ?? (close?.hasSpend && close.spend.tokens.hasCache ? close.spend.tokens.cacheRead : null),
1199
+ cache_write: workerSource?.cacheWrite ?? (close?.hasSpend && close.spend.tokens.hasCache ? close.spend.tokens.cacheWrite : null),
1200
+ wall_s: wallMs === null ? null : wallMs / 1e3
1201
+ },
1202
+ artifacts: {
1203
+ patch_path: workerSource?.patchPath ?? null,
1204
+ run_dir: src.supRunDir,
1205
+ transcript_ref: workerSource?.transcriptRef ?? null
1206
+ },
1207
+ provenance: {
1208
+ captured_at: capturedAt,
1209
+ capture: "backfill",
1210
+ lossy_projection: true,
1211
+ ...captures === void 0 ? {} : { workspace_captures: captures },
1212
+ gap: [workerSource?.transcriptRef == null ? "no worker transcript was retained; messages unavailable" : "worker transcript retained by reference; messages not inlined into this row", captureGap].filter((reason) => reason !== null).join("; ")
1213
+ }
1214
+ };
1215
+ }
1216
+ /** Mint rollout rows from an already parsed source without reading its JSONL again. */
1217
+ function supervisorRunRolloutLinesFromFacts(src, tree, opts = {}) {
1218
+ const gaps = [];
1219
+ if (src.journal === null) {
1220
+ gaps.push({
1221
+ code: "journal-unavailable",
1222
+ message: `${src.supRunDir === null ? "no supervisor run dir" : "journal absent"}; no nodes recoverable`
1118
1223
  });
1224
+ return {
1225
+ rootId: null,
1226
+ nodes: [],
1227
+ gaps
1228
+ };
1229
+ }
1230
+ const malformedSourceRows = tree.journalInvalidRows + tree.spawns.filter((spawn) => !spawn.valid).length;
1231
+ if (malformedSourceRows > 0) gaps.push({
1232
+ code: "source-row-malformed",
1233
+ message: `${malformedSourceRows} of ${tree.journalRows} journal row(s) were unusable and excluded from the tree`,
1234
+ count: malformedSourceRows
1235
+ });
1236
+ const ctx = rolloutContext(src, tree, opts, gaps);
1237
+ const nodes = [];
1238
+ const root = rootRolloutNode(ctx);
1239
+ if (root) nodes.push(root);
1240
+ const lookups = workerLookups(ctx);
1241
+ for (const spawn of tree.workerSpawns) {
1242
+ const node = workerRolloutNode(ctx, lookups, spawn);
1243
+ if (node) nodes.push(node);
1119
1244
  }
1120
1245
  const invalid = nodes.filter((n) => !isRolloutLine(n));
1121
1246
  if (invalid.length > 0) gaps.push({
@@ -1124,7 +1249,7 @@ function supervisorRunRolloutLinesFromFacts(src, tree, opts = {}) {
1124
1249
  count: invalid.length
1125
1250
  });
1126
1251
  return {
1127
- rootId,
1252
+ rootId: tree.rootId,
1128
1253
  nodes,
1129
1254
  gaps
1130
1255
  };
@@ -1188,4 +1313,4 @@ function analyzeSupervisorRunIntegrity(input, options = {}) {
1188
1313
  //#endregion
1189
1314
  export { supervisorRunRolloutLines as n, SUPERVISOR_RUN_INTEGRITY_SCHEMA as r, analyzeSupervisorRunIntegrity as t };
1190
1315
 
1191
- //# sourceMappingURL=integrity-DOd9Q86O.js.map
1316
+ //# sourceMappingURL=integrity-C8oUeB0g.js.map