@tangle-network/agent-eval 0.129.0 → 0.130.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +2 -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-BJgDGkAD.js +754 -0
- package/dist/benchmarks-BJgDGkAD.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-aKJt6emI.js +3886 -0
- package/dist/campaign-aKJt6emI.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-CD_WZ_Xr.d.ts +2250 -0
- package/dist/index-CD_WZ_Xr.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-Em67JBjs.d.ts +335 -0
- package/dist/index-Em67JBjs.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-CUmHkGbI.js +7718 -0
- package/dist/skillopt-optimization-method-CUmHkGbI.js.map +1 -0
- package/dist/skillopt-optimization-method-CWKVTnks.d.ts +1740 -0
- package/dist/skillopt-optimization-method-CWKVTnks.d.ts.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/docs/campaign-proposers.md +1 -0
- 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
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { s as ValidationError } from "./errors-8YnH8WlF.js";
|
|
2
|
+
import { r as hashJson } from "./pre-registration-DakwTRXk.js";
|
|
3
|
+
import { n as observedScore } from "./reward-nw2xZGZG.js";
|
|
4
|
+
import { t as FAILURE_CLASSES } from "./schema-CRhEY1SO.js";
|
|
5
|
+
//#region src/agent-profile-cell.ts
|
|
6
|
+
var AgentProfileCellValidationError = class extends ValidationError {
|
|
7
|
+
path;
|
|
8
|
+
constructor(message, path = "") {
|
|
9
|
+
super(path ? `${message} (at ${path})` : message);
|
|
10
|
+
this.path = path;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
14
|
+
const CELL_ID = /^agent-profile-cell:sha256:[0-9a-f]{64}$/;
|
|
15
|
+
async function buildAgentProfileCell(input) {
|
|
16
|
+
const material = await normalizeAgentProfileCellInput(input);
|
|
17
|
+
const cellId = `agent-profile-cell:sha256:${await hashJson(material)}`;
|
|
18
|
+
return {
|
|
19
|
+
...material,
|
|
20
|
+
cellId
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function agentProfileCellHashMaterial(cell) {
|
|
24
|
+
const { cellId: _cellId, ...material } = cell;
|
|
25
|
+
return normalizeAgentProfileCell(material);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Verify an `AgentProfileCell`'s `cellId` matches the sha256 of its hash-material fields, confirming the record has not been tampered with.
|
|
29
|
+
*/
|
|
30
|
+
async function verifyAgentProfileCell(cell) {
|
|
31
|
+
validateAgentProfileCell(cell);
|
|
32
|
+
return cell.cellId === `agent-profile-cell:sha256:${await hashJson(agentProfileCellHashMaterial(cell))}`;
|
|
33
|
+
}
|
|
34
|
+
function validateAgentProfileCell(input) {
|
|
35
|
+
if (input === null || typeof input !== "object") throw new AgentProfileCellValidationError("expected object");
|
|
36
|
+
const obj = input;
|
|
37
|
+
expectLiteral(obj.schemaVersion, "agent-profile-cell/v1", "schemaVersion");
|
|
38
|
+
if (typeof obj.cellId !== "string" || !CELL_ID.test(obj.cellId)) throw new AgentProfileCellValidationError("cellId must match agent-profile-cell:sha256:<64 lowercase hex chars>", "cellId");
|
|
39
|
+
expectString$1(obj.profileId, "profileId");
|
|
40
|
+
validateSource(obj.sourceProfile, "sourceProfile");
|
|
41
|
+
if (obj.harness !== void 0) validateHarness(obj.harness, "harness");
|
|
42
|
+
if (obj.model !== void 0) expectString$1(obj.model, "model");
|
|
43
|
+
if (obj.promptHash !== void 0) expectString$1(obj.promptHash, "promptHash");
|
|
44
|
+
if (obj.dimensions !== void 0) validateDimensions(obj.dimensions, "dimensions");
|
|
45
|
+
return input;
|
|
46
|
+
}
|
|
47
|
+
function requireAgentProfileCell(record) {
|
|
48
|
+
if (!record.agentProfile) throw new AgentProfileCellValidationError(`run "${record.runId}" is missing agentProfile; profile-cell grouping requires explicit profile identity`, "agentProfile");
|
|
49
|
+
return validateAgentProfileCell(record.agentProfile);
|
|
50
|
+
}
|
|
51
|
+
function agentProfileCellKey(record) {
|
|
52
|
+
return requireAgentProfileCell(record).cellId;
|
|
53
|
+
}
|
|
54
|
+
async function assertRunAgentProfileCell(record) {
|
|
55
|
+
const profile = requireAgentProfileCell(record);
|
|
56
|
+
if (!await verifyAgentProfileCell(profile)) throw new AgentProfileCellValidationError(`run "${record.runId}" has an agentProfile.cellId that does not match its content`, "agentProfile.cellId");
|
|
57
|
+
if (profile.model !== void 0 && profile.model !== record.model) throw new AgentProfileCellValidationError(`run "${record.runId}" agentProfile.model "${profile.model}" does not match model "${record.model}"`, "agentProfile.model");
|
|
58
|
+
if (profile.promptHash !== void 0 && profile.promptHash !== record.promptHash) throw new AgentProfileCellValidationError(`run "${record.runId}" agentProfile.promptHash "${profile.promptHash}" does not match promptHash "${record.promptHash}"`, "agentProfile.promptHash");
|
|
59
|
+
return profile;
|
|
60
|
+
}
|
|
61
|
+
function groupRunsByAgentProfileCell(records) {
|
|
62
|
+
const groups = /* @__PURE__ */ new Map();
|
|
63
|
+
for (const record of records) {
|
|
64
|
+
const key = agentProfileCellKey(record);
|
|
65
|
+
const bucket = groups.get(key);
|
|
66
|
+
if (bucket) bucket.push(record);
|
|
67
|
+
else groups.set(key, [record]);
|
|
68
|
+
}
|
|
69
|
+
return groups;
|
|
70
|
+
}
|
|
71
|
+
async function normalizeAgentProfileCellInput(input) {
|
|
72
|
+
return normalizeAgentProfileCell({
|
|
73
|
+
schemaVersion: "agent-profile-cell/v1",
|
|
74
|
+
profileId: input.profileId,
|
|
75
|
+
sourceProfile: await normalizeSourceInput(input.sourceProfile),
|
|
76
|
+
harness: input.harness,
|
|
77
|
+
model: input.model,
|
|
78
|
+
promptHash: input.promptHash,
|
|
79
|
+
dimensions: input.dimensions
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function normalizeAgentProfileCell(input) {
|
|
83
|
+
return compactObject({
|
|
84
|
+
schemaVersion: "agent-profile-cell/v1",
|
|
85
|
+
profileId: requireNonEmpty(input.profileId, "profileId"),
|
|
86
|
+
sourceProfile: normalizeSource(input.sourceProfile),
|
|
87
|
+
harness: input.harness ? normalizeHarness(input.harness, "harness") : void 0,
|
|
88
|
+
model: optionalNonEmpty(input.model, "model"),
|
|
89
|
+
promptHash: optionalNonEmpty(input.promptHash, "promptHash"),
|
|
90
|
+
dimensions: input.dimensions ? nonEmptyRecord(normalizeDimensions(input.dimensions)) : void 0
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function normalizeSourceInput(input) {
|
|
94
|
+
const kind = requireNonEmpty(input.kind, "sourceProfile.kind");
|
|
95
|
+
if (input.hash !== void 0 && input.profile !== void 0) throw new AgentProfileCellValidationError("sourceProfile must provide either hash or profile, not both", "sourceProfile");
|
|
96
|
+
if (input.hash !== void 0) return {
|
|
97
|
+
kind,
|
|
98
|
+
hash: requireSha256Hex(input.hash, "sourceProfile.hash")
|
|
99
|
+
};
|
|
100
|
+
if (input.profile === void 0) throw new AgentProfileCellValidationError("sourceProfile must provide hash or profile", "sourceProfile");
|
|
101
|
+
assertJson(input.profile, "sourceProfile.profile");
|
|
102
|
+
return {
|
|
103
|
+
kind,
|
|
104
|
+
hash: await hashJson(input.profile)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function normalizeSource(input) {
|
|
108
|
+
return {
|
|
109
|
+
kind: requireNonEmpty(input.kind, "sourceProfile.kind"),
|
|
110
|
+
hash: requireSha256Hex(input.hash, "sourceProfile.hash")
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function normalizeHarness(input, path) {
|
|
114
|
+
return compactObject({
|
|
115
|
+
id: requireNonEmpty(input.id, `${path}.id`),
|
|
116
|
+
version: optionalNonEmpty(input.version, `${path}.version`),
|
|
117
|
+
hash: optionalNonEmpty(input.hash, `${path}.hash`)
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function normalizeDimensions(input) {
|
|
121
|
+
const out = {};
|
|
122
|
+
for (const key of Object.keys(input).sort()) {
|
|
123
|
+
const value = input[key];
|
|
124
|
+
requireNonEmpty(key, "dimensions.<key>");
|
|
125
|
+
if (value !== null && typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") throw new AgentProfileCellValidationError("expected primitive dimension value", `dimensions.${key}`);
|
|
126
|
+
if (typeof value === "number" && !Number.isFinite(value)) throw new AgentProfileCellValidationError("expected finite number", `dimensions.${key}`);
|
|
127
|
+
out[key] = value;
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
function compactObject(input) {
|
|
132
|
+
const out = {};
|
|
133
|
+
for (const [key, value] of Object.entries(input)) if (value !== void 0) out[key] = value;
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
function nonEmptyRecord(input) {
|
|
137
|
+
return Object.keys(input).length > 0 ? input : void 0;
|
|
138
|
+
}
|
|
139
|
+
function validateSource(value, path) {
|
|
140
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new AgentProfileCellValidationError("expected object", path);
|
|
141
|
+
const rec = value;
|
|
142
|
+
expectString$1(rec.kind, `${path}.kind`);
|
|
143
|
+
requireSha256Hex(rec.hash, `${path}.hash`);
|
|
144
|
+
}
|
|
145
|
+
function validateHarness(value, path) {
|
|
146
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new AgentProfileCellValidationError("expected object", path);
|
|
147
|
+
const rec = value;
|
|
148
|
+
expectString$1(rec.id, `${path}.id`);
|
|
149
|
+
if (rec.version !== void 0) expectString$1(rec.version, `${path}.version`);
|
|
150
|
+
if (rec.hash !== void 0) expectString$1(rec.hash, `${path}.hash`);
|
|
151
|
+
}
|
|
152
|
+
function validateDimensions(value, path) {
|
|
153
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new AgentProfileCellValidationError("expected object", path);
|
|
154
|
+
normalizeDimensions(value);
|
|
155
|
+
}
|
|
156
|
+
function assertJson(value, path) {
|
|
157
|
+
if (value === null) return;
|
|
158
|
+
const type = typeof value;
|
|
159
|
+
if (type === "string" || type === "boolean") return;
|
|
160
|
+
if (type === "number") {
|
|
161
|
+
if (!Number.isFinite(value)) throw new AgentProfileCellValidationError("expected finite number", path);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (Array.isArray(value)) {
|
|
165
|
+
value.forEach((item, index) => {
|
|
166
|
+
assertJson(item, `${path}[${index}]`);
|
|
167
|
+
});
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (type === "object") {
|
|
171
|
+
for (const [key, nested] of Object.entries(value)) {
|
|
172
|
+
requireNonEmpty(key, `${path}.<key>`);
|
|
173
|
+
assertJson(nested, `${path}.${key}`);
|
|
174
|
+
}
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
throw new AgentProfileCellValidationError("expected JSON-compatible value", path);
|
|
178
|
+
}
|
|
179
|
+
function expectLiteral(value, expected, path) {
|
|
180
|
+
if (value !== expected) throw new AgentProfileCellValidationError(`expected ${expected}`, path);
|
|
181
|
+
}
|
|
182
|
+
function expectString$1(value, path) {
|
|
183
|
+
if (typeof value !== "string" || value.length === 0) throw new AgentProfileCellValidationError("expected non-empty string", path);
|
|
184
|
+
}
|
|
185
|
+
function requireNonEmpty(value, path) {
|
|
186
|
+
if (typeof value !== "string" || value.length === 0) throw new AgentProfileCellValidationError("expected non-empty string", path);
|
|
187
|
+
return value;
|
|
188
|
+
}
|
|
189
|
+
function optionalNonEmpty(value, path) {
|
|
190
|
+
if (value === void 0) return void 0;
|
|
191
|
+
return requireNonEmpty(value, path);
|
|
192
|
+
}
|
|
193
|
+
function requireSha256Hex(value, path) {
|
|
194
|
+
if (typeof value !== "string" || !SHA256_HEX.test(value)) throw new AgentProfileCellValidationError("expected 64 lowercase sha256 hex chars", path);
|
|
195
|
+
return value;
|
|
196
|
+
}
|
|
197
|
+
/** Canonical `sourceProfile.kind` values. Two products fingerprinting the
|
|
198
|
+
* same canonical profile MUST use the same kind for their cells to share
|
|
199
|
+
* `sourceProfile.hash`. Extend rather than create new strings — adding a
|
|
200
|
+
* new kind is a deliberate cross-product schema change. */
|
|
201
|
+
const AGENT_PROFILE_KINDS = {
|
|
202
|
+
/** A profile declared via `defineAgentProfile(...)` from
|
|
203
|
+
* `@tangle-network/agent-interface`. The default kind for router-backed
|
|
204
|
+
* and sandbox-backed products. */
|
|
205
|
+
AGENT_INTERFACE_PROFILE: "agent-interface-profile" };
|
|
206
|
+
/** Canonicalize an arbitrary value into `AgentProfileJson` by JSON
|
|
207
|
+
* round-trip. Throws when the value contains anything not representable
|
|
208
|
+
* as JSON (functions, BigInt, cycles) — non-portable profiles fail loud
|
|
209
|
+
* rather than silently dropping fields. */
|
|
210
|
+
function toAgentProfileJson(value) {
|
|
211
|
+
let serialized;
|
|
212
|
+
try {
|
|
213
|
+
serialized = JSON.stringify(value);
|
|
214
|
+
} catch (err) {
|
|
215
|
+
throw new AgentProfileCellValidationError(`agent profile must be JSON-serializable: ${err instanceof Error ? err.message : String(err)}`, "sourceProfile.profile");
|
|
216
|
+
}
|
|
217
|
+
if (serialized === void 0) throw new AgentProfileCellValidationError("agent profile must be JSON-serializable (got undefined after JSON.stringify)", "sourceProfile.profile");
|
|
218
|
+
return JSON.parse(serialized);
|
|
219
|
+
}
|
|
220
|
+
/** Higher-level helper that hard-codes the canonical
|
|
221
|
+
* `agent-interface-profile` kind plus the JSON canonicalization. Equivalent
|
|
222
|
+
* to calling `buildAgentProfileCell` with `profileId = \`${name}@${version}\``
|
|
223
|
+
* and `sourceProfile = { kind: AGENT_INTERFACE_PROFILE, profile: <round-tripped> }`.
|
|
224
|
+
*
|
|
225
|
+
* Use this from any product consuming an agent-interface `AgentProfile`; the
|
|
226
|
+
* manual `buildAgentProfileCell` call is reserved for advanced cases
|
|
227
|
+
* (custom kinds, pre-computed source hashes, alternate profileId
|
|
228
|
+
* conventions). */
|
|
229
|
+
async function buildAgentInterfaceProfileCell(profile, input) {
|
|
230
|
+
if (!profile || typeof profile !== "object") throw new AgentProfileCellValidationError("AgentProfile must be an object", "profile");
|
|
231
|
+
if (typeof profile.name !== "string" || profile.name.length === 0) throw new AgentProfileCellValidationError("AgentProfile must have a non-empty `name`", "profile.name");
|
|
232
|
+
if (typeof profile.version !== "string" || profile.version.length === 0) throw new AgentProfileCellValidationError("AgentProfile must have a non-empty `version`", "profile.version");
|
|
233
|
+
return buildAgentProfileCell({
|
|
234
|
+
...input,
|
|
235
|
+
profileId: `${profile.name}@${profile.version}`,
|
|
236
|
+
sourceProfile: {
|
|
237
|
+
kind: AGENT_PROFILE_KINDS.AGENT_INTERFACE_PROFILE,
|
|
238
|
+
profile: toAgentProfileJson(profile)
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/run-record.ts
|
|
244
|
+
/**
|
|
245
|
+
* Return task quality, preferring held-out evidence when both scores exist.
|
|
246
|
+
*
|
|
247
|
+
* RAW: no realness protection is applied. Built on `observedScore` rather
|
|
248
|
+
* than repeating the split derivation, so only `rollout/reward.ts` reads the
|
|
249
|
+
* raw fields. Anything that becomes training data must use `trainingScore` or
|
|
250
|
+
* `trainingReward` instead.
|
|
251
|
+
*/
|
|
252
|
+
function runTaskScore(record) {
|
|
253
|
+
const score = observedScore(record);
|
|
254
|
+
return typeof score === "number" && Number.isFinite(score) ? score : void 0;
|
|
255
|
+
}
|
|
256
|
+
const MANDATORY_TOP_LEVEL = [
|
|
257
|
+
"runId",
|
|
258
|
+
"experimentId",
|
|
259
|
+
"candidateId",
|
|
260
|
+
"seed",
|
|
261
|
+
"model",
|
|
262
|
+
"promptHash",
|
|
263
|
+
"configHash",
|
|
264
|
+
"commitSha",
|
|
265
|
+
"wallMs",
|
|
266
|
+
"costUsd",
|
|
267
|
+
"costProvenance",
|
|
268
|
+
"tokenUsage",
|
|
269
|
+
"terminalOutcome",
|
|
270
|
+
"outcome",
|
|
271
|
+
"splitTag",
|
|
272
|
+
"scenarioId"
|
|
273
|
+
];
|
|
274
|
+
const SPLIT_TAGS = [
|
|
275
|
+
"search",
|
|
276
|
+
"dev",
|
|
277
|
+
"holdout"
|
|
278
|
+
];
|
|
279
|
+
const TERMINAL_OUTCOMES = [
|
|
280
|
+
"succeeded",
|
|
281
|
+
"failed",
|
|
282
|
+
"cancelled",
|
|
283
|
+
"incomplete",
|
|
284
|
+
"unknown"
|
|
285
|
+
];
|
|
286
|
+
var RunRecordValidationError = class extends ValidationError {
|
|
287
|
+
path;
|
|
288
|
+
constructor(message, path = "") {
|
|
289
|
+
super(path ? `${message} (at ${path})` : message);
|
|
290
|
+
this.path = path;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Strict validator. Throws `RunRecordValidationError` on the first
|
|
295
|
+
* missing or wrongly-typed field. Returns the input cast to
|
|
296
|
+
* `RunRecord` on success — the validator does not coerce.
|
|
297
|
+
*/
|
|
298
|
+
function validateRunRecord(input) {
|
|
299
|
+
if (input === null || typeof input !== "object") throw new RunRecordValidationError("expected object");
|
|
300
|
+
const obj = input;
|
|
301
|
+
for (const key of MANDATORY_TOP_LEVEL) if (!(key in obj)) throw new RunRecordValidationError(`missing mandatory field "${key}"`);
|
|
302
|
+
expectString(obj.runId, "runId");
|
|
303
|
+
expectString(obj.experimentId, "experimentId");
|
|
304
|
+
expectString(obj.candidateId, "candidateId");
|
|
305
|
+
expectFiniteNumber(obj.seed, "seed");
|
|
306
|
+
expectString(obj.model, "model");
|
|
307
|
+
expectString(obj.promptHash, "promptHash");
|
|
308
|
+
expectString(obj.configHash, "configHash");
|
|
309
|
+
expectString(obj.commitSha, "commitSha");
|
|
310
|
+
expectNonNegativeNumber(obj.wallMs, "wallMs");
|
|
311
|
+
if (obj.queueMs !== void 0) expectNonNegativeNumber(obj.queueMs, "queueMs");
|
|
312
|
+
validateCost(obj.costUsd, obj.costProvenance);
|
|
313
|
+
if (!modelHasSnapshot(obj.model)) throw new RunRecordValidationError(`model "${obj.model}" lacks a snapshot version (use 'name@YYYY-MM-DD' or 'name-YYYYMMDD')`, "model");
|
|
314
|
+
const tu = obj.tokenUsage;
|
|
315
|
+
if (tu === null || typeof tu !== "object") throw new RunRecordValidationError("tokenUsage must be an object", "tokenUsage");
|
|
316
|
+
const tuRec = tu;
|
|
317
|
+
expectNonNegativeNumber(tuRec.input, "tokenUsage.input");
|
|
318
|
+
expectNonNegativeNumber(tuRec.output, "tokenUsage.output");
|
|
319
|
+
if (tuRec.reasoning !== void 0) {
|
|
320
|
+
expectNonNegativeNumber(tuRec.reasoning, "tokenUsage.reasoning");
|
|
321
|
+
if (tuRec.reasoning > tuRec.output) throw new RunRecordValidationError("reasoning tokens must be a subset of output tokens", "tokenUsage.reasoning");
|
|
322
|
+
}
|
|
323
|
+
if (tuRec.cached !== void 0) expectNonNegativeNumber(tuRec.cached, "tokenUsage.cached");
|
|
324
|
+
if (tuRec.cacheWrite !== void 0) expectNonNegativeNumber(tuRec.cacheWrite, "tokenUsage.cacheWrite");
|
|
325
|
+
if (obj.judgeMetadata !== void 0) {
|
|
326
|
+
const jm = obj.judgeMetadata;
|
|
327
|
+
if (jm === null || typeof jm !== "object") throw new RunRecordValidationError("judgeMetadata must be an object", "judgeMetadata");
|
|
328
|
+
const jmRec = jm;
|
|
329
|
+
expectString(jmRec.model, "judgeMetadata.model");
|
|
330
|
+
expectString(jmRec.promptVersion, "judgeMetadata.promptVersion");
|
|
331
|
+
expectFiniteNumber(jmRec.confidence, "judgeMetadata.confidence");
|
|
332
|
+
if (typeof jmRec.fallback !== "boolean") throw new RunRecordValidationError("judgeMetadata.fallback must be boolean", "judgeMetadata.fallback");
|
|
333
|
+
}
|
|
334
|
+
const out = obj.outcome;
|
|
335
|
+
if (out === null || typeof out !== "object") throw new RunRecordValidationError("outcome must be an object", "outcome");
|
|
336
|
+
const outRec = out;
|
|
337
|
+
if (outRec.searchScore !== void 0) expectFiniteNumber(outRec.searchScore, "outcome.searchScore");
|
|
338
|
+
if (outRec.holdoutScore !== void 0) expectFiniteNumber(outRec.holdoutScore, "outcome.holdoutScore");
|
|
339
|
+
const raw = outRec.raw;
|
|
340
|
+
if (raw === null || typeof raw !== "object") throw new RunRecordValidationError("outcome.raw must be an object", "outcome.raw");
|
|
341
|
+
for (const [k, v] of Object.entries(raw)) expectFiniteNumber(v, `outcome.raw.${k}`);
|
|
342
|
+
if (outRec.realness !== void 0) {
|
|
343
|
+
const r = outRec.realness;
|
|
344
|
+
if (r === null || typeof r !== "object") throw new RunRecordValidationError("outcome.realness must be an object", "outcome.realness");
|
|
345
|
+
const rr = r;
|
|
346
|
+
expectFiniteNumber(rr.score, "outcome.realness.score");
|
|
347
|
+
if (typeof rr.gated !== "boolean") throw new RunRecordValidationError("outcome.realness.gated must be a boolean", "outcome.realness.gated");
|
|
348
|
+
}
|
|
349
|
+
if (outRec.judgeScores !== void 0) validateJudgeScores(outRec.judgeScores, "outcome.judgeScores");
|
|
350
|
+
if (obj.failureClass !== void 0 && (typeof obj.failureClass !== "string" || !FAILURE_CLASSES.includes(obj.failureClass))) throw new RunRecordValidationError(`failureClass must be one of ${FAILURE_CLASSES.join(", ")}`, "failureClass");
|
|
351
|
+
if (obj.failureMode !== void 0) {
|
|
352
|
+
expectString(obj.failureMode, "failureMode");
|
|
353
|
+
if (obj.failureClass === void 0 || obj.failureClass === "success") throw new RunRecordValidationError("failureMode requires a non-success failureClass", "failureMode");
|
|
354
|
+
}
|
|
355
|
+
if (typeof obj.terminalOutcome !== "string" || !TERMINAL_OUTCOMES.includes(obj.terminalOutcome)) throw new RunRecordValidationError(`terminalOutcome must be one of ${TERMINAL_OUTCOMES.join(", ")}`, "terminalOutcome");
|
|
356
|
+
if (obj.terminalFailureReason !== void 0) {
|
|
357
|
+
expectString(obj.terminalFailureReason, "terminalFailureReason");
|
|
358
|
+
if (obj.terminalOutcome !== "failed" && obj.terminalOutcome !== "cancelled" && obj.terminalOutcome !== "incomplete") throw new RunRecordValidationError("terminalFailureReason requires terminalOutcome failed, cancelled, or incomplete", "terminalFailureReason");
|
|
359
|
+
}
|
|
360
|
+
if (obj.agentProfile !== void 0) try {
|
|
361
|
+
const profile = validateAgentProfileCell(obj.agentProfile);
|
|
362
|
+
if (profile.model !== void 0 && profile.model !== obj.model) throw new RunRecordValidationError(`agentProfile.model "${profile.model}" does not match model "${obj.model}"`, "agentProfile.model");
|
|
363
|
+
if (profile.promptHash !== void 0 && profile.promptHash !== obj.promptHash) throw new RunRecordValidationError(`agentProfile.promptHash "${profile.promptHash}" does not match promptHash "${obj.promptHash}"`, "agentProfile.promptHash");
|
|
364
|
+
} catch (error) {
|
|
365
|
+
if (error instanceof RunRecordValidationError) throw error;
|
|
366
|
+
if (error instanceof Error) throw new RunRecordValidationError(error.message, "agentProfile");
|
|
367
|
+
throw error;
|
|
368
|
+
}
|
|
369
|
+
expectString(obj.scenarioId, "scenarioId");
|
|
370
|
+
if (typeof obj.splitTag !== "string" || !SPLIT_TAGS.includes(obj.splitTag)) throw new RunRecordValidationError(`splitTag must be one of ${SPLIT_TAGS.join(", ")}, got ${String(obj.splitTag)}`, "splitTag");
|
|
371
|
+
return input;
|
|
372
|
+
}
|
|
373
|
+
function validateCost(costUsd, provenance) {
|
|
374
|
+
if (provenance === null || typeof provenance !== "object") throw new RunRecordValidationError("costProvenance must be an object", "costProvenance");
|
|
375
|
+
const value = provenance;
|
|
376
|
+
if (value.kind !== "observed" && value.kind !== "estimated" && value.kind !== "uncaptured") throw new RunRecordValidationError("costProvenance.kind must be observed, estimated, or uncaptured", "costProvenance.kind");
|
|
377
|
+
if (value.kind === "uncaptured") {
|
|
378
|
+
if (value.usd !== null) throw new RunRecordValidationError("uncaptured costProvenance.usd must be null", "costProvenance.usd");
|
|
379
|
+
if (costUsd !== null) throw new RunRecordValidationError("uncaptured cost requires costUsd to be null", "costUsd");
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
expectNonNegativeNumber(costUsd, "costUsd");
|
|
383
|
+
expectNonNegativeNumber(value.usd, "costProvenance.usd");
|
|
384
|
+
if (value.usd !== costUsd) throw new RunRecordValidationError("costProvenance.usd must equal costUsd", "costProvenance.usd");
|
|
385
|
+
}
|
|
386
|
+
/** Boolean validator — convenience for filtering arrays. */
|
|
387
|
+
function isRunRecord(input) {
|
|
388
|
+
try {
|
|
389
|
+
validateRunRecord(input);
|
|
390
|
+
return true;
|
|
391
|
+
} catch {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
/** Non-throwing validator — returns a discriminated union. */
|
|
396
|
+
function parseRunRecordSafe(input) {
|
|
397
|
+
try {
|
|
398
|
+
return {
|
|
399
|
+
ok: true,
|
|
400
|
+
value: validateRunRecord(input)
|
|
401
|
+
};
|
|
402
|
+
} catch (e) {
|
|
403
|
+
if (e instanceof RunRecordValidationError) return {
|
|
404
|
+
ok: false,
|
|
405
|
+
error: e
|
|
406
|
+
};
|
|
407
|
+
throw e;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
/** Round-trip helper — `JSON.parse(JSON.stringify(record))` then validate. */
|
|
411
|
+
function roundTripRunRecord(record) {
|
|
412
|
+
const json = JSON.stringify(record);
|
|
413
|
+
return validateRunRecord(JSON.parse(json));
|
|
414
|
+
}
|
|
415
|
+
function expectString(value, path) {
|
|
416
|
+
if (typeof value !== "string" || value.length === 0) throw new RunRecordValidationError(`expected non-empty string`, path);
|
|
417
|
+
}
|
|
418
|
+
function expectFiniteNumber(value, path) {
|
|
419
|
+
if (typeof value !== "number" || !Number.isFinite(value)) throw new RunRecordValidationError(`expected finite number`, path);
|
|
420
|
+
}
|
|
421
|
+
function expectNonNegativeNumber(value, path) {
|
|
422
|
+
expectFiniteNumber(value, path);
|
|
423
|
+
if (value < 0) throw new RunRecordValidationError("expected non-negative number", path);
|
|
424
|
+
}
|
|
425
|
+
function validateJudgeScores(value, path) {
|
|
426
|
+
if (value === null || typeof value !== "object") throw new RunRecordValidationError("judgeScores must be an object", path);
|
|
427
|
+
const rec = value;
|
|
428
|
+
const perJudge = rec.perJudge;
|
|
429
|
+
if (perJudge === null || typeof perJudge !== "object") throw new RunRecordValidationError("perJudge must be an object", `${path}.perJudge`);
|
|
430
|
+
for (const [judgeId, dims] of Object.entries(perJudge)) {
|
|
431
|
+
if (dims === null || typeof dims !== "object") throw new RunRecordValidationError("per-judge entry must be an object of dimension scores", `${path}.perJudge.${judgeId}`);
|
|
432
|
+
for (const [dim, score] of Object.entries(dims)) expectFiniteNumber(score, `${path}.perJudge.${judgeId}.${dim}`);
|
|
433
|
+
}
|
|
434
|
+
const perDimMean = rec.perDimMean;
|
|
435
|
+
if (perDimMean === null || typeof perDimMean !== "object") throw new RunRecordValidationError("perDimMean must be an object", `${path}.perDimMean`);
|
|
436
|
+
for (const [dim, mean] of Object.entries(perDimMean)) expectFiniteNumber(mean, `${path}.perDimMean.${dim}`);
|
|
437
|
+
expectFiniteNumber(rec.composite, `${path}.composite`);
|
|
438
|
+
if (rec.failedJudges !== void 0) {
|
|
439
|
+
if (!Array.isArray(rec.failedJudges)) throw new RunRecordValidationError("failedJudges must be an array of strings", `${path}.failedJudges`);
|
|
440
|
+
for (let i = 0; i < rec.failedJudges.length; i++) {
|
|
441
|
+
const id = rec.failedJudges[i];
|
|
442
|
+
if (typeof id !== "string" || id.length === 0) throw new RunRecordValidationError("failedJudges entry must be a non-empty string", `${path}.failedJudges[${i}]`);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
if (rec.notes !== void 0 && typeof rec.notes !== "string") throw new RunRecordValidationError("notes must be a string", `${path}.notes`);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Heuristic snapshot check. Accepts:
|
|
449
|
+
* - `name@YYYY-MM-DD` (Anthropic style: `claude-sonnet-4-6@2025-04-15`)
|
|
450
|
+
* - `name-YYYYMMDD` (OpenAI style: `gpt-4o-2024-11-20`)
|
|
451
|
+
* - `name@<arbitrary-token>` (allow opaque snapshots like `@v3`)
|
|
452
|
+
* - explicit `:date-...` Vertex-style tags
|
|
453
|
+
*
|
|
454
|
+
* Rejects bare aliases like `claude-sonnet-4` or `gpt-4o` that remap
|
|
455
|
+
* silently as providers ship new snapshots.
|
|
456
|
+
*/
|
|
457
|
+
function modelHasSnapshot(model) {
|
|
458
|
+
if (model.includes("@")) return true;
|
|
459
|
+
if (/-\d{8}$/.test(model)) return true;
|
|
460
|
+
if (/-\d{4}-\d{2}-\d{2}$/.test(model)) return true;
|
|
461
|
+
if (/:date-/.test(model)) return true;
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
//#endregion
|
|
465
|
+
export { toAgentProfileJson as _, roundTripRunRecord as a, AGENT_PROFILE_KINDS as c, agentProfileCellKey as d, assertRunAgentProfileCell as f, requireAgentProfileCell as g, groupRunsByAgentProfileCell as h, parseRunRecordSafe as i, AgentProfileCellValidationError as l, buildAgentProfileCell as m, isRunRecord as n, runTaskScore as o, buildAgentInterfaceProfileCell as p, modelHasSnapshot as r, validateRunRecord as s, RunRecordValidationError as t, agentProfileCellHashMaterial as u, validateAgentProfileCell as v, verifyAgentProfileCell as y };
|
|
466
|
+
|
|
467
|
+
//# sourceMappingURL=run-record-BuoE80Dq.js.map
|