@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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,81 @@ All notable changes to `@tangle-network/agent-eval` and its sibling `agent-eval-
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## Unreleased
|
|
8
|
+
|
|
9
|
+
No caller of 2.0.0 must change code. Two behaviors change:
|
|
10
|
+
|
|
11
|
+
- `RunCampaignOptions.tracing: 'off'` now does what it documented: every attempt gets a writer that keeps no span, and each cell's `traceRef` is unknown with that reason. Before, `'off'` was ignored and spans were captured. Combining it with `buildTraceWriter` is refused. A caller that passed `'off'` and still reads the spans removes `'off'`.
|
|
12
|
+
- The SkillOpt bridge checks each callback response against `maxEvidenceChars` by the TypeScript rule (the response's JSON length in UTF-16 code units), not the case and the response together, so it no longer refuses a response the callback excerpted to the bound.
|
|
13
|
+
|
|
14
|
+
Fixes:
|
|
15
|
+
|
|
16
|
+
- An external evaluation (GEPA or SkillOpt) whose campaign throws keeps what it spent: the refusal's `measurement` carries every cell that settled before the throw with its real accounting, and each cell the throw interrupted (`campaign-threw`, unknown tokens and cost, with the agent spend its receipts proved as the lower bound). Before, the evaluation was one cell with unknown cost and a $0 floor.
|
|
17
|
+
- `campaignToRunRecords`, `selfImprove`'s run records and `runProfileMatrix` records carry the campaign cell's known trace as `RunRecord.traceRef`; a cell whose trace is unknown leaves it absent.
|
|
18
|
+
- `pnpm lint` passes and the documented local gate runs it.
|
|
19
|
+
|
|
20
|
+
## [2.0.0] — 2026-11-20
|
|
21
|
+
|
|
22
|
+
Breaking changes first. Each names what a caller must do.
|
|
23
|
+
|
|
24
|
+
- `Trajectory` gains a required `missingParents: TrajectoryMissingParent[]`. `buildTrajectory` fills it; a caller that builds a `Trajectory` literal (a test fixture, a replay) adds `missingParents: []`. A span whose parent is absent from the capture used to vanish from `steps` and from every count; it is now kept as a root and listed in `missingParents` with the parent id it names. A trace with no such hole is unchanged.
|
|
25
|
+
- `CounterfactualMutation.at` is a `TrajectoryStepRef`: a step index as before, or `{ spanId }`. A caller that only passes numbers changes nothing. A caller that reads `mutation.at` as a number must handle the span-id form. A runner implementing the counterfactual runner contract receives a required `inFlight: TrajectoryStep[]` on its context and a result now carries `targetSpanId: string`; a caller that builds either literal adds the field. The prefix before a mutation is no longer `steps.slice(0, index)`: it is the target's ancestors plus every step that ended before the target started, so a parallel branch's later steps no longer reach the replay. Steps still running at the target's start are `inFlight`, and `SandboxCounterfactualRunner` refuses a target with steps in flight before it opens a sandbox. A sequential trace's prefix is unchanged. `trajectoryTimingBoundary` is exported.
|
|
26
|
+
- `prmTrainingPairs` returns a `PrmPairingResult` (`triples` plus counts of the steps and contexts it could not use), not an array. A caller reads `.triples`. Its option `minPrefixLength` is removed; `minMargin` stays. A pair is now two actions taken in the same recorded context, represented by steps from two different runs: steps are grouped by context digest across runs, grouped again by action, and compared on mean reward, so two unrelated tasks that share span names no longer pair. `PrmTrainingTriple` gains required `contextDigest`, `chosenStepCount`, `chosenRunIds`, `rejectedStepCount` and `rejectedRunIds`; a caller that builds a triple by hand supplies them.
|
|
27
|
+
- `toPrmRows` refuses a triple with no `contextDigest`, and a triple that names no runs behind its means, instead of building a row. It checks the realness gate of every run behind either mean, and carries the digest, step counts and run ids on `meta`. A caller that built triples outside `prmTrainingPairs` must supply a `contextDigest` that names the shared context.
|
|
28
|
+
- `StepReward.stepIndex` is the span's position among all spans of the run, not a count of scored steps. `StepScorer.score` returns a `ScoredStep` (`StepReward` without identity, adds optional `contextDigest` and `actionDigest`). `extractStepRewards` gives each step a context digest (the run's scenario id, the recorded content of every span before the step, and the step's own input) and an action digest. A step's context is what was observable when it started: each span contributes its start content at `startedAt` and its end content at `endedAt`, so the end state of a span still open at that moment is no longer part of the context. A run whose scenario id is the emitter's default has no task identity and gets no context digest, and missing content yields no digest. `extractStepRewards` takes `contextAttributes` to name the attribute keys that count as context. `extractStepRewards` and `runwiseStepRewardSummary` are exported from `/rl`. A caller that relied on position among scored steps reads the new index.
|
|
29
|
+
- `campaignBreakdown` takes an optional second argument (`ArtifactEvidenceOptions`, with `describeArtifact`). A caller that passes one argument is unaffected. The per-scenario evidence it shows is now `campaignEvidence`: the lowest-scoring cell's artifact, as is for a string or as `describeArtifact` returns it, and nothing without the hook. Long text keeps its head and tail around an omitted-character count (`excerptEvidence`) in `campaignBreakdown` and `buildReflectionPrompt`, so the end of an output, where a failure usually is, reaches the reflection prompt; the head-only clip is gone. `runOptimization` takes the same `describeArtifact` hook, and the GEPA and SkillOpt callbacks send the same evidence as a JSON value (a described artifact may still carry inline images).
|
|
30
|
+
- The type re-exports `Span`, `TraceEvent` and `TraceStore` at the foot of `src/trajectory.ts` and `src/counterfactual.ts` are removed. No package entry exported them from there; a deep import of those paths takes them from `src/trace`.
|
|
31
|
+
|
|
32
|
+
Behavior and additions:
|
|
33
|
+
|
|
34
|
+
- `heldOutGate` counts each independent unit once. `HeldOutGateOptions` gains optional `independentUnitByScenarioId`; paired cells are averaged within a unit, and units count toward `n` and `minProductiveRuns`, so many decision points from one historical run cannot read as many independent tasks. A scored scenario missing from a supplied map raises the shared `aggregatePairedHoldout` error. With a map the reason names both counts and the detail adds `pairedCellN`, `observationUnit` and `unitIds`. Without a map nothing changes.
|
|
35
|
+
- Imported search cells carry the campaign cells that measured them. The GEPA and SkillOpt evaluation callback keeps a `CampaignCellMeasurement` of every campaign cell behind a request on that request's observation (optional `measurement`), and `importExternalEvaluations` records each distinct measured cell once, with its outcome, dimensions, tokens, cost, model, duration and attempt. A request answered from an earlier request's cells is logged as reused and adds no cell; every rep of a multi-rep evaluation is its own cell, and `maxCells` is the evaluation limit times the reps. `GepaEvaluationImport` reports `measuredCells` and `reusedRequests`. An observation log without measurements imports as before. Every campaign cell records `dimension.<judge>.<dimension>` for each successful judge, its cached prompt tokens, and a trace reason naming the attempt whose trace writer received its spans.
|
|
36
|
+
- `mintRolloutRows` reads `Trajectory.missingParents`: a line from a trace with a missing parent span keeps that span as a step, carries a `provenance.gap` naming how many spans are affected and is marked lossy, so training sinks exclude it. Each minted step carries the source `spanId` and, below a root, the `parentSpanId`; both are optional in `tangle.rollout.v1`, so earlier lines still validate.
|
|
37
|
+
- `jsonDocument` refuses a reference cycle with `LedgerCanonicalizationError`.
|
|
38
|
+
- `fix(harbor)`: a released case prunes its build records even when BuildKit reports them shared (#1298).
|
|
39
|
+
- Every campaign cell names its trace (#1309). `CampaignTraceWriter` gains an optional method `traceRef?(): SearchTraceRef`, and `CampaignCellResult` and `CampaignCellMeasurement` gain an optional `traceRef`. `runCampaign` reads `traceRef` once, after the attempt's final flush, and records it on the cell, on the failure receipt and in the cache, so a cached cell keeps the trace of the attempt that measured it. A writer without `traceRef`, or one that returns `{ unknown: <reason> }`, leaves the trace unknown with that reason. The default writer's trace id is the W3C id of `<runAttemptId>/<cellId>/attempt-<n>`; every span it writes carries it as `traceId`, and `traceRef` counts a span opened and never ended as dropped. Records written before this change have no `traceRef` and import as before. A caller must act on none of this: the fields and method are optional, and the cell's `traceRef` in the search ledger is now the real reference where it was unknown.
|
|
40
|
+
- `RunCampaignOptions.buildTraceWriter` is called with a third argument, the attempt (`runAttemptId` and `number`). A function that takes two parameters still works; a custom writer that wants its trace id derived from the attempt reads the third.
|
|
41
|
+
- An evaluation refused after it measured keeps its spend. When the GEPA or SkillOpt evaluation callback measures cells and then refuses (evidence no excerpt fits, no score for the case), the refusal observation carries `measurement` (only on `evaluation-failed`), `importExternalEvaluations` records those cells with their real tokens, cost and trace and an `evaluation-refused` outcome, and the failed evaluation is not cached, so a later request retries it. Before, the spend was lost. Observation logs written earlier import as before.
|
|
42
|
+
- Evidence over `maxEvidenceChars` is excerpted instead of refused. The judge notes, the error message and a text artifact keep their head and tail around an omitted-count marker, sharing the room the other fields leave. A described (non-string) artifact stays whole when the text fields alone can make room; otherwise it is sent as its excerpted JSON text, so a consumer of the evidence that expected a structured `artifact` must also accept a string there. Only a response whose scores, dimensions and ids alone exceed the bound is still refused. A caller that raised `maxEvidenceChars` to avoid the refusal can lower it again.
|
|
43
|
+
- `describeArtifact?` is accepted by `OptimizationMethodInput`, `CompareOptimizationMethodsOptions` and `SelfImproveOptions`, and forwarded through `selfImprove`, `compareOptimizationMethods` and the GEPA, SkillOpt and external-text methods, so every method's optimizer sees the same described evidence as the native proposer. A caller that already gave a method its own `describeArtifact` and now also passes one through `selfImprove`, `compareOptimizationMethods` or `OptimizationMethodInput` that is a different function gets an error naming the label (`describeArtifact is set both on the method and by its caller; set it once`) before the method runs: set it once, on the caller. The same function in both places is accepted.
|
|
44
|
+
- The maintainer skill, the public API census and the analyst benchmark pin are regenerated for these changes; tests for the removed head-only clip are deleted with it.
|
|
45
|
+
|
|
46
|
+
Commits in this release:
|
|
47
|
+
|
|
48
|
+
- chore(analyst): repin the benchmark implementation after merging main; format touched tests
|
|
49
|
+
- fix(campaign): read a run refusal's measurement without a dead kind check; repin analyst benchmark
|
|
50
|
+
- fix(campaign): name each cell's trace, keep a refused evaluation's spend, forward describeArtifact
|
|
51
|
+
- test(campaign): trace identity, refused-evaluation spend and describeArtifact forwarding
|
|
52
|
+
- chore(rl): regenerate the analyst pin and public API listing after merging main
|
|
53
|
+
- docs(skill): the maintainer skill states the current rules and routes multi-component optimization
|
|
54
|
+
- docs(rl): extractStepRewards states its context rule and its timing limit
|
|
55
|
+
- docs(census): regenerate the public API census with the rl step-reward exports
|
|
56
|
+
- chore(analyst): refresh the benchmark implementation pin for the canonical cycle refusal
|
|
57
|
+
- fix(rl): a step's context is what was observable when it started; pairs compare mean rewards
|
|
58
|
+
- test(rl): a realness-gated run behind a mean keeps its PRM row out
|
|
59
|
+
- chore(analyst): pin the benchmark implementation digest over the callback's measurement
|
|
60
|
+
- test(rl): contexts end at a step's start, pairs use mean reward, unknown tasks and cycles get no digest
|
|
61
|
+
- fix(campaign): native and external optimizers see the same cell evidence
|
|
62
|
+
- test(campaign): optimizers see the end of a long output and the same evidence
|
|
63
|
+
- fix(campaign): imported search cells carry the campaign cells that measured them
|
|
64
|
+
- test(campaign): imported search cells are the campaign cells that measured them
|
|
65
|
+
- fix(rollout): a minted line from a trace with a missing parent span says so
|
|
66
|
+
- feat(campaign): heldOutGate counts each independent unit once
|
|
67
|
+
- style(rl): keep the formatter's parentheses on the llm input default
|
|
68
|
+
- test(rollout): a minted line from a trace with a missing parent span carries no gap today
|
|
69
|
+
- fix(trajectory): keep orphan spans and draw the counterfactual prefix by span timing
|
|
70
|
+
- test(rl): the PRM exporter refuses a pipeline triple stripped of its context digest
|
|
71
|
+
- test(trajectory): orphan spans and a parallel counterfactual prefix fail today
|
|
72
|
+
- test(campaign): heldOutGate counts wakes from one historical run as one unit
|
|
73
|
+
- refactor(rl): a span's record is every field but identity, timing and accounting
|
|
74
|
+
- fix(rl): a process-reward pair is two actions taken in the same recorded context
|
|
75
|
+
- test(rl): a PRM row from two runs of different scenarios that share span names
|
|
76
|
+
- fix(harbor): a released case prunes its build records even when BuildKit reports them shared (#1298)
|
|
77
|
+
|
|
78
|
+
## [1.0.40] — 2026-11-18
|
|
79
|
+
|
|
80
|
+
- fix(cost): selfImprove, compareOptimizationMethods and trace analysts report agent spend the ledger missed (#1296)
|
|
81
|
+
|
|
7
82
|
## [1.0.39] — 2026-11-17
|
|
8
83
|
|
|
9
84
|
- fix(campaign): an executed cell with no agent receipt makes the run's cost unknown, not an observed $0 (#1294)
|
package/dist/adapters/http.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as CostReceipt } from "../cost-ledger-Czro9wmo.js";
|
|
2
|
-
import { R as Scenario, d as DispatchContext, f as DispatchFn } from "../types-
|
|
3
|
-
import "../index-
|
|
2
|
+
import { R as Scenario, d as DispatchContext, f as DispatchFn } from "../types-pMk2rgP9.js";
|
|
3
|
+
import "../index-FLyheOVA.js";
|
|
4
4
|
export interface HttpDispatchOptions<TScenario extends Scenario, _TArtifact> {
|
|
5
5
|
/** Static endpoint URL. Mutually exclusive with `resolveUrl`. */
|
|
6
6
|
url?: string;
|
|
@@ -1,171 +1,10 @@
|
|
|
1
|
-
import { f as CostReceiptInput, m as CustomTokenPricing } from "./cost-ledger-Czro9wmo.js";
|
|
2
|
-
import { Y as TraceAnalysisStore, i as AnalystFinding, m as EvidenceRef, p as AnalystUsageReceipt } from "./types-
|
|
1
|
+
import { d as CostReceipt, f as CostReceiptInput, m as CustomTokenPricing } from "./cost-ledger-Czro9wmo.js";
|
|
2
|
+
import { Y as TraceAnalysisStore, i as AnalystFinding, m as EvidenceRef, p as AnalystUsageReceipt } from "./types-BJ27EWAS.js";
|
|
3
3
|
import { A as ChatResponse, k as ChatRequest } from "./cluster-CSd0LE_M.js";
|
|
4
|
+
import { E as SearchExecutionIdentity, Q as SearchTaskOutcome, a as SearchAttemptAccounting, et as SearchTraceRef, j as SearchModelIdentity, z as SearchOperationRecordedEvent } from "./search-ledger-types-BhZE848w.js";
|
|
5
|
+
import { r as CampaignCellResult } from "./types-pMk2rgP9.js";
|
|
6
|
+
import { o as SearchCellResult } from "./search-kernel-CuTvZlPS.js";
|
|
4
7
|
import { AgentProfile, AgentProfile as AgentProfile$1, HarnessType, HarnessType as HarnessType$1 } from "@tangle-network/agent-interface";
|
|
5
|
-
interface ExternalOptimizerProcessLimits {
|
|
6
|
-
/** Maximum serialized input written for the child process. */
|
|
7
|
-
maxInputBytes: number;
|
|
8
|
-
/** Maximum JSON result read from the child process. */
|
|
9
|
-
maxResultBytes: number;
|
|
10
|
-
/** Maximum stdout or stderr characters retained for diagnostics. */
|
|
11
|
-
maxOutputChars: number;
|
|
12
|
-
}
|
|
13
|
-
declare const DEFAULT_EXTERNAL_OPTIMIZER_PROCESS_LIMITS: Readonly<ExternalOptimizerProcessLimits>;
|
|
14
|
-
interface ExternalOptimizerCallbackLimits {
|
|
15
|
-
/** Maximum serialized request accepted by the loopback callback. */
|
|
16
|
-
maxRequestBytes: number;
|
|
17
|
-
/** Maximum serialized response returned by the loopback callback. */
|
|
18
|
-
maxResponseBytes: number;
|
|
19
|
-
}
|
|
20
|
-
declare const DEFAULT_EXTERNAL_OPTIMIZER_CALLBACK_LIMITS: Readonly<ExternalOptimizerCallbackLimits>;
|
|
21
|
-
interface ExternalOptimizerRunnerCommand {
|
|
22
|
-
command?: string;
|
|
23
|
-
args?: readonly string[];
|
|
24
|
-
env?: NodeJS.ProcessEnv;
|
|
25
|
-
/** Child-process resource limits. Omitted fields use finite defaults. */
|
|
26
|
-
limits?: Partial<ExternalOptimizerProcessLimits>;
|
|
27
|
-
}
|
|
28
|
-
type ExternalOptimizerResumeMode = 'never' | 'if-compatible' | 'required';
|
|
29
|
-
type ExternalTextCandidate = string | Record<string, string>;
|
|
30
|
-
interface ExternalTextEvaluationRequest {
|
|
31
|
-
candidate: ExternalTextCandidate;
|
|
32
|
-
exampleId: string;
|
|
33
|
-
}
|
|
34
|
-
type DeepReadonly<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]>; } : T;
|
|
35
|
-
/** Provider-neutral request parsed once from the optimizer's loopback protocol. */
|
|
36
|
-
type ExternalOptimizerChatRequest = DeepReadonly<Omit<ChatRequest, 'model'> & {
|
|
37
|
-
model: string;
|
|
38
|
-
}>;
|
|
39
|
-
type ExternalOptimizerEndpointFormat = 'chat-completions' | 'responses' | 'anthropic-messages';
|
|
40
|
-
/** One exact model request admitted by the loopback proxy. */
|
|
41
|
-
interface ExternalOptimizerModelCallRequest {
|
|
42
|
-
/** Stable identity allocated by the cost ledger for this paid call. */
|
|
43
|
-
readonly callId: string;
|
|
44
|
-
/** Deeply immutable canonical request; HTTP protocol fields never cross this boundary. */
|
|
45
|
-
readonly request: ExternalOptimizerChatRequest;
|
|
46
|
-
/** Child response shape, when the execution owner needs to retain it as evidence. */
|
|
47
|
-
readonly endpointFormat?: ExternalOptimizerEndpointFormat;
|
|
48
|
-
readonly signal: AbortSignal;
|
|
49
|
-
}
|
|
50
|
-
/** Runtime-owned result for one admitted optimizer-model call. */
|
|
51
|
-
type ExternalOptimizerModelCallResult = {
|
|
52
|
-
readonly succeeded: true;
|
|
53
|
-
/** Canonical response encoded back into the child's protocol by Agent Eval. */
|
|
54
|
-
readonly response: ChatResponse;
|
|
55
|
-
/**
|
|
56
|
-
* Canonical measured usage/cost input retained by Agent Eval's cost ledger.
|
|
57
|
-
* `inputTokens` is the non-cached portion, `cachedTokens` is the cache-read
|
|
58
|
-
* portion, and response `promptTokens` equals their sum. Cache-write tokens
|
|
59
|
-
* remain a separately billed class and are never silently added to that total.
|
|
60
|
-
*/
|
|
61
|
-
readonly receipt: CostReceiptInput;
|
|
62
|
-
/** Opaque, finite JSON proof of the exact execution retained in provenance. */
|
|
63
|
-
readonly execution: unknown;
|
|
64
|
-
} | {
|
|
65
|
-
readonly succeeded: false;
|
|
66
|
-
/** Public failure text safe to retain and return to the child process. */
|
|
67
|
-
readonly error: string;
|
|
68
|
-
/** Usage/cost state for the failed Runtime call. Unknown values stay unknown. */
|
|
69
|
-
readonly receipt: CostReceiptInput;
|
|
70
|
-
/** Opaque, finite JSON proof of the failed exact execution. */
|
|
71
|
-
readonly execution: unknown;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Execution-neutral model-call seam for an external optimizer.
|
|
75
|
-
*
|
|
76
|
-
* The package that owns execution implements this with its exact execution
|
|
77
|
-
* path. For Discovery that owner is Runtime and the identity is an
|
|
78
|
-
* AgentProfile. The loopback proxy owns request validation, limits, response
|
|
79
|
-
* bounds, and cost-ledger recording. Once invoked, the callback must resolve
|
|
80
|
-
* with one success/failure result. Rejecting loses the execution record and
|
|
81
|
-
* therefore fails the optimizer attempt.
|
|
82
|
-
*/
|
|
83
|
-
type ExternalOptimizerModelCall = (request: ExternalOptimizerModelCallRequest) => Promise<ExternalOptimizerModelCallResult>;
|
|
84
|
-
/** One opaque Runtime execution record retained for one admitted model call. */
|
|
85
|
-
type ExternalOptimizerModelExecutionObservation = {
|
|
86
|
-
readonly sequence: number;
|
|
87
|
-
readonly callId: string;
|
|
88
|
-
readonly callRef: string;
|
|
89
|
-
readonly path: '/v1/chat/completions' | '/v1/responses' | '/v1/messages';
|
|
90
|
-
readonly model: string;
|
|
91
|
-
readonly succeeded: true;
|
|
92
|
-
readonly responseStatus: number;
|
|
93
|
-
readonly execution: unknown;
|
|
94
|
-
} | {
|
|
95
|
-
readonly sequence: number;
|
|
96
|
-
readonly callId: string;
|
|
97
|
-
readonly callRef: string;
|
|
98
|
-
readonly path: '/v1/chat/completions' | '/v1/responses' | '/v1/messages';
|
|
99
|
-
readonly model: string;
|
|
100
|
-
readonly succeeded: false;
|
|
101
|
-
readonly error: string;
|
|
102
|
-
readonly execution: unknown;
|
|
103
|
-
};
|
|
104
|
-
type ExternalOptimizerEvaluationRefusalReason = 'invalid-request' | 'evaluation-limit' | 'evaluation-failed';
|
|
105
|
-
/**
|
|
106
|
-
* Durable callback-side record of every candidate submitted for scoring,
|
|
107
|
-
* scored task, and callback refusal. Optimizer-internal proposals that never
|
|
108
|
-
* reach this callback are outside this record's scope.
|
|
109
|
-
*/
|
|
110
|
-
type ExternalOptimizerEvaluationObservation = {
|
|
111
|
-
readonly kind: 'proposal';
|
|
112
|
-
readonly sequence: number;
|
|
113
|
-
readonly candidate: ExternalTextCandidate;
|
|
114
|
-
readonly candidateHash: string;
|
|
115
|
-
} | {
|
|
116
|
-
readonly kind: 'evaluation';
|
|
117
|
-
readonly sequence: number;
|
|
118
|
-
readonly candidate: ExternalTextCandidate;
|
|
119
|
-
readonly candidateHash: string;
|
|
120
|
-
readonly exampleId: string;
|
|
121
|
-
/** One-based accepted evaluation number for this optimizer attempt. */
|
|
122
|
-
readonly evaluationNumber: number;
|
|
123
|
-
readonly response: unknown;
|
|
124
|
-
} | {
|
|
125
|
-
readonly kind: 'refusal';
|
|
126
|
-
readonly sequence: number;
|
|
127
|
-
readonly reason: ExternalOptimizerEvaluationRefusalReason;
|
|
128
|
-
readonly candidate?: ExternalTextCandidate;
|
|
129
|
-
readonly candidateHash?: string;
|
|
130
|
-
readonly exampleId?: string;
|
|
131
|
-
};
|
|
132
|
-
interface ExternalOptimizerModelBudget {
|
|
133
|
-
/** Optional optimizer-model spend ceiling, independent of task-evaluation spend. */
|
|
134
|
-
maxCostUsd?: number;
|
|
135
|
-
/** Maximum calls into the execution owner; owner-internal retries are reported there. */
|
|
136
|
-
maxRequests: number;
|
|
137
|
-
/** Reject a request body above this byte count. */
|
|
138
|
-
maxRequestBytes: number;
|
|
139
|
-
/** Reject a provider response above this byte count. */
|
|
140
|
-
maxResponseBytes: number;
|
|
141
|
-
/** Reject a request asking the provider for more output tokens. */
|
|
142
|
-
maxOutputTokensPerRequest: number;
|
|
143
|
-
/**
|
|
144
|
-
* Reasoning tokens a single response may bill beyond its completion limit.
|
|
145
|
-
*
|
|
146
|
-
* A reasoning model bounds only the completion by `max_tokens` and bills
|
|
147
|
-
* thinking on top, so a reservation sized to the completion alone is always
|
|
148
|
-
* too small and the ledger refuses the real charge. Callers that route a
|
|
149
|
-
* reasoning model declare its thinking budget here; the reservation covers
|
|
150
|
-
* it and a response exceeding it still fails loudly. Default: 0.
|
|
151
|
-
*/
|
|
152
|
-
maxReasoningTokensPerRequest?: number;
|
|
153
|
-
/**
|
|
154
|
-
* Optional rates used to estimate cost when the provider omits a valid
|
|
155
|
-
* `usage.cost`. Omit when billed USD is unknown; catalog estimates are not
|
|
156
|
-
* enforcement evidence.
|
|
157
|
-
*/
|
|
158
|
-
pricing?: CustomTokenPricing;
|
|
159
|
-
/** Per-provider-request deadline. Default: 300,000 ms. */
|
|
160
|
-
requestTimeoutMs?: number;
|
|
161
|
-
}
|
|
162
|
-
/** Per-wire request accounting for the loopback proxy. */
|
|
163
|
-
interface ExternalOptimizerWireCounts {
|
|
164
|
-
/** Execution-owner calls admitted on this wire, including failures. */
|
|
165
|
-
requestAttempts: number;
|
|
166
|
-
/** Successful 2xx responses recorded on this wire. */
|
|
167
|
-
successfulCompletions: number;
|
|
168
|
-
}
|
|
169
8
|
interface AnalystEvidenceExpectation {
|
|
170
9
|
uri: string;
|
|
171
10
|
kind?: EvidenceRef['kind'];
|
|
@@ -386,6 +225,246 @@ interface RunAnalystBenchmarkOptions<TInput> {
|
|
|
386
225
|
signal?: AbortSignal;
|
|
387
226
|
}
|
|
388
227
|
declare function runAnalystBenchmark<TInput>(options: RunAnalystBenchmarkOptions<TInput>): Promise<AnalystBenchmarkResult>;
|
|
228
|
+
/**
|
|
229
|
+
* The facts `cell-settled` records about one campaign cell, without its
|
|
230
|
+
* artifact. JSON-safe, so a producer that measures cells out of process (the
|
|
231
|
+
* external-optimizer evaluation callback) can keep them in its observation log
|
|
232
|
+
* and record them later through the same mapping as an in-process executor.
|
|
233
|
+
*/
|
|
234
|
+
interface CampaignCellMeasurement {
|
|
235
|
+
/** The campaign's cell id, `<scenarioId>:<rep>`; unique within one campaign only. */
|
|
236
|
+
cellId: string;
|
|
237
|
+
scenarioId: string;
|
|
238
|
+
rep: number;
|
|
239
|
+
/** The attempt that produced the result; null on a historical cached record without one. */
|
|
240
|
+
attempt: {
|
|
241
|
+
runAttemptId: string;
|
|
242
|
+
number: number;
|
|
243
|
+
} | null;
|
|
244
|
+
/** runCampaign read this result from its cache instead of dispatching it. */
|
|
245
|
+
cached: boolean;
|
|
246
|
+
outcome: SearchTaskOutcome;
|
|
247
|
+
accounting: SearchAttemptAccounting;
|
|
248
|
+
/** The model every agent receipt in the cell reported; absent for none or several. */
|
|
249
|
+
resolvedModel?: string;
|
|
250
|
+
durationMs: number;
|
|
251
|
+
/** The trace the measuring attempt's spans went to, or unknown with the
|
|
252
|
+
* reason. Absent in observation logs written before cells carried it. */
|
|
253
|
+
traceRef?: SearchTraceRef;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Project a campaign cell onto what `cell-settled` records: `passed` with the
|
|
257
|
+
* composite, each judge's composite and each judge dimension when every judge
|
|
258
|
+
* scored it, else `errored`, never retryable, because `runCampaign` already
|
|
259
|
+
* applied its own retry policy; its tokens and cost, with an uncaptured cost
|
|
260
|
+
* kept as a lower bound; the attempt that produced it and the trace its spans
|
|
261
|
+
* went to.
|
|
262
|
+
*/
|
|
263
|
+
declare function campaignCellMeasurement<TArtifact>(cell: CampaignCellResult<TArtifact>): CampaignCellMeasurement;
|
|
264
|
+
/**
|
|
265
|
+
* What `cell-settled` records for one campaign cell, or for its measurement:
|
|
266
|
+
* the outcome and accounting of `campaignCellMeasurement`, the model the cell
|
|
267
|
+
* resolved, else the declared one, its duration, and the trace its trace
|
|
268
|
+
* writer named. A cell or measurement recorded before cells carried a trace
|
|
269
|
+
* keeps an unknown reference that names the attempt whose trace writer
|
|
270
|
+
* received its spans.
|
|
271
|
+
*/
|
|
272
|
+
declare function campaignCellSearchResult<TArtifact>(cell: CampaignCellResult<TArtifact> | CampaignCellMeasurement, input: {
|
|
273
|
+
execution: SearchExecutionIdentity;
|
|
274
|
+
lane: string;
|
|
275
|
+
}): SearchCellResult;
|
|
276
|
+
/** A provider-reported model: a snapshot when its name pins one, else a moving alias. */
|
|
277
|
+
declare function searchModelIdentity(model: string, provider: string): SearchModelIdentity;
|
|
278
|
+
/** The accounting of a proposal's cost receipts: token and dollar sums, each
|
|
279
|
+
* unknown (with the known dollars as a lower bound) when a receipt lacks it. */
|
|
280
|
+
declare function searchReceiptAccounting(receipts: ReadonlyArray<CostReceipt>): SearchAttemptAccounting;
|
|
281
|
+
/** What ran a proposal: a model when it made a paid call other than a judge's,
|
|
282
|
+
* else deterministic code. */
|
|
283
|
+
declare function searchProposalExecution(receipts: ReadonlyArray<CostReceipt>, provider: string, source: SearchOperationRecordedEvent['execution']['source']): SearchOperationRecordedEvent['execution'];
|
|
284
|
+
interface ExternalOptimizerProcessLimits {
|
|
285
|
+
/** Maximum serialized input written for the child process. */
|
|
286
|
+
maxInputBytes: number;
|
|
287
|
+
/** Maximum JSON result read from the child process. */
|
|
288
|
+
maxResultBytes: number;
|
|
289
|
+
/** Maximum stdout or stderr characters retained for diagnostics. */
|
|
290
|
+
maxOutputChars: number;
|
|
291
|
+
}
|
|
292
|
+
declare const DEFAULT_EXTERNAL_OPTIMIZER_PROCESS_LIMITS: Readonly<ExternalOptimizerProcessLimits>;
|
|
293
|
+
interface ExternalOptimizerCallbackLimits {
|
|
294
|
+
/** Maximum serialized request accepted by the loopback callback. */
|
|
295
|
+
maxRequestBytes: number;
|
|
296
|
+
/** Maximum serialized response returned by the loopback callback. */
|
|
297
|
+
maxResponseBytes: number;
|
|
298
|
+
}
|
|
299
|
+
declare const DEFAULT_EXTERNAL_OPTIMIZER_CALLBACK_LIMITS: Readonly<ExternalOptimizerCallbackLimits>;
|
|
300
|
+
interface ExternalOptimizerRunnerCommand {
|
|
301
|
+
command?: string;
|
|
302
|
+
args?: readonly string[];
|
|
303
|
+
env?: NodeJS.ProcessEnv;
|
|
304
|
+
/** Child-process resource limits. Omitted fields use finite defaults. */
|
|
305
|
+
limits?: Partial<ExternalOptimizerProcessLimits>;
|
|
306
|
+
}
|
|
307
|
+
type ExternalOptimizerResumeMode = 'never' | 'if-compatible' | 'required';
|
|
308
|
+
type ExternalTextCandidate = string | Record<string, string>;
|
|
309
|
+
interface ExternalTextEvaluationRequest {
|
|
310
|
+
candidate: ExternalTextCandidate;
|
|
311
|
+
exampleId: string;
|
|
312
|
+
}
|
|
313
|
+
type DeepReadonly<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]>; } : T;
|
|
314
|
+
/** Provider-neutral request parsed once from the optimizer's loopback protocol. */
|
|
315
|
+
type ExternalOptimizerChatRequest = DeepReadonly<Omit<ChatRequest, 'model'> & {
|
|
316
|
+
model: string;
|
|
317
|
+
}>;
|
|
318
|
+
type ExternalOptimizerEndpointFormat = 'chat-completions' | 'responses' | 'anthropic-messages';
|
|
319
|
+
/** One exact model request admitted by the loopback proxy. */
|
|
320
|
+
interface ExternalOptimizerModelCallRequest {
|
|
321
|
+
/** Stable identity allocated by the cost ledger for this paid call. */
|
|
322
|
+
readonly callId: string;
|
|
323
|
+
/** Deeply immutable canonical request; HTTP protocol fields never cross this boundary. */
|
|
324
|
+
readonly request: ExternalOptimizerChatRequest;
|
|
325
|
+
/** Child response shape, when the execution owner needs to retain it as evidence. */
|
|
326
|
+
readonly endpointFormat?: ExternalOptimizerEndpointFormat;
|
|
327
|
+
readonly signal: AbortSignal;
|
|
328
|
+
}
|
|
329
|
+
/** Runtime-owned result for one admitted optimizer-model call. */
|
|
330
|
+
type ExternalOptimizerModelCallResult = {
|
|
331
|
+
readonly succeeded: true;
|
|
332
|
+
/** Canonical response encoded back into the child's protocol by Agent Eval. */
|
|
333
|
+
readonly response: ChatResponse;
|
|
334
|
+
/**
|
|
335
|
+
* Canonical measured usage/cost input retained by Agent Eval's cost ledger.
|
|
336
|
+
* `inputTokens` is the non-cached portion, `cachedTokens` is the cache-read
|
|
337
|
+
* portion, and response `promptTokens` equals their sum. Cache-write tokens
|
|
338
|
+
* remain a separately billed class and are never silently added to that total.
|
|
339
|
+
*/
|
|
340
|
+
readonly receipt: CostReceiptInput;
|
|
341
|
+
/** Opaque, finite JSON proof of the exact execution retained in provenance. */
|
|
342
|
+
readonly execution: unknown;
|
|
343
|
+
} | {
|
|
344
|
+
readonly succeeded: false;
|
|
345
|
+
/** Public failure text safe to retain and return to the child process. */
|
|
346
|
+
readonly error: string;
|
|
347
|
+
/** Usage/cost state for the failed Runtime call. Unknown values stay unknown. */
|
|
348
|
+
readonly receipt: CostReceiptInput;
|
|
349
|
+
/** Opaque, finite JSON proof of the failed exact execution. */
|
|
350
|
+
readonly execution: unknown;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Execution-neutral model-call seam for an external optimizer.
|
|
354
|
+
*
|
|
355
|
+
* The package that owns execution implements this with its exact execution
|
|
356
|
+
* path. For Discovery that owner is Runtime and the identity is an
|
|
357
|
+
* AgentProfile. The loopback proxy owns request validation, limits, response
|
|
358
|
+
* bounds, and cost-ledger recording. Once invoked, the callback must resolve
|
|
359
|
+
* with one success/failure result. Rejecting loses the execution record and
|
|
360
|
+
* therefore fails the optimizer attempt.
|
|
361
|
+
*/
|
|
362
|
+
type ExternalOptimizerModelCall = (request: ExternalOptimizerModelCallRequest) => Promise<ExternalOptimizerModelCallResult>;
|
|
363
|
+
/** One opaque Runtime execution record retained for one admitted model call. */
|
|
364
|
+
type ExternalOptimizerModelExecutionObservation = {
|
|
365
|
+
readonly sequence: number;
|
|
366
|
+
readonly callId: string;
|
|
367
|
+
readonly callRef: string;
|
|
368
|
+
readonly path: '/v1/chat/completions' | '/v1/responses' | '/v1/messages';
|
|
369
|
+
readonly model: string;
|
|
370
|
+
readonly succeeded: true;
|
|
371
|
+
readonly responseStatus: number;
|
|
372
|
+
readonly execution: unknown;
|
|
373
|
+
} | {
|
|
374
|
+
readonly sequence: number;
|
|
375
|
+
readonly callId: string;
|
|
376
|
+
readonly callRef: string;
|
|
377
|
+
readonly path: '/v1/chat/completions' | '/v1/responses' | '/v1/messages';
|
|
378
|
+
readonly model: string;
|
|
379
|
+
readonly succeeded: false;
|
|
380
|
+
readonly error: string;
|
|
381
|
+
readonly execution: unknown;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Which campaign cells answered one evaluation request. `measured`: this
|
|
385
|
+
* request ran them. `reused`: an earlier request for the same candidate and
|
|
386
|
+
* case ran them, and this one was answered from its result. The search ledger
|
|
387
|
+
* records each distinct cell once, so a reused request adds no cell.
|
|
388
|
+
*/
|
|
389
|
+
interface ExternalEvaluationMeasurement {
|
|
390
|
+
readonly source: 'measured' | 'reused';
|
|
391
|
+
readonly cells: readonly CampaignCellMeasurement[];
|
|
392
|
+
}
|
|
393
|
+
type ExternalOptimizerEvaluationRefusalReason = 'invalid-request' | 'evaluation-limit' | 'evaluation-failed';
|
|
394
|
+
/**
|
|
395
|
+
* Durable callback-side record of every candidate submitted for scoring,
|
|
396
|
+
* scored task, and callback refusal. Optimizer-internal proposals that never
|
|
397
|
+
* reach this callback are outside this record's scope.
|
|
398
|
+
*/
|
|
399
|
+
type ExternalOptimizerEvaluationObservation = {
|
|
400
|
+
readonly kind: 'proposal';
|
|
401
|
+
readonly sequence: number;
|
|
402
|
+
readonly candidate: ExternalTextCandidate;
|
|
403
|
+
readonly candidateHash: string;
|
|
404
|
+
} | {
|
|
405
|
+
readonly kind: 'evaluation';
|
|
406
|
+
readonly sequence: number;
|
|
407
|
+
readonly candidate: ExternalTextCandidate;
|
|
408
|
+
readonly candidateHash: string;
|
|
409
|
+
readonly exampleId: string;
|
|
410
|
+
/** One-based accepted evaluation number for this optimizer attempt. */
|
|
411
|
+
readonly evaluationNumber: number;
|
|
412
|
+
readonly response: unknown;
|
|
413
|
+
/** The campaign cells behind `response`. Absent in logs written before
|
|
414
|
+
* the callback recorded them, and for an evaluator that reports none. */
|
|
415
|
+
readonly measurement?: ExternalEvaluationMeasurement;
|
|
416
|
+
} | {
|
|
417
|
+
readonly kind: 'refusal';
|
|
418
|
+
readonly sequence: number;
|
|
419
|
+
readonly reason: ExternalOptimizerEvaluationRefusalReason;
|
|
420
|
+
readonly candidate?: ExternalTextCandidate;
|
|
421
|
+
readonly candidateHash?: string;
|
|
422
|
+
readonly exampleId?: string;
|
|
423
|
+
/** The campaign cells an `evaluation-failed` refusal measured before it
|
|
424
|
+
* was refused, such as evidence no excerpt fits the bound; their spend
|
|
425
|
+
* is real. When the evaluation's campaign threw, these are the cells it
|
|
426
|
+
* settled, then each cell the throw interrupted, whose accounting is
|
|
427
|
+
* unknown. Absent for a refusal that measured nothing, and in logs
|
|
428
|
+
* written before refusals recorded them. */
|
|
429
|
+
readonly measurement?: ExternalEvaluationMeasurement;
|
|
430
|
+
};
|
|
431
|
+
interface ExternalOptimizerModelBudget {
|
|
432
|
+
/** Optional optimizer-model spend ceiling, independent of task-evaluation spend. */
|
|
433
|
+
maxCostUsd?: number;
|
|
434
|
+
/** Maximum calls into the execution owner; owner-internal retries are reported there. */
|
|
435
|
+
maxRequests: number;
|
|
436
|
+
/** Reject a request body above this byte count. */
|
|
437
|
+
maxRequestBytes: number;
|
|
438
|
+
/** Reject a provider response above this byte count. */
|
|
439
|
+
maxResponseBytes: number;
|
|
440
|
+
/** Reject a request asking the provider for more output tokens. */
|
|
441
|
+
maxOutputTokensPerRequest: number;
|
|
442
|
+
/**
|
|
443
|
+
* Reasoning tokens a single response may bill beyond its completion limit.
|
|
444
|
+
*
|
|
445
|
+
* A reasoning model bounds only the completion by `max_tokens` and bills
|
|
446
|
+
* thinking on top, so a reservation sized to the completion alone is always
|
|
447
|
+
* too small and the ledger refuses the real charge. Callers that route a
|
|
448
|
+
* reasoning model declare its thinking budget here; the reservation covers
|
|
449
|
+
* it and a response exceeding it still fails loudly. Default: 0.
|
|
450
|
+
*/
|
|
451
|
+
maxReasoningTokensPerRequest?: number;
|
|
452
|
+
/**
|
|
453
|
+
* Optional rates used to estimate cost when the provider omits a valid
|
|
454
|
+
* `usage.cost`. Omit when billed USD is unknown; catalog estimates are not
|
|
455
|
+
* enforcement evidence.
|
|
456
|
+
*/
|
|
457
|
+
pricing?: CustomTokenPricing;
|
|
458
|
+
/** Per-provider-request deadline. Default: 300,000 ms. */
|
|
459
|
+
requestTimeoutMs?: number;
|
|
460
|
+
}
|
|
461
|
+
/** Per-wire request accounting for the loopback proxy. */
|
|
462
|
+
interface ExternalOptimizerWireCounts {
|
|
463
|
+
/** Execution-owner calls admitted on this wire, including failures. */
|
|
464
|
+
requestAttempts: number;
|
|
465
|
+
/** Successful 2xx responses recorded on this wire. */
|
|
466
|
+
successfulCompletions: number;
|
|
467
|
+
}
|
|
389
468
|
/**
|
|
390
469
|
* The agentic coding harnesses an eval sweeps by default — the ones we care about
|
|
391
470
|
* ranking. This is the SINGLE source of that list; consumers import it instead of
|
|
@@ -465,5 +544,5 @@ declare function agentProfileId(profile: AgentProfile): string;
|
|
|
465
544
|
* as absent; explicit `null` fields remain hash-bearing.
|
|
466
545
|
*/
|
|
467
546
|
declare function agentProfileHash(profile: AgentProfile): string;
|
|
468
|
-
export {
|
|
469
|
-
//# sourceMappingURL=agent-profile-
|
|
547
|
+
export { RunAnalystBenchmarkOptions as $, campaignCellMeasurement as A, AnalystBenchmarkObservation as B, ExternalOptimizerProcessLimits as C, ExternalTextCandidate as D, ExternalOptimizerWireCounts as E, AnalystBenchmarkCase as F, AnalystBenchmarkSummary as G, AnalystBenchmarkProvenance as H, AnalystBenchmarkDatasetRef as I, AnalystEvidenceResolutionError as J, AnalystEvidenceExpectation as K, AnalystBenchmarkDescriptor as L, searchModelIdentity as M, searchProposalExecution as N, ExternalTextEvaluationRequest as O, searchReceiptAccounting as P, AnalystLatencyDistribution as Q, AnalystBenchmarkError as R, ExternalOptimizerModelExecutionObservation as S, ExternalOptimizerRunnerCommand as T, AnalystBenchmarkResult as U, AnalystBenchmarkOutput as V, AnalystBenchmarkRunner as W, AnalystFindingScore as X, AnalystEvidenceResolver as Y, AnalystIssueExpectation as Z, ExternalOptimizerEvaluationRefusalReason as _, ProfileAxisSpec as a, ExternalOptimizerModelCallRequest as b, expandProfileAxes as c, DEFAULT_EXTERNAL_OPTIMIZER_PROCESS_LIMITS as d, runAnalystBenchmark as et, ExternalEvaluationMeasurement as f, ExternalOptimizerEvaluationObservation as g, ExternalOptimizerEndpointFormat as h, HarnessType$1 as i, campaignCellSearchResult as j, CampaignCellMeasurement as k, harnessAxisOf as l, ExternalOptimizerChatRequest as m, CODING_HARNESSES as n, agentProfileHash as o, ExternalOptimizerCallbackLimits as p, AnalystEvidenceResolution as q, HARNESS_NATIVE_MODEL as r, agentProfileId as s, AgentProfile$1 as t, traceStoreEvidenceResolver as tt, DEFAULT_EXTERNAL_OPTIMIZER_CALLBACK_LIMITS as u, ExternalOptimizerModelBudget as v, ExternalOptimizerResumeMode as w, ExternalOptimizerModelCallResult as x, ExternalOptimizerModelCall as y, AnalystBenchmarkLabelState as z };
|
|
548
|
+
//# sourceMappingURL=agent-profile-BSgtn-k-.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-profile-BSgtn-k-.d.ts","names":["_$___cost_ledger0.CostReceiptInput"],"sources":["../src/analyst/benchmark.ts","../src/campaign/search-campaign-cell.ts","../src/campaign/external-optimizer-contracts.ts","../src/agent-profile.ts"],"mappings":";;;;;;;UAUiB;EACf;EACA,OAAO;;UAGQ;EACf;EACA;EACA;EACA;EACA,oBAAoB;EACpB;;EAEA,4BAA4B;;KAGlB;UAEK,qBAAqB;EACpC;;EAEA;;EAEA,YAAY;EACZ,OAAO;EACP,yBAAyB;;EAEzB,2BAA2B;EAC3B;EACA,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA,mBAAmB;EACnB;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;EACA;;UAGe;EACf,UAAU;EACV;EACA;;UAGe;EACf;EACA;EACA,oBAAoB;EACpB,QAAQ;;EAER;;KAGU,wBAAwB,qBAAqB;EACvD;EACA,WAAW;EACX,UAAU;EACV,SAAS;gBACK;;;;;iBAMA,2BAA2B,QACzC,WAAW,OAAO,WAAW,qBAC5B,wBAAwB;UAoBV;EACf,mBAAmB;EACnB,QAAQ;EACR,WAAW;;;;;EAKX;;EAEA,QAAQ;;UAGO;EACf;EACA;EACA;EACA;;UAGe,uBAAuB;EACtC;EACA,QACE,OAAO,QACP;IAAW;IAAgB;IAAoB,SAAS;MACvD,yBAAyB,QAAQ;;UAGrB;EACf;EACA;EACA;EACA,YAAY;EACZ;EACA;EACA;EACA;EACA,mBAAmB;EACnB,OAAO;EACP,qBAAqB;EACrB;EACA,eAAe;EACf,QAAQ;EACR,iBAAiB;EACjB,QAAQ;;UAGO;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA,UAAU;EACV;EACA,cAAc;EACd,WAAW;;UAGI,mCAAmC;EAClD;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,YAAY;EACZ,cAAc;EACd,WAAW;;UAGI,2BAA2B;EAC1C,gBAAgB,qBAAqB;EACrC,kBAAkB,uBAAuB;EACzC;EACA;EACA;EACA,kBAAkB,wBAAwB;EAC1C,YAAY;;EAEZ,+BAA+B;EAC/B,iBAAiB,aAAa,uCAAuC;EACrE,SAAS;;iBAGW,oBAAoB,QACxC,SAAS,2BAA2B,UACnC,QAAQ;;;;;;;UC9OM;;EAEf;EACA;EACA;;EAEA;IAAW;IAAsB;;;EAEjC;EACA,SAAS;EACT,YAAY;;EAEZ;EACA;;;EAGA,WAAW;;;;;;;;;;iBAWG,wBAAwB,WACtC,MAAM,mBAAmB,aACxB;;;;;;;;;iBAyBa,yBAAyB,WACvC,MAAM,mBAAmB,aAAa,yBACtC;EAAS,WAAW;EAAyB;IAC5C;;iBA8Ba,oBAAoB,eAAe,mBAAmB;;;iBAkEtD,wBACd,UAAU,cAAc,eACvB;;;iBA+Ba,wBACd,UAAU,cAAc,cACxB,kBACA,QAAQ,sDACP;UC/Mc;;EAEf;;EAEA;;EAEA;;cAGW,2CAA2C,SAAS;UAOhD;;EAEf;;EAEA;;cAGW,4CAA4C,SAAS;UAMjD;EACf;EACA;EACA,MAAM,OAAO;;EAEb,SAAS,QAAQ;;KAGP;KAEA,iCAAiC;UAE5B;EACf,WAAW;EACX;;KAqDG,aAAa,KAAK,eAAc,6BACjC,IACA,0BAA0B,gBACf,aAAa,OACtB,+BACc,WAAW,IAAI,aAAa,EAAE,SAC1C;;KAGI,+BAA+B,aACzC,KAAK;EAA0B;;KAGrB;;UAMK;;WAEN;;WAEA,SAAS;;WAET,iBAAiB;WACjB,QAAQ;;;KAIP;WAEG;;WAEA,UAAU;;;;;;;WAOV,SAPUA;;WASV;;WAGA;;WAEA;;WAEA,SATkCA;;WAWlC;;;;;;;;;;;;KAaH,8BACV,SAAS,sCACN,QAAQ;;KAGD;WAEG;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAGA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;;;;UASE;WACN;WACA,gBAAgB;;KAGf;;;;;;KAUA;WAEG;WACA;WACA,WAAW;WACX;;WAGA;WACA;WACA,WAAW;WACX;WACA;;WAEA;WACA;;;WAGA,cAAc;;WAGd;WACA;WACA,QAAQ;WACR,YAAY;WACZ;WACA;;;;;;;WAOA,cAAc;;UAGZ;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;EAUA;;;;;;EAMA,UAAU;;EAEV;;;UAIe;;EAEf;;EAEA;;;;;;;;;cCzRW,2BAA2B;UAOvB;;;EAGf,MAAM;;EAEN,qBAAqB;;;EAGrB;;;;;;EAMA;;;;;;;cAQW;;;;;;;;;;;;;;;;;;;iBAoBG,kBAAkB,MAAM,kBAAkB;;;;;;;;iBAkD1C,cACd,SAAS,KAAK;EACX,SAAS;EAAa;;;;;;;;;iBAiBX,eAAe,SAAS;;;;;;;;;;;iBAmDxB,iBAAiB,SAAS"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as ValidationError } from "./errors-DeEEV9Vx.js";
|
|
2
|
-
import { r as canonicalString } from "./canonical-
|
|
2
|
+
import { r as canonicalString } from "./canonical-DKgL_Wby.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { harnessSupportsModel } from "@tangle-network/agent-interface";
|
|
5
5
|
// src/agent-profile.ts
|
|
@@ -150,4 +150,4 @@ function agentProfileHash(profile) {
|
|
|
150
150
|
}
|
|
151
151
|
export { agentProfileModelId as a, agentProfileId as i, HARNESS_NATIVE_MODEL as n, expandProfileAxes as o, agentProfileHash as r, harnessAxisOf as s, CODING_HARNESSES as t };
|
|
152
152
|
|
|
153
|
-
//# sourceMappingURL=agent-profile-
|
|
153
|
+
//# sourceMappingURL=agent-profile-CCw6EXWW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-profile-DgbRJpSi.js","names":[],"sources":["../src/agent-profile.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\nimport type { AgentProfile } from '@tangle-network/agent-interface'\nimport { type HarnessType, harnessSupportsModel } from '@tangle-network/agent-interface'\nimport { ValidationError } from './errors'\nimport { canonicalString } from './ledger-core/canonical'\n\nexport type { AgentProfile, HarnessType } from '@tangle-network/agent-interface'\n\n/**\n * The agentic coding harnesses an eval sweeps by default — the ones we care about\n * ranking. This is the SINGLE source of that list; consumers import it instead of\n * re-declaring their own (a re-declared list is how the fleet drifts). Pass an\n * explicit `harnesses` (e.g. `harnessTypeSchema.options` for literally every known\n * harness) to widen beyond these.\n */\nexport const CODING_HARNESSES: readonly HarnessType[] = [\n 'opencode',\n 'claude-code',\n 'codex',\n 'kimi-code',\n]\n\nexport interface ProfileAxisSpec {\n /** The domain profile to sweep. Its prompt/tools/skills are held fixed; only the\n * harness and model vary. `model.default` is the fallback model. */\n base: AgentProfile\n /** Harnesses to cross. Default: {@link CODING_HARNESSES}. */\n harnesses?: readonly HarnessType[]\n /** Models to cross. Default: `[base.model.default]` — one model, i.e. today's\n * single-model behaviour, so omitting this never changes an existing run. */\n models?: readonly string[]\n /** Force every (harness, model) pair verbatim, even ones the harness can't run —\n * for deliberately testing failure modes. Default (false): SNAP instead — a\n * vendor-locked harness runs only the swept models in its family, or its native\n * default when it supports none, so no harness is dropped and none gets a\n * guaranteed-failing foreign-model cell. */\n keepIncompatible?: boolean\n}\n\n/** Model sentinel for a vendor-locked harness that supports none of the swept models:\n * it carries no provider prefix, so `harnessSupportsModel` accepts it and the harness\n * resolves it to its own native default model at runtime. Lets `expandProfileAxes`\n * snap-instead-of-drop without a per-harness flagship table that would rot as router\n * catalogs change. */\nexport const HARNESS_NATIVE_MODEL = 'default'\n\n/**\n * Expand a base profile across the harness × model matrix into the `AgentProfile[]`\n * that `runProfileMatrix` / `selfImprove` score — the ONE place \"which harnesses ×\n * which models do we evaluate\" lives, so no product hand-rolls its own harness list\n * or column→profile mapping (the pattern that let those copies drift and silently\n * break the harness pivot).\n *\n * Each cell clones `base`, sets the canonical top-level `harness` and `model.default`,\n * and stamps `metadata.harness` + `metadata.harnessModel` for matrix grouping. Both\n * metadata fields are hash-bearing, so every cell gets a distinct `agentProfileId` row\n * and results join back by harness/model via {@link harnessAxisOf} with no\n * hand-recomputed key. A vendor-locked harness snaps to its family's swept models — or\n * its native default ({@link HARNESS_NATIVE_MODEL}) when it supports none — so every\n * requested harness runs; `keepIncompatible` forces every pair verbatim.\n *\n * Omit `harnesses`/`models` to sweep the full default set — the \"turn it on for\n * everything we care about\" switch, identical in shape whether one harness or all.\n */\nexport function expandProfileAxes(spec: ProfileAxisSpec): AgentProfile[] {\n const harnesses = spec.harnesses ?? CODING_HARNESSES\n if (harnesses.length === 0) throw new ValidationError('expandProfileAxes: no harnesses to sweep')\n const baseModel = spec.base.model?.default\n const models = spec.models ?? (baseModel ? [baseModel] : [])\n if (models.length === 0) {\n throw new ValidationError(\n 'expandProfileAxes: no models to sweep — base profile has no model.default and none were supplied',\n )\n }\n const out: AgentProfile[] = []\n const seen = new Set<string>()\n for (const harness of harnesses) {\n // Keep each requested harness on supported models, or its native default when none fit.\n // `keepIncompatible` forces every (harness, model) pair verbatim (failure-mode runs).\n const supported = spec.keepIncompatible\n ? models\n : models.filter((model) => harnessSupportsModel(harness, model))\n const effective = supported.length > 0 ? supported : [HARNESS_NATIVE_MODEL]\n for (const model of effective) {\n const profile: AgentProfile = {\n ...spec.base,\n harness,\n name: `${spec.base.name ?? 'agent'}/${harness}/${model}`,\n model: { ...spec.base.model, default: model },\n metadata: { ...(spec.base.metadata ?? {}), harness, harnessModel: model },\n }\n const id = agentProfileId(profile)\n if (seen.has(id)) continue\n seen.add(id)\n out.push(profile)\n }\n }\n if (out.length === 0) {\n // Unreachable in normal use — snapping guarantees ≥1 cell per harness — but keep a\n // fail-closed guard so a future refactor can't silently produce an empty sweep.\n throw new ValidationError(\n `expandProfileAxes: produced no profiles (harnesses=[${harnesses.join(', ')}], models=[${models.join(', ')}]).`,\n )\n }\n return out\n}\n\n/**\n * Read the (harness, model) a matrix cell ran under, off a profile or a result row's\n * profile — the join-back for a `byHarness` pivot. Returns undefined when the profile\n * wasn't produced by {@link expandProfileAxes}. Callers group `result.byProfile` by\n * this instead of recomputing an id (recomputing the wrong key is what broke the pivot\n * in the hand-rolled copies).\n */\nexport function harnessAxisOf(\n profile: Pick<AgentProfile, 'metadata'>,\n): { harness: HarnessType; model: string } | undefined {\n const m = profile.metadata as Record<string, unknown> | undefined\n const harness = m?.harness\n const model = m?.harnessModel\n if (typeof harness === 'string' && typeof model === 'string') {\n return { harness: harness as HarnessType, model }\n }\n return undefined\n}\n\n/**\n * Collision-resistant, path-safe, human-readable profile id for eval artifacts.\n * Scorecard joins still use `agentProfileHash`; this id is for run ids, matrix\n * keys, and directory names where two profiles must not collapse onto one row.\n * The suffix is the first 64 bits of the behaviour hash, enough for ordinary\n * eval matrices while keeping filenames readable.\n */\nexport function agentProfileId(profile: AgentProfile): string {\n const label = pathSafeProfileLabel(agentProfileDisplayLabel(profile)) ?? 'profile'\n return `${label}-${agentProfileHash(profile).slice(0, 16)}`\n}\n\n/**\n * Model snapshot used for `RunRecord.model`. Eval surfaces require a concrete\n * model id because run records reject bare/missing model aliases.\n */\nexport function agentProfileModelId(profile: AgentProfile): string {\n const model = profile.model?.default?.trim()\n if (!model) {\n const label = agentProfileDisplayLabel(profile) ?? 'unnamed profile'\n throw new ValidationError(\n `AgentProfile \"${label}\" has no model.default — cannot record eval run`,\n )\n }\n return model\n}\n\nfunction agentProfileDisplayLabel(profile: AgentProfile): string | undefined {\n return profile.name?.trim() || profile.version?.trim() || undefined\n}\n\nfunction pathSafeProfileLabel(label: string | undefined): string | undefined {\n const safe = label\n ?.trim()\n .replace(/[^A-Za-z0-9._-]+/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n return safe || undefined\n}\n\nfunction compact<T extends Record<string, unknown>>(input: T): Partial<T> {\n const out: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(input)) {\n if (value !== undefined) out[key] = value\n }\n return out as Partial<T>\n}\n\n/**\n * Deterministic behaviour identity for the canonical\n * `@tangle-network/agent-interface` AgentProfile.\n *\n * `name` and `description` are labels and do not affect the hash. Profile\n * `version`, prompt, model hints, tools, resources, hooks, modes, permissions,\n * and extensions do affect the hash. Resource array order is hash-bearing\n * because mount order can change agent behaviour. Undefined fields are treated\n * as absent; explicit `null` fields remain hash-bearing.\n */\nexport function agentProfileHash(profile: AgentProfile): string {\n const model = agentProfileModelId(profile)\n const behaviour = compact({\n ...profile,\n name: undefined,\n description: undefined,\n tags: profile.tags ? [...profile.tags].sort() : undefined,\n model: compact({ ...profile.model, default: model }),\n })\n return createHash('sha256').update(canonicalString(behaviour)).digest('hex')\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"agent-profile-CCw6EXWW.js","names":[],"sources":["../src/agent-profile.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\nimport type { AgentProfile } from '@tangle-network/agent-interface'\nimport { type HarnessType, harnessSupportsModel } from '@tangle-network/agent-interface'\nimport { ValidationError } from './errors'\nimport { canonicalString } from './ledger-core/canonical'\n\nexport type { AgentProfile, HarnessType } from '@tangle-network/agent-interface'\n\n/**\n * The agentic coding harnesses an eval sweeps by default — the ones we care about\n * ranking. This is the SINGLE source of that list; consumers import it instead of\n * re-declaring their own (a re-declared list is how the fleet drifts). Pass an\n * explicit `harnesses` (e.g. `harnessTypeSchema.options` for literally every known\n * harness) to widen beyond these.\n */\nexport const CODING_HARNESSES: readonly HarnessType[] = [\n 'opencode',\n 'claude-code',\n 'codex',\n 'kimi-code',\n]\n\nexport interface ProfileAxisSpec {\n /** The domain profile to sweep. Its prompt/tools/skills are held fixed; only the\n * harness and model vary. `model.default` is the fallback model. */\n base: AgentProfile\n /** Harnesses to cross. Default: {@link CODING_HARNESSES}. */\n harnesses?: readonly HarnessType[]\n /** Models to cross. Default: `[base.model.default]` — one model, i.e. today's\n * single-model behaviour, so omitting this never changes an existing run. */\n models?: readonly string[]\n /** Force every (harness, model) pair verbatim, even ones the harness can't run —\n * for deliberately testing failure modes. Default (false): SNAP instead — a\n * vendor-locked harness runs only the swept models in its family, or its native\n * default when it supports none, so no harness is dropped and none gets a\n * guaranteed-failing foreign-model cell. */\n keepIncompatible?: boolean\n}\n\n/** Model sentinel for a vendor-locked harness that supports none of the swept models:\n * it carries no provider prefix, so `harnessSupportsModel` accepts it and the harness\n * resolves it to its own native default model at runtime. Lets `expandProfileAxes`\n * snap-instead-of-drop without a per-harness flagship table that would rot as router\n * catalogs change. */\nexport const HARNESS_NATIVE_MODEL = 'default'\n\n/**\n * Expand a base profile across the harness × model matrix into the `AgentProfile[]`\n * that `runProfileMatrix` / `selfImprove` score — the ONE place \"which harnesses ×\n * which models do we evaluate\" lives, so no product hand-rolls its own harness list\n * or column→profile mapping (the pattern that let those copies drift and silently\n * break the harness pivot).\n *\n * Each cell clones `base`, sets the canonical top-level `harness` and `model.default`,\n * and stamps `metadata.harness` + `metadata.harnessModel` for matrix grouping. Both\n * metadata fields are hash-bearing, so every cell gets a distinct `agentProfileId` row\n * and results join back by harness/model via {@link harnessAxisOf} with no\n * hand-recomputed key. A vendor-locked harness snaps to its family's swept models — or\n * its native default ({@link HARNESS_NATIVE_MODEL}) when it supports none — so every\n * requested harness runs; `keepIncompatible` forces every pair verbatim.\n *\n * Omit `harnesses`/`models` to sweep the full default set — the \"turn it on for\n * everything we care about\" switch, identical in shape whether one harness or all.\n */\nexport function expandProfileAxes(spec: ProfileAxisSpec): AgentProfile[] {\n const harnesses = spec.harnesses ?? CODING_HARNESSES\n if (harnesses.length === 0) throw new ValidationError('expandProfileAxes: no harnesses to sweep')\n const baseModel = spec.base.model?.default\n const models = spec.models ?? (baseModel ? [baseModel] : [])\n if (models.length === 0) {\n throw new ValidationError(\n 'expandProfileAxes: no models to sweep — base profile has no model.default and none were supplied',\n )\n }\n const out: AgentProfile[] = []\n const seen = new Set<string>()\n for (const harness of harnesses) {\n // Keep each requested harness on supported models, or its native default when none fit.\n // `keepIncompatible` forces every (harness, model) pair verbatim (failure-mode runs).\n const supported = spec.keepIncompatible\n ? models\n : models.filter((model) => harnessSupportsModel(harness, model))\n const effective = supported.length > 0 ? supported : [HARNESS_NATIVE_MODEL]\n for (const model of effective) {\n const profile: AgentProfile = {\n ...spec.base,\n harness,\n name: `${spec.base.name ?? 'agent'}/${harness}/${model}`,\n model: { ...spec.base.model, default: model },\n metadata: { ...(spec.base.metadata ?? {}), harness, harnessModel: model },\n }\n const id = agentProfileId(profile)\n if (seen.has(id)) continue\n seen.add(id)\n out.push(profile)\n }\n }\n if (out.length === 0) {\n // Unreachable in normal use — snapping guarantees ≥1 cell per harness — but keep a\n // fail-closed guard so a future refactor can't silently produce an empty sweep.\n throw new ValidationError(\n `expandProfileAxes: produced no profiles (harnesses=[${harnesses.join(', ')}], models=[${models.join(', ')}]).`,\n )\n }\n return out\n}\n\n/**\n * Read the (harness, model) a matrix cell ran under, off a profile or a result row's\n * profile — the join-back for a `byHarness` pivot. Returns undefined when the profile\n * wasn't produced by {@link expandProfileAxes}. Callers group `result.byProfile` by\n * this instead of recomputing an id (recomputing the wrong key is what broke the pivot\n * in the hand-rolled copies).\n */\nexport function harnessAxisOf(\n profile: Pick<AgentProfile, 'metadata'>,\n): { harness: HarnessType; model: string } | undefined {\n const m = profile.metadata as Record<string, unknown> | undefined\n const harness = m?.harness\n const model = m?.harnessModel\n if (typeof harness === 'string' && typeof model === 'string') {\n return { harness: harness as HarnessType, model }\n }\n return undefined\n}\n\n/**\n * Collision-resistant, path-safe, human-readable profile id for eval artifacts.\n * Scorecard joins still use `agentProfileHash`; this id is for run ids, matrix\n * keys, and directory names where two profiles must not collapse onto one row.\n * The suffix is the first 64 bits of the behaviour hash, enough for ordinary\n * eval matrices while keeping filenames readable.\n */\nexport function agentProfileId(profile: AgentProfile): string {\n const label = pathSafeProfileLabel(agentProfileDisplayLabel(profile)) ?? 'profile'\n return `${label}-${agentProfileHash(profile).slice(0, 16)}`\n}\n\n/**\n * Model snapshot used for `RunRecord.model`. Eval surfaces require a concrete\n * model id because run records reject bare/missing model aliases.\n */\nexport function agentProfileModelId(profile: AgentProfile): string {\n const model = profile.model?.default?.trim()\n if (!model) {\n const label = agentProfileDisplayLabel(profile) ?? 'unnamed profile'\n throw new ValidationError(\n `AgentProfile \"${label}\" has no model.default — cannot record eval run`,\n )\n }\n return model\n}\n\nfunction agentProfileDisplayLabel(profile: AgentProfile): string | undefined {\n return profile.name?.trim() || profile.version?.trim() || undefined\n}\n\nfunction pathSafeProfileLabel(label: string | undefined): string | undefined {\n const safe = label\n ?.trim()\n .replace(/[^A-Za-z0-9._-]+/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n return safe || undefined\n}\n\nfunction compact<T extends Record<string, unknown>>(input: T): Partial<T> {\n const out: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(input)) {\n if (value !== undefined) out[key] = value\n }\n return out as Partial<T>\n}\n\n/**\n * Deterministic behaviour identity for the canonical\n * `@tangle-network/agent-interface` AgentProfile.\n *\n * `name` and `description` are labels and do not affect the hash. Profile\n * `version`, prompt, model hints, tools, resources, hooks, modes, permissions,\n * and extensions do affect the hash. Resource array order is hash-bearing\n * because mount order can change agent behaviour. Undefined fields are treated\n * as absent; explicit `null` fields remain hash-bearing.\n */\nexport function agentProfileHash(profile: AgentProfile): string {\n const model = agentProfileModelId(profile)\n const behaviour = compact({\n ...profile,\n name: undefined,\n description: undefined,\n tags: profile.tags ? [...profile.tags].sort() : undefined,\n model: compact({ ...profile.model, default: model }),\n })\n return createHash('sha256').update(canonicalString(behaviour)).digest('hex')\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as ValidationError } from "./errors-DeEEV9Vx.js";
|
|
2
|
-
import { a as hashCanonical, o as jsonDocument, r as canonicalString } from "./canonical-
|
|
2
|
+
import { a as hashCanonical, o as jsonDocument, r as canonicalString } from "./canonical-DKgL_Wby.js";
|
|
3
3
|
// src/pre-registration.ts
|
|
4
4
|
/**
|
|
5
5
|
* Pre-registered hypotheses — declare what you're testing BEFORE the
|
|
@@ -284,4 +284,4 @@ function toAgentProfileJson(value) {
|
|
|
284
284
|
}
|
|
285
285
|
export { groupRunsByAgentProfileCell as a, verifyAgentProfileCell as c, signManifest as d, verifyManifest as f, buildAgentProfileCell as i, hashJson as l, AgentProfileCellValidationError as n, toAgentProfileJson as o, agentProfileCellKey as r, validateAgentProfileCell as s, AGENT_PROFILE_KINDS as t, manifestContentDigest as u };
|
|
286
286
|
|
|
287
|
-
//# sourceMappingURL=agent-profile-cell-
|
|
287
|
+
//# sourceMappingURL=agent-profile-cell-CUthydZB.js.map
|