@tangle-network/agent-eval 1.0.39 → 2.0.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 +75 -0
- package/dist/adapters/http.d.ts +2 -2
- package/dist/{agent-profile-BKgR30kv.d.ts → agent-profile-BSgtn-k-.d.ts} +247 -168
- package/dist/agent-profile-BSgtn-k-.d.ts.map +1 -0
- package/dist/{agent-profile-DgbRJpSi.js → agent-profile-CCw6EXWW.js} +2 -2
- package/dist/{agent-profile-DgbRJpSi.js.map → agent-profile-CCw6EXWW.js.map} +1 -1
- package/dist/{agent-profile-cell-7Mt0wBkl.js → agent-profile-cell-CUthydZB.js} +2 -2
- package/dist/{agent-profile-cell-7Mt0wBkl.js.map → agent-profile-cell-CUthydZB.js.map} +1 -1
- package/dist/analyst/index.d.ts +13 -13
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +15 -15
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-DqHx3Q_g.js → analyze-runs-C_9cXPZn.js} +9 -9
- package/dist/{analyze-runs-DqHx3Q_g.js.map → analyze-runs-C_9cXPZn.js.map} +1 -1
- package/dist/{analyze-runs-Ctuz-dd3.d.ts → analyze-runs-zEI7yAH_.d.ts} +2 -2
- package/dist/{analyze-runs-Ctuz-dd3.d.ts.map → analyze-runs-zEI7yAH_.d.ts.map} +1 -1
- package/dist/app-grade/index.d.ts +3 -3
- package/dist/app-grade/index.js +3 -3
- package/dist/authenticity/index.d.ts.map +1 -1
- package/dist/authenticity/index.js.map +1 -1
- package/dist/{benchmark-command-BpmrrgzA.js → benchmark-command-XLXa7I98.js} +14 -13
- package/dist/benchmark-command-XLXa7I98.js.map +1 -0
- package/dist/benchmarks/index.d.ts +8 -4
- package/dist/benchmarks/index.d.ts.map +1 -1
- package/dist/benchmarks/index.js +11 -6
- package/dist/benchmarks/index.js.map +1 -1
- package/dist/builder-eval/index.d.ts +1 -1
- package/dist/builder-eval/index.js +3 -3
- package/dist/{calibration-BBhY1QM6.js → calibration-Cfoup0xz.js} +3 -3
- package/dist/{calibration-BBhY1QM6.js.map → calibration-Cfoup0xz.js.map} +1 -1
- package/dist/campaign/index.d.ts +9 -9
- package/dist/campaign/index.js +16 -15
- package/dist/{campaign-UzOUBIwA.js → campaign-BlmkAwFD.js} +23 -23
- package/dist/campaign-BlmkAwFD.js.map +1 -0
- package/dist/{statistical-heldout-RmdXoz2e.d.ts → campaign-evidence-BVKG5o32.d.ts} +418 -418
- package/dist/campaign-evidence-BVKG5o32.d.ts.map +1 -0
- package/dist/{campaign-evidence-BX8OveG5.js → campaign-evidence-CsUE_lwc.js} +79 -26
- package/dist/campaign-evidence-CsUE_lwc.js.map +1 -0
- package/dist/{canonical-gLeHiqzd.d.ts → canonical-CGXS21f_.d.ts} +8 -5
- package/dist/{canonical-gLeHiqzd.d.ts.map → canonical-CGXS21f_.d.ts.map} +1 -1
- package/dist/{canonical-BANK6NOj.js → canonical-DKgL_Wby.js} +30 -8
- package/dist/canonical-DKgL_Wby.js.map +1 -0
- package/dist/{chat-client-DmPB31_2.js → chat-client-DqAXFLi-.js} +2 -2
- package/dist/{chat-client-DmPB31_2.js.map → chat-client-DqAXFLi-.js.map} +1 -1
- package/dist/{chat-json-call-Rfhu7JbJ.js → chat-json-call-CB6sQ6sv.js} +2 -2
- package/dist/{chat-json-call-Rfhu7JbJ.js.map → chat-json-call-CB6sQ6sv.js.map} +1 -1
- package/dist/{claim-C6LRiwz1.js → claim-BWEXwwBk.js} +2 -2
- package/dist/{claim-C6LRiwz1.js.map → claim-BWEXwwBk.js.map} +1 -1
- package/dist/cli.js +11 -11
- package/dist/{client-BIFwUg7I.d.ts → client-DUMIaMob.d.ts} +2 -2
- package/dist/{client-BIFwUg7I.d.ts.map → client-DUMIaMob.d.ts.map} +1 -1
- package/dist/cluster-CSd0LE_M.d.ts.map +1 -1
- package/dist/{cluster-bootstrap-ClPYIWoX.js → cluster-bootstrap-DPzVy3_K.js} +2 -2
- package/dist/{cluster-bootstrap-ClPYIWoX.js.map → cluster-bootstrap-DPzVy3_K.js.map} +1 -1
- package/dist/{completion-verifier-C3q1T96h.js → completion-verifier-DiG3y43g.js} +6 -6
- package/dist/{completion-verifier-C3q1T96h.js.map → completion-verifier-DiG3y43g.js.map} +1 -1
- package/dist/containment-order-GCJ-y_FV.js +56 -0
- package/dist/containment-order-GCJ-y_FV.js.map +1 -0
- package/dist/contract/index.d.ts +11 -11
- package/dist/contract/index.js +16 -16
- package/dist/contract/index.js.map +1 -1
- package/dist/cost-ledger-1CwUnVOd.js.map +1 -1
- package/dist/{decision-point-BN1YQNqk.js → decision-point-gt5JgqZ0.js} +8 -8
- package/dist/{decision-point-BN1YQNqk.js.map → decision-point-gt5JgqZ0.js.map} +1 -1
- package/dist/{default-registry-C5x2jyD6.d.ts → default-registry-DH_tl-V1.d.ts} +7 -7
- package/dist/{default-registry-C5x2jyD6.d.ts.map → default-registry-DH_tl-V1.d.ts.map} +1 -1
- package/dist/{default-registry-DSo3tnsW.js → default-registry-Y9AaKLmG.js} +8 -8
- package/dist/default-registry-Y9AaKLmG.js.map +1 -0
- package/dist/{define-agent-eval-4KGwzIVt.d.ts → define-agent-eval-BDxV_ONM.d.ts} +18 -10
- package/dist/define-agent-eval-BDxV_ONM.d.ts.map +1 -0
- package/dist/{define-agent-eval-C6zFzxp7.js → define-agent-eval-Cq-bdF4O.js} +16 -13
- package/dist/define-agent-eval-Cq-bdF4O.js.map +1 -0
- package/dist/diagnosis/index.d.ts +3 -3
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +1 -1
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{dspy-rlm-engine-EC-Pkdf-.js → dspy-rlm-engine-CHpTzYvZ.js} +4 -3
- package/dist/dspy-rlm-engine-CHpTzYvZ.js.map +1 -0
- package/dist/{emitter-DhQ65mza.js → emitter-BjW3NnX-.js} +15 -6
- package/dist/emitter-BjW3NnX-.js.map +1 -0
- package/dist/{emitter-mAXC5PSN.d.ts → emitter-Cw8ijO3v.d.ts} +4 -4
- package/dist/{emitter-mAXC5PSN.d.ts.map → emitter-Cw8ijO3v.d.ts.map} +1 -1
- package/dist/{engine-B2w3ARpj.d.ts → engine-3y87jnX0.d.ts} +2 -2
- package/dist/{engine-B2w3ARpj.d.ts.map → engine-3y87jnX0.d.ts.map} +1 -1
- package/dist/errors-DeEEV9Vx.js.map +1 -1
- package/dist/{eval-campaign-CWWh-1p1.js → eval-campaign-Cyk-tkLh.js} +5 -5
- package/dist/{eval-campaign-CWWh-1p1.js.map → eval-campaign-Cyk-tkLh.js.map} +1 -1
- package/dist/{evaluation-CQ-uAbqF.d.ts → evaluation-RODuDmCe.d.ts} +4 -4
- package/dist/{evaluation-CQ-uAbqF.d.ts.map → evaluation-RODuDmCe.d.ts.map} +1 -1
- package/dist/evaluation.d.ts +1 -1
- package/dist/{exact-types-B0_jA3V7.d.ts → exact-types-C4Rug7fG.d.ts} +2 -2
- package/dist/{exact-types-B0_jA3V7.d.ts.map → exact-types-C4Rug7fG.d.ts.map} +1 -1
- package/dist/{execution-insight-9No6Si55.d.ts → execution-insight-iOsr1Zi8.d.ts} +2 -2
- package/dist/{execution-insight-9No6Si55.d.ts.map → execution-insight-iOsr1Zi8.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +4 -4
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +10 -10
- package/dist/experiment/index.js.map +1 -1
- package/dist/{exporters-C9AwGDDK.js → exporters-CKFtnWmX.js} +2 -2
- package/dist/{exporters-C9AwGDDK.js.map → exporters-CKFtnWmX.js.map} +1 -1
- package/dist/external-optimizer-contracts-eKQTutGZ.js +123 -0
- package/dist/external-optimizer-contracts-eKQTutGZ.js.map +1 -0
- package/dist/{external-optimizer-process-DFEPdWJY.js → external-optimizer-process-CkAc1xBa.js} +22 -26
- package/dist/external-optimizer-process-CkAc1xBa.js.map +1 -0
- package/dist/{external-optimizer-subprocess-BspZ0bZb.js → external-optimizer-subprocess-B48Ie4qQ.js} +10 -124
- package/dist/external-optimizer-subprocess-B48Ie4qQ.js.map +1 -0
- package/dist/extract-usage-ISFqhfDz.js.map +1 -1
- package/dist/{feedback-trajectory-FamLu3Wt.d.ts → feedback-trajectory-B5hTr9w5.d.ts} +4 -4
- package/dist/{feedback-trajectory-FamLu3Wt.d.ts.map → feedback-trajectory-B5hTr9w5.d.ts.map} +1 -1
- package/dist/{finding-composition-BMgspnVI.js → finding-composition-CyWSTcAY.js} +2 -2
- package/dist/{finding-composition-BMgspnVI.js.map → finding-composition-CyWSTcAY.js.map} +1 -1
- package/dist/{findings-store-71J302Ls.js → findings-store-Rx9ZJgHV.js} +6 -6
- package/dist/{findings-store-71J302Ls.js.map → findings-store-Rx9ZJgHV.js.map} +1 -1
- package/dist/fuzz.d.ts.map +1 -1
- package/dist/fuzz.js +1 -1
- package/dist/fuzz.js.map +1 -1
- package/dist/{harness-session-lines-Fd5aeSDV.js → harness-session-lines-CSxKR6no.js} +3 -3
- package/dist/{harness-session-lines-Fd5aeSDV.js.map → harness-session-lines-CSxKR6no.js.map} +1 -1
- package/dist/{hf-dataset-kthWy7xl.js → hf-dataset-B0s2ZAhQ.js} +4 -4
- package/dist/{hf-dataset-kthWy7xl.js.map → hf-dataset-B0s2ZAhQ.js.map} +1 -1
- package/dist/hosted/index.d.ts +2 -2
- package/dist/hosted/index.js +1 -1
- package/dist/{index-BsTGJf2M.d.ts → index-BJTUL2Ff.d.ts} +42 -30
- package/dist/index-BJTUL2Ff.d.ts.map +1 -0
- package/dist/{index-Bhc7H9e0.d.ts → index-CX8_WfqS.d.ts} +5 -5
- package/dist/{index-Bhc7H9e0.d.ts.map → index-CX8_WfqS.d.ts.map} +1 -1
- package/dist/{index-DtW7KhyE.d.ts → index-D-nKkzsI.d.ts} +3 -3
- package/dist/{index-DtW7KhyE.d.ts.map → index-D-nKkzsI.d.ts.map} +1 -1
- package/dist/{index-RBV2Y-7X.d.ts → index-D1NRaf5U.d.ts} +7 -7
- package/dist/{index-RBV2Y-7X.d.ts.map → index-D1NRaf5U.d.ts.map} +1 -1
- package/dist/{index-Bcy00QoN.d.ts → index-DcGHcBpR.d.ts} +86 -86
- package/dist/index-DcGHcBpR.d.ts.map +1 -0
- package/dist/{index-CzEGCOWM.d.ts → index-FLyheOVA.d.ts} +9 -9
- package/dist/index-FLyheOVA.d.ts.map +1 -0
- package/dist/{index-lRKqfyg4.d.ts → index-qy6buL6y.d.ts} +2 -2
- package/dist/{index-lRKqfyg4.d.ts.map → index-qy6buL6y.d.ts.map} +1 -1
- package/dist/index.d.ts +31 -31
- package/dist/index.js +41 -41
- package/dist/index.js.map +1 -1
- package/dist/{integrity-BSs9dgKW.js → integrity-BF0tJK21.js} +3 -3
- package/dist/{integrity-BSs9dgKW.js.map → integrity-BF0tJK21.js.map} +1 -1
- package/dist/{journal-DQsbHGjX.js → journal-3y-btqaP.js} +2 -2
- package/dist/{journal-DQsbHGjX.js.map → journal-3y-btqaP.js.map} +1 -1
- package/dist/journal-file-AekB57Er.js.map +1 -1
- package/dist/{json-recovery-b7O9WVTF.js → json-recovery-BRUCeQxo.js} +2 -2
- package/dist/{json-recovery-b7O9WVTF.js.map → json-recovery-BRUCeQxo.js.map} +1 -1
- package/dist/{judge-gate-LbmZU-pA.js → judge-gate-TBv2jeO0.js} +3 -3
- package/dist/{judge-gate-LbmZU-pA.js.map → judge-gate-TBv2jeO0.js.map} +1 -1
- package/dist/{kind-factory-BTUq1Byh.js → kind-factory-DfNsTe-q.js} +22 -4
- package/dist/kind-factory-DfNsTe-q.js.map +1 -0
- package/dist/ledger-core/index.d.ts +2 -2
- package/dist/ledger-core/index.js +3 -3
- package/dist/{ledger-core-7e6sXmhV.js → ledger-core-auznoaD7.js} +3 -3
- package/dist/ledger-core-auznoaD7.js.map +1 -0
- package/dist/{llm-client-CdHo3SH0.js → llm-client-gRPgIJyz.js} +2 -2
- package/dist/{llm-client-CdHo3SH0.js.map → llm-client-gRPgIJyz.js.map} +1 -1
- package/dist/{llm-judge-lUQCBY1e.js → llm-judge-CThv1Rog.js} +197 -66
- package/dist/llm-judge-CThv1Rog.js.map +1 -0
- package/dist/{matrix-BKzNwIWb.d.ts → matrix-CfJ5vhfq.d.ts} +2 -2
- package/dist/{matrix-BKzNwIWb.d.ts.map → matrix-CfJ5vhfq.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +1 -1
- package/dist/meta-eval/index.js +9 -9
- package/dist/{mint-VN-qtJTc.js → mint-B4n1pRRd.js} +12 -6
- package/dist/mint-B4n1pRRd.js.map +1 -0
- package/dist/{model-comparison-BZr_Hu00.js → model-comparison-CgnVh4Ph.js} +3 -3
- package/dist/{model-comparison-BZr_Hu00.js.map → model-comparison-CgnVh4Ph.js.map} +1 -1
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/multishot/index.js +1 -1
- package/dist/multishot/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{outcome-observations-YFFmdGGW.js → outcome-observations-DL3CC8w1.js} +2 -2
- package/dist/{outcome-observations-YFFmdGGW.js.map → outcome-observations-DL3CC8w1.js.map} +1 -1
- package/dist/{paired-arms-DH376s4-.js → paired-arms-DZhH3FGu.js} +3 -3
- package/dist/{paired-arms-DH376s4-.js.map → paired-arms-DZhH3FGu.js.map} +1 -1
- package/dist/{paired-promotion-decision-BoWHWL1i.js → paired-promotion-decision-Dn3-jaq4.js} +2 -2
- package/dist/{paired-promotion-decision-BoWHWL1i.js.map → paired-promotion-decision-Dn3-jaq4.js.map} +1 -1
- package/dist/{paired-promotion-decision-BBSxTo-h.d.ts → paired-promotion-decision-Il-Nv-n4.d.ts} +2 -2
- package/dist/{paired-promotion-decision-BBSxTo-h.d.ts.map → paired-promotion-decision-Il-Nv-n4.d.ts.map} +1 -1
- package/dist/{paired-promotion-power-BXH3gzvs.js → paired-promotion-power-BlzXdgMD.js} +3 -3
- package/dist/{paired-promotion-power-BXH3gzvs.js.map → paired-promotion-power-BlzXdgMD.js.map} +1 -1
- package/dist/{pareto-BNWWbLNl.js → pareto-Bg75Gajo.js} +7 -7
- package/dist/{pareto-BNWWbLNl.js.map → pareto-Bg75Gajo.js.map} +1 -1
- package/dist/pipelines/index.d.ts +3 -3
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js +19 -33
- package/dist/pipelines/index.js.map +1 -1
- package/dist/{prime-protocol-BR0xy0cF.d.ts → prime-protocol-CdNaCQy5.d.ts} +2 -2
- package/dist/{prime-protocol-BR0xy0cF.d.ts.map → prime-protocol-CdNaCQy5.d.ts.map} +1 -1
- package/dist/profile-cell.js +1 -1
- package/dist/{promotion-gate-XiTqW22r.d.ts → promotion-gate-DKAvMFlS.d.ts} +2 -2
- package/dist/{promotion-gate-XiTqW22r.d.ts.map → promotion-gate-DKAvMFlS.d.ts.map} +1 -1
- package/dist/{promotion-policy-CfgRPGx0.js → promotion-policy-CxDIh-9p.js} +4 -4
- package/dist/{promotion-policy-CfgRPGx0.js.map → promotion-policy-CxDIh-9p.js.map} +1 -1
- package/dist/{proposal-findings-DFQvA-k5.js → proposal-findings-DnR7zdUc.js} +2 -2
- package/dist/{proposal-findings-DFQvA-k5.js.map → proposal-findings-DnR7zdUc.js.map} +1 -1
- package/dist/{query-Ck6KhcDo.js → query-Dhjkwqyx.js} +2 -2
- package/dist/{query-Ck6KhcDo.js.map → query-Dhjkwqyx.js.map} +1 -1
- package/dist/{registry-D23oO0_f.d.ts → registry-LqAf_laP.d.ts} +3 -3
- package/dist/{registry-D23oO0_f.d.ts.map → registry-LqAf_laP.d.ts.map} +1 -1
- package/dist/{release-confidence-BdidB0mG.js → release-confidence-BLHOMK5Q.js} +3 -3
- package/dist/{release-confidence-BdidB0mG.js.map → release-confidence-BLHOMK5Q.js.map} +1 -1
- package/dist/reporting.d.ts +4 -4
- package/dist/reporting.js +5 -5
- package/dist/{research-report-BGKsOqkF.d.ts → research-report-BauFJiqu.d.ts} +2 -2
- package/dist/{research-report-BGKsOqkF.d.ts.map → research-report-BauFJiqu.d.ts.map} +1 -1
- package/dist/{researcher-k925Q6Jb.d.ts → researcher-B4e2Z92k.d.ts} +3 -3
- package/dist/{researcher-k925Q6Jb.d.ts.map → researcher-B4e2Z92k.d.ts.map} +1 -1
- package/dist/{reward-hacking-DNiHskry.js → reward-hacking-DKAflk2c.js} +2 -2
- package/dist/{reward-hacking-DNiHskry.js.map → reward-hacking-DKAflk2c.js.map} +1 -1
- package/dist/rl.d.ts +155 -39
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +420 -76
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +4 -4
- package/dist/rollout/index.js +6 -6
- package/dist/{rollout-DDMkK_Lw.js → rollout-B6LlGRSq.js} +9 -9
- package/dist/rollout-B6LlGRSq.js.map +1 -0
- package/dist/{rollout-nodes-DzmHlPAC.js → rollout-nodes-Vas6OSxX.js} +2 -2
- package/dist/{rollout-nodes-DzmHlPAC.js.map → rollout-nodes-Vas6OSxX.js.map} +1 -1
- package/dist/{rubric-predictive-validity-Cln7r56F.js → rubric-predictive-validity--6z0q8s6.js} +2 -2
- package/dist/{rubric-predictive-validity-Cln7r56F.js.map → rubric-predictive-validity--6z0q8s6.js.map} +1 -1
- package/dist/{index-OvU1UXKC.d.ts → run-improvement-loop-B1OKCm2D.d.ts} +1682 -1640
- package/dist/run-improvement-loop-B1OKCm2D.d.ts.map +1 -0
- package/dist/{run-record-c860wUR8.js → run-record-Bqg0NZ_e.js} +19 -4
- package/dist/run-record-Bqg0NZ_e.js.map +1 -0
- package/dist/{run-record-Dx64nPcX.js → run-record-CqUft6Yf.js} +2 -2
- package/dist/{run-record-Dx64nPcX.js.map → run-record-CqUft6Yf.js.map} +1 -1
- package/dist/{runtime-rollouts-CALol_Y4.js → runtime-rollouts-DdUijr_t.js} +7 -7
- package/dist/runtime-rollouts-DdUijr_t.js.map +1 -0
- package/dist/{schema-BTTzvMnn.d.ts → schema-BfSoJjD-.d.ts} +5 -1
- package/dist/schema-BfSoJjD-.d.ts.map +1 -0
- package/dist/{schema-b18jtzZw.js → schema-Bh9CfSZT.js} +3 -1
- package/dist/schema-Bh9CfSZT.js.map +1 -0
- package/dist/schema-CkIvnmLU.d.ts.map +1 -1
- package/dist/schema-D-xu3MU_.js.map +1 -1
- package/dist/search/index.d.ts +3 -3
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +3 -3
- package/dist/{search-kernel-DRHWY35J.d.ts → search-kernel-CuTvZlPS.d.ts} +5 -5
- package/dist/{search-kernel-DRHWY35J.d.ts.map → search-kernel-CuTvZlPS.d.ts.map} +1 -1
- package/dist/{search-ledger-oyqxZhry.js → search-ledger-C7t68cmy.js} +7 -7
- package/dist/{search-ledger-oyqxZhry.js.map → search-ledger-C7t68cmy.js.map} +1 -1
- package/dist/{search-ledger-file-DoHCYYLt.js → search-ledger-file-QuIbgz6b.js} +2 -2
- package/dist/search-ledger-file-QuIbgz6b.js.map +1 -0
- package/dist/{search-ledger-types-qiYRUo_N.d.ts → search-ledger-types-BhZE848w.d.ts} +2 -2
- package/dist/{search-ledger-types-qiYRUo_N.d.ts.map → search-ledger-types-BhZE848w.d.ts.map} +1 -1
- package/dist/{search-shipper-BwqeQ61l.js → search-shipper-CmDW9dU6.js} +3 -3
- package/dist/{search-shipper-BwqeQ61l.js.map → search-shipper-CmDW9dU6.js.map} +1 -1
- package/dist/{search-summary-CNHpHFfw.js → search-summary-B1x1Vmzh.js} +5 -5
- package/dist/{search-summary-CNHpHFfw.js.map → search-summary-B1x1Vmzh.js.map} +1 -1
- package/dist/{sequential-93xxuiiG.js → sequential-BphITa5b.js} +4 -4
- package/dist/{sequential-93xxuiiG.js.map → sequential-BphITa5b.js.map} +1 -1
- package/dist/{sequential-B-zx24n_.d.ts → sequential-DqOJZO2V.d.ts} +2 -2
- package/dist/{sequential-B-zx24n_.d.ts.map → sequential-DqOJZO2V.d.ts.map} +1 -1
- package/dist/{sequential-C6k0Wrb7.js → sequential-ux_XrjBf.js} +3 -3
- package/dist/{sequential-C6k0Wrb7.js.map → sequential-ux_XrjBf.js.map} +1 -1
- package/dist/{served-model-qhLmbutL.js → served-model-BXmeKm7D.js} +2 -2
- package/dist/{served-model-qhLmbutL.js.map → served-model-BXmeKm7D.js.map} +1 -1
- package/dist/{server-DnoEi4Sb.js → server-BxHJyclG.js} +4 -4
- package/dist/{server-DnoEi4Sb.js.map → server-BxHJyclG.js.map} +1 -1
- package/dist/{skillopt-optimization-method-Dch9LiNR.js → skillopt-optimization-method-CHW9mphc.js} +397 -70
- package/dist/skillopt-optimization-method-CHW9mphc.js.map +1 -0
- package/dist/{statistical-heldout-BvcAVtof.js → statistical-heldout-CaS4T-43.js} +3 -3
- package/dist/{statistical-heldout-BvcAVtof.js.map → statistical-heldout-CaS4T-43.js.map} +1 -1
- package/dist/{statistics-CHs0jlsY.js → statistics-DSidA5I2.js} +184 -184
- package/dist/statistics-DSidA5I2.js.map +1 -0
- package/dist/statistics.d.ts +1 -1
- package/dist/statistics.js +1 -1
- package/dist/{store-otlp-DQK9hCtH.js → store-otlp-DCQTz9lS.js} +2 -2
- package/dist/{store-otlp-DQK9hCtH.js.map → store-otlp-DCQTz9lS.js.map} +1 -1
- package/dist/{store-tool-spans-C1lZKvvl.d.ts → store-tool-spans-B0UYrcl7.d.ts} +5 -5
- package/dist/{store-tool-spans-C1lZKvvl.d.ts.map → store-tool-spans-B0UYrcl7.d.ts.map} +1 -1
- package/dist/{store-tool-spans-BRR9hsPP.js → store-tool-spans-D2-S3OdE.js} +4 -4
- package/dist/{store-tool-spans-BRR9hsPP.js.map → store-tool-spans-D2-S3OdE.js.map} +1 -1
- package/dist/storyboard/index.d.ts.map +1 -1
- package/dist/storyboard/index.js.map +1 -1
- package/dist/{summary-report-CXiE1UrA.js → summary-report-CI4J6gxU.js} +4 -4
- package/dist/{summary-report-CXiE1UrA.js.map → summary-report-CI4J6gxU.js.map} +1 -1
- 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 +3 -3
- package/dist/{systemone-B_3Vd395.d.ts → systemone-nAN8fBy9.d.ts} +8 -8
- package/dist/{systemone-B_3Vd395.d.ts.map → systemone-nAN8fBy9.d.ts.map} +1 -1
- package/dist/systemone-protocol.js +1 -1
- package/dist/{systemone-review-ZAN-5m_2.d.ts → systemone-review-e2ElIpD_.d.ts} +3 -3
- package/dist/{systemone-review-ZAN-5m_2.d.ts.map → systemone-review-e2ElIpD_.d.ts.map} +1 -1
- package/dist/{systemone-review-CqNNZMiD.js → systemone-review-ir3Cbejl.js} +3 -3
- package/dist/{systemone-review-CqNNZMiD.js.map → systemone-review-ir3Cbejl.js.map} +1 -1
- package/dist/systemone.d.ts +3 -3
- package/dist/systemone.js +2 -2
- package/dist/{tool-groups-BOH1E-E4.d.ts → tool-groups-sRVCeevR.d.ts} +3 -3
- package/dist/tool-groups-sRVCeevR.d.ts.map +1 -0
- package/dist/tool-waste-CIhtU1ad.d.ts +217 -0
- package/dist/tool-waste-CIhtU1ad.d.ts.map +1 -0
- package/dist/{tool-waste-DzLI-JJg.js → tool-waste-u7JJ_BlE.js} +3 -3
- package/dist/{tool-waste-DzLI-JJg.js.map → tool-waste-u7JJ_BlE.js.map} +1 -1
- package/dist/{trace-questions-DBsrgY_H.d.ts → trace-questions-BN-LSfkA.d.ts} +3 -3
- package/dist/{trace-questions-DBsrgY_H.d.ts.map → trace-questions-BN-LSfkA.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +1 -1
- package/dist/trace-repair/index.d.ts.map +1 -1
- package/dist/trace-repair/index.js +4 -4
- package/dist/trace-repair/index.js.map +1 -1
- package/dist/traces.d.ts +4 -4
- package/dist/traces.js +6 -6
- package/dist/{training-admission-xaDOlQ_U.d.ts → training-admission-DGZCyntI.d.ts} +2 -2
- package/dist/{training-admission-xaDOlQ_U.d.ts.map → training-admission-DGZCyntI.d.ts.map} +1 -1
- package/dist/trajectory-CKVZaQoQ.js +144 -0
- package/dist/trajectory-CKVZaQoQ.js.map +1 -0
- package/dist/trajectory-replay/index.d.ts.map +1 -1
- package/dist/trajectory-replay/index.js +24 -11
- package/dist/trajectory-replay/index.js.map +1 -1
- package/dist/{tree-0r6gPODs.js → tree-DQMlcNFI.js} +18 -6
- package/dist/tree-DQMlcNFI.js.map +1 -0
- package/dist/{types-DmYd2Igl.d.ts → types-BJ27EWAS.d.ts} +8 -8
- package/dist/{types-DmYd2Igl.d.ts.map → types-BJ27EWAS.d.ts.map} +1 -1
- package/dist/{types-ClDpBoLt.d.ts → types-CDWfUYOq.d.ts} +2 -2
- package/dist/{types-ClDpBoLt.d.ts.map → types-CDWfUYOq.d.ts.map} +1 -1
- package/dist/{types-_dfu6Ox2.d.ts → types-DI7YKvDI.d.ts} +3 -3
- package/dist/{types-_dfu6Ox2.d.ts.map → types-DI7YKvDI.d.ts.map} +1 -1
- package/dist/{types-C8AyaiFi.js → types-_tlhWGUq.js} +2 -2
- package/dist/{types-C8AyaiFi.js.map → types-_tlhWGUq.js.map} +1 -1
- package/dist/{types-DGqGbNY4.d.ts → types-pMk2rgP9.d.ts} +20 -6
- package/dist/{types-DGqGbNY4.d.ts.map → types-pMk2rgP9.d.ts.map} +1 -1
- package/dist/{verdict-CKo1iZkI.js → verdict-5PVtsWT_.js} +2 -2
- package/dist/{verdict-CKo1iZkI.js.map → verdict-5PVtsWT_.js.map} +1 -1
- package/dist/{verdict-cache-DfzlHLdf.js → verdict-cache-BPaYxfG8.js} +2 -2
- package/dist/verdict-cache-BPaYxfG8.js.map +1 -0
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/campaign-proposers.md +14 -1
- package/docs/public-api.md +323 -85
- package/docs/rollout.md +2 -2
- package/docs/search-ledger.md +14 -2
- package/docs/statistical-evidence.md +9 -3
- package/docs/trajectory-replay.md +4 -0
- package/package.json +1 -1
- package/dist/agent-profile-BKgR30kv.d.ts.map +0 -1
- package/dist/benchmark-command-BpmrrgzA.js.map +0 -1
- package/dist/campaign-UzOUBIwA.js.map +0 -1
- package/dist/campaign-evidence-BX8OveG5.js.map +0 -1
- package/dist/canonical-BANK6NOj.js.map +0 -1
- package/dist/default-registry-DSo3tnsW.js.map +0 -1
- package/dist/define-agent-eval-4KGwzIVt.d.ts.map +0 -1
- package/dist/define-agent-eval-C6zFzxp7.js.map +0 -1
- package/dist/dspy-rlm-engine-EC-Pkdf-.js.map +0 -1
- package/dist/emitter-DhQ65mza.js.map +0 -1
- package/dist/external-optimizer-process-DFEPdWJY.js.map +0 -1
- package/dist/external-optimizer-subprocess-BspZ0bZb.js.map +0 -1
- package/dist/index-Bcy00QoN.d.ts.map +0 -1
- package/dist/index-BsTGJf2M.d.ts.map +0 -1
- package/dist/index-CzEGCOWM.d.ts.map +0 -1
- package/dist/index-OvU1UXKC.d.ts.map +0 -1
- package/dist/kind-factory-BTUq1Byh.js.map +0 -1
- package/dist/ledger-core-7e6sXmhV.js.map +0 -1
- package/dist/llm-judge-lUQCBY1e.js.map +0 -1
- package/dist/mint-VN-qtJTc.js.map +0 -1
- package/dist/rollout-DDMkK_Lw.js.map +0 -1
- package/dist/run-record-c860wUR8.js.map +0 -1
- package/dist/runtime-rollouts-CALol_Y4.js.map +0 -1
- package/dist/schema-BTTzvMnn.d.ts.map +0 -1
- package/dist/schema-b18jtzZw.js.map +0 -1
- package/dist/search-ledger-file-DoHCYYLt.js.map +0 -1
- package/dist/skillopt-optimization-method-Dch9LiNR.js.map +0 -1
- package/dist/statistical-heldout-RmdXoz2e.d.ts.map +0 -1
- package/dist/statistics-CHs0jlsY.js.map +0 -1
- package/dist/tool-groups-BOH1E-E4.d.ts.map +0 -1
- package/dist/tool-waste-CUASoTtk.d.ts +0 -139
- package/dist/tool-waste-CUASoTtk.d.ts.map +0 -1
- package/dist/trajectory-O3GDHmev.js +0 -55
- package/dist/trajectory-O3GDHmev.js.map +0 -1
- package/dist/tree-0r6gPODs.js.map +0 -1
- package/dist/verdict-cache-DfzlHLdf.js.map +0 -1
package/dist/rl.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { s as ValidationError } from "./errors-DeEEV9Vx.js";
|
|
2
|
-
import { a as hashCanonical, i as compareCodeUnits, o as jsonDocument } from "./canonical-
|
|
3
|
-
import { s as runTaskScore } from "./run-record-
|
|
4
|
-
import { _t as medianInPlace,
|
|
5
|
-
import { t as decidePairedPromotion } from "./paired-promotion-decision-
|
|
6
|
-
import { n as campaignCellToRunRecord } from "./run-record-
|
|
7
|
-
import { n as extractVerifiableReward, r as extractVerifiableRewardsFromRecords, t as detectRewardHacking } from "./reward-hacking-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
2
|
+
import { a as hashCanonical, i as compareCodeUnits, n as LedgerCanonicalizationError, o as jsonDocument } from "./canonical-DKgL_Wby.js";
|
|
3
|
+
import { s as runTaskScore } from "./run-record-CqUft6Yf.js";
|
|
4
|
+
import { _t as medianInPlace, a as wilcoxonSignedRank, p as pairedBootstrap } from "./statistics-DSidA5I2.js";
|
|
5
|
+
import { t as decidePairedPromotion } from "./paired-promotion-decision-Dn3-jaq4.js";
|
|
6
|
+
import { n as campaignCellToRunRecord } from "./run-record-Bqg0NZ_e.js";
|
|
7
|
+
import { n as extractVerifiableReward, r as extractVerifiableRewardsFromRecords, t as detectRewardHacking } from "./reward-hacking-DKAflk2c.js";
|
|
8
|
+
import { n as defaultScenarioId } from "./emitter-BjW3NnX-.js";
|
|
9
|
+
import { t as runEvalCampaign } from "./eval-campaign-Cyk-tkLh.js";
|
|
10
|
+
import { s as assertRewardGate } from "./schema-Bh9CfSZT.js";
|
|
11
|
+
import { a as toSftRows, s as trainingAdmission, t as isTrainingLineEligible } from "./exporters-CKFtnWmX.js";
|
|
12
|
+
import { t as mintRolloutRows } from "./mint-B4n1pRRd.js";
|
|
13
|
+
import { t as evaluateInterimReleaseConfidence } from "./sequential-ux_XrjBf.js";
|
|
14
|
+
import { o as validateOutcomeMetricSpecifications, t as assertUniqueObservationIds } from "./outcome-observations-DL3CC8w1.js";
|
|
15
|
+
import { n as prepareSystemOneReview } from "./systemone-review-ir3Cbejl.js";
|
|
16
|
+
import { t as rubricPredictiveValidity } from "./rubric-predictive-validity--6z0q8s6.js";
|
|
16
17
|
import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "./outcome-store-TarrcfHG.js";
|
|
17
18
|
import { createHash } from "node:crypto";
|
|
18
19
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1330,12 +1331,21 @@ function toSftJsonl(rows) {
|
|
|
1330
1331
|
* Convert PRM training triples to JSONL rows. Caller's `stepTextOf`
|
|
1331
1332
|
* callback resolves span text from the consumer's trace store.
|
|
1332
1333
|
*
|
|
1333
|
-
*
|
|
1334
|
-
*
|
|
1335
|
-
*
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1334
|
+
* A triple is two different actions taken in the same context, compared on
|
|
1335
|
+
* their mean rewards — the rule `prmTrainingPairs` enforces — and its
|
|
1336
|
+
* `contextDigest` names that context. A triple with no context digest, or that
|
|
1337
|
+
* does not name the runs behind its means, is refused before anything else,
|
|
1338
|
+
* because no row may be built from steps that are not known to share a context
|
|
1339
|
+
* or from a mean whose runs cannot be checked. The digest, the step counts and
|
|
1340
|
+
* the run ids behind each mean are carried on `meta`.
|
|
1341
|
+
*
|
|
1342
|
+
* Every referenced run — both representatives and every run behind either mean
|
|
1343
|
+
* — is checked against its minted line before any row is emitted, and the
|
|
1344
|
+
* export FAILS LOUD on a trajectory that was never fully captured (see
|
|
1345
|
+
* `assertPrmTrainableLine`). A triple any of whose runs is realness-gated is
|
|
1346
|
+
* dropped instead, so a gamed run cannot move a mean: a capture defect is the
|
|
1347
|
+
* caller's mint configuration and must be fixed, whereas a gamed run is exactly
|
|
1348
|
+
* the condition the gate exists to filter.
|
|
1339
1349
|
*
|
|
1340
1350
|
* `context` is REQUIRED. A two-argument call used to be accepted and produced
|
|
1341
1351
|
* rows with no gate applied at all — a `PrmTrainingTriple` carries a bare
|
|
@@ -1346,6 +1356,10 @@ function toSftJsonl(rows) {
|
|
|
1346
1356
|
* the exact step the gaming happened.
|
|
1347
1357
|
*/
|
|
1348
1358
|
async function toPrmRows(triples, lookups, context) {
|
|
1359
|
+
for (const t of triples) {
|
|
1360
|
+
if (!t.contextDigest) throw new Error(`PRM export: triple ${t.chosenSpanId}/${t.rejectedSpanId} has no context digest; its steps are not known to share a context`);
|
|
1361
|
+
if (!Array.isArray(t.chosenRunIds) || !Array.isArray(t.rejectedRunIds)) throw new Error(`PRM export: triple ${t.chosenSpanId}/${t.rejectedSpanId} names no runs behind its mean rewards; their realness gates cannot be read`);
|
|
1362
|
+
}
|
|
1349
1363
|
const admitted = admitPrmTriples(triples, context);
|
|
1350
1364
|
const rows = [];
|
|
1351
1365
|
for (const t of admitted) {
|
|
@@ -1365,9 +1379,14 @@ async function toPrmRows(triples, lookups, context) {
|
|
|
1365
1379
|
rejectedReward: t.rejectedReward,
|
|
1366
1380
|
marginScore: t.marginScore,
|
|
1367
1381
|
meta: {
|
|
1382
|
+
contextDigest: t.contextDigest,
|
|
1368
1383
|
prefixRunId: t.prefixRunId,
|
|
1369
1384
|
rejectedRunId: t.rejectedRunId,
|
|
1370
|
-
prefixStepIndex: t.prefixStepIndex
|
|
1385
|
+
prefixStepIndex: t.prefixStepIndex,
|
|
1386
|
+
chosenStepCount: t.chosenStepCount,
|
|
1387
|
+
rejectedStepCount: t.rejectedStepCount,
|
|
1388
|
+
chosenRunIds: t.chosenRunIds,
|
|
1389
|
+
rejectedRunIds: t.rejectedRunIds
|
|
1371
1390
|
}
|
|
1372
1391
|
});
|
|
1373
1392
|
}
|
|
@@ -1401,7 +1420,12 @@ const PRM_CONTEXT_REQUIREMENT = {
|
|
|
1401
1420
|
* `stepRewardsToJsonl`; only the trajectory-completeness rules are PRM's own.
|
|
1402
1421
|
*/
|
|
1403
1422
|
function admitPrmTriples(triples, context) {
|
|
1404
|
-
return admitUngatedByInvocation(triples, (t) => [
|
|
1423
|
+
return admitUngatedByInvocation(triples, (t) => [.../* @__PURE__ */ new Set([
|
|
1424
|
+
t.prefixRunId,
|
|
1425
|
+
t.rejectedRunId,
|
|
1426
|
+
...t.chosenRunIds,
|
|
1427
|
+
...t.rejectedRunIds
|
|
1428
|
+
])], context, PRM_CONTEXT_REQUIREMENT, (line) => assertPrmTrainableLine(line, context.mintedWithMaxSteps));
|
|
1405
1429
|
}
|
|
1406
1430
|
// src/rl/dataset.ts
|
|
1407
1431
|
/**
|
|
@@ -2309,65 +2333,385 @@ function makePair(a, b, scenarioId, minMargin) {
|
|
|
2309
2333
|
}
|
|
2310
2334
|
// src/rl/process-reward.ts
|
|
2311
2335
|
/**
|
|
2312
|
-
*
|
|
2313
|
-
*
|
|
2314
|
-
*
|
|
2315
|
-
*
|
|
2316
|
-
*
|
|
2317
|
-
*
|
|
2318
|
-
*
|
|
2319
|
-
*
|
|
2320
|
-
*
|
|
2321
|
-
*
|
|
2322
|
-
*
|
|
2323
|
-
*
|
|
2324
|
-
*
|
|
2336
|
+
* Process reward extraction — step-level credit assignment from trace spans.
|
|
2337
|
+
*
|
|
2338
|
+
* RL on long-horizon agents needs *step-level* rewards, not run-level
|
|
2339
|
+
* ones. The classic credit-assignment problem (Sutton & Barto) requires
|
|
2340
|
+
* knowing which sub-decisions in a trajectory contributed to the
|
|
2341
|
+
* outcome. Modern systems (DeepSeek-R1, OpenAI o-series, Lightman et al.
|
|
2342
|
+
* "Let's Verify Step by Step" 2023) train *process reward models* (PRMs)
|
|
2343
|
+
* that score every step, then do RL with the PRM as the reward signal.
|
|
2344
|
+
*
|
|
2345
|
+
* This module extracts `StepReward[]` from trace spans — one per
|
|
2346
|
+
* meaningful step — and ships:
|
|
2347
|
+
*
|
|
2348
|
+
* 1. `extractStepRewards(store, runId, opts)` — span → step-reward
|
|
2349
|
+
* conversion using configurable per-span scorers (LLM judge over the
|
|
2350
|
+
* span output, deterministic checkers, or a learned PRM). Each step
|
|
2351
|
+
* carries a digest of the context it acted in and of the action it took.
|
|
2352
|
+
* 2. `runwiseStepRewardSummary(stepRewards)` — aggregate the per-step
|
|
2353
|
+
* signal into a credit-assignment-aware run-level score.
|
|
2354
|
+
* 3. `prmTrainingPairs(stepRewardsByRun, options)` — produce the
|
|
2355
|
+
* `(prefix, chosen_step, rejected_step)` triples that PRM training
|
|
2356
|
+
* pipelines consume: two different actions taken in the same context,
|
|
2357
|
+
* compared on their mean reward across the runs that took them.
|
|
2358
|
+
*
|
|
2359
|
+
* What we ship: the *extraction* and *aggregation* infrastructure plus
|
|
2360
|
+
* the data shape PRM training expects. We do NOT ship the actual PRM
|
|
2361
|
+
* training (gradient descent over a transformer is out of scope for a
|
|
2362
|
+
* TS package). The interface is the contract; downstream consumers wire
|
|
2363
|
+
* their preferred trainer.
|
|
2364
|
+
*
|
|
2365
|
+
* A step's context is what had been recorded by the time it started: the
|
|
2366
|
+
* start of every earlier span and the end of every span that had already
|
|
2367
|
+
* ended. That is a timing boundary. It does not prove the policy read an
|
|
2368
|
+
* earlier span's output, only that the output existed before the step began.
|
|
2369
|
+
*
|
|
2370
|
+
* Caveat: a pair says that, from one recorded context, one action was
|
|
2371
|
+
* followed by a higher mean step reward than another. The reward is still the
|
|
2372
|
+
* scorer's; whether the action caused it needs counterfactual rollouts or a
|
|
2373
|
+
* learned dynamics model.
|
|
2325
2374
|
*/
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2375
|
+
/**
|
|
2376
|
+
* Score a recorded run's spans and attach to each step the digest of its
|
|
2377
|
+
* context and of its action.
|
|
2378
|
+
*
|
|
2379
|
+
* The context is built from a time-ordered chain of events: each span adds its
|
|
2380
|
+
* start content at `startedAt` and its end content (`END_FIELDS`) at
|
|
2381
|
+
* `endedAt`. A step's context digest is the chain just before its own start,
|
|
2382
|
+
* plus its own input. This is a timing boundary: it says what had been
|
|
2383
|
+
* recorded when the step began, not that the policy read it.
|
|
2384
|
+
*/
|
|
2385
|
+
async function extractStepRewards(store, runId, opts) {
|
|
2386
|
+
const run = await store.getRun(runId);
|
|
2387
|
+
const ordered = [...await store.spans({ runId })].sort((a, b) => a.startedAt - b.startedAt);
|
|
2388
|
+
const positionOf = new Map(ordered.map((span, position) => [span.spanId, position]));
|
|
2389
|
+
const attributeKeys = opts.contextAttributes === void 0 ? void 0 : new Set(opts.contextAttributes);
|
|
2390
|
+
const task = run?.scenarioId && run.scenarioId !== defaultScenarioId(run) ? run.scenarioId : void 0;
|
|
2391
|
+
let chain = task === void 0 ? void 0 : digestOf({ scenarioId: task });
|
|
2392
|
+
const fold = (event, recorded) => {
|
|
2393
|
+
chain = chain === void 0 || !recorded ? void 0 : digestOf({
|
|
2394
|
+
prefix: chain,
|
|
2395
|
+
event
|
|
2396
|
+
});
|
|
2397
|
+
};
|
|
2398
|
+
let running = [];
|
|
2399
|
+
const out = [];
|
|
2400
|
+
for (const [position, span] of ordered.entries()) {
|
|
2401
|
+
const ended = running.filter((p) => endedBy(ordered[p], span.startedAt)).sort((a, b) => ordered[a].endedAt - ordered[b].endedAt || a - b);
|
|
2402
|
+
for (const p of ended) {
|
|
2403
|
+
const earlier = ordered[p];
|
|
2404
|
+
fold({
|
|
2405
|
+
end: p,
|
|
2406
|
+
content: endContent(earlier)
|
|
2407
|
+
}, endRecorded(earlier));
|
|
2408
|
+
}
|
|
2409
|
+
running = running.filter((p) => !ended.includes(p));
|
|
2410
|
+
const start = startContent(span, positionOf, attributeKeys);
|
|
2411
|
+
const input = span.kind === "llm" ? start.messages ?? UNRECORDED : void 0;
|
|
2412
|
+
const action = actionOf(span);
|
|
2413
|
+
const contextBefore = chain;
|
|
2414
|
+
fold({
|
|
2415
|
+
start: position,
|
|
2416
|
+
content: start
|
|
2417
|
+
}, input !== UNRECORDED && action !== UNRECORDED);
|
|
2418
|
+
running.push(position);
|
|
2419
|
+
if (opts.preFilter && !opts.preFilter(span)) continue;
|
|
2420
|
+
let scored = null;
|
|
2421
|
+
for (const s of opts.scorers) {
|
|
2422
|
+
if (!s.appliesTo.includes(span.kind)) continue;
|
|
2423
|
+
const r = await s.score(span);
|
|
2424
|
+
if (r) {
|
|
2425
|
+
scored = r;
|
|
2347
2426
|
break;
|
|
2348
2427
|
}
|
|
2349
2428
|
}
|
|
2350
|
-
if (
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2429
|
+
if (!scored) continue;
|
|
2430
|
+
const contextDigest = scored.contextDigest ?? (contextBefore === void 0 || input === UNRECORDED ? void 0 : digestOf({
|
|
2431
|
+
prefix: contextBefore,
|
|
2432
|
+
input
|
|
2433
|
+
}));
|
|
2434
|
+
const actionDigest = scored.actionDigest ?? (action === void 0 || action === UNRECORDED ? void 0 : digestOf({
|
|
2435
|
+
kind: span.kind,
|
|
2436
|
+
name: span.name,
|
|
2437
|
+
action
|
|
2438
|
+
}));
|
|
2439
|
+
out.push({
|
|
2440
|
+
spanId: span.spanId,
|
|
2441
|
+
runId,
|
|
2442
|
+
stepIndex: position,
|
|
2443
|
+
kind: span.kind,
|
|
2444
|
+
name: span.name,
|
|
2445
|
+
reward: scored.reward,
|
|
2446
|
+
determinism: scored.determinism,
|
|
2447
|
+
rationale: scored.rationale,
|
|
2448
|
+
weight: scored.weight,
|
|
2449
|
+
...contextDigest === void 0 ? {} : { contextDigest },
|
|
2450
|
+
...actionDigest === void 0 ? {} : { actionDigest }
|
|
2368
2451
|
});
|
|
2369
2452
|
}
|
|
2370
|
-
return
|
|
2453
|
+
return out;
|
|
2454
|
+
}
|
|
2455
|
+
/** A part the span's kind carries and the trace does not. */
|
|
2456
|
+
const UNRECORDED = Symbol("unrecorded");
|
|
2457
|
+
/**
|
|
2458
|
+
* Fields left out of a span's content: identifiers, timestamps, and token and
|
|
2459
|
+
* cost accounting differ between runs that saw and did the same thing, and the
|
|
2460
|
+
* model is the policy, not the context.
|
|
2461
|
+
*/
|
|
2462
|
+
const NOT_CONTENT = /* @__PURE__ */ new Set([
|
|
2463
|
+
"spanId",
|
|
2464
|
+
"parentSpanId",
|
|
2465
|
+
"runId",
|
|
2466
|
+
"startedAt",
|
|
2467
|
+
"endedAt",
|
|
2468
|
+
"latencyMs",
|
|
2469
|
+
"wallMs",
|
|
2470
|
+
"model",
|
|
2471
|
+
"inputTokens",
|
|
2472
|
+
"outputTokens",
|
|
2473
|
+
"cachedTokens",
|
|
2474
|
+
"cacheWriteTokens",
|
|
2475
|
+
"reasoningTokens",
|
|
2476
|
+
"costUsd",
|
|
2477
|
+
"tokens"
|
|
2478
|
+
]);
|
|
2479
|
+
/**
|
|
2480
|
+
* Fields that exist only once a span has ended, so they are observable only
|
|
2481
|
+
* after `endedAt`. Every other content field, including `attributes` and any
|
|
2482
|
+
* field the schema gains later, counts as known from `startedAt` — the strict
|
|
2483
|
+
* reading, since a field read too early can only make contexts differ.
|
|
2484
|
+
*/
|
|
2485
|
+
const END_FIELDS = /* @__PURE__ */ new Set([
|
|
2486
|
+
"output",
|
|
2487
|
+
"finishReason",
|
|
2488
|
+
"result",
|
|
2489
|
+
"hits",
|
|
2490
|
+
"score",
|
|
2491
|
+
"rationale",
|
|
2492
|
+
"evidence",
|
|
2493
|
+
"exitCode",
|
|
2494
|
+
"testsTotal",
|
|
2495
|
+
"testsPassed",
|
|
2496
|
+
"stdoutHash",
|
|
2497
|
+
"stderrHash",
|
|
2498
|
+
"status",
|
|
2499
|
+
"error"
|
|
2500
|
+
]);
|
|
2501
|
+
function contentOf(value, keep) {
|
|
2502
|
+
return Object.fromEntries(Object.entries(value).filter(([key]) => !NOT_CONTENT.has(key) && keep(key)));
|
|
2503
|
+
}
|
|
2504
|
+
/**
|
|
2505
|
+
* What a span carried when it started. An llm span's messages are missing when
|
|
2506
|
+
* none were captured; a judge's target is named by its position in the run, so
|
|
2507
|
+
* the same target reads the same in two runs.
|
|
2508
|
+
*/
|
|
2509
|
+
function startContent(span, positionOf, attributeKeys) {
|
|
2510
|
+
const content = contentOf(span, (key) => !END_FIELDS.has(key));
|
|
2511
|
+
if (span.kind === "llm") content.messages = Array.isArray(span.messages) && span.messages.length > 0 ? span.messages.map((message) => contentOf(message, () => true)) : void 0;
|
|
2512
|
+
if (span.kind === "judge") content.targetSpanId = positionOf.get(span.targetSpanId) ?? span.targetSpanId;
|
|
2513
|
+
if (attributeKeys !== void 0 && span.attributes !== void 0) {
|
|
2514
|
+
const kept = Object.entries(span.attributes).filter(([key]) => attributeKeys.has(key));
|
|
2515
|
+
content.attributes = kept.length > 0 ? Object.fromEntries(kept) : void 0;
|
|
2516
|
+
}
|
|
2517
|
+
return content;
|
|
2518
|
+
}
|
|
2519
|
+
/** What a span carried once it ended. */
|
|
2520
|
+
function endContent(span) {
|
|
2521
|
+
return contentOf(span, (key) => END_FIELDS.has(key));
|
|
2522
|
+
}
|
|
2523
|
+
/** Whether the span had ended by `time`. A span that never ended never has. */
|
|
2524
|
+
function endedBy(span, time) {
|
|
2525
|
+
return span.endedAt !== void 0 && span.endedAt <= time;
|
|
2526
|
+
}
|
|
2527
|
+
/**
|
|
2528
|
+
* Whether an ended span recorded what it produced: an llm span its output or
|
|
2529
|
+
* error, a tool call its result or error, a retrieval its hits.
|
|
2530
|
+
*/
|
|
2531
|
+
function endRecorded(span) {
|
|
2532
|
+
switch (span.kind) {
|
|
2533
|
+
case "llm": return typeof span.output === "string" || span.error !== void 0;
|
|
2534
|
+
case "tool": return span.result !== void 0 || span.error !== void 0;
|
|
2535
|
+
case "retrieval": return Array.isArray(span.hits) || span.error !== void 0;
|
|
2536
|
+
default: return true;
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
/**
|
|
2540
|
+
* The decision a step made: an llm span's `output`, a tool call's name and
|
|
2541
|
+
* arguments, a retrieval's query. Judge, sandbox, agent and custom spans make
|
|
2542
|
+
* no policy decision — a judge grades, the harness runs the sandbox, a
|
|
2543
|
+
* container only groups — so they shape later contexts and are never paired.
|
|
2544
|
+
* A tool call's arguments and a retrieval's query are known at its start, so an
|
|
2545
|
+
* uncaptured one leaves the context unknown from that start on.
|
|
2546
|
+
*/
|
|
2547
|
+
function actionOf(span) {
|
|
2548
|
+
switch (span.kind) {
|
|
2549
|
+
case "llm": return typeof span.output === "string" ? span.output : void 0;
|
|
2550
|
+
case "tool": return span.argsCaptured === false || span.args === void 0 ? UNRECORDED : {
|
|
2551
|
+
toolName: span.toolName,
|
|
2552
|
+
args: span.args
|
|
2553
|
+
};
|
|
2554
|
+
case "retrieval": return typeof span.query === "string" ? { query: span.query } : UNRECORDED;
|
|
2555
|
+
default: return;
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* The canonical digest of `value` in its JSON document form, where an
|
|
2560
|
+
* undefined field is absent. Content with no canonical form (NaN, a class
|
|
2561
|
+
* instance, a reference cycle) has no digest, the same as content that was
|
|
2562
|
+
* never recorded.
|
|
2563
|
+
*/
|
|
2564
|
+
function digestOf(value) {
|
|
2565
|
+
try {
|
|
2566
|
+
return hashCanonical(jsonDocument(value));
|
|
2567
|
+
} catch (error) {
|
|
2568
|
+
if (error instanceof LedgerCanonicalizationError) return void 0;
|
|
2569
|
+
throw error;
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
/** Summarize one run's step rewards, given in step order. */
|
|
2573
|
+
function runwiseStepRewardSummary(stepRewards) {
|
|
2574
|
+
if (stepRewards.length === 0) return {
|
|
2575
|
+
runId: "",
|
|
2576
|
+
totalSteps: 0,
|
|
2577
|
+
meanReward: 0,
|
|
2578
|
+
sumWeightedReward: 0,
|
|
2579
|
+
failureFraction: 0,
|
|
2580
|
+
worstStepDelta: 0,
|
|
2581
|
+
worstStepIndex: null
|
|
2582
|
+
};
|
|
2583
|
+
const runId = stepRewards[0].runId;
|
|
2584
|
+
let sumW = 0;
|
|
2585
|
+
let sumWR = 0;
|
|
2586
|
+
let failures = 0;
|
|
2587
|
+
let worstDelta = 0;
|
|
2588
|
+
let worstIdx = null;
|
|
2589
|
+
let prev = stepRewards[0].reward;
|
|
2590
|
+
for (let i = 0; i < stepRewards.length; i++) {
|
|
2591
|
+
const s = stepRewards[i];
|
|
2592
|
+
const w = s.weight ?? 1;
|
|
2593
|
+
sumW += w;
|
|
2594
|
+
sumWR += w * s.reward;
|
|
2595
|
+
if (s.reward < .5) failures++;
|
|
2596
|
+
if (i > 0) {
|
|
2597
|
+
const delta = s.reward - prev;
|
|
2598
|
+
if (delta < worstDelta) {
|
|
2599
|
+
worstDelta = delta;
|
|
2600
|
+
worstIdx = i;
|
|
2601
|
+
}
|
|
2602
|
+
prev = s.reward;
|
|
2603
|
+
} else prev = s.reward;
|
|
2604
|
+
}
|
|
2605
|
+
return {
|
|
2606
|
+
runId,
|
|
2607
|
+
totalSteps: stepRewards.length,
|
|
2608
|
+
meanReward: sumW === 0 ? 0 : sumWR / sumW,
|
|
2609
|
+
sumWeightedReward: sumWR,
|
|
2610
|
+
failureFraction: failures / stepRewards.length,
|
|
2611
|
+
worstStepDelta: worstDelta,
|
|
2612
|
+
worstStepIndex: worstIdx
|
|
2613
|
+
};
|
|
2614
|
+
}
|
|
2615
|
+
/**
|
|
2616
|
+
* Build PRM training triples — the `(prefix, chosen_step, rejected_step)`
|
|
2617
|
+
* shape of Lightman et al. and DeepSeek-R1 process supervision.
|
|
2618
|
+
*
|
|
2619
|
+
* Steps are grouped by `contextDigest` across all runs, and within a context by
|
|
2620
|
+
* `actionDigest`. Each action's reward is its mean over every step that took
|
|
2621
|
+
* it there, so the same action scored twice is one estimate, not two
|
|
2622
|
+
* preferences. Two actions in one context form one triple when:
|
|
2623
|
+
* - their mean rewards differ, by at least `minMargin` (default 0.2);
|
|
2624
|
+
* - two different runs can represent them.
|
|
2625
|
+
* The higher-mean action is `chosen`. Its representative is its step with the
|
|
2626
|
+
* lowest run id, then span id; the rejected representative is the other
|
|
2627
|
+
* action's first step, in the same order, from a different run. When the
|
|
2628
|
+
* chosen action's first step has no such partner, its next step is tried.
|
|
2629
|
+
* A step with no digest is counted in the result and never paired.
|
|
2630
|
+
*/
|
|
2631
|
+
function prmTrainingPairs(stepRewardsByRun, opts = {}) {
|
|
2632
|
+
const minMargin = opts.minMargin ?? .2;
|
|
2633
|
+
if (!Number.isFinite(minMargin) || minMargin < 0) throw new RangeError(`prmTrainingPairs: minMargin must be a finite number >= 0, got ${minMargin}`);
|
|
2634
|
+
const result = {
|
|
2635
|
+
triples: [],
|
|
2636
|
+
stepsWithoutContextDigest: 0,
|
|
2637
|
+
stepsWithoutActionDigest: 0,
|
|
2638
|
+
singleRunContexts: 0,
|
|
2639
|
+
sameActionContexts: 0,
|
|
2640
|
+
actionPairsBelowMargin: 0,
|
|
2641
|
+
actionPairsInOneRun: 0
|
|
2642
|
+
};
|
|
2643
|
+
const byContext = /* @__PURE__ */ new Map();
|
|
2644
|
+
for (const steps of stepRewardsByRun.values()) for (const step of steps) if (!step.contextDigest) result.stepsWithoutContextDigest++;
|
|
2645
|
+
else if (!step.actionDigest) result.stepsWithoutActionDigest++;
|
|
2646
|
+
else byContext.set(step.contextDigest, [...byContext.get(step.contextDigest) ?? [], step]);
|
|
2647
|
+
for (const [contextDigest, group] of byContext) {
|
|
2648
|
+
if (new Set(group.map((s) => s.runId)).size < 2) {
|
|
2649
|
+
result.singleRunContexts++;
|
|
2650
|
+
continue;
|
|
2651
|
+
}
|
|
2652
|
+
const actions = actionsIn(group);
|
|
2653
|
+
if (actions.length < 2) {
|
|
2654
|
+
result.sameActionContexts++;
|
|
2655
|
+
continue;
|
|
2656
|
+
}
|
|
2657
|
+
for (let i = 0; i < actions.length; i++) for (let j = i + 1; j < actions.length; j++) {
|
|
2658
|
+
const a = actions[i];
|
|
2659
|
+
const b = actions[j];
|
|
2660
|
+
const [chosen, rejected] = a.mean >= b.mean ? [a, b] : [b, a];
|
|
2661
|
+
const margin = chosen.mean - rejected.mean;
|
|
2662
|
+
if (!(margin > 0 && margin >= minMargin)) {
|
|
2663
|
+
result.actionPairsBelowMargin++;
|
|
2664
|
+
continue;
|
|
2665
|
+
}
|
|
2666
|
+
const representatives = representativesOf(chosen.steps, rejected.steps);
|
|
2667
|
+
if (representatives === void 0) {
|
|
2668
|
+
result.actionPairsInOneRun++;
|
|
2669
|
+
continue;
|
|
2670
|
+
}
|
|
2671
|
+
const [chosenStep, rejectedStep] = representatives;
|
|
2672
|
+
result.triples.push({
|
|
2673
|
+
contextDigest,
|
|
2674
|
+
prefixRunId: chosenStep.runId,
|
|
2675
|
+
prefixStepIndex: chosenStep.stepIndex - 1,
|
|
2676
|
+
chosenSpanId: chosenStep.spanId,
|
|
2677
|
+
chosenReward: chosen.mean,
|
|
2678
|
+
chosenStepCount: chosen.steps.length,
|
|
2679
|
+
chosenRunIds: runIdsOf(chosen.steps),
|
|
2680
|
+
rejectedSpanId: rejectedStep.spanId,
|
|
2681
|
+
rejectedReward: rejected.mean,
|
|
2682
|
+
rejectedStepCount: rejected.steps.length,
|
|
2683
|
+
rejectedRunIds: runIdsOf(rejected.steps),
|
|
2684
|
+
rejectedRunId: rejectedStep.runId,
|
|
2685
|
+
marginScore: margin
|
|
2686
|
+
});
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
return result;
|
|
2690
|
+
}
|
|
2691
|
+
/** A context's steps grouped by action, in first-seen order. */
|
|
2692
|
+
function actionsIn(group) {
|
|
2693
|
+
const byAction = /* @__PURE__ */ new Map();
|
|
2694
|
+
for (const step of group) {
|
|
2695
|
+
const digest = step.actionDigest;
|
|
2696
|
+
byAction.set(digest, [...byAction.get(digest) ?? [], step]);
|
|
2697
|
+
}
|
|
2698
|
+
return [...byAction.values()].map((steps) => ({
|
|
2699
|
+
steps: [...steps].sort(byRunThenSpan),
|
|
2700
|
+
mean: steps.reduce((sum, s) => sum + s.reward, 0) / steps.length
|
|
2701
|
+
}));
|
|
2702
|
+
}
|
|
2703
|
+
/** The first chosen step, in order, that a rejected step from another run can face. */
|
|
2704
|
+
function representativesOf(chosen, rejected) {
|
|
2705
|
+
for (const c of chosen) {
|
|
2706
|
+
const r = rejected.find((s) => s.runId !== c.runId);
|
|
2707
|
+
if (r !== void 0) return [c, r];
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
function byRunThenSpan(a, b) {
|
|
2711
|
+
return compareCodeUnits(a.runId, b.runId) || compareCodeUnits(a.spanId, b.spanId);
|
|
2712
|
+
}
|
|
2713
|
+
function runIdsOf(steps) {
|
|
2714
|
+
return [...new Set(steps.map((s) => s.runId))].sort(compareCodeUnits);
|
|
2371
2715
|
}
|
|
2372
2716
|
// src/rl/rl-campaign.ts
|
|
2373
2717
|
/**
|
|
@@ -3099,6 +3443,6 @@ function loadVerifiedFindingsDataset(source) {
|
|
|
3099
3443
|
}
|
|
3100
3444
|
};
|
|
3101
3445
|
}
|
|
3102
|
-
export { FileSystemOutcomeStore, GRADER_REFERENCE_PHRASES, InMemoryOutcomeStore, PredictiveValidityResearcher, bestOfN, bucketLabel, buildPairwiseFromCampaign, buildRlDataset, campaignToRunRecords, checkerReadSignal, claimIntegrityDigest, claimIntegritySystemOneReview, claimIntegrityTraceQuestions, claimIntegrityVerdict, compareAdaptationCurves, detectRewardHacking, doublyRobust, extractPreferences, extractVerifiableReward, extractVerifiableRewardsFromRecords, farmingSignal, firstPassK, fitBradleyTerry, graderReferenceSignal, inverseProbabilityWeighting, loadVerifiedFindingsDataset, monitorSignal, paretoCostScoreFrontier, parseSourceScopeReferee, prmTrainingPairs, readCorpus, refereeSignal, ruleHolds, runAdaptationCurve, runContaminationProbe, runEvalCampaign, runRLCampaign, scopeSignals, selfNormalizedImportanceWeighting, sourceScopeRefereeMessages, systemOneSignal, toAnthropicFormat, toDpoRows, toGrpoRows, toPrmRows, toSftJsonl, toSftRowsWithLookups, toTRLFormat, validateDatasetFormats };
|
|
3446
|
+
export { FileSystemOutcomeStore, GRADER_REFERENCE_PHRASES, InMemoryOutcomeStore, PredictiveValidityResearcher, bestOfN, bucketLabel, buildPairwiseFromCampaign, buildRlDataset, campaignToRunRecords, checkerReadSignal, claimIntegrityDigest, claimIntegritySystemOneReview, claimIntegrityTraceQuestions, claimIntegrityVerdict, compareAdaptationCurves, detectRewardHacking, doublyRobust, extractPreferences, extractStepRewards, extractVerifiableReward, extractVerifiableRewardsFromRecords, farmingSignal, firstPassK, fitBradleyTerry, graderReferenceSignal, inverseProbabilityWeighting, loadVerifiedFindingsDataset, monitorSignal, paretoCostScoreFrontier, parseSourceScopeReferee, prmTrainingPairs, readCorpus, refereeSignal, ruleHolds, runAdaptationCurve, runContaminationProbe, runEvalCampaign, runRLCampaign, runwiseStepRewardSummary, scopeSignals, selfNormalizedImportanceWeighting, sourceScopeRefereeMessages, systemOneSignal, toAnthropicFormat, toDpoRows, toGrpoRows, toPrmRows, toSftJsonl, toSftRowsWithLookups, toTRLFormat, validateDatasetFormats };
|
|
3103
3447
|
|
|
3104
3448
|
//# sourceMappingURL=rl.js.map
|