@tangle-network/agent-eval 0.128.2 → 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 +279 -0
- package/README.md +19 -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 +83 -2932
- package/dist/analyst/index.d.ts.map +1 -0
- package/dist/analyst/index.js +319 -364
- 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 -1205
- package/dist/belief-state/index.d.ts.map +1 -0
- package/dist/belief-state/index.js +1617 -1710
- package/dist/belief-state/index.js.map +1 -1
- package/dist/benchmarks/index.d.ts +2 -894
- package/dist/benchmarks/index.js +2 -59
- 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 -6390
- package/dist/campaign/index.js +3 -212
- 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 -174
- 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 -5605
- package/dist/contract/index.d.ts.map +1 -0
- package/dist/contract/index.js +1730 -1937
- package/dist/contract/index.js.map +1 -1
- package/dist/control.d.ts +3 -1030
- package/dist/control.js +2 -32
- 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 -617
- 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 +3776 -15120
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11185 -11191
- 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 -481
- 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 -1298
- package/dist/reporting.js +6 -50
- 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 +916 -3596
- package/dist/rl.d.ts.map +1 -0
- package/dist/rl.js +2362 -1751
- package/dist/rl.js.map +1 -1
- package/dist/rolldown-runtime-8H4AJuhK.js +14 -0
- package/dist/rollout/index.d.ts +3 -1048
- package/dist/rollout/index.js +8 -110
- 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/run-record-BuoE80Dq.js.map +1 -0
- 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 -849
- package/dist/supervisor-run/index.js +2 -64
- 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 -251
- 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 -1174
- package/dist/wire/index.d.ts.map +1 -0
- package/dist/wire/index.js +2 -81
- package/docs/feature-guide.md +1 -1
- package/docs/rollout.md +116 -2
- package/package.json +18 -10
- package/dist/benchmarks/index.js.map +0 -1
- package/dist/campaign/index.js.map +0 -1
- package/dist/chunk-2JX3CFMB.js +0 -695
- package/dist/chunk-2JX3CFMB.js.map +0 -1
- package/dist/chunk-2MKQIFS4.js +0 -183
- package/dist/chunk-2MKQIFS4.js.map +0 -1
- package/dist/chunk-3RF76KTD.js +0 -84
- package/dist/chunk-3RF76KTD.js.map +0 -1
- package/dist/chunk-5DTSBUL2.js +0 -159
- package/dist/chunk-5DTSBUL2.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-BYT7ELPS.js +0 -1553
- package/dist/chunk-BYT7ELPS.js.map +0 -1
- package/dist/chunk-DJKY2TSY.js +0 -2428
- package/dist/chunk-DJKY2TSY.js.map +0 -1
- package/dist/chunk-DPUHNQLN.js +0 -232
- package/dist/chunk-DPUHNQLN.js.map +0 -1
- package/dist/chunk-DRYIUNWY.js +0 -622
- package/dist/chunk-DRYIUNWY.js.map +0 -1
- package/dist/chunk-EJGRPCO3.js +0 -617
- package/dist/chunk-EJGRPCO3.js.map +0 -1
- package/dist/chunk-EOSZT7PL.js +0 -2001
- package/dist/chunk-EOSZT7PL.js.map +0 -1
- package/dist/chunk-EZJEIH2R.js +0 -1559
- package/dist/chunk-EZJEIH2R.js.map +0 -1
- package/dist/chunk-GGE4NNQT.js +0 -65
- package/dist/chunk-GGE4NNQT.js.map +0 -1
- package/dist/chunk-HHWE3POT.js +0 -94
- package/dist/chunk-HHWE3POT.js.map +0 -1
- package/dist/chunk-IHQDPH7D.js +0 -171
- package/dist/chunk-IHQDPH7D.js.map +0 -1
- package/dist/chunk-JHCHEVET.js +0 -274
- package/dist/chunk-JHCHEVET.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-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-MHELPNRP.js +0 -1212
- package/dist/chunk-MHELPNRP.js.map +0 -1
- package/dist/chunk-NACAGYSY.js +0 -1040
- package/dist/chunk-NACAGYSY.js.map +0 -1
- package/dist/chunk-NKAGIDE2.js +0 -7633
- package/dist/chunk-NKAGIDE2.js.map +0 -1
- package/dist/chunk-NPCTHQIO.js +0 -91
- package/dist/chunk-NPCTHQIO.js.map +0 -1
- package/dist/chunk-NYLOYM6N.js +0 -332
- package/dist/chunk-NYLOYM6N.js.map +0 -1
- package/dist/chunk-ONWEPEDO.js +0 -57
- package/dist/chunk-ONWEPEDO.js.map +0 -1
- package/dist/chunk-P5W7RQKK.js +0 -576
- package/dist/chunk-P5W7RQKK.js.map +0 -1
- package/dist/chunk-P6FYH6K4.js +0 -1161
- package/dist/chunk-P6FYH6K4.js.map +0 -1
- package/dist/chunk-PBE2LOSS.js +0 -669
- package/dist/chunk-PBE2LOSS.js.map +0 -1
- package/dist/chunk-PC4UYEBM.js +0 -166
- package/dist/chunk-PC4UYEBM.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-RZTMDUO7.js +0 -49
- package/dist/chunk-RZTMDUO7.js.map +0 -1
- package/dist/chunk-S5YLIBFX.js +0 -136
- package/dist/chunk-S5YLIBFX.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-TBL77AUT.js +0 -355
- package/dist/chunk-TBL77AUT.js.map +0 -1
- package/dist/chunk-TSN7JT6D.js +0 -1646
- package/dist/chunk-TSN7JT6D.js.map +0 -1
- package/dist/chunk-TT4KNT67.js +0 -124
- package/dist/chunk-TT4KNT67.js.map +0 -1
- package/dist/chunk-UB2LOJ6Q.js +0 -4461
- package/dist/chunk-UB2LOJ6Q.js.map +0 -1
- package/dist/chunk-UWZZKKU7.js +0 -237
- package/dist/chunk-UWZZKKU7.js.map +0 -1
- package/dist/chunk-VBQ3CRKH.js +0 -291
- package/dist/chunk-VBQ3CRKH.js.map +0 -1
- package/dist/chunk-VGRCHJON.js +0 -163
- package/dist/chunk-VGRCHJON.js.map +0 -1
- package/dist/chunk-VI2UW6B6.js +0 -162
- package/dist/chunk-VI2UW6B6.js.map +0 -1
- package/dist/chunk-VLOATJQ2.js +0 -908
- package/dist/chunk-VLOATJQ2.js.map +0 -1
- package/dist/chunk-VQMK5FMP.js +0 -247
- package/dist/chunk-VQMK5FMP.js.map +0 -1
- package/dist/chunk-VZSRQ272.js +0 -149
- package/dist/chunk-VZSRQ272.js.map +0 -1
- package/dist/chunk-WGXIEX7P.js +0 -116
- package/dist/chunk-WGXIEX7P.js.map +0 -1
- package/dist/chunk-WS3NZZQQ.js +0 -929
- package/dist/chunk-WS3NZZQQ.js.map +0 -1
- package/dist/chunk-XDWDC2MP.js +0 -695
- package/dist/chunk-XDWDC2MP.js.map +0 -1
- package/dist/chunk-XPRT64IE.js +0 -766
- package/dist/chunk-XPRT64IE.js.map +0 -1
- package/dist/chunk-YJBNWCAA.js +0 -1056
- package/dist/chunk-YJBNWCAA.js.map +0 -1
- package/dist/chunk-ZET2UAYW.js +0 -89
- package/dist/chunk-ZET2UAYW.js.map +0 -1
- package/dist/chunk-ZUUWPZCV.js +0 -752
- package/dist/chunk-ZUUWPZCV.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-ISHFZ7FJ.js +0 -17
- package/dist/run-campaign-ISHFZ7FJ.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/chunk-NACAGYSY.js
DELETED
|
@@ -1,1040 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
paretoChart
|
|
3
|
-
} from "./chunk-VLOATJQ2.js";
|
|
4
|
-
import {
|
|
5
|
-
pairRunRecords
|
|
6
|
-
} from "./chunk-DPUHNQLN.js";
|
|
7
|
-
import {
|
|
8
|
-
continuousAgreement,
|
|
9
|
-
pairedBootstrap,
|
|
10
|
-
pairedCohensDz,
|
|
11
|
-
pairedMde,
|
|
12
|
-
pairedTTest,
|
|
13
|
-
pearsonR,
|
|
14
|
-
requiredPairedSampleSize,
|
|
15
|
-
spearmanR
|
|
16
|
-
} from "./chunk-MHELPNRP.js";
|
|
17
|
-
import {
|
|
18
|
-
llmSpans
|
|
19
|
-
} from "./chunk-ZET2UAYW.js";
|
|
20
|
-
import {
|
|
21
|
-
validateRunRecord
|
|
22
|
-
} from "./chunk-2JX3CFMB.js";
|
|
23
|
-
|
|
24
|
-
// src/contamination-guard.ts
|
|
25
|
-
function checkCanaries(output, scenarios) {
|
|
26
|
-
const leaks = [];
|
|
27
|
-
for (const s of scenarios) {
|
|
28
|
-
if (!s.canary) continue;
|
|
29
|
-
if (output.includes(s.canary)) {
|
|
30
|
-
leaks.push({ scenarioId: s.id, canary: s.canary, evidence: excerpt(output, s.canary) });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return leaks;
|
|
34
|
-
}
|
|
35
|
-
function checkBehavioralCanary(output, scenario) {
|
|
36
|
-
const pattern = scenario.forbiddenPattern ?? scenario.canary;
|
|
37
|
-
if (!pattern) return null;
|
|
38
|
-
const hit = matchForbidden(output, pattern);
|
|
39
|
-
if (!hit) return null;
|
|
40
|
-
return {
|
|
41
|
-
scenarioId: scenario.id,
|
|
42
|
-
canary: pattern,
|
|
43
|
-
evidence: excerpt(output, hit)
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function runBehavioralCanaries(cases) {
|
|
47
|
-
const leaks = [];
|
|
48
|
-
for (const c of cases) {
|
|
49
|
-
const leak = checkBehavioralCanary(c.output, c.scenario);
|
|
50
|
-
if (leak) leaks.push({ ...leak, runId: c.runId ?? leak.runId });
|
|
51
|
-
}
|
|
52
|
-
return leaks;
|
|
53
|
-
}
|
|
54
|
-
function matchForbidden(output, pattern) {
|
|
55
|
-
const re = tryParseRegex(pattern);
|
|
56
|
-
if (re) {
|
|
57
|
-
const m = output.match(re);
|
|
58
|
-
return m && m[0].length > 0 ? m[0] : null;
|
|
59
|
-
}
|
|
60
|
-
return output.includes(pattern) ? pattern : null;
|
|
61
|
-
}
|
|
62
|
-
function tryParseRegex(pattern) {
|
|
63
|
-
if (pattern.length < 2 || pattern[0] !== "/") return null;
|
|
64
|
-
const last = pattern.lastIndexOf("/");
|
|
65
|
-
if (last <= 0) return null;
|
|
66
|
-
const body = pattern.slice(1, last);
|
|
67
|
-
const flags = pattern.slice(last + 1);
|
|
68
|
-
if (!/^[gimsuy]*$/.test(flags)) return null;
|
|
69
|
-
try {
|
|
70
|
-
return new RegExp(body, flags);
|
|
71
|
-
} catch {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async function canaryLeakView(store, scenarios) {
|
|
76
|
-
const targets = scenarios.filter((s) => !!s.canary);
|
|
77
|
-
if (targets.length === 0) return [];
|
|
78
|
-
const spans = await llmSpans(store);
|
|
79
|
-
const leaks = [];
|
|
80
|
-
for (const span of spans) {
|
|
81
|
-
const output = span.output ?? "";
|
|
82
|
-
for (const s of targets) {
|
|
83
|
-
if (s.canary && output.includes(s.canary)) {
|
|
84
|
-
leaks.push({
|
|
85
|
-
scenarioId: s.id,
|
|
86
|
-
canary: s.canary,
|
|
87
|
-
runId: span.runId,
|
|
88
|
-
evidence: excerpt(output, s.canary)
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return leaks;
|
|
94
|
-
}
|
|
95
|
-
var HoldoutAuditor = class {
|
|
96
|
-
scenarios;
|
|
97
|
-
accessLog = [];
|
|
98
|
-
constructor(scenarios) {
|
|
99
|
-
this.scenarios = scenarios;
|
|
100
|
-
}
|
|
101
|
-
/** Retrieve a holdout scenario for a declared purpose. Non-'evaluation' throws. */
|
|
102
|
-
get(scenarioId, purpose) {
|
|
103
|
-
if (purpose !== "evaluation" && purpose !== "debugging") {
|
|
104
|
-
throw new Error(
|
|
105
|
-
`HoldoutAuditor.get: purpose must be 'evaluation' or 'debugging', got ${purpose}`
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
const s = this.scenarios.find((x) => x.id === scenarioId);
|
|
109
|
-
if (!s) throw new Error(`holdout scenario "${scenarioId}" not found`);
|
|
110
|
-
this.accessLog.push({ scenarioId, purpose, at: Date.now() });
|
|
111
|
-
return s;
|
|
112
|
-
}
|
|
113
|
-
getAccessLog() {
|
|
114
|
-
return this.accessLog;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
function excerpt(source, needle) {
|
|
118
|
-
const at = source.indexOf(needle);
|
|
119
|
-
if (at < 0) return "";
|
|
120
|
-
const start = Math.max(0, at - 30);
|
|
121
|
-
const end = Math.min(source.length, at + needle.length + 30);
|
|
122
|
-
return (start > 0 ? "\u2026" : "") + source.slice(start, end) + (end < source.length ? "\u2026" : "");
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// src/contract/analyze-runs.ts
|
|
126
|
-
function summarizeExecution(opts) {
|
|
127
|
-
const runs = opts.runs.map(validateRunRecord);
|
|
128
|
-
const bins = opts.histogramBins ?? 12;
|
|
129
|
-
return {
|
|
130
|
-
execution: computeExecutionInsight(runs, bins),
|
|
131
|
-
costProvenance: summarizeCostProvenance(runs)
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
async function analyzeRuns(opts) {
|
|
135
|
-
const runs = opts.runs.map(validateRunRecord);
|
|
136
|
-
const bins = opts.histogramBins ?? 12;
|
|
137
|
-
const threshold = opts.decisionThreshold ?? 0.02;
|
|
138
|
-
const split = resolveSplit(runs, opts.split ?? "auto");
|
|
139
|
-
const compositeWithIds = runs.map((r) => ({ runId: r.runId, score: compositeOf(r, split) })).filter((p) => Number.isFinite(p.score));
|
|
140
|
-
const composite = distributionOf(
|
|
141
|
-
compositeWithIds.map((p) => p.score),
|
|
142
|
-
bins,
|
|
143
|
-
compositeWithIds
|
|
144
|
-
);
|
|
145
|
-
const perDimension = computePerDimension(runs, bins);
|
|
146
|
-
const { execution, costProvenance: provenance } = summarizeExecution({
|
|
147
|
-
runs,
|
|
148
|
-
histogramBins: bins
|
|
149
|
-
});
|
|
150
|
-
const knownCostRuns = runs.filter((run) => run.costProvenance.kind !== "uncaptured");
|
|
151
|
-
const costs = knownCostRuns.map((r) => r.costUsd).filter(isFiniteNumber);
|
|
152
|
-
const costDist = distributionOf(costs, bins);
|
|
153
|
-
const pareto = paretoChart(knownCostRuns, { split });
|
|
154
|
-
const degraded = {};
|
|
155
|
-
if (provenance.uncaptured.n > 0) {
|
|
156
|
-
degraded.cost = diagnoseCostCoverage(runs, provenance);
|
|
157
|
-
} else if (costs.length === 0 || costs.every((c) => c === 0)) {
|
|
158
|
-
degraded.cost = `all ${runs.length} explicitly observed or estimated USD values are $0`;
|
|
159
|
-
}
|
|
160
|
-
if (pareto.points.length < 2) {
|
|
161
|
-
degraded.pareto = pareto.points.length === 0 ? "no candidates \u2014 Pareto unavailable" : "single candidate \u2014 Pareto is a single point, not a frontier";
|
|
162
|
-
}
|
|
163
|
-
const costQuality = {
|
|
164
|
-
cost: costDist,
|
|
165
|
-
pareto,
|
|
166
|
-
provenance,
|
|
167
|
-
...degraded.cost || degraded.pareto ? { degraded } : {}
|
|
168
|
-
};
|
|
169
|
-
const judges = computeJudgeInsights(runs);
|
|
170
|
-
const interRater = opts.raterScores ? computeInterRater(opts.raterScores) : void 0;
|
|
171
|
-
const lift = computeLift(runs, opts.baselineCandidateId, opts.candidateCandidateId, split);
|
|
172
|
-
const failureClusters = opts.analyst ? await computeFailureClusters(runs, opts.analyst, split) : void 0;
|
|
173
|
-
const failureClasses = computeFailureClasses(runs, split);
|
|
174
|
-
const contamination = opts.canaryScenarios ? computeContamination(runs, opts.canaryScenarios) : void 0;
|
|
175
|
-
const outcomeCorrelation = opts.outcomeSignal ? computeOutcomeCorrelation(runs, opts.outcomeSignal, split) : void 0;
|
|
176
|
-
const release = buildReleaseScorecard(composite, lift, contamination);
|
|
177
|
-
const priorPeriodComparison = opts.baselineRuns ? computePriorPeriodComparison(runs, opts.baselineRuns, split, opts.baselineLabel) : void 0;
|
|
178
|
-
const recommendations = buildRecommendations({
|
|
179
|
-
composite,
|
|
180
|
-
judges,
|
|
181
|
-
interRater,
|
|
182
|
-
lift,
|
|
183
|
-
failureClusters,
|
|
184
|
-
failureClasses,
|
|
185
|
-
contamination,
|
|
186
|
-
outcomeCorrelation,
|
|
187
|
-
priorPeriodComparison,
|
|
188
|
-
threshold
|
|
189
|
-
});
|
|
190
|
-
return {
|
|
191
|
-
n: runs.length,
|
|
192
|
-
execution,
|
|
193
|
-
composite,
|
|
194
|
-
perDimension,
|
|
195
|
-
costQuality,
|
|
196
|
-
judges,
|
|
197
|
-
interRater,
|
|
198
|
-
lift,
|
|
199
|
-
failureClusters,
|
|
200
|
-
contamination,
|
|
201
|
-
outcomeCorrelation,
|
|
202
|
-
release,
|
|
203
|
-
...failureClasses ? { failureClasses } : {},
|
|
204
|
-
...priorPeriodComparison ? { priorPeriodComparison } : {},
|
|
205
|
-
recommendations
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function computeExecutionInsight(runs, bins) {
|
|
209
|
-
const aggregateRows = runs.flatMap((run) => {
|
|
210
|
-
const usage = aggregateTokenUsage(run);
|
|
211
|
-
return usage ? [{ usage, costUsd: finiteRaw(run, "aggregate_cost_usd") }] : [];
|
|
212
|
-
});
|
|
213
|
-
const aggregateCosts = aggregateRows.flatMap(
|
|
214
|
-
(row) => row.costUsd !== void 0 ? [row.costUsd] : []
|
|
215
|
-
);
|
|
216
|
-
const modelCounts = /* @__PURE__ */ new Map();
|
|
217
|
-
let executionErrorRuns = 0;
|
|
218
|
-
let executionErrorEvents = 0;
|
|
219
|
-
let errorReportingRuns = 0;
|
|
220
|
-
let errorSpanEvents = 0;
|
|
221
|
-
let errorSpanReportingRuns = 0;
|
|
222
|
-
const terminalOutcomes = {
|
|
223
|
-
succeeded: 0,
|
|
224
|
-
failed: 0,
|
|
225
|
-
cancelled: 0,
|
|
226
|
-
incomplete: 0,
|
|
227
|
-
unknown: 0
|
|
228
|
-
};
|
|
229
|
-
const errorsByTerminalOutcome = {
|
|
230
|
-
succeeded: { withErrors: 0, withoutErrors: 0, unreported: 0 },
|
|
231
|
-
failed: { withErrors: 0, withoutErrors: 0, unreported: 0 },
|
|
232
|
-
cancelled: { withErrors: 0, withoutErrors: 0, unreported: 0 },
|
|
233
|
-
incomplete: { withErrors: 0, withoutErrors: 0, unreported: 0 },
|
|
234
|
-
unknown: { withErrors: 0, withoutErrors: 0, unreported: 0 }
|
|
235
|
-
};
|
|
236
|
-
let modelCallRuns = 0;
|
|
237
|
-
let modelCallEvents = 0;
|
|
238
|
-
let modelCallReportingRuns = 0;
|
|
239
|
-
for (const run of runs) {
|
|
240
|
-
modelCounts.set(run.model, (modelCounts.get(run.model) ?? 0) + 1);
|
|
241
|
-
const terminalOutcome = run.terminalOutcome;
|
|
242
|
-
terminalOutcomes[terminalOutcome] += 1;
|
|
243
|
-
const modelCalls = nonNegativeCountRaw(run, "llm_span_count");
|
|
244
|
-
if (modelCalls !== void 0) {
|
|
245
|
-
modelCallEvents += modelCalls;
|
|
246
|
-
modelCallReportingRuns += 1;
|
|
247
|
-
}
|
|
248
|
-
const usage = run.tokenUsage;
|
|
249
|
-
if ((modelCalls ?? 0) > 0 || usage.input > 0 || usage.output > 0 || (usage.cached ?? 0) > 0 || (usage.cacheWrite ?? 0) > 0) {
|
|
250
|
-
modelCallRuns += 1;
|
|
251
|
-
}
|
|
252
|
-
const errorEvents = reportedExecutionErrorEvents(run);
|
|
253
|
-
if (errorEvents !== void 0) {
|
|
254
|
-
executionErrorEvents += errorEvents;
|
|
255
|
-
errorReportingRuns += 1;
|
|
256
|
-
if (errorEvents > 0) {
|
|
257
|
-
executionErrorRuns += 1;
|
|
258
|
-
errorsByTerminalOutcome[terminalOutcome].withErrors += 1;
|
|
259
|
-
} else errorsByTerminalOutcome[terminalOutcome].withoutErrors += 1;
|
|
260
|
-
} else errorsByTerminalOutcome[terminalOutcome].unreported += 1;
|
|
261
|
-
const reportedErrorSpans = nonNegativeCountRaw(run, "error_span_count");
|
|
262
|
-
if (reportedErrorSpans !== void 0) {
|
|
263
|
-
errorSpanEvents += reportedErrorSpans;
|
|
264
|
-
errorSpanReportingRuns += 1;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return {
|
|
268
|
-
durationMs: distributionOf(
|
|
269
|
-
runs.map((run) => run.wallMs),
|
|
270
|
-
bins
|
|
271
|
-
),
|
|
272
|
-
queueMs: distributionOf(
|
|
273
|
-
runs.filter((run) => run.queueMs !== void 0).map((run) => run.queueMs),
|
|
274
|
-
bins
|
|
275
|
-
),
|
|
276
|
-
tokenUsage: summarizeTokenUsage(
|
|
277
|
-
runs.map((run) => run.tokenUsage),
|
|
278
|
-
bins
|
|
279
|
-
),
|
|
280
|
-
aggregateUsage: {
|
|
281
|
-
runs: aggregateRows.length,
|
|
282
|
-
tokenUsage: summarizeTokenUsage(
|
|
283
|
-
aggregateRows.map((row) => row.usage),
|
|
284
|
-
bins
|
|
285
|
-
),
|
|
286
|
-
costUsd: distributionOf(aggregateCosts, bins),
|
|
287
|
-
totalCostUsd: aggregateCosts.reduce((total, value) => total + value, 0)
|
|
288
|
-
},
|
|
289
|
-
models: [...modelCounts.entries()].map(([model, count]) => ({ model, runs: count })).sort((left, right) => right.runs - left.runs || left.model.localeCompare(right.model)),
|
|
290
|
-
modelCalls: {
|
|
291
|
-
runs: modelCallRuns,
|
|
292
|
-
events: modelCallEvents,
|
|
293
|
-
reportingRuns: modelCallReportingRuns
|
|
294
|
-
},
|
|
295
|
-
executionErrors: {
|
|
296
|
-
runs: executionErrorRuns,
|
|
297
|
-
fraction: errorReportingRuns > 0 ? executionErrorRuns / errorReportingRuns : null,
|
|
298
|
-
events: executionErrorEvents,
|
|
299
|
-
reportingRuns: errorReportingRuns,
|
|
300
|
-
errorSpanEvents,
|
|
301
|
-
errorSpanReportingRuns,
|
|
302
|
-
byTerminalOutcome: errorsByTerminalOutcome
|
|
303
|
-
},
|
|
304
|
-
terminalOutcomes
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
function reportedExecutionErrorEvents(run) {
|
|
308
|
-
const canonical = nonNegativeCountRaw(run, "execution_error_count");
|
|
309
|
-
if (canonical !== void 0) return canonical;
|
|
310
|
-
const toolErrors = nonNegativeCountRaw(run, "tool_errors");
|
|
311
|
-
return toolErrors;
|
|
312
|
-
}
|
|
313
|
-
function nonNegativeCountRaw(run, key) {
|
|
314
|
-
const value = finiteRaw(run, key);
|
|
315
|
-
return value !== void 0 && Number.isInteger(value) && value >= 0 ? value : void 0;
|
|
316
|
-
}
|
|
317
|
-
function summarizeTokenUsage(usages, bins) {
|
|
318
|
-
const reasoning = usages.flatMap(
|
|
319
|
-
(usage) => usage.reasoning !== void 0 ? [usage.reasoning] : []
|
|
320
|
-
);
|
|
321
|
-
const cached = usages.flatMap((usage) => usage.cached !== void 0 ? [usage.cached] : []);
|
|
322
|
-
const cacheWrite = usages.flatMap(
|
|
323
|
-
(usage) => usage.cacheWrite !== void 0 ? [usage.cacheWrite] : []
|
|
324
|
-
);
|
|
325
|
-
return {
|
|
326
|
-
input: distributionOf(
|
|
327
|
-
usages.map((usage) => usage.input),
|
|
328
|
-
bins
|
|
329
|
-
),
|
|
330
|
-
output: distributionOf(
|
|
331
|
-
usages.map((usage) => usage.output),
|
|
332
|
-
bins
|
|
333
|
-
),
|
|
334
|
-
reasoning: distributionOf(reasoning, bins),
|
|
335
|
-
cached: distributionOf(cached, bins),
|
|
336
|
-
cacheWrite: distributionOf(cacheWrite, bins),
|
|
337
|
-
totals: {
|
|
338
|
-
input: usages.reduce((total, usage) => total + usage.input, 0),
|
|
339
|
-
output: usages.reduce((total, usage) => total + usage.output, 0),
|
|
340
|
-
reasoning: reasoning.reduce((total, value) => total + value, 0),
|
|
341
|
-
cached: cached.reduce((total, value) => total + value, 0),
|
|
342
|
-
cacheWrite: cacheWrite.reduce((total, value) => total + value, 0)
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
function aggregateTokenUsage(run) {
|
|
347
|
-
const input = finiteRaw(run, "aggregate_prompt_tokens");
|
|
348
|
-
const output = finiteRaw(run, "aggregate_completion_tokens");
|
|
349
|
-
const reasoning = finiteRaw(run, "aggregate_reasoning_tokens");
|
|
350
|
-
const cached = finiteRaw(run, "aggregate_cached_tokens");
|
|
351
|
-
const cacheWrite = finiteRaw(run, "aggregate_cache_write_tokens");
|
|
352
|
-
if (input === void 0 && output === void 0 && reasoning === void 0 && cached === void 0 && cacheWrite === void 0)
|
|
353
|
-
return void 0;
|
|
354
|
-
return {
|
|
355
|
-
input: input ?? 0,
|
|
356
|
-
output: output ?? 0,
|
|
357
|
-
...reasoning !== void 0 ? { reasoning } : {},
|
|
358
|
-
...cached !== void 0 ? { cached } : {},
|
|
359
|
-
...cacheWrite !== void 0 ? { cacheWrite } : {}
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
function finiteRaw(run, key) {
|
|
363
|
-
const value = run.outcome.raw[key];
|
|
364
|
-
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
365
|
-
}
|
|
366
|
-
function summarizeCostProvenance(runs) {
|
|
367
|
-
const summary = {
|
|
368
|
-
observed: { n: 0, totalUsd: 0 },
|
|
369
|
-
estimated: { n: 0, totalUsd: 0 },
|
|
370
|
-
uncaptured: { n: 0 },
|
|
371
|
-
knownFraction: 0
|
|
372
|
-
};
|
|
373
|
-
for (const run of runs) {
|
|
374
|
-
const cost = run.costProvenance;
|
|
375
|
-
if (cost.kind === "uncaptured") {
|
|
376
|
-
summary.uncaptured.n += 1;
|
|
377
|
-
} else {
|
|
378
|
-
summary[cost.kind].n += 1;
|
|
379
|
-
summary[cost.kind].totalUsd += cost.usd;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
const known = summary.observed.n + summary.estimated.n;
|
|
383
|
-
summary.knownFraction = runs.length > 0 ? known / runs.length : 0;
|
|
384
|
-
return summary;
|
|
385
|
-
}
|
|
386
|
-
function diagnoseCostCoverage(runs, provenance) {
|
|
387
|
-
const uncaptured = provenance.uncaptured.n;
|
|
388
|
-
const known = provenance.observed.n + provenance.estimated.n;
|
|
389
|
-
if (uncaptured === runs.length) {
|
|
390
|
-
return `USD cost uncaptured for all ${runs.length} runs \u2014 no observed or estimated USD values; token and wall-time metrics remain available.`;
|
|
391
|
-
}
|
|
392
|
-
return `USD cost uncaptured for ${uncaptured}/${runs.length} runs; excluded those rows from cost statistics (${known}/${runs.length} retained: ${provenance.observed.n} observed, ${provenance.estimated.n} estimated).`;
|
|
393
|
-
}
|
|
394
|
-
function computeFailureClasses(runs, split) {
|
|
395
|
-
const counts = /* @__PURE__ */ new Map();
|
|
396
|
-
for (const r of runs) {
|
|
397
|
-
if (!isTaskFailure(r, split)) continue;
|
|
398
|
-
const key = r.failureClass !== void 0 && r.failureClass !== "success" ? r.failureClass : "unknown";
|
|
399
|
-
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
400
|
-
}
|
|
401
|
-
if (counts.size === 0) return void 0;
|
|
402
|
-
const n = runs.length;
|
|
403
|
-
return [...counts.entries()].map(([failureClass, count]) => ({
|
|
404
|
-
failureClass,
|
|
405
|
-
count,
|
|
406
|
-
share: n > 0 ? count / n : 0
|
|
407
|
-
})).sort((a, b) => b.count - a.count || a.failureClass.localeCompare(b.failureClass));
|
|
408
|
-
}
|
|
409
|
-
function computePriorPeriodComparison(current, baseline, split, windowLabel) {
|
|
410
|
-
if (current.length === 0 || baseline.length === 0) return void 0;
|
|
411
|
-
const metrics = {};
|
|
412
|
-
const directions = {};
|
|
413
|
-
const compositeCurrent = current.map((r) => compositeOf(r, split)).filter(Number.isFinite);
|
|
414
|
-
const compositeBaseline = baseline.map((r) => compositeOf(r, split)).filter(Number.isFinite);
|
|
415
|
-
if (compositeCurrent.length > 0 && compositeBaseline.length > 0) {
|
|
416
|
-
metrics.composite = welchCompare(compositeBaseline, compositeCurrent);
|
|
417
|
-
directions.composite = "higher-is-better";
|
|
418
|
-
}
|
|
419
|
-
const costCurrent = knownCostValues(current);
|
|
420
|
-
const costBaseline = knownCostValues(baseline);
|
|
421
|
-
if (costCurrent.length > 0 && costBaseline.length > 0) {
|
|
422
|
-
metrics.cost = welchCompare(costBaseline, costCurrent);
|
|
423
|
-
directions.cost = "lower-is-better";
|
|
424
|
-
}
|
|
425
|
-
const durCurrent = current.map((r) => r.wallMs).filter(Number.isFinite);
|
|
426
|
-
const durBaseline = baseline.map((r) => r.wallMs).filter(Number.isFinite);
|
|
427
|
-
if (durCurrent.length > 0 && durBaseline.length > 0) {
|
|
428
|
-
metrics.duration = welchCompare(durBaseline, durCurrent);
|
|
429
|
-
directions.duration = "lower-is-better";
|
|
430
|
-
}
|
|
431
|
-
const tokCurrent = current.map((r) => (r.tokenUsage.input ?? 0) + (r.tokenUsage.output ?? 0)).filter(Number.isFinite);
|
|
432
|
-
const tokBaseline = baseline.map((r) => (r.tokenUsage.input ?? 0) + (r.tokenUsage.output ?? 0)).filter(Number.isFinite);
|
|
433
|
-
if (tokCurrent.length > 0 && tokBaseline.length > 0) {
|
|
434
|
-
metrics.tokenUsage = welchCompare(tokBaseline, tokCurrent);
|
|
435
|
-
directions.tokenUsage = "lower-is-better";
|
|
436
|
-
}
|
|
437
|
-
const dimsCurrent = collectPerDimension(current);
|
|
438
|
-
const dimsBaseline = collectPerDimension(baseline);
|
|
439
|
-
for (const dim of Object.keys(dimsCurrent)) {
|
|
440
|
-
const b = dimsBaseline[dim];
|
|
441
|
-
const c = dimsCurrent[dim];
|
|
442
|
-
if (!b || b.length === 0 || !c || c.length === 0) continue;
|
|
443
|
-
metrics[`dim.${dim}`] = welchCompare(b, c);
|
|
444
|
-
directions[`dim.${dim}`] = "higher-is-better";
|
|
445
|
-
}
|
|
446
|
-
const regressedMetrics = [];
|
|
447
|
-
const improvedMetrics = [];
|
|
448
|
-
for (const [name, delta] of Object.entries(metrics)) {
|
|
449
|
-
if (!delta.significant) continue;
|
|
450
|
-
const dir = directions[name] ?? "higher-is-better";
|
|
451
|
-
const better = dir === "higher-is-better" ? delta.delta > 0 : delta.delta < 0;
|
|
452
|
-
if (better) improvedMetrics.push(name);
|
|
453
|
-
else regressedMetrics.push(name);
|
|
454
|
-
}
|
|
455
|
-
return {
|
|
456
|
-
baselineN: baseline.length,
|
|
457
|
-
currentN: current.length,
|
|
458
|
-
...windowLabel ? { windowLabel } : {},
|
|
459
|
-
metrics,
|
|
460
|
-
regressedMetrics,
|
|
461
|
-
improvedMetrics
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
function knownCostValues(runs) {
|
|
465
|
-
return runs.filter((run) => run.costProvenance.kind !== "uncaptured").map((run) => run.costUsd).filter(isFiniteNumber);
|
|
466
|
-
}
|
|
467
|
-
function isFiniteNumber(value) {
|
|
468
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
469
|
-
}
|
|
470
|
-
function collectPerDimension(runs) {
|
|
471
|
-
const out = {};
|
|
472
|
-
for (const r of runs) {
|
|
473
|
-
const perDim = r.outcome.judgeScores?.perDimMean;
|
|
474
|
-
if (!perDim) continue;
|
|
475
|
-
for (const [dim, value] of Object.entries(perDim)) {
|
|
476
|
-
if (!Number.isFinite(value)) continue;
|
|
477
|
-
if (!out[dim]) out[dim] = [];
|
|
478
|
-
out[dim].push(value);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
return out;
|
|
482
|
-
}
|
|
483
|
-
function welchCompare(baseline, current) {
|
|
484
|
-
const baselineMean = mean(baseline);
|
|
485
|
-
const currentMean = mean(current);
|
|
486
|
-
const baselineVar = sampleVariance(baseline, baselineMean);
|
|
487
|
-
const currentVar = sampleVariance(current, currentMean);
|
|
488
|
-
const baselineN = baseline.length;
|
|
489
|
-
const currentN = current.length;
|
|
490
|
-
const delta = currentMean - baselineMean;
|
|
491
|
-
const se = Math.sqrt(baselineVar / baselineN + currentVar / currentN);
|
|
492
|
-
const halfWidth = 1.96 * (se > 0 ? se : 0);
|
|
493
|
-
const ci95 = [delta - halfWidth, delta + halfWidth];
|
|
494
|
-
const t = se > 0 ? delta / se : 0;
|
|
495
|
-
const pValue = se > 0 ? 2 * (1 - standardNormalCdf(Math.abs(t))) : 1;
|
|
496
|
-
const pooledStddev = Math.sqrt(
|
|
497
|
-
((baselineN - 1) * baselineVar + (currentN - 1) * currentVar) / Math.max(1, baselineN + currentN - 2)
|
|
498
|
-
);
|
|
499
|
-
const cohensD = pooledStddev > 0 ? delta / pooledStddev : 0;
|
|
500
|
-
const significant = pValue < 0.05 && Math.abs(cohensD) >= 0.2;
|
|
501
|
-
return {
|
|
502
|
-
current: currentMean,
|
|
503
|
-
baseline: baselineMean,
|
|
504
|
-
delta,
|
|
505
|
-
ci95,
|
|
506
|
-
pValue,
|
|
507
|
-
cohensD,
|
|
508
|
-
baselineN,
|
|
509
|
-
currentN,
|
|
510
|
-
significant
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
function sampleVariance(xs, xsMean) {
|
|
514
|
-
if (xs.length < 2) return 0;
|
|
515
|
-
let s = 0;
|
|
516
|
-
for (const x of xs) s += (x - xsMean) ** 2;
|
|
517
|
-
return s / (xs.length - 1);
|
|
518
|
-
}
|
|
519
|
-
function standardNormalCdf(z) {
|
|
520
|
-
const a1 = 0.254829592;
|
|
521
|
-
const a2 = -0.284496736;
|
|
522
|
-
const a3 = 1.421413741;
|
|
523
|
-
const a4 = -1.453152027;
|
|
524
|
-
const a5 = 1.061405429;
|
|
525
|
-
const p = 0.3275911;
|
|
526
|
-
const sign = z < 0 ? -1 : 1;
|
|
527
|
-
const x = Math.abs(z) / Math.SQRT2;
|
|
528
|
-
const t = 1 / (1 + p * x);
|
|
529
|
-
const y = 1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);
|
|
530
|
-
return 0.5 * (1 + sign * y);
|
|
531
|
-
}
|
|
532
|
-
function resolveSplit(runs, pref) {
|
|
533
|
-
if (pref !== "auto") return pref;
|
|
534
|
-
const hasHoldout = runs.some((r) => Number.isFinite(r.outcome.holdoutScore));
|
|
535
|
-
return hasHoldout ? "holdout" : "search";
|
|
536
|
-
}
|
|
537
|
-
function compositeOf(run, split) {
|
|
538
|
-
const score = split === "holdout" ? run.outcome.holdoutScore : run.outcome.searchScore;
|
|
539
|
-
return Number.isFinite(score) ? score : Number.NaN;
|
|
540
|
-
}
|
|
541
|
-
function distributionOf(values, bins, withIds) {
|
|
542
|
-
if (values.length === 0) {
|
|
543
|
-
return {
|
|
544
|
-
n: 0,
|
|
545
|
-
mean: null,
|
|
546
|
-
p50: null,
|
|
547
|
-
p95: null,
|
|
548
|
-
stddev: null,
|
|
549
|
-
min: null,
|
|
550
|
-
max: null,
|
|
551
|
-
histogram: []
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
const sorted = [...values].sort((a, b) => a - b);
|
|
555
|
-
const n = sorted.length;
|
|
556
|
-
const mean2 = sorted.reduce((s, v) => s + v, 0) / n;
|
|
557
|
-
const variance = sorted.reduce((s, v) => s + (v - mean2) ** 2, 0) / n;
|
|
558
|
-
const stddev = Math.sqrt(variance);
|
|
559
|
-
const tailRuns = withIds ? [...withIds].sort((a, b) => a.score - b.score).slice(0, Math.min(5, withIds.length)) : void 0;
|
|
560
|
-
return {
|
|
561
|
-
n,
|
|
562
|
-
mean: mean2,
|
|
563
|
-
p50: percentile(sorted, 0.5),
|
|
564
|
-
p95: percentile(sorted, 0.95),
|
|
565
|
-
stddev,
|
|
566
|
-
min: sorted[0],
|
|
567
|
-
max: sorted[n - 1],
|
|
568
|
-
histogram: histogram(sorted, bins),
|
|
569
|
-
...tailRuns ? { tailRuns } : {}
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
function percentile(sorted, q) {
|
|
573
|
-
if (sorted.length === 0) return 0;
|
|
574
|
-
if (sorted.length === 1) return sorted[0];
|
|
575
|
-
const idx = (sorted.length - 1) * q;
|
|
576
|
-
const lo = Math.floor(idx);
|
|
577
|
-
const hi = Math.ceil(idx);
|
|
578
|
-
if (lo === hi) return sorted[lo];
|
|
579
|
-
const w = idx - lo;
|
|
580
|
-
return sorted[lo] * (1 - w) + sorted[hi] * w;
|
|
581
|
-
}
|
|
582
|
-
function histogram(sorted, bins) {
|
|
583
|
-
if (sorted.length === 0 || bins < 1) return [];
|
|
584
|
-
const min = sorted[0];
|
|
585
|
-
const max = sorted[sorted.length - 1];
|
|
586
|
-
if (min === max) return [{ lo: min, hi: max, count: sorted.length }];
|
|
587
|
-
const width = (max - min) / bins;
|
|
588
|
-
const out = [];
|
|
589
|
-
for (let i = 0; i < bins; i++) {
|
|
590
|
-
const lo = min + i * width;
|
|
591
|
-
const hi = i === bins - 1 ? max : lo + width;
|
|
592
|
-
out.push({ lo, hi, count: 0 });
|
|
593
|
-
}
|
|
594
|
-
for (const v of sorted) {
|
|
595
|
-
const idx = Math.min(bins - 1, Math.floor((v - min) / width));
|
|
596
|
-
out[idx].count++;
|
|
597
|
-
}
|
|
598
|
-
return out;
|
|
599
|
-
}
|
|
600
|
-
function computePerDimension(runs, bins) {
|
|
601
|
-
const byDim = /* @__PURE__ */ new Map();
|
|
602
|
-
for (const run of runs) {
|
|
603
|
-
const scores = run.outcome.judgeScores;
|
|
604
|
-
if (!scores) continue;
|
|
605
|
-
for (const [dim, value] of Object.entries(scores.perDimMean ?? {})) {
|
|
606
|
-
if (!Number.isFinite(value)) continue;
|
|
607
|
-
const arr = byDim.get(dim) ?? [];
|
|
608
|
-
arr.push(value);
|
|
609
|
-
byDim.set(dim, arr);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
const out = {};
|
|
613
|
-
for (const [dim, values] of byDim) out[dim] = distributionOf(values, bins);
|
|
614
|
-
return out;
|
|
615
|
-
}
|
|
616
|
-
function computeJudgeInsights(runs) {
|
|
617
|
-
const out = {};
|
|
618
|
-
const byJudge = /* @__PURE__ */ new Map();
|
|
619
|
-
for (const run of runs) {
|
|
620
|
-
const scores = run.outcome.judgeScores;
|
|
621
|
-
if (!scores?.perJudge) continue;
|
|
622
|
-
for (const [judgeId, dims] of Object.entries(scores.perJudge)) {
|
|
623
|
-
const dimValues = Object.values(dims).filter(Number.isFinite);
|
|
624
|
-
if (dimValues.length === 0) continue;
|
|
625
|
-
const judgeMean = dimValues.reduce((s, v) => s + v, 0) / dimValues.length;
|
|
626
|
-
const arr = byJudge.get(judgeId) ?? [];
|
|
627
|
-
arr.push(judgeMean);
|
|
628
|
-
byJudge.set(judgeId, arr);
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
for (const [judgeId, values] of byJudge) {
|
|
632
|
-
out[judgeId] = {
|
|
633
|
-
n: values.length,
|
|
634
|
-
meanScore: values.reduce((s, v) => s + v, 0) / values.length
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
return out;
|
|
638
|
-
}
|
|
639
|
-
function computeInterRater(ratings) {
|
|
640
|
-
const byRun = /* @__PURE__ */ new Map();
|
|
641
|
-
for (const r of ratings) {
|
|
642
|
-
if (!Number.isFinite(r.score)) continue;
|
|
643
|
-
const list = byRun.get(r.runId) ?? [];
|
|
644
|
-
list.push({ rater: r.rater, score: r.score });
|
|
645
|
-
byRun.set(r.runId, list);
|
|
646
|
-
}
|
|
647
|
-
const raters = new Set(ratings.map((r) => r.rater));
|
|
648
|
-
const jointlyRated = [];
|
|
649
|
-
for (const [runId, ratersForRun] of byRun) {
|
|
650
|
-
const seen = new Set(ratersForRun.map((r) => r.rater));
|
|
651
|
-
let all = true;
|
|
652
|
-
for (const r of raters) if (!seen.has(r)) all = false;
|
|
653
|
-
if (all) jointlyRated.push(runId);
|
|
654
|
-
}
|
|
655
|
-
if (raters.size < 2 || jointlyRated.length === 0) return void 0;
|
|
656
|
-
const raterList = [...raters].sort();
|
|
657
|
-
const perPair = {};
|
|
658
|
-
for (let i = 0; i < raterList.length; i++) {
|
|
659
|
-
for (let j = i + 1; j < raterList.length; j++) {
|
|
660
|
-
const a = raterList[i];
|
|
661
|
-
const b = raterList[j];
|
|
662
|
-
const aScores = [];
|
|
663
|
-
const bScores = [];
|
|
664
|
-
for (const runId of jointlyRated) {
|
|
665
|
-
const ratersForRun = byRun.get(runId);
|
|
666
|
-
const sa = ratersForRun.find((r) => r.rater === a)?.score;
|
|
667
|
-
const sb = ratersForRun.find((r) => r.rater === b)?.score;
|
|
668
|
-
if (sa !== void 0 && sb !== void 0) {
|
|
669
|
-
aScores.push(sa);
|
|
670
|
-
bScores.push(sb);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
const agreement2 = continuousAgreement(
|
|
674
|
-
aScores.map((score, index) => [score, bScores[index]]),
|
|
675
|
-
{ bootstrap: 0 }
|
|
676
|
-
);
|
|
677
|
-
perPair[`${a}::${b}`] = agreement2.weightedKappa;
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
const matrix = jointlyRated.map((runId) => {
|
|
681
|
-
const ratingsByRater = new Map(byRun.get(runId).map((rating) => [rating.rater, rating.score]));
|
|
682
|
-
return raterList.map((rater) => ratingsByRater.get(rater));
|
|
683
|
-
});
|
|
684
|
-
const agreement = continuousAgreement(matrix, { bootstrap: 0 });
|
|
685
|
-
const disagreementCases = jointlyRated.map((runId) => {
|
|
686
|
-
const ratersForRun = byRun.get(runId);
|
|
687
|
-
const scores = ratersForRun.map((r) => r.score);
|
|
688
|
-
const range = Math.max(...scores) - Math.min(...scores);
|
|
689
|
-
return { runId, ratings: ratersForRun, range };
|
|
690
|
-
}).sort((a, b) => b.range - a.range).slice(0, 20);
|
|
691
|
-
return {
|
|
692
|
-
raters: raters.size,
|
|
693
|
-
jointlyRated: jointlyRated.length,
|
|
694
|
-
kappa: Number.isFinite(agreement.weightedKappa) ? agreement.weightedKappa : 0,
|
|
695
|
-
icc: agreement.icc,
|
|
696
|
-
pearson: agreement.pearson,
|
|
697
|
-
spearman: agreement.spearman,
|
|
698
|
-
perPair,
|
|
699
|
-
disagreementCases
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
function computeLift(runs, baselineId, candidateId, split) {
|
|
703
|
-
let bId = baselineId;
|
|
704
|
-
let cId = candidateId;
|
|
705
|
-
if (!bId || !cId) {
|
|
706
|
-
const ids = [...new Set(runs.map((r) => r.candidateId))];
|
|
707
|
-
if (ids.length !== 2) return void 0;
|
|
708
|
-
const [idA, idB] = ids;
|
|
709
|
-
const scoresA = finiteCompositeScores(
|
|
710
|
-
runs.filter((run) => run.candidateId === idA),
|
|
711
|
-
split
|
|
712
|
-
);
|
|
713
|
-
const scoresB = finiteCompositeScores(
|
|
714
|
-
runs.filter((run) => run.candidateId === idB),
|
|
715
|
-
split
|
|
716
|
-
);
|
|
717
|
-
if (scoresA.length === 0 || scoresB.length === 0) return void 0;
|
|
718
|
-
const meanA = mean(scoresA);
|
|
719
|
-
const meanB = mean(scoresB);
|
|
720
|
-
bId = meanA <= meanB ? idA : idB;
|
|
721
|
-
cId = meanA <= meanB ? idB : idA;
|
|
722
|
-
}
|
|
723
|
-
const baseline = runs.filter((r) => r.candidateId === bId);
|
|
724
|
-
const candidate = runs.filter((r) => r.candidateId === cId);
|
|
725
|
-
if (baseline.length === 0 || candidate.length === 0) return void 0;
|
|
726
|
-
const scoredBaseline = baseline.filter((run) => Number.isFinite(compositeOf(run, split)));
|
|
727
|
-
const scoredCandidate = candidate.filter((run) => Number.isFinite(compositeOf(run, split)));
|
|
728
|
-
const pairing = pairRunRecords(scoredBaseline, scoredCandidate);
|
|
729
|
-
const pairedBaseline = pairing.pairs.map((pair) => compositeOf(pair.baseline, split));
|
|
730
|
-
const pairedCandidate = pairing.pairs.map((pair) => compositeOf(pair.treatment, split));
|
|
731
|
-
if (pairedBaseline.length === 0) return void 0;
|
|
732
|
-
const baselineMean = mean(pairedBaseline);
|
|
733
|
-
const candidateMean = mean(pairedCandidate);
|
|
734
|
-
const delta = candidateMean - baselineMean;
|
|
735
|
-
const bootstrap = pairedBootstrap(pairedBaseline, pairedCandidate, {
|
|
736
|
-
confidence: 0.95,
|
|
737
|
-
resamples: 2e3,
|
|
738
|
-
statistic: "mean"
|
|
739
|
-
});
|
|
740
|
-
const tTest = pairedTTest(pairedBaseline, pairedCandidate);
|
|
741
|
-
const d = pairedCohensDz(pairedBaseline, pairedCandidate);
|
|
742
|
-
const mde = pairedMde({ nPaired: pairedBaseline.length, power: 0.8, alpha: 0.05 });
|
|
743
|
-
const requiredN = d === null || d === 0 ? null : requiredPairedSampleSize({
|
|
744
|
-
effect: Math.abs(d),
|
|
745
|
-
power: 0.8,
|
|
746
|
-
alpha: 0.05
|
|
747
|
-
});
|
|
748
|
-
return {
|
|
749
|
-
baselineMean,
|
|
750
|
-
candidateMean,
|
|
751
|
-
delta,
|
|
752
|
-
ci95: [bootstrap.low, bootstrap.high],
|
|
753
|
-
pValue: tTest.p,
|
|
754
|
-
n: pairedBaseline.length,
|
|
755
|
-
unpairedBaseline: pairing.unpairedBaseline.length,
|
|
756
|
-
unpairedCandidate: pairing.unpairedTreatment.length,
|
|
757
|
-
cohensD: d,
|
|
758
|
-
mde,
|
|
759
|
-
requiredN
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
function mean(arr) {
|
|
763
|
-
return arr.length === 0 ? 0 : arr.reduce((s, v) => s + v, 0) / arr.length;
|
|
764
|
-
}
|
|
765
|
-
async function computeFailureClusters(runs, analyst, split) {
|
|
766
|
-
const failed = runs.filter((run) => isTaskFailure(run, split));
|
|
767
|
-
if (failed.length === 0) return { clusters: [], totalFailures: 0 };
|
|
768
|
-
const clusters = /* @__PURE__ */ new Map();
|
|
769
|
-
for (const run of failed) {
|
|
770
|
-
try {
|
|
771
|
-
const result = await analyst.run(run.runId, { runRecord: run });
|
|
772
|
-
for (const finding of result.findings) {
|
|
773
|
-
const key = finding.area || finding.analyst_id || "unclassified";
|
|
774
|
-
const c = clusters.get(key) ?? { exemplars: [], share: 0 };
|
|
775
|
-
if (c.exemplars.length < 5) c.exemplars.push(run.runId);
|
|
776
|
-
clusters.set(key, c);
|
|
777
|
-
}
|
|
778
|
-
} catch {
|
|
779
|
-
const c = clusters.get("analyst-error") ?? { exemplars: [], share: 0 };
|
|
780
|
-
if (c.exemplars.length < 5) c.exemplars.push(run.runId);
|
|
781
|
-
clusters.set("analyst-error", c);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
const clusterList = [...clusters.entries()].map(([id, c]) => ({
|
|
785
|
-
id,
|
|
786
|
-
name: id,
|
|
787
|
-
share: c.exemplars.length / failed.length,
|
|
788
|
-
exemplars: c.exemplars
|
|
789
|
-
}));
|
|
790
|
-
clusterList.sort((a, b) => b.share - a.share);
|
|
791
|
-
return { clusters: clusterList, totalFailures: failed.length };
|
|
792
|
-
}
|
|
793
|
-
function finiteCompositeScores(runs, split) {
|
|
794
|
-
return runs.map((run) => compositeOf(run, split)).filter(Number.isFinite);
|
|
795
|
-
}
|
|
796
|
-
function isTaskFailure(run, split) {
|
|
797
|
-
if (run.failureClass !== void 0 && run.failureClass !== "success") return true;
|
|
798
|
-
const score = compositeOf(run, split);
|
|
799
|
-
return Number.isFinite(score) && score < 0.5;
|
|
800
|
-
}
|
|
801
|
-
function computeContamination(runs, canaries) {
|
|
802
|
-
let leaks = 0;
|
|
803
|
-
const details = [];
|
|
804
|
-
for (const run of runs) {
|
|
805
|
-
const output = stringifyOutput(run);
|
|
806
|
-
if (!output) continue;
|
|
807
|
-
const leaksHere = checkCanaries(output, canaries);
|
|
808
|
-
for (const leak of leaksHere) {
|
|
809
|
-
leaks++;
|
|
810
|
-
details.push({ runId: run.runId, canary: leak.canary, matched: leak.evidence });
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
return { leaks, holdoutAuditPassed: leaks === 0, details };
|
|
814
|
-
}
|
|
815
|
-
function stringifyOutput(run) {
|
|
816
|
-
const metadata = run.metadata;
|
|
817
|
-
if (typeof metadata?.output === "string") return metadata.output;
|
|
818
|
-
if (typeof metadata?.text === "string") return metadata.text;
|
|
819
|
-
return void 0;
|
|
820
|
-
}
|
|
821
|
-
function computeOutcomeCorrelation(runs, outcome, split) {
|
|
822
|
-
const xs = [];
|
|
823
|
-
const ys = [];
|
|
824
|
-
for (const run of runs) {
|
|
825
|
-
const y = outcome.valueByRunId[run.runId];
|
|
826
|
-
if (y === void 0 || !Number.isFinite(y)) continue;
|
|
827
|
-
const x = compositeOf(run, split);
|
|
828
|
-
if (!Number.isFinite(x)) continue;
|
|
829
|
-
xs.push(x);
|
|
830
|
-
ys.push(y);
|
|
831
|
-
}
|
|
832
|
-
if (xs.length < 3) return void 0;
|
|
833
|
-
const p = pearsonR(xs, ys);
|
|
834
|
-
const s = spearmanR(xs, ys);
|
|
835
|
-
const meanX = mean(xs);
|
|
836
|
-
const meanY = mean(ys);
|
|
837
|
-
let num = 0;
|
|
838
|
-
let denom = 0;
|
|
839
|
-
for (let i = 0; i < xs.length; i++) {
|
|
840
|
-
num += (xs[i] - meanX) * (ys[i] - meanY);
|
|
841
|
-
denom += (xs[i] - meanX) ** 2;
|
|
842
|
-
}
|
|
843
|
-
const slope = denom === 0 ? 0 : num / denom;
|
|
844
|
-
const intercept = meanY - slope * meanX;
|
|
845
|
-
const ssTot = ys.reduce((a, y) => a + (y - meanY) ** 2, 0);
|
|
846
|
-
const ssRes = ys.reduce((a, y, i) => a + (y - (intercept + slope * xs[i])) ** 2, 0);
|
|
847
|
-
const r2 = ssTot === 0 ? 0 : 1 - ssRes / ssTot;
|
|
848
|
-
return {
|
|
849
|
-
metric: outcome.metric,
|
|
850
|
-
n: xs.length,
|
|
851
|
-
pearson: p,
|
|
852
|
-
spearman: s,
|
|
853
|
-
rewardModel: { intercept, slope, r2 }
|
|
854
|
-
};
|
|
855
|
-
}
|
|
856
|
-
function buildReleaseScorecard(composite, lift, contamination) {
|
|
857
|
-
const axes = [];
|
|
858
|
-
const liftPass = lift === void 0 ? "not_evaluated" : lift.ci95[0] > 0 ? "pass" : lift.delta > 0 ? "warn" : "fail";
|
|
859
|
-
axes.push({
|
|
860
|
-
name: "quality-lift",
|
|
861
|
-
status: liftPass,
|
|
862
|
-
detail: lift ? `delta=${lift.delta.toFixed(3)}, CI95=[${lift.ci95[0].toFixed(3)}, ${lift.ci95[1].toFixed(3)}], n=${lift.n}` : "no baseline/candidate pair available"
|
|
863
|
-
});
|
|
864
|
-
const contamPass = contamination === void 0 ? "not_evaluated" : contamination.leaks === 0 ? "pass" : "fail";
|
|
865
|
-
axes.push({
|
|
866
|
-
name: "contamination",
|
|
867
|
-
status: contamPass,
|
|
868
|
-
detail: contamination ? `${contamination.leaks} canary leak(s)` : "no canaries supplied"
|
|
869
|
-
});
|
|
870
|
-
axes.push(
|
|
871
|
-
composite.n === 0 ? {
|
|
872
|
-
name: "composite-distribution",
|
|
873
|
-
status: "not_evaluated",
|
|
874
|
-
detail: "no task-quality scores available"
|
|
875
|
-
} : {
|
|
876
|
-
name: "composite-distribution",
|
|
877
|
-
status: composite.mean !== null && composite.mean >= 0.5 ? "pass" : composite.mean !== null && composite.mean >= 0.3 ? "warn" : "fail",
|
|
878
|
-
detail: composite.mean === null || composite.p50 === null || composite.p95 === null ? "task-quality distribution is internally incomplete" : `mean=${composite.mean.toFixed(3)}, p50=${composite.p50.toFixed(3)}, p95=${composite.p95.toFixed(3)} over n=${composite.n}`
|
|
879
|
-
}
|
|
880
|
-
);
|
|
881
|
-
const status = axes.some((a) => a.status === "fail") ? "fail" : axes.some((a) => a.status === "warn" || a.status === "not_evaluated") ? "warn" : "pass";
|
|
882
|
-
return {
|
|
883
|
-
status,
|
|
884
|
-
axes,
|
|
885
|
-
issues: []
|
|
886
|
-
};
|
|
887
|
-
}
|
|
888
|
-
function buildRecommendations(ctx) {
|
|
889
|
-
const out = [];
|
|
890
|
-
if (ctx.priorPeriodComparison) {
|
|
891
|
-
const ppc = ctx.priorPeriodComparison;
|
|
892
|
-
const label = ppc.windowLabel ?? "baseline period";
|
|
893
|
-
for (const name of ppc.regressedMetrics) {
|
|
894
|
-
const d = ppc.metrics[name];
|
|
895
|
-
if (!d) continue;
|
|
896
|
-
out.push({
|
|
897
|
-
priority: "critical",
|
|
898
|
-
kind: "investigate",
|
|
899
|
-
title: `${name} regressed from ${d.baseline.toFixed(3)} \u2192 ${d.current.toFixed(3)} vs ${label}`,
|
|
900
|
-
detail: `Welch CI95 = [${d.ci95[0].toFixed(3)}, ${d.ci95[1].toFixed(3)}], p=${d.pValue.toFixed(4)}, Cohen's d=${d.cohensD.toFixed(2)} (n_current=${d.currentN}, n_baseline=${d.baselineN}). The regression is statistically significant at p<0.05 with at-least-small effect size.`,
|
|
901
|
-
evidencePath: `priorPeriodComparison.metrics.${name}`
|
|
902
|
-
});
|
|
903
|
-
}
|
|
904
|
-
for (const name of ppc.improvedMetrics) {
|
|
905
|
-
const d = ppc.metrics[name];
|
|
906
|
-
if (!d) continue;
|
|
907
|
-
out.push({
|
|
908
|
-
priority: "low",
|
|
909
|
-
kind: "ship",
|
|
910
|
-
title: `${name} improved from ${d.baseline.toFixed(3)} \u2192 ${d.current.toFixed(3)} vs ${label}`,
|
|
911
|
-
detail: `Welch CI95 = [${d.ci95[0].toFixed(3)}, ${d.ci95[1].toFixed(3)}], p=${d.pValue.toFixed(4)}, Cohen's d=${d.cohensD.toFixed(2)} (n_current=${d.currentN}, n_baseline=${d.baselineN}). Statistically significant improvement worth flagging.`,
|
|
912
|
-
evidencePath: `priorPeriodComparison.metrics.${name}`
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
if (ctx.composite.n > 0 && ctx.composite.mean !== null && ctx.composite.p50 !== null && ctx.composite.p95 !== null) {
|
|
917
|
-
if (ctx.composite.mean < 0.3) {
|
|
918
|
-
const tail = ctx.composite.tailRuns ?? [];
|
|
919
|
-
const names = tail.slice(0, 5).map((t) => `${t.runId}=${t.score.toFixed(3)}`).join(", ");
|
|
920
|
-
out.push({
|
|
921
|
-
priority: "critical",
|
|
922
|
-
kind: "investigate",
|
|
923
|
-
title: `Composite mean ${ctx.composite.mean.toFixed(3)} is below the 0.3 floor \u2014 the agent is broken on this corpus`,
|
|
924
|
-
detail: tail.length > 0 ? `Worst ${tail.length} run${tail.length === 1 ? "" : "s"} to inspect first: ${names}. Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.` : `Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.`,
|
|
925
|
-
evidencePath: "composite.tailRuns"
|
|
926
|
-
});
|
|
927
|
-
} else if (ctx.composite.mean < 0.5) {
|
|
928
|
-
const tail = ctx.composite.tailRuns ?? [];
|
|
929
|
-
const names = tail.slice(0, 3).map((t) => `${t.runId}=${t.score.toFixed(3)}`).join(", ");
|
|
930
|
-
out.push({
|
|
931
|
-
priority: "high",
|
|
932
|
-
kind: "investigate",
|
|
933
|
-
title: `Composite mean ${ctx.composite.mean.toFixed(3)} is below 0.5 \u2014 investigate the lower tail before claiming the agent is healthy`,
|
|
934
|
-
detail: tail.length > 0 ? `Worst ${tail.length} run${tail.length === 1 ? "" : "s"}: ${names}. Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.` : `Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.`,
|
|
935
|
-
evidencePath: "composite.tailRuns"
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
if (ctx.failureClasses && ctx.failureClasses.length > 0) {
|
|
940
|
-
const top = ctx.failureClasses[0];
|
|
941
|
-
if (top.count >= 3 && top.share >= 0.15) {
|
|
942
|
-
out.push({
|
|
943
|
-
priority: top.share >= 0.25 ? "high" : "medium",
|
|
944
|
-
kind: "investigate",
|
|
945
|
-
title: `'${top.failureClass}' is the dominant failure class \u2014 ${top.count} runs (${(top.share * 100).toFixed(0)}% of the corpus)`,
|
|
946
|
-
detail: `The mean composite can look acceptable while one failure class dominates the lower tail. ${top.count} of ${ctx.composite.n} runs failed with '${top.failureClass}'${ctx.failureClasses.length > 1 ? ` (next: '${ctx.failureClasses[1].failureClass}' \xD7${ctx.failureClasses[1].count})` : ""}. Fix this cause first.`,
|
|
947
|
-
evidencePath: "failureClasses"
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
if (Object.keys(ctx.judges).length === 0 && ctx.composite.n > 0) {
|
|
952
|
-
out.push({
|
|
953
|
-
priority: "medium",
|
|
954
|
-
kind: "expand-corpus",
|
|
955
|
-
title: "No judge scores recorded \u2014 per-dimension + calibration insights unavailable",
|
|
956
|
-
detail: "Records have no `outcome.judgeScores`. To unlock perDimension, judges, and calibration, attach a Judge run during your eval pass and populate `outcome.judgeScores.perJudge[judgeName][dimension] = score`. See `docs/insight-report.md` for the expected shape.",
|
|
957
|
-
evidencePath: "judges"
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
if (ctx.lift) {
|
|
961
|
-
const pairedEffect = ctx.lift.cohensD === null ? "undefined (zero delta variance)" : ctx.lift.cohensD.toFixed(2);
|
|
962
|
-
const requiredRuns = ctx.lift.requiredN === null ? "not estimable" : `~${ctx.lift.requiredN} paired runs`;
|
|
963
|
-
const decisive = ctx.lift.ci95[0] > ctx.threshold;
|
|
964
|
-
const inconclusive = ctx.lift.ci95[0] <= ctx.threshold && ctx.lift.ci95[1] > ctx.threshold;
|
|
965
|
-
if (decisive) {
|
|
966
|
-
out.push({
|
|
967
|
-
priority: "critical",
|
|
968
|
-
kind: "ship",
|
|
969
|
-
title: `Ship \u2014 lift ${ctx.lift.delta.toFixed(3)} (95% CI ${ctx.lift.ci95[0].toFixed(3)}..${ctx.lift.ci95[1].toFixed(3)})`,
|
|
970
|
-
detail: `Holdout lift exceeds threshold ${ctx.threshold} with 95% bootstrap confidence (n=${ctx.lift.n}, p=${ctx.lift.pValue.toFixed(4)}, paired d=${pairedEffect}).`,
|
|
971
|
-
evidencePath: "lift"
|
|
972
|
-
});
|
|
973
|
-
} else if (inconclusive) {
|
|
974
|
-
out.push({
|
|
975
|
-
priority: "high",
|
|
976
|
-
kind: "expand-corpus",
|
|
977
|
-
title: `Inconclusive \u2014 required sample is ${requiredRuns} (have ${ctx.lift.n}) at current effect size`,
|
|
978
|
-
detail: `CI straddles threshold. Current MDE at 80% power is ${ctx.lift.mde.toFixed(3)}; observed delta is ${ctx.lift.delta.toFixed(3)}.`,
|
|
979
|
-
evidencePath: "lift"
|
|
980
|
-
});
|
|
981
|
-
} else {
|
|
982
|
-
out.push({
|
|
983
|
-
priority: "critical",
|
|
984
|
-
kind: "hold",
|
|
985
|
-
title: `Hold \u2014 lift CI lower bound ${ctx.lift.ci95[0].toFixed(3)} is at or below threshold ${ctx.threshold}`,
|
|
986
|
-
detail: `Bootstrap CI provides no statistical evidence the candidate is better. Consider tightening the mutation or expanding the holdout.`,
|
|
987
|
-
evidencePath: "lift"
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
if (ctx.contamination && ctx.contamination.leaks > 0) {
|
|
992
|
-
out.push({
|
|
993
|
-
priority: "critical",
|
|
994
|
-
kind: "fix",
|
|
995
|
-
title: `${ctx.contamination.leaks} canary leak${ctx.contamination.leaks === 1 ? "" : "s"} detected`,
|
|
996
|
-
detail: `Holdout integrity is compromised. The lift number is unreliable until you investigate.`,
|
|
997
|
-
evidencePath: "contamination"
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
if (ctx.interRater && ctx.interRater.kappa < 0.5) {
|
|
1001
|
-
out.push({
|
|
1002
|
-
priority: "high",
|
|
1003
|
-
kind: "recalibrate",
|
|
1004
|
-
title: `Inter-rater weighted kappa ${ctx.interRater.kappa.toFixed(2)} is below 0.5`,
|
|
1005
|
-
detail: "Raters disagree on what good looks like. Review the largest disagreement cases and refine the rubric before automating these decisions.",
|
|
1006
|
-
evidencePath: "interRater"
|
|
1007
|
-
});
|
|
1008
|
-
}
|
|
1009
|
-
if (ctx.failureClusters && ctx.failureClusters.clusters.length > 0) {
|
|
1010
|
-
const top = ctx.failureClusters.clusters[0];
|
|
1011
|
-
out.push({
|
|
1012
|
-
priority: "high",
|
|
1013
|
-
kind: "investigate",
|
|
1014
|
-
title: `Top failure cluster: ${top.name} (${(top.share * 100).toFixed(0)}% of failures)`,
|
|
1015
|
-
detail: `${ctx.failureClusters.totalFailures} runs failed. The largest cluster groups ${top.exemplars.length} exemplars under '${top.name}'.`,
|
|
1016
|
-
evidencePath: "failureClusters.clusters[0]"
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
if (ctx.outcomeCorrelation && Math.abs(ctx.outcomeCorrelation.spearman) < 0.3) {
|
|
1020
|
-
out.push({
|
|
1021
|
-
priority: "medium",
|
|
1022
|
-
kind: "recalibrate",
|
|
1023
|
-
title: `Judge scores decoupled from ${ctx.outcomeCorrelation.metric} (Spearman \u03C1=${ctx.outcomeCorrelation.spearman.toFixed(2)})`,
|
|
1024
|
-
detail: `Your judges score what they were trained to score, but it isn't predicting downstream ${ctx.outcomeCorrelation.metric}. Consider retraining the judge against ${ctx.outcomeCorrelation.metric} as the gold signal.`,
|
|
1025
|
-
evidencePath: "outcomeCorrelation"
|
|
1026
|
-
});
|
|
1027
|
-
}
|
|
1028
|
-
return out;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
export {
|
|
1032
|
-
checkCanaries,
|
|
1033
|
-
checkBehavioralCanary,
|
|
1034
|
-
runBehavioralCanaries,
|
|
1035
|
-
canaryLeakView,
|
|
1036
|
-
HoldoutAuditor,
|
|
1037
|
-
summarizeExecution,
|
|
1038
|
-
analyzeRuns
|
|
1039
|
-
};
|
|
1040
|
-
//# sourceMappingURL=chunk-NACAGYSY.js.map
|