@tangle-network/agent-eval 0.187.2 → 0.189.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.
- package/CHANGELOG.md +95 -0
- package/dist/adapters/http.d.ts +2 -2
- package/dist/{agent-profile-uAIQK3Nr.d.ts → agent-profile-DNV_U6QR.d.ts} +4 -4
- package/dist/{agent-profile-uAIQK3Nr.d.ts.map → agent-profile-DNV_U6QR.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +12 -12
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +7 -7
- package/dist/{analyze-runs-DapYZz02.d.ts → analyze-runs-BvK4-wSs.d.ts} +5 -5
- package/dist/{analyze-runs-DapYZz02.d.ts.map → analyze-runs-BvK4-wSs.d.ts.map} +1 -1
- package/dist/{analyze-runs-DCY7LMt4.js → analyze-runs-SCSWYpy0.js} +17 -9
- package/dist/analyze-runs-SCSWYpy0.js.map +1 -0
- package/dist/{benchmark-command-DGokT8zd.js → benchmark-command-BhhAYstU.js} +14 -14
- package/dist/benchmark-command-BhhAYstU.js.map +1 -0
- package/dist/benchmarks/index.d.ts +4 -4
- package/dist/benchmarks/index.js +3 -3
- package/dist/builder-eval/index.d.ts +3 -3
- package/dist/builder-eval/index.js +1 -1
- package/dist/campaign/index.d.ts +5 -5
- package/dist/campaign/index.js +7 -7
- package/dist/{campaign-DlxdTOvw.js → campaign-BWoSQPSU.js} +10 -10
- package/dist/{campaign-DlxdTOvw.js.map → campaign-BWoSQPSU.js.map} +1 -1
- package/dist/{campaign-evidence-IF1p0oDa.js → campaign-evidence-CBlGJ3kC.js} +5 -5
- package/dist/campaign-evidence-CBlGJ3kC.js.map +1 -0
- package/dist/{chat-client-DqPqWzVV.js → chat-client-C4dg7Ng_.js} +2 -2
- package/dist/{chat-client-DqPqWzVV.js.map → chat-client-C4dg7Ng_.js.map} +1 -1
- package/dist/{chat-json-call-C-DnDxEy.js → chat-json-call-JVGbfx95.js} +2 -2
- package/dist/{chat-json-call-C-DnDxEy.js.map → chat-json-call-JVGbfx95.js.map} +1 -1
- package/dist/cli.js +4 -4
- package/dist/{client-DCc7a8ZC.d.ts → client-BhEyAdfe.d.ts} +4 -4
- package/dist/{client-DCc7a8ZC.d.ts.map → client-BhEyAdfe.d.ts.map} +1 -1
- package/dist/{client-CXE-U1SA.js → client-QwJpsNYU.js} +5 -1
- package/dist/client-QwJpsNYU.js.map +1 -0
- package/dist/contract/index.d.ts +11 -11
- package/dist/contract/index.js +22 -13
- package/dist/contract/index.js.map +1 -1
- package/dist/{counterfactual-CLgrwhkY.d.ts → counterfactual-CPaWN99-.d.ts} +4 -4
- package/dist/{counterfactual-CLgrwhkY.d.ts.map → counterfactual-CPaWN99-.d.ts.map} +1 -1
- package/dist/{counterfactual-Bjq1mlUu.js → counterfactual-DtMWvn7D.js} +2 -2
- package/dist/{counterfactual-Bjq1mlUu.js.map → counterfactual-DtMWvn7D.js.map} +1 -1
- package/dist/deep-freeze-CurcOQg3.js +16 -0
- package/dist/deep-freeze-CurcOQg3.js.map +1 -0
- package/dist/{default-registry-DMxeb4GD.d.ts → default-registry-B5HrwrPM.d.ts} +6 -6
- package/dist/{default-registry-DMxeb4GD.d.ts.map → default-registry-B5HrwrPM.d.ts.map} +1 -1
- package/dist/{default-registry-Ca2IWH1X.js → default-registry-m2jhbG6Q.js} +4 -3
- package/dist/default-registry-m2jhbG6Q.js.map +1 -0
- package/dist/{define-agent-eval-C0EqJ9Gz.js → define-agent-eval-98sgUaC1.js} +8 -8
- package/dist/{define-agent-eval-C0EqJ9Gz.js.map → define-agent-eval-98sgUaC1.js.map} +1 -1
- package/dist/{define-agent-eval-CGBwPPaq.d.ts → define-agent-eval-q6890HU4.d.ts} +7 -7
- package/dist/{define-agent-eval-CGBwPPaq.d.ts.map → define-agent-eval-q6890HU4.d.ts.map} +1 -1
- package/dist/diagnosis/index.d.ts +38 -96
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +84 -135
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{dspy-rlm-engine-BE9lCzzL.js → dspy-rlm-engine-DLYttKBm.js} +3 -3
- package/dist/{dspy-rlm-engine-BE9lCzzL.js.map → dspy-rlm-engine-DLYttKBm.js.map} +1 -1
- package/dist/emitter-DbMXUIVP.js +334 -0
- package/dist/emitter-DbMXUIVP.js.map +1 -0
- package/dist/{emitter-Cs0egaFd.d.ts → emitter-HcCmFQl_.d.ts} +37 -6
- package/dist/emitter-HcCmFQl_.d.ts.map +1 -0
- package/dist/{engine-DNlKhIm0.d.ts → engine-BkLCnZQX.d.ts} +15 -5
- package/dist/engine-BkLCnZQX.d.ts.map +1 -0
- package/dist/{eval-campaign-XFHEpN86.js → eval-campaign-C0Q1Eeo_.js} +8 -5
- package/dist/{eval-campaign-XFHEpN86.js.map → eval-campaign-C0Q1Eeo_.js.map} +1 -1
- package/dist/evaluation.d.ts +2 -2
- package/dist/{exact-types-BEHN7tnq.d.ts → exact-types-CfpP2A4Z.d.ts} +2 -2
- package/dist/{exact-types-BEHN7tnq.d.ts.map → exact-types-CfpP2A4Z.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +3 -3
- package/dist/experiment/index.js +2 -3
- package/dist/experiment/index.js.map +1 -1
- package/dist/{external-optimizer-process-BbhvXTFx.js → external-optimizer-process-C3quNeKV.js} +3 -3
- package/dist/{external-optimizer-process-BbhvXTFx.js.map → external-optimizer-process-C3quNeKV.js.map} +1 -1
- package/dist/{external-optimizer-subprocess-DMgmqTB6.js → external-optimizer-subprocess-BDwgKLO1.js} +3 -3
- package/dist/{external-optimizer-subprocess-DMgmqTB6.js.map → external-optimizer-subprocess-BDwgKLO1.js.map} +1 -1
- package/dist/{failure-cluster-OldNRoAt.d.ts → failure-cluster-CbgEDcFJ.d.ts} +3 -3
- package/dist/{failure-cluster-OldNRoAt.d.ts.map → failure-cluster-CbgEDcFJ.d.ts.map} +1 -1
- package/dist/failure-taxonomy-CjabTATj.js +538 -0
- package/dist/failure-taxonomy-CjabTATj.js.map +1 -0
- package/dist/{feedback-trajectory-CytTR7u4.d.ts → feedback-trajectory-B3ZSkfAq.d.ts} +6 -6
- package/dist/{feedback-trajectory-CytTR7u4.d.ts.map → feedback-trajectory-B3ZSkfAq.d.ts.map} +1 -1
- package/dist/hosted/index.d.ts +2 -2
- package/dist/hosted/index.d.ts.map +1 -1
- package/dist/hosted/index.js +1 -1
- package/dist/{index-vYNHCV2G.d.ts → index-2e_MTznj.d.ts} +8 -8
- package/dist/{index-vYNHCV2G.d.ts.map → index-2e_MTznj.d.ts.map} +1 -1
- package/dist/{index-CKZa_rnt.d.ts → index-Bcc9PkOz.d.ts} +3 -3
- package/dist/{index-CKZa_rnt.d.ts.map → index-Bcc9PkOz.d.ts.map} +1 -1
- package/dist/{index-u0d1Jp4F.d.ts → index-BqDJ6fUK.d.ts} +45 -24
- package/dist/index-BqDJ6fUK.d.ts.map +1 -0
- package/dist/{index-BRsrfSHT.d.ts → index-CnJOPR_E.d.ts} +10 -10
- package/dist/{index-BRsrfSHT.d.ts.map → index-CnJOPR_E.d.ts.map} +1 -1
- package/dist/{index-YZrbnBSV.d.ts → index-Dk1dOUfm.d.ts} +11 -11
- package/dist/{index-YZrbnBSV.d.ts.map → index-Dk1dOUfm.d.ts.map} +1 -1
- package/dist/index.d.ts +384 -69
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1492 -217
- package/dist/index.js.map +1 -1
- package/dist/{insight-report-DpOo-3iL.d.ts → insight-report-CvPkEIcC.d.ts} +14 -7
- package/dist/insight-report-CvPkEIcC.d.ts.map +1 -0
- package/dist/{integrity-Cy9WHAtb.js → integrity-BFP4kjGj.js} +6 -1
- package/dist/integrity-BFP4kjGj.js.map +1 -0
- package/dist/{integrity-rGOfSUle.d.ts → integrity-CaeNeusS.d.ts} +4 -4
- package/dist/integrity-CaeNeusS.d.ts.map +1 -0
- package/dist/jev.d.ts +2 -2
- package/dist/jev.js +2 -1
- package/dist/jev.js.map +1 -1
- package/dist/{journal-BuRLm6ho.js → journal-CDP0Vhx_.js} +262 -115
- package/dist/journal-CDP0Vhx_.js.map +1 -0
- package/dist/{kind-factory-V79Hw0AU.js → kind-factory-BGwN0nE6.js} +17 -5
- package/dist/{kind-factory-V79Hw0AU.js.map → kind-factory-BGwN0nE6.js.map} +1 -1
- package/dist/ledger-core/index.d.ts +2 -2
- package/dist/ledger-core/index.js +1 -1
- package/dist/{llm-client-DDhZ29Vm.js → llm-client-DF9bPNYA.js} +2 -2
- package/dist/{llm-client-DDhZ29Vm.js.map → llm-client-DF9bPNYA.js.map} +1 -1
- package/dist/{llm-judge-BVso5x-u.js → llm-judge-M_l_WXw2.js} +26 -24
- package/dist/llm-judge-M_l_WXw2.js.map +1 -0
- package/dist/{matrix-CPKsRY8Y.d.ts → matrix-CNypzP-v.d.ts} +2 -2
- package/dist/{matrix-CPKsRY8Y.d.ts.map → matrix-CNypzP-v.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +4 -4
- package/dist/{mint-BI14xehJ.d.ts → mint-DsS38v5c.d.ts} +25 -5
- package/dist/{mint-BI14xehJ.d.ts.map → mint-DsS38v5c.d.ts.map} +1 -1
- package/dist/{mint-B4zgSAJW.js → mint-iCD-W43s.js} +30 -12
- package/dist/mint-iCD-W43s.js.map +1 -0
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/openapi.json +1 -1
- package/dist/pipelines/index.d.ts +67 -12
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js +178 -41
- package/dist/pipelines/index.js.map +1 -1
- package/dist/{prime-protocol-CDBcL9NM.d.ts → prime-protocol-Fwvctmhm.d.ts} +2 -2
- package/dist/{prime-protocol-CDBcL9NM.d.ts.map → prime-protocol-Fwvctmhm.d.ts.map} +1 -1
- package/dist/{produced-state-Cn9ECr4v.js → produced-state-BOY98IJO.js} +4 -4
- package/dist/{produced-state-Cn9ECr4v.js.map → produced-state-BOY98IJO.js.map} +1 -1
- package/dist/{query-D6W6MaGx.d.ts → query-DBUQhehH.d.ts} +3 -3
- package/dist/{query-D6W6MaGx.d.ts.map → query-DBUQhehH.d.ts.map} +1 -1
- package/dist/random-DGEyr3zG.d.ts +83 -0
- package/dist/random-DGEyr3zG.d.ts.map +1 -0
- package/dist/{raw-provider-sink-BQd7mzyT.js → raw-provider-sink-C96CcqeG.js} +19 -56
- package/dist/raw-provider-sink-C96CcqeG.js.map +1 -0
- package/dist/redact-DPoH1-OW.d.ts +158 -0
- package/dist/redact-DPoH1-OW.d.ts.map +1 -0
- package/dist/redact-DxwlUAvh.js +824 -0
- package/dist/redact-DxwlUAvh.js.map +1 -0
- package/dist/{registry-D5Ly3GRV.d.ts → registry-mAQVtuLx.d.ts} +4 -4
- package/dist/{registry-D5Ly3GRV.d.ts.map → registry-mAQVtuLx.d.ts.map} +1 -1
- package/dist/{release-confidence-CSp3MsU4.d.ts → release-confidence-CkoXFx9I.d.ts} +4 -4
- package/dist/{release-confidence-CSp3MsU4.d.ts.map → release-confidence-CkoXFx9I.d.ts.map} +1 -1
- package/dist/{release-confidence-RanRUXRW.js → release-confidence-XQm_xjhR.js} +3 -3
- package/dist/release-confidence-XQm_xjhR.js.map +1 -0
- package/dist/{report-command-CSTjzFGY.js → report-command-DKJ_yAIj.js} +21 -12
- package/dist/{report-command-CSTjzFGY.js.map → report-command-DKJ_yAIj.js.map} +1 -1
- package/dist/reporting.d.ts +3 -3
- package/dist/reporting.js +1 -1
- package/dist/{researcher-D7E92STT.d.ts → researcher-DojEMb7E.d.ts} +7 -7
- package/dist/{researcher-D7E92STT.d.ts.map → researcher-DojEMb7E.d.ts.map} +1 -1
- package/dist/{reward-hacking-BIQ2BWLG.d.ts → reward-hacking-Cyk-QHk9.d.ts} +2 -2
- package/dist/{reward-hacking-BIQ2BWLG.d.ts.map → reward-hacking-Cyk-QHk9.d.ts.map} +1 -1
- package/dist/rl.d.ts +11 -10
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +7 -6
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +4 -4
- package/dist/rollout/index.js +2 -2
- package/dist/{rollout-C0Ifk3vK.js → rollout-B-XBReTC.js} +2 -2
- package/dist/{rollout-C0Ifk3vK.js.map → rollout-B-XBReTC.js.map} +1 -1
- package/dist/{rubric-predictive-validity-CTU8y8Cv.d.ts → rubric-predictive-validity-DIUwJJ9Y.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-CTU8y8Cv.d.ts.map → rubric-predictive-validity-DIUwJJ9Y.d.ts.map} +1 -1
- package/dist/{run-record-tg_5H2IK.js → run-record-BRlM99rX.js} +41 -3
- package/dist/run-record-BRlM99rX.js.map +1 -0
- package/dist/{run-record-D9wS35fK.d.ts → run-record-DF-fuu31.d.ts} +59 -7
- package/dist/run-record-DF-fuu31.d.ts.map +1 -0
- package/dist/{run-record-CNNzWGpB.js → run-record-DnMFyg_g.js} +26 -13
- package/dist/run-record-DnMFyg_g.js.map +1 -0
- package/dist/{schema-CR5cpjQ3.d.ts → schema-2g7trUwH.d.ts} +17 -2
- package/dist/schema-2g7trUwH.d.ts.map +1 -0
- package/dist/{schema-BzWDXhOR.d.ts → schema-B5LtYvn9.d.ts} +7 -5
- package/dist/{schema-BzWDXhOR.d.ts.map → schema-B5LtYvn9.d.ts.map} +1 -1
- package/dist/schema-C1aaAxTf.js.map +1 -1
- package/dist/schema-CSf6qWgZ.js.map +1 -1
- package/dist/{semantic-concept-judge-Cnt0TWp0.js → semantic-concept-judge-Cm2K2wAo.js} +6 -6
- package/dist/{semantic-concept-judge-Cnt0TWp0.js.map → semantic-concept-judge-Cm2K2wAo.js.map} +1 -1
- package/dist/{series-convergence-BnMs_uAr.d.ts → series-convergence-DY7ha0kx.d.ts} +2 -2
- package/dist/{series-convergence-BnMs_uAr.d.ts.map → series-convergence-DY7ha0kx.d.ts.map} +1 -1
- package/dist/{server-DmpcFiVK.js → server-C8XvqCg8.js} +2 -2
- package/dist/{server-DmpcFiVK.js.map → server-C8XvqCg8.js.map} +1 -1
- package/dist/{skillopt-optimization-method-Cc9SVLqi.js → skillopt-optimization-method-BVSB676o.js} +7 -7
- package/dist/{skillopt-optimization-method-Cc9SVLqi.js.map → skillopt-optimization-method-BVSB676o.js.map} +1 -1
- package/dist/spans-W0o8pbEg.d.ts +60 -0
- package/dist/spans-W0o8pbEg.d.ts.map +1 -0
- package/dist/{statistical-heldout-DTmhTW8P.d.ts → statistical-heldout-plAHG82H.d.ts} +3 -3
- package/dist/{statistical-heldout-DTmhTW8P.d.ts.map → statistical-heldout-plAHG82H.d.ts.map} +1 -1
- package/dist/{store-BErPvYBr.d.ts → store-C4avFjIi.d.ts} +2 -2
- package/dist/{store-BErPvYBr.d.ts.map → store-C4avFjIi.d.ts.map} +1 -1
- package/dist/{store-otlp-2gYCy-v0.js → store-otlp-D0AV4cvB.js} +2 -2
- package/dist/{store-otlp-2gYCy-v0.js.map → store-otlp-D0AV4cvB.js.map} +1 -1
- package/dist/{store-tool-spans-B3bX9yqn.d.ts → store-tool-spans-8PAyhRqb.d.ts} +9 -54
- package/dist/store-tool-spans-8PAyhRqb.d.ts.map +1 -0
- package/dist/{store-tool-spans-B1e6Auc2.js → store-tool-spans-B_0mXvYl.js} +4 -4
- package/dist/{store-tool-spans-B1e6Auc2.js.map → store-tool-spans-B_0mXvYl.js.map} +1 -1
- package/dist/storyboard/index.d.ts +1 -1
- package/dist/{summary-report-Iy6kXo8x.d.ts → summary-report-DvvesgR_.d.ts} +6 -5
- package/dist/summary-report-DvvesgR_.d.ts.map +1 -0
- package/dist/supervisor-run/index.d.ts +2 -2
- package/dist/supervisor-run/index.d.ts.map +1 -1
- package/dist/supervisor-run/index.js +1 -1
- package/dist/{tool-groups-veQYPiTy.d.ts → tool-groups-W7MJobX_.d.ts} +3 -3
- package/dist/tool-groups-W7MJobX_.d.ts.map +1 -0
- package/dist/{tool-waste-nbHPAxei.js → tool-waste-CJDfxH45.js} +3 -537
- package/dist/tool-waste-CJDfxH45.js.map +1 -0
- package/dist/{tool-waste-D23I0zWm.d.ts → tool-waste-CP5DO383.d.ts} +4 -4
- package/dist/{tool-waste-D23I0zWm.d.ts.map → tool-waste-CP5DO383.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +2 -2
- package/dist/traces.d.ts +12 -11
- package/dist/traces.d.ts.map +1 -1
- package/dist/traces.js +9 -9
- package/dist/{trajectory-D7qrNvaN.d.ts → trajectory-Y1fmdlw7.d.ts} +3 -3
- package/dist/{trajectory-D7qrNvaN.d.ts.map → trajectory-Y1fmdlw7.d.ts.map} +1 -1
- package/dist/trajectory-replay/index.d.ts +3 -3
- package/dist/trajectory-replay/index.js +2 -2
- package/dist/{types-BjB2wZM9.d.ts → types-Bay1dh2o.d.ts} +6 -6
- package/dist/{types-BjB2wZM9.d.ts.map → types-Bay1dh2o.d.ts.map} +1 -1
- package/dist/{types-BTRcIqFr.d.ts → types-BvmWNjjs.d.ts} +4 -4
- package/dist/{types-BTRcIqFr.d.ts.map → types-BvmWNjjs.d.ts.map} +1 -1
- package/dist/{types-CBbLtr2J.d.ts → types-C0bWoSKC.d.ts} +10 -11
- package/dist/types-C0bWoSKC.d.ts.map +1 -0
- package/dist/{types-C8VBbiw6.js → types-CW5b90JH.js} +2 -15
- package/dist/types-CW5b90JH.js.map +1 -0
- package/dist/{types--18oHwVF.d.ts → types-Cvqy7asY.d.ts} +3 -3
- package/dist/{types--18oHwVF.d.ts.map → types-Cvqy7asY.d.ts.map} +1 -1
- package/dist/{types-Tp5WhYL9.d.ts → types-DRNlLbBR.d.ts} +2 -2
- package/dist/{types-Tp5WhYL9.d.ts.map → types-DRNlLbBR.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/code-agent-intake.md +1 -1
- package/docs/diagnosis.md +2 -3
- package/docs/eval-surface-map.md +1 -1
- package/docs/experiment.md +0 -1
- package/docs/insight-report.md +3 -2
- package/docs/public-api.md +2 -2
- package/docs/redaction.md +59 -0
- package/docs/rollout.md +5 -5
- package/docs/search-history-receipts.md +1 -0
- package/docs/trace-contracts.md +102 -0
- package/docs/verdicts.md +1 -1
- package/package.json +3 -2
- package/dist/analyze-runs-DCY7LMt4.js.map +0 -1
- package/dist/benchmark-command-DGokT8zd.js.map +0 -1
- package/dist/campaign-evidence-IF1p0oDa.js.map +0 -1
- package/dist/client-CXE-U1SA.js.map +0 -1
- package/dist/default-registry-Ca2IWH1X.js.map +0 -1
- package/dist/emitter-Cs0egaFd.d.ts.map +0 -1
- package/dist/emitter-DeQHiDMm.js +0 -257
- package/dist/emitter-DeQHiDMm.js.map +0 -1
- package/dist/engine-DNlKhIm0.d.ts.map +0 -1
- package/dist/experiment-tracker-BKEumQug.js +0 -280
- package/dist/experiment-tracker-BKEumQug.js.map +0 -1
- package/dist/experiment-tracker-URRGP9ek.d.ts +0 -237
- package/dist/experiment-tracker-URRGP9ek.d.ts.map +0 -1
- package/dist/index-u0d1Jp4F.d.ts.map +0 -1
- package/dist/insight-report-DpOo-3iL.d.ts.map +0 -1
- package/dist/integrity-Cy9WHAtb.js.map +0 -1
- package/dist/integrity-rGOfSUle.d.ts.map +0 -1
- package/dist/journal-BuRLm6ho.js.map +0 -1
- package/dist/llm-judge-BVso5x-u.js.map +0 -1
- package/dist/mint-B4zgSAJW.js.map +0 -1
- package/dist/raw-provider-sink-BQd7mzyT.js.map +0 -1
- package/dist/redact-7Aq1ukl-.js +0 -107
- package/dist/redact-7Aq1ukl-.js.map +0 -1
- package/dist/release-confidence-RanRUXRW.js.map +0 -1
- package/dist/run-record-CNNzWGpB.js.map +0 -1
- package/dist/run-record-D9wS35fK.d.ts.map +0 -1
- package/dist/run-record-tg_5H2IK.js.map +0 -1
- package/dist/schema-CR5cpjQ3.d.ts.map +0 -1
- package/dist/store-tool-spans-B3bX9yqn.d.ts.map +0 -1
- package/dist/summary-report-Iy6kXo8x.d.ts.map +0 -1
- package/dist/tool-groups-veQYPiTy.d.ts.map +0 -1
- package/dist/tool-waste-nbHPAxei.js.map +0 -1
- package/dist/types-C8VBbiw6.js.map +0 -1
- package/dist/types-CBbLtr2J.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as CostProvenance } from "./cost-ledger-DbQdN3nO.js";
|
|
2
|
-
import { w as JudgeScore } from "./types-
|
|
2
|
+
import { w as JudgeScore } from "./types-BvmWNjjs.js";
|
|
3
3
|
import { o as MatrixResult } from "./index-DNgf5gyG.js";
|
|
4
4
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
5
5
|
//#region src/multishot/types.d.ts
|
|
@@ -398,4 +398,4 @@ interface RunMultishotMatrixResult {
|
|
|
398
398
|
declare function runMultishotMatrix<TPersona extends MultishotPersona>(opts: RunMultishotMatrixOptions<TPersona>): Promise<RunMultishotMatrixResult>;
|
|
399
399
|
//#endregion
|
|
400
400
|
export { MultishotToolExecutor as A, MultishotFatalToolError as C, MultishotShape as D, MultishotResult as E, assertMultishotShotResult as F, MultishotTransportRequest as M, MultishotTransportResponse as N, MultishotShotResultError as O, MultishotTransportToolCall as P, MultishotDriverEmptyError as S, MultishotPersona as T, JudgeRunResult as _, MultishotCellOutput as a, runJudge as b, RunMultishotMatrixResult as c, MultishotShot as d, RunMultishotOptions as f, JudgeDimension as g, JudgeConfig as h, ConversationJudgeInput as i, MultishotTransport as j, MultishotToolDefinition as k, computeCellComposite as l, DEFAULT_JUDGE_MODEL as m, CellCompositeInput as n, MultishotJudges as o, runMultishot as p, CellCompositeScore as r, RunMultishotMatrixOptions as s, ArtifactJudgeInput as t, runMultishotMatrix as u, renderDimensions as v, MultishotMessage as w, MultishotArtifact as x, renderJsonFooter as y };
|
|
401
|
-
//# sourceMappingURL=matrix-
|
|
401
|
+
//# sourceMappingURL=matrix-CNypzP-v.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix-
|
|
1
|
+
{"version":3,"file":"matrix-CNypzP-v.d.ts","names":[],"sources":["../src/multishot/types.ts","../src/multishot/judges.ts","../src/multishot/multishot.ts","../src/multishot/matrix.ts"],"mappings":";;;;;UAIiB;EACf;EACA;EACA;EACA,YAAY;IAAQ;IAAY;IAAc,MAAM;;;UAGrC;EACf;EACA;EACA;IAAc;IAAc,MAAM;;EAClC;;UAGe;EACf,YAAY;EACZ,WAAW;EACX;EACA;;;EAGA;;;;;;;;EAQA,iBAAiB;;UAGF;EACf;EACA;IACE;IACA;IACA,YAAY;;;;;;UAOC;EACf;EACA,UAAU,MAAM;EAChB,QAAQ;EACR;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;IAAY;IAAc;;;UAGX;EACf;IAAW;IAAyB,aAAa;;EACjD;IAAU;IAAwB;;;;EAGlC;;;;EAIA;;;;;;;;KASU,sBACV,KAAK,8BACF,QAAQ;KAED,yBACV,MAAM,yBACN;;EAEE,WAAW;EACX,SAAS;MAER;EAAU;EAAiB;;UAEf;;EAEf;;GAEC;;;;;;;;UASc,eAAe,iBAAiB;;EAE/C,eAAe,SAAS;;;EAGxB,2BAA2B,SAAS;;cAGzB,kCAAkC;WACjB;EAA5B,YAA4B;;cAMjB,gCAAgC;EAC3C,YAAY;;cAMD,iCAAiC;EAC5C,YAAY;;;;;;;;;;;;;;;;;;;iBAyBE,0BAA0B,yBAAyB,SAAS;;;cCvI/D;UAEI;;EAEf;;EAEA;;UAGe,YAAY;;EAE3B;;;EAGA,WAAW;;EAEX;;EAEA,YAAY;;EAEZ;;;EAGA,cAAc,OAAO;;EAErB;;UAGe;;EAEf,OAAO;;EAEP,MAAM;;iBAGc,SAAS,QAC7B,OAAO,YAAY,SACnB,OAAO,SACN,QAAQ;;;iBAsIK,iBAAiB,eAAe;;iBAKhC,iBAAiB,eAAe;;;UCxK/B,oBAAoB,iBAAiB;EACpD,SAAS;EACT,SAAS;;;EAGT,QAAQ,eAAe;;EAEvB,QAAQ;;EAER,gBAAgB,eAAe;;;;EAI/B,mBAAmB;EACnB;EACA;EACA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1
|
+
import { f as Run } from "../schema-2g7trUwH.js";
|
|
2
2
|
import { a as ContinuousCalibrationResult, c as SelfPreferenceResult, d as calibrateJudgeContinuous, f as continuousAgreement, h as verbosityBias, i as ContinuousAgreementOptions, l as VerbosityBiasResult, m as selfPreference, n as CandidateScore, o as GoldenItem, p as positionalBias, r as ContinuousAgreement, s as PositionalBiasResult, t as CalibrationResult, u as calibrateJudge } from "../judge-calibration-DFtEMlde.js";
|
|
3
|
-
import { n as SeriesConvergenceResult, o as CorpusAgreementReport, t as SeriesConvergenceOptions } from "../series-convergence-
|
|
3
|
+
import { n as SeriesConvergenceResult, o as CorpusAgreementReport, t as SeriesConvergenceOptions } from "../series-convergence-DY7ha0kx.js";
|
|
4
4
|
import { r as LedgerHash } from "../canonical-CFpojCN5.js";
|
|
5
|
-
import { s as TraceStore } from "../store-
|
|
5
|
+
import { s as TraceStore } from "../store-C4avFjIi.js";
|
|
6
6
|
import { a as OutcomeFilter, i as InMemoryOutcomeStore, n as FileSystemOutcomeStore, o as OutcomeStore, r as FileSystemOutcomeStoreOptions, s as OutcomeStoreError, t as DeploymentOutcome } from "../outcome-store-CNt4iZ67.js";
|
|
7
7
|
import { a as ComputedInterval } from "../ast-hI-vjW6J.js";
|
|
8
|
-
import { a as RubricPredictiveValidityReport, c as CorrelationInterval, i as RubricPredictiveValidityInput, l as OutcomeReduction, n as RubricOutcomeExclusion, o as RubricRanking, r as RubricOutcomePair, s as rubricPredictiveValidity, t as OutcomeMetricSpec } from "../rubric-predictive-validity-
|
|
8
|
+
import { a as RubricPredictiveValidityReport, c as CorrelationInterval, i as RubricPredictiveValidityInput, l as OutcomeReduction, n as RubricOutcomeExclusion, o as RubricRanking, r as RubricOutcomePair, s as rubricPredictiveValidity, t as OutcomeMetricSpec } from "../rubric-predictive-validity-DIUwJJ9Y.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/meta-eval/correlation-study.d.ts
|
|
11
11
|
interface EvalMetricSpec {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as RunRecord } from "./run-record-
|
|
2
|
-
import { s as TraceStore } from "./store-
|
|
3
|
-
import { S as ToolDef, a as MintedRolloutLine, b as RolloutStep, m as RolloutLine, t as ChatMessage, v as RolloutRole, y as RolloutSplit } from "./schema-
|
|
1
|
+
import { a as RunRecord, s as RunSearchCoordinates } from "./run-record-DF-fuu31.js";
|
|
2
|
+
import { s as TraceStore } from "./store-C4avFjIi.js";
|
|
3
|
+
import { S as ToolDef, a as MintedRolloutLine, b as RolloutStep, m as RolloutLine, t as ChatMessage, v as RolloutRole, y as RolloutSplit } from "./schema-B5LtYvn9.js";
|
|
4
4
|
//#region src/rollout/exporters.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* The gate's two claims, which travel TOGETHER on every emitted row.
|
|
@@ -237,6 +237,18 @@ declare function trainingReward(record: Scored): {
|
|
|
237
237
|
//#region src/rollout/mint.d.ts
|
|
238
238
|
/** Redactor for transcript/step payload text (secrets, PII), not opaque identity. */
|
|
239
239
|
type RolloutScrubber = (text: string) => string;
|
|
240
|
+
/** A search cell's place in its search tree, read from the search ledger. */
|
|
241
|
+
interface RolloutSearchLineage {
|
|
242
|
+
/** Edges between the cell's node and the search root; the root is 0. */
|
|
243
|
+
depth: number;
|
|
244
|
+
/** Order in which the node registered in its search; the root is 0. */
|
|
245
|
+
ordinal: number;
|
|
246
|
+
/** Repeat index of the cell on its task, from 0. */
|
|
247
|
+
rep: number;
|
|
248
|
+
/** Run id of the cell whose execution contains this search; null for a
|
|
249
|
+
* top-level search. */
|
|
250
|
+
containingRunId: string | null;
|
|
251
|
+
}
|
|
240
252
|
interface MintRolloutOptions {
|
|
241
253
|
scrub?: RolloutScrubber;
|
|
242
254
|
/**
|
|
@@ -254,6 +266,14 @@ interface MintRolloutOptions {
|
|
|
254
266
|
suite?: string;
|
|
255
267
|
/** Injected clock for deterministic output. */
|
|
256
268
|
now?: () => Date;
|
|
269
|
+
/**
|
|
270
|
+
* Lineage of a search run, read from its search ledger. It fills the line's
|
|
271
|
+
* `generation` (node depth), `candidate_index` (node order), `task.rep` and
|
|
272
|
+
* `parent_rollout_id` (the containing cell's run). Mint refuses a record
|
|
273
|
+
* that carries `search` when this is absent, because a null `generation`
|
|
274
|
+
* states that the run is not part of a search.
|
|
275
|
+
*/
|
|
276
|
+
searchLineage?: (search: RunSearchCoordinates) => RolloutSearchLineage | Promise<RolloutSearchLineage>;
|
|
257
277
|
}
|
|
258
278
|
interface MintRolloutResult {
|
|
259
279
|
rows: MintedRolloutLine[];
|
|
@@ -281,5 +301,5 @@ declare function unmintableReasons(record: RunRecord): string[];
|
|
|
281
301
|
*/
|
|
282
302
|
declare function mintRolloutRows(records: RunRecord[], store: TraceStore, options?: MintRolloutOptions): Promise<MintRolloutResult>;
|
|
283
303
|
//#endregion
|
|
284
|
-
export {
|
|
285
|
-
//# sourceMappingURL=mint-
|
|
304
|
+
export { toJsonl as C, toSftRows as D, toRftItems as E, toVerifiersRolloutOutput as O, VerifiersTokenUsage as S, toRftItem as T, RftItem as _, mintRolloutRows as a, TrainingExportOptions as b, ScorePreference as c, observedSplitScore as d, scoreOrigin as f, RewardRow as g, RealnessLabels as h, RolloutSearchLineage as i, toVerifiersRolloutOutputs as k, isRealnessGated as l, trainingScore as m, MintRolloutResult as n, unmintableReasons as o, trainingReward as p, RolloutScrubber as r, ScoreOrigin as s, MintRolloutOptions as t, observedScore as u, SftExportOptions as v, toRewardRows as w, VerifiersRolloutOutput as x, SftRow as y };
|
|
305
|
+
//# sourceMappingURL=mint-DsS38v5c.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint-
|
|
1
|
+
{"version":3,"file":"mint-DsS38v5c.d.ts","names":[],"sources":["../src/rollout/exporters.ts","../src/rollout/reward.ts","../src/rollout/mint.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAiDiB;;EAEf;;;;;;EAMA;;UAiBe;;EAEf;;EAEA;;;;;;EAMA,cAAc;;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AAQ;;UAGrB;EACf,MAAM;;EAEN;;;;;;;;;;;;;;iBA4Pc,kBAAkB,QAAQ;;;;;;;iBAiMpB,gBACpB,SAAS,aACT,OAAO,YACP,UAAS,qBACR,QAAQ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as ValidationError } from "./errors-Dngq5h35.js";
|
|
2
2
|
import { a as scoreOrigin, i as rolloutRewardFields } from "./reward-nw2xZGZG.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as runTaskScore } from "./run-record-BRlM99rX.js";
|
|
4
4
|
import { t as buildTrajectory } from "./trajectory-D_7rLrvE.js";
|
|
5
5
|
import { a as assertMinted, r as ROLLOUT_SCHEMA } from "./schema-C1aaAxTf.js";
|
|
6
6
|
//#region src/rollout/mint.ts
|
|
@@ -15,6 +15,7 @@ import { a as assertMinted, r as ROLLOUT_SCHEMA } from "./schema-C1aaAxTf.js";
|
|
|
15
15
|
* - step structure → `buildTrajectory` over the shared TraceStore
|
|
16
16
|
* - preference-pair export → `feedbackTrajectoryToOptimizerRow` (feedback-trajectory.ts)
|
|
17
17
|
* - PRM / reward-model → `reward-model-export.ts`
|
|
18
|
+
* - search lineage → `searchLineage`, read from the run's search ledger
|
|
18
19
|
*
|
|
19
20
|
* Anti-Goodhart invariant: a run whose `outcome.realness.gated` is true is
|
|
20
21
|
* never exported with a positive reward OR with any of the numbers that reward
|
|
@@ -247,16 +248,32 @@ function requireMintableRecord(record) {
|
|
|
247
248
|
if (reasons.length === 0) return;
|
|
248
249
|
throw new ValidationError(`Cannot mint rollout for run ${record.runId}: ${reasons.join("\n ")}`);
|
|
249
250
|
}
|
|
251
|
+
/** The search lineage a record's line is built from; undefined for a record outside a search. */
|
|
252
|
+
async function resolveSearchLineage(record, options) {
|
|
253
|
+
if (record.search === void 0) return void 0;
|
|
254
|
+
const refuse = (detail) => {
|
|
255
|
+
throw new ValidationError(`Cannot mint rollout for search run ${record.runId}: ${detail}`);
|
|
256
|
+
};
|
|
257
|
+
if (!options.searchLineage) refuse("pass searchLineage so generation, candidate_index, rep and parent come from its ledger");
|
|
258
|
+
const lineage = await options.searchLineage(record.search);
|
|
259
|
+
const isCount = (value) => Number.isSafeInteger(value) && value >= 0;
|
|
260
|
+
if (!isCount(lineage.depth)) refuse("lineage depth must be a non-negative integer");
|
|
261
|
+
if (!isCount(lineage.ordinal)) refuse("lineage ordinal must be a non-negative integer");
|
|
262
|
+
if (!isCount(lineage.rep)) refuse("lineage rep must be a non-negative integer");
|
|
263
|
+
if (lineage.containingRunId !== null && (typeof lineage.containingRunId !== "string" || lineage.containingRunId.length === 0)) refuse("lineage containingRunId must be null or a non-empty run id");
|
|
264
|
+
if (lineage.containingRunId === record.runId) refuse("a run cannot contain itself");
|
|
265
|
+
return lineage;
|
|
266
|
+
}
|
|
250
267
|
const SPLIT_FROM_TAG = {
|
|
251
268
|
search: "search",
|
|
252
269
|
dev: "dev",
|
|
253
270
|
holdout: "holdout"
|
|
254
271
|
};
|
|
255
|
-
function mintLine(record, steps, messages, options, capturedAt, gap) {
|
|
272
|
+
function mintLine(record, lineage, steps, messages, options, capturedAt, gap) {
|
|
256
273
|
requireMintableRecord(record);
|
|
257
274
|
requireTaskScore(record);
|
|
258
275
|
const rewardFields = rolloutRewardFields(record);
|
|
259
|
-
const
|
|
276
|
+
const knownTotal = record.costProvenance.kind === "observed" || record.costProvenance.kind === "estimated";
|
|
260
277
|
const terminalOutcome = record.terminalOutcome;
|
|
261
278
|
const isCompleted = terminalOutcome === "succeeded" || terminalOutcome === "failed";
|
|
262
279
|
const isTruncated = terminalOutcome === "cancelled" || terminalOutcome === "incomplete";
|
|
@@ -264,19 +281,19 @@ function mintLine(record, steps, messages, options, capturedAt, gap) {
|
|
|
264
281
|
return assertMinted({
|
|
265
282
|
schema: ROLLOUT_SCHEMA,
|
|
266
283
|
rollout_id: record.runId,
|
|
267
|
-
parent_rollout_id: null,
|
|
284
|
+
parent_rollout_id: lineage?.containingRunId ?? null,
|
|
268
285
|
run_id: record.runId,
|
|
269
286
|
experiment_id: record.experimentId,
|
|
270
287
|
candidate_id: record.candidateId,
|
|
271
|
-
generation: null,
|
|
272
|
-
candidate_index: null,
|
|
288
|
+
generation: lineage?.depth ?? null,
|
|
289
|
+
candidate_index: lineage?.ordinal ?? null,
|
|
273
290
|
role: options.role ?? "agent",
|
|
274
291
|
task: {
|
|
275
292
|
suite: options.suite ?? record.experimentId,
|
|
276
293
|
instance_id: record.scenarioId,
|
|
277
294
|
split: SPLIT_FROM_TAG[record.splitTag],
|
|
278
295
|
seed: record.seed,
|
|
279
|
-
rep: 0
|
|
296
|
+
rep: lineage?.rep ?? 0
|
|
280
297
|
},
|
|
281
298
|
policy: {
|
|
282
299
|
harness: null,
|
|
@@ -302,7 +319,7 @@ function mintLine(record, steps, messages, options, capturedAt, gap) {
|
|
|
302
319
|
error: terminalError
|
|
303
320
|
},
|
|
304
321
|
cost: {
|
|
305
|
-
usd:
|
|
322
|
+
usd: knownTotal ? record.costUsd : null,
|
|
306
323
|
tokens_in: record.tokenUsage.input,
|
|
307
324
|
tokens_out: record.tokenUsage.output,
|
|
308
325
|
tokens_reasoning: record.tokenUsage.reasoning ?? null,
|
|
@@ -313,7 +330,7 @@ function mintLine(record, steps, messages, options, capturedAt, gap) {
|
|
|
313
330
|
artifacts: {
|
|
314
331
|
patch_path: null,
|
|
315
332
|
run_dir: null,
|
|
316
|
-
transcript_ref: null
|
|
333
|
+
transcript_ref: record.traceRef ? `trace:${record.traceRef.traceId}` : null
|
|
317
334
|
},
|
|
318
335
|
provenance: {
|
|
319
336
|
captured_at: capturedAt,
|
|
@@ -337,9 +354,10 @@ async function mintRolloutRows(records, store, options = {}) {
|
|
|
337
354
|
const trajectory = await buildTrajectory(store, record.runId);
|
|
338
355
|
const captured = options.messagesOf ? await options.messagesOf(record.runId) : void 0;
|
|
339
356
|
if (options.messagesOf && (!Array.isArray(captured) || captured.length === 0)) throw new ValidationError(`Cannot mint rollout for run ${record.runId}: full capture is missing`);
|
|
357
|
+
const lineage = await resolveSearchLineage(record, options);
|
|
340
358
|
if (trajectory.steps.length === 0 && !options.messagesOf) {
|
|
341
359
|
missingTraces.push(record.runId);
|
|
342
|
-
rows.push(mintLine(record, [], [], options, capturedAt, "no trace spans recorded for this runId"));
|
|
360
|
+
rows.push(mintLine(record, lineage, [], [], options, capturedAt, "no trace spans recorded for this runId"));
|
|
343
361
|
continue;
|
|
344
362
|
}
|
|
345
363
|
let steps = trajectory.steps.map((s) => projectStep(s.span, scrub));
|
|
@@ -354,7 +372,7 @@ async function mintRolloutRows(records, store, options = {}) {
|
|
|
354
372
|
const conversation = messages.map((message) => projectMessage(message, scrub));
|
|
355
373
|
requireToolLinkage(conversation.filter((message) => message.is_copied_context !== true), record.runId);
|
|
356
374
|
const gap = conversation.length === 0 ? "trace has no llm spans — no conversation to inline" : void 0;
|
|
357
|
-
rows.push(mintLine(record, steps, conversation, options, capturedAt, gap));
|
|
375
|
+
rows.push(mintLine(record, lineage, steps, conversation, options, capturedAt, gap));
|
|
358
376
|
}
|
|
359
377
|
return {
|
|
360
378
|
rows,
|
|
@@ -364,4 +382,4 @@ async function mintRolloutRows(records, store, options = {}) {
|
|
|
364
382
|
//#endregion
|
|
365
383
|
export { unmintableReasons as n, mintRolloutRows as t };
|
|
366
384
|
|
|
367
|
-
//# sourceMappingURL=mint-
|
|
385
|
+
//# sourceMappingURL=mint-iCD-W43s.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mint-iCD-W43s.js","names":[],"sources":["../src/rollout/mint.ts"],"sourcesContent":["/**\n * Rollout minting — `tangle.rollout.v1` lines joined from the records the\n * substrate ALREADY keeps. There is no separate rollout store: a rollout\n * is the JOIN of a RunRecord (identity, provenance, cost, outcome) with\n * its trace (spans share `runId`), projected into the canonical line.\n *\n * Composition, not duplication:\n * - identity/provenance → `RunRecord` (candidateId, splitTag, agentProfile, hashes)\n * - step structure → `buildTrajectory` over the shared TraceStore\n * - preference-pair export → `feedbackTrajectoryToOptimizerRow` (feedback-trajectory.ts)\n * - PRM / reward-model → `reward-model-export.ts`\n * - search lineage → `searchLineage`, read from the run's search ledger\n *\n * Anti-Goodhart invariant: a run whose `outcome.realness.gated` is true is\n * never exported with a positive reward OR with any of the numbers that reward\n * was computed from. The gate travels into the training data (`reward` forced\n * to 0, `realness_gated: true`) and the whole outcome is transformed by\n * `gateGamedOutcome` inside `assertMinted` below, which relocates `metrics` and\n * `verdict` to `provenance.gated_evidence`. Mint returns\n * `MintedRolloutLine[]`: the brand the training exporters require, which only\n * this function, `readRolloutLedger`, and an explicit `assertMinted` can mint.\n *\n * A record carrying NEITHER split score is REJECTED (`ValidationError`), never\n * minted at 0 — \"nobody graded this\" is not the same claim as \"graded a total\n * failure\", and a trainer reading 0 learns the second. Lines that already\n * carry `reward: null` (interchange imports, existing ledgers) remain valid on\n * the wire; only the RunRecord→line door refuses.\n *\n * Records without spans or an explicit full capture become labeled GAP LINES (messages: [],\n * provenance.gap) — present in the output AND surfaced in\n * `missingTraces`; a capture gap is a finding, never a silent omission.\n */\n\nimport { ValidationError } from '../errors'\nimport { type RunRecord, type RunSearchCoordinates, runTaskScore } from '../run-record'\nimport type { LlmSpan, Span, ToolSpan } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\nimport { buildTrajectory } from '../trajectory'\nimport { rolloutRewardFields, scoreOrigin } from './reward'\nimport {\n assertMinted,\n type ChatMessage,\n type MintedRolloutLine,\n ROLLOUT_SCHEMA,\n type RolloutRole,\n type RolloutSplit,\n type RolloutStep,\n} from './schema'\n\n/** Redactor for transcript/step payload text (secrets, PII), not opaque identity. */\nexport type RolloutScrubber = (text: string) => string\n\n/** A search cell's place in its search tree, read from the search ledger. */\nexport interface RolloutSearchLineage {\n /** Edges between the cell's node and the search root; the root is 0. */\n depth: number\n /** Order in which the node registered in its search; the root is 0. */\n ordinal: number\n /** Repeat index of the cell on its task, from 0. */\n rep: number\n /** Run id of the cell whose execution contains this search; null for a\n * top-level search. */\n containingRunId: string | null\n}\n\nexport interface MintRolloutOptions {\n scrub?: RolloutScrubber\n /**\n * Full canonical capture, including turns no longer in the model's context.\n * When supplied, missing/empty capture is refused, never replaced with a\n * span summary. Use the execution owner's capture or the existing harness\n * readers; reviewer traces and compacted histories are not full capture.\n */\n messagesOf?: (\n runId: string,\n ) => readonly ChatMessage[] | undefined | Promise<readonly ChatMessage[] | undefined>\n /** Cap steps per line (longest runs first drop middle steps). Default: no cap. */\n maxSteps?: number\n /** Role recorded on every minted line. Default 'agent' (a solo eval run). */\n role?: RolloutRole\n /** Task suite label. Default: the record's `experimentId`. */\n suite?: string\n /** Injected clock for deterministic output. */\n now?: () => Date\n /**\n * Lineage of a search run, read from its search ledger. It fills the line's\n * `generation` (node depth), `candidate_index` (node order), `task.rep` and\n * `parent_rollout_id` (the containing cell's run). Mint refuses a record\n * that carries `search` when this is absent, because a null `generation`\n * states that the run is not part of a search.\n */\n searchLineage?: (\n search: RunSearchCoordinates,\n ) => RolloutSearchLineage | Promise<RolloutSearchLineage>\n}\n\nexport interface MintRolloutResult {\n rows: MintedRolloutLine[]\n /** runIds that had a RunRecord but no spans — emitted as gap lines AND listed here. */\n missingTraces: string[]\n}\n\nconst asText = (v: unknown, scrub: RolloutScrubber): string => {\n const s = typeof v === 'string' ? v : JSON.stringify(v)\n return scrub(s ?? '')\n}\n\nfunction projectStep(span: Span, scrub: RolloutScrubber): RolloutStep {\n const base: RolloutStep = {\n kind: span.kind,\n name: scrub(span.name),\n status: span.status,\n durationMs: span.endedAt !== undefined ? span.endedAt - span.startedAt : undefined,\n }\n if (span.kind === 'llm') {\n const llm = span as LlmSpan\n const last = llm.messages[llm.messages.length - 1]\n if (last && last.content !== null) base.input = scrub(last.content)\n if (llm.output !== undefined) base.output = scrub(llm.output)\n } else if (span.kind === 'tool') {\n const tool = span as ToolSpan\n base.input = asText(tool.args, scrub)\n if (tool.result !== undefined) base.output = asText(tool.result, scrub)\n }\n return base\n}\n\n/** Preserve captured fields; invocation ids are opaque linkage, not generated text. */\nfunction projectMessage(message: ChatMessage, scrub: RolloutScrubber): ChatMessage {\n return {\n role: message.role,\n content: message.content === null ? null : scrub(message.content),\n ...(message.reasoning_content !== undefined\n ? { reasoning_content: scrub(message.reasoning_content) }\n : {}),\n ...(message.tool_calls !== undefined\n ? {\n tool_calls: message.tool_calls.map((call) => ({\n id: call.id,\n type: call.type,\n function: {\n name: call.function.name,\n arguments: scrub(call.function.arguments),\n },\n })),\n }\n : {}),\n ...(message.tool_call_id !== undefined ? { tool_call_id: message.tool_call_id } : {}),\n ...(message.name !== undefined ? { name: message.name } : {}),\n ...(message.is_copied_context !== undefined\n ? { is_copied_context: message.is_copied_context }\n : {}),\n }\n}\n\n/** Never recover missing calls from tool names, span order or argument summaries. */\nfunction requireToolLinkage(messages: readonly ChatMessage[], runId: string): void {\n const seen = new Set<string>()\n const pending = new Map<string, string>()\n const refuse: (detail: string) => never = (detail) => {\n throw new ValidationError(`Cannot mint rollout for run ${runId}: ${detail}`)\n }\n for (const message of messages) {\n if (message.tool_calls !== undefined) {\n if (message.role !== 'assistant' || !Array.isArray(message.tool_calls)) {\n refuse('tool calls must be captured on an assistant message')\n }\n if (pending.size > 0) refuse('new tool calls precede the prior invocation results')\n for (const call of message.tool_calls) {\n if (\n !call ||\n typeof call.id !== 'string' ||\n call.id.length === 0 ||\n seen.has(call.id) ||\n call.type !== 'function' ||\n !call.function ||\n typeof call.function.name !== 'string' ||\n call.function.name.length === 0 ||\n typeof call.function.arguments !== 'string'\n ) {\n refuse('missing, duplicate or malformed tool invocation')\n }\n seen.add(call.id)\n pending.set(call.id, call.function.name)\n }\n }\n if (message.role === 'tool') {\n const id = message.tool_call_id\n if (typeof id !== 'string' || !pending.has(id)) {\n refuse('tool result has no captured invocation (or answers it more than once)')\n }\n if (message.name !== undefined && message.name !== pending.get(id)) {\n refuse('tool result name does not match its invocation')\n }\n pending.delete(id)\n } else if (message.tool_call_id !== undefined) {\n refuse('tool_call_id is only valid on a tool result')\n } else if (pending.size > 0 && message.tool_calls === undefined) {\n refuse('conversation advances before all tool results were captured')\n }\n }\n if (pending.size > 0) refuse('tool invocation has no captured result')\n}\n\n/** Legacy span history; callers with compacted contexts supply messagesOf instead. */\nfunction finalConversation(spans: Span[]): ChatMessage[] {\n const llms = spans.filter((s): s is LlmSpan => s.kind === 'llm')\n const last = llms[llms.length - 1]\n if (!last) return []\n const messages: ChatMessage[] = [...last.messages]\n if (last.output !== undefined && last.output !== '') {\n messages.push({ role: 'assistant', content: last.output })\n }\n return messages\n}\n\n// The reward derivations live in the leaf module `./reward` so gate and\n// reporting code can import them without dragging in the trace store; they are\n// re-exported here because the derivations shipped from this path.\nexport {\n isRealnessGated,\n observedScore,\n observedSplitScore,\n type ScoreOrigin,\n type ScorePreference,\n scoreOrigin,\n trainingReward,\n trainingScore,\n} from './reward'\n\nconst REWARD_SOURCE: Record<ReturnType<typeof scoreOrigin>, string> = {\n holdout: 'run-record/holdout-score',\n search: 'run-record/search-score',\n unscored: 'run-record/unscored',\n}\n\n/**\n * The mint door refuses an execution-only record: a missing training label is\n * not a zero reward, and not a mintable line either. Lines that already carry\n * `reward: null` — interchange imports, existing ledgers — stay valid on the\n * wire and keep their labeled gap; this guard is only about the\n * RunRecord→line door, where the producer can still be told to go score the\n * run instead of shipping an unlabeled row.\n */\nfunction requireTaskScore(record: RunRecord): void {\n if (runTaskScore(record) === undefined) {\n throw new ValidationError(`Cannot mint rollout for run ${record.runId}: task score is missing`)\n }\n}\n\nconst isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null\n\ninterface MintFieldCheck {\n /** The RunRecord path, spelled the way the caller has to fix it. */\n readonly field: string\n /** True when the record carries something the line can honestly be built from. */\n readonly present: (bag: Record<string, unknown>) => boolean\n /** What the caller writes onto the record, and why that value and not another. */\n readonly remedy: string\n}\n\n/**\n * The RunRecord fields mint reads that a record can be missing even though the\n * TYPE says it cannot. There are exactly two ways that happens:\n *\n * 1. The field was OPTIONAL when the record was serialized. `costProvenance`,\n * `terminalOutcome` and `scenarioId` were optional through agent-eval\n * 0.125 and became required in 0.126, with no on-disk migration — so every\n * ledger written before 0.126 is full of records the type calls complete.\n * 2. Mint reads a level DEEPER than the record's own type is checked at:\n * `outcome.raw`, `tokenUsage.input`, `tokenUsage.output`.\n *\n * Nothing else needs a check here. Every other field mint copies is a top-level\n * scalar landing in a typed slot on the line, where an absent value arrives as\n * `undefined` and `assertMinted` refuses it by name. These are the ones where an\n * absent value instead kills the join with `TypeError: Cannot read properties of\n * undefined`, or — worse — mints a line that reads as measured.\n *\n * This is deliberately NOT `validateRunRecord`. That validator answers \"is this\n * a valid RunRecord\", which is a wider question than \"can a rollout line be\n * built from this one\": it also enforces model-snapshot discipline, the\n * `terminalFailureReason` coupling, and the `costUsd === costProvenance.usd`\n * agreement. Routing the mint door through it would refuse records mint can\n * mint honestly today (a model alias with no snapshot date, for one), which is\n * a policy change with its own blast radius and not this bug. The door asks the\n * narrower question and answers it precisely.\n */\nconst MINT_FIELD_CHECKS: readonly MintFieldCheck[] = [\n {\n field: 'costProvenance',\n present: (bag) => isObject(bag.costProvenance) && typeof bag.costProvenance.kind === 'string',\n remedy:\n \"Records written before agent-eval 0.126 predate this field and carry `costUsd: 0` as the documented uncaptured sentinel, which is NOT an observed zero. Backfill it as costProvenance: { kind: 'uncaptured', usd: null } WITH costUsd: null — an uncaptured cost whose costUsd is non-null is rejected by validateRunRecord, so provenance alone leaves the record invalid.\",\n },\n {\n field: 'tokenUsage',\n present: (bag) => isObject(bag.tokenUsage),\n remedy:\n \"The line's cost.tokens_in and cost.tokens_out are read from it. Backfill it from the provider's usage report; mint will not write 0 for tokens nobody counted.\",\n },\n {\n field: 'tokenUsage.input',\n present: (bag) => !isObject(bag.tokenUsage) || typeof bag.tokenUsage.input === 'number',\n remedy: \"The line's cost.tokens_in is read from it, and a missing count is not a zero count.\",\n },\n {\n field: 'tokenUsage.output',\n present: (bag) => !isObject(bag.tokenUsage) || typeof bag.tokenUsage.output === 'number',\n remedy: \"The line's cost.tokens_out is read from it, and a missing count is not a zero count.\",\n },\n {\n field: 'outcome',\n present: (bag) => isObject(bag.outcome),\n remedy:\n \"The line's reward, reward_source and metrics are all read from it. A record with no outcome carries no training label at all, and mint refuses an unlabeled row.\",\n },\n {\n field: 'outcome.raw',\n // Reported only when `outcome` itself is present: one absent field should\n // produce one reason per CAUSE, not one per path that dereferences it.\n present: (bag) => !isObject(bag.outcome) || isObject(bag.outcome.raw),\n remedy:\n 'It is the metric bag copied verbatim into the line\\'s outcome.metrics. `{ ...undefined }` spreads to `{}` without complaint, so an absent bag would mint as \"this run reported no metrics\" — a different claim from \"this record predates the field\". Backfill it as {} only when that is what you mean.',\n },\n {\n field: 'terminalOutcome',\n present: (bag) => typeof bag.terminalOutcome === 'string',\n remedy:\n \"It became required in agent-eval 0.126. Backfill it from root-run or process evidence, or as 'unknown' when the producer has none — mint will not decide the line's is_completed and is_truncated for you.\",\n },\n {\n field: 'scenarioId',\n present: (bag) => typeof bag.scenarioId === 'string' && bag.scenarioId.length > 0,\n remedy:\n \"It became required in agent-eval 0.126 and becomes the line's task.instance_id, which must be a non-empty string. Backfill it from the scenario the run was dealt (pre-0.126 producers often left it in outcome.raw.scenario_id).\",\n },\n]\n\n/**\n * Why a record cannot be minted, one entry per missing field, empty when it can.\n *\n * Exported so a caller can partition a whole ledger — \"which of my 2742 records\n * predate 0.126\" — without catching an exception per record, and without\n * re-deriving the field list on their side. A re-derived list is a list that\n * drifts from the door it is supposed to predict.\n *\n * Takes a `RunRecord` because that is what the caller holds and what the\n * compiler agrees they hold. The type is precisely the thing that is wrong, so\n * the checks read the record as the untyped bag it actually is on disk.\n */\nexport function unmintableReasons(record: RunRecord): string[] {\n const bag = record as unknown as Record<string, unknown>\n return MINT_FIELD_CHECKS.filter((check) => !check.present(bag)).map(\n (check) => `${check.field} is missing. ${check.remedy}`,\n )\n}\n\n/**\n * The mint door THROWS on a record it cannot build a line from. It does NOT\n * normalise an absent `costProvenance` to `{kind:'uncaptured', usd:null}`, and\n * the choice is not stylistic:\n *\n * - Normalising cannot cover the record, only part of it. `terminalOutcome`\n * feeds `is_completed` and `is_truncated`, which the rollout schema requires\n * to be BOOLEAN — there is no null to fall back to, so every possible\n * default is a claim about how the run ended. A door that quietly fixes the\n * cost and invents the ending is a door no caller can predict.\n * - Normalising the cost requires knowing what `costUsd: 0` meant, and mint\n * cannot know. A genuinely free run and an uncaptured one are the same bytes\n * in a pre-0.126 record; only the producer can tell them apart. Guessing is\n * exactly the failure this guard exists to stop — the 0.125 optional chain\n * `record.costProvenance?.kind === 'uncaptured'` already made that guess,\n * silently, and every record it touched minted `cost.usd: 0`: an unmeasured\n * cost published as a measured zero, into a training dataset.\n * - `requireTaskScore`, directly above, already refuses an unlabeled record\n * for the same reason: \"nobody graded this\" is not \"graded zero\". \"Nobody\n * billed this\" is not \"billed zero\".\n *\n * The caller who wants historical records minted backfills them at their store,\n * in one pass, where `costUsd` can be corrected alongside `costProvenance` —\n * which is the only place that decision can be made correctly. The refusal names\n * the run, names every missing field, and spells the value to write.\n */\nfunction requireMintableRecord(record: RunRecord): void {\n const reasons = unmintableReasons(record)\n if (reasons.length === 0) return\n throw new ValidationError(`Cannot mint rollout for run ${record.runId}: ${reasons.join('\\n ')}`)\n}\n\n/** The search lineage a record's line is built from; undefined for a record outside a search. */\nasync function resolveSearchLineage(\n record: RunRecord,\n options: MintRolloutOptions,\n): Promise<RolloutSearchLineage | undefined> {\n if (record.search === undefined) return undefined\n const refuse: (detail: string) => never = (detail) => {\n throw new ValidationError(`Cannot mint rollout for search run ${record.runId}: ${detail}`)\n }\n if (!options.searchLineage) {\n refuse('pass searchLineage so generation, candidate_index, rep and parent come from its ledger')\n }\n const lineage = await options.searchLineage(record.search)\n const isCount = (value: unknown): boolean => Number.isSafeInteger(value) && (value as number) >= 0\n if (!isCount(lineage.depth)) refuse('lineage depth must be a non-negative integer')\n if (!isCount(lineage.ordinal)) refuse('lineage ordinal must be a non-negative integer')\n if (!isCount(lineage.rep)) refuse('lineage rep must be a non-negative integer')\n if (\n lineage.containingRunId !== null &&\n (typeof lineage.containingRunId !== 'string' || lineage.containingRunId.length === 0)\n ) {\n refuse('lineage containingRunId must be null or a non-empty run id')\n }\n if (lineage.containingRunId === record.runId) refuse('a run cannot contain itself')\n return lineage\n}\n\nconst SPLIT_FROM_TAG: Record<RunRecord['splitTag'], RolloutSplit> = {\n search: 'search',\n dev: 'dev',\n holdout: 'holdout',\n}\n\nfunction mintLine(\n record: RunRecord,\n lineage: RolloutSearchLineage | undefined,\n steps: RolloutStep[],\n messages: ChatMessage[],\n options: MintRolloutOptions,\n capturedAt: string,\n gap?: string,\n): MintedRolloutLine {\n // Field presence first, and BEFORE `requireTaskScore`: that guard reads\n // `record.outcome.searchScore` on its way to the answer, so an absent\n // `outcome` would throw a bare TypeError from inside the guard whose whole\n // job is to produce a clean refusal.\n //\n // Both branches of `mintRolloutRows` — the traced line and the gap line —\n // land here, which is the point: `mintLine` is the only constructor of a\n // `MintedRolloutLine` from a RunRecord, so there is no path into the waist\n // that skips the check and no way to get this wrong from the outside.\n requireMintableRecord(record)\n // A missing task score is refused before anything is built: an\n // execution-only record has no training label, and a missing label is\n // neither a zero reward nor a mintable row.\n requireTaskScore(record)\n // `reward` and `realness_gated` come out of one call, so neither door into\n // the waist can write one and forget the other.\n const rewardFields = rolloutRewardFields(record)\n // Only an observed or estimated amount is a total; a lower bound is not.\n const knownTotal =\n record.costProvenance.kind === 'observed' || record.costProvenance.kind === 'estimated'\n const terminalOutcome = record.terminalOutcome\n const isCompleted = terminalOutcome === 'succeeded' || terminalOutcome === 'failed'\n const isTruncated = terminalOutcome === 'cancelled' || terminalOutcome === 'incomplete'\n const terminalError =\n terminalOutcome === 'failed' ||\n terminalOutcome === 'cancelled' ||\n terminalOutcome === 'incomplete'\n ? (record.terminalFailureReason ?? `run ended ${terminalOutcome}`)\n : null\n // `assertMinted` rather than a cast: mint is the producer the whole gate\n // rests on, so it proves the line it just built is valid instead of asserting\n // it by fiat. The brand is unforgeable precisely because nobody casts to it.\n return assertMinted(\n {\n schema: ROLLOUT_SCHEMA,\n rollout_id: record.runId,\n parent_rollout_id: lineage?.containingRunId ?? null,\n run_id: record.runId,\n experiment_id: record.experimentId,\n candidate_id: record.candidateId,\n generation: lineage?.depth ?? null,\n candidate_index: lineage?.ordinal ?? null,\n role: options.role ?? 'agent',\n task: {\n suite: options.suite ?? record.experimentId,\n instance_id: record.scenarioId,\n split: SPLIT_FROM_TAG[record.splitTag],\n seed: record.seed,\n rep: lineage?.rep ?? 0,\n },\n policy: {\n harness: null,\n harness_version: null,\n model: record.model,\n provider: null,\n profile_commit: record.commitSha,\n prompt_hash: record.promptHash,\n config_hash: record.configHash,\n agent_profile_cell_id: record.agentProfile?.cellId ?? null,\n sampling: null,\n },\n messages,\n tool_defs: [],\n ...(steps.length > 0 ? { steps } : {}),\n outcome: {\n ...rewardFields,\n reward_source: REWARD_SOURCE[scoreOrigin(record)],\n verdict: null,\n // A verbatim bulk copy, deliberately UNFILTERED here. `outcome.raw`\n // holds the per-layer verifier scores (`layer.*`) that the reward was\n // derived from, so on a gated run this dict is the reward signal in\n // component form — but filtering it at this call site is the pattern\n // that has now leaked twice, because the next producer to write a\n // reward-bearing field forgets. The gate is applied to the whole\n // outcome once, in `assertMinted` below (`gateGamedOutcome`), which\n // moves the block to `provenance.gated_evidence` when the run is gated\n // and leaves it here untouched when it is not.\n metrics: { ...record.outcome.raw },\n is_completed: isCompleted,\n is_truncated: isTruncated,\n error: terminalError,\n },\n cost: {\n usd: knownTotal ? record.costUsd : null,\n tokens_in: record.tokenUsage.input,\n tokens_out: record.tokenUsage.output,\n tokens_reasoning: record.tokenUsage.reasoning ?? null,\n cache_read: record.tokenUsage.cached ?? null,\n cache_write: record.tokenUsage.cacheWrite ?? null,\n wall_s: Math.round(record.wallMs / 1000),\n },\n artifacts: {\n patch_path: null,\n run_dir: null,\n transcript_ref: record.traceRef ? `trace:${record.traceRef.traceId}` : null,\n },\n provenance: {\n captured_at: capturedAt,\n capture: 'mint',\n ...(gap !== undefined ? { gap } : {}),\n },\n },\n `minted rollout line for run ${record.runId}`,\n )\n}\n\n/**\n * Join RunRecords with their traces into canonical rollout lines. Records\n * without spans or an explicit capture are emitted as labeled gap lines and reported in\n * `missingTraces`. Execution-only records without a task score are rejected\n * because a missing training label is not a zero reward.\n */\nexport async function mintRolloutRows(\n records: RunRecord[],\n store: TraceStore,\n options: MintRolloutOptions = {},\n): Promise<MintRolloutResult> {\n const scrub = options.scrub ?? ((t) => t)\n const capturedAt = (options.now?.() ?? new Date()).toISOString()\n const rows: MintedRolloutLine[] = []\n const missingTraces: string[] = []\n for (const record of records) {\n const trajectory = await buildTrajectory(store, record.runId)\n const captured = options.messagesOf ? await options.messagesOf(record.runId) : undefined\n if (options.messagesOf && (!Array.isArray(captured) || captured.length === 0)) {\n throw new ValidationError(\n `Cannot mint rollout for run ${record.runId}: full capture is missing`,\n )\n }\n const lineage = await resolveSearchLineage(record, options)\n if (trajectory.steps.length === 0 && !options.messagesOf) {\n missingTraces.push(record.runId)\n rows.push(\n mintLine(\n record,\n lineage,\n [],\n [],\n options,\n capturedAt,\n 'no trace spans recorded for this runId',\n ),\n )\n continue\n }\n let steps = trajectory.steps.map((s) => projectStep(s.span, scrub))\n if (options.maxSteps !== undefined && steps.length > options.maxSteps) {\n // Keep the head and tail — the middle of a long run is the least\n // informative for outcome attribution.\n const head = Math.ceil(options.maxSteps / 2)\n const tail = options.maxSteps - head\n steps = [...steps.slice(0, head), ...steps.slice(steps.length - tail)]\n }\n const spans = trajectory.steps.map((s) => s.span)\n const messages = captured ?? finalConversation(spans)\n requireToolLinkage(messages, record.runId)\n const conversation = messages.map((message) => projectMessage(message, scrub))\n // SFT drops copied context. That projection must not orphan a retained result.\n requireToolLinkage(\n conversation.filter((message) => message.is_copied_context !== true),\n record.runId,\n )\n const gap =\n conversation.length === 0 ? 'trace has no llm spans — no conversation to inline' : undefined\n rows.push(m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xD,cAAc,KAAK,OAAO,KAAK;GAC/B,KAAK,KACH,SACE,QACA,SACA,CAAC,GACD,CAAC,GACD,SACA,YACA,wCACF,CACF;GACA;EACF;EACA,IAAI,QAAQ,WAAW,MAAM,KAAK,MAAM,YAAY,EAAE,MAAM,KAAK,CAAC;EAClE,IAAI,QAAQ,aAAa,KAAA,KAAa,MAAM,SAAS,QAAQ,UAAU;GAGrE,MAAM,OAAO,KAAK,KAAK,QAAQ,WAAW,CAAC;GAC3C,MAAM,OAAO,QAAQ,WAAW;GAChC,QAAQ,CAAC,GAAG,MAAM,MAAM,GAAG,IAAI,GAAG,GAAG,MAAM,MAAM,MAAM,SAAS,IAAI,CAAC;EACvE;EACA,MAAM,QAAQ,WAAW,MAAM,KAAK,MAAM,EAAE,IAAI;EAChD,MAAM,WAAW,YAAY,kBAAkB,KAAK;EACpD,mBAAmB,UAAU,OAAO,KAAK;EACzC,MAAM,eAAe,SAAS,KAAK,YAAY,eAAe,SAAS,KAAK,CAAC;EAE7E,mBACE,aAAa,QAAQ,YAAY,QAAQ,sBAAsB,IAAI,GACnE,OAAO,KACT;EACA,MAAM,MACJ,aAAa,WAAW,IAAI,uDAAuD,KAAA;EACrF,KAAK,KAAK,SAAS,QAAQ,SAAS,OAAO,cAAc,SAAS,YAAY,GAAG,CAAC;CACpF;CACA,OAAO;EAAE;EAAM;CAAc;AAC/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as MultishotResult, M as MultishotTransportRequest, T as MultishotPersona, c as RunMultishotMatrixResult, f as RunMultishotOptions, k as MultishotToolDefinition, s as RunMultishotMatrixOptions } from "../../matrix-
|
|
1
|
+
import { E as MultishotResult, M as MultishotTransportRequest, T as MultishotPersona, c as RunMultishotMatrixResult, f as RunMultishotOptions, k as MultishotToolDefinition, s as RunMultishotMatrixOptions } from "../../matrix-CNypzP-v.js";
|
|
2
2
|
//#region src/multishot/golden/compare.d.ts
|
|
3
3
|
interface CompareOptions {
|
|
4
4
|
/** Stop after this many mismatches. A structural divergence high in the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { w as JudgeScore } from "../types-
|
|
2
|
-
import { A as MultishotToolExecutor, C as MultishotFatalToolError, D as MultishotShape, E as MultishotResult, F as assertMultishotShotResult, M as MultishotTransportRequest, N as MultishotTransportResponse, O as MultishotShotResultError, P as MultishotTransportToolCall, S as MultishotDriverEmptyError, T as MultishotPersona, _ as JudgeRunResult, a as MultishotCellOutput, b as runJudge, c as RunMultishotMatrixResult, d as MultishotShot, f as RunMultishotOptions, g as JudgeDimension, h as JudgeConfig, i as ConversationJudgeInput, j as MultishotTransport, k as MultishotToolDefinition, l as computeCellComposite, m as DEFAULT_JUDGE_MODEL, n as CellCompositeInput, o as MultishotJudges, p as runMultishot, r as CellCompositeScore, s as RunMultishotMatrixOptions, t as ArtifactJudgeInput, u as runMultishotMatrix, v as renderDimensions, w as MultishotMessage, x as MultishotArtifact, y as renderJsonFooter } from "../matrix-
|
|
1
|
+
import { w as JudgeScore } from "../types-BvmWNjjs.js";
|
|
2
|
+
import { A as MultishotToolExecutor, C as MultishotFatalToolError, D as MultishotShape, E as MultishotResult, F as assertMultishotShotResult, M as MultishotTransportRequest, N as MultishotTransportResponse, O as MultishotShotResultError, P as MultishotTransportToolCall, S as MultishotDriverEmptyError, T as MultishotPersona, _ as JudgeRunResult, a as MultishotCellOutput, b as runJudge, c as RunMultishotMatrixResult, d as MultishotShot, f as RunMultishotOptions, g as JudgeDimension, h as JudgeConfig, i as ConversationJudgeInput, j as MultishotTransport, k as MultishotToolDefinition, l as computeCellComposite, m as DEFAULT_JUDGE_MODEL, n as CellCompositeInput, o as MultishotJudges, p as runMultishot, r as CellCompositeScore, s as RunMultishotMatrixOptions, t as ArtifactJudgeInput, u as runMultishotMatrix, v as renderDimensions, w as MultishotMessage, x as MultishotArtifact, y as renderJsonFooter } from "../matrix-CNypzP-v.js";
|
|
3
3
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
4
4
|
//#region src/multishot/cost.d.ts
|
|
5
5
|
/**
|
package/dist/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "@tangle-network/agent-eval — wire protocol",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.189.0",
|
|
6
6
|
"description": "HTTP and stdio RPC interface to agent-eval. The TypeScript runtime is the source of truth; this spec is the contract that cross-language clients (Python, Rust, Go) generate from.\n\nWire-protocol version: 1.1.0. Bumps on breaking changes to request/response schemas.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "Tangle Network",
|
|
@@ -1,24 +1,79 @@
|
|
|
1
|
-
import { f as Run } from "../schema-
|
|
2
|
-
import { a as RunFilter, s as TraceStore } from "../store-
|
|
3
|
-
import { n as FailureClusterReport, r as failureClusterView, t as FailureCluster } from "../failure-cluster-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { f as Run } from "../schema-2g7trUwH.js";
|
|
2
|
+
import { a as RunFilter, s as TraceStore } from "../store-C4avFjIi.js";
|
|
3
|
+
import { n as FailureClusterReport, r as failureClusterView, t as FailureCluster } from "../failure-cluster-CbgEDcFJ.js";
|
|
4
|
+
import { t as DiagnosisSpan } from "../spans-W0o8pbEg.js";
|
|
5
|
+
import { n as TrajectoryStep } from "../trajectory-Y1fmdlw7.js";
|
|
6
|
+
import { c as computeToolUseMetrics, d as judgeAgreementView, f as BudgetBreachFinding, g as BaselineReport, h as BaselineOptions, i as toolWasteView, l as JudgeAgreementReport, m as budgetBreachView, n as ToolWasteOptions, p as BudgetBreachReport, r as ToolWasteReport, t as ToolWasteFinding, u as JudgePair } from "../tool-waste-CP5DO383.js";
|
|
6
7
|
//#region src/pipelines/first-divergence.d.ts
|
|
8
|
+
/** One step of a run, as the diff reads it. */
|
|
9
|
+
interface DiffStep {
|
|
10
|
+
/** The step's id within its run. */
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
/** Fields compared once two steps pair, such as status, tool or model. */
|
|
15
|
+
fields: Readonly<Record<string, string | number | boolean | null>>;
|
|
16
|
+
}
|
|
17
|
+
type StepPairing = 'id' | 'position' | 'name';
|
|
18
|
+
interface FieldDifference {
|
|
19
|
+
field: string;
|
|
20
|
+
a: string | number | boolean | null;
|
|
21
|
+
b: string | number | boolean | null;
|
|
22
|
+
}
|
|
23
|
+
interface StepPair {
|
|
24
|
+
/** Index in run A. */
|
|
25
|
+
a: number;
|
|
26
|
+
/** Index in run B. */
|
|
27
|
+
b: number;
|
|
28
|
+
pairedBy: StepPairing;
|
|
29
|
+
/** Empty when the paired steps agree on name, kind and every field. */
|
|
30
|
+
differences: FieldDifference[];
|
|
31
|
+
}
|
|
32
|
+
type StepDivergenceKind = 'changed' | 'replaced' | 'only-in-a' | 'only-in-b' | 'reordered';
|
|
33
|
+
interface StepDivergence {
|
|
34
|
+
/** The first index at which the runs stop agreeing; equals `commonPrefixLen`. */
|
|
35
|
+
index: number;
|
|
36
|
+
kind: StepDivergenceKind;
|
|
37
|
+
/** Index of the step at `index` in each run, or null when that run has ended. */
|
|
38
|
+
a: number | null;
|
|
39
|
+
b: number | null;
|
|
40
|
+
/** Set when `kind` is `changed`. */
|
|
41
|
+
differences: FieldDifference[];
|
|
42
|
+
reason: string;
|
|
43
|
+
}
|
|
44
|
+
interface StepDiff {
|
|
45
|
+
/** Paired steps in run A order. */
|
|
46
|
+
pairs: StepPair[];
|
|
47
|
+
/** Indexes of run A steps with no partner in run B. */
|
|
48
|
+
onlyInA: number[];
|
|
49
|
+
/** Indexes of run B steps with no partner in run A. */
|
|
50
|
+
onlyInB: number[];
|
|
51
|
+
/** Leading steps paired index for index with no difference. */
|
|
52
|
+
commonPrefixLen: number;
|
|
53
|
+
/** Null when the runs agree step for step. */
|
|
54
|
+
firstDivergence: StepDivergence | null;
|
|
55
|
+
}
|
|
56
|
+
declare function diffSteps(a: readonly DiffStep[], b: readonly DiffStep[]): StepDiff;
|
|
7
57
|
interface DivergenceReport {
|
|
8
58
|
runA: string;
|
|
9
59
|
runB: string;
|
|
60
|
+
/** Null when the runs agree step for step. */
|
|
10
61
|
firstDivergenceIndex: number | null;
|
|
11
62
|
aStep?: TrajectoryStep;
|
|
12
63
|
bStep?: TrajectoryStep;
|
|
13
64
|
reason?: string;
|
|
14
|
-
/** Common prefix length (steps that matched). */
|
|
15
65
|
commonPrefixLen: number;
|
|
66
|
+
/** The step diff behind the first divergence, over trajectory step indexes. */
|
|
67
|
+
diff: StepDiff;
|
|
16
68
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
69
|
+
declare function firstDivergenceView(store: TraceStore, runA: string, runB: string): Promise<DivergenceReport>;
|
|
70
|
+
/**
|
|
71
|
+
* One run's spans as diff steps, in containment order: depth first, siblings
|
|
72
|
+
* by start time, the same order `buildTrajectory` gives a trace store run.
|
|
73
|
+
* Spans whose parent is absent, or whose parents form a cycle, start their own
|
|
74
|
+
* subtree, so every span appears exactly once.
|
|
75
|
+
*/
|
|
76
|
+
declare function diffStepsFromSpans(spans: readonly DiagnosisSpan[]): DiffStep[];
|
|
22
77
|
//#endregion
|
|
23
78
|
//#region src/pipelines/regression.d.ts
|
|
24
79
|
interface RegressionSpec {
|
|
@@ -67,5 +122,5 @@ interface StuckLoopOptions {
|
|
|
67
122
|
}
|
|
68
123
|
declare function stuckLoopView(store: TraceStore, options?: StuckLoopOptions): Promise<StuckLoopReport>;
|
|
69
124
|
//#endregion
|
|
70
|
-
export { BudgetBreachFinding, BudgetBreachReport,
|
|
125
|
+
export { BudgetBreachFinding, BudgetBreachReport, DiffStep, DivergenceReport, FailureCluster, FailureClusterReport, FieldDifference, JudgeAgreementReport, JudgePair, RegressionOptions, RegressionSpec, StepDiff, StepDivergence, StepDivergenceKind, StepPair, StepPairing, StuckLoopFinding, StuckLoopOptions, StuckLoopReport, ToolWasteFinding, ToolWasteOptions, ToolWasteReport, budgetBreachView, computeToolUseMetrics, diffSteps, diffStepsFromSpans, failureClusterView, firstDivergenceView, judgeAgreementView, regressionView, stuckLoopView, toolWasteView };
|
|
71
126
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/pipelines/first-divergence.ts","../../src/pipelines/regression.ts","../../src/pipelines/stuck-loop.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/pipelines/first-divergence.ts","../../src/pipelines/regression.ts","../../src/pipelines/stuck-loop.ts"],"mappings":";;;;;;;;UAyBiB;;EAEf;EACA;EACA;;EAEA,QAAQ,SAAS;;KAGP;UAEK;EACf;EACA;EACA;;UAGe;;EAEf;;EAEA;EACA,UAAU;;EAEV,aAAa;;KAGH;UAEK;;EAEf;EACA,MAAM;;EAEN;EACA;;EAEA,aAAa;EACb;;UAGe;;EAEf,OAAO;;EAEP;;EAEA;;EAEA;;EAEA,iBAAiB;;iBAGH,UAAU,YAAY,YAAY,YAAY,aAAa;UAwI1D;EACf;EACA;;EAEA;EACA,QAAQ;EACR,QAAQ;EACR;EACA;;EAEA,MAAM;;iBAGc,oBACpB,OAAO,YACP,cACA,eACC,QAAQ;;;;;;;iBAmCK,mBAAmB,gBAAgB,kBAAkB;;;UC7PpD;EACf;EACA;;;EAGA,WAAW,KAAK,KAAK,OAAO,eAAe;;UAG5B,0BAA0B;EACzC,UAAU;EACV,WAAW;;iBAGS,eACpB,OAAO,YACP,SAAS,kBACT,SAAS,oBACR,QAAQ;;;UCFM;EACf;EACA;EACA;;EAEA;EACA;;EAEA;;EAEA;;UAGe;EACf,UAAU;EACV;EACA;;UAGe;;EAEf;;EAEA;;;;;EAKA;;EAEA;;iBAGoB,cACpB,OAAO,YACP,UAAS,mBACR,QAAQ"}
|