@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/{skillopt-optimization-method-Dch9LiNR.js → skillopt-optimization-method-CHW9mphc.js}
RENAMED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { a as hashCanonical } from "./canonical-
|
|
2
|
-
import { i as assertServedModelPolicy } from "./served-model-
|
|
3
|
-
import { ht as meanOrZero } from "./statistics-
|
|
4
|
-
import { t as decidePairedPromotion } from "./paired-promotion-decision-
|
|
5
|
-
import { a as heldoutSignificance, o as pairHoldout } from "./statistical-heldout-
|
|
6
|
-
import { a as mapConcurrent } from "./journal-
|
|
7
|
-
import { n as contentHash, t as canonicalJson } from "./verdict-cache-
|
|
8
|
-
import {
|
|
9
|
-
import { D as
|
|
1
|
+
import { a as hashCanonical } from "./canonical-DKgL_Wby.js";
|
|
2
|
+
import { i as assertServedModelPolicy } from "./served-model-BXmeKm7D.js";
|
|
3
|
+
import { ht as meanOrZero } from "./statistics-DSidA5I2.js";
|
|
4
|
+
import { t as decidePairedPromotion } from "./paired-promotion-decision-Dn3-jaq4.js";
|
|
5
|
+
import { a as heldoutSignificance, o as pairHoldout } from "./statistical-heldout-CaS4T-43.js";
|
|
6
|
+
import { a as mapConcurrent } from "./journal-3y-btqaP.js";
|
|
7
|
+
import { n as contentHash, t as canonicalJson } from "./verdict-cache-BPaYxfG8.js";
|
|
8
|
+
import { $ as reserveFinalEvidence, A as campaignCellMeasurement, B as captureJudge, C as surfaceDiff, J as assertIndependentEvaluationSplit, T as assertSearchHistoryAdmissionOptions, X as evaluationUnitMap, Y as captureFinalEvidencePolicy, Z as exposeFinalEvidence, b as SearchRecorder, c as readGepaCandidatePopulationArtifact, ct as withUncapturedAgentSpend, d as optimizationTokenUsageFromSummary, it as resolveRunDir, j as campaignCellSearchResult, l as combineComparisonCosts, nt as runCampaign, o as executeOptimizationMethod, s as assertGepaCandidatePopulationSummary, u as costFromLedgerSummary, w as surfaceNode, x as developmentClaim } from "./llm-judge-CThv1Rog.js";
|
|
9
|
+
import { D as assertCampaignDesign, f as campaignBreakdown, k as assertCompleteCampaign, p as campaignEvidence, t as createCampaignEvidenceReceipt, v as excerptEvidence } from "./campaign-evidence-CsUE_lwc.js";
|
|
10
10
|
import { t as deepFreezeCanonicalJson } from "./deep-freeze-CK8-2W7p.js";
|
|
11
|
-
import {
|
|
12
|
-
import { s as surfaceContentHash } from "./json-recovery-
|
|
13
|
-
import { r as summarizeEvaluationUnits, t as defineEvaluationClaim } from "./claim-
|
|
14
|
-
import { n as openSearchLedger } from "./search-ledger-
|
|
15
|
-
import { t as acquireSingleRunLock } from "./single-run-lock-BSKsoeQF.js";
|
|
11
|
+
import { b as createRunCostLedger, i as startExternalOptimizerModelProxy, n as closeExternalOptimizerResources, r as runWithCleanup, t as runExternalOptimizerProcess, x as fsCampaignStorage } from "./external-optimizer-subprocess-B48Ie4qQ.js";
|
|
12
|
+
import { s as surfaceContentHash } from "./json-recovery-BRUCeQxo.js";
|
|
13
|
+
import { r as summarizeEvaluationUnits, t as defineEvaluationClaim } from "./claim-BWEXwwBk.js";
|
|
14
|
+
import { n as openSearchLedger } from "./search-ledger-C7t68cmy.js";
|
|
16
15
|
import { n as isRecord } from "./json-DtvZNAU9.js";
|
|
17
|
-
import { c as
|
|
18
|
-
import { t as
|
|
16
|
+
import { a as assertNoCredentialValues, c as isExternalTextCandidate, d as resolveExternalOptimizerProcessLimits, f as safePathComponent, i as assertJsonValue, l as removeCredentialEnvironment, r as assertExternalOptimizerModelBudget, s as isCandidateText, u as resolveExternalOptimizerCallbackLimits } from "./external-optimizer-contracts-eKQTutGZ.js";
|
|
17
|
+
import { t as acquireSingleRunLock } from "./single-run-lock-BSKsoeQF.js";
|
|
18
|
+
import { c as combineAbortSignals } from "./llm-client-gRPgIJyz.js";
|
|
19
|
+
import { t as startExternalOptimizerCallback } from "./external-optimizer-process-CkAc1xBa.js";
|
|
19
20
|
import { createHash, randomBytes } from "node:crypto";
|
|
20
21
|
import { mkdir } from "node:fs/promises";
|
|
21
22
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -72,11 +73,13 @@ function readExternalOptimizerObservationArtifact(input) {
|
|
|
72
73
|
evaluationNumbers.add(observation.evaluationNumber);
|
|
73
74
|
assertObservedCandidate(observation, proposed);
|
|
74
75
|
assertJsonValue(observation.response, "external optimizer evaluation response");
|
|
76
|
+
if (observation.measurement?.cells.some((cell) => cell.scenarioId !== observation.exampleId)) throw new Error(`external optimizer observation artifact measures another case than it evaluated at sequence ${observation.sequence}`);
|
|
75
77
|
continue;
|
|
76
78
|
}
|
|
77
79
|
refusals += 1;
|
|
78
80
|
if (observation.reason !== "invalid-request" && observation.reason !== "evaluation-limit" && observation.reason !== "evaluation-failed") throw new Error(`external optimizer observation artifact has invalid refusal reason at sequence ${observation.sequence}`);
|
|
79
81
|
if (observation.reason === "evaluation-failed") failedEvaluations += 1;
|
|
82
|
+
if (observation.measurement?.cells.some((cell) => cell.scenarioId !== observation.exampleId)) throw new Error(`external optimizer observation artifact measures another case than it refused at sequence ${observation.sequence}`);
|
|
80
83
|
const candidateFields = [observation.candidate, observation.candidateHash];
|
|
81
84
|
if (observation.reason !== "invalid-request" && candidateFields.some((value) => value === void 0)) throw new Error(`external optimizer observation artifact omits a refused candidate at sequence ${observation.sequence}`);
|
|
82
85
|
if (candidateFields.some((value) => value !== void 0)) {
|
|
@@ -166,7 +169,7 @@ function assertObservationShape(value, line) {
|
|
|
166
169
|
return;
|
|
167
170
|
}
|
|
168
171
|
if (observation.kind === "evaluation") {
|
|
169
|
-
|
|
172
|
+
const required = [
|
|
170
173
|
"candidate",
|
|
171
174
|
"candidateHash",
|
|
172
175
|
"evaluationNumber",
|
|
@@ -174,7 +177,9 @@ function assertObservationShape(value, line) {
|
|
|
174
177
|
"kind",
|
|
175
178
|
"response",
|
|
176
179
|
"sequence"
|
|
177
|
-
]
|
|
180
|
+
];
|
|
181
|
+
assertExactKeys(observation, "measurement" in observation ? [...required, "measurement"] : required, line);
|
|
182
|
+
if ("measurement" in observation) assertMeasurement(observation.measurement, line);
|
|
178
183
|
assertCandidateFields(observation, line);
|
|
179
184
|
if (typeof observation.exampleId !== "string") throw new Error(`external optimizer observation artifact line ${line} has an invalid exampleId`);
|
|
180
185
|
if (!Number.isSafeInteger(observation.evaluationNumber) || Number(observation.evaluationNumber) <= 0) throw new Error(`external optimizer observation artifact line ${line} has an invalid evaluationNumber`);
|
|
@@ -187,16 +192,47 @@ function assertObservationShape(value, line) {
|
|
|
187
192
|
"candidateHash",
|
|
188
193
|
"exampleId",
|
|
189
194
|
"kind",
|
|
195
|
+
"measurement",
|
|
190
196
|
"reason",
|
|
191
197
|
"sequence"
|
|
192
198
|
], line);
|
|
193
199
|
if (typeof observation.reason !== "string") throw new Error(`external optimizer observation artifact line ${line} has an invalid reason`);
|
|
200
|
+
if ("measurement" in observation) {
|
|
201
|
+
if (observation.reason !== "evaluation-failed") throw new Error(`external optimizer observation artifact line ${line} measures a refusal that never ran`);
|
|
202
|
+
assertMeasurement(observation.measurement, line);
|
|
203
|
+
}
|
|
194
204
|
if (observation.candidate !== void 0 || observation.candidateHash !== void 0) assertCandidateFields(observation, line);
|
|
195
205
|
if (observation.exampleId !== void 0 && typeof observation.exampleId !== "string") throw new Error(`external optimizer observation artifact line ${line} has an invalid exampleId`);
|
|
196
206
|
return;
|
|
197
207
|
}
|
|
198
208
|
throw new Error(`external optimizer observation artifact line ${line} has an invalid kind`);
|
|
199
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* The reference an evaluation keeps to its campaign cells. This checks what
|
|
212
|
+
* the importer reads to tell cells apart; the search ledger's own event schema
|
|
213
|
+
* checks each cell's outcome and accounting when the importer records it.
|
|
214
|
+
*/
|
|
215
|
+
function assertMeasurement(value, line) {
|
|
216
|
+
const cells = isPlainRecord(value) && Array.isArray(value.cells) ? value.cells : [];
|
|
217
|
+
if (!(isPlainRecord(value) && (value.source === "measured" || value.source === "reused") && cells.length > 0 && cells.every((cell) => isPlainRecord(cell) && typeof cell.cellId === "string" && typeof cell.scenarioId === "string" && Number.isSafeInteger(cell.rep) && typeof cell.cached === "boolean" && typeof cell.durationMs === "number" && (cell.resolvedModel === void 0 || typeof cell.resolvedModel === "string") && (cell.traceRef === void 0 || isPlainRecord(cell.traceRef) && (typeof cell.traceRef.traceId === "string" || typeof cell.traceRef.unknown === "string")) && (cell.attempt === null || isPlainRecord(cell.attempt) && typeof cell.attempt.runAttemptId === "string" && Number.isSafeInteger(cell.attempt.number))))) throw new Error(`external optimizer observation artifact line ${line} has an invalid measurement`);
|
|
218
|
+
assertAllowedKeys(value, ["cells", "source"], line);
|
|
219
|
+
for (const cell of cells) assertAllowedKeys(cell, [...MEASUREMENT_CELL_KEYS], line);
|
|
220
|
+
}
|
|
221
|
+
const MEASUREMENT_CELL_KEYS = [
|
|
222
|
+
"accounting",
|
|
223
|
+
"attempt",
|
|
224
|
+
"cached",
|
|
225
|
+
"cellId",
|
|
226
|
+
"durationMs",
|
|
227
|
+
"outcome",
|
|
228
|
+
"rep",
|
|
229
|
+
"resolvedModel",
|
|
230
|
+
"scenarioId",
|
|
231
|
+
"traceRef"
|
|
232
|
+
];
|
|
233
|
+
function isPlainRecord(value) {
|
|
234
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
235
|
+
}
|
|
200
236
|
function assertCandidateFields(observation, line) {
|
|
201
237
|
if (!isExternalTextCandidate(observation.candidate)) throw new Error(`external optimizer observation artifact line ${line} has an invalid candidate`);
|
|
202
238
|
if (typeof observation.candidateHash !== "string" || !/^[a-f0-9]{64}$/u.test(observation.candidateHash)) throw new Error(`external optimizer observation artifact line ${line} has an invalid candidateHash`);
|
|
@@ -258,8 +294,11 @@ function openExternalOptimizerExecutionLog(input) {
|
|
|
258
294
|
}
|
|
259
295
|
// src/campaign/external-text-evaluation.ts
|
|
260
296
|
function createExternalTextEvaluator(args) {
|
|
297
|
+
const shared = args.input.describeArtifact;
|
|
298
|
+
if (args.describeArtifact && shared && args.describeArtifact !== shared) throw new Error(`${args.label}: describeArtifact is set both on the method and by its caller; set it once`);
|
|
299
|
+
const describeArtifact = args.describeArtifact ?? shared;
|
|
261
300
|
const cached = /* @__PURE__ */ new Map();
|
|
262
|
-
return async ({ candidate, exampleId }, signal) => {
|
|
301
|
+
return async ({ candidate, exampleId }, signal, measured) => {
|
|
263
302
|
if (!args.scenarioById.has(exampleId)) throw new Error(`${args.label} requested unknown train or selection case '${exampleId}'`);
|
|
264
303
|
const detachedCandidate = cloneExternalTextCandidate$1(candidate);
|
|
265
304
|
const surface = typeof detachedCandidate === "string" ? detachedCandidate : {
|
|
@@ -271,7 +310,14 @@ function createExternalTextEvaluator(args) {
|
|
|
271
310
|
const scenario = args.scenarioById.get(exampleId);
|
|
272
311
|
const cacheKey = `${args.compatibleRunId}:${surfaceContentHash(surface)}:${exampleId}`;
|
|
273
312
|
const existing = cached.get(cacheKey);
|
|
274
|
-
if (existing)
|
|
313
|
+
if (existing) {
|
|
314
|
+
const reused = await existing;
|
|
315
|
+
if (reused.cells.length > 0) measured?.({
|
|
316
|
+
source: "reused",
|
|
317
|
+
cells: reused.cells
|
|
318
|
+
});
|
|
319
|
+
return answer(reused);
|
|
320
|
+
}
|
|
275
321
|
const result = scoreOneScenario({
|
|
276
322
|
input: args.input,
|
|
277
323
|
label: args.label,
|
|
@@ -283,18 +329,27 @@ function createExternalTextEvaluator(args) {
|
|
|
283
329
|
costTags: args.costTags,
|
|
284
330
|
costLedger: args.costLedger,
|
|
285
331
|
maxEvidenceChars: args.maxEvidenceChars,
|
|
286
|
-
describeArtifact:
|
|
332
|
+
...describeArtifact ? { describeArtifact } : {},
|
|
287
333
|
signal
|
|
288
334
|
});
|
|
289
335
|
cached.set(cacheKey, result);
|
|
290
|
-
result.then((
|
|
291
|
-
if (response.info.status
|
|
336
|
+
result.then((scored) => {
|
|
337
|
+
if (!("response" in scored && scored.response.info.status !== "failed") && cached.get(cacheKey) === result) cached.delete(cacheKey);
|
|
292
338
|
}, () => {
|
|
293
339
|
if (cached.get(cacheKey) === result) cached.delete(cacheKey);
|
|
294
340
|
});
|
|
295
|
-
|
|
341
|
+
const scored = await result;
|
|
342
|
+
if (scored.cells.length > 0) measured?.({
|
|
343
|
+
source: "measured",
|
|
344
|
+
cells: scored.cells
|
|
345
|
+
});
|
|
346
|
+
return answer(scored);
|
|
296
347
|
};
|
|
297
348
|
}
|
|
349
|
+
function answer(scored) {
|
|
350
|
+
if ("refusal" in scored) throw scored.refusal;
|
|
351
|
+
return scored.response;
|
|
352
|
+
}
|
|
298
353
|
function mapExternalScenarios(train, selection, label) {
|
|
299
354
|
const out = /* @__PURE__ */ new Map();
|
|
300
355
|
for (const scenario of [...train, ...selection]) {
|
|
@@ -325,25 +380,62 @@ function decodeExternalTextCandidate(candidate) {
|
|
|
325
380
|
};
|
|
326
381
|
}
|
|
327
382
|
async function scoreOneScenario(args) {
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
383
|
+
const { runOptions } = args.input;
|
|
384
|
+
const settled = [];
|
|
385
|
+
const started = /* @__PURE__ */ new Map();
|
|
386
|
+
let campaign;
|
|
387
|
+
try {
|
|
388
|
+
campaign = await runCampaign({
|
|
389
|
+
...runOptions,
|
|
390
|
+
scenarios: [structuredClone(args.scenario)],
|
|
391
|
+
dispatch: (scenario, context) => {
|
|
392
|
+
noteDispatch(started, scenario.id, context);
|
|
393
|
+
return args.input.dispatchWithSurface(args.candidate, scenario, context);
|
|
394
|
+
},
|
|
395
|
+
onCellSettled: async (cell, scenario) => {
|
|
396
|
+
settled.push(cell);
|
|
397
|
+
await runOptions.onCellSettled?.(cell, scenario);
|
|
398
|
+
},
|
|
399
|
+
dispatchRef: `external-text:${args.compatibleRunId}:${surfaceContentHash(args.candidate)}`,
|
|
400
|
+
judges: [...args.input.judges],
|
|
401
|
+
runDir: [
|
|
402
|
+
args.runDir,
|
|
403
|
+
"evaluations",
|
|
404
|
+
safePathComponent(args.compatibleRunId),
|
|
405
|
+
safePathComponent(surfaceContentHash(args.candidate)),
|
|
406
|
+
safePathComponent(args.scenario.id)
|
|
407
|
+
].join("/"),
|
|
408
|
+
seed: args.input.seed,
|
|
409
|
+
costLedger: args.costLedger,
|
|
410
|
+
costPhase: args.costPhase,
|
|
411
|
+
...args.costTags ? { costTags: args.costTags } : {},
|
|
412
|
+
maxConcurrency: 1,
|
|
413
|
+
...args.signal ? { signal: args.signal } : {}
|
|
414
|
+
});
|
|
415
|
+
} catch (error) {
|
|
416
|
+
const refusal = error instanceof Error ? error : new Error(String(error));
|
|
417
|
+
return {
|
|
418
|
+
cells: [...measureByRep(settled), ...interruptedCells(started, settled, args.costLedger, refusal.message)],
|
|
419
|
+
refusal
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
const cells = measureByRep(campaign.cells);
|
|
423
|
+
const respond = (response) => {
|
|
424
|
+
const bounded = boundEvidence(response, args.maxEvidenceChars);
|
|
425
|
+
if (bounded) return {
|
|
426
|
+
cells,
|
|
427
|
+
response: bounded
|
|
428
|
+
};
|
|
429
|
+
return {
|
|
430
|
+
cells,
|
|
431
|
+
refusal: /* @__PURE__ */ new Error(`${args.label} evaluation evidence for '${args.scenario.id}' exceeds maxEvidenceChars (${args.maxEvidenceChars}) in fields no excerpt can shorten`)
|
|
432
|
+
};
|
|
433
|
+
};
|
|
342
434
|
const failedCell = campaign.cells.find((cell) => cell.error !== void 0);
|
|
343
435
|
if (failedCell) {
|
|
344
436
|
const stage = failedCell.errorStage ?? "unknown";
|
|
345
437
|
const message = failedCell.error?.slice(0, 2e3) ?? "cell failed without an error message";
|
|
346
|
-
|
|
438
|
+
return respond({
|
|
347
439
|
score: 0,
|
|
348
440
|
info: {
|
|
349
441
|
scenarioId: failedCell.scenarioId,
|
|
@@ -355,16 +447,19 @@ async function scoreOneScenario(args) {
|
|
|
355
447
|
message
|
|
356
448
|
}
|
|
357
449
|
}
|
|
358
|
-
};
|
|
359
|
-
if (JSON.stringify(response).length > args.maxEvidenceChars) throw new Error(`${args.label} failed evaluation evidence for '${args.scenario.id}' exceeds maxEvidenceChars`);
|
|
360
|
-
return response;
|
|
450
|
+
});
|
|
361
451
|
}
|
|
362
452
|
const breakdown = campaignBreakdown(campaign);
|
|
363
453
|
const row = breakdown.scenarios[0];
|
|
364
|
-
if (!row)
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
454
|
+
if (!row) return {
|
|
455
|
+
cells,
|
|
456
|
+
refusal: /* @__PURE__ */ new Error(`${args.label} evaluation produced no score for '${args.scenario.id}'`)
|
|
457
|
+
};
|
|
458
|
+
const artifact = campaignEvidence(campaign.cells, {
|
|
459
|
+
scenarios: [args.scenario],
|
|
460
|
+
...args.describeArtifact ? { describeArtifact: args.describeArtifact } : {}
|
|
461
|
+
}).get(args.scenario.id);
|
|
462
|
+
return respond({
|
|
368
463
|
score: row.composite,
|
|
369
464
|
info: {
|
|
370
465
|
scenarioId: row.scenarioId,
|
|
@@ -374,9 +469,153 @@ async function scoreOneScenario(args) {
|
|
|
374
469
|
...row.notes ? { notes: row.notes } : {},
|
|
375
470
|
...artifact !== void 0 ? { artifact } : {}
|
|
376
471
|
}
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
function measureByRep(cells) {
|
|
475
|
+
return [...cells].sort((left, right) => left.rep - right.rep).map(campaignCellMeasurement);
|
|
476
|
+
}
|
|
477
|
+
function noteDispatch(started, scenarioId, context) {
|
|
478
|
+
const known = started.get(context.cellId);
|
|
479
|
+
if (known) {
|
|
480
|
+
known.dispatches += 1;
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
started.set(context.cellId, {
|
|
484
|
+
cellId: context.cellId,
|
|
485
|
+
scenarioId,
|
|
486
|
+
rep: context.rep,
|
|
487
|
+
runAttemptId: context.runAttemptId,
|
|
488
|
+
dispatches: 1,
|
|
489
|
+
startedMs: Date.now()
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Every cell that started but never settled before runCampaign threw. No cell
|
|
494
|
+
* result exists for it, so its outcome is the throw and its accounting is
|
|
495
|
+
* unknown: the agent spend the cost ledger holds for its attempt is a lower
|
|
496
|
+
* bound, since a dispatch that ignored cancellation may still be paying.
|
|
497
|
+
*/
|
|
498
|
+
function interruptedCells(started, settled, costLedger, thrown) {
|
|
499
|
+
const settledIds = new Set(settled.map((cell) => cell.cellId));
|
|
500
|
+
return [...started.values()].filter((cell) => !settledIds.has(cell.cellId)).sort((left, right) => left.rep - right.rep).map((cell) => {
|
|
501
|
+
const reason = `runCampaign threw before campaign cell ${cell.cellId} settled`;
|
|
502
|
+
const spent = costLedger.summary({
|
|
503
|
+
channel: "agent",
|
|
504
|
+
tags: {
|
|
505
|
+
runAttemptId: cell.runAttemptId,
|
|
506
|
+
cellId: cell.cellId
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
return {
|
|
510
|
+
cellId: cell.cellId,
|
|
511
|
+
scenarioId: cell.scenarioId,
|
|
512
|
+
rep: cell.rep,
|
|
513
|
+
attempt: {
|
|
514
|
+
runAttemptId: cell.runAttemptId,
|
|
515
|
+
number: cell.dispatches
|
|
516
|
+
},
|
|
517
|
+
cached: false,
|
|
518
|
+
outcome: {
|
|
519
|
+
status: "errored",
|
|
520
|
+
metrics: {},
|
|
521
|
+
error: {
|
|
522
|
+
code: "campaign-threw",
|
|
523
|
+
message: `${reason}: ${thrown.slice(0, 2e3)}`,
|
|
524
|
+
retryable: false
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
accounting: {
|
|
528
|
+
tokens: {
|
|
529
|
+
status: "unknown",
|
|
530
|
+
reason
|
|
531
|
+
},
|
|
532
|
+
cost: {
|
|
533
|
+
status: "unknown",
|
|
534
|
+
knownLowerBoundUsd: spent.totalCostUsd,
|
|
535
|
+
reason: `${reason}; the agent spend its receipts proved by then is a lower bound`
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
durationMs: Date.now() - cell.startedMs,
|
|
539
|
+
traceRef: { unknown: `${reason}, so no trace was named for it` }
|
|
540
|
+
};
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* The response within `maxChars` of JSON, or undefined when it cannot be.
|
|
545
|
+
*
|
|
546
|
+
* The bound limits how much evidence the optimizer reads per evaluation, and
|
|
547
|
+
* an excerpt meets it without hiding that anything was cut: the judge notes,
|
|
548
|
+
* the error message and a text artifact keep their head and tail around an
|
|
549
|
+
* omitted-count marker (`excerptEvidence`), sharing the room the other fields
|
|
550
|
+
* leave. A described artifact stays whole when the text fields alone can make
|
|
551
|
+
* room; otherwise it is shown as its excerpted JSON text, as the native
|
|
552
|
+
* reflective path shows it. Only the fields no excerpt can shorten (the
|
|
553
|
+
* scores, the dimensions and the ids) can make a response not fit.
|
|
554
|
+
*/
|
|
555
|
+
function boundEvidence(response, maxChars) {
|
|
556
|
+
if (JSON.stringify(response).length <= maxChars) return response;
|
|
557
|
+
const { info } = response;
|
|
558
|
+
const fit = (artifactAsText) => {
|
|
559
|
+
const artifact = typeof info.artifact === "string" ? info.artifact : artifactAsText && info.artifact !== void 0 ? JSON.stringify(info.artifact) : void 0;
|
|
560
|
+
const fields = [];
|
|
561
|
+
if (info.notes !== void 0) fields.push(["notes", info.notes]);
|
|
562
|
+
if (info.error) fields.push(["message", info.error.message]);
|
|
563
|
+
if (artifact !== void 0) fields.push(["artifact", artifact]);
|
|
564
|
+
const build = (texts) => {
|
|
565
|
+
const text = new Map(fields.map(([name], index) => [name, texts[index]]));
|
|
566
|
+
const notes = text.get("notes");
|
|
567
|
+
const message = text.get("message");
|
|
568
|
+
const excerpted = text.get("artifact");
|
|
569
|
+
return {
|
|
570
|
+
...response,
|
|
571
|
+
info: {
|
|
572
|
+
...info,
|
|
573
|
+
...notes === void 0 ? {} : { notes },
|
|
574
|
+
...message === void 0 || !info.error ? {} : { error: {
|
|
575
|
+
...info.error,
|
|
576
|
+
message
|
|
577
|
+
} },
|
|
578
|
+
...excerpted === void 0 ? {} : { artifact: excerpted }
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
const texts = fitTexts(fields.map(([, value]) => value), (candidate) => JSON.stringify(build(candidate)).length, maxChars);
|
|
583
|
+
return texts && build(texts);
|
|
377
584
|
};
|
|
378
|
-
|
|
379
|
-
return
|
|
585
|
+
const describedArtifact = info.artifact !== void 0 && typeof info.artifact !== "string";
|
|
586
|
+
return fit(false) ?? (describedArtifact ? fit(true) : void 0);
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Excerpts of `texts` whose `size` is at most `maxChars`, or undefined when
|
|
590
|
+
* the rest of the value alone exceeds it. The room left by the rest is shared
|
|
591
|
+
* evenly, and a text shorter than its share leaves the remainder to the
|
|
592
|
+
* others. Sizes count JSON-encoded characters, so escapes are paid for.
|
|
593
|
+
*/
|
|
594
|
+
function fitTexts(texts, size, maxChars) {
|
|
595
|
+
const fixed = size(texts.map(() => ""));
|
|
596
|
+
if (fixed > maxChars) return void 0;
|
|
597
|
+
const encoded = (text) => JSON.stringify(text).length - 2;
|
|
598
|
+
const shares = new Array(texts.length).fill(0);
|
|
599
|
+
let room = maxChars - fixed;
|
|
600
|
+
let remaining = texts.length;
|
|
601
|
+
const shortestFirst = texts.map((_, index) => index).sort((left, right) => encoded(texts[left]) - encoded(texts[right]));
|
|
602
|
+
for (const index of shortestFirst) {
|
|
603
|
+
shares[index] = Math.min(encoded(texts[index]), Math.floor(room / remaining));
|
|
604
|
+
room -= shares[index];
|
|
605
|
+
remaining -= 1;
|
|
606
|
+
}
|
|
607
|
+
return texts.map((text, index) => excerptWithin(text, shares[index]));
|
|
608
|
+
}
|
|
609
|
+
/** The longest `excerptEvidence` of `text` whose JSON-encoded content fits `maxEncoded`. */
|
|
610
|
+
function excerptWithin(text, maxEncoded) {
|
|
611
|
+
let limit = maxEncoded;
|
|
612
|
+
while (limit > 0) {
|
|
613
|
+
const excerpt = excerptEvidence(text, limit);
|
|
614
|
+
const over = JSON.stringify(excerpt).length - 2 - maxEncoded;
|
|
615
|
+
if (over <= 0) return excerpt;
|
|
616
|
+
limit -= over;
|
|
617
|
+
}
|
|
618
|
+
return "";
|
|
380
619
|
}
|
|
381
620
|
function cloneExternalTextCandidate$1(candidate) {
|
|
382
621
|
return typeof candidate === "string" ? candidate : { ...candidate };
|
|
@@ -1015,6 +1254,7 @@ function heldOutGate(options) {
|
|
|
1015
1254
|
const minProductiveRuns = options.minProductiveRuns ?? 3;
|
|
1016
1255
|
const resamples = options.resamples ?? 2e3;
|
|
1017
1256
|
const seed = options.bootstrapSeed ?? 1337;
|
|
1257
|
+
const independentUnitByScenarioId = options.independentUnitByScenarioId === void 0 ? void 0 : new Map(options.independentUnitByScenarioId);
|
|
1018
1258
|
return {
|
|
1019
1259
|
name: "heldOutGate",
|
|
1020
1260
|
async decide(ctx) {
|
|
@@ -1025,19 +1265,24 @@ function heldOutGate(options) {
|
|
|
1025
1265
|
confidence,
|
|
1026
1266
|
minProductiveRuns,
|
|
1027
1267
|
resamples,
|
|
1028
|
-
seed
|
|
1268
|
+
seed,
|
|
1269
|
+
independentUnitByScenarioId
|
|
1029
1270
|
});
|
|
1030
1271
|
const dec = sig.decision;
|
|
1031
1272
|
const delta = dec.delta;
|
|
1032
1273
|
const passed = sig.significant;
|
|
1033
1274
|
const status = sig.fewRuns ? "not_evaluated" : passed ? "pass" : "fail";
|
|
1275
|
+
const registered = sig.observationUnit === "registered";
|
|
1276
|
+
const units = `${sig.n} independent units from ${sig.pairedCellN} paired cells`;
|
|
1277
|
+
const observed = registered ? units : `${sig.n} paired runs`;
|
|
1278
|
+
const count = registered ? `n=${units}` : `n=${sig.n}`;
|
|
1034
1279
|
const tieNote = sig.tieFraction >= .4 ? `, ${(sig.tieFraction * 100).toFixed(0)}% tied` : "";
|
|
1035
1280
|
const ci = `${(dec.confidence * 100).toFixed(0)}% CI [${dec.low.toFixed(3)}, ${dec.high.toFixed(3)}]`;
|
|
1036
1281
|
const held = `held-out ${dec.label} Δ ${delta.toFixed(3)}`;
|
|
1037
|
-
const holdReason = sig.fewRuns ? `held-out: only ${
|
|
1282
|
+
const holdReason = sig.fewRuns ? `held-out: only ${observed}; ${sig.minimumRequired} required — too few to claim significance` : dec.indeterminate ? `held-out: ${dec.indeterminateCause}, so the paired CI is ${ci} and carries no direction — it cannot clear ${deltaThreshold} on evidence (${count}${tieNote})` : dec.exactTestVetoes ? `${held}, McNemar exact p=${dec.mcnemar?.pValue.toExponential(2)} does not reject at α=${(1 - dec.confidence).toFixed(4)} (${ci}, ${count}${tieNote})` : `${held}, CI.low ${dec.low.toFixed(3)} ≤ ${deltaThreshold} (${ci}, ${count}${tieNote})`;
|
|
1038
1283
|
return {
|
|
1039
1284
|
decision: passed ? "ship" : "hold",
|
|
1040
|
-
reasons: passed ? [`${held}, CI.low ${dec.low.toFixed(3)} > ${deltaThreshold} (${ci},
|
|
1285
|
+
reasons: passed ? [`${held}, CI.low ${dec.low.toFixed(3)} > ${deltaThreshold} (${ci}, ${count}${tieNote})`] : [holdReason],
|
|
1041
1286
|
contributingGates: [{
|
|
1042
1287
|
name: "heldOutGate",
|
|
1043
1288
|
status,
|
|
@@ -1057,6 +1302,11 @@ function heldOutGate(options) {
|
|
|
1057
1302
|
bootstrapCiHigh: sig.bootstrap.high,
|
|
1058
1303
|
confidence: dec.confidence,
|
|
1059
1304
|
n: sig.n,
|
|
1305
|
+
...registered ? {
|
|
1306
|
+
pairedCellN: sig.pairedCellN,
|
|
1307
|
+
observationUnit: sig.observationUnit,
|
|
1308
|
+
unitIds: sig.unitIds
|
|
1309
|
+
} : {},
|
|
1060
1310
|
deltaThreshold,
|
|
1061
1311
|
fewRuns: sig.fewRuns,
|
|
1062
1312
|
seed
|
|
@@ -1408,7 +1658,8 @@ function isGepaCandidate(value, maxChars) {
|
|
|
1408
1658
|
* GEPA's candidate population also names each candidate's parents by index.
|
|
1409
1659
|
* The importer turns both into ledger events: one node per distinct candidate,
|
|
1410
1660
|
* one `correlated` edge per population entry (joined by content digest from
|
|
1411
|
-
* GEPA's own parent record), and one cell per
|
|
1661
|
+
* GEPA's own parent record), and one cell per campaign cell an evaluation
|
|
1662
|
+
* measured (one per evaluation for a log that names no cells). Nothing is inferred
|
|
1412
1663
|
* from timing or order: a candidate with no parent record (every SkillOpt
|
|
1413
1664
|
* candidate, and a candidate GEPA kept out of its population) has an `unknown`
|
|
1414
1665
|
* edge and no parents.
|
|
@@ -1491,20 +1742,34 @@ async function importGepaPopulation(input) {
|
|
|
1491
1742
|
};
|
|
1492
1743
|
}
|
|
1493
1744
|
/**
|
|
1494
|
-
* Record
|
|
1495
|
-
*
|
|
1745
|
+
* Record the callback's evaluations as `external` cells. An evaluation that
|
|
1746
|
+
* carries its measurement records each campaign cell it names once, through
|
|
1747
|
+
* `campaignCellSearchResult`, so the ledger holds the cell's own outcome,
|
|
1748
|
+
* dimensions, tokens, cost, model, duration, attempt and trace; a request
|
|
1749
|
+
* answered from an earlier request's cells adds none. A refusal that measured
|
|
1750
|
+
* cells before it was refused records them the same way, with their real
|
|
1751
|
+
* accounting and an `evaluation-refused` outcome; for an evaluation whose
|
|
1752
|
+
* campaign threw, that is every cell it settled, and each cell the throw
|
|
1753
|
+
* interrupted with unknown accounting. An evaluation logged
|
|
1754
|
+
* without cells (a log written before the callback recorded them, or a
|
|
1755
|
+
* refusal that measured nothing) records one cell whose accounting is
|
|
1756
|
+
* unknown. A candidate that is not yet a node (GEPA evaluated it on a
|
|
1496
1757
|
* minibatch and discarded it, or SkillOpt, which reports no parents, proposed
|
|
1497
1758
|
* it) is registered with an `unknown` edge.
|
|
1498
1759
|
*/
|
|
1499
1760
|
async function importExternalEvaluations(input) {
|
|
1500
1761
|
const { recorder } = input;
|
|
1501
1762
|
const optimizer = input.optimizer ?? "GEPA";
|
|
1763
|
+
const lane = `${optimizer.toLowerCase()}-evaluation-callback`;
|
|
1502
1764
|
const reps = /* @__PURE__ */ new Map();
|
|
1765
|
+
const recordedCells = /* @__PURE__ */ new Set();
|
|
1503
1766
|
const unrecorded = [];
|
|
1504
1767
|
let cells = 0;
|
|
1768
|
+
let reusedRequests = 0;
|
|
1505
1769
|
for (const observation of input.observations.observations) {
|
|
1506
1770
|
if (!(observation.kind === "evaluation" || observation.kind === "refusal" && observation.reason === "evaluation-failed") || observation.candidate === void 0 || observation.exampleId === void 0) continue;
|
|
1507
1771
|
const candidateHash = observation.candidateHash;
|
|
1772
|
+
const exampleId = observation.exampleId;
|
|
1508
1773
|
const surface = externalSurface(observation.candidate);
|
|
1509
1774
|
const registered = await recorder.registerNode(surfaceNode(recorder, surface));
|
|
1510
1775
|
if (((await recorder.state()).node(registered.nodeId)?.edgeIds.length ?? 0) === 0) {
|
|
@@ -1521,19 +1786,49 @@ async function importExternalEvaluations(input) {
|
|
|
1521
1786
|
});
|
|
1522
1787
|
unrecorded.push(registered.nodeId);
|
|
1523
1788
|
}
|
|
1524
|
-
const split = input.splitOf(
|
|
1525
|
-
const
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1789
|
+
const split = input.splitOf(exampleId);
|
|
1790
|
+
const { measurement } = observation;
|
|
1791
|
+
const refused = observation.kind === "refusal";
|
|
1792
|
+
const allocate = async () => {
|
|
1793
|
+
const repKey = `${registered.nodeId}\u0000${exampleId}`;
|
|
1794
|
+
const rep = reps.get(repKey) ?? 0;
|
|
1795
|
+
reps.set(repKey, rep + 1);
|
|
1796
|
+
return recorder.allocateCell({
|
|
1797
|
+
nodeId: registered.nodeId,
|
|
1798
|
+
taskId: exampleId,
|
|
1799
|
+
split,
|
|
1800
|
+
rep,
|
|
1801
|
+
stage: "external",
|
|
1802
|
+
...measurement === void 0 ? {} : { lane }
|
|
1803
|
+
});
|
|
1804
|
+
};
|
|
1805
|
+
if (measurement !== void 0) {
|
|
1806
|
+
if (measurement.source === "reused") reusedRequests += 1;
|
|
1807
|
+
for (const cell of measurement.cells) {
|
|
1808
|
+
const key = hashCanonical({
|
|
1809
|
+
candidateHash,
|
|
1810
|
+
exampleId,
|
|
1811
|
+
cellId: cell.cellId,
|
|
1812
|
+
attempt: cell.attempt
|
|
1813
|
+
});
|
|
1814
|
+
if (recordedCells.has(key)) continue;
|
|
1815
|
+
recordedCells.add(key);
|
|
1816
|
+
const result = campaignCellSearchResult(cell, {
|
|
1817
|
+
execution: input.identity,
|
|
1818
|
+
lane
|
|
1819
|
+
});
|
|
1820
|
+
await recorder.settleCell({
|
|
1821
|
+
cellId: await allocate(),
|
|
1822
|
+
attempt: 1,
|
|
1823
|
+
...result,
|
|
1824
|
+
...refused ? { outcome: refusedAfterMeasurement(result.outcome) } : {}
|
|
1825
|
+
});
|
|
1826
|
+
cells += 1;
|
|
1827
|
+
}
|
|
1828
|
+
continue;
|
|
1829
|
+
}
|
|
1535
1830
|
await recorder.settleCell({
|
|
1536
|
-
cellId,
|
|
1831
|
+
cellId: await allocate(),
|
|
1537
1832
|
attempt: 1,
|
|
1538
1833
|
outcome: observation.kind === "evaluation" ? evaluationOutcome(observation.response) : {
|
|
1539
1834
|
status: "errored",
|
|
@@ -1561,9 +1856,30 @@ async function importExternalEvaluations(input) {
|
|
|
1561
1856
|
}
|
|
1562
1857
|
return {
|
|
1563
1858
|
cells,
|
|
1859
|
+
measuredCells: recordedCells.size,
|
|
1860
|
+
reusedRequests,
|
|
1564
1861
|
unrecordedParentNodeIds: unrecorded
|
|
1565
1862
|
};
|
|
1566
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* A cell the callback measured and then refused to return to the optimizer,
|
|
1866
|
+
* for example because its evidence did not fit the bound. Its accounting and
|
|
1867
|
+
* metrics are the measurement's, since the spend was real; it is unscored,
|
|
1868
|
+
* because the optimizer received no score, and the error names what the
|
|
1869
|
+
* measurement found.
|
|
1870
|
+
*/
|
|
1871
|
+
function refusedAfterMeasurement(measured) {
|
|
1872
|
+
const found = measured.status === "errored" ? `an unscored cell (${measured.error.code}: ${measured.error.message})` : `a ${measured.status} cell scoring ${measured.score}`;
|
|
1873
|
+
return {
|
|
1874
|
+
status: "errored",
|
|
1875
|
+
metrics: measured.metrics,
|
|
1876
|
+
error: {
|
|
1877
|
+
code: "evaluation-refused",
|
|
1878
|
+
message: `the evaluation callback refused the evaluation after measuring ${found}; the optimizer received no score`,
|
|
1879
|
+
retryable: false
|
|
1880
|
+
}
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1567
1883
|
/** GEPA's callback response. A `failed` evaluation carries a penalty score for
|
|
1568
1884
|
* the optimizer that is not a measurement, so the cell is unscored. */
|
|
1569
1885
|
function evaluationOutcome(response) {
|
|
@@ -1634,6 +1950,8 @@ async function recordSkillOptSearch(input) {
|
|
|
1634
1950
|
async function recordExternalSearch(input) {
|
|
1635
1951
|
const { identity, population, optimizer } = input;
|
|
1636
1952
|
const policyName = optimizer.toLowerCase();
|
|
1953
|
+
const repsPerEvaluation = input.repsPerEvaluation ?? 1;
|
|
1954
|
+
if (!Number.isSafeInteger(repsPerEvaluation) || repsPerEvaluation <= 0) throw new Error(`${input.name}: repsPerEvaluation must be a positive safe integer`);
|
|
1637
1955
|
const tasks = (scenarios) => scenarios.map((scenario) => ({
|
|
1638
1956
|
taskId: scenario.id,
|
|
1639
1957
|
unitId: scenario.id,
|
|
@@ -1680,7 +1998,7 @@ async function recordExternalSearch(input) {
|
|
|
1680
1998
|
},
|
|
1681
1999
|
budget: {
|
|
1682
2000
|
maxUsd: null,
|
|
1683
|
-
maxCells: input.evaluationLimit,
|
|
2001
|
+
maxCells: input.evaluationLimit * repsPerEvaluation,
|
|
1684
2002
|
maxNodes: null,
|
|
1685
2003
|
deadline: null,
|
|
1686
2004
|
maxConcurrency: null,
|
|
@@ -2147,6 +2465,7 @@ async function recordGepaSearchHistory(ctx, result, population) {
|
|
|
2147
2465
|
trainScenarios: input.trainScenarios,
|
|
2148
2466
|
selectionScenarios: input.selectionScenarios,
|
|
2149
2467
|
evaluationLimit,
|
|
2468
|
+
repsPerEvaluation: input.runOptions.reps ?? 1,
|
|
2150
2469
|
...population ? { population } : {
|
|
2151
2470
|
population: null,
|
|
2152
2471
|
selected: decodeExternalTextCandidate(result.bestCandidate)
|
|
@@ -2416,6 +2735,7 @@ function normalizeComparisonOptions(prev) {
|
|
|
2416
2735
|
/** Scoring a surface on the final test set, and aligning the scores to the designed scenarios. */
|
|
2417
2736
|
async function finalTestScoring(prev) {
|
|
2418
2737
|
const { opts, seed, intervalConfidence, resamples, evidence, evidenceBySurface, storage, resolvedRunDir, costLedger } = prev;
|
|
2738
|
+
const testCampaigns = [];
|
|
2419
2739
|
const scoreOnTest = async (surface, tag, costPhase) => {
|
|
2420
2740
|
const measuredSurface = structuredClone(surface);
|
|
2421
2741
|
const campaign = await runCampaign({
|
|
@@ -2429,6 +2749,10 @@ async function finalTestScoring(prev) {
|
|
|
2429
2749
|
runDir: `${resolvedRunDir}/${tag}`
|
|
2430
2750
|
});
|
|
2431
2751
|
assertCompleteCampaign(campaign, opts.testScenarios, opts.reps ?? 1, true, `compareOptimizationMethods: ${tag} final comparison`);
|
|
2752
|
+
testCampaigns.push({
|
|
2753
|
+
label: tag,
|
|
2754
|
+
cells: campaign.cells
|
|
2755
|
+
});
|
|
2432
2756
|
if (evidence) evidenceBySurface.set(surfaceContentHash(measuredSurface), createCampaignEvidenceReceipt({
|
|
2433
2757
|
campaign,
|
|
2434
2758
|
surface: measuredSurface,
|
|
@@ -2472,6 +2796,7 @@ async function finalTestScoring(prev) {
|
|
|
2472
2796
|
return {
|
|
2473
2797
|
...prev,
|
|
2474
2798
|
scoreOnTest,
|
|
2799
|
+
testCampaigns,
|
|
2475
2800
|
scenarioIds,
|
|
2476
2801
|
unitByScenario,
|
|
2477
2802
|
units,
|
|
@@ -2674,12 +2999,12 @@ function pairwiseAgainstBest(prev) {
|
|
|
2674
2999
|
}
|
|
2675
3000
|
/** Total cost against the ceiling, then the comparison record. */
|
|
2676
3001
|
function comparisonResult(prev) {
|
|
2677
|
-
const { opts, searchHistoryPolicy, seed, confidence, comparisonCount, intervalConfidence, resamples, costLedger, scenarioIds, units, optimized, testCostPhase, finalEvidence, scores, best, pairwise } = prev;
|
|
3002
|
+
const { opts, searchHistoryPolicy, seed, confidence, comparisonCount, intervalConfidence, resamples, costLedger, scenarioIds, units, optimized, testCostPhase, testCampaigns, finalEvidence, scores, best, pairwise } = prev;
|
|
2678
3003
|
const optimizationCost = combineComparisonCosts(scores.map((score) => ({
|
|
2679
3004
|
label: `method '${score.name}'`,
|
|
2680
3005
|
cost: score.optimizationCost
|
|
2681
3006
|
})));
|
|
2682
|
-
const testCost = costFromLedgerSummary(costLedger.summary({ phase: testCostPhase }));
|
|
3007
|
+
const testCost = withUncapturedAgentSpend(costFromLedgerSummary(costLedger.summary({ phase: testCostPhase })), testCampaigns);
|
|
2683
3008
|
const totalCost = combineComparisonCosts([{
|
|
2684
3009
|
label: "optimization",
|
|
2685
3010
|
cost: optimizationCost
|
|
@@ -2782,6 +3107,7 @@ function createOptimizationMethodInput(opts, methodName, resolvedRunDir, seed, b
|
|
|
2782
3107
|
selectionScenarios: opts.selectionScenarios,
|
|
2783
3108
|
dispatchWithSurface: opts.dispatchWithSurface,
|
|
2784
3109
|
judges: opts.judges,
|
|
3110
|
+
...opts.describeArtifact ? { describeArtifact: opts.describeArtifact } : {},
|
|
2785
3111
|
runDir: methodRunDir,
|
|
2786
3112
|
seed,
|
|
2787
3113
|
runOptions: Object.freeze({
|
|
@@ -3176,6 +3502,7 @@ async function finishSkillOptRun(context, result, outputDir, modelProxy) {
|
|
|
3176
3502
|
trainScenarios: input.trainScenarios,
|
|
3177
3503
|
selectionScenarios: input.selectionScenarios,
|
|
3178
3504
|
evaluationLimit: config.maxEvaluations,
|
|
3505
|
+
repsPerEvaluation: input.runOptions.reps ?? 1,
|
|
3179
3506
|
observations: readExternalOptimizerObservationArtifact({
|
|
3180
3507
|
summary: observationLog.summary(),
|
|
3181
3508
|
storage: context.storage
|
|
@@ -3224,4 +3551,4 @@ async function finishSkillOptRun(context, result, outputDir, modelProxy) {
|
|
|
3224
3551
|
}
|
|
3225
3552
|
export { importExternalEvaluations as a, composeGate as c, readExternalOptimizerObservationArtifact as d, externalSurface as i, externalTextOptimizationMethod as l, compareOptimizationMethods as n, importGepaPopulation as o, gepaOptimizationMethod as r, heldOutGate as s, skillOptOptimizationMethod as t, decodeExternalTextCandidate as u };
|
|
3226
3553
|
|
|
3227
|
-
//# sourceMappingURL=skillopt-optimization-method-
|
|
3554
|
+
//# sourceMappingURL=skillopt-optimization-method-CHW9mphc.js.map
|