@tangle-network/agent-eval 0.129.0 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -0
- package/dist/active-curriculum-C4mk67HP.js +214 -0
- package/dist/active-curriculum-C4mk67HP.js.map +1 -0
- package/dist/adversarial-smnADNFS.d.ts +21 -0
- package/dist/adversarial-smnADNFS.d.ts.map +1 -0
- package/dist/analyst/index.d.ts +81 -2872
- package/dist/analyst/index.d.ts.map +1 -0
- package/dist/analyst/index.js +319 -360
- package/dist/analyst/index.js.map +1 -1
- package/dist/analyst-BkTS3C58.d.ts +89 -0
- package/dist/analyst-BkTS3C58.d.ts.map +1 -0
- package/dist/analyst-LsnNpSkm.js +152 -0
- package/dist/analyst-LsnNpSkm.js.map +1 -0
- package/dist/analyze-runs-C1CavBMk.js +1067 -0
- package/dist/analyze-runs-C1CavBMk.js.map +1 -0
- package/dist/analyze-runs-FsgYCinh.d.ts +72 -0
- package/dist/analyze-runs-FsgYCinh.d.ts.map +1 -0
- package/dist/attribute-vocabulary-DLJ6303h.d.ts +54 -0
- package/dist/attribute-vocabulary-DLJ6303h.d.ts.map +1 -0
- package/dist/authenticity/index.d.ts +81 -79
- package/dist/authenticity/index.d.ts.map +1 -0
- package/dist/authenticity/index.js +209 -193
- package/dist/authenticity/index.js.map +1 -1
- package/dist/baseline-HsBvw_dk.js +550 -0
- package/dist/baseline-HsBvw_dk.js.map +1 -0
- package/dist/baseline-hG3K85h4.d.ts +125 -0
- package/dist/baseline-hG3K85h4.d.ts.map +1 -0
- package/dist/belief-state/index.d.ts +448 -1188
- package/dist/belief-state/index.d.ts.map +1 -0
- package/dist/belief-state/index.js +1617 -1709
- package/dist/belief-state/index.js.map +1 -1
- package/dist/benchmarks/index.d.ts +2 -891
- package/dist/benchmarks/index.js +2 -60
- package/dist/benchmarks-DviOvUNr.js +754 -0
- package/dist/benchmarks-DviOvUNr.js.map +1 -0
- package/dist/builder-eval/index.d.ts +150 -662
- package/dist/builder-eval/index.d.ts.map +1 -0
- package/dist/builder-eval/index.js +356 -345
- package/dist/builder-eval/index.js.map +1 -1
- package/dist/calibration-CNWWA6K8.js +94 -0
- package/dist/calibration-CNWWA6K8.js.map +1 -0
- package/dist/campaign/index.d.ts +5 -6381
- package/dist/campaign/index.js +3 -213
- package/dist/campaign-CBKZvQ1H.js +3885 -0
- package/dist/campaign-CBKZvQ1H.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +164 -175
- package/dist/cli.js.map +1 -1
- package/dist/client-C97NMzqi.d.ts +581 -0
- package/dist/client-C97NMzqi.d.ts.map +1 -0
- package/dist/client-CYzbdJOZ.js +637 -0
- package/dist/client-CYzbdJOZ.js.map +1 -0
- package/dist/code-agent-session-BjkMTQ7H.js +1390 -0
- package/dist/code-agent-session-BjkMTQ7H.js.map +1 -0
- package/dist/code-agent-session-DqqgOJaz.d.ts +143 -0
- package/dist/code-agent-session-DqqgOJaz.d.ts.map +1 -0
- package/dist/concurrency-DIxRZF_J.js +85 -0
- package/dist/concurrency-DIxRZF_J.js.map +1 -0
- package/dist/contract/index.d.ts +645 -5565
- package/dist/contract/index.d.ts.map +1 -0
- package/dist/contract/index.js +1730 -1938
- package/dist/contract/index.js.map +1 -1
- package/dist/control.d.ts +3 -1030
- package/dist/control.js +2 -33
- package/dist/cost-ledger-DIgQUFZZ.js +801 -0
- package/dist/cost-ledger-DIgQUFZZ.js.map +1 -0
- package/dist/cost-ledger-Dye6jCgg.d.ts +236 -0
- package/dist/cost-ledger-Dye6jCgg.d.ts.map +1 -0
- package/dist/dataset-BvtnC8Dc.d.ts +115 -0
- package/dist/dataset-BvtnC8Dc.d.ts.map +1 -0
- package/dist/default-registry-C-vFCSEc.js +2579 -0
- package/dist/default-registry-C-vFCSEc.js.map +1 -0
- package/dist/default-registry-CNPo-Vsb.d.ts +540 -0
- package/dist/default-registry-CNPo-Vsb.d.ts.map +1 -0
- package/dist/emitter-CPBAhxum.js +266 -0
- package/dist/emitter-CPBAhxum.js.map +1 -0
- package/dist/emitter-DGQGoLyj.d.ts +113 -0
- package/dist/emitter-DGQGoLyj.d.ts.map +1 -0
- package/dist/errors-8YnH8WlF.js +64 -0
- package/dist/errors-8YnH8WlF.js.map +1 -0
- package/dist/errors-CEk209JS.d.ts +76 -0
- package/dist/errors-CEk209JS.d.ts.map +1 -0
- package/dist/eval-campaign-DEm6c8ru.js +349 -0
- package/dist/eval-campaign-DEm6c8ru.js.map +1 -0
- package/dist/execution-tracks-CpgFPpS5.js +93 -0
- package/dist/execution-tracks-CpgFPpS5.js.map +1 -0
- package/dist/exporters-q9iL-2Jf.js +148 -0
- package/dist/exporters-q9iL-2Jf.js.map +1 -0
- package/dist/extract-usage-BrQ8mCLX.js +155 -0
- package/dist/extract-usage-BrQ8mCLX.js.map +1 -0
- package/dist/failure-cluster-CqcvCcdR.d.ts +59 -0
- package/dist/failure-cluster-CqcvCcdR.d.ts.map +1 -0
- package/dist/feedback-trajectory-CVaeREXV.d.ts +340 -0
- package/dist/feedback-trajectory-CVaeREXV.d.ts.map +1 -0
- package/dist/fuzz.d.ts +320 -646
- package/dist/fuzz.d.ts.map +1 -0
- package/dist/fuzz.js +670 -618
- package/dist/fuzz.js.map +1 -1
- package/dist/hf-dataset-DBJXXoY1.js +763 -0
- package/dist/hf-dataset-DBJXXoY1.js.map +1 -0
- package/dist/hosted/index.d.ts +11 -831
- package/dist/hosted/index.d.ts.map +1 -0
- package/dist/hosted/index.js +2 -37
- package/dist/index-2JJSA6-r2.d.ts +926 -0
- package/dist/index-2JJSA6-r2.d.ts.map +1 -0
- package/dist/index-6N0aYmpW.d.ts +217 -0
- package/dist/index-6N0aYmpW.d.ts.map +1 -0
- package/dist/index-BAvgST_9.d.ts +131 -0
- package/dist/index-BAvgST_9.d.ts.map +1 -0
- package/dist/index-BvnJuTGD.d.ts +68 -0
- package/dist/index-BvnJuTGD.d.ts.map +1 -0
- package/dist/index-C61Wi7yg.d.ts +547 -0
- package/dist/index-C61Wi7yg.d.ts.map +1 -0
- package/dist/index-CAPUUKaM.d.ts +335 -0
- package/dist/index-CAPUUKaM.d.ts.map +1 -0
- package/dist/index-DE5fb3EC.d.ts +2244 -0
- package/dist/index-DE5fb3EC.d.ts.map +1 -0
- package/dist/index-DSC51roc.d.ts +102 -0
- package/dist/index-DSC51roc.d.ts.map +1 -0
- package/dist/index.d.ts +3755 -15555
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11182 -11216
- package/dist/index.js.map +1 -1
- package/dist/integrity-BzRbCHzi.js +424 -0
- package/dist/integrity-BzRbCHzi.js.map +1 -0
- package/dist/integrity-rmVhXWA7.d.ts +61 -0
- package/dist/integrity-rmVhXWA7.d.ts.map +1 -0
- package/dist/judge-calibration-DFtEMlde.d.ts +146 -0
- package/dist/judge-calibration-DFtEMlde.d.ts.map +1 -0
- package/dist/ledger-core/index.d.ts +2 -0
- package/dist/ledger-core/index.js +2 -0
- package/dist/ledger-core-DtZz1RG0.js +388 -0
- package/dist/ledger-core-DtZz1RG0.js.map +1 -0
- package/dist/llm-client--GR4JbZE.js +687 -0
- package/dist/llm-client--GR4JbZE.js.map +1 -0
- package/dist/llm-client-B_nIBlYo.d.ts +290 -0
- package/dist/llm-client-B_nIBlYo.d.ts.map +1 -0
- package/dist/matrix/index.d.ts +3 -155
- package/dist/matrix/index.js +2 -8
- package/dist/matrix-BzQnu2S6.js +270 -0
- package/dist/matrix-BzQnu2S6.js.map +1 -0
- package/dist/meta-eval/index.d.ts +4 -1027
- package/dist/meta-eval/index.js +393 -390
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/metrics-C9YY1OcL.js +239 -0
- package/dist/metrics-C9YY1OcL.js.map +1 -0
- package/dist/mint-yN2M2eh0.js +201 -0
- package/dist/mint-yN2M2eh0.js.map +1 -0
- package/dist/multi-layer-verifier-BHY1gWAc.d.ts +138 -0
- package/dist/multi-layer-verifier-BHY1gWAc.d.ts.map +1 -0
- package/dist/multishot/index.d.ts +273 -480
- package/dist/multishot/index.d.ts.map +1 -0
- package/dist/multishot/index.js +595 -548
- package/dist/multishot/index.js.map +1 -1
- package/dist/off-policy-DvgzvtIx.js +220 -0
- package/dist/off-policy-DvgzvtIx.js.map +1 -0
- package/dist/off-policy-mskQw8Mb.d.ts +153 -0
- package/dist/off-policy-mskQw8Mb.d.ts.map +1 -0
- package/dist/openapi.json +1 -1
- package/dist/opencode-sqlite-BGrHeDu3.js +318 -0
- package/dist/opencode-sqlite-BGrHeDu3.js.map +1 -0
- package/dist/outcome-store-BYHIuO0e.d.ts +65 -0
- package/dist/outcome-store-BYHIuO0e.d.ts.map +1 -0
- package/dist/outcome-store-ChBKlTd_.js +75 -0
- package/dist/outcome-store-ChBKlTd_.js.map +1 -0
- package/dist/paired-arms-D9D0wXj2.js +260 -0
- package/dist/paired-arms-D9D0wXj2.js.map +1 -0
- package/dist/pipelines/index.d.ts +95 -532
- package/dist/pipelines/index.d.ts.map +1 -0
- package/dist/pipelines/index.js +497 -478
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pre-registration-DakwTRXk.js +96 -0
- package/dist/pre-registration-DakwTRXk.js.map +1 -0
- package/dist/propose-review-control-LhIWGzHl.js +1458 -0
- package/dist/propose-review-control-LhIWGzHl.js.map +1 -0
- package/dist/query-CJ_DX8vl.d.ts +28 -0
- package/dist/query-CJ_DX8vl.d.ts.map +1 -0
- package/dist/query-Di7eEQ79.js +83 -0
- package/dist/query-Di7eEQ79.js.map +1 -0
- package/dist/raw-provider-sink-BQd7mzyT.js +201 -0
- package/dist/raw-provider-sink-BQd7mzyT.js.map +1 -0
- package/dist/raw-provider-sink-BU29Sh8h.d.ts +134 -0
- package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +1 -0
- package/dist/redact-7Aq1ukl-.js +107 -0
- package/dist/redact-7Aq1ukl-.js.map +1 -0
- package/dist/release-report-Cz9NKH39.js +603 -0
- package/dist/release-report-Cz9NKH39.js.map +1 -0
- package/dist/release-report-mvB2G4_J.d.ts +244 -0
- package/dist/release-report-mvB2G4_J.d.ts.map +1 -0
- package/dist/replay-GnyotH0J.js +1741 -0
- package/dist/replay-GnyotH0J.js.map +1 -0
- package/dist/replay-OoidtG1E.d.ts +749 -0
- package/dist/replay-OoidtG1E.d.ts.map +1 -0
- package/dist/reporting.d.ts +6 -1312
- package/dist/reporting.js +6 -51
- package/dist/researcher-CwTdwXG1.d.ts +314 -0
- package/dist/researcher-CwTdwXG1.d.ts.map +1 -0
- package/dist/reward-hacking-eAnOsynk.d.ts +224 -0
- package/dist/reward-hacking-eAnOsynk.d.ts.map +1 -0
- package/dist/reward-hacking-qipEpKvY.js +596 -0
- package/dist/reward-hacking-qipEpKvY.js.map +1 -0
- package/dist/reward-nw2xZGZG.js +137 -0
- package/dist/reward-nw2xZGZG.js.map +1 -0
- package/dist/rl.d.ts +760 -4010
- package/dist/rl.d.ts.map +1 -0
- package/dist/rl.js +2325 -1958
- package/dist/rl.js.map +1 -1
- package/dist/rolldown-runtime-8H4AJuhK.js +14 -0
- package/dist/rollout/index.d.ts +3 -2087
- package/dist/rollout/index.js +8 -168
- package/dist/rollout-BOYjemfR.js +624 -0
- package/dist/rollout-BOYjemfR.js.map +1 -0
- package/dist/rubric-predictive-validity-B3xmbmS1.js +141 -0
- package/dist/rubric-predictive-validity-B3xmbmS1.js.map +1 -0
- package/dist/rubric-predictive-validity-Ku_clp_1.d.ts +74 -0
- package/dist/rubric-predictive-validity-Ku_clp_1.d.ts.map +1 -0
- package/dist/run-evidence-ClRX_8A9.d.ts +225 -0
- package/dist/run-evidence-ClRX_8A9.d.ts.map +1 -0
- package/dist/run-record-BuoE80Dq.js +467 -0
- package/dist/{chunk-56TAVBOK.js.map → run-record-BuoE80Dq.js.map} +1 -1
- package/dist/run-record-CnZu_gjl.d.ts +357 -0
- package/dist/run-record-CnZu_gjl.d.ts.map +1 -0
- package/dist/run-score-iEEAWiBY.js +41 -0
- package/dist/run-score-iEEAWiBY.js.map +1 -0
- package/dist/runtime-trajectory-1gyaTOoC.js +93 -0
- package/dist/runtime-trajectory-1gyaTOoC.js.map +1 -0
- package/dist/runtime-trajectory-BvSZcCHD.d.ts +50 -0
- package/dist/runtime-trajectory-BvSZcCHD.d.ts.map +1 -0
- package/dist/schema-BtVldJ3T.d.ts +206 -0
- package/dist/schema-BtVldJ3T.d.ts.map +1 -0
- package/dist/schema-C6DW4ZHR.js +821 -0
- package/dist/schema-C6DW4ZHR.js.map +1 -0
- package/dist/schema-CRhEY1SO.js +69 -0
- package/dist/schema-CRhEY1SO.js.map +1 -0
- package/dist/schema-Cef2cFmb.d.ts +408 -0
- package/dist/schema-Cef2cFmb.d.ts.map +1 -0
- package/dist/semantic-concept-judge-B6cWNJ2K.js +725 -0
- package/dist/semantic-concept-judge-B6cWNJ2K.js.map +1 -0
- package/dist/sequential-Br0mAPHA.js +148 -0
- package/dist/sequential-Br0mAPHA.js.map +1 -0
- package/dist/sequential-CYwq6Ff_.d.ts +141 -0
- package/dist/sequential-CYwq6Ff_.d.ts.map +1 -0
- package/dist/series-convergence-CjO2QdRW.js +43 -0
- package/dist/series-convergence-CjO2QdRW.js.map +1 -0
- package/dist/series-convergence-ofsqPWhs.d.ts +35 -0
- package/dist/series-convergence-ofsqPWhs.d.ts.map +1 -0
- package/dist/server-m5D9cvnG.js +1040 -0
- package/dist/server-m5D9cvnG.js.map +1 -0
- package/dist/skill-usage-C_pXm7lP.d.ts +534 -0
- package/dist/skill-usage-C_pXm7lP.d.ts.map +1 -0
- package/dist/skillopt-optimization-method-B7wX7XkF.d.ts +1739 -0
- package/dist/skillopt-optimization-method-B7wX7XkF.d.ts.map +1 -0
- package/dist/skillopt-optimization-method-D4ODwFVV.js +7712 -0
- package/dist/skillopt-optimization-method-D4ODwFVV.js.map +1 -0
- package/dist/statistics-Cmj6nynr.d.ts +514 -0
- package/dist/statistics-Cmj6nynr.d.ts.map +1 -0
- package/dist/statistics-CnnxdpOg.js +1437 -0
- package/dist/statistics-CnnxdpOg.js.map +1 -0
- package/dist/store-CT9YIIve.d.ts +117 -0
- package/dist/store-CT9YIIve.d.ts.map +1 -0
- package/dist/store-CxJry_cs.d.ts +229 -0
- package/dist/store-CxJry_cs.d.ts.map +1 -0
- package/dist/storyboard/index.d.ts +84 -203
- package/dist/storyboard/index.d.ts.map +1 -0
- package/dist/storyboard/index.js +609 -542
- package/dist/storyboard/index.js.map +1 -1
- package/dist/summary-report-BNs5nmXI.js +862 -0
- package/dist/summary-report-BNs5nmXI.js.map +1 -0
- package/dist/summary-report-Cj9gdw4i.d.ts +407 -0
- package/dist/summary-report-Cj9gdw4i.d.ts.map +1 -0
- package/dist/supervisor-run/index.d.ts +2 -959
- package/dist/supervisor-run/index.js +2 -65
- package/dist/supervisor-run-_lnTLM3z.js +1679 -0
- package/dist/supervisor-run-_lnTLM3z.js.map +1 -0
- package/dist/task-failure-attributes-CQZlB3et.js +311 -0
- package/dist/task-failure-attributes-CQZlB3et.js.map +1 -0
- package/dist/test-graded-scenario-BsqWLmPt.js +318 -0
- package/dist/test-graded-scenario-BsqWLmPt.js.map +1 -0
- package/dist/test-graded-scenario-D1TaI2va.d.ts +141 -0
- package/dist/test-graded-scenario-D1TaI2va.d.ts.map +1 -0
- package/dist/tools-BmuN627J.js +1085 -0
- package/dist/tools-BmuN627J.js.map +1 -0
- package/dist/trace-attributes.d.ts +2 -52
- package/dist/trace-attributes.js +131 -61
- package/dist/trace-attributes.js.map +1 -1
- package/dist/traces.d.ts +12 -2365
- package/dist/traces.js +12 -252
- package/dist/trajectory-D_7rLrvE.js +56 -0
- package/dist/trajectory-D_7rLrvE.js.map +1 -0
- package/dist/types-DGsxbAEd.d.ts +387 -0
- package/dist/types-DGsxbAEd.d.ts.map +1 -0
- package/dist/types-k9tZGKUg.d.ts +640 -0
- package/dist/types-k9tZGKUg.d.ts.map +1 -0
- package/dist/verdict-Dps8_okt.d.ts +37 -0
- package/dist/verdict-Dps8_okt.d.ts.map +1 -0
- package/dist/wire/index.d.ts +702 -1173
- package/dist/wire/index.d.ts.map +1 -0
- package/dist/wire/index.js +2 -81
- package/package.json +17 -9
- package/dist/benchmarks/index.js.map +0 -1
- package/dist/campaign/index.js.map +0 -1
- package/dist/chunk-2QU3YOPR.js +0 -7374
- package/dist/chunk-2QU3YOPR.js.map +0 -1
- package/dist/chunk-3OCR4R5I.js +0 -728
- package/dist/chunk-3OCR4R5I.js.map +0 -1
- package/dist/chunk-3RF76KTD.js +0 -84
- package/dist/chunk-3RF76KTD.js.map +0 -1
- package/dist/chunk-56TAVBOK.js +0 -698
- package/dist/chunk-5DTSBUL2.js +0 -159
- package/dist/chunk-5DTSBUL2.js.map +0 -1
- package/dist/chunk-7FO3TNPI.js +0 -232
- package/dist/chunk-7FO3TNPI.js.map +0 -1
- package/dist/chunk-7ZZMD7UK.js +0 -386
- package/dist/chunk-7ZZMD7UK.js.map +0 -1
- package/dist/chunk-BOD4O7OF.js +0 -40
- package/dist/chunk-BOD4O7OF.js.map +0 -1
- package/dist/chunk-BSO5JDQH.js +0 -2335
- package/dist/chunk-BSO5JDQH.js.map +0 -1
- package/dist/chunk-C6LXANRU.js +0 -1550
- package/dist/chunk-C6LXANRU.js.map +0 -1
- package/dist/chunk-DODXQREJ.js +0 -752
- package/dist/chunk-DODXQREJ.js.map +0 -1
- package/dist/chunk-DRYIUNWY.js +0 -622
- package/dist/chunk-DRYIUNWY.js.map +0 -1
- package/dist/chunk-E7QXT7SX.js +0 -183
- package/dist/chunk-E7QXT7SX.js.map +0 -1
- package/dist/chunk-EG66UGL4.js +0 -341
- package/dist/chunk-EG66UGL4.js.map +0 -1
- package/dist/chunk-FXTVJPYD.js +0 -576
- package/dist/chunk-FXTVJPYD.js.map +0 -1
- package/dist/chunk-G7MGMCZD.js +0 -153
- package/dist/chunk-G7MGMCZD.js.map +0 -1
- package/dist/chunk-GGE4NNQT.js +0 -65
- package/dist/chunk-GGE4NNQT.js.map +0 -1
- package/dist/chunk-H23X7XKK.js +0 -181
- package/dist/chunk-H23X7XKK.js.map +0 -1
- package/dist/chunk-HHWE3POT.js +0 -94
- package/dist/chunk-HHWE3POT.js.map +0 -1
- package/dist/chunk-HPWUNB47.js +0 -289
- package/dist/chunk-HPWUNB47.js.map +0 -1
- package/dist/chunk-IYCLP2N2.js +0 -766
- package/dist/chunk-IYCLP2N2.js.map +0 -1
- package/dist/chunk-JHCHEVET.js +0 -274
- package/dist/chunk-JHCHEVET.js.map +0 -1
- package/dist/chunk-JQSF5DQT.js +0 -701
- package/dist/chunk-JQSF5DQT.js.map +0 -1
- package/dist/chunk-K4DBDHLK.js +0 -158
- package/dist/chunk-K4DBDHLK.js.map +0 -1
- package/dist/chunk-K6N6XJJX.js +0 -306
- package/dist/chunk-K6N6XJJX.js.map +0 -1
- package/dist/chunk-M4YBQKIJ.js +0 -1040
- package/dist/chunk-M4YBQKIJ.js.map +0 -1
- package/dist/chunk-MA6HLL3S.js +0 -65
- package/dist/chunk-MA6HLL3S.js.map +0 -1
- package/dist/chunk-MAZ26DC7.js +0 -99
- package/dist/chunk-MAZ26DC7.js.map +0 -1
- package/dist/chunk-NPCTHQIO.js +0 -91
- package/dist/chunk-NPCTHQIO.js.map +0 -1
- package/dist/chunk-NY44NC4A.js +0 -1056
- package/dist/chunk-NY44NC4A.js.map +0 -1
- package/dist/chunk-OIUOT4QD.js +0 -44
- package/dist/chunk-OIUOT4QD.js.map +0 -1
- package/dist/chunk-ONWEPEDO.js +0 -57
- package/dist/chunk-ONWEPEDO.js.map +0 -1
- package/dist/chunk-OWN5NPMC.js +0 -152
- package/dist/chunk-OWN5NPMC.js.map +0 -1
- package/dist/chunk-P6FYH6K4.js +0 -1161
- package/dist/chunk-P6FYH6K4.js.map +0 -1
- package/dist/chunk-PC4UYEBM.js +0 -166
- package/dist/chunk-PC4UYEBM.js.map +0 -1
- package/dist/chunk-PC5DOSM7.js +0 -579
- package/dist/chunk-PC5DOSM7.js.map +0 -1
- package/dist/chunk-PXE2VKMX.js +0 -140
- package/dist/chunk-PXE2VKMX.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-QB6BDBP2.js +0 -4464
- package/dist/chunk-QB6BDBP2.js.map +0 -1
- package/dist/chunk-RXHCETDZ.js +0 -536
- package/dist/chunk-RXHCETDZ.js.map +0 -1
- package/dist/chunk-RZTMDUO7.js +0 -49
- package/dist/chunk-RZTMDUO7.js.map +0 -1
- package/dist/chunk-SFLLL76A.js +0 -669
- package/dist/chunk-SFLLL76A.js.map +0 -1
- package/dist/chunk-SZLVEKMJ.js +0 -1446
- package/dist/chunk-SZLVEKMJ.js.map +0 -1
- package/dist/chunk-T4SQEITX.js +0 -95
- package/dist/chunk-T4SQEITX.js.map +0 -1
- package/dist/chunk-T6RLYGAD.js +0 -158
- package/dist/chunk-T6RLYGAD.js.map +0 -1
- package/dist/chunk-TJVT4QFF.js +0 -911
- package/dist/chunk-TJVT4QFF.js.map +0 -1
- package/dist/chunk-TQ7LNKZ3.js +0 -136
- package/dist/chunk-TQ7LNKZ3.js.map +0 -1
- package/dist/chunk-U4L7JRPZ.js +0 -1706
- package/dist/chunk-U4L7JRPZ.js.map +0 -1
- package/dist/chunk-U4PHLT2N.js +0 -419
- package/dist/chunk-U4PHLT2N.js.map +0 -1
- package/dist/chunk-VCZ5FQYW.js +0 -928
- package/dist/chunk-VCZ5FQYW.js.map +0 -1
- package/dist/chunk-VI2UW6B6.js +0 -162
- package/dist/chunk-VI2UW6B6.js.map +0 -1
- package/dist/chunk-VQMK5FMP.js +0 -247
- package/dist/chunk-VQMK5FMP.js.map +0 -1
- package/dist/chunk-WGXIEX7P.js +0 -116
- package/dist/chunk-WGXIEX7P.js.map +0 -1
- package/dist/chunk-WVATSFCP.js +0 -1553
- package/dist/chunk-WVATSFCP.js.map +0 -1
- package/dist/chunk-X4YIBDER.js +0 -1662
- package/dist/chunk-X4YIBDER.js.map +0 -1
- package/dist/chunk-YQN4ICPP.js +0 -355
- package/dist/chunk-YQN4ICPP.js.map +0 -1
- package/dist/chunk-ZET2UAYW.js +0 -89
- package/dist/chunk-ZET2UAYW.js.map +0 -1
- package/dist/chunk-ZHTZ4EYI.js +0 -1212
- package/dist/chunk-ZHTZ4EYI.js.map +0 -1
- package/dist/control.js.map +0 -1
- package/dist/hosted/index.js.map +0 -1
- package/dist/matrix/index.js.map +0 -1
- package/dist/reporting.js.map +0 -1
- package/dist/rollout/index.js.map +0 -1
- package/dist/run-campaign-OJJ7CZF4.js +0 -18
- package/dist/run-campaign-OJJ7CZF4.js.map +0 -1
- package/dist/supervisor-run/index.js.map +0 -1
- package/dist/traces.js.map +0 -1
- package/dist/wire/index.js.map +0 -1
package/dist/pipelines/index.js
CHANGED
|
@@ -1,517 +1,536 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "../
|
|
7
|
-
|
|
8
|
-
executionTrackByLane
|
|
9
|
-
} from "../chunk-HHWE3POT.js";
|
|
10
|
-
import {
|
|
11
|
-
buildTrajectory
|
|
12
|
-
} from "../chunk-RZTMDUO7.js";
|
|
13
|
-
import {
|
|
14
|
-
interRaterReliability,
|
|
15
|
-
pearsonR
|
|
16
|
-
} from "../chunk-ZHTZ4EYI.js";
|
|
17
|
-
import {
|
|
18
|
-
aggregateLlm,
|
|
19
|
-
argHash,
|
|
20
|
-
hasCapturedToolArgs,
|
|
21
|
-
llmSpans,
|
|
22
|
-
runFailureClass,
|
|
23
|
-
toolSpans
|
|
24
|
-
} from "../chunk-ZET2UAYW.js";
|
|
25
|
-
import {
|
|
26
|
-
isToolSpan
|
|
27
|
-
} from "../chunk-MA6HLL3S.js";
|
|
28
|
-
import "../chunk-ONWEPEDO.js";
|
|
29
|
-
import "../chunk-PZ5AY32C.js";
|
|
30
|
-
|
|
31
|
-
// src/pipelines/budget-breach.ts
|
|
1
|
+
import { t as executionTrackByLane } from "../execution-tracks-CpgFPpS5.js";
|
|
2
|
+
import { E as pearsonR, u as interRaterReliability } from "../statistics-CnnxdpOg.js";
|
|
3
|
+
import { s as isToolSpan } from "../schema-CRhEY1SO.js";
|
|
4
|
+
import { t as buildTrajectory } from "../trajectory-D_7rLrvE.js";
|
|
5
|
+
import { i as hasCapturedToolArgs, l as toolSpans, n as argHash, o as llmSpans, s as runFailureClass, t as aggregateLlm } from "../query-Di7eEQ79.js";
|
|
6
|
+
import { a as DEFAULT_RULES, i as computeToolUseMetrics, o as classifyFailure, t as compareToBaseline } from "../baseline-HsBvw_dk.js";
|
|
7
|
+
//#region src/pipelines/budget-breach.ts
|
|
32
8
|
async function budgetBreachView(store, options = {}) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
9
|
+
const runs = await store.listRuns({
|
|
10
|
+
scenarioId: options.scenarioId,
|
|
11
|
+
variantId: options.variantId
|
|
12
|
+
});
|
|
13
|
+
const findings = [];
|
|
14
|
+
const byDimension = {};
|
|
15
|
+
const byScenario = {};
|
|
16
|
+
const byVariant = {};
|
|
17
|
+
for (const run of runs) {
|
|
18
|
+
const entries = await store.budget(run.runId);
|
|
19
|
+
for (const e of entries) {
|
|
20
|
+
if (!e.breached) continue;
|
|
21
|
+
const excessRatio = e.limit > 0 ? e.consumed / e.limit : Infinity;
|
|
22
|
+
findings.push({
|
|
23
|
+
runId: run.runId,
|
|
24
|
+
scenarioId: run.scenarioId,
|
|
25
|
+
variantId: run.variantId,
|
|
26
|
+
dimension: e.dimension,
|
|
27
|
+
limit: e.limit,
|
|
28
|
+
consumed: e.consumed,
|
|
29
|
+
excessRatio,
|
|
30
|
+
timestamp: e.timestamp
|
|
31
|
+
});
|
|
32
|
+
byDimension[e.dimension] = (byDimension[e.dimension] ?? 0) + 1;
|
|
33
|
+
byScenario[run.scenarioId] = (byScenario[run.scenarioId] ?? 0) + 1;
|
|
34
|
+
if (run.variantId) byVariant[run.variantId] = (byVariant[run.variantId] ?? 0) + 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const breachedRuns = new Set(findings.map((f) => f.runId));
|
|
38
|
+
return {
|
|
39
|
+
findings,
|
|
40
|
+
byDimension,
|
|
41
|
+
byScenario,
|
|
42
|
+
byVariant,
|
|
43
|
+
totalRuns: runs.length,
|
|
44
|
+
breachedRunRatio: runs.length > 0 ? breachedRuns.size / runs.length : 0
|
|
45
|
+
};
|
|
70
46
|
}
|
|
71
|
-
|
|
72
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/pipelines/failure-cluster.ts
|
|
49
|
+
/**
|
|
50
|
+
* FailureClusterView — groups failed runs by (failureClass, triggerTool,
|
|
51
|
+
* argHash-prefix) so weekly reviews can prioritize the top-N clusters.
|
|
52
|
+
*
|
|
53
|
+
* Each cluster includes: N runs, scenarios affected, representative
|
|
54
|
+
* error message, a proposed mitigation hint (rule → action table).
|
|
55
|
+
*/
|
|
73
56
|
async function failureClusterView(store, options = {}) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
57
|
+
const rules = options.rules ?? DEFAULT_RULES;
|
|
58
|
+
const minSize = options.minClusterSize ?? 1;
|
|
59
|
+
const runs = await store.listRuns();
|
|
60
|
+
const clusters = /* @__PURE__ */ new Map();
|
|
61
|
+
let totalFailures = 0;
|
|
62
|
+
for (const run of runs) {
|
|
63
|
+
if (run.status === "completed" && run.outcome?.pass !== false) continue;
|
|
64
|
+
totalFailures++;
|
|
65
|
+
const spans = await store.spans({ runId: run.runId });
|
|
66
|
+
const cls = classifyFailure({
|
|
67
|
+
run,
|
|
68
|
+
spans,
|
|
69
|
+
events: await store.events({ runId: run.runId })
|
|
70
|
+
}, rules);
|
|
71
|
+
let toolName;
|
|
72
|
+
let argPrefix;
|
|
73
|
+
let dimension;
|
|
74
|
+
if (cls.triggerSpanId) {
|
|
75
|
+
const trig = spans.find((s) => s.spanId === cls.triggerSpanId);
|
|
76
|
+
if (trig?.kind === "tool") {
|
|
77
|
+
toolName = trig.toolName;
|
|
78
|
+
if (hasCapturedToolArgs(trig)) argPrefix = argHash(trig.args).slice(0, 16);
|
|
79
|
+
} else if (trig?.kind === "judge") dimension = trig.dimension;
|
|
80
|
+
}
|
|
81
|
+
if (!toolName) {
|
|
82
|
+
const errored = (await toolSpans(store, run.runId)).filter((t) => t.status === "error").pop();
|
|
83
|
+
if (errored) {
|
|
84
|
+
toolName = errored.toolName;
|
|
85
|
+
if (hasCapturedToolArgs(errored)) argPrefix = argHash(errored.args).slice(0, 16);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!dimension) {
|
|
89
|
+
const judge = spans.find((s) => s.kind === "judge" && typeof s.dimension === "string");
|
|
90
|
+
if (judge?.kind === "judge") dimension = judge.dimension;
|
|
91
|
+
}
|
|
92
|
+
const key = `${cls.failureClass}|${toolName ?? ""}|${argPrefix ?? ""}|${dimension ?? ""}`;
|
|
93
|
+
let cluster = clusters.get(key);
|
|
94
|
+
if (!cluster) {
|
|
95
|
+
cluster = {
|
|
96
|
+
failureClass: cls.failureClass,
|
|
97
|
+
toolName,
|
|
98
|
+
argPrefix,
|
|
99
|
+
dimension,
|
|
100
|
+
runCount: 0,
|
|
101
|
+
scenarioIds: [],
|
|
102
|
+
exampleRunId: run.runId,
|
|
103
|
+
exampleError: firstErrorMessage(spans) ?? cls.reason
|
|
104
|
+
};
|
|
105
|
+
clusters.set(key, cluster);
|
|
106
|
+
}
|
|
107
|
+
cluster.runCount++;
|
|
108
|
+
if (!cluster.scenarioIds.includes(run.scenarioId)) cluster.scenarioIds.push(run.scenarioId);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
clusters: [...clusters.values()].filter((c) => c.runCount >= minSize).sort((a, b) => b.runCount - a.runCount),
|
|
112
|
+
totalFailures,
|
|
113
|
+
totalRuns: runs.length
|
|
114
|
+
};
|
|
129
115
|
}
|
|
130
116
|
function firstErrorMessage(spans) {
|
|
131
|
-
|
|
132
|
-
return errored?.error;
|
|
117
|
+
return spans.find((s) => s.status === "error")?.error;
|
|
133
118
|
}
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/pipelines/first-divergence.ts
|
|
136
121
|
async function firstDivergenceView(store, runA, runB, options = {}) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
122
|
+
const [a, b] = await Promise.all([buildTrajectory(store, runA), buildTrajectory(store, runB)]);
|
|
123
|
+
const eq = options.stepEquals ?? defaultStepEquals;
|
|
124
|
+
const minLen = Math.min(a.steps.length, b.steps.length);
|
|
125
|
+
for (let i = 0; i < minLen; i++) {
|
|
126
|
+
const aStep = a.steps[i];
|
|
127
|
+
const bStep = b.steps[i];
|
|
128
|
+
if (!eq(aStep, bStep)) return {
|
|
129
|
+
runA,
|
|
130
|
+
runB,
|
|
131
|
+
firstDivergenceIndex: i,
|
|
132
|
+
aStep,
|
|
133
|
+
bStep,
|
|
134
|
+
reason: describeDifference(aStep, bStep),
|
|
135
|
+
commonPrefixLen: i
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (a.steps.length === b.steps.length) return {
|
|
139
|
+
runA,
|
|
140
|
+
runB,
|
|
141
|
+
firstDivergenceIndex: null,
|
|
142
|
+
commonPrefixLen: minLen
|
|
143
|
+
};
|
|
144
|
+
const extra = (a.steps.length > b.steps.length ? a : b).steps.length - minLen;
|
|
145
|
+
const reason = minLen === 0 ? `one trajectory is empty; the other has ${extra} step(s) starting at index 0` : `one trajectory has ${extra} more step(s) after index ${minLen - 1}`;
|
|
146
|
+
return {
|
|
147
|
+
runA,
|
|
148
|
+
runB,
|
|
149
|
+
firstDivergenceIndex: minLen,
|
|
150
|
+
aStep: a.steps[minLen],
|
|
151
|
+
bStep: b.steps[minLen],
|
|
152
|
+
reason,
|
|
153
|
+
commonPrefixLen: minLen
|
|
154
|
+
};
|
|
170
155
|
}
|
|
171
156
|
function defaultStepEquals(a, b) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return a.span.name === b.span.name;
|
|
157
|
+
if (a.span.kind !== b.span.kind) return false;
|
|
158
|
+
if (a.span.kind === "tool" && b.span.kind === "tool") return a.span.toolName === b.span.toolName;
|
|
159
|
+
if (a.span.kind === "llm" && b.span.kind === "llm") return a.span.model === b.span.model;
|
|
160
|
+
if (a.span.kind === "judge" && b.span.kind === "judge") return a.span.dimension === b.span.dimension;
|
|
161
|
+
return a.span.name === b.span.name;
|
|
178
162
|
}
|
|
179
163
|
function describeDifference(a, b) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (a.span.kind === "llm" && b.span.kind === "llm" && a.span.model !== b.span.model) {
|
|
185
|
-
return `model ${a.span.model} vs ${b.span.model}`;
|
|
186
|
-
}
|
|
187
|
-
return `name "${a.span.name}" vs "${b.span.name}"`;
|
|
164
|
+
if (a.span.kind !== b.span.kind) return `kind ${a.span.kind} vs ${b.span.kind}`;
|
|
165
|
+
if (a.span.kind === "tool" && b.span.kind === "tool" && a.span.toolName !== b.span.toolName) return `tool ${a.span.toolName} vs ${b.span.toolName}`;
|
|
166
|
+
if (a.span.kind === "llm" && b.span.kind === "llm" && a.span.model !== b.span.model) return `model ${a.span.model} vs ${b.span.model}`;
|
|
167
|
+
return `name "${a.span.name}" vs "${b.span.name}"`;
|
|
188
168
|
}
|
|
189
|
-
|
|
190
|
-
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/pipelines/judge-agreement.ts
|
|
171
|
+
/**
|
|
172
|
+
* JudgeAgreementView — pairwise agreement between judges across the
|
|
173
|
+
* corpus, grouped by dimension.
|
|
174
|
+
*
|
|
175
|
+
* Output drives two workflows:
|
|
176
|
+
* - Judge robustness audit: "does Claude agree with GPT at κ ≥ 0.6?"
|
|
177
|
+
* - Calibration tracking: κ vs golden human labels over time (by
|
|
178
|
+
* providing a `humanGoldenJudgeId`).
|
|
179
|
+
*/
|
|
191
180
|
async function judgeAgreementView(store) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
181
|
+
const all = (await store.spans({ kind: "judge" })).filter((s) => s.kind === "judge");
|
|
182
|
+
if (all.length === 0) return {
|
|
183
|
+
pairs: [],
|
|
184
|
+
dimensions: [],
|
|
185
|
+
judgeIds: []
|
|
186
|
+
};
|
|
187
|
+
const byDimension = /* @__PURE__ */ new Map();
|
|
188
|
+
for (const s of all) {
|
|
189
|
+
const arr = byDimension.get(s.dimension) ?? [];
|
|
190
|
+
arr.push(s);
|
|
191
|
+
byDimension.set(s.dimension, arr);
|
|
192
|
+
}
|
|
193
|
+
const judgeIds = [...new Set(all.map((s) => s.judgeId))].sort();
|
|
194
|
+
const pairs = [];
|
|
195
|
+
for (const [dim, spans] of byDimension) {
|
|
196
|
+
const byJudge = /* @__PURE__ */ new Map();
|
|
197
|
+
for (const s of spans) {
|
|
198
|
+
const m = byJudge.get(s.judgeId) ?? /* @__PURE__ */ new Map();
|
|
199
|
+
m.set(s.targetSpanId, s.score);
|
|
200
|
+
byJudge.set(s.judgeId, m);
|
|
201
|
+
}
|
|
202
|
+
const judgesHere = [...byJudge.keys()];
|
|
203
|
+
for (let i = 0; i < judgesHere.length; i++) for (let j = i + 1; j < judgesHere.length; j++) {
|
|
204
|
+
const judgeI = judgesHere[i];
|
|
205
|
+
const judgeJ = judgesHere[j];
|
|
206
|
+
const a = byJudge.get(judgeI);
|
|
207
|
+
const b = byJudge.get(judgeJ);
|
|
208
|
+
const common = [];
|
|
209
|
+
for (const [target, scoreA] of a) {
|
|
210
|
+
const scoreB = b.get(target);
|
|
211
|
+
if (scoreB !== void 0) common.push([scoreA, scoreB]);
|
|
212
|
+
}
|
|
213
|
+
if (common.length < 2) continue;
|
|
214
|
+
const judgeScores = common.map(([scoreA, scoreB]) => [{
|
|
215
|
+
judgeName: judgeI,
|
|
216
|
+
dimension: dim,
|
|
217
|
+
score: scoreA,
|
|
218
|
+
reasoning: ""
|
|
219
|
+
}, {
|
|
220
|
+
judgeName: judgeJ,
|
|
221
|
+
dimension: dim,
|
|
222
|
+
score: scoreB,
|
|
223
|
+
reasoning: ""
|
|
224
|
+
}]);
|
|
225
|
+
const k = interRaterReliability(judgeScores[0].map((_, k2) => judgeScores.map((pair) => pair[k2])));
|
|
226
|
+
pairs.push({
|
|
227
|
+
judgeA: judgeI,
|
|
228
|
+
judgeB: judgeJ,
|
|
229
|
+
dimension: dim,
|
|
230
|
+
commonItems: common.length,
|
|
231
|
+
pearson: pearsonR(common.map((c) => c[0]), common.map((c) => c[1])),
|
|
232
|
+
krippendorff: k
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
pairs: pairs.sort((a, b) => b.commonItems - a.commonItems),
|
|
238
|
+
dimensions: [...byDimension.keys()].sort(),
|
|
239
|
+
judgeIds
|
|
240
|
+
};
|
|
252
241
|
}
|
|
253
|
-
|
|
254
|
-
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/pipelines/regression.ts
|
|
244
|
+
/**
|
|
245
|
+
* RegressionView — compares a candidate slice to a baseline slice on a
|
|
246
|
+
* named metric. Delegates the statistics (Welch's t-test, Cohen's d,
|
|
247
|
+
* IQR stability) to `baseline.ts`.
|
|
248
|
+
*
|
|
249
|
+
* This is the entry point for CI regression gates: "given runs tagged
|
|
250
|
+
* release=A and release=B, did any metric regress?"
|
|
251
|
+
*/
|
|
255
252
|
async function regressionView(store, metrics, options) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
253
|
+
const baselineRuns = await store.listRuns(options.baseline);
|
|
254
|
+
const candidateRuns = await store.listRuns(options.candidate);
|
|
255
|
+
return compareToBaseline(await Promise.all(metrics.map(async (m) => {
|
|
256
|
+
const extract = m.extract ?? defaultExtract(m.metric);
|
|
257
|
+
const baseline = await extractAll(baselineRuns, extract, store);
|
|
258
|
+
const candidate = await extractAll(candidateRuns, extract, store);
|
|
259
|
+
return {
|
|
260
|
+
metric: m.metric,
|
|
261
|
+
higherIsBetter: m.higherIsBetter,
|
|
262
|
+
baseline,
|
|
263
|
+
candidate
|
|
264
|
+
};
|
|
265
|
+
})), options);
|
|
267
266
|
}
|
|
268
267
|
async function extractAll(runs, extract, store) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
268
|
+
const out = [];
|
|
269
|
+
for (const r of runs) {
|
|
270
|
+
const v = await extract(r, store);
|
|
271
|
+
if (v !== null && Number.isFinite(v)) out.push(v);
|
|
272
|
+
}
|
|
273
|
+
return out;
|
|
275
274
|
}
|
|
276
275
|
function defaultExtract(metric) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
case "inputTokens": {
|
|
291
|
-
const llm = await llmSpans(store, run.runId);
|
|
292
|
-
return aggregateLlm(llm).inputTokens;
|
|
293
|
-
}
|
|
294
|
-
case "outputTokens": {
|
|
295
|
-
const llm = await llmSpans(store, run.runId);
|
|
296
|
-
return aggregateLlm(llm).outputTokens;
|
|
297
|
-
}
|
|
298
|
-
case "failureClass": {
|
|
299
|
-
return runFailureClass(run) === "success" ? 1 : 0;
|
|
300
|
-
}
|
|
301
|
-
default:
|
|
302
|
-
return null;
|
|
303
|
-
}
|
|
304
|
-
};
|
|
276
|
+
return async (run, store) => {
|
|
277
|
+
switch (metric) {
|
|
278
|
+
case "score":
|
|
279
|
+
case "overallScore": return run.outcome?.score ?? null;
|
|
280
|
+
case "pass": return run.outcome?.pass === true ? 1 : 0;
|
|
281
|
+
case "durationMs": return run.endedAt && run.startedAt ? run.endedAt - run.startedAt : null;
|
|
282
|
+
case "costUsd": return aggregateLlm(await llmSpans(store, run.runId)).costUsd;
|
|
283
|
+
case "inputTokens": return aggregateLlm(await llmSpans(store, run.runId)).inputTokens;
|
|
284
|
+
case "outputTokens": return aggregateLlm(await llmSpans(store, run.runId)).outputTokens;
|
|
285
|
+
case "failureClass": return runFailureClass(run) === "success" ? 1 : 0;
|
|
286
|
+
default: return null;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
305
289
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region src/pipelines/stuck-loop.ts
|
|
292
|
+
/**
|
|
293
|
+
* StuckLoopView — detects when an agent calls the same tool with the
|
|
294
|
+
* same (or structurally similar) arguments ≥ N times in a short window.
|
|
295
|
+
*
|
|
296
|
+
* Rationale: agents that loop are the number-one production failure
|
|
297
|
+
* mode on long-horizon flows. The view returns (runId, toolName,
|
|
298
|
+
* argHash, occurrences, windowMs) for each detected loop plus a
|
|
299
|
+
* fraction of runs affected.
|
|
300
|
+
*/
|
|
301
|
+
const DEFAULT_MAX_WINDOW_MS = 6e4;
|
|
302
|
+
const DEFAULT_MAX_INTERVENING_TOOL_CALLS = 0;
|
|
310
303
|
async function stuckLoopView(store, options = {}) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
304
|
+
const minOccurrences = options.minOccurrences ?? 3;
|
|
305
|
+
const maxWindowMs = options.maxWindowMs ?? DEFAULT_MAX_WINDOW_MS;
|
|
306
|
+
const maxInterveningToolCalls = options.maxInterveningToolCalls ?? DEFAULT_MAX_INTERVENING_TOOL_CALLS;
|
|
307
|
+
if (!Number.isInteger(minOccurrences) || minOccurrences < 1) throw new RangeError("minOccurrences must be a positive integer");
|
|
308
|
+
if (!Number.isFinite(maxWindowMs) || maxWindowMs < 0) throw new RangeError("maxWindowMs must be a finite non-negative number");
|
|
309
|
+
if (!Number.isInteger(maxInterveningToolCalls) || maxInterveningToolCalls < 0) throw new RangeError("maxInterveningToolCalls must be a non-negative integer");
|
|
310
|
+
const runs = options.runId ? [{ runId: options.runId }] : (await store.listRuns()).map((r) => ({ runId: r.runId }));
|
|
311
|
+
const findings = [];
|
|
312
|
+
for (const { runId } of runs) {
|
|
313
|
+
const spans = await store.spans({ runId });
|
|
314
|
+
const spansById = new Map(spans.map((span) => [span.spanId, span]));
|
|
315
|
+
const scopedTools = spans.filter(isToolSpan).map((span, sourceIndex) => ({
|
|
316
|
+
span,
|
|
317
|
+
sourceIndex
|
|
318
|
+
})).sort((a, b) => a.span.startedAt - b.span.startedAt || a.sourceIndex - b.sourceIndex).map(({ span }) => ({
|
|
319
|
+
span,
|
|
320
|
+
...executionScope(span, spansById)
|
|
321
|
+
}));
|
|
322
|
+
const trackByLane = executionTrackByLane(scopedTools.map((call) => {
|
|
323
|
+
const timed = call.laneSpanId === null || call.laneSpanId === call.scopeSpanId ? call.span : call.laneSpanId ? spansById.get(call.laneSpanId) : void 0;
|
|
324
|
+
return {
|
|
325
|
+
key: executionKey(call),
|
|
326
|
+
scopeKey: JSON.stringify(call.scopeSpanId),
|
|
327
|
+
start: timed?.startedAt ?? null,
|
|
328
|
+
end: timed?.endedAt ?? null
|
|
329
|
+
};
|
|
330
|
+
}));
|
|
331
|
+
const nextToolIndexByTrack = /* @__PURE__ */ new Map();
|
|
332
|
+
const orderedTools = scopedTools.map((call) => {
|
|
333
|
+
const trackId = trackByLane.get(executionKey(call));
|
|
334
|
+
const toolCallIndex = nextToolIndexByTrack.get(trackId) ?? 0;
|
|
335
|
+
nextToolIndexByTrack.set(trackId, toolCallIndex + 1);
|
|
336
|
+
return {
|
|
337
|
+
...call,
|
|
338
|
+
toolCallIndex,
|
|
339
|
+
trackId
|
|
340
|
+
};
|
|
341
|
+
});
|
|
342
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
343
|
+
for (const call of orderedTools) {
|
|
344
|
+
if (!hasCapturedToolArgs(call.span)) continue;
|
|
345
|
+
const h = argHash(call.span.args);
|
|
346
|
+
const key = JSON.stringify([
|
|
347
|
+
call.trackId,
|
|
348
|
+
call.span.toolName,
|
|
349
|
+
h
|
|
350
|
+
]);
|
|
351
|
+
const bucket = byKey.get(key) ?? {
|
|
352
|
+
calls: [],
|
|
353
|
+
argHash: h,
|
|
354
|
+
toolName: call.span.toolName,
|
|
355
|
+
scopeSpanId: call.scopeSpanId
|
|
356
|
+
};
|
|
357
|
+
bucket.calls.push(call);
|
|
358
|
+
byKey.set(key, bucket);
|
|
359
|
+
}
|
|
360
|
+
for (const { calls, argHash: h, toolName, scopeSpanId } of byKey.values()) {
|
|
361
|
+
if (calls.length < minOccurrences) continue;
|
|
362
|
+
let episodeStart = 0;
|
|
363
|
+
for (let episodeEnd = 1; episodeEnd <= calls.length; episodeEnd += 1) {
|
|
364
|
+
const previous = calls[episodeEnd - 1];
|
|
365
|
+
const next = calls[episodeEnd];
|
|
366
|
+
if (!(next === void 0 || next.span.startedAt - previous.span.startedAt > maxWindowMs || next.toolCallIndex - previous.toolCallIndex - 1 > maxInterveningToolCalls || !callsAreSerial(previous, next))) continue;
|
|
367
|
+
const episode = calls.slice(episodeStart, episodeEnd);
|
|
368
|
+
let left = 0;
|
|
369
|
+
let bestStart = 0;
|
|
370
|
+
let bestEnd = -1;
|
|
371
|
+
for (let right = 0; right < episode.length; right += 1) {
|
|
372
|
+
while (episode[right].span.startedAt - episode[left].span.startedAt > maxWindowMs) left += 1;
|
|
373
|
+
if (right - left > bestEnd - bestStart) {
|
|
374
|
+
bestStart = left;
|
|
375
|
+
bestEnd = right;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (bestEnd - bestStart + 1 >= minOccurrences) {
|
|
379
|
+
const loop = episode.slice(bestStart, bestEnd + 1);
|
|
380
|
+
const first = loop[0].span.startedAt;
|
|
381
|
+
const last = loop[loop.length - 1].span.startedAt;
|
|
382
|
+
findings.push({
|
|
383
|
+
runId,
|
|
384
|
+
toolName,
|
|
385
|
+
argHash: h,
|
|
386
|
+
occurrences: loop.length,
|
|
387
|
+
spanIds: loop.map((call) => call.span.spanId),
|
|
388
|
+
...scopeSpanId ? { scopeSpanId } : {},
|
|
389
|
+
windowMs: last - first
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
episodeStart = episodeEnd;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
const affectedRuns = new Set(findings.map((f) => f.runId));
|
|
397
|
+
return {
|
|
398
|
+
findings,
|
|
399
|
+
affectedRunRatio: runs.length > 0 ? affectedRuns.size / runs.length : 0,
|
|
400
|
+
totalRuns: runs.length
|
|
401
|
+
};
|
|
407
402
|
}
|
|
408
403
|
function laneKey(call) {
|
|
409
|
-
|
|
404
|
+
return JSON.stringify([call.scopeSpanId, call.laneSpanId]);
|
|
410
405
|
}
|
|
411
406
|
function executionKey(call) {
|
|
412
|
-
|
|
407
|
+
return call.laneSpanId === null || call.laneSpanId === call.scopeSpanId ? JSON.stringify([call.scopeSpanId, call.span.spanId]) : laneKey(call);
|
|
413
408
|
}
|
|
414
409
|
function executionScope(span, spansById) {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
410
|
+
const directParent = span.parentSpanId;
|
|
411
|
+
if (!directParent) return {
|
|
412
|
+
scopeSpanId: null,
|
|
413
|
+
laneSpanId: null
|
|
414
|
+
};
|
|
415
|
+
let currentId = directParent;
|
|
416
|
+
let laneSpanId = null;
|
|
417
|
+
const seen = /* @__PURE__ */ new Set();
|
|
418
|
+
while (currentId && !seen.has(currentId)) {
|
|
419
|
+
seen.add(currentId);
|
|
420
|
+
const current = spansById.get(currentId);
|
|
421
|
+
if (!current) return {
|
|
422
|
+
scopeSpanId: directParent,
|
|
423
|
+
laneSpanId: directParent
|
|
424
|
+
};
|
|
425
|
+
if (current.kind === "agent") return {
|
|
426
|
+
scopeSpanId: current.spanId,
|
|
427
|
+
laneSpanId: laneSpanId ?? current.spanId
|
|
428
|
+
};
|
|
429
|
+
laneSpanId = current.spanId;
|
|
430
|
+
currentId = current.parentSpanId;
|
|
431
|
+
}
|
|
432
|
+
return {
|
|
433
|
+
scopeSpanId: directParent,
|
|
434
|
+
laneSpanId: directParent
|
|
435
|
+
};
|
|
431
436
|
}
|
|
432
437
|
function callsAreSerial(previous, next) {
|
|
433
|
-
|
|
438
|
+
return previous.span.endedAt !== void 0 && previous.span.endedAt <= next.span.startedAt;
|
|
434
439
|
}
|
|
435
|
-
|
|
436
|
-
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/pipelines/tool-waste.ts
|
|
442
|
+
/**
|
|
443
|
+
* ToolWasteView — fraction of tool calls whose results weren't used
|
|
444
|
+
* downstream. Without a "used" signal we fall back to structural
|
|
445
|
+
* proxies: error calls, duplicate calls, and tool calls followed by
|
|
446
|
+
* zero subsequent LLM spans are all considered waste.
|
|
447
|
+
*
|
|
448
|
+
* Consumers can pass a `usageOracle` that inspects a tool span and
|
|
449
|
+
* returns true iff the tool's result appears in a later LLM message,
|
|
450
|
+
* artifact, or state mutation — that's the canonical definition; the
|
|
451
|
+
* default heuristic is a reasonable fallback.
|
|
452
|
+
*/
|
|
437
453
|
async function toolWasteView(store, options = {}) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
454
|
+
const runs = options.runId ? [options.runId] : (await store.listRuns()).map((r) => r.runId);
|
|
455
|
+
const byRun = [];
|
|
456
|
+
let totalCalls = 0;
|
|
457
|
+
let totalWasted = 0;
|
|
458
|
+
for (const runId of runs) {
|
|
459
|
+
const tools = await toolSpans(store, runId);
|
|
460
|
+
if (tools.length === 0) {
|
|
461
|
+
byRun.push({
|
|
462
|
+
runId,
|
|
463
|
+
wastedCalls: 0,
|
|
464
|
+
totalCalls: 0,
|
|
465
|
+
wasteRate: 0
|
|
466
|
+
});
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
const sortedLlm = [...await llmSpans(store, runId)].sort((a, b) => a.startedAt - b.startedAt);
|
|
470
|
+
const startTimes = sortedLlm.map((l) => l.startedAt);
|
|
471
|
+
const suffixText = buildSuffixText(sortedLlm);
|
|
472
|
+
let wasted = 0;
|
|
473
|
+
for (const t of tools) {
|
|
474
|
+
if (t.status === "error") {
|
|
475
|
+
wasted++;
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
const cutoff = upperBound(startTimes, t.startedAt);
|
|
479
|
+
if (options.usageOracle) {
|
|
480
|
+
if (!options.usageOracle(t, { llm: sortedLlm.slice(cutoff) })) wasted++;
|
|
481
|
+
} else {
|
|
482
|
+
const resultStr = stringify(t.result);
|
|
483
|
+
if (resultStr === "") continue;
|
|
484
|
+
if (!(suffixText[cutoff] ?? "").includes(resultStr.slice(0, 120))) wasted++;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
const wasteRate = wasted / tools.length;
|
|
488
|
+
byRun.push({
|
|
489
|
+
runId,
|
|
490
|
+
wastedCalls: wasted,
|
|
491
|
+
totalCalls: tools.length,
|
|
492
|
+
wasteRate
|
|
493
|
+
});
|
|
494
|
+
totalCalls += tools.length;
|
|
495
|
+
totalWasted += wasted;
|
|
496
|
+
}
|
|
497
|
+
return {
|
|
498
|
+
byRun,
|
|
499
|
+
overallWasteRate: totalCalls > 0 ? totalWasted / totalCalls : 0
|
|
500
|
+
};
|
|
475
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
* Build per-position suffix haystacks: result[i] is the concatenation of every
|
|
504
|
+
* string message content in spans[i..end]. Built back-to-front so each entry
|
|
505
|
+
* reuses the next one — O(total message text) rather than O(spans²).
|
|
506
|
+
*/
|
|
476
507
|
function buildSuffixText(spans) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
(m) => typeof m.content === "string" ? m.content : ""
|
|
482
|
-
).join("\n");
|
|
483
|
-
result[i] = `${own}
|
|
484
|
-
${result[i + 1]}`;
|
|
485
|
-
}
|
|
486
|
-
return result;
|
|
508
|
+
const result = new Array(spans.length + 1);
|
|
509
|
+
result[spans.length] = "";
|
|
510
|
+
for (let i = spans.length - 1; i >= 0; i--) result[i] = `${spans[i].messages.map((m) => typeof m.content === "string" ? m.content : "").join("\n")}\n${result[i + 1]}`;
|
|
511
|
+
return result;
|
|
487
512
|
}
|
|
513
|
+
/** Index of the first element strictly greater than `target` in a sorted array. */
|
|
488
514
|
function upperBound(sorted, target) {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
515
|
+
let lo = 0;
|
|
516
|
+
let hi = sorted.length;
|
|
517
|
+
while (lo < hi) {
|
|
518
|
+
const mid = lo + hi >>> 1;
|
|
519
|
+
if (sorted[mid] <= target) lo = mid + 1;
|
|
520
|
+
else hi = mid;
|
|
521
|
+
}
|
|
522
|
+
return lo;
|
|
497
523
|
}
|
|
498
524
|
function stringify(v) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
525
|
+
if (v === null || v === void 0) return "";
|
|
526
|
+
if (typeof v === "string") return v;
|
|
527
|
+
try {
|
|
528
|
+
return JSON.stringify(v);
|
|
529
|
+
} catch {
|
|
530
|
+
return String(v);
|
|
531
|
+
}
|
|
506
532
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
failureClusterView,
|
|
511
|
-
firstDivergenceView,
|
|
512
|
-
judgeAgreementView,
|
|
513
|
-
regressionView,
|
|
514
|
-
stuckLoopView,
|
|
515
|
-
toolWasteView
|
|
516
|
-
};
|
|
533
|
+
//#endregion
|
|
534
|
+
export { budgetBreachView, computeToolUseMetrics, failureClusterView, firstDivergenceView, judgeAgreementView, regressionView, stuckLoopView, toolWasteView };
|
|
535
|
+
|
|
517
536
|
//# sourceMappingURL=index.js.map
|