@tangle-network/agent-eval 0.216.0 → 0.217.1
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 +141 -57
- package/README.md +2 -2
- package/dist/adapters/http.d.ts +3 -3
- package/dist/{agent-profile-CIA2Atnt.d.ts → agent-profile-DTt8uGP9.d.ts} +5 -18
- package/dist/agent-profile-DTt8uGP9.d.ts.map +1 -0
- package/dist/{agent-profile-cell-BYc0bxsL.js → agent-profile-cell-B1V1gUZs.js} +4 -53
- package/dist/agent-profile-cell-B1V1gUZs.js.map +1 -0
- package/dist/{agent-profile-cell-BNp-Js9F.d.ts → agent-profile-cell-BcpFbNd5.d.ts} +2 -22
- package/dist/agent-profile-cell-BcpFbNd5.d.ts.map +1 -0
- package/dist/{agreement-irr-DsTURxdr.js → agreement-irr-BhAqjluA.js} +5 -5
- package/dist/agreement-irr-BhAqjluA.js.map +1 -0
- package/dist/analyst/index.d.ts +37 -170
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +17 -192
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-3xpby3p2.js → analyze-runs-DqPJaJ4X.js} +763 -555
- package/dist/analyze-runs-DqPJaJ4X.js.map +1 -0
- package/dist/{analyze-runs-CSDAh8A7.d.ts → analyze-runs-DyeNcenW.d.ts} +18 -16
- package/dist/analyze-runs-DyeNcenW.d.ts.map +1 -0
- package/dist/authenticity/index.d.ts +0 -23
- package/dist/authenticity/index.d.ts.map +1 -1
- package/dist/authenticity/index.js +1 -34
- package/dist/authenticity/index.js.map +1 -1
- package/dist/{benchmark-command-CByl9dxG.js → benchmark-command-xQK8nOI6.js} +591 -109
- package/dist/benchmark-command-xQK8nOI6.js.map +1 -0
- package/dist/benchmarks/index.d.ts +5 -6
- package/dist/benchmarks/index.d.ts.map +1 -1
- package/dist/benchmarks/index.js +4 -4
- package/dist/benchmarks/index.js.map +1 -1
- package/dist/builder-eval/index.d.ts +3 -3
- package/dist/builder-eval/index.js +2 -2
- package/dist/builder-eval/index.js.map +1 -1
- package/dist/campaign/index.d.ts +8 -8
- package/dist/campaign/index.js +15 -15
- package/dist/{campaign-BQ-Jujuj.js → campaign-CJGkxAQ6.js} +256 -765
- package/dist/campaign-CJGkxAQ6.js.map +1 -0
- package/dist/{campaign-evidence-OcUciD-N.js → campaign-evidence-CQYw8_0H.js} +10 -18
- package/dist/{campaign-evidence-OcUciD-N.js.map → campaign-evidence-CQYw8_0H.js.map} +1 -1
- package/dist/{canonical-BsZVgBhW.js → canonical-Dq2hOQ8L.js} +2 -2
- package/dist/{canonical-BsZVgBhW.js.map → canonical-Dq2hOQ8L.js.map} +1 -1
- package/dist/cell-spend-DEWR3nj-.js +90 -0
- package/dist/cell-spend-DEWR3nj-.js.map +1 -0
- package/dist/{chat-client-DthPOYGd.js → chat-client-ldqxYYTN.js} +2 -2
- package/dist/{chat-client-DthPOYGd.js.map → chat-client-ldqxYYTN.js.map} +1 -1
- package/dist/{chat-json-call-BrKsyspg.js → chat-json-call-DavzexSp.js} +3 -2
- package/dist/chat-json-call-DavzexSp.js.map +1 -0
- package/dist/{claim-BXcZw-jo.js → claim-BPVuyHuy.js} +4 -4
- package/dist/claim-BPVuyHuy.js.map +1 -0
- package/dist/cli.js +113 -12
- package/dist/cli.js.map +1 -1
- package/dist/{client-BzL9niqi.d.ts → client-hwo3cJjR.d.ts} +3 -16
- package/dist/client-hwo3cJjR.d.ts.map +1 -0
- package/dist/{cluster-bootstrap-B3JywQQn.js → cluster-bootstrap-DEwwhl0C.js} +3 -3
- package/dist/{cluster-bootstrap-B3JywQQn.js.map → cluster-bootstrap-DEwwhl0C.js.map} +1 -1
- package/dist/{produced-state-ZCtDBxAE.js → completion-verifier-B_jw6C9p.js} +9 -64
- package/dist/completion-verifier-B_jw6C9p.js.map +1 -0
- package/dist/contract/index.d.ts +13 -13
- package/dist/contract/index.js +1041 -1473
- package/dist/contract/index.js.map +1 -1
- package/dist/{cost-ledger-D2FnJPBF.js → cost-ledger-D0352Z4d.js} +832 -817
- package/dist/cost-ledger-D0352Z4d.js.map +1 -0
- package/dist/{cost-ledger-CO7UyEcQ.d.ts → cost-ledger-Jk62OBfF.d.ts} +12 -47
- package/dist/cost-ledger-Jk62OBfF.d.ts.map +1 -0
- package/dist/dataset-DQqhOCPt.d.ts.map +1 -1
- package/dist/{default-registry-Cn1LQ2Ve.js → default-registry-ClYjq3QE.js} +8 -11
- package/dist/default-registry-ClYjq3QE.js.map +1 -0
- package/dist/{default-registry-BrWh62zf.d.ts → default-registry-DXgLmoDI.d.ts} +7 -50
- package/dist/default-registry-DXgLmoDI.d.ts.map +1 -0
- package/dist/{define-agent-eval-Ch3MWX6k.js → define-agent-eval-BDxNlP3D.js} +10 -10
- package/dist/define-agent-eval-BDxNlP3D.js.map +1 -0
- package/dist/{define-agent-eval-CEWkX5wZ.d.ts → define-agent-eval-BIkH_gAR.d.ts} +9 -9
- package/dist/define-agent-eval-BIkH_gAR.d.ts.map +1 -0
- package/dist/{descriptive-CnU8Yq29.js → descriptive-CVNy48rR.js} +2 -2
- package/dist/{descriptive-CnU8Yq29.js.map → descriptive-CVNy48rR.js.map} +1 -1
- package/dist/diagnosis/index.d.ts +4 -14
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +67 -28
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{dspy-rlm-engine-D-KX_e64.js → dspy-rlm-engine-DhdCr1Dc.js} +5 -10
- package/dist/dspy-rlm-engine-DhdCr1Dc.js.map +1 -0
- package/dist/{emitter-HcCmFQl_.d.ts → emitter-DABYYTcH.d.ts} +5 -5
- package/dist/emitter-DABYYTcH.d.ts.map +1 -0
- package/dist/emitter-DbMXUIVP.js.map +1 -1
- package/dist/{engine-C_zNWfM8.d.ts → engine-BvZ0R-36.d.ts} +18 -22
- package/dist/engine-BvZ0R-36.d.ts.map +1 -0
- package/dist/{equal-terms-Blx9Zk5I.js → equal-terms-DbPGcVtI.js} +2 -2
- package/dist/equal-terms-DbPGcVtI.js.map +1 -0
- package/dist/{errors-Dngq5h35.js → errors-BcOs5MKW.js} +6 -8
- package/dist/{errors-Dngq5h35.js.map → errors-BcOs5MKW.js.map} +1 -1
- package/dist/{eval-campaign-4byTtqrf.js → eval-campaign-BLEfBGbA.js} +6 -6
- package/dist/{eval-campaign-4byTtqrf.js.map → eval-campaign-BLEfBGbA.js.map} +1 -1
- package/dist/{evaluation-Cn2dRZIz.d.ts → evaluation-jTjC_QQD.d.ts} +8 -8
- package/dist/evaluation-jTjC_QQD.d.ts.map +1 -0
- package/dist/evaluation.d.ts +2 -2
- package/dist/evaluation.js +1 -1
- package/dist/evaluation.js.map +1 -1
- package/dist/{exact-types-CD0lf5Qd.d.ts → exact-types-CflbJ9f3.d.ts} +2 -2
- package/dist/{exact-types-CD0lf5Qd.d.ts.map → exact-types-CflbJ9f3.d.ts.map} +1 -1
- package/dist/{exec-ChJ6d5if.js → exec-CpbtOXVt.js} +2 -24
- package/dist/{exec-ChJ6d5if.js.map → exec-CpbtOXVt.js.map} +1 -1
- package/dist/execution-tracks-CpgFPpS5.js.map +1 -1
- package/dist/experiment/index.d.ts +331 -33
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +303 -101
- package/dist/experiment/index.js.map +1 -1
- package/dist/{exporters-X4xwla8A.js → exporters-Cl6IeNAu.js} +3 -3
- package/dist/exporters-Cl6IeNAu.js.map +1 -0
- package/dist/{exporters-ChTnR90l.d.ts → exporters-Dk3oEbK_.d.ts} +2 -4
- package/dist/{exporters-ChTnR90l.d.ts.map → exporters-Dk3oEbK_.d.ts.map} +1 -1
- package/dist/{external-optimizer-process-nnsY5D_4.js → external-optimizer-process-KVFGvYX1.js} +4 -3
- package/dist/external-optimizer-process-KVFGvYX1.js.map +1 -0
- package/dist/{external-optimizer-subprocess-DcerlZSG.js → external-optimizer-subprocess-XIHBOSKt.js} +551 -553
- package/dist/external-optimizer-subprocess-XIHBOSKt.js.map +1 -0
- package/dist/{extract-usage-BrnzRJ6H.js → extract-usage-BZLU01kR.js} +2 -23
- package/dist/{extract-usage-BrnzRJ6H.js.map → extract-usage-BZLU01kR.js.map} +1 -1
- package/dist/{failure-cluster-CbgEDcFJ.d.ts → failure-cluster-DN0t63Z0.d.ts} +4 -43
- package/dist/failure-cluster-DN0t63Z0.d.ts.map +1 -0
- package/dist/{failure-taxonomy-CjabTATj.js → failure-taxonomy-Bx5oWqaW.js} +2 -19
- package/dist/{failure-taxonomy-CjabTATj.js.map → failure-taxonomy-Bx5oWqaW.js.map} +1 -1
- package/dist/{feedback-trajectory-DkaDj0dj.d.ts → feedback-trajectory-BWmhRBGu.d.ts} +8 -13
- package/dist/feedback-trajectory-BWmhRBGu.d.ts.map +1 -0
- package/dist/{semantic-concept-judge-zQBG9hHU.js → findings-store-BMVQtEsm.js} +13 -255
- package/dist/findings-store-BMVQtEsm.js.map +1 -0
- package/dist/fuzz.d.ts +20 -63
- package/dist/fuzz.d.ts.map +1 -1
- package/dist/fuzz.js +62 -108
- package/dist/fuzz.js.map +1 -1
- package/dist/{hf-dataset-BR2yhuNn.js → hf-dataset-D9f7-oX7.js} +4 -24
- package/dist/hf-dataset-D9f7-oX7.js.map +1 -0
- package/dist/hosted/index.d.ts +2 -2
- package/dist/hosted/index.js +2 -2
- package/dist/{index-DHKEAv3s.d.ts → index-9jJ2fKSX.d.ts} +2 -64
- package/dist/index-9jJ2fKSX.d.ts.map +1 -0
- package/dist/{index-oQ4aHziK.d.ts → index-BLGqZ81N.d.ts} +11 -16
- package/dist/{index-oQ4aHziK.d.ts.map → index-BLGqZ81N.d.ts.map} +1 -1
- package/dist/{index-DlH0Y9gI.d.ts → index-BiT6RtNH.d.ts} +31 -43
- package/dist/index-BiT6RtNH.d.ts.map +1 -0
- package/dist/{index-Ch9VxCpK.d.ts → index-CX-GAUpw.d.ts} +4 -8
- package/dist/index-CX-GAUpw.d.ts.map +1 -0
- package/dist/{index-CPJJr98o.d.ts → index-CiRwLv2R.d.ts} +5 -68
- package/dist/index-CiRwLv2R.d.ts.map +1 -0
- package/dist/{index-NvGBiO8H.d.ts → index-ZuWx52WG.d.ts} +266 -495
- package/dist/index-ZuWx52WG.d.ts.map +1 -0
- package/dist/index.d.ts +2256 -2165
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +514 -1192
- package/dist/index.js.map +1 -1
- package/dist/{integrity-BV1ZDf42.js → integrity-DOd9Q86O.js} +7 -12
- package/dist/integrity-DOd9Q86O.js.map +1 -0
- package/dist/{integrity-BvnVARVl.js → integrity-W4CADcFc.js} +3 -7
- package/dist/{integrity-BvnVARVl.js.map → integrity-W4CADcFc.js.map} +1 -1
- package/dist/{integrity-CCAxGVK6.d.ts → integrity-_qgZLA5p.d.ts} +4 -6
- package/dist/{integrity-CCAxGVK6.d.ts.map → integrity-_qgZLA5p.d.ts.map} +1 -1
- package/dist/{internal-CRHwS9iz.js → internal-BTK91Bqt.js} +3 -3
- package/dist/{internal-CRHwS9iz.js.map → internal-BTK91Bqt.js.map} +1 -1
- package/dist/interval-Dq9gt7jx.js +219 -0
- package/dist/interval-Dq9gt7jx.js.map +1 -0
- package/dist/interval-ohuOJurX.d.ts +47 -0
- package/dist/interval-ohuOJurX.d.ts.map +1 -0
- package/dist/{journal-DvKCvjty.js → journal-CR4QikYp.js} +110 -110
- package/dist/journal-CR4QikYp.js.map +1 -0
- package/dist/json-BhdsJaOQ.js +111 -0
- package/dist/json-BhdsJaOQ.js.map +1 -0
- package/dist/{judge-calibration-N44V04Se.js → judge-calibration-BkXMIWA4.js} +3 -3
- package/dist/{judge-calibration-N44V04Se.js.map → judge-calibration-BkXMIWA4.js.map} +1 -1
- package/dist/{judge-gate-B1qYnkpi.js → judge-gate-Co5tuh57.js} +4 -27
- package/dist/judge-gate-Co5tuh57.js.map +1 -0
- package/dist/{judge-gate-DNcUrRFA.d.ts → judge-gate-DsL0yFcb.d.ts} +9 -10
- package/dist/judge-gate-DsL0yFcb.d.ts.map +1 -0
- package/dist/{kind-factory-CbZ-6tvu.js → kind-factory-Gy4fXixd.js} +88 -17
- package/dist/kind-factory-Gy4fXixd.js.map +1 -0
- package/dist/ledger-core/index.d.ts +2 -2
- package/dist/ledger-core/index.js +4 -4
- package/dist/{ledger-core-B2hahzrt.js → ledger-core-DrJhbms9.js} +5 -84
- package/dist/ledger-core-DrJhbms9.js.map +1 -0
- package/dist/{llm-client-DQveoxSM.js → llm-client-BshCREn6.js} +90 -219
- package/dist/llm-client-BshCREn6.js.map +1 -0
- package/dist/{llm-judge-PXV7Xljl.js → llm-judge-C8jMTNNG.js} +501 -931
- package/dist/llm-judge-C8jMTNNG.js.map +1 -0
- package/dist/matrix/index.d.ts +4 -4
- package/dist/matrix/index.js +3 -2
- package/dist/{matrix-_BV9-Lk5.js → matrix-B8l-Nsxd.js} +7 -96
- package/dist/matrix-B8l-Nsxd.js.map +1 -0
- package/dist/{matrix-CHMiebFx.d.ts → matrix-DHe-dwVJ.d.ts} +10 -19
- package/dist/matrix-DHe-dwVJ.d.ts.map +1 -0
- package/dist/{paired-tests-jbwPdSz5.js → mean-BbA_JCzW.js} +45 -5
- package/dist/mean-BbA_JCzW.js.map +1 -0
- package/dist/meta-eval/index.d.ts +6 -6
- package/dist/meta-eval/index.js +10 -10
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/metrics-BKaPBtIG.js.map +1 -1
- package/dist/mint-BRZXuwRi.d.ts +81 -0
- package/dist/mint-BRZXuwRi.d.ts.map +1 -0
- package/dist/{mint-Csor1BLJ.js → mint-zszyYlpA.js} +4 -4
- package/dist/{mint-Csor1BLJ.js.map → mint-zszyYlpA.js.map} +1 -1
- package/dist/{multi-layer-verifier-BUaQ4C17.d.ts → multi-layer-verifier-DEgMUk6v.d.ts} +2 -2
- package/dist/{multi-layer-verifier-BUaQ4C17.d.ts.map → multi-layer-verifier-DEgMUk6v.d.ts.map} +1 -1
- package/dist/{multiplicity-D9cjmStq.js → multiplicity-Sg0U7h8j.js} +2 -2
- package/dist/{multiplicity-D9cjmStq.js.map → multiplicity-Sg0U7h8j.js.map} +1 -1
- package/dist/multishot/golden/index.d.ts +1 -23
- package/dist/multishot/golden/index.d.ts.map +1 -1
- package/dist/multishot/golden/index.js +5 -8
- package/dist/multishot/golden/index.js.map +1 -1
- package/dist/multishot/index.d.ts +3 -12
- package/dist/multishot/index.d.ts.map +1 -1
- package/dist/multishot/index.js +4 -3
- package/dist/multishot/index.js.map +1 -1
- package/dist/nonnegative-number-DvdMxg_f.js +9 -0
- package/dist/nonnegative-number-DvdMxg_f.js.map +1 -0
- package/dist/openapi.json +114 -10
- package/dist/{otel-spans-C8YIJWy1.js → otel-spans-CdN909k1.js} +3 -3
- package/dist/{otel-spans-C8YIJWy1.js.map → otel-spans-CdN909k1.js.map} +1 -1
- package/dist/{paired-arms-DzKn0TfY.js → paired-arms-Ct4LTKc1.js} +32 -9
- package/dist/paired-arms-Ct4LTKc1.js.map +1 -0
- package/dist/{paired-binary-Q36bhn2R.js → paired-binary-B_nejA44.js} +3 -36
- package/dist/paired-binary-B_nejA44.js.map +1 -0
- package/dist/{paired-promotion-decision-DPKz8ZnF.d.ts → paired-promotion-decision-CQMJ5xGN.d.ts} +2 -34
- package/dist/paired-promotion-decision-CQMJ5xGN.d.ts.map +1 -0
- package/dist/{paired-promotion-decision-BN6IQTiu.js → paired-promotion-decision-D0SHb-ZL.js} +3 -3
- package/dist/{paired-promotion-decision-BN6IQTiu.js.map → paired-promotion-decision-D0SHb-ZL.js.map} +1 -1
- package/dist/{search-kernel-BztlERLv.js → pareto-BzsxidFD.js} +883 -861
- package/dist/pareto-BzsxidFD.js.map +1 -0
- package/dist/pipelines/index.d.ts +16 -19
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js +4 -68
- package/dist/pipelines/index.js.map +1 -1
- package/dist/{power-and-mde-fK5Qocwo.js → power-and-mde-N5nU4_Ly.js} +3 -3
- package/dist/{power-and-mde-fK5Qocwo.js.map → power-and-mde-N5nU4_Ly.js.map} +1 -1
- package/dist/predicate-FdKmElA_.js +38 -0
- package/dist/predicate-FdKmElA_.js.map +1 -0
- package/dist/{prime-protocol-DcAK9pC8.js → prime-protocol-BFgGrEMP.js} +3 -3
- package/dist/prime-protocol-BFgGrEMP.js.map +1 -0
- package/dist/{prime-protocol-CEE4BR9N.d.ts → prime-protocol-BWG2DQIk.d.ts} +4 -22
- package/dist/prime-protocol-BWG2DQIk.d.ts.map +1 -0
- package/dist/profile-cell.d.ts +2 -2
- package/dist/profile-cell.js +2 -2
- package/dist/{release-confidence-BK2QCB5M.d.ts → promotion-gate-DaY95yU6.d.ts} +105 -106
- package/dist/promotion-gate-DaY95yU6.d.ts.map +1 -0
- package/dist/{promotion-policy-CWW35UWq.js → promotion-policy-6A8osGr_.js} +4 -4
- package/dist/{promotion-policy-CWW35UWq.js.map → promotion-policy-6A8osGr_.js.map} +1 -1
- package/dist/{proposal-findings-BZiMTzAF.js → proposal-findings-BbWidvUk.js} +3 -3
- package/dist/proposal-findings-BbWidvUk.js.map +1 -0
- package/dist/{query-B1D1qp2Z.js → query-B_RZ36an.js} +5 -5
- package/dist/query-B_RZ36an.js.map +1 -0
- package/dist/{query-DK1nWcmp.d.ts → query-Cmv_U8vf.d.ts} +4 -24
- package/dist/{query-DK1nWcmp.d.ts.map → query-Cmv_U8vf.d.ts.map} +1 -1
- package/dist/{random-Dn5fPWkt.js → random-DDDcC7YU.js} +2 -2
- package/dist/{random-Dn5fPWkt.js.map → random-DDDcC7YU.js.map} +1 -1
- package/dist/{raw-provider-sink-rB2DYxr6.js → raw-provider-sink-75w4FWBj.js} +2 -2
- package/dist/{raw-provider-sink-rB2DYxr6.js.map → raw-provider-sink-75w4FWBj.js.map} +1 -1
- package/dist/{redact-Cveoq6fJ.d.ts → redact-DXdlFb_U.d.ts} +4 -21
- package/dist/redact-DXdlFb_U.d.ts.map +1 -0
- package/dist/{redact-Dk1ZdJEm.js → redact-mtkTiJVk.js} +92 -98
- package/dist/redact-mtkTiJVk.js.map +1 -0
- package/dist/{registry-JYfPxcVz.d.ts → registry-ssNoHzwD.d.ts} +5 -5
- package/dist/{registry-JYfPxcVz.d.ts.map → registry-ssNoHzwD.d.ts.map} +1 -1
- package/dist/{release-confidence-Dbe9AS_X.js → release-confidence-CYIFH-fp.js} +6 -11
- package/dist/release-confidence-CYIFH-fp.js.map +1 -0
- package/dist/{report-command-y8H6RSX8.js → render-C-w2EZ6p.js} +331 -554
- package/dist/render-C-w2EZ6p.js.map +1 -0
- package/dist/reporting-html-Kvlc8oMt.js +100 -0
- package/dist/reporting-html-Kvlc8oMt.js.map +1 -0
- package/dist/reporting.d.ts +6 -6
- package/dist/reporting.js +8 -8
- package/dist/{researcher-f6mZhh58.d.ts → researcher-0ABVIdGa.d.ts} +9 -9
- package/dist/{researcher-f6mZhh58.d.ts.map → researcher-0ABVIdGa.d.ts.map} +1 -1
- package/dist/reward-DrZ71vnf.d.ts +55 -0
- package/dist/reward-DrZ71vnf.d.ts.map +1 -0
- package/dist/{reward-hacking-BFcQgkux.js → reward-hacking-ByuETaIb.js} +3 -3
- package/dist/{reward-hacking-BFcQgkux.js.map → reward-hacking-ByuETaIb.js.map} +1 -1
- package/dist/{reward-hacking-DHA7c1l8.d.ts → reward-hacking-E52wq86n.d.ts} +5 -18
- package/dist/reward-hacking-E52wq86n.d.ts.map +1 -0
- package/dist/reward-nw2xZGZG.js.map +1 -1
- package/dist/rl.d.ts +117 -295
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +27 -747
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +5 -4
- package/dist/rollout/index.js +7 -8
- package/dist/{rollout-D9bKKBnZ.js → rollout-D6C50mfA.js} +88 -13
- package/dist/rollout-D6C50mfA.js.map +1 -0
- package/dist/round-decimal-COrKglMh.js +10 -0
- package/dist/round-decimal-COrKglMh.js.map +1 -0
- package/dist/{rubric-predictive-validity-BsgkBfT0.js → rubric-predictive-validity-D3_oI72N.js} +3 -3
- package/dist/{rubric-predictive-validity-BsgkBfT0.js.map → rubric-predictive-validity-D3_oI72N.js.map} +1 -1
- package/dist/{rubric-predictive-validity-2SgHxoa5.d.ts → rubric-predictive-validity-DiwT8PbL.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-2SgHxoa5.d.ts.map → rubric-predictive-validity-DiwT8PbL.d.ts.map} +1 -1
- package/dist/{run-record-D1Hw-Jml.d.ts → run-record-CaxbLq6Y.d.ts} +5 -11
- package/dist/run-record-CaxbLq6Y.d.ts.map +1 -0
- package/dist/{run-record-ES07wfz9.js → run-record-CysKLB93.js} +3 -5
- package/dist/run-record-CysKLB93.js.map +1 -0
- package/dist/{run-record-DlTZ_lqe.js → run-record-DhEJgoPz.js} +4 -4
- package/dist/{run-record-DlTZ_lqe.js.map → run-record-DhEJgoPz.js.map} +1 -1
- package/dist/sandbox-harness-BlSOu4LX.d.ts.map +1 -1
- package/dist/{schema-CSf6qWgZ.js → schema-Bt2vLFm3.js} +2 -14
- package/dist/schema-Bt2vLFm3.js.map +1 -0
- package/dist/schema-C-ziyJD7.d.ts.map +1 -1
- package/dist/{schema-2g7trUwH.d.ts → schema-D6EVKzTB.d.ts} +4 -5
- package/dist/schema-D6EVKzTB.d.ts.map +1 -0
- package/dist/{schema-BuiujZ-g.js → schema-DxcKTzbi.js} +2 -2
- package/dist/schema-DxcKTzbi.js.map +1 -0
- package/dist/search/index.d.ts +39 -53
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +4 -4
- package/dist/{search-kernel-CpcKH5Ih.d.ts → search-kernel-DxqjBxA-.d.ts} +18 -31
- package/dist/search-kernel-DxqjBxA-.d.ts.map +1 -0
- package/dist/{search-ledger-d7V8o9Lk.js → search-ledger-TUvB5gWH.js} +189 -199
- package/dist/search-ledger-TUvB5gWH.js.map +1 -0
- package/dist/{search-ledger-file-BqOo-bVo.js → search-ledger-file-UKCO2r8a.js} +4 -4
- package/dist/search-ledger-file-UKCO2r8a.js.map +1 -0
- package/dist/search-ledger-types-p2xKfiDJ.d.ts.map +1 -1
- package/dist/{search-shipper-er4pK5_Y.js → search-shipper-Cw2z3-td.js} +4 -4
- package/dist/search-shipper-Cw2z3-td.js.map +1 -0
- package/dist/{search-summary-CBvz3u_S.js → search-summary-DQIvJsSB.js} +5 -5
- package/dist/{search-summary-CBvz3u_S.js.map → search-summary-DQIvJsSB.js.map} +1 -1
- package/dist/{sequential-CzK5DarL.js → sequential-BVv1sjsw.js} +2 -32
- package/dist/{sequential-CzK5DarL.js.map → sequential-BVv1sjsw.js.map} +1 -1
- package/dist/{sequential-D-1PPCmM.js → sequential-CimQrbjv.js} +5 -5
- package/dist/sequential-CimQrbjv.js.map +1 -0
- package/dist/{sequential-BhsrMupG.d.ts → sequential-KwGspfeR.d.ts} +2 -9
- package/dist/{sequential-BhsrMupG.d.ts.map → sequential-KwGspfeR.d.ts.map} +1 -1
- package/dist/{sequential-eprocess-D1jKoihe.js → sequential-eprocess-DodI6RoF.js} +2 -2
- package/dist/{sequential-eprocess-D1jKoihe.js.map → sequential-eprocess-DodI6RoF.js.map} +1 -1
- package/dist/{server-DbcC7xMl.js → server-DoVbqqtJ.js} +101 -101
- package/dist/server-DoVbqqtJ.js.map +1 -0
- package/dist/{single-run-lock-fVu3MZWH.js → single-run-lock-U58yf8N6.js} +2 -2
- package/dist/{single-run-lock-fVu3MZWH.js.map → single-run-lock-U58yf8N6.js.map} +1 -1
- package/dist/{skillopt-optimization-method-CCtzralq.js → skillopt-optimization-method-kyL94-ri.js} +428 -91
- package/dist/skillopt-optimization-method-kyL94-ri.js.map +1 -0
- package/dist/{spans-D9_ehFuk.d.ts → spans-CVngGij3.d.ts} +2 -2
- package/dist/{spans-D9_ehFuk.d.ts.map → spans-CVngGij3.d.ts.map} +1 -1
- package/dist/{statistical-heldout-1Gbmex7v.js → statistical-heldout-Bksv92Th.js} +3 -3
- package/dist/statistical-heldout-Bksv92Th.js.map +1 -0
- package/dist/{statistical-heldout-BeR4bOdg.d.ts → statistical-heldout-C9AbgREN.d.ts} +8 -67
- package/dist/statistical-heldout-C9AbgREN.d.ts.map +1 -0
- package/dist/{steps-Bg5-KVx1.d.ts → steps-DlepJPwD.d.ts} +2 -56
- package/dist/steps-DlepJPwD.d.ts.map +1 -0
- package/dist/{store-C4avFjIi.d.ts → store-B3nWRy3B.d.ts} +2 -2
- package/dist/{store-C4avFjIi.d.ts.map → store-B3nWRy3B.d.ts.map} +1 -1
- package/dist/{store-otlp-DtB4Slsr.js → store-otlp-BteDAbHK.js} +135 -132
- package/dist/store-otlp-BteDAbHK.js.map +1 -0
- package/dist/{store-tool-spans-fZIigrpP.js → store-tool-spans-D5l_OfTJ.js} +9 -9
- package/dist/store-tool-spans-D5l_OfTJ.js.map +1 -0
- package/dist/{store-tool-spans-DR1SrCLK.d.ts → store-tool-spans-DZS0HWVf.d.ts} +157 -165
- package/dist/store-tool-spans-DZS0HWVf.d.ts.map +1 -0
- package/dist/storyboard/index.d.ts +4 -11
- package/dist/storyboard/index.d.ts.map +1 -1
- package/dist/storyboard/index.js +21 -19
- package/dist/storyboard/index.js.map +1 -1
- package/dist/{summary-report-DtdRucM0.js → summary-report-BsXJoYX5.js} +588 -598
- package/dist/summary-report-BsXJoYX5.js.map +1 -0
- package/dist/{summary-report-C-CtItCN.d.ts → summary-report-DM7tlml1.d.ts} +16 -20
- package/dist/summary-report-DM7tlml1.d.ts.map +1 -0
- package/dist/supervisor-run/index.d.ts +189 -153
- package/dist/supervisor-run/index.d.ts.map +1 -1
- package/dist/supervisor-run/index.js +58 -450
- package/dist/supervisor-run/index.js.map +1 -1
- package/dist/{systemone-CpTLAlqb.d.ts → systemone-Bp_Ac0p1.d.ts} +6 -6
- package/dist/{systemone-CpTLAlqb.d.ts.map → systemone-Bp_Ac0p1.d.ts.map} +1 -1
- package/dist/systemone-protocol.js +1 -1
- package/dist/{systemone-review-B_yo1xsd.d.ts → systemone-review-CwE6JGIp.d.ts} +2 -2
- package/dist/{systemone-review-B_yo1xsd.d.ts.map → systemone-review-CwE6JGIp.d.ts.map} +1 -1
- package/dist/{systemone-review-BZWfrtq1.js → systemone-review-DzdOJ8I6.js} +3 -3
- package/dist/{systemone-review-BZWfrtq1.js.map → systemone-review-DzdOJ8I6.js.map} +1 -1
- package/dist/systemone.d.ts +5 -5
- package/dist/systemone.js +5 -5
- package/dist/systemone.js.map +1 -1
- package/dist/{task-failure-attributes-DngaLdE4.js → task-failure-attributes-BMsblaDh.js} +3 -3
- package/dist/task-failure-attributes-BMsblaDh.js.map +1 -0
- package/dist/{terminal-record-BHocwFw1.js → terminal-record-78g6E4vh.js} +17 -13
- package/dist/terminal-record-78g6E4vh.js.map +1 -0
- package/dist/{tool-groups-mcxOXVlb.d.ts → tool-groups-DyNz2JZ_.d.ts} +3 -3
- package/dist/tool-groups-DyNz2JZ_.d.ts.map +1 -0
- package/dist/{tool-waste-Wi4g6Ekb.d.ts → tool-waste-CkjzWmeY.d.ts} +53 -56
- package/dist/tool-waste-CkjzWmeY.d.ts.map +1 -0
- package/dist/{tool-waste-D52PqU9Q.js → tool-waste-DLsjS_p-.js} +5 -5
- package/dist/{tool-waste-D52PqU9Q.js.map → tool-waste-DLsjS_p-.js.map} +1 -1
- package/dist/{trace-questions-DG7nqLQ7.d.ts → trace-questions-xxwgsuMi.d.ts} +5 -10
- package/dist/{trace-questions-DG7nqLQ7.d.ts.map → trace-questions-xxwgsuMi.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +15 -212
- package/dist/trace-repair/index.d.ts.map +1 -1
- package/dist/trace-repair/index.js +865 -987
- package/dist/trace-repair/index.js.map +1 -1
- package/dist/traces.d.ts +76 -86
- package/dist/traces.d.ts.map +1 -1
- package/dist/traces.js +13 -13
- package/dist/traces.js.map +1 -1
- package/dist/trajectory-replay/index.d.ts +3 -117
- package/dist/trajectory-replay/index.d.ts.map +1 -1
- package/dist/trajectory-replay/index.js +98 -56
- package/dist/trajectory-replay/index.js.map +1 -1
- package/dist/{tree-rXLW3M_4.js → tree-BGRglkKd.js} +2355 -2414
- package/dist/tree-BGRglkKd.js.map +1 -0
- package/dist/{types-B3jzCp0p.js → types-BXgASBCL.js} +2 -2
- package/dist/{types-B3jzCp0p.js.map → types-BXgASBCL.js.map} +1 -1
- package/dist/{types-oKRhQAde.d.ts → types-CW8ewATZ.d.ts} +5 -114
- package/dist/types-CW8ewATZ.d.ts.map +1 -0
- package/dist/{types-BqkVmHfv.d.ts → types-CmXY0PQf.d.ts} +2 -4
- package/dist/types-CmXY0PQf.d.ts.map +1 -0
- package/dist/{types-DBZ7keha.d.ts → types-D-mgRzlh.d.ts} +9 -72
- package/dist/types-D-mgRzlh.d.ts.map +1 -0
- package/dist/{types-B4C5nFw6.d.ts → types-D8GhJoHk.d.ts} +79 -75
- package/dist/types-D8GhJoHk.d.ts.map +1 -0
- package/dist/{types-IXD2HJzu.js → types-DqFMNTgK.js} +2 -4
- package/dist/types-DqFMNTgK.js.map +1 -0
- package/dist/{types-CfZMIzB_.d.ts → types-DtMbFw6U.d.ts} +3 -3
- package/dist/{types-CfZMIzB_.d.ts.map → types-DtMbFw6U.d.ts.map} +1 -1
- package/dist/{verdict-DhPoXApk.js → verdict-BGQmxQ8A.js} +3 -3
- package/dist/verdict-BGQmxQ8A.js.map +1 -0
- package/dist/{verdict-E4eRNf7-.d.ts → verdict-C24NELtN.d.ts} +2 -15
- package/dist/{verdict-E4eRNf7-.d.ts.map → verdict-C24NELtN.d.ts.map} +1 -1
- package/dist/{verdict-cache-BQEsVy9n.js → verdict-cache-CL_7tePD.js} +2 -2
- package/dist/verdict-cache-CL_7tePD.js.map +1 -0
- package/dist/wire/index.d.ts +32 -411
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +2 -2
- package/docs/changes/jev-evidence-review.md +1 -1
- package/docs/changes/jev-product-adoption.md +1 -1
- package/docs/changes/jev-recorded-evidence.md +1 -1
- package/docs/design/mlbenchmarks-book-review.md +1 -1
- package/docs/design/mlbenchmarks-review/probes.mts +23 -31
- package/docs/design/statistics-decisions.md +17 -17
- package/docs/design.md +1 -1
- package/docs/evaluation-integrity.md +1 -1
- package/docs/experiment.md +1 -1
- package/docs/proofs/campaign-attempt-retention-20261001/README.md +2 -2
- package/docs/public-api.md +138 -529
- package/docs/rollout.md +1 -1
- package/docs/trace-repair-admission.md +1 -1
- package/docs/wire-protocol.md +1 -1
- package/package.json +1 -1
- package/dist/active-curriculum-B_Lc9kfO.js +0 -61
- package/dist/active-curriculum-B_Lc9kfO.js.map +0 -1
- package/dist/agent-profile-CIA2Atnt.d.ts.map +0 -1
- package/dist/agent-profile-cell-BNp-Js9F.d.ts.map +0 -1
- package/dist/agent-profile-cell-BYc0bxsL.js.map +0 -1
- package/dist/agreement-irr-DsTURxdr.js.map +0 -1
- package/dist/analyze-runs-3xpby3p2.js.map +0 -1
- package/dist/analyze-runs-CSDAh8A7.d.ts.map +0 -1
- package/dist/ast-DJ6Bc7ab.js +0 -558
- package/dist/ast-DJ6Bc7ab.js.map +0 -1
- package/dist/ast-hI-vjW6J.d.ts +0 -457
- package/dist/ast-hI-vjW6J.d.ts.map +0 -1
- package/dist/baseline-Dm8966du.js +0 -259
- package/dist/baseline-Dm8966du.js.map +0 -1
- package/dist/benchmark-BywPeAUo.js +0 -562
- package/dist/benchmark-BywPeAUo.js.map +0 -1
- package/dist/benchmark-command-CByl9dxG.js.map +0 -1
- package/dist/campaign-BQ-Jujuj.js.map +0 -1
- package/dist/chat-json-call-BrKsyspg.js.map +0 -1
- package/dist/claim-BXcZw-jo.js.map +0 -1
- package/dist/claude-jsonl-dZir12m6.js +0 -86
- package/dist/claude-jsonl-dZir12m6.js.map +0 -1
- package/dist/client-BzL9niqi.d.ts.map +0 -1
- package/dist/cost-ledger-CO7UyEcQ.d.ts.map +0 -1
- package/dist/cost-ledger-D2FnJPBF.js.map +0 -1
- package/dist/counterfactual-CPaWN99-.d.ts +0 -60
- package/dist/counterfactual-CPaWN99-.d.ts.map +0 -1
- package/dist/counterfactual-DtMWvn7D.js +0 -98
- package/dist/counterfactual-DtMWvn7D.js.map +0 -1
- package/dist/default-registry-BrWh62zf.d.ts.map +0 -1
- package/dist/default-registry-Cn1LQ2Ve.js.map +0 -1
- package/dist/define-agent-eval-CEWkX5wZ.d.ts.map +0 -1
- package/dist/define-agent-eval-Ch3MWX6k.js.map +0 -1
- package/dist/dspy-rlm-engine-D-KX_e64.js.map +0 -1
- package/dist/effect-sizes-DiH8MGOH.js +0 -82
- package/dist/effect-sizes-DiH8MGOH.js.map +0 -1
- package/dist/emitter-HcCmFQl_.d.ts.map +0 -1
- package/dist/engine-C_zNWfM8.d.ts.map +0 -1
- package/dist/equal-terms-Blx9Zk5I.js.map +0 -1
- package/dist/evaluation-Cn2dRZIz.d.ts.map +0 -1
- package/dist/exporters-X4xwla8A.js.map +0 -1
- package/dist/external-optimizer-process-nnsY5D_4.js.map +0 -1
- package/dist/external-optimizer-subprocess-DcerlZSG.js.map +0 -1
- package/dist/failure-cluster-CbgEDcFJ.d.ts.map +0 -1
- package/dist/feedback-trajectory-DkaDj0dj.d.ts.map +0 -1
- package/dist/hf-dataset-BR2yhuNn.js.map +0 -1
- package/dist/index-CPJJr98o.d.ts.map +0 -1
- package/dist/index-Ch9VxCpK.d.ts.map +0 -1
- package/dist/index-DHKEAv3s.d.ts.map +0 -1
- package/dist/index-DlH0Y9gI.d.ts.map +0 -1
- package/dist/index-NvGBiO8H.d.ts.map +0 -1
- package/dist/integrity-BV1ZDf42.js.map +0 -1
- package/dist/journal-DvKCvjty.js.map +0 -1
- package/dist/judge-gate-B1qYnkpi.js.map +0 -1
- package/dist/judge-gate-DNcUrRFA.d.ts.map +0 -1
- package/dist/kind-factory-CbZ-6tvu.js.map +0 -1
- package/dist/ledger-core-B2hahzrt.js.map +0 -1
- package/dist/llm-client-DQveoxSM.js.map +0 -1
- package/dist/llm-judge-PXV7Xljl.js.map +0 -1
- package/dist/matrix-CHMiebFx.d.ts.map +0 -1
- package/dist/matrix-_BV9-Lk5.js.map +0 -1
- package/dist/mint-DCGoBYhB.d.ts +0 -155
- package/dist/mint-DCGoBYhB.d.ts.map +0 -1
- package/dist/normal-DsJZtrJc.js +0 -25
- package/dist/normal-DsJZtrJc.js.map +0 -1
- package/dist/paired-arms-DzKn0TfY.js.map +0 -1
- package/dist/paired-binary-Q36bhn2R.js.map +0 -1
- package/dist/paired-promotion-decision-DPKz8ZnF.d.ts.map +0 -1
- package/dist/paired-tests-jbwPdSz5.js.map +0 -1
- package/dist/prime-protocol-CEE4BR9N.d.ts.map +0 -1
- package/dist/prime-protocol-DcAK9pC8.js.map +0 -1
- package/dist/produced-state-ZCtDBxAE.js.map +0 -1
- package/dist/proposal-findings-BZiMTzAF.js.map +0 -1
- package/dist/query-B1D1qp2Z.js.map +0 -1
- package/dist/redact-Cveoq6fJ.d.ts.map +0 -1
- package/dist/redact-Dk1ZdJEm.js.map +0 -1
- package/dist/release-confidence-BK2QCB5M.d.ts.map +0 -1
- package/dist/release-confidence-Dbe9AS_X.js.map +0 -1
- package/dist/report-command-y8H6RSX8.js.map +0 -1
- package/dist/reward-hacking-DHA7c1l8.d.ts.map +0 -1
- package/dist/rollout-D9bKKBnZ.js.map +0 -1
- package/dist/run-record-D1Hw-Jml.d.ts.map +0 -1
- package/dist/run-record-ES07wfz9.js.map +0 -1
- package/dist/schema-2g7trUwH.d.ts.map +0 -1
- package/dist/schema-BuiujZ-g.js.map +0 -1
- package/dist/schema-CSf6qWgZ.js.map +0 -1
- package/dist/search-kernel-BztlERLv.js.map +0 -1
- package/dist/search-kernel-CpcKH5Ih.d.ts.map +0 -1
- package/dist/search-ledger-d7V8o9Lk.js.map +0 -1
- package/dist/search-ledger-file-BqOo-bVo.js.map +0 -1
- package/dist/search-shipper-er4pK5_Y.js.map +0 -1
- package/dist/semantic-concept-judge-zQBG9hHU.js.map +0 -1
- package/dist/sequential-D-1PPCmM.js.map +0 -1
- package/dist/server-DbcC7xMl.js.map +0 -1
- package/dist/skillopt-optimization-method-CCtzralq.js.map +0 -1
- package/dist/statistical-heldout-1Gbmex7v.js.map +0 -1
- package/dist/statistical-heldout-BeR4bOdg.d.ts.map +0 -1
- package/dist/steps-Bg5-KVx1.d.ts.map +0 -1
- package/dist/store-otlp-DtB4Slsr.js.map +0 -1
- package/dist/store-tool-spans-DR1SrCLK.d.ts.map +0 -1
- package/dist/store-tool-spans-fZIigrpP.js.map +0 -1
- package/dist/student-t-BQeKJx2N.js +0 -39
- package/dist/student-t-BQeKJx2N.js.map +0 -1
- package/dist/summary-report-C-CtItCN.d.ts.map +0 -1
- package/dist/summary-report-DtdRucM0.js.map +0 -1
- package/dist/task-failure-attributes-DngaLdE4.js.map +0 -1
- package/dist/terminal-record-BHocwFw1.js.map +0 -1
- package/dist/tool-groups-mcxOXVlb.d.ts.map +0 -1
- package/dist/tool-waste-Wi4g6Ekb.d.ts.map +0 -1
- package/dist/trajectory-Y1fmdlw7.d.ts +0 -24
- package/dist/trajectory-Y1fmdlw7.d.ts.map +0 -1
- package/dist/tree-rXLW3M_4.js.map +0 -1
- package/dist/types-B4C5nFw6.d.ts.map +0 -1
- package/dist/types-BqkVmHfv.d.ts.map +0 -1
- package/dist/types-DBZ7keha.d.ts.map +0 -1
- package/dist/types-IXD2HJzu.js.map +0 -1
- package/dist/types-oKRhQAde.d.ts.map +0 -1
- package/dist/usage-receipt-Cx3xNeyB.js +0 -76
- package/dist/usage-receipt-Cx3xNeyB.js.map +0 -1
- package/dist/verdict-DhPoXApk.js.map +0 -1
- package/dist/verdict-cache-BQEsVy9n.js.map +0 -1
- package/docs/design/self-improvement-evidence-audit.md +0 -263
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { s as ValidationError, t as AgentEvalError } from "./errors-
|
|
2
|
-
import { a as hashCanonical, i as compareCodeUnits, o as jsonDocument, r as canonicalString } from "./canonical-
|
|
3
|
-
import {
|
|
1
|
+
import { c as errorMessage, s as ValidationError, t as AgentEvalError } from "./errors-BcOs5MKW.js";
|
|
2
|
+
import { a as hashCanonical, i as compareCodeUnits, o as jsonDocument, r as canonicalString } from "./canonical-Dq2hOQ8L.js";
|
|
3
|
+
import { i as pairedBootstrap, t as mean$3 } from "./mean-BbA_JCzW.js";
|
|
4
4
|
import { a as resolveModelPricing } from "./metrics-BKaPBtIG.js";
|
|
5
|
-
import { a as CostLedgerPersistenceError, i as
|
|
6
|
-
import {
|
|
7
|
-
import "./ledger-core-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as acquireSingleRunLock } from "./single-run-lock-
|
|
12
|
-
import { a as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { t as createDspyRlmTraceEngine } from "./dspy-rlm-engine-
|
|
16
|
-
import { i as otlpTextToTraceAnalysisStore,
|
|
17
|
-
import
|
|
18
|
-
import "./
|
|
19
|
-
import { t as
|
|
20
|
-
import { c as primeProtocolSha256, d as runPrimeExchange, f as decodeReplyRows, n as buildPrimePrompt, t as analystUsageReceiptFromPrimeUsage, u as projectPrimeTrajectory } from "./prime-protocol-DcAK9pC8.js";
|
|
5
|
+
import { a as CostLedgerPersistenceError, i as CostCeilingReachedError, n as CostAccountingIncompleteError, o as CostReceiptCaptureError, r as CostCallConflictError, s as CostReservationExceededError, t as CostLedger } from "./cost-ledger-D0352Z4d.js";
|
|
6
|
+
import { l as withLedgerFileLock, u as writeLedgerFileAtomically } from "./journal-CR4QikYp.js";
|
|
7
|
+
import "./ledger-core-DrJhbms9.js";
|
|
8
|
+
import { M as fsCampaignStorage, b as AnalystFindingSchema, i as startExternalOptimizerModelProxy, j as createRunCostLedger, r as runWithCleanup, v as resolveExternalOptimizerProcessLimits } from "./external-optimizer-subprocess-XIHBOSKt.js";
|
|
9
|
+
import { s as redactText } from "./redact-mtkTiJVk.js";
|
|
10
|
+
import { i as makeFinding } from "./types-DqFMNTgK.js";
|
|
11
|
+
import { t as acquireSingleRunLock } from "./single-run-lock-U58yf8N6.js";
|
|
12
|
+
import { a as LlmCallError, n as isRecord, o as LlmResponseError } from "./json-BhdsJaOQ.js";
|
|
13
|
+
import { A as RawAnalystFindingSchema, U as assertValidAnalystUsageReceipt, W as usageReceiptFromCostLedger, j as evidenceRefsFromRawFinding, k as RAW_FINDING_SCHEMA_PROMPT, m as TRACE_ANALYSIS_LIMITS, n as runTraceAnalyst } from "./kind-factory-Gy4fXixd.js";
|
|
14
|
+
import { n as callLlmJson } from "./llm-client-BshCREn6.js";
|
|
15
|
+
import { t as createDspyRlmTraceEngine } from "./dspy-rlm-engine-DhdCr1Dc.js";
|
|
16
|
+
import { i as otlpTextToTraceAnalysisStore, n as DEFAULT_MAX_TRACE_FILE_BYTES, t as BufferTraceStore } from "./store-otlp-BteDAbHK.js";
|
|
17
|
+
import "./external-optimizer-process-KVFGvYX1.js";
|
|
18
|
+
import { t as assertEqualDeclarativeTerms } from "./equal-terms-DbPGcVtI.js";
|
|
19
|
+
import { c as runPrimeExchange, l as decodeReplyRows, n as buildPrimePrompt, o as primeProtocolSha256, s as projectPrimeTrajectory, t as analystUsageReceiptFromPrimeUsage } from "./prime-protocol-BFgGrEMP.js";
|
|
21
20
|
import { t as nodeHttpPrimeBridgeTransport } from "./prime-bridge-transport-Z3cpKGoV.js";
|
|
22
21
|
import { createHash, randomUUID } from "node:crypto";
|
|
23
22
|
import { constants, existsSync, lstatSync, readFileSync } from "node:fs";
|
|
@@ -28,6 +27,504 @@ import { arch, platform } from "node:os";
|
|
|
28
27
|
import { pathToFileURL } from "node:url";
|
|
29
28
|
import { link, lstat, mkdir, open, readFile, readdir, realpath, stat, unlink } from "node:fs/promises";
|
|
30
29
|
import { TextDecoder as TextDecoder$1 } from "node:util";
|
|
30
|
+
import { performance } from "node:perf_hooks";
|
|
31
|
+
import { linearSumAssignment } from "linear-sum-assignment";
|
|
32
|
+
//#region src/analyst/benchmark-scoring.ts
|
|
33
|
+
function scoreAnalystFindings(testCase, findings) {
|
|
34
|
+
assertValidAnalystScoringCase(testCase);
|
|
35
|
+
const matchedFindingByIssue = matchFindingsToIssues(testCase.expectedIssues, findings);
|
|
36
|
+
const matchedIssueIds = testCase.expectedIssues.filter((_, index) => matchedFindingByIssue.has(index)).map((issue) => issue.id);
|
|
37
|
+
const missedIssueIds = testCase.expectedIssues.filter((_, index) => !matchedFindingByIssue.has(index)).map((issue) => issue.id);
|
|
38
|
+
const supportedFindingIndexes = new Set(matchedFindingByIssue.values());
|
|
39
|
+
const unsupportedFindingIndexes = findings.map((_, index) => index).filter((index) => !supportedFindingIndexes.has(index));
|
|
40
|
+
const expectedIssueCount = testCase.expectedIssues.length;
|
|
41
|
+
const issueRecall = expectedIssueCount === 0 ? 1 : matchedIssueIds.length / expectedIssueCount;
|
|
42
|
+
const findingPrecision = findings.length === 0 ? expectedIssueCount === 0 ? 1 : 0 : supportedFindingIndexes.size / findings.length;
|
|
43
|
+
const f1 = harmonicMeanScore(findingPrecision, issueRecall);
|
|
44
|
+
const allEvidence = findings.flatMap((finding) => finding.evidence_refs);
|
|
45
|
+
const criticalIssues = testCase.expectedIssues.filter((issue) => (issue.criticalEvidence?.length ?? 0) > 0);
|
|
46
|
+
const criticalHits = testCase.expectedIssues.filter((issue) => {
|
|
47
|
+
if ((issue.criticalEvidence?.length ?? 0) === 0) return false;
|
|
48
|
+
return matchesEvidence(allEvidence, issue.criticalEvidence ?? [], "any");
|
|
49
|
+
}).length;
|
|
50
|
+
const findingsWithEvidence = findings.filter((finding) => finding.evidence_refs.length > 0).length;
|
|
51
|
+
const unlabeledEvidence = testCase.labeledEvidence ? allEvidence.filter((ref) => !testCase.labeledEvidence.some((expected) => evidenceMatches(ref, expected))) : [];
|
|
52
|
+
return {
|
|
53
|
+
expectedIssueCount,
|
|
54
|
+
matchedIssueIds,
|
|
55
|
+
missedIssueIds,
|
|
56
|
+
supportedFindingIndexes: [...supportedFindingIndexes].sort((a, b) => a - b),
|
|
57
|
+
unsupportedFindingIndexes,
|
|
58
|
+
unlabeledEvidence,
|
|
59
|
+
issueRecall,
|
|
60
|
+
findingPrecision,
|
|
61
|
+
f1,
|
|
62
|
+
criticalStepAccuracy: criticalIssues.length === 0 ? null : criticalHits / criticalIssues.length,
|
|
63
|
+
citationCoverage: findings.length === 0 ? null : findingsWithEvidence / findings.length,
|
|
64
|
+
citationExcerptCoverage: allEvidence.length === 0 ? null : allEvidence.filter((evidence) => Boolean(evidence.excerpt?.trim())).length / allEvidence.length,
|
|
65
|
+
citationLabelAgreement: testCase.labeledEvidence === void 0 ? null : allEvidence.length === 0 ? findings.length === 0 ? null : 0 : (allEvidence.length - unlabeledEvidence.length) / allEvidence.length,
|
|
66
|
+
predictionOnLabelEmptyCase: expectedIssueCount === 0 && findings.length > 0
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function assertValidAnalystScoringCase(testCase) {
|
|
70
|
+
if (!testCase.id.trim()) throw new TypeError("analyst benchmark case id must not be empty");
|
|
71
|
+
const ids = /* @__PURE__ */ new Set();
|
|
72
|
+
for (const issue of testCase.expectedIssues) {
|
|
73
|
+
if (!issue.id.trim()) throw new TypeError(`${testCase.id}: expected issue id must not be empty`);
|
|
74
|
+
if (ids.has(issue.id)) throw new TypeError(`${testCase.id}: duplicate expected issue id '${issue.id}'`);
|
|
75
|
+
ids.add(issue.id);
|
|
76
|
+
if (!issue.findingIds?.length && !issue.areas?.length && !issue.subjects?.length && !issue.evidence?.length) throw new TypeError(`${testCase.id}/${issue.id}: expected issue must identify a finding by id, area, subject, or evidence`);
|
|
77
|
+
}
|
|
78
|
+
for (const ref of testCase.labeledEvidence ?? []) if (!ref.uri.trim()) throw new TypeError(`${testCase.id}: labeled evidence URI must not be empty`);
|
|
79
|
+
}
|
|
80
|
+
function harmonicMeanScore(a, b) {
|
|
81
|
+
return a + b === 0 ? 0 : 2 * a * b / (a + b);
|
|
82
|
+
}
|
|
83
|
+
function matchFindingsToIssues(issues, findings) {
|
|
84
|
+
if (issues.length === 0) return /* @__PURE__ */ new Map();
|
|
85
|
+
const cardinalityWeight = issues.length + 1;
|
|
86
|
+
const scores = issues.map((issue) => [...findings.map((finding) => {
|
|
87
|
+
if (!findingMatchesIssue(finding, issue)) return -1;
|
|
88
|
+
const criticalHit = (issue.criticalEvidence?.length ?? 0) > 0 && matchesEvidence(finding.evidence_refs, issue.criticalEvidence ?? [], "any");
|
|
89
|
+
return cardinalityWeight + Number(criticalHit);
|
|
90
|
+
}), ...Array.from({ length: issues.length }, () => 0)]);
|
|
91
|
+
const assignment = linearSumAssignment(scores, { maximaze: true }).rowAssignments;
|
|
92
|
+
const matches = /* @__PURE__ */ new Map();
|
|
93
|
+
for (const [issueIndex, column] of assignment.entries()) {
|
|
94
|
+
if (column < 0 || column >= findings.length) continue;
|
|
95
|
+
if (!findingMatchesIssue(findings[column], issues[issueIndex])) continue;
|
|
96
|
+
matches.set(issueIndex, column);
|
|
97
|
+
}
|
|
98
|
+
return matches;
|
|
99
|
+
}
|
|
100
|
+
function findingMatchesIssue(finding, issue) {
|
|
101
|
+
if (issue.findingIds && !issue.findingIds.includes(finding.finding_id)) return false;
|
|
102
|
+
if (issue.areas && !issue.areas.includes(finding.area)) return false;
|
|
103
|
+
if (issue.subjects && (!finding.subject || !issue.subjects.includes(finding.subject))) return false;
|
|
104
|
+
if (issue.evidence && !matchesEvidence(finding.evidence_refs, issue.evidence, issue.evidenceMode ?? "any")) return false;
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
function matchesEvidence(actual, expected, mode) {
|
|
108
|
+
if (expected.length === 0) return true;
|
|
109
|
+
const match = (target) => actual.some((ref) => evidenceMatches(ref, target));
|
|
110
|
+
return mode === "all" ? expected.every(match) : expected.some(match);
|
|
111
|
+
}
|
|
112
|
+
function evidenceMatches(actual, expected) {
|
|
113
|
+
return actual.uri === expected.uri && (expected.kind === void 0 || actual.kind === expected.kind);
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/analyst/benchmark-summary.ts
|
|
117
|
+
function summarizeAnalystBenchmarkRunner(runnerId, observations) {
|
|
118
|
+
const issueBearing = observations.filter((observation) => observation.labelState === "positive");
|
|
119
|
+
const completed = observations.filter((observation) => !observation.error);
|
|
120
|
+
const expectedIssues = issueBearing.reduce((sum, observation) => sum + observation.score.expectedIssueCount, 0);
|
|
121
|
+
const matchedIssues = issueBearing.reduce((sum, observation) => sum + observation.score.matchedIssueIds.length, 0);
|
|
122
|
+
const issueFindings = issueBearing.reduce((sum, observation) => sum + (observation.error ? 0 : observation.findings.length), 0);
|
|
123
|
+
const supportedFindings = issueBearing.reduce((sum, observation) => sum + observation.score.supportedFindingIndexes.length, 0);
|
|
124
|
+
const issueRecall = expectedIssues === 0 ? null : matchedIssues / expectedIssues;
|
|
125
|
+
const findingPrecision = expectedIssues === 0 ? null : issueFindings === 0 ? 0 : supportedFindings / issueFindings;
|
|
126
|
+
const macroIssueRecall = issueBearing.length === 0 ? null : mean$2(issueBearing.map((observation) => observation.score.issueRecall));
|
|
127
|
+
const macroFindingPrecision = issueBearing.length === 0 ? null : mean$2(issueBearing.map((observation) => observation.score.findingPrecision));
|
|
128
|
+
const macroF1 = issueBearing.length === 0 ? null : mean$2(issueBearing.map((observation) => observation.score.f1));
|
|
129
|
+
const critical = observations.map((observation) => observation.score.criticalStepAccuracy).filter((value) => value !== null);
|
|
130
|
+
const findingsWithEvidence = completed.reduce((sum, observation) => sum + observation.findings.filter((finding) => finding.evidence_refs.length > 0).length, 0);
|
|
131
|
+
const allFindings = completed.reduce((sum, observation) => sum + observation.findings.length, 0);
|
|
132
|
+
const allCitations = completed.flatMap((observation) => observation.findings.flatMap((finding) => finding.evidence_refs));
|
|
133
|
+
const citationObservations = completed.filter((observation) => observation.score.citationLabelAgreement !== null);
|
|
134
|
+
const citationCount = citationObservations.reduce((sum, observation) => sum + observation.findings.reduce((count, finding) => count + finding.evidence_refs.length, 0), 0);
|
|
135
|
+
const invalidCitationCount = citationObservations.reduce((sum, observation) => sum + observation.score.unlabeledEvidence.length, 0);
|
|
136
|
+
const trustedNegative = observations.filter((observation) => observation.labelState === "trusted-negative");
|
|
137
|
+
const completedTrustedNegative = trustedNegative.filter((observation) => !observation.error);
|
|
138
|
+
const unlabeled = observations.filter((observation) => observation.labelState === "unlabeled");
|
|
139
|
+
const completedUnlabeled = unlabeled.filter((observation) => !observation.error);
|
|
140
|
+
const resolvedCitations = completed.reduce((sum, observation) => sum + (observation.evidenceResolution?.resolved ?? 0), 0);
|
|
141
|
+
const unresolvedCitations = completed.reduce((sum, observation) => sum + (observation.evidenceResolution?.unresolvedEvidence.length ?? 0), 0);
|
|
142
|
+
const citationResolutionErrors = completed.reduce((sum, observation) => sum + (observation.evidenceResolution?.errors.length ?? 0), 0);
|
|
143
|
+
const resolutionAttempts = completed.filter((observation) => observation.findings.some((finding) => finding.evidence_refs.length > 0));
|
|
144
|
+
const citationResolutionUnknownRuns = resolutionAttempts.filter((observation) => !observation.evidenceResolution || observation.evidenceResolution.errors.length > 0).length;
|
|
145
|
+
const usages = observations.map((observation) => observation.usage);
|
|
146
|
+
const knownCostUsd = stableSum(usages.map((usage) => {
|
|
147
|
+
if (!usage) return 0;
|
|
148
|
+
return usage.cost.kind === "uncaptured" ? usage.knownCostUsd ?? 0 : usage.cost.usd;
|
|
149
|
+
}));
|
|
150
|
+
const predictionAgreement = repeatedObservationAgreement(observations, predictionSignature);
|
|
151
|
+
const matchedLabelAgreement = repeatedObservationAgreement(observations.filter((observation) => observation.labelState === "positive"), matchedLabelSignature);
|
|
152
|
+
return {
|
|
153
|
+
runnerId,
|
|
154
|
+
plannedRuns: observations.length,
|
|
155
|
+
completedRuns: observations.filter((observation) => !observation.error).length,
|
|
156
|
+
failedRuns: observations.filter((observation) => Boolean(observation.error)).length,
|
|
157
|
+
issueBearingRuns: issueBearing.length,
|
|
158
|
+
trustedNegativeRuns: trustedNegative.length,
|
|
159
|
+
unlabeledRuns: unlabeled.length,
|
|
160
|
+
issueRecall,
|
|
161
|
+
findingPrecision,
|
|
162
|
+
f1: findingPrecision === null || issueRecall === null ? null : harmonicMeanScore(findingPrecision, issueRecall),
|
|
163
|
+
macroIssueRecall,
|
|
164
|
+
macroFindingPrecision,
|
|
165
|
+
macroF1,
|
|
166
|
+
criticalStepAccuracy: critical.length === 0 ? null : mean$2(critical),
|
|
167
|
+
citationCoverage: allFindings === 0 ? null : findingsWithEvidence / allFindings,
|
|
168
|
+
citationExcerptCoverage: allCitations.length === 0 ? null : allCitations.filter((evidence) => Boolean(evidence.excerpt?.trim())).length / allCitations.length,
|
|
169
|
+
citationLabelAgreement: citationObservations.length === 0 ? null : citationCount === 0 ? 0 : (citationCount - invalidCitationCount) / citationCount,
|
|
170
|
+
citationResolution: resolutionAttempts.length === 0 || citationResolutionUnknownRuns > 0 || resolvedCitations + unresolvedCitations === 0 ? null : resolvedCitations / (resolvedCitations + unresolvedCitations),
|
|
171
|
+
citationResolutionUnknownRuns,
|
|
172
|
+
unresolvedCitations,
|
|
173
|
+
citationResolutionErrors,
|
|
174
|
+
trustedNegativeFalsePositiveRate: completedTrustedNegative.length === 0 ? null : completedTrustedNegative.filter((observation) => observation.score.predictionOnLabelEmptyCase).length / completedTrustedNegative.length,
|
|
175
|
+
trustedNegativeFailureRate: trustedNegative.length === 0 ? null : trustedNegative.filter((observation) => Boolean(observation.error)).length / trustedNegative.length,
|
|
176
|
+
unlabeledPredictionRate: completedUnlabeled.length === 0 ? null : completedUnlabeled.filter((observation) => observation.findings.length > 0).length / completedUnlabeled.length,
|
|
177
|
+
unlabeledFailureRate: unlabeled.length === 0 ? null : unlabeled.filter((observation) => Boolean(observation.error)).length / unlabeled.length,
|
|
178
|
+
predictionAgreement: predictionAgreement.value,
|
|
179
|
+
predictionAgreementCases: predictionAgreement.cases,
|
|
180
|
+
matchedLabelAgreement: matchedLabelAgreement.value,
|
|
181
|
+
matchedLabelAgreementCases: matchedLabelAgreement.cases,
|
|
182
|
+
latencyMs: latencyDistribution(observations.map((observation) => observation.latencyMs).filter((value) => value !== null)),
|
|
183
|
+
benchmarkClockLatencyRuns: observations.filter((observation) => observation.latencySource === "benchmark-clock").length,
|
|
184
|
+
runnerReportedLatencyRuns: observations.filter((observation) => observation.latencySource === "runner-reported").length,
|
|
185
|
+
latencyUnknownRuns: observations.filter((observation) => observation.latencySource === "uncaptured").length,
|
|
186
|
+
calls: usages.reduce((sum, usage) => sum + (usage?.calls ?? 0), 0),
|
|
187
|
+
callsUnknownRuns: usages.filter((usage) => !usage || usage.calls === null).length,
|
|
188
|
+
inputTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.input ?? 0), 0),
|
|
189
|
+
outputTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.output ?? 0), 0),
|
|
190
|
+
reasoningTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.reasoning ?? 0), 0),
|
|
191
|
+
cachedTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.cached ?? 0), 0),
|
|
192
|
+
cacheWriteTokens: usages.reduce((sum, usage) => sum + (usage?.tokens?.cacheWrite ?? 0), 0),
|
|
193
|
+
tokenUsageUnknownRuns: usages.filter((usage) => !usage?.tokens).length,
|
|
194
|
+
reasoningTokenUsageUnknownRuns: usages.filter((usage) => usage?.tokens?.reasoning === void 0).length,
|
|
195
|
+
cachedTokenUsageUnknownRuns: usages.filter((usage) => usage?.tokens?.cached === void 0).length,
|
|
196
|
+
cacheWriteTokenUsageUnknownRuns: usages.filter((usage) => usage?.tokens?.cacheWrite === void 0).length,
|
|
197
|
+
knownCostUsd,
|
|
198
|
+
costUnknownRuns: usages.filter((usage) => !usage || usage.cost.kind === "uncaptured").length
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function mean$2(values) {
|
|
202
|
+
return values.length === 0 ? 0 : stableSum(values) / values.length;
|
|
203
|
+
}
|
|
204
|
+
function stableSum(values) {
|
|
205
|
+
const ordered = [...values].sort((left, right) => Math.abs(left) - Math.abs(right) || left - right);
|
|
206
|
+
let sum = 0;
|
|
207
|
+
let correction = 0;
|
|
208
|
+
for (const value of ordered) {
|
|
209
|
+
const next = sum + value;
|
|
210
|
+
correction += Math.abs(sum) >= Math.abs(value) ? sum - next + value : value - next + sum;
|
|
211
|
+
sum = next;
|
|
212
|
+
}
|
|
213
|
+
return sum + correction;
|
|
214
|
+
}
|
|
215
|
+
function latencyDistribution(values) {
|
|
216
|
+
if (values.length === 0) return null;
|
|
217
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
218
|
+
return {
|
|
219
|
+
min: sorted[0],
|
|
220
|
+
mean: mean$2(sorted),
|
|
221
|
+
p50: percentile(sorted, .5),
|
|
222
|
+
p95: percentile(sorted, .95),
|
|
223
|
+
max: sorted.at(-1)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function percentile(sorted, quantile) {
|
|
227
|
+
if (sorted.length === 0) return 0;
|
|
228
|
+
return sorted[Math.ceil(quantile * sorted.length) - 1] ?? sorted.at(-1) ?? 0;
|
|
229
|
+
}
|
|
230
|
+
function repeatedObservationAgreement(observations, signature) {
|
|
231
|
+
const byCase = /* @__PURE__ */ new Map();
|
|
232
|
+
for (const observation of observations) {
|
|
233
|
+
const rows = byCase.get(observation.caseId) ?? [];
|
|
234
|
+
rows.push(observation);
|
|
235
|
+
byCase.set(observation.caseId, rows);
|
|
236
|
+
}
|
|
237
|
+
const caseAgreements = [];
|
|
238
|
+
for (const rows of byCase.values()) {
|
|
239
|
+
const agreements = [];
|
|
240
|
+
for (let left = 0; left < rows.length; left++) for (let right = left + 1; right < rows.length; right++) agreements.push(jaccard(signature(rows[left]), signature(rows[right])));
|
|
241
|
+
if (agreements.length > 0) caseAgreements.push(mean$2(agreements));
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
value: caseAgreements.length === 0 ? null : mean$2(caseAgreements),
|
|
245
|
+
cases: caseAgreements.length
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function matchedLabelSignature(observation) {
|
|
249
|
+
if (observation.error) return [`error:${observation.error.class}`];
|
|
250
|
+
return observation.score.matchedIssueIds;
|
|
251
|
+
}
|
|
252
|
+
function predictionSignature(observation) {
|
|
253
|
+
if (observation.error) return [`error:${observation.error.class}`];
|
|
254
|
+
return observation.findings.map((finding) => JSON.stringify([finding.finding_id, finding.evidence_refs.map((evidence) => [
|
|
255
|
+
evidence.kind,
|
|
256
|
+
evidence.uri,
|
|
257
|
+
evidence.excerpt ?? null
|
|
258
|
+
]).sort((left, right) => compareCodeUnits(JSON.stringify(left), JSON.stringify(right)))])).sort();
|
|
259
|
+
}
|
|
260
|
+
function jaccard(left, right) {
|
|
261
|
+
const a = new Set(left);
|
|
262
|
+
const b = new Set(right);
|
|
263
|
+
const union = /* @__PURE__ */ new Set([...a, ...b]);
|
|
264
|
+
if (union.size === 0) return 1;
|
|
265
|
+
let intersection = 0;
|
|
266
|
+
for (const value of a) if (b.has(value)) intersection += 1;
|
|
267
|
+
return intersection / union.size;
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/analyst/benchmark.ts
|
|
271
|
+
/**
|
|
272
|
+
* Resolve canonical `trace://<trace>/span/<span>` evidence against a trace store.
|
|
273
|
+
* Other evidence kinds and URI schemes require a caller-supplied resolver.
|
|
274
|
+
*/
|
|
275
|
+
function traceStoreEvidenceResolver(getStore) {
|
|
276
|
+
return async ({ caseInput, evidence, signal }) => {
|
|
277
|
+
if (evidence.kind !== "span") return false;
|
|
278
|
+
const location = parseTraceSpanUri(evidence.uri);
|
|
279
|
+
if (!location) return false;
|
|
280
|
+
const result = await getStore(caseInput).viewSpans({
|
|
281
|
+
trace_id: location.traceId,
|
|
282
|
+
span_ids: [location.spanId]
|
|
283
|
+
}, signal ? { signal } : void 0);
|
|
284
|
+
return result.trace_id === location.traceId && result.missing_span_ids.length === 0 && result.spans.some((span) => span.span_id === location.spanId);
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
async function runAnalystBenchmark(options) {
|
|
288
|
+
validateBenchmarkOptions(options);
|
|
289
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
290
|
+
const repetitions = options.repetitions ?? 1;
|
|
291
|
+
const runnerOrderSeed = options.runnerOrderSeed ?? 0;
|
|
292
|
+
const allJobs = benchmarkJobs(options.cases, options.runners, repetitions, runnerOrderSeed);
|
|
293
|
+
const maxConcurrency = Math.min(options.maxConcurrency ?? 1, allJobs.length);
|
|
294
|
+
const initialObservations = validateInitialObservations(options.initialObservations ?? [], allJobs);
|
|
295
|
+
const completed = new Set(initialObservations.map(observationKey$1));
|
|
296
|
+
const jobs = allJobs.filter((job) => !completed.has(jobKey(job)));
|
|
297
|
+
const observations = [...initialObservations];
|
|
298
|
+
let cursor = 0;
|
|
299
|
+
const worker = async () => {
|
|
300
|
+
while (cursor < jobs.length) {
|
|
301
|
+
options.signal?.throwIfAborted();
|
|
302
|
+
const job = jobs[cursor++];
|
|
303
|
+
const observation = await runBenchmarkJob(job, options.signal, options.resolveEvidence);
|
|
304
|
+
options.signal?.throwIfAborted();
|
|
305
|
+
await options.onObservation?.(observation);
|
|
306
|
+
options.signal?.throwIfAborted();
|
|
307
|
+
observations.push(observation);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
await Promise.all(Array.from({ length: Math.min(maxConcurrency, jobs.length) }, worker));
|
|
311
|
+
options.signal?.throwIfAborted();
|
|
312
|
+
const runnerOrder = new Map(options.runners.map((runner, index) => [runner.id, index]));
|
|
313
|
+
const caseOrder = new Map(options.cases.map((testCase, index) => [testCase.id, index]));
|
|
314
|
+
observations.sort((a, b) => (runnerOrder.get(a.runnerId) ?? 0) - (runnerOrder.get(b.runnerId) ?? 0) || (caseOrder.get(a.caseId) ?? 0) - (caseOrder.get(b.caseId) ?? 0) || a.repetition - b.repetition);
|
|
315
|
+
return {
|
|
316
|
+
provenance: {
|
|
317
|
+
...options.benchmark,
|
|
318
|
+
startedAt,
|
|
319
|
+
endedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
320
|
+
caseCount: options.cases.length,
|
|
321
|
+
runnerIds: options.runners.map((runner) => runner.id),
|
|
322
|
+
repetitions,
|
|
323
|
+
maxConcurrency,
|
|
324
|
+
runnerOrderSeed
|
|
325
|
+
},
|
|
326
|
+
observations,
|
|
327
|
+
summaries: options.runners.map((runner) => summarizeAnalystBenchmarkRunner(runner.id, observations.filter((observation) => observation.runnerId === runner.id)))
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
async function runBenchmarkJob(job, signal, resolveEvidence) {
|
|
331
|
+
const started = performance.now();
|
|
332
|
+
try {
|
|
333
|
+
const output = await job.runner.analyze(job.testCase.input, {
|
|
334
|
+
caseId: job.testCase.id,
|
|
335
|
+
repetition: job.repetition,
|
|
336
|
+
signal
|
|
337
|
+
});
|
|
338
|
+
if (output.usage) assertValidAnalystUsageReceipt(output.usage, "analyst benchmark usage");
|
|
339
|
+
const benchmarkLatencyMs = performance.now() - started;
|
|
340
|
+
const latency = resolveBenchmarkLatency(output.observedLatencyMs, benchmarkLatencyMs);
|
|
341
|
+
const scoredFindings = output.error ? [] : output.findings;
|
|
342
|
+
return {
|
|
343
|
+
runnerId: job.runner.id,
|
|
344
|
+
caseId: job.testCase.id,
|
|
345
|
+
clusterId: job.testCase.clusterId,
|
|
346
|
+
labelState: job.testCase.labelState,
|
|
347
|
+
repetition: job.repetition,
|
|
348
|
+
executionIndex: job.executionIndex,
|
|
349
|
+
latencyMs: latency.value,
|
|
350
|
+
latencySource: latency.source,
|
|
351
|
+
findings: output.findings,
|
|
352
|
+
score: scoreAnalystFindings(job.testCase, scoredFindings),
|
|
353
|
+
evidenceResolution: resolveEvidence ? await resolveFindingEvidence(job.testCase, output.findings, resolveEvidence, signal) : void 0,
|
|
354
|
+
caseTags: [...job.testCase.tags ?? []],
|
|
355
|
+
caseMetadata: job.testCase.metadata,
|
|
356
|
+
usage: output.usage,
|
|
357
|
+
runnerMetadata: output.metadata,
|
|
358
|
+
...output.error ? { error: output.error } : {}
|
|
359
|
+
};
|
|
360
|
+
} catch (error) {
|
|
361
|
+
if (signal?.aborted) throw error;
|
|
362
|
+
const findings = [];
|
|
363
|
+
return {
|
|
364
|
+
runnerId: job.runner.id,
|
|
365
|
+
caseId: job.testCase.id,
|
|
366
|
+
clusterId: job.testCase.clusterId,
|
|
367
|
+
labelState: job.testCase.labelState,
|
|
368
|
+
repetition: job.repetition,
|
|
369
|
+
executionIndex: job.executionIndex,
|
|
370
|
+
latencyMs: performance.now() - started,
|
|
371
|
+
latencySource: "benchmark-clock",
|
|
372
|
+
findings,
|
|
373
|
+
score: scoreAnalystFindings(job.testCase, findings),
|
|
374
|
+
caseTags: [...job.testCase.tags ?? []],
|
|
375
|
+
caseMetadata: job.testCase.metadata,
|
|
376
|
+
error: {
|
|
377
|
+
class: error instanceof Error ? error.constructor.name : "Error",
|
|
378
|
+
message: error instanceof Error ? error.message : String(error)
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
function resolveBenchmarkLatency(observedLatencyMs, fallbackMs) {
|
|
384
|
+
if (observedLatencyMs === void 0) return {
|
|
385
|
+
value: fallbackMs,
|
|
386
|
+
source: "benchmark-clock"
|
|
387
|
+
};
|
|
388
|
+
if (observedLatencyMs === null) return {
|
|
389
|
+
value: null,
|
|
390
|
+
source: "uncaptured"
|
|
391
|
+
};
|
|
392
|
+
if (!Number.isFinite(observedLatencyMs) || observedLatencyMs < 0) throw new RangeError("analyst benchmark observedLatencyMs must be finite and non-negative");
|
|
393
|
+
return {
|
|
394
|
+
value: observedLatencyMs,
|
|
395
|
+
source: "runner-reported"
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function benchmarkJobs(cases, runners, repetitions, runnerOrderSeed) {
|
|
399
|
+
const seededRunners = [...runners].sort((left, right) => stableHash(`${runnerOrderSeed}\u0000${left.id}`) - stableHash(`${runnerOrderSeed}\u0000${right.id}`) || left.id.localeCompare(right.id));
|
|
400
|
+
let executionIndex = 0;
|
|
401
|
+
return cases.flatMap((testCase, caseIndex) => Array.from({ length: repetitions }, (_, repetition) => {
|
|
402
|
+
const rotation = (caseIndex * repetitions + repetition) % seededRunners.length;
|
|
403
|
+
return [...seededRunners.slice(rotation), ...seededRunners.slice(0, rotation)].map((runner) => ({
|
|
404
|
+
runner,
|
|
405
|
+
testCase,
|
|
406
|
+
repetition,
|
|
407
|
+
executionIndex: executionIndex++
|
|
408
|
+
}));
|
|
409
|
+
}).flat());
|
|
410
|
+
}
|
|
411
|
+
function validateInitialObservations(observations, jobs) {
|
|
412
|
+
const expected = new Map(jobs.map((job) => [jobKey(job), job]));
|
|
413
|
+
const seen = /* @__PURE__ */ new Set();
|
|
414
|
+
return observations.map((observation) => {
|
|
415
|
+
const key = observationKey$1(observation);
|
|
416
|
+
if (seen.has(key)) throw new TypeError(`duplicate initial analyst benchmark observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}'`);
|
|
417
|
+
seen.add(key);
|
|
418
|
+
const job = expected.get(key);
|
|
419
|
+
if (!job) throw new TypeError(`initial analyst benchmark observation does not match a planned job: '${observation.runnerId}/${observation.caseId}/${observation.repetition}'`);
|
|
420
|
+
if (observation.executionIndex !== job.executionIndex) throw new TypeError(`initial analyst benchmark observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}' has executionIndex ${observation.executionIndex}; expected ${job.executionIndex}`);
|
|
421
|
+
if (observation.clusterId !== job.testCase.clusterId || observation.labelState !== job.testCase.labelState) throw new TypeError(`initial analyst benchmark observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}' does not match the current case labels`);
|
|
422
|
+
if (JSON.stringify(observation.caseTags) !== JSON.stringify(job.testCase.tags ?? []) || JSON.stringify(observation.caseMetadata) !== JSON.stringify(job.testCase.metadata)) throw new TypeError(`initial analyst benchmark observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}' does not match the current case metadata`);
|
|
423
|
+
const expectedScore = scoreAnalystFindings(job.testCase, observation.error ? [] : observation.findings);
|
|
424
|
+
if (JSON.stringify(observation.score) !== JSON.stringify(expectedScore)) throw new TypeError(`initial analyst benchmark observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}' has stale or invalid scores`);
|
|
425
|
+
if (observation.usage) assertValidAnalystUsageReceipt(observation.usage, `initial analyst benchmark observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}' usage`);
|
|
426
|
+
if (![
|
|
427
|
+
"benchmark-clock",
|
|
428
|
+
"runner-reported",
|
|
429
|
+
"uncaptured"
|
|
430
|
+
].includes(observation.latencySource) || observation.latencySource === "uncaptured" && observation.latencyMs !== null || observation.latencySource !== "uncaptured" && (observation.latencyMs === null || !Number.isFinite(observation.latencyMs) || observation.latencyMs < 0)) throw new TypeError(`initial analyst benchmark observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}' has invalid latency`);
|
|
431
|
+
return { ...observation };
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
function jobKey(job) {
|
|
435
|
+
return `${job.runner.id}\u0000${job.testCase.id}\u0000${job.repetition}`;
|
|
436
|
+
}
|
|
437
|
+
function observationKey$1(observation) {
|
|
438
|
+
return `${observation.runnerId}\u0000${observation.caseId}\u0000${observation.repetition}`;
|
|
439
|
+
}
|
|
440
|
+
async function resolveFindingEvidence(testCase, findings, resolver, signal) {
|
|
441
|
+
const evidence = findings.flatMap((finding) => finding.evidence_refs);
|
|
442
|
+
const resolved = [];
|
|
443
|
+
const unresolvedEvidence = [];
|
|
444
|
+
const errors = [];
|
|
445
|
+
for (const ref of evidence) {
|
|
446
|
+
signal?.throwIfAborted();
|
|
447
|
+
try {
|
|
448
|
+
if (await resolver({
|
|
449
|
+
caseId: testCase.id,
|
|
450
|
+
caseInput: testCase.input,
|
|
451
|
+
evidence: ref,
|
|
452
|
+
signal
|
|
453
|
+
})) resolved.push(ref);
|
|
454
|
+
else unresolvedEvidence.push(ref);
|
|
455
|
+
} catch (error) {
|
|
456
|
+
if (signal?.aborted) throw error;
|
|
457
|
+
errors.push({
|
|
458
|
+
evidence: ref,
|
|
459
|
+
class: error instanceof Error ? error.constructor.name : "Error",
|
|
460
|
+
message: error instanceof Error ? error.message : String(error)
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return {
|
|
465
|
+
checked: evidence.length,
|
|
466
|
+
resolved: resolved.length,
|
|
467
|
+
unresolvedEvidence,
|
|
468
|
+
errors,
|
|
469
|
+
validity: evidence.length === 0 || errors.length > 0 ? null : resolved.length / evidence.length
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
function parseTraceSpanUri(uri) {
|
|
473
|
+
const match = /^trace:\/\/([^/]+)\/span\/([^/]+)$/.exec(uri);
|
|
474
|
+
if (!match) return null;
|
|
475
|
+
try {
|
|
476
|
+
const traceId = decodeURIComponent(match[1]);
|
|
477
|
+
const spanId = decodeURIComponent(match[2]);
|
|
478
|
+
return traceId && spanId ? {
|
|
479
|
+
traceId,
|
|
480
|
+
spanId
|
|
481
|
+
} : null;
|
|
482
|
+
} catch {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
function validateBenchmarkOptions(options) {
|
|
487
|
+
if (options.cases.length === 0) throw new TypeError("runAnalystBenchmark requires cases");
|
|
488
|
+
if (options.runners.length === 0) throw new TypeError("runAnalystBenchmark requires runners");
|
|
489
|
+
const repetitions = options.repetitions ?? 1;
|
|
490
|
+
const maxConcurrency = options.maxConcurrency ?? 1;
|
|
491
|
+
if (!Number.isSafeInteger(repetitions) || repetitions < 1) throw new RangeError("runAnalystBenchmark repetitions must be a positive safe integer");
|
|
492
|
+
if (!Number.isSafeInteger(maxConcurrency) || maxConcurrency < 1) throw new RangeError("runAnalystBenchmark maxConcurrency must be a positive safe integer");
|
|
493
|
+
if (!Number.isSafeInteger(options.runnerOrderSeed ?? 0)) throw new RangeError("runAnalystBenchmark runnerOrderSeed must be a safe integer");
|
|
494
|
+
assertUniqueNonEmpty(options.cases.map((testCase) => testCase.id), "case");
|
|
495
|
+
assertUniqueNonEmpty(options.runners.map((runner) => runner.id), "runner");
|
|
496
|
+
for (const testCase of options.cases) validateBenchmarkCase(testCase);
|
|
497
|
+
}
|
|
498
|
+
function validateBenchmarkCase(testCase) {
|
|
499
|
+
assertValidAnalystScoringCase(testCase);
|
|
500
|
+
if (!testCase.clusterId.trim()) throw new TypeError(`${testCase.id}: analyst benchmark clusterId must not be empty`);
|
|
501
|
+
if (testCase.labelState !== "positive" && testCase.labelState !== "trusted-negative" && testCase.labelState !== "unlabeled") throw new TypeError(`${testCase.id}: analyst benchmark labelState is invalid`);
|
|
502
|
+
if (testCase.labelState === "positive" && testCase.expectedIssues.length === 0) throw new TypeError(`${testCase.id}: positive case requires at least one expected issue`);
|
|
503
|
+
if (testCase.labelState !== "positive" && testCase.expectedIssues.length > 0) throw new TypeError(`${testCase.id}: ${testCase.labelState} case cannot contain expected issues`);
|
|
504
|
+
}
|
|
505
|
+
function assertUniqueNonEmpty(values, label) {
|
|
506
|
+
const seen = /* @__PURE__ */ new Set();
|
|
507
|
+
for (const value of values) {
|
|
508
|
+
if (!value.trim()) throw new TypeError(`analyst benchmark ${label} id must not be empty`);
|
|
509
|
+
if (seen.has(value)) throw new TypeError(`duplicate analyst benchmark ${label} id '${value}'`);
|
|
510
|
+
seen.add(value);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
/** 32-bit FNV-1a over raw UTF-16 code units, left SIGNED so subtracting two
|
|
514
|
+
* results is a valid comparator.
|
|
515
|
+
*
|
|
516
|
+
* Frozen: it fixes the runner order a benchmark reports. Adding the `>>> 0`
|
|
517
|
+
* the other variants carry would change that order, which is why this one
|
|
518
|
+
* does not have it. */
|
|
519
|
+
function stableHash(value) {
|
|
520
|
+
let hash = 2166136261;
|
|
521
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
522
|
+
hash ^= value.charCodeAt(index);
|
|
523
|
+
hash = Math.imul(hash, 16777619);
|
|
524
|
+
}
|
|
525
|
+
return hash >>> 0;
|
|
526
|
+
}
|
|
527
|
+
//#endregion
|
|
31
528
|
//#region src/analyst/benchmark-dataset-utils.ts
|
|
32
529
|
function normalizeBenchmarkLabel(value) {
|
|
33
530
|
const normalized = nonEmpty$1(value, "benchmark label").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
@@ -47,9 +544,6 @@ function assertStepWithinRange(step, stepCount, field) {
|
|
|
47
544
|
function defaultStepUri(trajectoryId, step) {
|
|
48
545
|
return `trace://${encodeURIComponent(trajectoryId)}/span/step-${step}`;
|
|
49
546
|
}
|
|
50
|
-
function isRecord$2(value) {
|
|
51
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
52
|
-
}
|
|
53
547
|
function positiveStep(value, field) {
|
|
54
548
|
if (!Number.isSafeInteger(value) || value < 1) throw new RangeError(`${field} must be a positive safe integer`);
|
|
55
549
|
return value;
|
|
@@ -203,7 +697,7 @@ function parseAgentRxPredictions(output, trajectoryId) {
|
|
|
203
697
|
let failures;
|
|
204
698
|
let report;
|
|
205
699
|
if (Array.isArray(output)) failures = output;
|
|
206
|
-
else if (isRecord
|
|
700
|
+
else if (isRecord(output)) {
|
|
207
701
|
assertMatchingAgentRxTaskId(output.task_id, trajectoryId, "report.task_id");
|
|
208
702
|
if (!Object.hasOwn(output, "failures")) throw new TypeError(`AgentRx prediction '${trajectoryId}' report must contain failures`);
|
|
209
703
|
failures = output.failures;
|
|
@@ -219,11 +713,11 @@ function parseAgentRxPredictions(output, trajectoryId) {
|
|
|
219
713
|
} else throw new TypeError(`AgentRx prediction '${trajectoryId}' must be a report or failures array`);
|
|
220
714
|
if (!Array.isArray(failures)) throw new TypeError(`AgentRx prediction '${trajectoryId}' failures must be an array`);
|
|
221
715
|
if (failures.length === 0) throw new TypeError(`AgentRx prediction '${trajectoryId}' failures must contain a judge prediction`);
|
|
222
|
-
if (isRecord
|
|
716
|
+
if (isRecord(output) && output.num_judges !== void 0 && output.num_judges !== failures.length) throw new TypeError(`AgentRx prediction '${trajectoryId}' declares ${output.num_judges} judges but contains ${failures.length} failures`);
|
|
223
717
|
return {
|
|
224
718
|
predictions: failures.map((value, index) => {
|
|
225
719
|
const field = `AgentRx prediction '${trajectoryId}' failures[${index}]`;
|
|
226
|
-
if (!isRecord
|
|
720
|
+
if (!isRecord(value)) throw new TypeError(`${field} must be an object`);
|
|
227
721
|
assertMatchingAgentRxTaskId(value.task_id, trajectoryId, `${field}.task_id`);
|
|
228
722
|
const failureCase = parseAgentRxFailureCase(value.failure_case, `${field}.failure_case`);
|
|
229
723
|
if (!Number.isSafeInteger(value.step_number)) throw new TypeError(`${field}.step_number must be a safe integer`);
|
|
@@ -437,7 +931,7 @@ function parseCodeTracerPredictionLabels(value, trajectoryId) {
|
|
|
437
931
|
flat.push(toCodeTracerPredictionLabel(item, codeTracerStageId(item, index + 1, trajectoryId), trajectoryId));
|
|
438
932
|
continue;
|
|
439
933
|
}
|
|
440
|
-
if (!isRecord
|
|
934
|
+
if (!isRecord(item) || !Array.isArray(item.labels)) throw new TypeError(`CodeTracer prediction '${trajectoryId}' contains an unsupported label row`);
|
|
441
935
|
const stageId = codeTracerStageId(item, index + 1, trajectoryId);
|
|
442
936
|
for (const label of item.labels) {
|
|
443
937
|
if (!isCodeTracerStepLabel(label)) throw new TypeError(`CodeTracer prediction '${trajectoryId}' contains an invalid step label`);
|
|
@@ -447,10 +941,10 @@ function parseCodeTracerPredictionLabels(value, trajectoryId) {
|
|
|
447
941
|
return flat;
|
|
448
942
|
}
|
|
449
943
|
function isCodeTraceStageAnnotation(value) {
|
|
450
|
-
return isRecord
|
|
944
|
+
return isRecord(value) && Number.isSafeInteger(value.stage_id) && value.stage_id > 0 && optionalStepArray(value.incorrect_step_ids) && optionalStepArray(value.unuseful_step_ids) && (value.reasoning === void 0 || typeof value.reasoning === "string");
|
|
451
945
|
}
|
|
452
946
|
function isCodeTracerStepLabel(value) {
|
|
453
|
-
return isRecord
|
|
947
|
+
return isRecord(value) && Number.isSafeInteger(value.step_id) && value.step_id > 0 && (value.stage === void 0 || typeof value.stage === "string" || typeof value.stage === "number") && (value.stage_name === void 0 || typeof value.stage_name === "string" || typeof value.stage_name === "number") && (value.stage_id === void 0 || typeof value.stage_id === "string" || typeof value.stage_id === "number") && (value.label === "incorrect" || value.label === "unuseful") && (value.rationale === void 0 || typeof value.rationale === "string") && (value.reason === void 0 || typeof value.reason === "string") && (value.note === void 0 || typeof value.note === "string") && (value.comment === void 0 || typeof value.comment === "string");
|
|
454
948
|
}
|
|
455
949
|
function toCodeTracerPredictionLabel(label, stageId, trajectoryId) {
|
|
456
950
|
if (!isCodeTracerStepLabel(label)) throw new TypeError(`CodeTracer prediction '${trajectoryId}' contains an invalid step label`);
|
|
@@ -556,20 +1050,20 @@ function summarizeRunner$1(runnerId, observations) {
|
|
|
556
1050
|
failedRuns: observations.filter((observation) => Boolean(observation.error)).length,
|
|
557
1051
|
predictedRuns: predicted.length,
|
|
558
1052
|
missingPredictionRuns: scored.length - predicted.length,
|
|
559
|
-
exactStepAccuracy: mean$
|
|
560
|
-
stepAccuracyWithin1: mean$
|
|
561
|
-
stepAccuracyWithin2: mean$
|
|
562
|
-
stepAccuracyWithin3: mean$
|
|
563
|
-
stepAccuracyWithin4: mean$
|
|
564
|
-
stepAccuracyWithin5: mean$
|
|
565
|
-
meanStepDistance: mean$
|
|
566
|
-
normalizedMeanStepDistance: mean$
|
|
1053
|
+
exactStepAccuracy: mean$1(scored.map((row) => Number(row.roundedDistance === 0))),
|
|
1054
|
+
stepAccuracyWithin1: mean$1(scored.map((row) => Number(row.roundedDistance !== null && row.roundedDistance <= 1))),
|
|
1055
|
+
stepAccuracyWithin2: mean$1(scored.map((row) => Number(row.roundedDistance !== null && row.roundedDistance <= 2))),
|
|
1056
|
+
stepAccuracyWithin3: mean$1(scored.map((row) => Number(row.roundedDistance !== null && row.roundedDistance <= 3))),
|
|
1057
|
+
stepAccuracyWithin4: mean$1(scored.map((row) => Number(row.roundedDistance !== null && row.roundedDistance <= 4))),
|
|
1058
|
+
stepAccuracyWithin5: mean$1(scored.map((row) => Number(row.roundedDistance !== null && row.roundedDistance <= 5))),
|
|
1059
|
+
meanStepDistance: mean$1(predicted.map((row) => row.distance)),
|
|
1060
|
+
normalizedMeanStepDistance: mean$1(normalized.map((row) => row.normalizedDistance)),
|
|
567
1061
|
normalizedDistanceRuns: normalized.length,
|
|
568
1062
|
normalizedDistanceUnknownRuns: scored.length - normalized.length,
|
|
569
|
-
rootCauseCategoryAccuracy: mean$
|
|
570
|
-
anyFailureCategoryAccuracy: mean$
|
|
571
|
-
earliestFailureCategoryAccuracy: mean$
|
|
572
|
-
terminalFailureCategoryAccuracy: mean$
|
|
1063
|
+
rootCauseCategoryAccuracy: mean$1(scored.map((row) => Number(row.rootCategoryMatch))),
|
|
1064
|
+
anyFailureCategoryAccuracy: mean$1(scored.map((row) => Number(row.anyCategoryMatch))),
|
|
1065
|
+
earliestFailureCategoryAccuracy: mean$1(scored.map((row) => Number(row.earliestCategoryMatch))),
|
|
1066
|
+
terminalFailureCategoryAccuracy: mean$1(scored.map((row) => Number(row.terminalCategoryMatch)))
|
|
573
1067
|
};
|
|
574
1068
|
}
|
|
575
1069
|
function scoredObservation(observation) {
|
|
@@ -616,7 +1110,7 @@ function requiredStringArray(value, caseId, field) {
|
|
|
616
1110
|
if (!Array.isArray(value) || value.length === 0 || value.some((entry) => typeof entry !== "string" || !entry.trim())) throw new TypeError(`${caseId}: ${field} must be a non-empty string array`);
|
|
617
1111
|
return value;
|
|
618
1112
|
}
|
|
619
|
-
function mean$
|
|
1113
|
+
function mean$1(values) {
|
|
620
1114
|
return values.length === 0 ? null : values.reduce((total, value) => total + value, 0) / values.length;
|
|
621
1115
|
}
|
|
622
1116
|
function rate$3(value) {
|
|
@@ -728,8 +1222,8 @@ function compareMetric(options) {
|
|
|
728
1222
|
if (caseBefore.length === 0 || !clusterId) continue;
|
|
729
1223
|
pairedCases.push({
|
|
730
1224
|
clusterId,
|
|
731
|
-
baseline: mean$
|
|
732
|
-
candidate: mean$
|
|
1225
|
+
baseline: mean$3(caseBefore),
|
|
1226
|
+
candidate: mean$3(caseAfter)
|
|
733
1227
|
});
|
|
734
1228
|
}
|
|
735
1229
|
const byCluster = /* @__PURE__ */ new Map();
|
|
@@ -738,8 +1232,8 @@ function compareMetric(options) {
|
|
|
738
1232
|
rows.push(pairedCase);
|
|
739
1233
|
byCluster.set(pairedCase.clusterId, rows);
|
|
740
1234
|
}
|
|
741
|
-
const before = [...byCluster.values()].map((rows) => mean$
|
|
742
|
-
const after = [...byCluster.values()].map((rows) => mean$
|
|
1235
|
+
const before = [...byCluster.values()].map((rows) => mean$3(rows.map((row) => row.baseline)));
|
|
1236
|
+
const after = [...byCluster.values()].map((rows) => mean$3(rows.map((row) => row.candidate)));
|
|
743
1237
|
const interval = before.length === 0 ? null : pairedBootstrap(before, after, {
|
|
744
1238
|
confidence: options.confidence,
|
|
745
1239
|
resamples: options.resamples,
|
|
@@ -762,8 +1256,8 @@ function compareMetric(options) {
|
|
|
762
1256
|
candidateMissingObservations,
|
|
763
1257
|
asymmetricMissingObservations,
|
|
764
1258
|
survivorOnly,
|
|
765
|
-
baselineMean: before.length === 0 ? null : mean$
|
|
766
|
-
candidateMean: after.length === 0 ? null : mean$
|
|
1259
|
+
baselineMean: before.length === 0 ? null : mean$3(before),
|
|
1260
|
+
candidateMean: after.length === 0 ? null : mean$3(after),
|
|
767
1261
|
meanDelta: interval?.mean ?? null,
|
|
768
1262
|
intervalLow: interval?.low ?? null,
|
|
769
1263
|
intervalHigh: interval?.high ?? null,
|
|
@@ -821,9 +1315,6 @@ function metricValue(observation, metric) {
|
|
|
821
1315
|
if (observation.usage?.cost.kind === "uncaptured") return null;
|
|
822
1316
|
return observation.usage?.cost.usd ?? null;
|
|
823
1317
|
}
|
|
824
|
-
function mean$1(values) {
|
|
825
|
-
return values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
826
|
-
}
|
|
827
1318
|
function assertComparisonControls(confidence, resamples) {
|
|
828
1319
|
if (!Number.isSafeInteger(resamples) || resamples <= 0 || resamples > 1e6) throw new Error(`compareAnalystRunners: resamples must be a positive safe integer no greater than 1000000, got ${String(resamples)}`);
|
|
829
1320
|
if (!Number.isFinite(confidence) || confidence <= 0 || confidence >= 1) throw new Error(`compareAnalystRunners: confidence must be a finite number in (0,1), got ${String(confidence)}`);
|
|
@@ -1350,7 +1841,7 @@ const ANALYST_BENCHMARK_COST_LEDGER_FILE = "cost-ledger.jsonl";
|
|
|
1350
1841
|
function observationKey(observation) {
|
|
1351
1842
|
return `${observation.runnerId}\u0000${observation.caseId}\u0000${observation.repetition}`;
|
|
1352
1843
|
}
|
|
1353
|
-
function
|
|
1844
|
+
function parseJsonText(text, source) {
|
|
1354
1845
|
try {
|
|
1355
1846
|
return JSON.parse(text);
|
|
1356
1847
|
} catch {
|
|
@@ -1374,22 +1865,13 @@ function digestCanonical(value) {
|
|
|
1374
1865
|
}
|
|
1375
1866
|
/** RFC 8785 canonical JSON of the value's JSON document form — the byte form
|
|
1376
1867
|
* the receipt digests and compares against. */
|
|
1377
|
-
function
|
|
1868
|
+
function canonicalJsonDocument(value) {
|
|
1378
1869
|
return canonicalString(jsonDocument(value));
|
|
1379
1870
|
}
|
|
1380
|
-
function isRecord$1(value) {
|
|
1381
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1382
|
-
}
|
|
1383
1871
|
function isSha256(value) {
|
|
1384
1872
|
return typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
1385
1873
|
}
|
|
1386
|
-
|
|
1387
|
-
//#region src/analyst/benchmark-implementation.ts
|
|
1388
|
-
const ANALYST_BENCHMARK_IMPLEMENTATION_DIGEST_ALGORITHM = "sha256-canonical-source-manifest";
|
|
1389
|
-
/** The dependency files' manifest digest with the package's own version
|
|
1390
|
-
* fields blanked, so a release that only bumps the version keeps the pin. */
|
|
1391
|
-
const ANALYST_BENCHMARK_DEPENDENCY_LOCK_DIGEST_ALGORITHM = "sha256-canonical-file-manifest-without-own-version";
|
|
1392
|
-
const ANALYST_BENCHMARK_DEPENDENCY_LOCK_FILES = Object.freeze([
|
|
1874
|
+
Object.freeze([
|
|
1393
1875
|
"clients/python/pyproject.toml",
|
|
1394
1876
|
"clients/python/uv.lock",
|
|
1395
1877
|
"package.json",
|
|
@@ -1461,7 +1943,12 @@ const ANALYST_BENCHMARK_IMPLEMENTATION_FILES = Object.freeze([
|
|
|
1461
1943
|
"src/campaign/external-optimizer-callback.ts",
|
|
1462
1944
|
"src/campaign/external-optimizer-contracts.ts",
|
|
1463
1945
|
"src/campaign/external-optimizer-http.ts",
|
|
1946
|
+
"src/campaign/external-optimizer-model-contract.ts",
|
|
1947
|
+
"src/campaign/external-optimizer-model-execution.ts",
|
|
1948
|
+
"src/campaign/external-optimizer-model-handler.ts",
|
|
1464
1949
|
"src/campaign/external-optimizer-model-proxy.ts",
|
|
1950
|
+
"src/campaign/external-optimizer-model-request.ts",
|
|
1951
|
+
"src/campaign/external-optimizer-model-response.ts",
|
|
1465
1952
|
"src/campaign/external-optimizer-process.ts",
|
|
1466
1953
|
"src/campaign/external-optimizer-resources.ts",
|
|
1467
1954
|
"src/campaign/external-optimizer-subprocess.ts",
|
|
@@ -1471,6 +1958,12 @@ const ANALYST_BENCHMARK_IMPLEMENTATION_FILES = Object.freeze([
|
|
|
1471
1958
|
"src/campaign/storage.ts",
|
|
1472
1959
|
"src/concurrency.ts",
|
|
1473
1960
|
"src/cost-ledger.ts",
|
|
1961
|
+
"src/cost-ledger/errors.ts",
|
|
1962
|
+
"src/cost-ledger/journal.ts",
|
|
1963
|
+
"src/cost-ledger/pricing.ts",
|
|
1964
|
+
"src/cost-ledger/receipts.ts",
|
|
1965
|
+
"src/cost-ledger/summary.ts",
|
|
1966
|
+
"src/cost-ledger/validation.ts",
|
|
1474
1967
|
"src/errors.ts",
|
|
1475
1968
|
"src/integrity/served-model.ts",
|
|
1476
1969
|
"src/judge-calibration.ts",
|
|
@@ -1485,6 +1978,13 @@ const ANALYST_BENCHMARK_IMPLEMENTATION_FILES = Object.freeze([
|
|
|
1485
1978
|
"src/ledger-core/projector-snapshot.ts",
|
|
1486
1979
|
"src/ledger-core/trusted-head.ts",
|
|
1487
1980
|
"src/llm-client.ts",
|
|
1981
|
+
"src/llm-client/accounting.ts",
|
|
1982
|
+
"src/llm-client/errors.ts",
|
|
1983
|
+
"src/llm-client/json.ts",
|
|
1984
|
+
"src/llm-client/request.ts",
|
|
1985
|
+
"src/llm-client/resilience.ts",
|
|
1986
|
+
"src/llm-client/wire.ts",
|
|
1987
|
+
"src/math/nonnegative-number.ts",
|
|
1488
1988
|
"src/math/normal.ts",
|
|
1489
1989
|
"src/math/quantile.ts",
|
|
1490
1990
|
"src/math/special-functions.ts",
|
|
@@ -1497,6 +1997,7 @@ const ANALYST_BENCHMARK_IMPLEMENTATION_FILES = Object.freeze([
|
|
|
1497
1997
|
"src/statistics/index.ts",
|
|
1498
1998
|
"src/statistics/inference.ts",
|
|
1499
1999
|
"src/statistics/internal.ts",
|
|
2000
|
+
"src/statistics/mean.ts",
|
|
1500
2001
|
"src/statistics/multiplicity.ts",
|
|
1501
2002
|
"src/statistics/paired-binary.ts",
|
|
1502
2003
|
"src/statistics/paired-tests.ts",
|
|
@@ -1511,6 +2012,9 @@ const ANALYST_BENCHMARK_IMPLEMENTATION_FILES = Object.freeze([
|
|
|
1511
2012
|
"src/trace-analyst/store-boundary.ts",
|
|
1512
2013
|
"src/trace-analyst/store-bounds.ts",
|
|
1513
2014
|
"src/trace-analyst/store-contract.ts",
|
|
2015
|
+
"src/trace-analyst/store-otlp-buffered.ts",
|
|
2016
|
+
"src/trace-analyst/store-otlp-error-clusters.ts",
|
|
2017
|
+
"src/trace-analyst/store-otlp-search-offset.ts",
|
|
1514
2018
|
"src/trace-analyst/store-otlp.ts",
|
|
1515
2019
|
"src/trace-analyst/store-schemas.ts",
|
|
1516
2020
|
"src/trace-analyst/store.ts",
|
|
@@ -1520,15 +2024,10 @@ const ANALYST_BENCHMARK_IMPLEMENTATION_FILES = Object.freeze([
|
|
|
1520
2024
|
"src/trace/otlp-attributes.ts",
|
|
1521
2025
|
"src/trace/raw-provider-sink.ts",
|
|
1522
2026
|
"src/trace/redact.ts",
|
|
2027
|
+
"src/trace/redaction/detectors.ts",
|
|
1523
2028
|
"src/verdict-cache.ts"
|
|
1524
2029
|
]);
|
|
1525
|
-
const ANALYST_BENCHMARK_IMPLEMENTATION_SHA256 = "
|
|
1526
|
-
function analystBenchmarkImplementationDigest() {
|
|
1527
|
-
return ANALYST_BENCHMARK_IMPLEMENTATION_SHA256;
|
|
1528
|
-
}
|
|
1529
|
-
function analystBenchmarkDependencyLockDigest() {
|
|
1530
|
-
return ANALYST_BENCHMARK_DEPENDENCY_LOCK_SHA256;
|
|
1531
|
-
}
|
|
2030
|
+
const ANALYST_BENCHMARK_IMPLEMENTATION_SHA256 = "705fdcf5f1226d15fde853ffe5c8f8771fea0dfb0f3e66671748cff8aa70e8b5";
|
|
1532
2031
|
//#endregion
|
|
1533
2032
|
//#region src/analyst/benchmark-evidence-validation.ts
|
|
1534
2033
|
const MIN_ACTION_EXCERPT_CHARACTERS = 12;
|
|
@@ -1985,9 +2484,6 @@ function status(value) {
|
|
|
1985
2484
|
function unsupported(path) {
|
|
1986
2485
|
return /* @__PURE__ */ new TypeError(`final verification result has no supported outcome field: ${path}; expected is_resolved, resolved, valid, or a SWE-bench instance report`);
|
|
1987
2486
|
}
|
|
1988
|
-
function errorMessage(error) {
|
|
1989
|
-
return error instanceof Error ? error.message : String(error);
|
|
1990
|
-
}
|
|
1991
2487
|
//#endregion
|
|
1992
2488
|
//#region src/analyst/benchmark-verification-artifacts.ts
|
|
1993
2489
|
const DEFAULT_MAX_VERIFICATION_ARTIFACT_BYTES = 8388608;
|
|
@@ -2339,17 +2835,6 @@ function isMissing(error) {
|
|
|
2339
2835
|
function isNodeError$1(error, code) {
|
|
2340
2836
|
return error instanceof Error && "code" in error && error.code === code;
|
|
2341
2837
|
}
|
|
2342
|
-
//#endregion
|
|
2343
|
-
//#region src/analyst/benchmark-public-prompt.ts
|
|
2344
|
-
/** Widest contiguous failure block a model may report. The published corpus's
|
|
2345
|
-
* widest labeled block is 8 steps and its widest stage span is 9, so this bound
|
|
2346
|
-
* never binds honest enumeration; it caps how far one over-wide block can push
|
|
2347
|
-
* unlabeled steps into the precision denominator. */
|
|
2348
|
-
const MAX_INCORRECT_BLOCK_STEPS = 12;
|
|
2349
|
-
/** Most blocks a model may report for one trajectory. The published corpus's
|
|
2350
|
-
* densest case carries 4 disjoint labeled blocks. Together with the per-block
|
|
2351
|
-
* cap this bounds one case at 192 predicted steps without a second ceiling. */
|
|
2352
|
-
const MAX_INCORRECT_BLOCKS = 16;
|
|
2353
2838
|
const TRACE_PROJECTION_ATTRIBUTE_BYTE_CAPS = [
|
|
2354
2839
|
4096,
|
|
2355
2840
|
2048,
|
|
@@ -2721,8 +3206,8 @@ async function readAndValidateResumeFiles(paths, currentIdentity, currentIdentit
|
|
|
2721
3206
|
if (!await regularFileExists(paths.initializationComplete)) return initializeRunFiles(paths, currentIdentity, currentIdentitySha256, currentLocalIdentitySha256, localReceiptInput);
|
|
2722
3207
|
const manifest = await readAndValidateManifest(paths.manifest, currentIdentity, currentIdentitySha256, currentLocalIdentitySha256);
|
|
2723
3208
|
const localReceiptContent = await readRegularFile(paths.localReceipt, "benchmark local run receipt");
|
|
2724
|
-
const value =
|
|
2725
|
-
if (!isRecord
|
|
3209
|
+
const value = parseJsonText(localReceiptContent, paths.localReceipt);
|
|
3210
|
+
if (!isRecord(value)) throw new TypeError(`benchmark local run receipt must be an object: ${paths.localReceipt}`);
|
|
2726
3211
|
assertExactKeys(value, [
|
|
2727
3212
|
"kind",
|
|
2728
3213
|
"runIdentitySha256",
|
|
@@ -2732,13 +3217,13 @@ async function readAndValidateResumeFiles(paths, currentIdentity, currentIdentit
|
|
|
2732
3217
|
"environment",
|
|
2733
3218
|
"files"
|
|
2734
3219
|
], "benchmark local run receipt");
|
|
2735
|
-
if (value.kind !== "agent-eval/analyst-benchmark-local-run" || value.runIdentitySha256 !== currentIdentitySha256 || value.localIdentitySha256 !== currentLocalIdentitySha256 || !isRecord
|
|
3220
|
+
if (value.kind !== "agent-eval/analyst-benchmark-local-run" || value.runIdentitySha256 !== currentIdentitySha256 || value.localIdentitySha256 !== currentLocalIdentitySha256 || !isRecord(value.local)) throw new Error("benchmark local run receipt does not match the requested resume");
|
|
2736
3221
|
const expectedLocalReceipt = {
|
|
2737
3222
|
...localReceiptInput,
|
|
2738
3223
|
runIdentitySha256: currentIdentitySha256,
|
|
2739
3224
|
localIdentitySha256: currentLocalIdentitySha256
|
|
2740
3225
|
};
|
|
2741
|
-
if (digestCanonical(value.local) !== currentLocalIdentitySha256 ||
|
|
3226
|
+
if (digestCanonical(value.local) !== currentLocalIdentitySha256 || canonicalJsonDocument(value.local) !== canonicalJsonDocument(localReceiptInput.local)) throw new Error("benchmark local paths or model-owner module do not match the requested resume");
|
|
2742
3227
|
if (localReceiptContent !== `${JSON.stringify(expectedLocalReceipt, null, 2)}\n`) throw new Error(`benchmark local run receipt does not exactly match: ${paths.localReceipt}`);
|
|
2743
3228
|
if (await readRegularFile(paths.initializationComplete, "benchmark initialization marker") !== renderInitializationComplete(manifest)) throw new Error(`benchmark initialization marker does not match the run manifest: ${paths.initializationComplete}`);
|
|
2744
3229
|
return manifest;
|
|
@@ -2750,8 +3235,8 @@ async function readAndValidateManifest(path, currentIdentity, currentIdentitySha
|
|
|
2750
3235
|
return manifest;
|
|
2751
3236
|
}
|
|
2752
3237
|
async function readAndValidateManifestContent(path, content, currentIdentity, currentIdentitySha256, currentLocalIdentitySha256) {
|
|
2753
|
-
const value =
|
|
2754
|
-
if (!isRecord
|
|
3238
|
+
const value = parseJsonText(content, path);
|
|
3239
|
+
if (!isRecord(value)) throw new TypeError(`benchmark run manifest must be an object: ${path}`);
|
|
2755
3240
|
assertExactKeys(value, [
|
|
2756
3241
|
"kind",
|
|
2757
3242
|
"createdAt",
|
|
@@ -2761,9 +3246,9 @@ async function readAndValidateManifestContent(path, content, currentIdentity, cu
|
|
|
2761
3246
|
], "benchmark run manifest");
|
|
2762
3247
|
if (value.kind !== "agent-eval/analyst-benchmark-run") throw new TypeError(`unsupported benchmark run manifest: ${path}`);
|
|
2763
3248
|
if (typeof value.createdAt !== "string" || !Number.isFinite(Date.parse(value.createdAt))) throw new TypeError(`benchmark run manifest has an invalid createdAt: ${path}`);
|
|
2764
|
-
if (!isSha256(value.identitySha256) || !isSha256(value.localIdentitySha256) || !isRecord
|
|
3249
|
+
if (!isSha256(value.identitySha256) || !isSha256(value.localIdentitySha256) || !isRecord(value.identity)) throw new TypeError(`benchmark run manifest has an invalid identity: ${path}`);
|
|
2765
3250
|
if (digestCanonical(value.identity) !== value.identitySha256) throw new Error(`benchmark run manifest identity digest does not match its contents: ${path}`);
|
|
2766
|
-
if (currentIdentitySha256 !== value.identitySha256 || currentLocalIdentitySha256 !== value.localIdentitySha256 ||
|
|
3251
|
+
if (currentIdentitySha256 !== value.identitySha256 || currentLocalIdentitySha256 !== value.localIdentitySha256 || canonicalJsonDocument(currentIdentity) !== canonicalJsonDocument(value.identity)) throw new Error(`benchmark resume configuration or inputs do not match ${ANALYST_BENCHMARK_MANIFEST_FILE}`);
|
|
2767
3252
|
return {
|
|
2768
3253
|
kind: "agent-eval/analyst-benchmark-run",
|
|
2769
3254
|
createdAt: value.createdAt,
|
|
@@ -2827,8 +3312,8 @@ async function readProgress(path, runIdentitySha256, caseIds, repetitions, analy
|
|
|
2827
3312
|
const plannedObservationCount = caseIds.length * 2 * repetitions;
|
|
2828
3313
|
for (const [index, line] of rawLines.entries()) {
|
|
2829
3314
|
if (!line.trim()) throw new Error(`benchmark observation log contains an empty row at line ${index + 1}`);
|
|
2830
|
-
const parsed =
|
|
2831
|
-
if (!isRecord
|
|
3315
|
+
const parsed = parseJsonText(line, `${path}:${index + 1}`);
|
|
3316
|
+
if (!isRecord(parsed)) throw new TypeError(`benchmark observation row ${index + 1} must be an object`);
|
|
2832
3317
|
assertExactKeys(parsed, [
|
|
2833
3318
|
"sequence",
|
|
2834
3319
|
"runIdentitySha256",
|
|
@@ -3028,7 +3513,7 @@ function escapeCell$1(value) {
|
|
|
3028
3513
|
//#endregion
|
|
3029
3514
|
//#region src/analyst/benchmark-command-result.ts
|
|
3030
3515
|
async function readAnalystBenchmarkArtifact(path) {
|
|
3031
|
-
const value =
|
|
3516
|
+
const value = parseJsonText(await readRegularFile(path, "analyst benchmark result"), path);
|
|
3032
3517
|
assertAnalystBenchmarkArtifact(value, "analyst benchmark result");
|
|
3033
3518
|
return value;
|
|
3034
3519
|
}
|
|
@@ -3086,33 +3571,33 @@ function assertCompletedArtifactMatchesRun(artifact, manifest, observations, pre
|
|
|
3086
3571
|
dependencyLockSha256: config.dependencyLockSha256
|
|
3087
3572
|
}
|
|
3088
3573
|
};
|
|
3089
|
-
if (
|
|
3574
|
+
if (canonicalJsonDocument(artifact.inputs) !== canonicalJsonDocument(expectedInputs)) throw new Error("completed benchmark result inputs do not match the run manifest");
|
|
3090
3575
|
const provenance = artifact.result.provenance;
|
|
3091
3576
|
const expectedDatasetId = config.dataset === "agentrx" ? "microsoft/AgentRx" : "NJU-LINK/CodeTraceBench";
|
|
3092
3577
|
const expectedOutputAdapter = config.dataset === "agentrx" ? "agentrx-taxonomy-and-root-step" : "codetracebench-incorrect-block";
|
|
3093
|
-
if (provenance.id !== `${config.dataset}-real-model-analyst` || provenance.startedAt !== manifest.createdAt || !Number.isFinite(Date.parse(provenance.endedAt)) || Date.parse(provenance.endedAt) < Date.parse(provenance.startedAt) ||
|
|
3578
|
+
if (provenance.id !== `${config.dataset}-real-model-analyst` || provenance.startedAt !== manifest.createdAt || !Number.isFinite(Date.parse(provenance.endedAt)) || Date.parse(provenance.endedAt) < Date.parse(provenance.startedAt) || canonicalJsonDocument(provenance.dataset) !== canonicalJsonDocument({
|
|
3094
3579
|
id: expectedDatasetId,
|
|
3095
3580
|
revision: config.datasetRevision,
|
|
3096
3581
|
split: config.datasetSplit
|
|
3097
|
-
}) || provenance.caseCount !== inputs.selectedCaseIds.length ||
|
|
3582
|
+
}) || provenance.caseCount !== inputs.selectedCaseIds.length || canonicalJsonDocument(provenance.runnerIds) !== canonicalJsonDocument(config.runnerIds) || provenance.repetitions !== config.repetitions || provenance.maxConcurrency !== Math.min(config.concurrency, expectedCount) || provenance.runnerOrderSeed !== config.seed || provenance.metadata?.model !== config.model.id || provenance.metadata?.modelOwnerCallRef !== config.model.ownerCallRef || provenance.metadata?.rlmSamples !== config.rlmSamples || provenance.metadata?.outputAdapter !== expectedOutputAdapter || provenance.metadata?.caseSelection !== prepared.selection.method || provenance.metadata?.caseSelectionSeed !== config.seed || provenance.metadata?.selectionStratified !== prepared.selection.stratified || provenance.metadata?.protocolSha256 !== config.analystProtocolSha256 || provenance.metadata?.implementationSha256 !== config.implementationSha256 || provenance.metadata?.dependencyLockSha256 !== config.dependencyLockSha256 || provenance.metadata?.populationRepresentativenessProven !== false) throw new Error("completed benchmark result provenance does not match the run manifest");
|
|
3098
3583
|
const expectedSummaries = config.runnerIds.map((runnerId) => summarizeAnalystBenchmarkRunner(runnerId, observations.filter((observation) => observation.runnerId === runnerId)));
|
|
3099
|
-
if (
|
|
3584
|
+
if (canonicalJsonDocument(artifact.result.summaries) !== canonicalJsonDocument(expectedSummaries)) throw new Error("completed benchmark summaries do not match durable observations");
|
|
3100
3585
|
const expectedComparisons = [compareAnalystRunners(artifact.result, {
|
|
3101
3586
|
baselineRunnerId: "empty",
|
|
3102
3587
|
candidateRunnerId: config.runnerIds[1],
|
|
3103
3588
|
seed: config.seed
|
|
3104
3589
|
})];
|
|
3105
|
-
if (
|
|
3590
|
+
if (canonicalJsonDocument(artifact.comparisons) !== canonicalJsonDocument(expectedComparisons)) throw new Error("completed benchmark comparisons do not match durable observations");
|
|
3106
3591
|
if (config.dataset === "codetracebench") {
|
|
3107
|
-
if (
|
|
3108
|
-
} else if (
|
|
3592
|
+
if (canonicalJsonDocument(artifact.codeTraceCalibration) !== canonicalJsonDocument(summarizeCodeTraceCalibration(artifact.result)) || artifact.agentRxCalibration !== void 0) throw new Error("completed CodeTraceBench calibration does not match durable observations");
|
|
3593
|
+
} else if (canonicalJsonDocument(artifact.agentRxCalibration) !== canonicalJsonDocument(summarizeAgentRxCalibration(artifact.result, "f228165bfec60a801fd5fedd9d8ffe0f9de0c69d")) || artifact.codeTraceCalibration !== void 0) throw new Error("completed AgentRx calibration does not match durable observations");
|
|
3109
3594
|
}
|
|
3110
3595
|
function assertSameObservations(expected, actual) {
|
|
3111
3596
|
if (expected.length !== actual.length) throw new Error(`benchmark result has ${expected.length} observations but the durable log has ${actual.length}`);
|
|
3112
|
-
const expectedByKey = new Map(expected.map((observation) => [observationKey(observation),
|
|
3597
|
+
const expectedByKey = new Map(expected.map((observation) => [observationKey(observation), canonicalJsonDocument(observation)]));
|
|
3113
3598
|
for (const observation of actual) {
|
|
3114
3599
|
const key = observationKey(observation);
|
|
3115
|
-
if (expectedByKey.get(key) !==
|
|
3600
|
+
if (expectedByKey.get(key) !== canonicalJsonDocument(observation)) throw new Error(`benchmark result does not match durable observation '${observation.runnerId}/${observation.caseId}/${observation.repetition}'`);
|
|
3116
3601
|
expectedByKey.delete(key);
|
|
3117
3602
|
}
|
|
3118
3603
|
if (expectedByKey.size > 0) throw new Error("benchmark result is missing durable observations");
|
|
@@ -3458,9 +3943,6 @@ function safeInteger(value, field) {
|
|
|
3458
3943
|
if (!Number.isSafeInteger(value)) throw new RangeError(`${field} must be a safe integer`);
|
|
3459
3944
|
return value;
|
|
3460
3945
|
}
|
|
3461
|
-
function isRecord(value) {
|
|
3462
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3463
|
-
}
|
|
3464
3946
|
//#endregion
|
|
3465
3947
|
//#region src/analyst/benchmark-response-cache.ts
|
|
3466
3948
|
const SHA256 = /^[a-f0-9]{64}$/;
|
|
@@ -5059,7 +5541,7 @@ async function indexSelectedSingleTraceFiles(traceDir, selectedTraceIds) {
|
|
|
5059
5541
|
const indexed = /* @__PURE__ */ new Map();
|
|
5060
5542
|
for (const path of files) {
|
|
5061
5543
|
const snapshot = await readImmutableInputSnapshot(path, DEFAULT_MAX_TRACE_FILE_BYTES);
|
|
5062
|
-
const store =
|
|
5544
|
+
const store = new BufferTraceStore(snapshot.bytes);
|
|
5063
5545
|
const overview = await store.getOverview();
|
|
5064
5546
|
if (overview.total_traces !== 1 || overview.sample_trace_ids.length !== 1) throw new Error(`public analyst benchmark trace file must contain exactly one trace: ${path} contains ${overview.total_traces}`);
|
|
5065
5547
|
if (!overview.time_range) throw new Error(`public analyst benchmark trace file has no valid timestamps: ${path}`);
|
|
@@ -6307,6 +6789,6 @@ function shellQuote(value) {
|
|
|
6307
6789
|
return /^[a-zA-Z0-9_./:@%+=,-]+$/.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
|
|
6308
6790
|
}
|
|
6309
6791
|
//#endregion
|
|
6310
|
-
export {
|
|
6792
|
+
export { agentRxBenchmarkCase as A, ANALYST_BENCHMARK_COST_LEDGER_FILE as C, AGENT_RX_UPSTREAM_REVISION as D, ANALYST_BENCHMARK_OBSERVATIONS_FILE as E, normalizeAgentRxCategory as M, runAnalystBenchmark as N, codeTraceBenchCase as O, traceStoreEvidenceResolver as P, ANALYST_BENCHMARK_IMPLEMENTATION_FILES as S, ANALYST_BENCHMARK_MANIFEST_FILE as T, readAnalystBenchmarkArtifact as _, runInlineAnalystDefinition as a, ANALYST_BENCHMARK_EVIDENCE_DEPENDENCY_LOCK_SHA256 as b, publicRlmAnalystDefinition as c, publicDirectAnalystDefinition as d, runChunkedAnalystDefinition as f, expandCodeTraceFailureBlocks as g, analystDefinitionProtocolSha256 as h, primeCodeTraceAnalystDefinition as i, agentRxPredictionsToFindings as j, codeTracerPredictionsToFindings as k, runReplVariableAnalystDefinition as l, analystDefinitionAsymmetries as m, createPrimeBenchmarkRunner as n, loadPublicBenchmarkRows as o, AnalystExpressivenessError as p, primeAnalystProtocolSha256 as r, createPublicBenchmarkRlmRunner as s, runAnalystBenchmarkCommand as t, createPublicBenchmarkDirectRunner as u, CODE_TRACE_BENCH_ANALYST_PROMPT as v, ANALYST_BENCHMARK_LOCAL_RECEIPT_FILE as w, ANALYST_BENCHMARK_EVIDENCE_IMPLEMENTATION_SHA256 as x, publicBenchmarkProtocolSha256 as y };
|
|
6311
6793
|
|
|
6312
|
-
//# sourceMappingURL=benchmark-command-
|
|
6794
|
+
//# sourceMappingURL=benchmark-command-xQK8nOI6.js.map
|