@tangle-network/agent-eval 0.221.8 → 0.222.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 +82 -0
- package/dist/adapters/http.d.ts +3 -5
- package/dist/adapters/http.d.ts.map +1 -1
- package/dist/adapters/http.js +1 -2
- package/dist/{adversarial-smnADNFS.d.ts → adversarial-DnQQFqTR.d.ts} +1 -3
- package/dist/adversarial-DnQQFqTR.d.ts.map +1 -0
- package/dist/{agent-profile-CNmwfaqq.d.ts → agent-profile-CoD1Dotf.d.ts} +4 -10
- package/dist/agent-profile-CoD1Dotf.d.ts.map +1 -0
- package/dist/agent-profile-Dngk3LZ0.js +153 -0
- package/dist/agent-profile-Dngk3LZ0.js.map +1 -0
- package/dist/{agent-profile-cell-BcpFbNd5.d.ts → agent-profile-cell-3kYxUsK2.d.ts} +3 -5
- package/dist/agent-profile-cell-3kYxUsK2.d.ts.map +1 -0
- package/dist/{agent-profile-cell-B1V1gUZs.js → agent-profile-cell-CT5JYueM.js} +5 -7
- package/dist/{agent-profile-cell-B1V1gUZs.js.map → agent-profile-cell-CT5JYueM.js.map} +1 -1
- package/dist/{agreement-irr-BhAqjluA.js → agreement-irr-BTjDN0i6.js} +4 -5
- package/dist/{agreement-irr-BhAqjluA.js.map → agreement-irr-BTjDN0i6.js.map} +1 -1
- package/dist/analyst/index.d.ts +95 -159
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +28 -39
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-DfX6dHP0.d.ts → analyze-runs-C-pP1sK9.d.ts} +7 -13
- package/dist/analyze-runs-C-pP1sK9.d.ts.map +1 -0
- package/dist/{analyze-runs-CHmsykNJ.js → analyze-runs-CTheASYV.js} +23 -32
- package/dist/{analyze-runs-CHmsykNJ.js.map → analyze-runs-CTheASYV.js.map} +1 -1
- package/dist/{attribute-vocabulary-CcXqHODT.d.ts → attribute-vocabulary-5oo8ykIx.d.ts} +2 -4
- package/dist/attribute-vocabulary-5oo8ykIx.d.ts.map +1 -0
- package/dist/authenticity/index.d.ts +0 -2
- package/dist/authenticity/index.d.ts.map +1 -1
- package/dist/authenticity/index.js +1 -2
- package/dist/{benchmark-command-Cnjfo0Zh.js → benchmark-command-jYWR2gya.js} +61 -94
- package/dist/benchmark-command-jYWR2gya.js.map +1 -0
- package/dist/benchmarks/index.d.ts +5 -15
- package/dist/benchmarks/index.d.ts.map +1 -1
- package/dist/benchmarks/index.js +27 -38
- package/dist/benchmarks/index.js.map +1 -1
- package/dist/{bounded-process-Cj9YjXbE.js → bounded-process-BZrWXIKW.js} +2 -3
- package/dist/{bounded-process-Cj9YjXbE.js.map → bounded-process-BZrWXIKW.js.map} +1 -1
- package/dist/builder-eval/index.d.ts +5 -14
- package/dist/builder-eval/index.d.ts.map +1 -1
- package/dist/builder-eval/index.js +11 -17
- package/dist/builder-eval/index.js.map +1 -1
- package/dist/{calibration-CTwxpJ-t.js → calibration-6usfVYYo.js} +4 -5
- package/dist/{calibration-CTwxpJ-t.js.map → calibration-6usfVYYo.js.map} +1 -1
- package/dist/campaign/index.d.ts +9 -9
- package/dist/campaign/index.js +15 -14
- package/dist/{campaign-uddTlFg5.js → campaign-ddr1N3yD.js} +61 -58
- package/dist/campaign-ddr1N3yD.js.map +1 -0
- package/dist/{campaign-evidence-DunzcJGv.js → campaign-evidence-DN8rWuBj.js} +20 -322
- package/dist/campaign-evidence-DN8rWuBj.js.map +1 -0
- package/dist/{canonical-Dq2hOQ8L.js → canonical-CicJlINA.js} +3 -4
- package/dist/{canonical-Dq2hOQ8L.js.map → canonical-CicJlINA.js.map} +1 -1
- package/dist/{canonical-CFpojCN5.d.ts → canonical-gLeHiqzd.d.ts} +2 -4
- package/dist/canonical-gLeHiqzd.d.ts.map +1 -0
- package/dist/{cell-spend-DEWR3nj-.js → cell-spend-zxmzg4GH.js} +3 -4
- package/dist/{cell-spend-DEWR3nj-.js.map → cell-spend-zxmzg4GH.js.map} +1 -1
- package/dist/{chat-client-BNATB3rJ.js → chat-client-CO3uB33i.js} +3 -4
- package/dist/{chat-client-BNATB3rJ.js.map → chat-client-CO3uB33i.js.map} +1 -1
- package/dist/{chat-json-call-BzWYp18J.js → chat-json-call-8yUv4LFO.js} +4 -5
- package/dist/{chat-json-call-BzWYp18J.js.map → chat-json-call-8yUv4LFO.js.map} +1 -1
- package/dist/{claim-BPVuyHuy.js → claim-Dod_mjk3.js} +5 -6
- package/dist/{claim-BPVuyHuy.js.map → claim-Dod_mjk3.js.map} +1 -1
- package/dist/cli.js +179 -23
- package/dist/cli.js.map +1 -1
- package/dist/{client-hwo3cJjR.d.ts → client-BIFwUg7I.d.ts} +6 -12
- package/dist/client-BIFwUg7I.d.ts.map +1 -0
- package/dist/{cluster-bootstrap-DEwwhl0C.js → cluster-bootstrap-SbaeM44s.js} +4 -5
- package/dist/{cluster-bootstrap-DEwwhl0C.js.map → cluster-bootstrap-SbaeM44s.js.map} +1 -1
- package/dist/completion-verifier-7KEfroqx.d.ts +168 -0
- package/dist/completion-verifier-7KEfroqx.d.ts.map +1 -0
- package/dist/{completion-verifier-asaV1nSj.js → completion-verifier-rqbMh5-4.js} +9 -160
- package/dist/completion-verifier-rqbMh5-4.js.map +1 -0
- package/dist/contract/index.d.ts +13 -13
- package/dist/contract/index.js +41 -60
- package/dist/contract/index.js.map +1 -1
- package/dist/{cost-ledger-BGZB6yY2.js → cost-ledger-CS8R3IZj.js} +10 -17
- package/dist/{cost-ledger-BGZB6yY2.js.map → cost-ledger-CS8R3IZj.js.map} +1 -1
- package/dist/{cost-ledger-C1W3ICmP.d.ts → cost-ledger-Czro9wmo.d.ts} +1 -5
- package/dist/cost-ledger-Czro9wmo.d.ts.map +1 -0
- package/dist/{dataset-DQqhOCPt.d.ts → dataset-DThC1S6G.d.ts} +1 -3
- package/dist/dataset-DThC1S6G.d.ts.map +1 -0
- package/dist/{decision-point-0nJubuoM.js → decision-point-lhMgODOR.js} +14 -18
- package/dist/{decision-point-0nJubuoM.js.map → decision-point-lhMgODOR.js.map} +1 -1
- package/dist/{deep-freeze-CurcOQg3.js → deep-freeze-CK8-2W7p.js} +2 -3
- package/dist/{deep-freeze-CurcOQg3.js.map → deep-freeze-CK8-2W7p.js.map} +1 -1
- package/dist/{default-registry-CLG5YqGS.d.ts → default-registry-B1DstPYg.d.ts} +53 -61
- package/dist/default-registry-B1DstPYg.d.ts.map +1 -0
- package/dist/{default-registry-BBTDgkDM.js → default-registry-C1tPEjZ4.js} +29 -45
- package/dist/{default-registry-BBTDgkDM.js.map → default-registry-C1tPEjZ4.js.map} +1 -1
- package/dist/{define-agent-eval-CCbT7Kfr.js → define-agent-eval-BLoP4Lf9.js} +15 -18
- package/dist/{define-agent-eval-CCbT7Kfr.js.map → define-agent-eval-BLoP4Lf9.js.map} +1 -1
- package/dist/{define-agent-eval-JKt3gMQr.d.ts → define-agent-eval-CAffiFbN.d.ts} +19 -27
- package/dist/define-agent-eval-CAffiFbN.d.ts.map +1 -0
- package/dist/{descriptive-CVNy48rR.js → descriptive-cPwITVfy.js} +30 -8
- package/dist/descriptive-cPwITVfy.js.map +1 -0
- package/dist/diagnosis/index.d.ts +5 -15
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +13 -19
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{dspy-rlm-engine-DN1p_5jx.js → dspy-rlm-engine-jDiWkul6.js} +7 -10
- package/dist/{dspy-rlm-engine-DN1p_5jx.js.map → dspy-rlm-engine-jDiWkul6.js.map} +1 -1
- package/dist/{emitter-DbMXUIVP.js → emitter-DhQ65mza.js} +3 -4
- package/dist/{emitter-DbMXUIVP.js.map → emitter-DhQ65mza.js.map} +1 -1
- package/dist/{emitter-DABYYTcH.d.ts → emitter-mAXC5PSN.d.ts} +3 -5
- package/dist/emitter-mAXC5PSN.d.ts.map +1 -0
- package/dist/{engine-dtRVeuQs.d.ts → engine-CaHaCc3W.d.ts} +10 -18
- package/dist/engine-CaHaCc3W.d.ts.map +1 -0
- package/dist/{equal-terms-DbPGcVtI.js → equal-terms-K11VHmR3.js} +3 -4
- package/dist/{equal-terms-DbPGcVtI.js.map → equal-terms-K11VHmR3.js.map} +1 -1
- package/dist/{errors-BcOs5MKW.js → errors-DeEEV9Vx.js} +2 -3
- package/dist/{errors-BcOs5MKW.js.map → errors-DeEEV9Vx.js.map} +1 -1
- package/dist/{errors-DEE6u6ot.d.ts → errors-E9I2hldP.d.ts} +1 -3
- package/dist/errors-E9I2hldP.d.ts.map +1 -0
- package/dist/{eval-campaign-DoX5vz3E.js → eval-campaign-Cgixrvf7.js} +8 -9
- package/dist/{eval-campaign-DoX5vz3E.js.map → eval-campaign-Cgixrvf7.js.map} +1 -1
- package/dist/{evaluation-wdGyZ7jV.js → evaluation-B8H3GYej.js} +4 -6
- package/dist/{evaluation-wdGyZ7jV.js.map → evaluation-B8H3GYej.js.map} +1 -1
- package/dist/{evaluation-DblGquCB.d.ts → evaluation-BPqUvZ66.d.ts} +4 -6
- package/dist/evaluation-BPqUvZ66.d.ts.map +1 -0
- package/dist/evaluation.d.ts +1 -1
- package/dist/evaluation.js +1 -2
- package/dist/{exact-types-Do63KoKn.d.ts → exact-types-D98BKpxo.d.ts} +8 -10
- package/dist/exact-types-D98BKpxo.d.ts.map +1 -0
- package/dist/{exec-CpbtOXVt.js → exec-C0_AkLUv.js} +3 -5
- package/dist/{exec-CpbtOXVt.js.map → exec-C0_AkLUv.js.map} +1 -1
- package/dist/{execution-tracks-CpgFPpS5.js → execution-tracks-DaDXYwAq.js} +2 -3
- package/dist/{execution-tracks-CpgFPpS5.js.map → execution-tracks-DaDXYwAq.js.map} +1 -1
- package/dist/experiment/index.d.ts +9 -37
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +29 -40
- package/dist/experiment/index.js.map +1 -1
- package/dist/{exporters-Dk3oEbK_.d.ts → exporters-B5Ze_RKh.d.ts} +4 -4
- package/dist/exporters-B5Ze_RKh.d.ts.map +1 -0
- package/dist/{exporters-DWvM16LE.js → exporters-ByLcILYU.js} +23 -5
- package/dist/exporters-ByLcILYU.js.map +1 -0
- package/dist/{external-optimizer-process-DEzJ2CGX.js → external-optimizer-process-BRVmaDFe.js} +5 -6
- package/dist/{external-optimizer-process-DEzJ2CGX.js.map → external-optimizer-process-BRVmaDFe.js.map} +1 -1
- package/dist/{external-optimizer-subprocess-B_ukPtRD.js → external-optimizer-subprocess-U616hV_l.js} +24 -37
- package/dist/{external-optimizer-subprocess-B_ukPtRD.js.map → external-optimizer-subprocess-U616hV_l.js.map} +1 -1
- package/dist/{extract-usage-BZLU01kR.js → extract-usage-ISFqhfDz.js} +2 -3
- package/dist/{extract-usage-BZLU01kR.js.map → extract-usage-ISFqhfDz.js.map} +1 -1
- package/dist/{failure-cluster-DN0t63Z0.d.ts → failure-cluster-DOoa7CBg.d.ts} +3 -7
- package/dist/failure-cluster-DOoa7CBg.d.ts.map +1 -0
- package/dist/{failure-taxonomy-Bx5oWqaW.js → failure-taxonomy-9eQfXKoW.js} +2 -3
- package/dist/{failure-taxonomy-Bx5oWqaW.js.map → failure-taxonomy-9eQfXKoW.js.map} +1 -1
- package/dist/{feedback-trajectory-CYVJXolG.d.ts → feedback-trajectory-SBGncrCP.d.ts} +7 -13
- package/dist/feedback-trajectory-SBGncrCP.d.ts.map +1 -0
- package/dist/{finding-composition-8n0fFgVI.js → finding-composition-DlvE1Qul.js} +4 -6
- package/dist/{finding-composition-8n0fFgVI.js.map → finding-composition-DlvE1Qul.js.map} +1 -1
- package/dist/{findings-store-Bg4sdS-e.js → findings-store-B75Dspaq.js} +11 -14
- package/dist/{findings-store-Bg4sdS-e.js.map → findings-store-B75Dspaq.js.map} +1 -1
- package/dist/fuzz.d.ts +3 -17
- package/dist/fuzz.d.ts.map +1 -1
- package/dist/fuzz.js +30 -29
- package/dist/fuzz.js.map +1 -1
- package/dist/{hf-dataset-CKxIJQba.js → hf-dataset-DPVQXW5n.js} +362 -21
- package/dist/hf-dataset-DPVQXW5n.js.map +1 -0
- package/dist/hosted/index.d.ts +2 -6
- package/dist/hosted/index.d.ts.map +1 -1
- package/dist/hosted/index.js +1 -2
- package/dist/{index-CalAsXMR.d.ts → index-B1Bm9oJA.d.ts} +3 -15
- package/dist/index-B1Bm9oJA.d.ts.map +1 -0
- package/dist/{index-CdEVr8-O.d.ts → index-B7v2QHlD.d.ts} +24 -299
- package/dist/index-B7v2QHlD.d.ts.map +1 -0
- package/dist/{index-CTIRz-AB.d.ts → index-CUjeTDPv.d.ts} +14 -36
- package/dist/index-CUjeTDPv.d.ts.map +1 -0
- package/dist/{index-CfJULcW5.d.ts → index-DAk2quYu.d.ts} +18 -38
- package/dist/index-DAk2quYu.d.ts.map +1 -0
- package/dist/{index-D7fmC-1K.d.ts → index-DUn0GNiZ.d.ts} +183 -36
- package/dist/index-DUn0GNiZ.d.ts.map +1 -0
- package/dist/{index-CHxwfW5g.d.ts → index-DwUGehqX.d.ts} +3 -9
- package/dist/index-DwUGehqX.d.ts.map +1 -0
- package/dist/{index-jnuFLxOs.d.ts → index-aDPVYBIM.d.ts} +11 -39
- package/dist/index-aDPVYBIM.d.ts.map +1 -0
- package/dist/index.d.ts +55 -188
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -195
- package/dist/index.js.map +1 -1
- package/dist/{integrity-D-s2iHiT.js → integrity-B1V6klyO.js} +12 -363
- package/dist/integrity-B1V6klyO.js.map +1 -0
- package/dist/{integrity-D9lBnv_K.d.ts → integrity-BAdVzT8u.d.ts} +4 -6
- package/dist/integrity-BAdVzT8u.d.ts.map +1 -0
- package/dist/{integrity-W4CADcFc.js → integrity-DOHt1mwU.js} +3 -4
- package/dist/{integrity-W4CADcFc.js.map → integrity-DOHt1mwU.js.map} +1 -1
- package/dist/{internal-BTK91Bqt.js → internal-v6XfOeJW.js} +6 -8
- package/dist/{internal-BTK91Bqt.js.map → internal-v6XfOeJW.js.map} +1 -1
- package/dist/{interval-Dq9gt7jx.js → interval-Bd2f4CRT.js} +6 -8
- package/dist/{interval-Dq9gt7jx.js.map → interval-Bd2f4CRT.js.map} +1 -1
- package/dist/{interval-ohuOJurX.d.ts → interval-CWyxqDpE.d.ts} +1 -5
- package/dist/interval-CWyxqDpE.d.ts.map +1 -0
- package/dist/{journal-C7om8Gum.js → journal-C1uLJi0w.js} +115 -121
- package/dist/{journal-C7om8Gum.js.map → journal-C1uLJi0w.js.map} +1 -1
- package/dist/{json-BhdsJaOQ.js → json-DtvZNAU9.js} +4 -6
- package/dist/{json-BhdsJaOQ.js.map → json-DtvZNAU9.js.map} +1 -1
- package/dist/json-recovery-DK4MDm5r.js +296 -0
- package/dist/json-recovery-DK4MDm5r.js.map +1 -0
- package/dist/{judge-calibration-BkXMIWA4.js → judge-calibration-DGqlfWW8.js} +5 -6
- package/dist/{judge-calibration-BkXMIWA4.js.map → judge-calibration-DGqlfWW8.js.map} +1 -1
- package/dist/{judge-calibration-DFtEMlde.d.ts → judge-calibration-DnrbQaXI.d.ts} +1 -3
- package/dist/judge-calibration-DnrbQaXI.d.ts.map +1 -0
- package/dist/{judge-gate-BVvmP00P.js → judge-gate-C2BCOt-M.js} +8 -12
- package/dist/{judge-gate-BVvmP00P.js.map → judge-gate-C2BCOt-M.js.map} +1 -1
- package/dist/judges-BLxg5p8E.js +20 -0
- package/dist/judges-BLxg5p8E.js.map +1 -0
- package/dist/{kind-factory-Dl0PmNQL.js → kind-factory-VKysp1ds.js} +23 -39
- package/dist/{kind-factory-Dl0PmNQL.js.map → kind-factory-VKysp1ds.js.map} +1 -1
- package/dist/ledger-core/index.d.ts +2 -2
- package/dist/ledger-core/index.js +3 -3
- package/dist/ledger-core/lock-holder.d.ts +1 -1
- package/dist/ledger-core/lock-holder.js +1 -2
- package/dist/{ledger-core-CAxUdDk0.js → ledger-core-CfT-FzPf.js} +5 -6
- package/dist/{ledger-core-CAxUdDk0.js.map → ledger-core-CfT-FzPf.js.map} +1 -1
- package/dist/{llm-client-b1ysZVIU.js → llm-client-kJ9EOqjt.js} +22 -30
- package/dist/{llm-client-b1ysZVIU.js.map → llm-client-kJ9EOqjt.js.map} +1 -1
- package/dist/{llm-judge-Cybq29bL.js → llm-judge-cgbhTKQp.js} +108 -164
- package/dist/llm-judge-cgbhTKQp.js.map +1 -0
- package/dist/{lock-holder-DaJbfpci.d.ts → lock-holder-DoxlZFkQ.d.ts} +1 -3
- package/dist/lock-holder-DoxlZFkQ.d.ts.map +1 -0
- package/dist/matrix/index.d.ts +3 -3
- package/dist/matrix/index.js +2 -2
- package/dist/{matrix-DtkZLD_3.d.ts → matrix-CBUzIZs4.d.ts} +4 -12
- package/dist/matrix-CBUzIZs4.d.ts.map +1 -0
- package/dist/{matrix-B8l-Nsxd.js → matrix-CgpX8wdm.js} +8 -13
- package/dist/matrix-CgpX8wdm.js.map +1 -0
- package/dist/{mean-BbA_JCzW.js → mean-CdDYG-us.js} +6 -9
- package/dist/{mean-BbA_JCzW.js.map → mean-CdDYG-us.js.map} +1 -1
- package/dist/meta-eval/index.d.ts +3 -3
- package/dist/meta-eval/index.js +17 -21
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/{metrics-BKaPBtIG.js → metrics-DNCAUtuB.js} +2 -3
- package/dist/{metrics-BKaPBtIG.js.map → metrics-DNCAUtuB.js.map} +1 -1
- package/dist/{mint-CbdwjTPW.js → mint-D9ZysYtY.js} +7 -8
- package/dist/{mint-CbdwjTPW.js.map → mint-D9ZysYtY.js.map} +1 -1
- package/dist/{multi-layer-verifier-DEgMUk6v.d.ts → multi-layer-verifier-lM4aVN78.d.ts} +2 -4
- package/dist/multi-layer-verifier-lM4aVN78.d.ts.map +1 -0
- package/dist/{multiplicity-Sg0U7h8j.js → multiplicity-DAd4xaDC.js} +3 -4
- package/dist/{multiplicity-Sg0U7h8j.js.map → multiplicity-DAd4xaDC.js.map} +1 -1
- package/dist/{multiplicity-DIWHvysC.d.ts → multiplicity-D_SEsc5j.d.ts} +1 -3
- package/dist/multiplicity-D_SEsc5j.d.ts.map +1 -0
- package/dist/multishot/golden/index.d.ts +1 -17
- package/dist/multishot/golden/index.d.ts.map +1 -1
- package/dist/multishot/golden/index.js +10 -17
- package/dist/multishot/golden/index.js.map +1 -1
- package/dist/multishot/index.d.ts +2 -10
- package/dist/multishot/index.d.ts.map +1 -1
- package/dist/multishot/index.js +11 -18
- package/dist/multishot/index.js.map +1 -1
- package/dist/{nonnegative-number-DvdMxg_f.js → nonnegative-number-lEYbOsuh.js} +2 -3
- package/dist/{nonnegative-number-DvdMxg_f.js.map → nonnegative-number-lEYbOsuh.js.map} +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{otel-spans-64hmQqON.js → otel-spans-BsGzTWIK.js} +5 -6
- package/dist/{otel-spans-64hmQqON.js.map → otel-spans-BsGzTWIK.js.map} +1 -1
- package/dist/{otlp-attributes-D9ptWaIJ.js → otlp-attributes-Boeb7gtH.js} +2 -3
- package/dist/{otlp-attributes-D9ptWaIJ.js.map → otlp-attributes-Boeb7gtH.js.map} +1 -1
- package/dist/{outcome-observations-FLmRpgYa.js → outcome-observations-D4snOtUb.js} +4 -5
- package/dist/{outcome-observations-FLmRpgYa.js.map → outcome-observations-D4snOtUb.js.map} +1 -1
- package/dist/{outcome-store-DUcMj-3D.js → outcome-store-TarrcfHG.js} +2 -3
- package/dist/{outcome-store-DUcMj-3D.js.map → outcome-store-TarrcfHG.js.map} +1 -1
- package/dist/{package-version-D7lQHt_-.js → package-version-CJl_pY9W.js} +2 -3
- package/dist/{package-version-D7lQHt_-.js.map → package-version-CJl_pY9W.js.map} +1 -1
- package/dist/{paired-arms-B2ttLc0_.js → paired-arms-D-54hO-k.js} +10 -14
- package/dist/{paired-arms-B2ttLc0_.js.map → paired-arms-D-54hO-k.js.map} +1 -1
- package/dist/{paired-binary-B_nejA44.js → paired-binary-BR0nwHOA.js} +3 -4
- package/dist/{paired-binary-B_nejA44.js.map → paired-binary-BR0nwHOA.js.map} +1 -1
- package/dist/{paired-promotion-decision-CQMJ5xGN.d.ts → paired-promotion-decision-BDnqepZ1.d.ts} +1 -5
- package/dist/paired-promotion-decision-BDnqepZ1.d.ts.map +1 -0
- package/dist/{paired-promotion-decision-D0SHb-ZL.js → paired-promotion-decision-FGvHA4p_.js} +5 -7
- package/dist/{paired-promotion-decision-D0SHb-ZL.js.map → paired-promotion-decision-FGvHA4p_.js.map} +1 -1
- package/dist/{pareto-BiBnQXAE.js → pareto-B9udAt2i.js} +28 -50
- package/dist/pareto-B9udAt2i.js.map +1 -0
- package/dist/pipelines/index.d.ts +5 -11
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js +6 -8
- package/dist/pipelines/index.js.map +1 -1
- package/dist/{power-and-mde-CQX-0weG.js → power-and-mde-ClI6RWw4.js} +4 -5
- package/dist/{power-and-mde-CQX-0weG.js.map → power-and-mde-ClI6RWw4.js.map} +1 -1
- package/dist/{predicate-FdKmElA_.js → predicate-BYHA4MBn.js} +2 -3
- package/dist/{predicate-FdKmElA_.js.map → predicate-BYHA4MBn.js.map} +1 -1
- package/dist/{prime-bridge-transport-6feEglLf.d.ts → prime-bridge-transport-Cfqir_Im.d.ts} +1 -3
- package/dist/prime-bridge-transport-Cfqir_Im.d.ts.map +1 -0
- package/dist/{prime-bridge-transport-Z3cpKGoV.js → prime-bridge-transport-Csd5SQg7.js} +2 -3
- package/dist/{prime-bridge-transport-Z3cpKGoV.js.map → prime-bridge-transport-Csd5SQg7.js.map} +1 -1
- package/dist/{prime-protocol-BGxjfhM4.d.ts → prime-protocol-COFkxas6.d.ts} +4 -8
- package/dist/prime-protocol-COFkxas6.d.ts.map +1 -0
- package/dist/{prime-protocol-BFgGrEMP.js → prime-protocol-CrhpXRz9.js} +4 -6
- package/dist/{prime-protocol-BFgGrEMP.js.map → prime-protocol-CrhpXRz9.js.map} +1 -1
- package/dist/profile-cell.d.ts +1 -1
- package/dist/profile-cell.js +1 -2
- package/dist/{promotion-gate-CkVZHagC.d.ts → promotion-gate-CixshGI8.d.ts} +5 -11
- package/dist/promotion-gate-CixshGI8.d.ts.map +1 -0
- package/dist/{promotion-policy-6A8osGr_.js → promotion-policy-CBYeD4zi.js} +5 -6
- package/dist/{promotion-policy-6A8osGr_.js.map → promotion-policy-CBYeD4zi.js.map} +1 -1
- package/dist/{proposal-findings-DqLUWsAG.js → proposal-findings-WFQrxnfe.js} +3 -4
- package/dist/{proposal-findings-DqLUWsAG.js.map → proposal-findings-WFQrxnfe.js.map} +1 -1
- package/dist/{quantile--0yb07pD.js → quantile-CncXP-Ss.js} +2 -3
- package/dist/{quantile--0yb07pD.js.map → quantile-CncXP-Ss.js.map} +1 -1
- package/dist/{query-B_RZ36an.js → query-CGXzO9d4.js} +5 -6
- package/dist/{query-B_RZ36an.js.map → query-CGXzO9d4.js.map} +1 -1
- package/dist/{query-Cmv_U8vf.d.ts → query-UD0B08Sb.d.ts} +4 -6
- package/dist/query-UD0B08Sb.d.ts.map +1 -0
- package/dist/{random-DGEyr3zG.d.ts → random-BN150Q_X.d.ts} +1 -5
- package/dist/random-BN150Q_X.d.ts.map +1 -0
- package/dist/{random-DDDcC7YU.js → random-DrzcgC7F.js} +3 -4
- package/dist/{random-DDDcC7YU.js.map → random-DrzcgC7F.js.map} +1 -1
- package/dist/{raw-provider-sink-75w4FWBj.js → raw-provider-sink-DDLkP_eF.js} +3 -4
- package/dist/{raw-provider-sink-75w4FWBj.js.map → raw-provider-sink-DDLkP_eF.js.map} +1 -1
- package/dist/{record-id-DUgsK5qp.js → record-id-CWZXFh58.js} +2 -3
- package/dist/{record-id-DUgsK5qp.js.map → record-id-CWZXFh58.js.map} +1 -1
- package/dist/{redact-DXdlFb_U.d.ts → redact-C_wzC4c_.d.ts} +1 -3
- package/dist/redact-C_wzC4c_.d.ts.map +1 -0
- package/dist/{redact-mtkTiJVk.js → redact-D6APJS1d.js} +3 -5
- package/dist/{redact-mtkTiJVk.js.map → redact-D6APJS1d.js.map} +1 -1
- package/dist/{registry-BcdJmyoU.d.ts → registry-dhdDoAV8.d.ts} +5 -11
- package/dist/registry-dhdDoAV8.d.ts.map +1 -0
- package/dist/{release-confidence-CYIFH-fp.js → release-confidence-CTUJz5mM.js} +10 -16
- package/dist/release-confidence-CTUJz5mM.js.map +1 -0
- package/dist/{render-BhJqXoBH.js → render-pfAZ7IR4.js} +266 -33
- package/dist/render-pfAZ7IR4.js.map +1 -0
- package/dist/{reporting-html-Kvlc8oMt.js → reporting-html-DMXIjATy.js} +2 -3
- package/dist/{reporting-html-Kvlc8oMt.js.map → reporting-html-DMXIjATy.js.map} +1 -1
- package/dist/reporting.d.ts +6 -6
- package/dist/reporting.js +7 -7
- package/dist/{researcher-DKWtoMWk.d.ts → researcher-CLnNJ7Or.d.ts} +8 -12
- package/dist/researcher-CLnNJ7Or.d.ts.map +1 -0
- package/dist/{reward-nw2xZGZG.js → reward-P0VD_Aft.js} +2 -3
- package/dist/{reward-nw2xZGZG.js.map → reward-P0VD_Aft.js.map} +1 -1
- package/dist/{reward-BeUgVVC_.d.ts → reward-ST4PXNXF.d.ts} +2 -4
- package/dist/reward-ST4PXNXF.d.ts.map +1 -0
- package/dist/{reward-hacking-WTxUbtbb.d.ts → reward-hacking-C9hPVT0Q.d.ts} +4 -8
- package/dist/reward-hacking-C9hPVT0Q.d.ts.map +1 -0
- package/dist/{reward-hacking-ByuETaIb.js → reward-hacking-DZzHZlS1.js} +5 -7
- package/dist/{reward-hacking-ByuETaIb.js.map → reward-hacking-DZzHZlS1.js.map} +1 -1
- package/dist/rl.d.ts +26 -63
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +35 -52
- package/dist/rl.js.map +1 -1
- package/dist/{rolldown-runtime-8H4AJuhK.js → rolldown-runtime-BJohB4LM.js} +1 -2
- package/dist/rollout/index.d.ts +6 -6
- package/dist/rollout/index.js +7 -7
- package/dist/{rollout-Dd1ucT_M.js → rollout-BhkMpAJT.js} +279 -16
- package/dist/rollout-BhkMpAJT.js.map +1 -0
- package/dist/{terminal-record-CB9BFtjS.js → rollout-nodes-BHR9Q5jP.js} +351 -11
- package/dist/rollout-nodes-BHR9Q5jP.js.map +1 -0
- package/dist/{round-decimal-COrKglMh.js → round-decimal-ZmjAQPo1.js} +2 -3
- package/dist/{round-decimal-COrKglMh.js.map → round-decimal-ZmjAQPo1.js.map} +1 -1
- package/dist/{rubric-predictive-validity-Cd5SCtAf.d.ts → rubric-predictive-validity-B3RzbwOx.d.ts} +2 -8
- package/dist/rubric-predictive-validity-B3RzbwOx.d.ts.map +1 -0
- package/dist/{rubric-predictive-validity-CeKW2GQN.js → rubric-predictive-validity-CQp_M0vy.js} +3 -4
- package/dist/{rubric-predictive-validity-CeKW2GQN.js.map → rubric-predictive-validity-CQp_M0vy.js.map} +1 -1
- package/dist/{run-record-CysKLB93.js → run-record-CZy4-TnZ.js} +4 -5
- package/dist/{run-record-CysKLB93.js.map → run-record-CZy4-TnZ.js.map} +1 -1
- package/dist/{run-record-C3awiXPf.d.ts → run-record-D2BFMPGl.d.ts} +5 -7
- package/dist/run-record-D2BFMPGl.d.ts.map +1 -0
- package/dist/{run-record-DhEJgoPz.js → run-record-DEjx43cI.js} +6 -7
- package/dist/{run-record-DhEJgoPz.js.map → run-record-DEjx43cI.js.map} +1 -1
- package/dist/{sandbox-harness-BlSOu4LX.d.ts → sandbox-harness-B3Kx1fOA.d.ts} +1 -3
- package/dist/sandbox-harness-B3Kx1fOA.d.ts.map +1 -0
- package/dist/{schema-D6EVKzTB.d.ts → schema-CkIvnmLU.d.ts} +2 -43
- package/dist/schema-CkIvnmLU.d.ts.map +1 -0
- package/dist/{schema-Bt2vLFm3.js → schema-D-xu3MU_.js} +2 -3
- package/dist/{schema-Bt2vLFm3.js.map → schema-D-xu3MU_.js.map} +1 -1
- package/dist/{schema-C-ziyJD7.d.ts → schema-DkFJr3Y8.d.ts} +111 -48
- package/dist/schema-DkFJr3Y8.d.ts.map +1 -0
- package/dist/{schema-CvhfLjtZ.js → schema-YUIXT8iW.js} +37 -7
- package/dist/schema-YUIXT8iW.js.map +1 -0
- package/dist/search/index.d.ts +3 -35
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +4 -5
- package/dist/{search-kernel-CctpiDd2.d.ts → search-kernel-CBdwFZ05.d.ts} +10 -36
- package/dist/search-kernel-CBdwFZ05.d.ts.map +1 -0
- package/dist/{search-ledger-CZRqtFbW.js → search-ledger-BsVi-Ngv.js} +17 -26
- package/dist/{search-ledger-CZRqtFbW.js.map → search-ledger-BsVi-Ngv.js.map} +1 -1
- package/dist/{search-ledger-file-Bd5Tioq6.js → search-ledger-file-DTBD6X-y.js} +6 -8
- package/dist/{search-ledger-file-Bd5Tioq6.js.map → search-ledger-file-DTBD6X-y.js.map} +1 -1
- package/dist/{search-ledger-types-p2xKfiDJ.d.ts → search-ledger-types-qiYRUo_N.d.ts} +5 -9
- package/dist/search-ledger-types-qiYRUo_N.d.ts.map +1 -0
- package/dist/{search-shipper-Dn3NLsuH.js → search-shipper-pdg4viK7.js} +8 -13
- package/dist/{search-shipper-Dn3NLsuH.js.map → search-shipper-pdg4viK7.js.map} +1 -1
- package/dist/{search-summary-D4bwYnAE.js → search-summary-Ct7SrmVc.js} +6 -7
- package/dist/{search-summary-D4bwYnAE.js.map → search-summary-Ct7SrmVc.js.map} +1 -1
- package/dist/{sequential-CimQrbjv.js → sequential-B1I0tRfL.js} +6 -7
- package/dist/{sequential-CimQrbjv.js.map → sequential-B1I0tRfL.js.map} +1 -1
- package/dist/{sequential-KwGspfeR.d.ts → sequential-Bb_pdTqG.d.ts} +1 -3
- package/dist/sequential-Bb_pdTqG.d.ts.map +1 -0
- package/dist/{sequential-BVv1sjsw.js → sequential-Bjs5roiK.js} +2 -3
- package/dist/{sequential-BVv1sjsw.js.map → sequential-Bjs5roiK.js.map} +1 -1
- package/dist/{sequential-eprocess-DodI6RoF.js → sequential-eprocess-C1YLwFaz.js} +3 -4
- package/dist/{sequential-eprocess-DodI6RoF.js.map → sequential-eprocess-C1YLwFaz.js.map} +1 -1
- package/dist/{server-ChhXPCgX.js → server-DA6h3co5.js} +11 -17
- package/dist/{server-ChhXPCgX.js.map → server-DA6h3co5.js.map} +1 -1
- package/dist/{single-run-lock-Dekd8_Wv.js → single-run-lock-BGlW3OSk.js} +3 -4
- package/dist/{single-run-lock-Dekd8_Wv.js.map → single-run-lock-BGlW3OSk.js.map} +1 -1
- package/dist/{skillopt-optimization-method-sB_-yi1G.js → skillopt-optimization-method-qB1M554K.js} +38 -57
- package/dist/{skillopt-optimization-method-sB_-yi1G.js.map → skillopt-optimization-method-qB1M554K.js.map} +1 -1
- package/dist/{spans-CVngGij3.d.ts → spans-vZoW__3q.d.ts} +2 -4
- package/dist/spans-vZoW__3q.d.ts.map +1 -0
- package/dist/{statistical-heldout-BjzSOmLH.d.ts → statistical-heldout-Cei036nE.d.ts} +9 -37
- package/dist/statistical-heldout-Cei036nE.d.ts.map +1 -0
- package/dist/{statistical-heldout-Bksv92Th.js → statistical-heldout-TP6ndL0B.js} +4 -5
- package/dist/{statistical-heldout-Bksv92Th.js.map → statistical-heldout-TP6ndL0B.js.map} +1 -1
- package/dist/{steps-DlepJPwD.d.ts → steps-B8fYY_Vo.d.ts} +1 -3
- package/dist/steps-B8fYY_Vo.d.ts.map +1 -0
- package/dist/{store-B3nWRy3B.d.ts → store-CMs5wGXP.d.ts} +2 -4
- package/dist/store-CMs5wGXP.d.ts.map +1 -0
- package/dist/{store-BhNuLdJw.js → store-ZykIyQmy.js} +2 -3
- package/dist/{store-BhNuLdJw.js.map → store-ZykIyQmy.js.map} +1 -1
- package/dist/{store-otlp-CFf27E8_.js → store-otlp-DmLm65XW.js} +8 -13
- package/dist/{store-otlp-CFf27E8_.js.map → store-otlp-DmLm65XW.js.map} +1 -1
- package/dist/{store-tool-spans-DxsFwtdr.d.ts → store-tool-spans-B3i3fl0A.d.ts} +11 -29
- package/dist/store-tool-spans-B3i3fl0A.d.ts.map +1 -0
- package/dist/{store-tool-spans-BK_8FjGG.js → store-tool-spans-C2g8UYm-.js} +17 -41
- package/dist/{store-tool-spans-BK_8FjGG.js.map → store-tool-spans-C2g8UYm-.js.map} +1 -1
- package/dist/storyboard/index.d.ts +1 -5
- package/dist/storyboard/index.d.ts.map +1 -1
- package/dist/storyboard/index.js +3 -5
- package/dist/storyboard/index.js.map +1 -1
- package/dist/{summary-report-C8V49Jt3.d.ts → summary-report-0La5vejY.d.ts} +5 -13
- package/dist/summary-report-0La5vejY.d.ts.map +1 -0
- package/dist/{summary-report-DHDWxe6p.js → summary-report-CPfsrLac.js} +21 -30
- package/dist/summary-report-CPfsrLac.js.map +1 -0
- package/dist/supervisor-run/index.d.ts +30 -29
- package/dist/supervisor-run/index.d.ts.map +1 -1
- package/dist/supervisor-run/index.js +6 -7
- package/dist/{systemone-CHnqwmYg.d.ts → systemone-Cw2txK5m.d.ts} +12 -24
- package/dist/systemone-Cw2txK5m.d.ts.map +1 -0
- package/dist/{systemone-protocol-Bl2EI2KQ.d.ts → systemone-protocol-C4t7JH4Y.d.ts} +1 -3
- package/dist/systemone-protocol-C4t7JH4Y.d.ts.map +1 -0
- package/dist/systemone-protocol.d.ts +1 -1
- package/dist/systemone-protocol.js +2 -3
- package/dist/{systemone-review-cQ9acAsb.d.ts → systemone-review-BLgxt-4Q.d.ts} +8 -10
- package/dist/systemone-review-BLgxt-4Q.d.ts.map +1 -0
- package/dist/{systemone-review-DFGtIUcf.js → systemone-review-S49gsy_y.js} +5 -6
- package/dist/{systemone-review-DFGtIUcf.js.map → systemone-review-S49gsy_y.js.map} +1 -1
- package/dist/systemone.d.ts +4 -4
- package/dist/systemone.js +3 -3
- package/dist/{task-failure-attributes-oIK3BhCR.js → task-failure-attributes-CC6VuIpk.js} +7 -10
- package/dist/{task-failure-attributes-oIK3BhCR.js.map → task-failure-attributes-CC6VuIpk.js.map} +1 -1
- package/dist/{tool-groups-b3oU_D88.d.ts → tool-groups-C3K-d3gd.d.ts} +3 -5
- package/dist/tool-groups-C3K-d3gd.d.ts.map +1 -0
- package/dist/{tool-waste-CkjzWmeY.d.ts → tool-waste-BFG1vwTV.d.ts} +4 -16
- package/dist/tool-waste-BFG1vwTV.d.ts.map +1 -0
- package/dist/{tool-waste-DLsjS_p-.js → tool-waste-CLJ46AbT.js} +10 -26
- package/dist/{tool-waste-DLsjS_p-.js.map → tool-waste-CLJ46AbT.js.map} +1 -1
- package/dist/trace-attributes.d.ts +1 -1
- package/dist/trace-attributes.js +1 -2
- package/dist/{trace-questions-BmT8M6UQ.d.ts → trace-questions-ej5AEJ5X.d.ts} +4 -6
- package/dist/trace-questions-ej5AEJ5X.d.ts.map +1 -0
- package/dist/trace-repair/index.d.ts +46 -92
- package/dist/trace-repair/index.d.ts.map +1 -1
- package/dist/trace-repair/index.js +32 -54
- package/dist/trace-repair/index.js.map +1 -1
- package/dist/traces.d.ts +13 -29
- package/dist/traces.d.ts.map +1 -1
- package/dist/traces.js +18 -22
- package/dist/traces.js.map +1 -1
- package/dist/{trajectory-D_7rLrvE.js → trajectory-O3GDHmev.js} +2 -3
- package/dist/{trajectory-D_7rLrvE.js.map → trajectory-O3GDHmev.js.map} +1 -1
- package/dist/trajectory-replay/index.d.ts +2 -22
- package/dist/trajectory-replay/index.d.ts.map +1 -1
- package/dist/trajectory-replay/index.js +19 -30
- package/dist/trajectory-replay/index.js.map +1 -1
- package/dist/{tree-DSqwJpL9.js → tree-DrIChF4a.js} +39 -68
- package/dist/{tree-DSqwJpL9.js.map → tree-DrIChF4a.js.map} +1 -1
- package/dist/{types-B_IFcKp5.d.ts → types-0KglnQ9o.d.ts} +3 -15
- package/dist/types-0KglnQ9o.d.ts.map +1 -0
- package/dist/{types-DZ0mYVw9.d.ts → types-0oMg7zee.d.ts} +3 -5
- package/dist/types-0oMg7zee.d.ts.map +1 -0
- package/dist/{types-CnWmj8NW.js → types-BK0blWhe.js} +3 -4
- package/dist/{types-CnWmj8NW.js.map → types-BK0blWhe.js.map} +1 -1
- package/dist/{types-CmXY0PQf.d.ts → types-C-aOqgt2.d.ts} +2 -5
- package/dist/types-C-aOqgt2.d.ts.map +1 -0
- package/dist/{types-M6eF9m-r.d.ts → types-C54Uk_a1.d.ts} +84 -24
- package/dist/types-C54Uk_a1.d.ts.map +1 -0
- package/dist/{types-BXgASBCL.js → types-DK4vNv5q.js} +2 -3
- package/dist/{types-BXgASBCL.js.map → types-DK4vNv5q.js.map} +1 -1
- package/dist/{types-6Lfdlshp.d.ts → types-DzCO-S1m.d.ts} +50 -62
- package/dist/types-DzCO-S1m.d.ts.map +1 -0
- package/dist/{verdict-BGQmxQ8A.js → verdict-C8TcdwfD.js} +3 -4
- package/dist/{verdict-BGQmxQ8A.js.map → verdict-C8TcdwfD.js.map} +1 -1
- package/dist/{verdict-C24NELtN.d.ts → verdict-D_qiBQ6_.d.ts} +1 -5
- package/dist/verdict-D_qiBQ6_.d.ts.map +1 -0
- package/dist/{verdict-cache-CL_7tePD.js → verdict-cache-BVH-fl18.js} +3 -4
- package/dist/{verdict-cache-CL_7tePD.js.map → verdict-cache-BVH-fl18.js.map} +1 -1
- package/dist/wire/index.d.ts +43 -51
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +1 -2
- package/docs/eval-surface-map.md +15 -0
- package/docs/rollout.md +132 -6
- package/package.json +18 -18
- package/dist/adversarial-smnADNFS.d.ts.map +0 -1
- package/dist/agent-profile-CNmwfaqq.d.ts.map +0 -1
- package/dist/agent-profile-cell-BcpFbNd5.d.ts.map +0 -1
- package/dist/analyze-runs-DfX6dHP0.d.ts.map +0 -1
- package/dist/attribute-vocabulary-CcXqHODT.d.ts.map +0 -1
- package/dist/benchmark-command-Cnjfo0Zh.js.map +0 -1
- package/dist/campaign-evidence-DunzcJGv.js.map +0 -1
- package/dist/campaign-uddTlFg5.js.map +0 -1
- package/dist/canonical-CFpojCN5.d.ts.map +0 -1
- package/dist/client-hwo3cJjR.d.ts.map +0 -1
- package/dist/completion-verifier-asaV1nSj.js.map +0 -1
- package/dist/cost-ledger-C1W3ICmP.d.ts.map +0 -1
- package/dist/dataset-DQqhOCPt.d.ts.map +0 -1
- package/dist/default-registry-CLG5YqGS.d.ts.map +0 -1
- package/dist/define-agent-eval-JKt3gMQr.d.ts.map +0 -1
- package/dist/descriptive-B2iPaT9J.d.ts +0 -89
- package/dist/descriptive-B2iPaT9J.d.ts.map +0 -1
- package/dist/descriptive-CVNy48rR.js.map +0 -1
- package/dist/emitter-DABYYTcH.d.ts.map +0 -1
- package/dist/engine-dtRVeuQs.d.ts.map +0 -1
- package/dist/errors-DEE6u6ot.d.ts.map +0 -1
- package/dist/evaluation-DblGquCB.d.ts.map +0 -1
- package/dist/exact-types-Do63KoKn.d.ts.map +0 -1
- package/dist/exporters-DWvM16LE.js.map +0 -1
- package/dist/exporters-Dk3oEbK_.d.ts.map +0 -1
- package/dist/failure-cluster-DN0t63Z0.d.ts.map +0 -1
- package/dist/feedback-trajectory-CYVJXolG.d.ts.map +0 -1
- package/dist/hf-dataset-CKxIJQba.js.map +0 -1
- package/dist/index-CHxwfW5g.d.ts.map +0 -1
- package/dist/index-CTIRz-AB.d.ts.map +0 -1
- package/dist/index-CalAsXMR.d.ts.map +0 -1
- package/dist/index-CdEVr8-O.d.ts.map +0 -1
- package/dist/index-CfJULcW5.d.ts.map +0 -1
- package/dist/index-D7fmC-1K.d.ts.map +0 -1
- package/dist/index-jnuFLxOs.d.ts.map +0 -1
- package/dist/integrity-D-s2iHiT.js.map +0 -1
- package/dist/integrity-D9lBnv_K.d.ts.map +0 -1
- package/dist/interval-ohuOJurX.d.ts.map +0 -1
- package/dist/judge-calibration-DFtEMlde.d.ts.map +0 -1
- package/dist/llm-judge-Cybq29bL.js.map +0 -1
- package/dist/lock-holder-DaJbfpci.d.ts.map +0 -1
- package/dist/matrix-B8l-Nsxd.js.map +0 -1
- package/dist/matrix-DtkZLD_3.d.ts.map +0 -1
- package/dist/mint-CkzpVPdz.d.ts +0 -81
- package/dist/mint-CkzpVPdz.d.ts.map +0 -1
- package/dist/multi-layer-verifier-DEgMUk6v.d.ts.map +0 -1
- package/dist/multiplicity-DIWHvysC.d.ts.map +0 -1
- package/dist/paired-promotion-decision-CQMJ5xGN.d.ts.map +0 -1
- package/dist/pareto-BiBnQXAE.js.map +0 -1
- package/dist/prime-bridge-transport-6feEglLf.d.ts.map +0 -1
- package/dist/prime-protocol-BGxjfhM4.d.ts.map +0 -1
- package/dist/promotion-gate-CkVZHagC.d.ts.map +0 -1
- package/dist/query-Cmv_U8vf.d.ts.map +0 -1
- package/dist/random-DGEyr3zG.d.ts.map +0 -1
- package/dist/redact-DXdlFb_U.d.ts.map +0 -1
- package/dist/registry-BcdJmyoU.d.ts.map +0 -1
- package/dist/release-confidence-CYIFH-fp.js.map +0 -1
- package/dist/render-BhJqXoBH.js.map +0 -1
- package/dist/researcher-DKWtoMWk.d.ts.map +0 -1
- package/dist/reward-BeUgVVC_.d.ts.map +0 -1
- package/dist/reward-hacking-WTxUbtbb.d.ts.map +0 -1
- package/dist/rollout-Dd1ucT_M.js.map +0 -1
- package/dist/rubric-predictive-validity-Cd5SCtAf.d.ts.map +0 -1
- package/dist/run-record-C3awiXPf.d.ts.map +0 -1
- package/dist/sandbox-harness-BlSOu4LX.d.ts.map +0 -1
- package/dist/schema-C-ziyJD7.d.ts.map +0 -1
- package/dist/schema-CvhfLjtZ.js.map +0 -1
- package/dist/schema-D6EVKzTB.d.ts.map +0 -1
- package/dist/search-kernel-CctpiDd2.d.ts.map +0 -1
- package/dist/search-ledger-types-p2xKfiDJ.d.ts.map +0 -1
- package/dist/sequential-KwGspfeR.d.ts.map +0 -1
- package/dist/spans-CVngGij3.d.ts.map +0 -1
- package/dist/statistical-heldout-BjzSOmLH.d.ts.map +0 -1
- package/dist/steps-DlepJPwD.d.ts.map +0 -1
- package/dist/store-B3nWRy3B.d.ts.map +0 -1
- package/dist/store-tool-spans-DxsFwtdr.d.ts.map +0 -1
- package/dist/summary-report-C8V49Jt3.d.ts.map +0 -1
- package/dist/summary-report-DHDWxe6p.js.map +0 -1
- package/dist/systemone-CHnqwmYg.d.ts.map +0 -1
- package/dist/systemone-protocol-Bl2EI2KQ.d.ts.map +0 -1
- package/dist/systemone-review-cQ9acAsb.d.ts.map +0 -1
- package/dist/terminal-record-CB9BFtjS.js.map +0 -1
- package/dist/tool-groups-b3oU_D88.d.ts.map +0 -1
- package/dist/tool-waste-CkjzWmeY.d.ts.map +0 -1
- package/dist/trace-questions-BmT8M6UQ.d.ts.map +0 -1
- package/dist/types-6Lfdlshp.d.ts.map +0 -1
- package/dist/types-B_IFcKp5.d.ts.map +0 -1
- package/dist/types-CmXY0PQf.d.ts.map +0 -1
- package/dist/types-DZ0mYVw9.d.ts.map +0 -1
- package/dist/types-M6eF9m-r.d.ts.map +0 -1
- package/dist/verdict-C24NELtN.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollout-nodes-BHR9Q5jP.js","names":["unhandled","str"],"sources":["../src/supervisor-run/journal-event-group.ts","../src/supervisor-run/types.ts","../src/supervisor-run/source-facts.ts","../src/supervisor-run/terminal-record.ts","../src/supervisor-run/rollout-nodes.ts"],"sourcesContent":["import { isRecord } from '../llm-client/json'\n\ntype ExpandedJournalRow =\n | { succeeded: true; value: readonly Record<string, unknown>[] }\n | { succeeded: false; error: string }\n\n/** Expand a committed group only after every member is readable; never recover its prefix. */\nexport function expandJournalEventGroup(row: Record<string, unknown>): ExpandedJournalRow {\n if (row.kind !== 'events') return { succeeded: true, value: [row] }\n if (typeof row.root !== 'string' || row.root.length === 0) {\n return { succeeded: false, error: 'root must be a non-empty string' }\n }\n if (!Array.isArray(row.events)) {\n return { succeeded: false, error: 'events must be an array' }\n }\n for (const [index, event] of row.events.entries()) {\n if (!isRecord(event)) {\n return { succeeded: false, error: `events[${index}] must be an object` }\n }\n if (typeof event.kind !== 'string' || event.kind.length === 0) {\n return { succeeded: false, error: `events[${index}].kind must be a non-empty string` }\n }\n }\n return {\n succeeded: true,\n value: row.events.map((event) => ({ kind: 'event', root: row.root, event })),\n }\n}\n","/**\n * Supervisor-run analysis — the multi-agent analogue of single-rollout trace\n * analysis. A solo rollout is one invocation with a transcript; a supervisor\n * run is a TREE of invocations (a brain that spawns, steers, and settles\n * workers) plus the event timeline that connects them. `src/trace-analyst`\n * answers \"what happened inside one session\"; this module answers \"what did\n * the tree do\" — did the brain steer anyone mid-task, how many spawn waves,\n * how concurrent, how idle, what did each role cost, what came back.\n *\n * The nodes of that tree are NOT a new shape: they are `tangle.rollout.v1`\n * rows (`src/rollout`), keyed by `parent_rollout_id`, with `role` already\n * spanning `supervisor` / `worker`. `supervisorRunRolloutLines` mints them.\n * What rollout rows deliberately do NOT carry is the inter-invocation event\n * timeline (spawn/settle/steer instants), which is what every structural\n * metric here is computed from — so the reader consumes the journal event\n * stream and emits rollout rows, rather than maintaining a parallel node type.\n *\n * ## UNAVAILABLE ≠ ZERO\n *\n * Every metric whose backing artifact can be missing is typed\n * `Measured<T> = T | { unavailable: reason }`. A supervisor that steered\n * nobody reports `steers: 0`; a supervisor whose worker logs were never\n * written reports `steers: unavailable — <reason>`. The two have driven\n * opposite conclusions about the same architecture, so they never collapse.\n */\n\nimport type { RolloutLine, RolloutWorkspaceCapture } from '../rollout/schema'\nimport type { SeriesDistribution } from '../statistics'\n\n// ---------------------------------------------------------------------------\n// Unavailable-aware metric type.\n// ---------------------------------------------------------------------------\n\n/** A metric that could not be computed, with the reason its artifact was missing. */\nexport interface Unavailable {\n readonly unavailable: string\n}\n\n/** A metric value, or the reason it is unknown. NEVER collapse `unavailable` to 0. */\nexport type Measured<T> = T | Unavailable\n\nexport function unavailable(reason: string): Unavailable {\n return { unavailable: reason }\n}\n\nexport function isUnavailable(v: unknown): v is Unavailable {\n return typeof v === 'object' && v !== null && typeof (v as Unavailable).unavailable === 'string'\n}\n\n/** Render a measured scalar for the markdown/headline: `0` and `unavailable` stay distinct. */\nexport function showMeasured(v: Measured<number | string | boolean | null>): string {\n if (isUnavailable(v)) return `unavailable — ${v.unavailable}`\n if (v === null) return 'null'\n return String(v)\n}\n\n// ---------------------------------------------------------------------------\n// Source contract — deliberately source-agnostic.\n// ---------------------------------------------------------------------------\n\n/** The two invocation roles a recursive supervision tree can contain. */\nexport type SupervisorRunNodeRole = 'supervisor' | 'worker'\n\n/** Turn-level transcript coverage for one worker. */\nexport interface WorkerTurnCoverage {\n readonly dispatched: number\n readonly retained: number\n}\n\n/** A native harness session receipt: the retained artifact, or the store's reason there is none. */\nexport type WorkerNativeSession =\n | {\n readonly status: 'available'\n readonly ref: string\n /** False when Runtime stored a partial copy (the session may continue past it). Absent on\n * receipts that do not say. */\n readonly coverageComplete?: boolean\n /** Stored files the harness writes its conversation to. Zero means the receipt holds other\n * native files only (a model cache, a config). Absent when the descriptor does not list\n * files or the harness has no known session layout. */\n readonly sessionFiles?: number\n }\n | { readonly status: 'unavailable'; readonly reason: string }\n\n/**\n * One worker's logs, as read. `null` means the artifact did not exist; `''`\n * means the artifact was captured and contained no rows.\n */\nexport interface WorkerLogSource {\n /**\n * Stable journal node id. Readers should set this whenever their source has\n * one; `label` remains the compatibility join for older stores.\n */\n readonly workerId?: string\n /** Human-readable task label. It is not required to be unique. */\n readonly label: string\n /** Worker event stream — started / progress / finished / message events (JSONL). */\n readonly events: string | null\n /** The durable steer queue — one line per steer request (JSONL). */\n readonly inbox: string | null\n /** Worker patch byte length, or null when absent. */\n readonly patchBytes: number | null\n /** Where this worker's transcript lives, for the rollout row. Null = no such artifact. */\n readonly transcriptRef?: string | null\n /**\n * Harness turns this worker dispatched, and how many left a retained output (the turn's own\n * event stream). A settled worker with fewer retained than dispatched lost those turns' record.\n * Null or absent = the store does not record turns.\n */\n readonly turns?: WorkerTurnCoverage | null\n /**\n * The store's receipt for this worker's native harness session: the harness's own session\n * files, which are the only record of what its native subagents did. Null or absent = the\n * store kept no receipt for this worker.\n */\n readonly nativeSession?: WorkerNativeSession | null\n /** Capture receipts in output order. Null means none were retained; absent means this reader has no channel. */\n readonly workspaceCaptures?: readonly RolloutWorkspaceCapture[] | null\n /** Where this worker's delivered patch lives. Null = the store keeps no patch per worker. */\n readonly patchPath?: string | null\n /** This worker's own inference tokens, when the store records them per worker. */\n readonly tokensIn?: number | null\n readonly tokensOut?: number | null\n readonly cacheRead?: number | null\n readonly cacheWrite?: number | null\n}\n\n/**\n * Facts a SOURCE structurally cannot express, each with the reason.\n *\n * The difference between \"the artifact is missing\" and \"this store never\n * records that fact\" is the difference between a run that spent $0 and a\n * harness that does not price inference — and the second harness is where a\n * store-specific assumption becomes a fabricated zero. A reader declares its\n * limits once; the analyzer reports `unavailable` for everything downstream.\n *\n * `null` on a field means the source DOES carry that fact.\n */\nexport interface SourceLimits {\n /** Reason manager input/output token totals are unavailable (null = recorded). */\n readonly managerTokens: string | null\n /** Reason worker input/output token totals are unavailable (null = recorded). */\n readonly workerTokens: string | null\n /** Reason inference spend has no price in this store (null = the store prices it). */\n readonly spendUsd: string | null\n /** Reason workers carry no pass/fail verdict (null = verdicts are recorded). */\n readonly workerVerdicts: string | null\n /** Reason no delivered artifact (patch/diff) is retained per worker (null = retained). */\n readonly deliverables: string | null\n}\n\n/** A source that carries every fact the analyzer can use. */\nexport const NO_SOURCE_LIMITS: SourceLimits = {\n managerTokens: null,\n workerTokens: null,\n spendUsd: null,\n workerVerdicts: null,\n deliverables: null,\n}\n\n/**\n * Everything the pure analyzer reads — already-read bytes, never paths. Each\n * field is `null` when its artifact was absent, which is what turns the\n * dependent metrics into `unavailable` rather than 0.\n *\n * This is the whole input contract. Any store that can produce these strings\n * (a Runtime run, an object-store archive, a database, or a test fixture) is a\n * valid source; the Runtime reader is one implementation.\n */\nexport interface SupervisorRunSources {\n /** Stable identity of the run being analyzed (a directory, a run id, a URL). */\n readonly runRef: string\n readonly instanceId: string | null\n /** Which arm/variant of a comparison this run is, when the run belongs to one. */\n readonly arm: string | null\n /** Identity of the supervision-tree store this was read from; null = none found. */\n readonly supRunDir: string | null\n /**\n * Supervision journal — spawned / settled / cancelled / metered events (JSONL).\n * Recursive readers put `role: 'supervisor' | 'worker'` on spawned rows;\n * settled `verdict` may be a string or `{ valid, score, ... }`.\n */\n readonly journal: string | null\n /**\n * Source-specific reason `journal` is null. The analyzer uses it verbatim as\n * the `unavailable` reason on every journal-dependent metric, so another\n * layout names its own journal file instead of inheriting a path assumption.\n */\n readonly journalMissingReason?: string\n /** Per-brain-call tap (JSONL): finish_reason, completion tokens, requested max tokens. */\n readonly brainLog: string | null\n /** Source-specific reason `brainLog` is absent. */\n readonly brainLogMissingReason?: string\n /** Supervisor state document (JSON). */\n readonly state: string | null\n /** Supervisor progress stream (JSONL). */\n readonly progress: string | null\n /** Per-worker logs; `null` = the worker log store itself was missing. */\n readonly workers: readonly WorkerLogSource[] | null\n /** Why `workers` is null (only set when it is). */\n readonly workersMissingReason: string | null\n /**\n * Runtime `result.json`, the `SupervisedResult` returned by `supervise()`.\n */\n readonly result: string | null\n /**\n * Runtime's terminal failure record (`failure.json`), written when\n * `supervise()` threw before a result landed. `null` = the store was read and\n * holds no such record; `undefined` = the store has no failure document.\n */\n readonly failure?: string | null\n /**\n * Judge verdict document (JSON), or the matching ledger row re-encoded as\n * one. Runners that write the verdict straight to a ledger leave no judge\n * document, so the ledger row is the same fact from the same run — not a\n * substitute measurement.\n */\n readonly judge: string | null\n /** Where `judge` came from, for the report's provenance line. */\n readonly judgeSource: string | null\n /** Delivered unified-diff patch text. */\n readonly patch: string | null\n /** Outer-driver log (used for the driver's steer verbs + deadline evidence). */\n readonly driverLog: string | null\n /**\n * Runtime `coordination-log.jsonl` (JSONL of `{ runId, seq, at, event }`):\n * questions, steers, answers and peer mail between nodes. Absent for stores\n * that keep no coordination log; null when the Runtime run dir has none.\n */\n readonly coordinationLog?: string | null\n /**\n * Worker tokens recovered from a harness session store; null = store unavailable.\n * `store` names the store in the report's provenance line (e.g. `opencode`).\n */\n readonly harnessWorkerTokens: {\n store: string\n sessions: number\n input: number\n output: number\n /** Cached prompt tokens, when the store counts them separately. */\n cacheRead?: number\n cacheWrite?: number\n } | null\n readonly harnessMissingReason: string | null\n /** What this store structurally cannot record. See `SourceLimits`. */\n readonly limits: SourceLimits\n /**\n * Where the ROOT invocation's transcript lives. Any store that does not\n * retain one must set this to `null`, or omit the path entirely.\n */\n readonly rootTranscriptRef?: string | null\n /** Root capture receipts in output order; null means no retained receipt. */\n readonly rootWorkspaceCaptures?: readonly RolloutWorkspaceCapture[] | null\n /**\n * The `traces` CLI command that covers this run's harness-session layer.\n * Null falls back to the analyzer's default (an opencode worker fleet).\n */\n readonly traceCommand: string | null\n}\n\n/**\n * A source of supervisor-run bytes. Implementations own their storage layout;\n * the analyzer only ever sees `SupervisorRunSources`.\n */\nexport interface SupervisorRunReader {\n /** Stable identity of what this reader points at (for logs and report labels). */\n readonly runRef: string\n read(): Promise<SupervisorRunSources>\n}\n\n// ---------------------------------------------------------------------------\n// Report shape.\n// ---------------------------------------------------------------------------\n\nexport const SUPERVISOR_RUN_SCHEMA = 'tangle.supervisor-run@1'\nexport const SUPERVISOR_RUN_ROLLUP_SCHEMA = 'tangle.supervisor-run-rollup@1'\n\nexport interface SteerBreakdown {\n /** Stable journal node id when the reader retained one. */\n readonly workerId: string | null\n readonly worker: string\n /** Steer requests durably queued to this worker's inbox. */\n readonly queued: number\n /** Steers the worker's executor actually accepted (control event `delivered:true`). */\n readonly delivered: number\n}\n\nexport interface OrchestrationMetrics {\n readonly workersSpawned: Measured<number>\n readonly workersSettled: Measured<number>\n readonly workersCancelled: Measured<number>\n /** THE HEADLINE: mid-task steers the brain sent to live workers. 0 ≠ unavailable. */\n readonly steers: Measured<number>\n readonly steersDelivered: Measured<number>\n readonly steersByWorker: Measured<readonly SteerBreakdown[]>\n /** Outer-driver `supervisor_steer` tool calls seen in the driver log (a second steer path). */\n readonly driverSteerCalls: Measured<number>\n /**\n * Spawn waves. A wave is a maximal run of worker spawns with no settle/cancel between\n * them: wave N+1 begins at the first spawn issued after at least one worker from an\n * earlier wave has settled. Structural, not a time threshold — no tunable constant.\n */\n readonly waves: Measured<number>\n readonly waveSizes: Measured<readonly number[]>\n readonly maxConcurrency: Measured<number>\n /** Direct-child spawns issued after that parent's first direct-child settlement. */\n readonly respawns: Measured<number>\n /** Labels spawned more than once by the same parent. */\n readonly repeatedLabels: Measured<readonly string[]>\n /** Longest parent chain below the root, in worker hops. */\n readonly delegationDepth: Measured<number>\n readonly timeToFirstSpawnMs: Measured<number>\n readonly supervisorWallMs: Measured<number>\n /**\n * Which measurement `supervisorWallMs` holds — never a silent substitution.\n * `stamps`: explicit start and completion stamps. `journal-span`: the start\n * stamp (or first stamped event) to the last stamped journal event — a\n * lower bound, derived when the store wrote no completion stamp. `idleMs`,\n * `idlePct`, and `workerUtilization` cover the same span. Unavailable\n * exactly when `supervisorWallMs` is, with the same reason.\n */\n readonly supervisorWallSource: Measured<'stamps' | 'journal-span'>\n /** Wall time inside the supervisor run with ZERO live workers. */\n readonly idleMs: Measured<number>\n readonly idlePct: Measured<number>\n /** sum(worker wall) / supervisor wall. >1 means real parallelism. */\n readonly workerUtilization: Measured<number>\n}\n\nexport interface DecisionMetrics {\n readonly settledByStatus: Measured<Record<string, number>>\n readonly settledVerdicts: Measured<Record<string, number>>\n /**\n * Workers whose recorded verdict was green. A store that retains a delivered patch also\n * requires patch bytes; a store that retains none accepts the verdict alone, because the\n * verdict IS the acceptance decision that store recorded. `emptyPass` — the split that\n * needs patch bytes — is what reads unavailable there.\n */\n readonly accepted: Measured<number>\n /** Worker settled with a failing verify. */\n readonly rejected: Measured<number>\n /** Worker verified green but delivered no patch bytes — output with nothing to accept. */\n readonly emptyPass: Measured<number>\n /** Direct-child settlements a parent observed before issuing its next direct-child spawn. */\n readonly observeThenRespawn: Measured<number>\n /** Parent-local respawns with no direct-child settlement in front of them. */\n readonly respawnWithoutEvidence: Measured<number>\n /** Steer + question traffic on the live down/up legs — the only \"review while running\" signal. */\n readonly reviewActions: Measured<number>\n readonly workerEvidenceBytes: Measured<number>\n}\n\nexport interface RoleSpend {\n readonly tokensIn: Measured<number>\n readonly tokensOut: Measured<number>\n /**\n * Cached prompt tokens read/written. On a harness that caches aggressively\n * these dwarf `tokensIn`, so a report that omits them understates the context\n * each invocation actually consumed. `unavailable` = the store has no such counter.\n */\n readonly cacheRead: Measured<number>\n readonly cacheWrite: Measured<number>\n readonly usd: Measured<number>\n readonly source: string\n}\n\nexport interface PerWorkerRow {\n /** Stable journal node id when the reader retained one. */\n readonly workerId: string | null\n readonly worker: string\n /** Explicit journal role after the worker source was joined to its spawn. */\n readonly role: SupervisorRunNodeRole | null\n /** Exact execution runtime tag from the spawn event. */\n readonly runtime: string | null\n /** Exact canonical AgentProfile digest from the spawn event. */\n readonly profileDigest: string | null\n /** Terminal lifecycle status exactly as recorded. */\n readonly status: string | null\n /** Terminal failure detail exactly as recorded. */\n readonly failure: string | null\n /** Runtime infrastructure classification, when recorded. */\n readonly infra: boolean | null\n readonly wallMs: number | null\n /** `null` = this store does not attribute tokens per worker (NOT \"zero tokens\"). */\n readonly tokensIn: number | null\n readonly tokensOut: number | null\n readonly usd: number | null\n readonly patchBytes: number | null\n readonly passed: boolean | null\n /** Numeric verdict score exactly as recorded; null means no score was recorded. */\n readonly score: number | null\n /** Exact Runtime capture receipts in journal order; null means capture evidence is unknown. */\n readonly workspaceCaptures: readonly RolloutWorkspaceCapture[] | null\n}\n\n/**\n * `SeriesDistribution` (from `../statistics`) over per-worker wall\n * milliseconds. The fold itself is `summarizeNumberSeries`, exported for any\n * series — fleet wall medians, tokens-per-claim spreads — not only wall.\n */\nexport type WallDistribution = SeriesDistribution\n\n/** One spend measurement and the number of source records behind it. */\nexport interface SpendMeasurement {\n readonly usd: Measured<number>\n /** Source records folded into `usd`; 0 when the measurement is unavailable. */\n readonly records: number\n /**\n * Records the store wrote with `usdKnown: false` — work that HAPPENED at a price the\n * provider never reported. Those records are NOT folded into `usd`, so a run with any\n * of them has a `usd` that is a floor on real spend, never the measured total. Dropping\n * the whole channel instead would discard the records that DID carry a price.\n */\n readonly unknownRecords: number\n /** True exactly when `unknownRecords > 0`: `usd` covers some of the run, not all of it. */\n readonly partial: boolean\n /** Node ids behind `unknownRecords`, in journal order. Empty when none. */\n readonly unknownNodes: readonly string[]\n}\n\n/**\n * The run's total inference spend, measured two ways.\n *\n * `closeRecord` is the spend the store recorded as settled when the run\n * closed (`result.json` `spentTotal.usd`) — the billing-shaped answer. `journalDerived` is the\n * spend execution observably consumed (journal `metered` + `settled` rows) —\n * the execution-accounting answer. Neither is canonical for the other's\n * question. The two cover different records at different moments, so\n * divergence between them is itself a signal (a dropped settlement, a\n * double meter, spend after the close) — read it, never average it away.\n */\nexport interface SpendMeasurements {\n readonly journalDerived: SpendMeasurement\n readonly closeRecord: SpendMeasurement\n}\n\n/** One source receipt; unknown amounts remain lower bounds when known is false. */\nexport interface NamedResourceReceipt {\n readonly name: Measured<string>\n readonly unit: Measured<string>\n readonly amount: Measured<number>\n readonly known: Measured<boolean>\n}\n\n/** Recorded spend evidence. Inclusive parent and child records must not be summed together. */\nexport interface ResourceSpendRecord {\n readonly nodeId: string | null\n readonly source: string\n readonly kind: 'metered' | 'settled' | 'cancelled' | 'result'\n readonly resources: Measured<readonly NamedResourceReceipt[]>\n}\n\nexport interface EconomicsMetrics {\n /** Per-journal-record resource receipts, without cross-node aggregation. */\n readonly resourceRecords?: Measured<readonly ResourceSpendRecord[]>\n /** Driver/brain inference — journal `metered` events. */\n readonly brain: RoleSpend\n /**\n * Brain completions that came back `finish_reason: \"length\"` — output TRUNCATED. Any value\n * above 0 means the supervisor planned into a wall and then acted on the half-written plan,\n * which is a defect and not a cost figure. The journal's `metered` rows carry token counts\n * but no finish reason, so this reads the per-call brain tap; a run whose supervisor\n * predates that tap reports `unavailable`, never 0.\n */\n readonly brainTruncations: Measured<number>\n /** Worker inference — journal `settled` spend plus the harness session join. */\n readonly workers: RoleSpend\n /** Both total-spend measurements, each with its own record count. */\n readonly spend: SpendMeasurements\n /**\n * One collapsed number kept for existing consumers: the close record when\n * the store wrote one, else the journal-derived sum. `totalUsdSource` names\n * the pick, and says so when the number is a partial floor because some\n * records carried `usdKnown: false`. Prefer `spend` — the collapse hides\n * which accounting question the number answers and how much of it is priced.\n */\n readonly totalUsd: Measured<number>\n /**\n * Where `totalUsd` came from. CLI-backend workers never price their own inference into\n * the journal, so on those arms the total is BRAIN-ONLY and the worker row's token\n * counts (recovered from the harness store) are the honest worker-side figure.\n */\n readonly totalUsdSource: string\n readonly costPerAcceptedPatchUsd: Measured<number>\n readonly workerWallMsDistribution: Measured<WallDistribution>\n readonly perWorker: Measured<readonly PerWorkerRow[]>\n}\n\nexport interface PatchStats {\n readonly files: number\n readonly linesAdded: number\n readonly linesRemoved: number\n readonly testFilesTouched: readonly string[]\n}\n\n/** Which record a run's terminal status was read from, so no source is a silent substitution. */\nexport type SupervisorStatusSource =\n /** Runtime's `result.json` `kind`: the `SupervisedResult` discriminant, read verbatim. */\n | 'runtime-result'\n /** Runtime's `failure.json`: `supervise()` threw before a result landed. */\n | 'runtime-failure'\n\n/** The error a run directory recorded. */\nexport interface TerminalFailure {\n /**\n * Which record carried the error: Runtime's `failure.json`, or the driver\n * rejection inside a `driver-failed` no-winner `result.json`.\n */\n readonly source: 'runtime-failure' | 'runtime-result'\n /** `error.name` exactly as recorded; null when the record has none. */\n readonly name: string | null\n /** `error.message` exactly as recorded; null when the record has none. */\n readonly message: string | null\n /** ISO timestamp the record carries; null when it carries none. */\n readonly at: string | null\n /**\n * True when the directory also holds a settled `result.json`. Runtime writes\n * `failure.json` only when `supervise()` threw, never after a settle, and\n * refuses to re-enter a settled directory, so a failure beside a result is\n * the throw of an earlier attempt that a later attempt outlived. The status\n * is the settled result's; this record explains the retry, not the outcome.\n */\n readonly earlierAttempt: boolean\n}\n\nexport interface OutcomeMetrics {\n /**\n * The run's terminal status, exactly as its Runtime record spells it:\n * `winner` / `no-winner`, or `failed` for a Runtime failure record.\n * `supStatusSource` names the record it came from.\n */\n readonly supStatus: Measured<string>\n readonly supStatusSource: Measured<SupervisorStatusSource>\n /**\n * Runtime's `reason` on a `no-winner` result (`all-children-down`,\n * `budget-exhausted`, `aborted`, `driver-failed`). `null` = the terminal\n * record carries no reason (a winner or a failure record).\n */\n readonly supReason: Measured<string | null>\n /**\n * The recorded error: Runtime's `failure.json`, or the driver rejection a\n * `driver-failed` no-winner carries. `null` = the run recorded a result and\n * no error. A `failure.json` beside a settled result is reported with\n * `earlierAttempt: true`. Unavailable when the store has no terminal record.\n */\n readonly failure: Measured<TerminalFailure | null>\n readonly supVerdict: Measured<string>\n readonly delivered: Measured<boolean>\n readonly judgeResolved: Measured<boolean | null>\n readonly judgeScore: Measured<number | null>\n readonly judgePassed: Measured<number | null>\n readonly judgeTotal: Measured<number | null>\n readonly verifyPass: Measured<boolean>\n readonly verifyRc: Measured<number>\n readonly patch: Measured<PatchStats>\n /** Which document the judge fields came from (a judge file, a ledger row, or nothing). */\n readonly judgeSource: string | null\n}\n\nexport interface SupervisorRunReport {\n readonly schema: typeof SUPERVISOR_RUN_SCHEMA\n /** The `runRef` of the sources this report was computed from. */\n readonly runRef: string\n readonly instanceId: string | null\n readonly arm: string | null\n readonly supervisorId: Measured<string>\n readonly supervisorProfileDigest: Measured<string>\n readonly generatedAt: string\n readonly orchestration: OrchestrationMetrics\n readonly decision: DecisionMetrics\n readonly economics: EconomicsMetrics\n readonly outcome: OutcomeMetrics\n /** Exact root capture receipts; null means capture evidence is unknown. */\n readonly rootWorkspaceCaptures: readonly RolloutWorkspaceCapture[] | null\n /** Artifacts that were missing, in read order — the provenance of every `unavailable`. */\n readonly gaps: readonly string[]\n /** The `traces` CLI command that covers the harness-session layer for this run. */\n readonly traceCommand: string\n}\n\nexport interface RollupCellRow {\n /** Per-source receipts remain attached to their comparison cell. */\n readonly resourceRecords?: Measured<readonly ResourceSpendRecord[]>\n readonly instanceId: string | null\n readonly arm: string | null\n readonly steers: Measured<number>\n readonly waves: Measured<number>\n readonly utilization: Measured<number>\n readonly idlePct: Measured<number>\n readonly resolved: Measured<boolean | null>\n readonly usd: Measured<number>\n}\n\nexport interface SupervisorRunRollup {\n readonly schema: typeof SUPERVISOR_RUN_ROLLUP_SCHEMA\n readonly cells: number\n readonly steersTotal: Measured<number>\n readonly cellsWithSteers: Measured<number>\n readonly cellsWithUnavailableSteers: number\n readonly wavesMean: Measured<number>\n readonly maxConcurrencyMax: Measured<number>\n readonly utilizationMean: Measured<number>\n readonly idlePctMean: Measured<number>\n readonly workersSpawnedTotal: Measured<number>\n readonly acceptedTotal: Measured<number>\n /**\n * Sum of the per-run collapsed `totalUsd`. Prefer `spendUsd`: this total\n * mixes close-record and journal-derived cells without saying which.\n */\n readonly usdTotal: Measured<number>\n /**\n * Fleet spend measured two ways. `runs` is each measurement's own\n * denominator — the cells where that measurement was available. The two\n * sums cover different run sets, so comparing the values without their\n * denominators manufactures a phantom divergence.\n */\n readonly spendUsd: {\n readonly journalDerived: { readonly value: Measured<number>; readonly runs: number }\n readonly closeRecord: { readonly value: Measured<number>; readonly runs: number }\n }\n readonly resolvedCount: Measured<number>\n readonly perCell: readonly RollupCellRow[]\n}\n\n/**\n * A supervision tree expressed in the canonical rollout row type: one\n * `RolloutLine` per invocation, joined by `parent_rollout_id`. The root row\n * carries `role: 'supervisor'`; nested supervisors retain that role and leaf\n * invocations carry `role: 'worker'`.\n */\nexport interface SupervisorRunTree {\n readonly rootId: string | null\n readonly nodes: readonly RolloutLine[]\n /** Typed reasons a rollout field could not be recovered, in read order. */\n readonly gaps: readonly SupervisorRunTreeGap[]\n}\n\n/** Stable machine-readable reasons emitted while minting a supervisor tree. */\nexport type SupervisorRunTreeGapCode =\n | 'journal-unavailable'\n | 'source-row-malformed'\n | 'root-spawn-unavailable'\n | 'root-reward-unavailable'\n | 'child-reward-unavailable'\n | 'node-role-unavailable'\n | 'workspace-capture-unavailable'\n | 'workspace-capture-incomplete'\n | 'node-schema-invalid'\n\nexport interface SupervisorRunTreeGap {\n readonly code: SupervisorRunTreeGapCode\n readonly message: string\n readonly nodeId?: string\n readonly count?: number\n}\n","import { expandJournalEventGroup } from './journal-event-group'\nimport {\n type Measured,\n type NamedResourceReceipt,\n type ResourceSpendRecord,\n type SupervisorRunNodeRole,\n type SupervisorRunSources,\n unavailable,\n} from './types'\n\n// ---------------------------------------------------------------------------\n// Journal shapes — structurally parsed. The journal is the contract, not the type.\n// ---------------------------------------------------------------------------\n\ninterface JournalEvent {\n kind?: unknown\n id?: unknown\n parent?: unknown\n label?: unknown\n role?: unknown\n profileDigest?: unknown\n runtime?: unknown\n status?: unknown\n verdict?: unknown\n reason?: unknown\n infra?: unknown\n seq?: unknown\n at?: unknown\n spend?: unknown\n spent?: unknown\n}\n\ninterface Tokens {\n input: number\n output: number\n cacheRead: number\n cacheWrite: number\n /** False when the event carried no cache counters at all — not \"zero cached\". */\n hasCache: boolean\n /**\n * False only when the record carried `cacheBreakdownKnown: false` — Runtime's mark for a\n * provider that reported a total without splitting cache reads from cache writes. The\n * counters that ARE present are then a partial split, never a measured \"zero cached\".\n */\n breakdownKnown: boolean\n}\n\ninterface SpendLike {\n readonly resources?: Measured<readonly NamedResourceReceipt[]>\n tokens: Tokens\n /**\n * False only when the record carried `tokensKnown: false` — Runtime's mark for work that\n * HAPPENED with an unreported token count. `tokens` then holds the known subtotal (often\n * zero), never the measured total. An absent flag means the record is complete.\n */\n tokensKnown: boolean\n usd: number\n /**\n * False only when the record carried `usdKnown: false` — work that HAPPENED at a price the\n * provider never reported. `usd` then holds a catalog estimate or zero, never a measured\n * price. An absent flag means the record is complete.\n */\n usdKnown: boolean\n}\n\nexport function asRecord(v: unknown): Record<string, unknown> {\n return typeof v === 'object' && v !== null ? (v as Record<string, unknown>) : {}\n}\n\nfunction num(v: unknown): number {\n return typeof v === 'number' && Number.isFinite(v) ? v : 0\n}\n\nfunction readResources(value: unknown): Measured<readonly NamedResourceReceipt[]> {\n if (value === undefined) return unavailable('resource map not recorded')\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n return unavailable('resource map is malformed')\n }\n return Object.entries(value).map(([name, raw]) => {\n const entry = asRecord(raw)\n return {\n name: name.trim() ? name : unavailable('resource name is empty'),\n unit:\n typeof entry.unit === 'string' && entry.unit.trim()\n ? entry.unit\n : unavailable('resource unit is missing or invalid'),\n amount:\n typeof entry.amount === 'number' && Number.isFinite(entry.amount) && entry.amount >= 0\n ? entry.amount\n : unavailable('resource amount is missing or invalid'),\n known:\n typeof entry.known === 'boolean'\n ? entry.known\n : unavailable('resource completeness is missing or invalid'),\n }\n })\n}\n\nfunction readSpend(v: unknown): SpendLike {\n const rec = asRecord(v)\n const tok = asRecord(rec.tokens)\n const cacheRead = tok.cacheRead ?? tok.cache_read\n const cacheWrite = tok.cacheWrite ?? tok.cache_write\n return {\n tokens: {\n input: num(tok.input),\n output: num(tok.output),\n cacheRead: num(cacheRead),\n cacheWrite: num(cacheWrite),\n hasCache: cacheRead !== undefined || cacheWrite !== undefined,\n breakdownKnown: tok.cacheBreakdownKnown !== false,\n },\n resources: readResources(rec.resources),\n tokensKnown: rec.tokensKnown !== false,\n usd: num(rec.usd),\n usdKnown: rec.usdKnown !== false,\n }\n}\n\nexport function parseJsonl(text: string | null): Record<string, unknown>[] {\n return parseJsonlWithDiagnostics(text).rows\n}\n\ninterface ParsedJsonl {\n readonly rows: Record<string, unknown>[]\n readonly invalidRows: number\n}\n\nfunction parseJsonlWithDiagnostics(text: string | null): ParsedJsonl {\n if (text === null) return { rows: [], invalidRows: 0 }\n const out: Record<string, unknown>[] = []\n let invalidRows = 0\n for (const line of text.split('\\n')) {\n const trimmed = line.trim()\n if (!trimmed) continue\n try {\n const parsed: unknown = JSON.parse(trimmed)\n if (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)) {\n out.push(parsed as Record<string, unknown>)\n } else {\n invalidRows += 1\n }\n } catch {\n invalidRows += 1\n }\n }\n return { rows: out, invalidRows }\n}\n\nexport function parseJsonRecord(text: string | null): Record<string, unknown> | null {\n if (text === null) return null\n try {\n const parsed: unknown = JSON.parse(text)\n return typeof parsed === 'object' && parsed !== null\n ? (parsed as Record<string, unknown>)\n : null\n } catch {\n return null\n }\n}\n\nfunction ms(at: unknown): number | null {\n if (typeof at !== 'string') return null\n const t = Date.parse(at)\n return Number.isFinite(t) ? t : null\n}\n\n// ---------------------------------------------------------------------------\n// The supervision tree, as parsed from the journal event stream.\n// ---------------------------------------------------------------------------\n\nexport interface SpawnRow {\n /** Zero-based row among parsed journal objects. */\n sourceRow: number\n id: string\n parent: string | null\n label: string\n /** Null when the source did not explicitly record a role. */\n role: SupervisorRunNodeRole | null\n /** Exact canonical AgentProfile digest, when the source recorded one. */\n profileDigest: string | null\n /** Exact execution runtime tag, when the source recorded one. */\n runtime: string | null\n at: number | null\n /** False when identity, parentage, label, or role was malformed. */\n valid: boolean\n invalidFields: readonly string[]\n}\n\nexport interface CloseRow {\n id: string\n kind: 'settled' | 'cancelled'\n status: string | null\n /** String verdict from flat journals, or valid/invalid for a structured verdict. */\n verdict: string | null\n /** Structured verdict validity, when recorded. */\n valid: boolean | null\n /** Structured verdict score, preserved without boolean coercion. */\n score: number | null\n /** The verdict exactly as the journal carried it. */\n rawVerdict: unknown | null\n /** Terminal failure detail exactly as recorded. */\n reason: string | null\n /** Whether Runtime classified the failure as infrastructure-caused. */\n infra: boolean | null\n at: number | null\n spend: SpendLike\n /** False when the close event carried no spend object — not \"spent nothing\". */\n hasSpend: boolean\n}\n\nexport interface WorkerLogFacts {\n /** Position in `SupervisorRunSources.workers`, retained for exact evidence paths. */\n sourceIndex: number\n workerId: string | null\n label: string\n /** `false` means the artifact was missing; a captured empty artifact is `true`. */\n inboxCaptured: boolean\n eventsCaptured: boolean\n inboxInvalidRows: number\n eventsInvalidRows: number\n started: number | null\n /** True once a `finished` event was seen — independent of whether its `at` parsed. */\n finished: boolean\n finishedAt: number | null\n passed: boolean | null\n /** Numeric score exactly as the finished event recorded it. */\n score: number | null\n /** `patchBytes` as reported by the finished event (not the patch file's size). */\n finishedPatchBytes: number | null\n evidenceBytes: number\n /** Unique queued request ids, or null when exact accounting is unavailable. */\n steersQueued: number | null\n /** Unique matched request ids acknowledged as delivered, or null when unavailable. */\n steersDelivered: number | null\n steersQueuedUnavailable: string | null\n steersDeliveredUnavailable: string | null\n questions: number\n steerRequests: SteerRequestFact[]\n steerAcknowledgements: SteerAcknowledgementFact[]\n}\n\nexport interface SteerRequestFact {\n /** Durable inbox request id; null when the row did not retain one. */\n requestId: string | null\n row: number\n}\n\nexport interface SteerAcknowledgementFact {\n /** Worker event request id; null when the event cannot be correlated. */\n requestId: string | null\n /** `null` means the acknowledgement omitted delivery status. */\n delivered: boolean | null\n row: number\n}\n\n/**\n * The tree + timeline the report is computed from, exposed because the rollout-row\n * minter needs exactly the same parse (one parser, two consumers).\n */\nexport interface SupervisorTreeFacts {\n readonly resourceRecords?: readonly ResourceSpendRecord[]\n readonly rootId: string | null\n readonly spawns: readonly SpawnRow[]\n readonly closes: readonly CloseRow[]\n readonly workerSpawns: readonly SpawnRow[]\n readonly workerCloses: readonly CloseRow[]\n readonly brain: {\n /**\n * Summed over the root's metered rows that reported a token count. A row Runtime marked\n * `tokensKnown: false` is EXCLUDED and counted in `tokensUnknownCount` instead, because\n * its `tokens` field holds a known subtotal — folding it in would price unreported work\n * at zero tokens.\n */\n tokensIn: number\n tokensOut: number\n cacheRead: number\n cacheWrite: number\n /** False when no metered event carried cache counters — not \"nothing cached\". */\n hasCache: boolean\n /** False when any folded metered row declared `cacheBreakdownKnown: false`. */\n cacheBreakdownKnown: boolean\n /** Root metered rows that reported a token count, and rows that did not. */\n tokensKnownCount: number\n tokensUnknownCount: number\n /** Summed over the root's metered rows that reported a price, on the same rule. */\n usd: number\n /** Root metered rows that reported a price, and rows Runtime marked `usdKnown: false`. */\n usdKnownCount: number\n usdUnknownCount: number\n /** Root-attributed metered events only — every row this object folded or counted. */\n meteredCount: number\n }\n readonly workerLogs: ReadonlyMap<string, WorkerLogFacts>\n /** Every worker source row, including duplicate identities that a map cannot retain. */\n readonly workerLogRows: readonly WorkerLogFacts[]\n /** Every non-empty input journal line; a group occupies one line regardless of its size. */\n readonly journalRows: number\n /**\n * Journal lines this parser could not interpret at all: invalid JSON, non-objects, and\n * JSON objects carrying no record shape it recognizes.\n *\n * This count is what separates \"the run was empty\" from \"the input was unreadable\".\n * Zero spawns with zero invalid rows is a positive claim that nothing happened; it must\n * only ever be made about bytes the parser actually understood.\n */\n readonly journalInvalidRows: number\n /** The `journalInvalidRows` subset that was not valid JSON, or not a JSON object. */\n readonly journalMalformedJsonRows: number\n /**\n * Records recognized but deliberately not folded into the tree, counted by kind — the\n * runtime envelope's `begin` header and the `waiting` / `woken` wait-node events. Kept\n * separate from `journalInvalidRows` because these rows were understood, not rejected.\n */\n readonly journalIgnoredRowsByKind: Readonly<Record<string, number>>\n /**\n * Every metered event read, root-attributed or not. `brain.meteredCount` covers only the\n * root's own spend; a nested driver's metered rows are understood but reach this tree\n * through that driver's settled close. Event counters count each group member, while\n * journalRows and journalInvalidRows count input lines. Without groups, journalRows equals\n * spawns + closes + journalMeteredRows + ignored + journalInvalidRows.\n */\n readonly journalMeteredRows: number\n /** Which dialect(s) the journal's rows were actually written in. */\n readonly journalDialect: SupervisorJournalDialect\n /** Parsed once with the journal and worker artifacts. */\n readonly state: Record<string, unknown> | null\n readonly startedAt: number | null\n readonly completedAt: number | null\n /**\n * First and last stamped tree events (spawned / settled / cancelled /\n * metered) in the journal — the bounds of observed activity. They derive a\n * lower-bound wall for a store that writes no completion stamp.\n */\n readonly firstEventAt: number | null\n readonly lastEventAt: number | null\n}\n\ninterface VerdictFacts {\n label: string | null\n valid: boolean | null\n score: number | null\n raw: unknown | null\n}\n\nfunction readVerdict(v: unknown): VerdictFacts {\n if (typeof v === 'string') return { label: v, valid: null, score: null, raw: v }\n if (typeof v !== 'object' || v === null) {\n return { label: null, valid: null, score: null, raw: null }\n }\n const rec = v as Record<string, unknown>\n const valid = typeof rec.valid === 'boolean' ? rec.valid : null\n return {\n label: valid === null ? null : valid ? 'valid' : 'invalid',\n valid,\n score: typeof rec.score === 'number' && Number.isFinite(rec.score) ? rec.score : null,\n raw: v,\n }\n}\n\nexport function workerSourceKey(\n worker: NonNullable<SupervisorRunSources['workers']>[number],\n): string {\n return worker.workerId ?? worker.label\n}\n\n// ---------------------------------------------------------------------------\n// Journal dialects — the two shapes a supervision journal is actually written in.\n// ---------------------------------------------------------------------------\n\n/**\n * How a journal's rows were shaped on disk.\n *\n * `flat` — one event object per line (`{kind:'spawned', id, ...}`). Claude Code\n * and other adapters may synthesize this shape for the pure analyzer.\n *\n * `runtime-envelope` — the records `agent-runtime`'s `FileSpawnJournal` writes:\n * a `{kind:'begin', root, at}` header followed by `{kind:'event', root, event}`\n * or atomic `{kind:'events', root, events:[...]}` envelopes. It is\n * the layout `createFileRunContext(dir)` produces at `<dir>/spawn-journal.jsonl`.\n * This dialect is READ, not tolerated: agent-runtime is the writer, so a reader\n * that could not interpret it was the defect, and `journalDialect` records which\n * shape the bytes actually had so an unexpected one is never invisible.\n *\n * `mixed` — rows of both shapes in one file. `none` — no interpretable row at all.\n */\nexport type SupervisorJournalDialect = 'none' | 'flat' | 'runtime-envelope' | 'mixed'\n\ntype JournalRowDialect = 'flat' | 'runtime-envelope'\n\n/** Event kinds this parser folds into the tree. */\nconst TREE_EVENT_KINDS = ['spawned', 'settled', 'cancelled', 'metered'] as const\ntype TreeEventKind = (typeof TREE_EVENT_KINDS)[number]\n\n/**\n * Event kinds `agent-runtime` journals that this parser recognizes but does not model as\n * tree nodes: `waiting` arms a wait node and `woken` settles it. They are counted by kind\n * rather than dropped, so \"understood, not modeled\" can never be mistaken for \"absent\".\n */\nconst UNMODELLED_EVENT_KINDS: readonly string[] = ['waiting', 'woken']\n\nfunction treeEventKind(value: unknown): TreeEventKind | null {\n return (TREE_EVENT_KINDS as readonly unknown[]).includes(value) ? (value as TreeEventKind) : null\n}\n\ntype JournalRowReading =\n | {\n outcome: 'event'\n dialect: JournalRowDialect\n kind: TreeEventKind\n event: JournalEvent\n }\n | { outcome: 'ignored'; dialect: JournalRowDialect; kind: string }\n | { outcome: 'unreadable' }\n\n/**\n * Classify one parsed journal row. Every row lands in exactly one outcome — interpreted,\n * recognized-but-not-modeled, or unreadable — because a row that falls through silently is\n * how a run with events reads as a run with none.\n */\nfunction readJournalRow(row: Record<string, unknown>): JournalRowReading {\n const kind = row.kind\n if (typeof kind !== 'string') return { outcome: 'unreadable' }\n\n // agent-runtime's FileSpawnJournal record header. It carries no event.\n if (kind === 'begin' && typeof row.root === 'string') {\n return { outcome: 'ignored', dialect: 'runtime-envelope', kind: 'begin' }\n }\n if (kind === 'event') {\n const inner = row.event\n if (typeof inner !== 'object' || inner === null || Array.isArray(inner)) {\n return { outcome: 'unreadable' }\n }\n const innerKind = (inner as Record<string, unknown>).kind\n if (typeof innerKind !== 'string') return { outcome: 'unreadable' }\n const tree = treeEventKind(innerKind)\n if (tree !== null) {\n return {\n outcome: 'event',\n dialect: 'runtime-envelope',\n kind: tree,\n event: inner as JournalEvent,\n }\n }\n // The envelope proves this IS a journaled event, so an unmodelled kind is recorded by\n // name rather than called unreadable — the caller sees exactly what went uncounted.\n return { outcome: 'ignored', dialect: 'runtime-envelope', kind: innerKind }\n }\n\n const tree = treeEventKind(kind)\n if (tree !== null) {\n return { outcome: 'event', dialect: 'flat', kind: tree, event: row as JournalEvent }\n }\n if (UNMODELLED_EVENT_KINDS.includes(kind)) {\n return { outcome: 'ignored', dialect: 'flat', kind }\n }\n // A bare object with an unknown `kind` could be any record at all — unlike the envelope\n // case there is no evidence it is a journal event, so it counts as unreadable (fail closed).\n return { outcome: 'unreadable' }\n}\n\nfunction summarizeDialect(seen: ReadonlySet<JournalRowDialect>): SupervisorJournalDialect {\n if (seen.size === 0) return 'none'\n if (seen.size > 1) return 'mixed'\n return seen.has('runtime-envelope') ? 'runtime-envelope' : 'flat'\n}\n\n/** One spawned event as a row; a field that is present but unusable marks the row invalid. */\nfunction spawnRowOf(\n ev: JournalEvent,\n id: string,\n sourceRow: number,\n rootId: string | null,\n): SpawnRow {\n const parent = typeof ev.parent === 'string' && ev.parent.length > 0 ? ev.parent : null\n const label = typeof ev.label === 'string' ? ev.label : ''\n const invalidFields: string[] = []\n if (id.length === 0) invalidFields.push('id')\n const parentOmittedForFirstRoot = ev.parent === undefined && rootId === null\n if (\n ev.parent !== null &&\n !parentOmittedForFirstRoot &&\n !(typeof ev.parent === 'string' && ev.parent.length > 0)\n ) {\n invalidFields.push('parent')\n }\n if (label.length === 0) invalidFields.push('label')\n if (ev.role !== undefined && ev.role !== 'supervisor' && ev.role !== 'worker') {\n invalidFields.push('role')\n }\n if (\n ev.profileDigest !== undefined &&\n !(typeof ev.profileDigest === 'string' && ev.profileDigest.length > 0)\n ) {\n invalidFields.push('profileDigest')\n }\n if (ev.runtime !== undefined && !(typeof ev.runtime === 'string' && ev.runtime.length > 0)) {\n invalidFields.push('runtime')\n }\n const role: SupervisorRunNodeRole | null =\n ev.role === 'supervisor' || ev.role === 'worker' ? ev.role : null\n const valid = invalidFields.length === 0\n if (valid && parent === null && rootId === null) rootId = id\n return {\n sourceRow,\n id,\n parent,\n label,\n role,\n profileDigest:\n typeof ev.profileDigest === 'string' && ev.profileDigest.length > 0 ? ev.profileDigest : null,\n runtime: typeof ev.runtime === 'string' && ev.runtime.length > 0 ? ev.runtime : null,\n at: ms(ev.at),\n valid,\n invalidFields,\n }\n}\n\n/** A settled event as a close row, with its verdict and spend. */\nfunction settledCloseOf(ev: JournalEvent, id: string): CloseRow {\n const verdict = readVerdict(ev.verdict)\n return {\n id,\n kind: 'settled',\n status: typeof ev.status === 'string' ? ev.status : null,\n verdict: verdict.label,\n valid: verdict.valid,\n score: verdict.score,\n rawVerdict: verdict.raw,\n reason: typeof ev.reason === 'string' ? ev.reason : null,\n infra: typeof ev.infra === 'boolean' ? ev.infra : null,\n at: ms(ev.at),\n spend: readSpend(ev.spent),\n hasSpend: asRecord(ev.spent).tokens !== undefined,\n }\n}\n\n/** A cancelled event as a close row: it carries no verdict and no spend. */\nfunction cancelledCloseOf(ev: JournalEvent, id: string): CloseRow {\n return {\n id,\n kind: 'cancelled',\n status: 'cancelled',\n verdict: typeof ev.reason === 'string' ? ev.reason : null,\n valid: null,\n score: null,\n rawVerdict: typeof ev.reason === 'string' ? ev.reason : null,\n reason: typeof ev.reason === 'string' ? ev.reason : null,\n infra: null,\n at: ms(ev.at),\n spend: {\n tokens: {\n input: 0,\n output: 0,\n cacheRead: 0,\n cacheWrite: 0,\n hasCache: false,\n breakdownKnown: true,\n },\n tokensKnown: true,\n usd: 0,\n usdKnown: true,\n },\n hasSpend: false,\n }\n}\n\n/** What the journal rows add up to: spawn and close rows, the root, and the rows set aside. */\ninterface JournalReading {\n spawns: SpawnRow[]\n closes: CloseRow[]\n rootId: string | null\n unreadableRows: number\n ignoredByKind: Map<string, number>\n dialectsSeen: Set<JournalRowDialect>\n resourceRecords: ResourceSpendRecord[]\n meteredRows: Array<{ id: string; spend: SpendLike; at: number | null }>\n}\n\nfunction readJournal(events: Record<string, unknown>[]): JournalReading {\n const spawns: SpawnRow[] = []\n const closes: CloseRow[] = []\n let rootId: string | null = null\n let unreadableRows = 0\n const ignoredByKind = new Map<string, number>()\n const dialectsSeen = new Set<JournalRowDialect>()\n const resourceRecords: ResourceSpendRecord[] = []\n const meteredRows: Array<{ id: string; spend: SpendLike; at: number | null }> = []\n for (const [sourceRow, row] of events.entries()) {\n const expanded = expandJournalEventGroup(row)\n if (!expanded.succeeded) {\n unreadableRows += 1\n continue\n }\n if (expanded.value.length === 0) {\n dialectsSeen.add('runtime-envelope')\n ignoredByKind.set('events', (ignoredByKind.get('events') ?? 0) + 1)\n }\n for (const [eventIndex, eventRow] of expanded.value.entries()) {\n const reading = readJournalRow(eventRow)\n if (reading.outcome === 'unreadable') {\n unreadableRows += 1\n continue\n }\n dialectsSeen.add(reading.dialect)\n if (reading.outcome === 'ignored') {\n ignoredByKind.set(reading.kind, (ignoredByKind.get(reading.kind) ?? 0) + 1)\n continue\n }\n const { kind, event: ev } = reading\n const id = typeof ev.id === 'string' ? ev.id : ''\n if (kind === 'metered' || kind === 'settled' || kind === 'cancelled') {\n const field = kind === 'metered' ? 'spend' : 'spent'\n const prefix =\n row.kind === 'events'\n ? `events[${eventIndex}].`\n : reading.dialect === 'runtime-envelope'\n ? 'event.'\n : ''\n resourceRecords.push({\n nodeId: id || null,\n kind,\n source: `journal.rows[${sourceRow}].${prefix}${field}.resources`,\n resources: readResources(asRecord(kind === 'metered' ? ev.spend : ev.spent).resources),\n })\n }\n if (kind === 'spawned') {\n const spawn = spawnRowOf(ev, id, sourceRow, rootId)\n if (spawn.valid && spawn.parent === null && rootId === null) rootId = id\n spawns.push(spawn)\n } else if (kind === 'settled') {\n closes.push(settledCloseOf(ev, id))\n } else if (kind === 'cancelled') {\n closes.push(cancelledCloseOf(ev, id))\n } else if (kind === 'metered') {\n // Deferred: rows are attributed after the loop, once the root is known, so a metered\n // event that precedes the root spawn is never misattributed.\n meteredRows.push({ id, spend: readSpend(ev.spend), at: ms(ev.at) })\n } else {\n // `TREE_EVENT_KINDS` and these branches are one contract: adding a kind to the set\n // without a branch here would silently drop its rows, which is the defect this\n // accounting exists to prevent. The compiler refuses the omission.\n const unhandled: never = kind\n throw new Error(`unhandled journal event kind ${JSON.stringify(unhandled)}`)\n }\n }\n }\n return {\n spawns,\n closes,\n rootId,\n unreadableRows,\n ignoredByKind,\n dialectsSeen,\n resourceRecords,\n meteredRows,\n }\n}\n\n/** Only root-attributed metered events are the supervisor brain's own spend. A nested driver meters under its own id; its spend reaches this tree through its settled close, so folding it into the brain here would count the same tokens twice. */\nfunction foldBrainSpend(\n meteredRows: JournalReading['meteredRows'],\n rootId: string | null,\n): SupervisorTreeFacts['brain'] {\n let brainIn = 0\n let brainOut = 0\n let brainCacheRead = 0\n let brainCacheWrite = 0\n let brainHasCache = false\n let brainCacheBreakdownKnown = true\n let brainTokensKnownCount = 0\n let brainTokensUnknownCount = 0\n let brainUsd = 0\n let brainUsdKnownCount = 0\n let brainUsdUnknownCount = 0\n let meteredCount = 0\n for (const row of meteredRows) {\n if (rootId === null || row.id !== rootId) continue\n if (row.spend.tokensKnown) {\n brainIn += row.spend.tokens.input\n brainOut += row.spend.tokens.output\n brainCacheRead += row.spend.tokens.cacheRead\n brainCacheWrite += row.spend.tokens.cacheWrite\n brainHasCache = brainHasCache || row.spend.tokens.hasCache\n brainCacheBreakdownKnown = brainCacheBreakdownKnown && row.spend.tokens.breakdownKnown\n brainTokensKnownCount += 1\n } else {\n brainTokensUnknownCount += 1\n }\n if (row.spend.usdKnown) {\n brainUsd += row.spend.usd\n brainUsdKnownCount += 1\n } else {\n brainUsdUnknownCount += 1\n }\n meteredCount += 1\n }\n return {\n tokensIn: brainIn,\n tokensOut: brainOut,\n cacheRead: brainCacheRead,\n cacheWrite: brainCacheWrite,\n hasCache: brainHasCache,\n cacheBreakdownKnown: brainCacheBreakdownKnown,\n tokensKnownCount: brainTokensKnownCount,\n tokensUnknownCount: brainTokensUnknownCount,\n usd: brainUsd,\n usdKnownCount: brainUsdKnownCount,\n usdUnknownCount: brainUsdUnknownCount,\n meteredCount,\n }\n}\n\n/** Steer counts from a worker's inbox and acknowledgements, or the reason they cannot be stated exactly. */\nfunction accountSteers(facts: WorkerLogFacts): void {\n const requestsById = new Map<string, number>()\n for (const request of facts.steerRequests) {\n if (request.requestId === null) continue\n requestsById.set(request.requestId, (requestsById.get(request.requestId) ?? 0) + 1)\n }\n const acknowledgementsById = new Map<string, SteerAcknowledgementFact[]>()\n for (const acknowledgement of facts.steerAcknowledgements) {\n if (acknowledgement.requestId === null) continue\n const matches = acknowledgementsById.get(acknowledgement.requestId) ?? []\n matches.push(acknowledgement)\n acknowledgementsById.set(acknowledgement.requestId, matches)\n }\n const queueProblems: string[] = []\n if (!facts.inboxCaptured) queueProblems.push('inbox absent')\n if (!facts.eventsCaptured) queueProblems.push('events absent')\n if (facts.inboxInvalidRows > 0) queueProblems.push('inbox contains malformed rows')\n if (facts.eventsInvalidRows > 0) queueProblems.push('events contain malformed rows')\n if (facts.steerRequests.some((request) => request.requestId === null)) {\n queueProblems.push('queued request id missing')\n }\n if ([...requestsById.values()].some((count) => count > 1)) {\n queueProblems.push('queued request id duplicated')\n }\n if (facts.steerAcknowledgements.some((acknowledgement) => acknowledgement.requestId === null)) {\n queueProblems.push('acknowledgement request id missing')\n }\n if ([...acknowledgementsById.keys()].some((id) => !requestsById.has(id))) {\n queueProblems.push('acknowledgement has no queued request')\n }\n if (queueProblems.length === 0) {\n facts.steersQueued = requestsById.size\n } else {\n facts.steersQueuedUnavailable = [...new Set(queueProblems)].join('; ')\n }\n\n const deliveryProblems = [...queueProblems]\n if ([...acknowledgementsById.values()].some((rows) => rows.length > 1)) {\n deliveryProblems.push('acknowledgement request id duplicated')\n }\n if (facts.steerAcknowledgements.some((acknowledgement) => acknowledgement.delivered === null)) {\n deliveryProblems.push('acknowledgement delivery status missing')\n }\n if (deliveryProblems.length === 0) {\n facts.steersDelivered = [...requestsById.keys()].filter((id) => {\n const acknowledgement = acknowledgementsById.get(id)\n return acknowledgement?.length === 1 && acknowledgement[0]?.delivered === true\n }).length\n } else {\n facts.steersDeliveredUnavailable = [...new Set(deliveryProblems)].join('; ')\n }\n}\n\n/** Everything one worker's inbox and event log say: timing, verdict, questions and steer accounting. */\nfunction readWorkerLog(\n w: NonNullable<SupervisorRunSources['workers']>[number],\n sourceIndex: number,\n): WorkerLogFacts {\n const facts: WorkerLogFacts = {\n sourceIndex,\n workerId: w.workerId ?? null,\n label: w.label,\n inboxCaptured: w.inbox !== null,\n eventsCaptured: w.events !== null,\n inboxInvalidRows: 0,\n eventsInvalidRows: 0,\n started: null,\n finished: false,\n finishedAt: null,\n passed: null,\n score: null,\n finishedPatchBytes: null,\n evidenceBytes: 0,\n steersQueued: null,\n steersDelivered: null,\n steersQueuedUnavailable: null,\n steersDeliveredUnavailable: null,\n questions: 0,\n steerRequests: [],\n steerAcknowledgements: [],\n }\n const parsedInbox = parseJsonlWithDiagnostics(w.inbox)\n const parsedEvents = parseJsonlWithDiagnostics(w.events)\n facts.inboxInvalidRows = parsedInbox.invalidRows\n facts.eventsInvalidRows = parsedEvents.invalidRows\n for (const [row, req] of parsedInbox.rows.entries()) {\n if (typeof req.message !== 'string' || req.message.trim().length === 0) continue\n facts.steerRequests.push({\n requestId: typeof req.id === 'string' && req.id.length > 0 ? req.id : null,\n row,\n })\n }\n for (const [row, ev] of parsedEvents.rows.entries()) {\n const kind = ev.kind\n if (kind === 'message') {\n if (ev.direction === 'up') {\n facts.questions += 1\n continue\n }\n facts.steerAcknowledgements.push({\n requestId:\n typeof ev.requestId === 'string' && ev.requestId.length > 0 ? ev.requestId : null,\n delivered: typeof ev.delivered === 'boolean' ? ev.delivered : null,\n row,\n })\n } else if (kind === 'started') {\n facts.started = ms(ev.at)\n } else if (kind === 'finished') {\n facts.finished = true\n facts.finishedAt = ms(ev.at)\n facts.passed = typeof ev.passed === 'boolean' ? ev.passed : null\n facts.score = typeof ev.score === 'number' && Number.isFinite(ev.score) ? ev.score : null\n facts.finishedPatchBytes = typeof ev.patchBytes === 'number' ? ev.patchBytes : null\n facts.evidenceBytes = typeof ev.evidence === 'string' ? ev.evidence.length : 0\n }\n }\n accountSteers(facts)\n return facts\n}\n\n/** The earliest and latest stamped event across spawns, closes and metered rows. */\nfunction eventSpan(\n spawns: SpawnRow[],\n closes: CloseRow[],\n meteredRows: JournalReading['meteredRows'],\n): { firstEventAt: number | null; lastEventAt: number | null } {\n let firstEventAt: number | null = null\n let lastEventAt: number | null = null\n const widenEventSpan = (at: number | null): void => {\n if (at === null) return\n if (firstEventAt === null || at < firstEventAt) firstEventAt = at\n if (lastEventAt === null || at > lastEventAt) lastEventAt = at\n }\n for (const spawn of spawns) widenEventSpan(spawn.at)\n for (const close of closes) widenEventSpan(close.at)\n for (const metered of meteredRows) widenEventSpan(metered.at)\n return { firstEventAt, lastEventAt }\n}\n\nexport function parseSupervisorTree(src: SupervisorRunSources): SupervisorTreeFacts {\n const parsedJournal = parseJsonlWithDiagnostics(src.journal)\n const events = parsedJournal.rows\n const state = parseJsonRecord(src.state)\n\n const {\n spawns,\n closes,\n rootId,\n unreadableRows,\n ignoredByKind,\n dialectsSeen,\n resourceRecords,\n meteredRows,\n } = readJournal(events)\n const brain = foldBrainSpend(meteredRows, rootId)\n\n const workerSpawns = spawns.filter((s) => s.valid && s.id !== rootId)\n const workerIds = new Set(workerSpawns.map((s) => s.id))\n const workerCloses = closes.filter((c) => workerIds.has(c.id))\n\n const workerLogs = new Map<string, WorkerLogFacts>()\n const workerLogRows: WorkerLogFacts[] = []\n for (const [sourceIndex, w] of (src.workers ?? []).entries()) {\n const facts = readWorkerLog(w, sourceIndex)\n workerLogRows.push(facts)\n workerLogs.set(workerSourceKey(w), facts)\n }\n\n const startedAt = ms(state?.startedAt) ?? spawns[0]?.at ?? null\n const rootClose = rootId === null ? null : closes.find((close) => close.id === rootId)\n const completedAt = ms(state?.completedAt) ?? rootClose?.at ?? null\n\n const { firstEventAt, lastEventAt } = eventSpan(spawns, closes, meteredRows)\n\n const result = parseJsonRecord(src.result)\n if (result && Object.hasOwn(result, 'spentTotal')) {\n resourceRecords.push({\n nodeId: rootId,\n kind: 'result',\n source: 'result.spentTotal.resources',\n resources: readResources(asRecord(result.spentTotal).resources),\n })\n }\n\n return {\n resourceRecords,\n rootId,\n spawns,\n closes,\n workerSpawns,\n workerCloses,\n brain,\n workerLogs,\n workerLogRows,\n journalRows: events.length + parsedJournal.invalidRows,\n journalInvalidRows: parsedJournal.invalidRows + unreadableRows,\n journalMalformedJsonRows: parsedJournal.invalidRows,\n journalIgnoredRowsByKind: Object.fromEntries(ignoredByKind),\n journalMeteredRows: meteredRows.length,\n journalDialect: summarizeDialect(dialectsSeen),\n state,\n startedAt,\n completedAt,\n firstEventAt,\n lastEventAt,\n }\n}\n\n/** A recorded non-empty string; whitespace is retained as source evidence. */\nexport function nonEmptyString(value: unknown): string | null {\n return typeof value === 'string' && value.length > 0 ? value : null\n}\n\nexport function recordOrNull(value: unknown): Record<string, unknown> | null {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null\n}\n","/**\n * The run's terminal record, read from the documents the store wrote when the\n * run ended. Runtime's own record outranks every other source: `result.json` is\n * the `SupervisedResult` that `supervise()` returned, verbatim, and its `kind`\n * is the run's status. `failure.json` is the record Runtime writes when\n * `supervise()` threw before a result landed. Runtime's result and failure\n * records are the only terminal status contract; state is timing metadata.\n *\n * Pure: takes already-parsed documents and returns `Measured` values. The\n * analyzer and the rollout minter share it so a run never has two statuses.\n */\n\nimport { asRecord, nonEmptyString as str } from './source-facts'\nimport {\n type Measured,\n type SupervisorStatusSource,\n type TerminalFailure,\n unavailable,\n} from './types'\n\n/** The reason every terminal field reads `unavailable` when no store wrote one. */\nexport const NO_TERMINAL_RECORD =\n 'no terminal record: Runtime result.json kind or Runtime failure.json'\n\n/** The status reported for a run whose directory holds Runtime's failure record and no result. */\nexport const RUNTIME_FAILED_STATUS = 'failed'\n\nexport interface TerminalRecordInput {\n /** Runtime state document, parsed; null when absent. */\n readonly state: Record<string, unknown> | null\n /** Runtime `result.json`, parsed; null when absent. */\n readonly result: Record<string, unknown> | null\n /**\n * Runtime's `failure.json`, parsed. `null` when the store was read and holds\n * none; `undefined` when the store has no such document type.\n */\n readonly failure: Record<string, unknown> | null | undefined\n}\n\nexport interface TerminalRecord {\n readonly supStatus: Measured<string>\n readonly supStatusSource: Measured<SupervisorStatusSource>\n /**\n * Runtime's `reason` on a `no-winner` result. `null` when the record carries\n * none (a winner or a failure record).\n */\n readonly supReason: Measured<string | null>\n /** The recorded error. `null` when the run recorded a result and no error. */\n readonly failure: Measured<TerminalFailure | null>\n /**\n * True when the run recorded a delivered Runtime `winner`; false on every\n * other recorded terminal state; null when no terminal record exists.\n */\n readonly completed: boolean | null\n}\n\nfunction errorRecord(\n doc: Record<string, unknown>,\n source: TerminalFailure['source'],\n earlierAttempt: boolean,\n): TerminalFailure | null {\n if (typeof doc.error !== 'object' || doc.error === null) return null\n const error = asRecord(doc.error)\n return {\n source,\n name: str(error.name),\n message: str(error.message),\n at: str(doc.at),\n earlierAttempt,\n }\n}\n\nexport function readTerminalRecord(input: TerminalRecordInput): TerminalRecord {\n const { result } = input\n const resultKind = str(result?.kind)\n const settled = resultKind !== null && result !== null\n const failureRecord =\n input.failure === null || input.failure === undefined\n ? null\n : errorRecord(input.failure, 'runtime-failure', settled)\n\n if (settled) {\n // Runtime's settle record is the status. A failure record beside it is an\n // earlier attempt's throw (Runtime never writes one after a settle), kept\n // as the recorded error with `earlierAttempt` set; a `driver-failed`\n // no-winner carries its own rejection instead.\n return {\n supStatus: resultKind,\n supStatusSource: 'runtime-result',\n supReason: str(result.reason),\n failure: failureRecord ?? errorRecord(result, 'runtime-result', false),\n completed: resultKind === 'winner',\n }\n }\n\n if (failureRecord !== null) {\n return {\n supStatus: RUNTIME_FAILED_STATUS,\n supStatusSource: 'runtime-failure',\n supReason: null,\n failure: failureRecord,\n completed: false,\n }\n }\n if (input.failure !== null && input.failure !== undefined) {\n // The document exists but carries no `error` object. The run still ended in\n // a failure; only the detail is missing, and it says so.\n return {\n supStatus: RUNTIME_FAILED_STATUS,\n supStatusSource: 'runtime-failure',\n supReason: null,\n failure: unavailable('Runtime failure.json carries no error record'),\n completed: false,\n }\n }\n\n return {\n supStatus: unavailable(NO_TERMINAL_RECORD),\n supStatusSource: unavailable(NO_TERMINAL_RECORD),\n supReason: unavailable(NO_TERMINAL_RECORD),\n failure: unavailable(NO_TERMINAL_RECORD),\n completed: null,\n }\n}\n","/**\n * The supervision tree as `tangle.rollout.v1` rows.\n *\n * A supervisor run IS a tree of rollouts, so its nodes are not a new shape:\n * the root becomes one `RolloutLine` with `role: 'supervisor'`, and every\n * spawned invocation keeps its explicit supervisor/worker role with\n * `parent_rollout_id` pointing at its spawner. The rows append to the same\n * ledger as solo-agent rollouts and join to them with the same keys.\n *\n * What the journal CANNOT supply is the transcript: a worker's messages live\n * in its harness store (opencode sqlite, Claude Code jsonl), which the\n * `src/rollout/readers/*` intake readers own. Rows minted here are therefore\n * GAP lines (`messages: []`, `provenance.gap` set) carrying identity,\n * structure, outcome and cost. Runtime workspace receipts remain attached in\n * `provenance.workspace_captures`; their archives stay at the recorded refs.\n * Hydrating messages is the intake readers' job, keyed on `artifacts.transcript_ref`.\n *\n * Timing lives in `outcome.metrics` (`spawned_at` / `settled_at` / `wall_ms`)\n * rather than a schema field: `tangle.rollout.v1` describes ONE invocation,\n * and the inter-invocation event timeline — which is what waves, concurrency,\n * idle and utilization are computed from — is a property of the journal, not\n * of any single row. The analyzer reads that timeline; these rows carry the\n * per-node facts.\n */\n\nimport { unscreenedRewardFields } from '../rollout/reward'\nimport {\n isRolloutLine,\n ROLLOUT_SCHEMA,\n type RolloutLine,\n type RolloutSplit,\n} from '../rollout/schema'\nimport {\n asRecord,\n parseJsonRecord,\n parseSupervisorTree,\n type SpawnRow,\n type SupervisorTreeFacts,\n} from './source-facts'\nimport { readTerminalRecord } from './terminal-record'\nimport {\n isUnavailable,\n type SupervisorRunSources,\n type SupervisorRunTree,\n type SupervisorRunTreeGap,\n type WorkerLogSource,\n} from './types'\n\nexport interface SupervisorRolloutOptions {\n /** Benchmark/suite id for `task.suite`. Defaults to `'supervisor-run'`. */\n readonly suite?: string\n /** `task.split`. Defaults to `'search'` (the trainable pool). */\n readonly split?: RolloutSplit\n /** Replicate index. Defaults to 0. */\n readonly rep?: number\n /** Sampling seed the campaign pinned. Defaults to null (not recorded). */\n readonly seed?: number | null\n /** `run_id` for every node. Defaults to the supervisor root id, else `runRef`. */\n readonly runId?: string\n /** Harness that drove the supervisor. */\n readonly supervisorHarness?: string | null\n /** Harness that drove the workers. */\n readonly workerHarness?: string | null\n /** Model the supervisor ran on. */\n readonly supervisorModel?: string | null\n /** Model the workers ran on. */\n readonly workerModel?: string | null\n readonly experimentId?: string | null\n readonly candidateId?: string | null\n readonly generation?: number | null\n readonly candidateIndex?: number | null\n /** Pins `provenance.captured_at`; defaults to now. */\n readonly capturedAt?: string\n}\n\nconst EMPTY_COST = {\n usd: null,\n tokens_in: null,\n tokens_out: null,\n tokens_reasoning: null,\n cache_read: null,\n cache_write: null,\n wall_s: null,\n} as const\n\nfunction hasWorkerId(\n worker: WorkerLogSource,\n): worker is WorkerLogSource & { readonly workerId: string } {\n return worker.workerId !== undefined\n}\n\n/**\n * Mint the supervision tree as rollout rows. Returns the rows plus the gaps\n * that made any of them incomplete — same unavailable-vs-zero discipline as\n * the report: a row with no transcript says WHY, it never pretends to be empty.\n */\nexport function supervisorRunRolloutLines(\n src: SupervisorRunSources,\n opts: SupervisorRolloutOptions = {},\n): SupervisorRunTree {\n return supervisorRunRolloutLinesFromFacts(src, parseSupervisorTree(src), opts)\n}\n\n/** What the root and worker rows share: the parsed run record, the row template and the gap collector. */\nfunction rolloutContext(\n src: SupervisorRunSources,\n tree: SupervisorTreeFacts,\n opts: SupervisorRolloutOptions,\n gaps: SupervisorRunTreeGap[],\n) {\n const state = tree.state\n const result = parseJsonRecord(src.result)\n const judge = parseJsonRecord(src.judge)\n const stateResult = asRecord(state?.result)\n // One derivation with the analyzer, so the root row and the report never\n // disagree about which record the status came from.\n const terminal = readTerminalRecord({\n state,\n result,\n failure: src.failure === undefined ? undefined : parseJsonRecord(src.failure),\n })\n\n const rootId = tree.rootId\n const runId = opts.runId ?? rootId ?? src.runRef\n const suite = opts.suite ?? 'supervisor-run'\n const instanceId = src.instanceId ?? src.runRef\n const split: RolloutSplit = opts.split ?? 'search'\n const capturedAt = opts.capturedAt ?? new Date().toISOString()\n\n const base = {\n schema: ROLLOUT_SCHEMA,\n run_id: runId,\n experiment_id: opts.experimentId ?? null,\n candidate_id: opts.candidateId ?? null,\n generation: opts.generation ?? null,\n candidate_index: opts.candidateIndex ?? null,\n task: {\n suite,\n instance_id: instanceId,\n split,\n seed: opts.seed ?? null,\n rep: opts.rep ?? 0,\n },\n messages: [] as RolloutLine['messages'],\n tool_defs: [] as RolloutLine['tool_defs'],\n } satisfies Partial<RolloutLine> & Record<string, unknown>\n\n const noteCaptureGaps = (\n owner: string,\n nodeId: string,\n captures: SupervisorRunSources['rootWorkspaceCaptures'],\n ): string | null => {\n if (captures === null || captures?.length === 0) {\n gaps.push({\n code: 'workspace-capture-unavailable',\n message: `${owner} has no retained output capture evidence`,\n nodeId,\n })\n return 'workspace capture evidence unavailable'\n }\n let incomplete = false\n for (const [index, capture] of captures?.entries() ?? []) {\n const reasons = [\n capture.projectionGap,\n capture.coverageComplete === false\n ? (capture.incompleteReason ?? 'provider reported incomplete coverage')\n : capture.coverageComplete === null\n ? 'capture coverage was not recorded'\n : null,\n ].filter((reason): reason is string => reason !== null)\n if (reasons.length > 0) {\n incomplete = true\n gaps.push({\n code: 'workspace-capture-incomplete',\n message: `${owner} result ${index + 1}: ${reasons.join('; ')}`,\n nodeId,\n })\n }\n }\n return incomplete ? 'workspace capture evidence incomplete' : null\n }\n return {\n src,\n tree,\n opts,\n gaps,\n state,\n result,\n judge,\n stateResult,\n terminal,\n rootId,\n capturedAt,\n base,\n noteCaptureGaps,\n }\n}\n\ntype RolloutContext = ReturnType<typeof rolloutContext>\n\n/** The supervisor invocation row, or nothing when the journal never named a root. */\nfunction rootRolloutNode(ctx: RolloutContext): RolloutLine | null {\n const {\n src,\n tree,\n opts,\n gaps,\n state,\n result,\n judge,\n stateResult,\n terminal,\n rootId,\n capturedAt,\n noteCaptureGaps,\n base,\n } = ctx\n if (rootId === null) {\n gaps.push({\n code: 'root-spawn-unavailable',\n message: 'no parentless spawned event in the journal',\n })\n return null\n }\n const rootSpawn = tree.spawns.find((spawn) => spawn.valid && spawn.id === rootId)\n const judgeResolved = typeof judge?.resolved === 'boolean' ? judge.resolved : null\n const judgeScore = typeof judge?.score === 'number' ? judge.score : null\n const reward = judgeScore ?? (judgeResolved === null ? null : judgeResolved ? 1 : 0)\n if (reward === null) {\n gaps.push({\n code: 'root-reward-unavailable',\n message: 'no judge verdict for this run',\n nodeId: rootId,\n })\n }\n const wallMs =\n tree.startedAt !== null && tree.completedAt !== null && tree.completedAt >= tree.startedAt\n ? tree.completedAt - tree.startedAt\n : null\n const captures = src.rootWorkspaceCaptures\n const captureGap = noteCaptureGaps(`root ${JSON.stringify(rootId)}`, rootId, captures)\n return {\n ...base,\n rollout_id: rootId,\n parent_rollout_id: null,\n role: rootSpawn?.role ?? 'supervisor',\n policy: {\n harness: opts.supervisorHarness ?? null,\n harness_version: null,\n model: opts.supervisorModel ?? null,\n provider: null,\n profile_commit: null,\n agent_profile_cell_id: rootSpawn?.profileDigest ?? null,\n sampling: null,\n },\n outcome: {\n // `reward` and `realness_gated` are written by one call, in the module\n // that owns the gate. This is the SECOND producer of rollout rewards —\n // the judge verdict in the supervision run dir, not `mintRolloutRows` —\n // and it wrote `reward` by hand while never stating the flag, so\n // `isLineRealnessGated` was structurally false for every supervisor and\n // worker row ever emitted here. `unscreenedRewardFields` is the honest\n // name for what this producer can claim: a supervision journal carries\n // no `RunRecord.outcome.realness`, so no authenticity gate has run on\n // this score, and `realness_gated: false` states that rather than\n // implying it by omission. These rows stay plain `RolloutLine`s, so a\n // caller feeding them to a training exporter must `assertMinted` first.\n ...unscreenedRewardFields(reward),\n reward_source: src.judgeSource,\n verdict: judge ?? null,\n metrics: {\n arm: src.arm,\n sup_status: isUnavailable(terminal.supStatus) ? null : terminal.supStatus,\n sup_verdict: typeof state?.verdict === 'string' ? state.verdict : null,\n delivered: typeof stateResult.delivered === 'boolean' ? stateResult.delivered : null,\n verify_pass: typeof result?.verify_pass === 'boolean' ? result.verify_pass : null,\n started_at: tree.startedAt,\n completed_at: tree.completedAt,\n workers_spawned: tree.workerSpawns.length,\n brain_metered_events: tree.brain.meteredCount,\n runtime: rootSpawn?.runtime ?? null,\n profile_digest: rootSpawn?.profileDigest ?? null,\n },\n is_completed: terminal.completed === true,\n is_truncated: false,\n // A recorded non-delivery names its cause: Runtime's no-winner reason,\n // else the recorded error's message. A run with no terminal record has\n // no error to report, and a delivered run has none.\n error:\n terminal.completed !== false\n ? null\n : !isUnavailable(terminal.supReason) && terminal.supReason !== null\n ? terminal.supReason\n : !isUnavailable(terminal.failure) && terminal.failure !== null\n ? (terminal.failure.message ?? terminal.failure.name)\n : null,\n realness_gated: false,\n },\n cost: {\n ...EMPTY_COST,\n usd:\n src.limits.spendUsd !== null\n ? null\n : typeof stateResult.spentUsd === 'number'\n ? stateResult.spentUsd\n : tree.brain.usd,\n tokens_in: src.limits.managerTokens === null ? tree.brain.tokensIn : null,\n tokens_out: src.limits.managerTokens === null ? tree.brain.tokensOut : null,\n cache_read:\n src.limits.managerTokens === null && tree.brain.hasCache ? tree.brain.cacheRead : null,\n cache_write:\n src.limits.managerTokens === null && tree.brain.hasCache ? tree.brain.cacheWrite : null,\n wall_s: wallMs === null ? null : wallMs / 1000,\n },\n artifacts: {\n patch_path: typeof result?.patchPath === 'string' ? result.patchPath : null,\n run_dir: src.supRunDir,\n // Only a reader's declared artifact: a guessed path would read as retained evidence.\n transcript_ref: src.rootTranscriptRef ?? null,\n },\n provenance: {\n captured_at: capturedAt,\n capture: 'backfill',\n lossy_projection: true,\n ...(captures === undefined ? {} : { workspace_captures: captures }),\n gap: [\n src.rootTranscriptRef == null\n ? 'supervision journal carries structure and spend, not the brain transcript'\n : 'brain transcript retained by reference; messages not inlined into this row',\n captureGap,\n ]\n .filter((reason): reason is string => reason !== null)\n .join('; '),\n },\n }\n}\n\n/** The journal closes and the reader's worker sources, joined to spawns by stable id first and by label only as a fallback. */\nfunction workerLookups(ctx: RolloutContext) {\n const { src, tree } = ctx\n const closeById = new Map(tree.closes.map((c) => [c.id, c]))\n const sourceById = new Map(\n (src.workers ?? []).filter(hasWorkerId).map((worker) => [worker.workerId, worker]),\n )\n const fallbackSourceByLabel = new Map(\n (src.workers ?? [])\n .filter((worker) => worker.workerId === undefined)\n .map((worker) => [worker.label, worker]),\n )\n return { closeById, sourceById, fallbackSourceByLabel }\n}\n\ntype WorkerLookups = ReturnType<typeof workerLookups>\n\n/** One worker row, or nothing when its spawn has no explicit role. */\nfunction workerRolloutNode(\n ctx: RolloutContext,\n lookups: WorkerLookups,\n spawn: SpawnRow,\n): RolloutLine | null {\n const { src, tree, opts, gaps, capturedAt, noteCaptureGaps, base } = ctx\n const { closeById, sourceById, fallbackSourceByLabel } = lookups\n if (spawn.role === null) {\n gaps.push({\n code: 'node-role-unavailable',\n message: `child ${JSON.stringify(spawn.label)} has no explicit invocation role`,\n nodeId: spawn.id,\n })\n return null\n }\n const close = closeById.get(spawn.id) ?? null\n const workerSource = sourceById.get(spawn.id) ?? fallbackSourceByLabel.get(spawn.label) ?? null\n const facts =\n tree.workerLogs.get(workerSource?.workerId ?? workerSource?.label ?? spawn.label) ?? null\n const wallMs =\n facts?.started != null && facts.finishedAt != null ? facts.finishedAt - facts.started : null\n const score = close?.score ?? facts?.score ?? null\n const passed = close?.valid ?? facts?.passed ?? null\n const reward = score ?? (passed === null ? null : passed ? 1 : 0)\n if (reward === null) {\n gaps.push({\n code: 'child-reward-unavailable',\n message: `child ${JSON.stringify(spawn.label)} has no verify verdict`,\n nodeId: spawn.id,\n })\n }\n const isSupervisor = spawn.role === 'supervisor'\n const captures = workerSource?.workspaceCaptures\n const captureGap = noteCaptureGaps(`child ${JSON.stringify(spawn.label)}`, spawn.id, captures)\n return {\n ...base,\n rollout_id: spawn.id,\n parent_rollout_id: spawn.parent,\n role: spawn.role,\n policy: {\n harness: isSupervisor ? (opts.supervisorHarness ?? null) : (opts.workerHarness ?? null),\n harness_version: null,\n model: isSupervisor ? (opts.supervisorModel ?? null) : (opts.workerModel ?? null),\n provider: null,\n profile_commit: null,\n agent_profile_cell_id: spawn.profileDigest,\n sampling: null,\n },\n outcome: {\n // Same producer, same claim: a child reward is a self-verify verdict\n // from the journal that no realness gate has seen.\n ...unscreenedRewardFields(reward),\n reward_source:\n reward === null ? null : score === null ? 'worker-self-verify' : 'worker-verdict-score',\n verdict:\n close === null\n ? null\n : {\n kind: close.kind,\n status: close.status,\n verdict: close.rawVerdict,\n valid: close.valid,\n score: close.score,\n },\n metrics: {\n label: spawn.label,\n spawned_at: spawn.at,\n settled_at: close?.at ?? null,\n started_at: facts?.started ?? null,\n finished_at: facts?.finishedAt ?? null,\n wall_ms: wallMs,\n patch_bytes: workerSource?.patchBytes ?? facts?.finishedPatchBytes ?? null,\n evidence_bytes: facts?.evidenceBytes ?? null,\n steers_queued: facts?.steersQueued ?? null,\n steers_delivered: facts?.steersDelivered ?? null,\n questions: facts?.questions ?? null,\n runtime: spawn.runtime,\n profile_digest: spawn.profileDigest,\n },\n is_completed: close?.kind === 'settled' && close.status === 'done',\n is_truncated: close?.kind === 'cancelled',\n error:\n close?.kind === 'cancelled'\n ? (close.reason ?? 'cancelled')\n : close?.status === 'down'\n ? (close.reason ?? 'child down')\n : null,\n realness_gated: false,\n },\n // `close.spend` is only a measurement when the close event carried one;\n // a store that never priced this worker must leave null, not 0.\n cost: {\n ...EMPTY_COST,\n usd: src.limits.spendUsd !== null || !close?.hasSpend ? null : close.spend.usd,\n tokens_in: workerSource?.tokensIn ?? (close?.hasSpend ? close.spend.tokens.input : null),\n tokens_out: workerSource?.tokensOut ?? (close?.hasSpend ? close.spend.tokens.output : null),\n // Mirror the tokens_in/out journal fallback so a source whose\n // `settled` spend carries cache counters is not reported as null cache\n // beside real tokens. Gate on `hasCache` — a spend object without cache\n // counters must stay null, not a fabricated 0.\n cache_read:\n workerSource?.cacheRead ??\n (close?.hasSpend && close.spend.tokens.hasCache ? close.spend.tokens.cacheRead : null),\n cache_write:\n workerSource?.cacheWrite ??\n (close?.hasSpend && close.spend.tokens.hasCache ? close.spend.tokens.cacheWrite : null),\n wall_s: wallMs === null ? null : wallMs / 1000,\n },\n // Only artifacts a reader declares: a guessed path would mint rows pointing at files that\n // never existed, and a transcript reference reads as retained evidence.\n artifacts: {\n patch_path: workerSource?.patchPath ?? null,\n run_dir: src.supRunDir,\n transcript_ref: workerSource?.transcriptRef ?? null,\n },\n provenance: {\n captured_at: capturedAt,\n capture: 'backfill',\n lossy_projection: true,\n ...(captures === undefined ? {} : { workspace_captures: captures }),\n gap: [\n workerSource?.transcriptRef == null\n ? 'no worker transcript was retained; messages unavailable'\n : 'worker transcript retained by reference; messages not inlined into this row',\n captureGap,\n ]\n .filter((reason): reason is string => reason !== null)\n .join('; '),\n },\n }\n}\n\n/** Mint rollout rows from an already parsed source without reading its JSONL again. */\nexport function supervisorRunRolloutLinesFromFacts(\n src: SupervisorRunSources,\n tree: SupervisorTreeFacts,\n opts: SupervisorRolloutOptions = {},\n): SupervisorRunTree {\n const gaps: SupervisorRunTreeGap[] = []\n if (src.journal === null) {\n gaps.push({\n code: 'journal-unavailable',\n message: `${src.supRunDir === null ? 'no supervisor run dir' : 'journal absent'}; no nodes recoverable`,\n })\n return { rootId: null, nodes: [], gaps }\n }\n // `journalInvalidRows` covers rows the parser could not interpret at all, including JSON\n // objects in a shape it does not recognize — so a journal it read but understood none of\n // reports an explicit gap instead of an empty tree.\n const malformedSourceRows =\n tree.journalInvalidRows + tree.spawns.filter((spawn) => !spawn.valid).length\n if (malformedSourceRows > 0) {\n gaps.push({\n code: 'source-row-malformed',\n message: `${malformedSourceRows} of ${tree.journalRows} journal row(s) were unusable and excluded from the tree`,\n count: malformedSourceRows,\n })\n }\n const ctx = rolloutContext(src, tree, opts, gaps)\n const nodes: RolloutLine[] = []\n const root = rootRolloutNode(ctx)\n if (root) nodes.push(root)\n const lookups = workerLookups(ctx)\n for (const spawn of tree.workerSpawns) {\n const node = workerRolloutNode(ctx, lookups, spawn)\n if (node) nodes.push(node)\n }\n\n const invalid = nodes.filter((n) => !isRolloutLine(n))\n if (invalid.length > 0) {\n gaps.push({\n code: 'node-schema-invalid',\n message: `${invalid.length} node(s) failed tangle.rollout.v1 validation`,\n count: invalid.length,\n })\n }\n return { rootId: tree.rootId, nodes, gaps }\n}\n"],"mappings":";;;;;AAOA,SAAgB,wBAAwB,KAAkD;CACxF,IAAI,IAAI,SAAS,UAAU,OAAO;EAAE,WAAW;EAAM,OAAO,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AiC,CAAC,GACf;CACnB,MAAM,OAA+B,CAAC;CACtC,IAAI,IAAI,YAAY,MAAM;EACxB,KAAK,KAAK;GACR,MAAM;GACN,SAAS,GAAG,IAAI,cAAc,OAAO,0BAA0B,iBAAiB;EAClF,CAAC;EACD,OAAO;GAAE,QAAQ;GAAM,OAAO,CAAC;GAAG;EAAK;CACzC;CAIA,MAAM,sBACJ,KAAK,qBAAqB,KAAK,OAAO,QAAQ,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;CACxE,IAAI,sBAAsB,GACxB,KAAK,KAAK;EACR,MAAM;EACN,SAAS,GAAG,oBAAoB,MAAM,KAAK,YAAY;EACvD,OAAO;CACT,CAAC;CAEH,MAAM,MAAM,eAAe,KAAK,MAAM,MAAM,IAAI;CAChD,MAAM,QAAuB,CAAC;CAC9B,MAAM,OAAO,gBAAgB,GAAG;CAChC,IAAI,MAAM,MAAM,KAAK,IAAI;CACzB,MAAM,UAAU,cAAc,GAAG;CACjC,KAAK,MAAM,SAAS,KAAK,cAAc;EACrC,MAAM,OAAO,kBAAkB,KAAK,SAAS,KAAK;EAClD,IAAI,MAAM,MAAM,KAAK,IAAI;CAC3B;CAEA,MAAM,UAAU,MAAM,QAAQ,MAAM,CAAC,cAAc,CAAC,CAAC;CACrD,IAAI,QAAQ,SAAS,GACnB,KAAK,KAAK;EACR,MAAM;EACN,SAAS,GAAG,QAAQ,OAAO;EAC3B,OAAO,QAAQ;CACjB,CAAC;CAEH,OAAO;EAAE,QAAQ,KAAK;EAAQ;EAAO;CAAK;AAC5C"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/math/round-decimal.ts
|
|
2
2
|
/** Round to a decimal precision, preserving JavaScript Math.round semantics. */
|
|
3
3
|
function roundDecimal(v, digits) {
|
|
4
4
|
const f = 10 ** digits;
|
|
5
5
|
return Math.round(v * f) / f;
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { roundDecimal as t };
|
|
9
8
|
|
|
10
|
-
//# sourceMappingURL=round-decimal-
|
|
9
|
+
//# sourceMappingURL=round-decimal-ZmjAQPo1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-decimal-
|
|
1
|
+
{"version":3,"file":"round-decimal-ZmjAQPo1.js","names":[],"sources":["../src/math/round-decimal.ts"],"sourcesContent":["/** Round to a decimal precision, preserving JavaScript Math.round semantics. */\nexport function roundDecimal(v: number, digits: number): number {\n const f = 10 ** digits\n return Math.round(v * f) / f\n}\n"],"mappings":";;AACA,SAAgB,aAAa,GAAW,QAAwB;CAC9D,MAAM,IAAI,MAAM;CAChB,OAAO,KAAK,MAAM,IAAI,CAAC,IAAI;AAC7B"}
|
package/dist/{rubric-predictive-validity-Cd5SCtAf.d.ts → rubric-predictive-validity-B3RzbwOx.d.ts}
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as RunRecord } from "./run-record-
|
|
2
|
-
//#region src/meta-eval/outcome-store.d.ts
|
|
1
|
+
import { a as RunRecord } from "./run-record-D2BFMPGl.js";
|
|
3
2
|
/** Deployment observations join to evaluation records through their runId. */
|
|
4
3
|
interface DeploymentOutcome {
|
|
5
4
|
runId: string;
|
|
@@ -54,15 +53,11 @@ declare class FileSystemOutcomeStore implements OutcomeStore {
|
|
|
54
53
|
list(filter?: OutcomeFilter): Promise<DeploymentOutcome[]>;
|
|
55
54
|
private serialize;
|
|
56
55
|
}
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/meta-eval/outcome-observations.d.ts
|
|
59
56
|
type OutcomeReduction = 'latest' | 'mean' | 'max';
|
|
60
57
|
interface CorrelationInterval {
|
|
61
58
|
lower: number;
|
|
62
59
|
upper: number;
|
|
63
60
|
}
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/meta-eval/rubric-predictive-validity.d.ts
|
|
66
61
|
interface OutcomeMetricSpec {
|
|
67
62
|
/** Exact key in DeploymentOutcome.metrics. */
|
|
68
63
|
id: string;
|
|
@@ -129,6 +124,5 @@ interface RubricPredictiveValidityReport {
|
|
|
129
124
|
rubricsWithoutData: string[];
|
|
130
125
|
}
|
|
131
126
|
declare function rubricPredictiveValidity(input: RubricPredictiveValidityInput): Promise<RubricPredictiveValidityReport>;
|
|
132
|
-
//#endregion
|
|
133
127
|
export { RubricPredictiveValidityReport as a, CorrelationInterval as c, FileSystemOutcomeStore as d, FileSystemOutcomeStoreOptions as f, OutcomeStoreError as g, OutcomeStore as h, RubricPredictiveValidityInput as i, OutcomeReduction as l, OutcomeFilter as m, RubricOutcomeExclusion as n, RubricRanking as o, InMemoryOutcomeStore as p, RubricOutcomePair as r, rubricPredictiveValidity as s, OutcomeMetricSpec as t, DeploymentOutcome as u };
|
|
134
|
-
//# sourceMappingURL=rubric-predictive-validity-
|
|
128
|
+
//# sourceMappingURL=rubric-predictive-validity-B3RzbwOx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rubric-predictive-validity-B3RzbwOx.d.ts","names":[],"sources":["../src/meta-eval/outcome-store.ts","../src/meta-eval/outcome-observations.ts","../src/meta-eval/rubric-predictive-validity.ts"],"mappings":";;UAIiB;EACf;EACA;;EAEA,SAAS;EACT,SAAS;;EAET;;UAGe;EACf;EACA;EACA;EACA;IAAU;IAAa;;EACvB;;UAGe;EACf,OAAO,SAAS,oBAAoB;EACpC,OAAO,gBAAgB,QAAQ;EAC/B,KAAK,SAAS,gBAAgB,QAAQ;;cAa3B,gCAAgC;UACnC;EAEF,OAAO,SAAS,oBAAoB;EAIpC,OAAO,gBAAgB,QAAQ;EAI/B,KAAK,SAAQ,gBAAqB,QAAQ;;UAOjC;EACf;;EAEA;;;cAIW,0BAA0B;WAEnB;WACA;WAEA;EAHA,YAAA,wCACA,cAChB,gBACgB;;;cAUP,kCAAkC;mBAC5B;mBACA;UACT;EAEI,YAAA,SAAS;EASf,OAAO,SAAS,oBAAoB;EA8BpC,OAAO,gBAAgB,QAAQ;EAI/B,KAAK,SAAQ,gBAAqB,QAAQ;UAqCxC;;KC/JE;UAEK;EACf;EACA;;UCWe;;EAEf;EACA;;UAGe;;EAEf,MAAM;EACN,UAAU;;EAEV,yBAAyB;;EAEzB;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA,kBAAkB;EAClB;;EAEA;EACA;EACA,aAAa;EACb,cAAc;;EAEd;EACA;EACA,qBAAqB;;EAErB;;UAGe,sBAAsB,KAAK;;EAE1C;;UAGe;EACf;EACA;EACA,kBAAkB;;EAElB;EACA;;UAGe;EACf,gBAAgB;EAChB,OAAO;;EAEP,eAAe;;EAEf,QAAQ;;EAER;;EAEA;;EAEA;;iBAGoB,yBACpB,OAAO,gCACN,QAAQ"}
|
package/dist/{rubric-predictive-validity-CeKW2GQN.js → rubric-predictive-validity-CQp_M0vy.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as validateObservationOptions, i as reduceOutcomeMetric, n as correlationSummary, o as validateOutcomeMetricSpecifications, r as hasVariation, t as assertUniqueObservationIds } from "./outcome-observations-
|
|
2
|
-
|
|
1
|
+
import { a as validateObservationOptions, i as reduceOutcomeMetric, n as correlationSummary, o as validateOutcomeMetricSpecifications, r as hasVariation, t as assertUniqueObservationIds } from "./outcome-observations-D4snOtUb.js";
|
|
2
|
+
// src/meta-eval/rubric-predictive-validity.ts
|
|
3
3
|
async function rubricPredictiveValidity(input) {
|
|
4
4
|
const minSamples = input.minSamples ?? 8;
|
|
5
5
|
const reduction = input.reduction ?? "latest";
|
|
@@ -98,7 +98,6 @@ async function rubricPredictiveValidity(input) {
|
|
|
98
98
|
rubricsWithoutData: rubrics.filter((rubric) => !observedRubrics.has(rubric))
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
//#endregion
|
|
102
101
|
export { rubricPredictiveValidity as t };
|
|
103
102
|
|
|
104
|
-
//# sourceMappingURL=rubric-predictive-validity-
|
|
103
|
+
//# sourceMappingURL=rubric-predictive-validity-CQp_M0vy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rubric-predictive-validity-CeKW2GQN.js","names":[],"sources":["../src/meta-eval/rubric-predictive-validity.ts"],"sourcesContent":["/**\n * Join rubric scores to deployment outcomes and measure their association.\n * Higher rubric scores always mean better evaluated behavior.\n * Outcome directions are explicit because success rate and failure rate have opposite meanings.\n * These descriptive associations neither establish causation nor validate a change to rubric weights.\n */\n\nimport type { RunRecord } from '../run-record'\nimport {\n assertUniqueObservationIds,\n type CorrelationInterval,\n correlationSummary,\n hasVariation,\n reduceOutcomeMetric,\n validateObservationOptions,\n validateOutcomeMetricSpecifications,\n} from './outcome-observations'\nimport type { DeploymentOutcome, OutcomeStore } from './outcome-store'\n\nexport interface OutcomeMetricSpec {\n /** Exact key in DeploymentOutcome.metrics. */\n id: string\n direction: 'higher-is-better' | 'lower-is-better'\n}\n\nexport interface RubricPredictiveValidityInput {\n /** One record per independent run; rubric scores come from outcome.raw. */\n runs: RunRecord[]\n outcomes: OutcomeStore\n /** Declare desired directions before inspecting associations. */\n outcomeMetrics: readonly OutcomeMetricSpec[]\n /** Higher is better for each rubric. Omit to discover finite numeric outcome.raw keys. */\n rubrics?: readonly string[]\n /** Minimum joined runs for an estimate; an integer at least 3. Default 8. */\n minSamples?: number\n /** Bootstrap resamples for both correlation intervals. Default 500. */\n bootstrapResamples?: number\n /** Omit to derive a reproducible seed from the paired observations. */\n seed?: number\n /** Reduce finite observations of each named outcome within a run. Default latest. */\n reduction?: 'latest' | 'mean' | 'max'\n}\n\nexport interface RubricOutcomePair {\n rubric: string\n outcome: string\n outcomeDirection: OutcomeMetricSpec['direction']\n n: number\n /** Raw association with the recorded outcome, before direction alignment. */\n pearson: number\n spearman: number\n pearsonCi95: CorrelationInterval | null\n spearmanCi95: CorrelationInterval | null\n /** Positive values associate higher rubric scores with better outcomes. */\n alignedPearson: number\n alignedSpearman: number\n alignedSpearmanCi95: CorrelationInterval | null\n /** Descriptive buckets at aligned Spearman +/-0.4; no causal or release authority. */\n verdict: 'aligned' | 'inverse' | 'weak'\n}\n\nexport interface RubricRanking extends Omit<RubricOutcomePair, 'outcome'> {\n /** Outcome with the greatest direction-aligned Spearman for this rubric. */\n bestOutcome: string\n}\n\nexport interface RubricOutcomeExclusion {\n rubric: string\n outcome: string\n outcomeDirection: OutcomeMetricSpec['direction']\n /** Finite joined observations, including measured zeros. */\n n: number\n reason: 'insufficient_samples' | 'constant_rubric' | 'constant_outcome'\n}\n\nexport interface RubricPredictiveValidityReport {\n outcomeMetrics: OutcomeMetricSpec[]\n pairs: RubricOutcomePair[]\n /** All declared pairs lacking an estimate, with their usable observation count. */\n excludedPairs: RubricOutcomeExclusion[]\n /** Exploratory ordering by aligned Spearman; never use outcome selection as confirmatory evidence. */\n ranked: RubricRanking[]\n /** Runs contributing at least one finite pair, including pairs below minSamples. */\n joinedSamples: number\n /** Runs contributing no finite pair; joinedSamples + skippedRuns equals the input run count. */\n skippedRuns: number\n /** Declared rubrics with no finite score, distinct from too few outcomes or constant observations. */\n rubricsWithoutData: string[]\n}\n\nexport async function rubricPredictiveValidity(\n input: RubricPredictiveValidityInput,\n): Promise<RubricPredictiveValidityReport> {\n const minSamples = input.minSamples ?? 8\n const reduction = input.reduction ?? 'latest'\n const resamples = input.bootstrapResamples ?? 500\n const seed = input.seed\n if (!Number.isSafeInteger(minSamples) || minSamples < 3) {\n throw new Error('minSamples must be a safe integer at least 3')\n }\n validateObservationOptions(reduction, resamples, seed)\n validateOutcomeMetricSpecifications(input.outcomeMetrics)\n assertUniqueObservationIds(\n input.runs.map((run) => run.runId),\n 'runId',\n )\n\n const outcomeMetrics = input.outcomeMetrics.map((metric) => ({ ...metric }))\n const runs = input.runs.map((run) => ({ runId: run.runId, scores: { ...run.outcome.raw } }))\n const declaredRubrics = input.rubrics === undefined ? undefined : [...input.rubrics]\n if (declaredRubrics !== undefined) assertUniqueObservationIds(declaredRubrics, 'rubric')\n\n const outcomes = await input.outcomes.list()\n const outcomesByRun = new Map<string, DeploymentOutcome[]>()\n for (const outcome of outcomes) {\n const rows = outcomesByRun.get(outcome.runId) ?? []\n rows.push(outcome)\n outcomesByRun.set(outcome.runId, rows)\n }\n\n const observedRubrics = new Set<string>()\n for (const run of runs) {\n for (const [rubric, value] of Object.entries(run.scores)) {\n if (typeof value === 'number' && Number.isFinite(value)) observedRubrics.add(rubric)\n }\n }\n const rubrics = declaredRubrics ?? [...observedRubrics]\n const buckets = rubrics.flatMap((rubric) =>\n outcomeMetrics.map((outcome) => ({\n rubric,\n outcome,\n xs: [] as number[],\n ys: [] as number[],\n })),\n )\n\n let joined = 0\n for (const run of runs) {\n const rows = outcomesByRun.get(run.runId) ?? []\n let joinedThisRun = false\n for (const bucket of buckets) {\n const x = run.scores[bucket.rubric]\n if (typeof x !== 'number' || !Number.isFinite(x)) continue\n const y = reduceOutcomeMetric(rows, bucket.outcome.id, reduction)\n if (y === null) continue\n bucket.xs.push(x)\n bucket.ys.push(y)\n joinedThisRun = true\n }\n if (joinedThisRun) joined++\n }\n\n const pairs: RubricOutcomePair[] = []\n const excludedPairs: RubricOutcomeExclusion[] = []\n for (const bucket of buckets) {\n const identity = {\n rubric: bucket.rubric,\n outcome: bucket.outcome.id,\n outcomeDirection: bucket.outcome.direction,\n n: bucket.xs.length,\n }\n const reason =\n bucket.xs.length < minSamples\n ? 'insufficient_samples'\n : !hasVariation(bucket.xs)\n ? 'constant_rubric'\n : !hasVariation(bucket.ys)\n ? 'constant_outcome'\n : null\n if (reason !== null) {\n excludedPairs.push({ ...identity, reason })\n continue\n }\n const summary = correlationSummary(bucket.xs, bucket.ys, resamples, seed)\n const sign = bucket.outcome.direction === 'higher-is-better' ? 1 : -1\n const alignedSpearman = summary.spearman * sign\n const alignedSpearmanCi95 =\n summary.spearmanCi95 === null\n ? null\n : sign === 1\n ? summary.spearmanCi95\n : { lower: -summary.spearmanCi95.upper, upper: -summary.spearmanCi95.lower }\n pairs.push({\n ...identity,\n ...summary,\n alignedPearson: summary.pearson * sign,\n alignedSpearman,\n alignedSpearmanCi95,\n verdict: alignedSpearman >= 0.4 ? 'aligned' : alignedSpearman <= -0.4 ? 'inverse' : 'weak',\n })\n }\n\n const bestByRubric = new Map<string, RubricOutcomePair>()\n for (const pair of pairs) {\n const best = bestByRubric.get(pair.rubric)\n if (!best || pair.alignedSpearman > best.alignedSpearman) bestByRubric.set(pair.rubric, pair)\n }\n const ranked = [...bestByRubric.values()]\n .map(({ outcome, ...pair }) => ({ ...pair, bestOutcome: outcome }))\n .sort((a, b) => b.alignedSpearman - a.alignedSpearman)\n\n return {\n outcomeMetrics,\n pairs,\n excludedPairs,\n ranked,\n joinedSamples: joined,\n skippedRuns: runs.length - joined,\n rubricsWithoutData: rubrics.filter((rubric) => !observedRubrics.has(rubric)),\n }\n}\n"],"mappings":";;AA0FA,eAAsB,yBACpB,OACyC;CACzC,MAAM,aAAa,MAAM,cAAc;CACvC,MAAM,YAAY,MAAM,aAAa;CACrC,MAAM,YAAY,MAAM,sBAAsB;CAC9C,MAAM,OAAO,MAAM;CACnB,IAAI,CAAC,OAAO,cAAc,UAAU,KAAK,aAAa,GACpD,MAAM,IAAI,MAAM,8CAA8C;CAEhE,2BAA2B,WAAW,WAAW,IAAI;CACrD,oCAAoC,MAAM,cAAc;CACxD,2BACE,MAAM,KAAK,KAAK,QAAQ,IAAI,KAAK,GACjC,OACF;CAEA,MAAM,iBAAiB,MAAM,eAAe,KAAK,YAAY,EAAE,GAAG,OAAO,EAAE;CAC3E,MAAM,OAAO,MAAM,KAAK,KAAK,SAAS;EAAE,OAAO,IAAI;EAAO,QAAQ,EAAE,GAAG,IAAI,QAAQ,IAAI;CAAE,EAAE;CAC3F,MAAM,kBAAkB,MAAM,YAAY,KAAA,IAAY,KAAA,IAAY,CAAC,GAAG,MAAM,OAAO;CACnF,IAAI,oBAAoB,KAAA,GAAW,2BAA2B,iBAAiB,QAAQ;CAEvF,MAAM,WAAW,MAAM,MAAM,SAAS,KAAK;CAC3C,MAAM,g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O,EAAE,IACrB,oBACA,CAAC,aAAa,OAAO,EAAE,IACrB,qBACA;EACV,IAAI,WAAW,MAAM;GACnB,cAAc,KAAK;IAAE,GAAG;IAAU;GAAO,CAAC;GAC1C;EACF;EACA,MAAM,UAAU,mBAAmB,OAAO,IAAI,OAAO,IAAI,WAAW,IAAI;EACxE,MAAM,OAAO,OAAO,QAAQ,cAAc,qBAAqB,IAAI;EACnE,MAAM,kBAAkB,QAAQ,WAAW;EAC3C,MAAM,sBACJ,QAAQ,iBAAiB,OACrB,OACA,SAAS,IACP,QAAQ,eACR;GAAE,OAAO,CAAC,QAAQ,aAAa;GAAO,OAAO,CAAC,QAAQ,aAAa;EAAM;EACjF,MAAM,KAAK;GACT,GAAG;GACH,GAAG;GACH,gBAAgB,QAAQ,UAAU;GAClC;GACA;GACA,SAAS,mBAAmB,KAAM,YAAY,mBAAmB,MAAO,YAAY;EACtF,CAAC;CACH;CAEA,MAAM,+BAAe,IAAI,IAA+B;CACxD,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,OAAO,aAAa,IAAI,KAAK,MAAM;EACzC,IAAI,CAAC,QAAQ,KAAK,kBAAkB,KAAK,iBAAiB,aAAa,IAAI,KAAK,QAAQ,IAAI;CAC9F;CAKA,OAAO;EACL;EACA;EACA;EACA,QARa,CAAC,GAAG,aAAa,OAAO,CAAC,CAAC,CACtC,KAAK,EAAE,SAAS,GAAG,YAAY;GAAE,GAAG;GAAM,aAAa;EAAQ,EAAE,CAAC,CAClE,MAAM,GAAG,MAAM,EAAE,kBAAkB,EAAE,eAMjC;EACL,eAAe;EACf,aAAa,KAAK,SAAS;EAC3B,oBAAoB,QAAQ,QAAQ,WAAW,CAAC,gBAAgB,IAAI,MAAM,CAAC;CAC7E;AACF"}
|
|
1
|
+
{"version":3,"file":"rubric-predictive-validity-CQp_M0vy.js","names":[],"sources":["../src/meta-eval/rubric-predictive-validity.ts"],"sourcesContent":["/**\n * Join rubric scores to deployment outcomes and measure their association.\n * Higher rubric scores always mean better evaluated behavior.\n * Outcome directions are explicit because success rate and failure rate have opposite meanings.\n * These descriptive associations neither establish causation nor validate a change to rubric weights.\n */\n\nimport type { RunRecord } from '../run-record'\nimport {\n assertUniqueObservationIds,\n type CorrelationInterval,\n correlationSummary,\n hasVariation,\n reduceOutcomeMetric,\n validateObservationOptions,\n validateOutcomeMetricSpecifications,\n} from './outcome-observations'\nimport type { DeploymentOutcome, OutcomeStore } from './outcome-store'\n\nexport interface OutcomeMetricSpec {\n /** Exact key in DeploymentOutcome.metrics. */\n id: string\n direction: 'higher-is-better' | 'lower-is-better'\n}\n\nexport interface RubricPredictiveValidityInput {\n /** One record per independent run; rubric scores come from outcome.raw. */\n runs: RunRecord[]\n outcomes: OutcomeStore\n /** Declare desired directions before inspecting associations. */\n outcomeMetrics: readonly OutcomeMetricSpec[]\n /** Higher is better for each rubric. Omit to discover finite numeric outcome.raw keys. */\n rubrics?: readonly string[]\n /** Minimum joined runs for an estimate; an integer at least 3. Default 8. */\n minSamples?: number\n /** Bootstrap resamples for both correlation intervals. Default 500. */\n bootstrapResamples?: number\n /** Omit to derive a reproducible seed from the paired observations. */\n seed?: number\n /** Reduce finite observations of each named outcome within a run. Default latest. */\n reduction?: 'latest' | 'mean' | 'max'\n}\n\nexport interface RubricOutcomePair {\n rubric: string\n outcome: string\n outcomeDirection: OutcomeMetricSpec['direction']\n n: number\n /** Raw association with the recorded outcome, before direction alignment. */\n pearson: number\n spearman: number\n pearsonCi95: CorrelationInterval | null\n spearmanCi95: CorrelationInterval | null\n /** Positive values associate higher rubric scores with better outcomes. */\n alignedPearson: number\n alignedSpearman: number\n alignedSpearmanCi95: CorrelationInterval | null\n /** Descriptive buckets at aligned Spearman +/-0.4; no causal or release authority. */\n verdict: 'aligned' | 'inverse' | 'weak'\n}\n\nexport interface RubricRanking extends Omit<RubricOutcomePair, 'outcome'> {\n /** Outcome with the greatest direction-aligned Spearman for this rubric. */\n bestOutcome: string\n}\n\nexport interface RubricOutcomeExclusion {\n rubric: string\n outcome: string\n outcomeDirection: OutcomeMetricSpec['direction']\n /** Finite joined observations, including measured zeros. */\n n: number\n reason: 'insufficient_samples' | 'constant_rubric' | 'constant_outcome'\n}\n\nexport interface RubricPredictiveValidityReport {\n outcomeMetrics: OutcomeMetricSpec[]\n pairs: RubricOutcomePair[]\n /** All declared pairs lacking an estimate, with their usable observation count. */\n excludedPairs: RubricOutcomeExclusion[]\n /** Exploratory ordering by aligned Spearman; never use outcome selection as confirmatory evidence. */\n ranked: RubricRanking[]\n /** Runs contributing at least one finite pair, including pairs below minSamples. */\n joinedSamples: number\n /** Runs contributing no finite pair; joinedSamples + skippedRuns equals the input run count. */\n skippedRuns: number\n /** Declared rubrics with no finite score, distinct from too few outcomes or constant observations. */\n rubricsWithoutData: string[]\n}\n\nexport async function rubricPredictiveValidity(\n input: RubricPredictiveValidityInput,\n): Promise<RubricPredictiveValidityReport> {\n const minSamples = input.minSamples ?? 8\n const reduction = input.reduction ?? 'latest'\n const resamples = input.bootstrapResamples ?? 500\n const seed = input.seed\n if (!Number.isSafeInteger(minSamples) || minSamples < 3) {\n throw new Error('minSamples must be a safe integer at least 3')\n }\n validateObservationOptions(reduction, resamples, seed)\n validateOutcomeMetricSpecifications(input.outcomeMetrics)\n assertUniqueObservationIds(\n input.runs.map((run) => run.runId),\n 'runId',\n )\n\n const outcomeMetrics = input.outcomeMetrics.map((metric) => ({ ...metric }))\n const runs = input.runs.map((run) => ({ runId: run.runId, scores: { ...run.outcome.raw } }))\n const declaredRubrics = input.rubrics === undefined ? undefined : [...input.rubrics]\n if (declaredRubrics !== undefined) assertUniqueObservationIds(declaredRubrics, 'rubric')\n\n const outcomes = await input.outcomes.list()\n const outcomesByRun = new Map<string, DeploymentOutcome[]>()\n for (const outcome of outcomes) {\n const rows = outcomesByRun.get(outcome.runId) ?? []\n rows.push(outcome)\n outcomesByRun.set(outcome.runId, rows)\n }\n\n const observedRubrics = new Set<string>()\n for (const run of runs) {\n for (const [rubric, value] of Object.entries(run.scores)) {\n if (typeof value === 'number' && Number.isFinite(value)) observedRubrics.add(rubric)\n }\n }\n const rubrics = declaredRubrics ?? [...observedRubrics]\n const buckets = rubrics.flatMap((rubric) =>\n outcomeMetrics.map((outcome) => ({\n rubric,\n outcome,\n xs: [] as number[],\n ys: [] as number[],\n })),\n )\n\n let joined = 0\n for (const run of runs) {\n const rows = outcomesByRun.get(run.runId) ?? []\n let joinedThisRun = false\n for (const bucket of buckets) {\n const x = run.scores[bucket.rubric]\n if (typeof x !== 'number' || !Number.isFinite(x)) continue\n const y = reduceOutcomeMetric(rows, bucket.outcome.id, reduction)\n if (y === null) continue\n bucket.xs.push(x)\n bucket.ys.push(y)\n joinedThisRun = true\n }\n if (joinedThisRun) joined++\n }\n\n const pairs: RubricOutcomePair[] = []\n const excludedPairs: RubricOutcomeExclusion[] = []\n for (const bucket of buckets) {\n const identity = {\n rubric: bucket.rubric,\n outcome: bucket.outcome.id,\n outcomeDirection: bucket.outcome.direction,\n n: bucket.xs.length,\n }\n const reason =\n bucket.xs.length < minSamples\n ? 'insufficient_samples'\n : !hasVariation(bucket.xs)\n ? 'constant_rubric'\n : !hasVariation(bucket.ys)\n ? 'constant_outcome'\n : null\n if (reason !== null) {\n excludedPairs.push({ ...identity, reason })\n continue\n }\n const summary = correlationSummary(bucket.xs, bucket.ys, resamples, seed)\n const sign = bucket.outcome.direction === 'higher-is-better' ? 1 : -1\n const alignedSpearman = summary.spearman * sign\n const alignedSpearmanCi95 =\n summary.spearmanCi95 === null\n ? null\n : sign === 1\n ? summary.spearmanCi95\n : { lower: -summary.spearmanCi95.upper, upper: -summary.spearmanCi95.lower }\n pairs.push({\n ...identity,\n ...summary,\n alignedPearson: summary.pearson * sign,\n alignedSpearman,\n alignedSpearmanCi95,\n verdict: alignedSpearman >= 0.4 ? 'aligned' : alignedSpearman <= -0.4 ? 'inverse' : 'weak',\n })\n }\n\n const bestByRubric = new Map<string, RubricOutcomePair>()\n for (const pair of pairs) {\n const best = bestByRubric.get(pair.rubric)\n if (!best || pair.alignedSpearman > best.alignedSpearman) bestByRubric.set(pair.rubric, pair)\n }\n const ranked = [...bestByRubric.values()]\n .map(({ outcome, ...pair }) => ({ ...pair, bestOutcome: outcome }))\n .sort((a, b) => b.alignedSpearman - a.alignedSpearman)\n\n return {\n outcomeMetrics,\n pairs,\n excludedPairs,\n ranked,\n joinedSamples: joined,\n skippedRuns: runs.length - joined,\n rubricsWithoutData: rubrics.filter((rubric) => !observedRubrics.has(rubric)),\n }\n}\n"],"mappings":";;AA0FA,eAAsB,yBACpB,OACyC;CACzC,MAAM,aAAa,MAAM,cAAc;CACvC,MAAM,YAAY,MAAM,aAAa;CACrC,MAAM,YAAY,MAAM,sBAAsB;CAC9C,MAAM,OAAO,MAAM;CACnB,IAAI,CAAC,OAAO,cAAc,UAAU,KAAK,aAAa,GACpD,MAAM,IAAI,MAAM,8CAA8C;CAEhE,2BAA2B,WAAW,WAAW,IAAI;CACrD,oCAAoC,MAAM,cAAc;CACxD,2BACE,MAAM,KAAK,KAAK,QAAQ,IAAI,KAAK,GACjC,OACF;CAEA,MAAM,iBAAiB,MAAM,eAAe,KAAK,YAAY,EAAE,GAAG,OAAO,EAAE;CAC3E,MAAM,OAAO,MAAM,KAAK,KAAK,SAAS;EAAE,OAAO,IAAI;EAAO,QAAQ,EAAE,GAAG,IAAI,QAAQ,IAAI;CAAE,EAAE;CAC3F,MAAM,kBAAkB,MAAM,YAAY,KAAA,IAAY,KAAA,IAAY,CAAC,GAAG,MAAM,OAAO;CACnF,IAAI,oBAAoB,KAAA,GAAW,2BAA2B,iBAAiB,QAAQ;CAEvF,MAAM,WAAW,MAAM,MAAM,SAAS,KAAK;CAC3C,MAAM,gCAAgB,IAAI,IAAiC;CAC3D,KAAK,MAAM,WAAW,UAAU;EAC9B,MAAM,OAAO,cAAc,IAAI,QAAQ,KAAK,KAAK,CAAC;EAClD,KAAK,KAAK,OAAO;EACjB,cAAc,IAAI,QAAQ,OAAO,IAAI;CACv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AI,OAAO,IAAI,WAAW,IAAI;EACxE,MAAM,OAAO,OAAO,QAAQ,cAAc,qBAAqB,IAAI;EACnE,MAAM,kBAAkB,QAAQ,WAAW;EAC3C,MAAM,sBACJ,QAAQ,iBAAiB,OACrB,OACA,SAAS,IACP,QAAQ,eACR;GAAE,OAAO,CAAC,QAAQ,aAAa;GAAO,OAAO,CAAC,QAAQ,aAAa;EAAM;EACjF,MAAM,KAAK;GACT,GAAG;GACH,GAAG;GACH,gBAAgB,QAAQ,UAAU;GAClC;GACA;GACA,SAAS,mBAAmB,KAAM,YAAY,mBAAmB,MAAO,YAAY;EACtF,CAAC;CACH;CAEA,MAAM,+BAAe,IAAI,IAA+B;CACxD,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,OAAO,aAAa,IAAI,KAAK,MAAM;EACzC,IAAI,CAAC,QAAQ,KAAK,kBAAkB,KAAK,iBAAiB,aAAa,IAAI,KAAK,QAAQ,IAAI;CAC9F;CAKA,OAAO;EACL;EACA;EACA;EACA,QARa,CAAC,GAAG,aAAa,OAAO,CAAC,CAAC,CACtC,KAAK,EAAE,SAAS,GAAG,YAAY;GAAE,GAAG;GAAM,aAAa;EAAQ,EAAE,CAAC,CAClE,MAAM,GAAG,MAAM,EAAE,kBAAkB,EAAE,eAMjC;EACL,eAAe;EACf,aAAa,KAAK,SAAS;EAC3B,oBAAoB,QAAQ,QAAQ,WAAW,CAAC,gBAAgB,IAAI,MAAM,CAAC;CAC7E;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as validateRunRecord } from "./run-record-
|
|
2
|
-
import { t as mean } from "./mean-
|
|
3
|
-
|
|
1
|
+
import { c as validateRunRecord } from "./run-record-DEjx43cI.js";
|
|
2
|
+
import { t as mean } from "./mean-CdDYG-us.js";
|
|
3
|
+
// src/campaign/run-record.ts
|
|
4
4
|
/**
|
|
5
5
|
* A campaign cell carried a judge score without a `dimensions` record.
|
|
6
6
|
*
|
|
@@ -215,7 +215,6 @@ function finiteMetrics(metrics) {
|
|
|
215
215
|
for (const [key, value] of Object.entries(metrics ?? {})) if (Number.isFinite(value)) finite[key] = value;
|
|
216
216
|
return finite;
|
|
217
217
|
}
|
|
218
|
-
//#endregion
|
|
219
218
|
export { campaignCellToRunRecord as n, projectCampaignCellQuality as r, campaignCellCostProvenance as t };
|
|
220
219
|
|
|
221
|
-
//# sourceMappingURL=run-record-
|
|
220
|
+
//# sourceMappingURL=run-record-CZy4-TnZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-record-CysKLB93.js","names":[],"sources":["../src/campaign/run-record.ts"],"sourcesContent":["import type { AgentProfileCell } from '../agent-profile-cell'\nimport type { CostProvenance } from '../cost-ledger'\nimport type {\n JudgeScoresRecord,\n RunCostProvenance,\n RunOutcome,\n RunRecord,\n RunSearchCoordinates,\n RunSplitTag,\n RunTerminalOutcome,\n RunTraceRef,\n} from '../run-record'\nimport { validateRunRecord } from '../run-record'\nimport { mean } from '../statistics/mean'\nimport type { CampaignCellResult, JudgeScore } from './types'\n\ninterface CampaignCellRunRecordOptions {\n /** With `search`, this must be `searchCellRunId(search)`. */\n runId: string\n experimentId: string\n candidateId: string\n model: string\n promptHash: string\n configHash: string\n commitSha: string\n splitTag: RunSplitTag\n seed?: number\n scenarioId?: string\n /** Estimated total for a cell that proved no spend at all. A cell that\n * proved part of its spend keeps that floor instead. */\n defaultCostUsd?: number\n agentProfile?: AgentProfileCell\n raw?: Record<string, number>\n search?: RunSearchCoordinates\n traceRef?: RunTraceRef\n}\n\ninterface CampaignCellQualityProjection {\n score?: number\n judgeScores?: JudgeScoresRecord\n successfulJudgeScores: Record<string, JudgeScore>\n failedJudges: string[]\n raw: Record<string, number>\n}\n\n/**\n * A campaign cell carried a judge score without a `dimensions` record.\n *\n * Two exported types share the name `JudgeScore`: the campaign verdict\n * (`{ dimensions, composite, notes }` from `@tangle-network/agent-eval/campaign`)\n * and the root export's flat per-dimension row (`{ judgeName, dimension, score }`\n * from `@tangle-network/agent-eval`). Campaign aggregation accepts only the\n * campaign shape; the flat shape previously crashed here with an opaque\n * TypeError deep inside aggregation.\n */\nexport class CampaignJudgeScoreShapeError extends TypeError {\n constructor(judgeName: string) {\n super(\n `campaign cell judge '${judgeName}' carries a score without a 'dimensions' record. ` +\n `Use the campaign JudgeScore ({ dimensions, composite, notes }) from ` +\n `'@tangle-network/agent-eval/campaign'; the root export's JudgeScore ` +\n `({ judgeName, dimension, score }) is a different type with the same name.`,\n )\n this.name = 'CampaignJudgeScoreShapeError'\n }\n}\n\ninterface CampaignCellExecutionEvidence {\n terminalOutcome: RunTerminalOutcome\n executionErrorCount?: number\n judgeErrorCount?: number\n unclassifiedErrorCount?: number\n terminalFailureReason?: string\n}\n\n/**\n * Project one campaign cell into the canonical run format.\n *\n * A dispatch error establishes terminal execution failure. A judge error only\n * establishes that quality measurement failed after dispatch completed.\n * Failures without a stage remain unknown. No failure becomes a zero-quality\n * label.\n */\nexport function campaignCellToRunRecord<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n options: CampaignCellRunRecordOptions,\n): RunRecord {\n const quality = projectCampaignCellQuality(cell)\n const execution = campaignCellExecutionEvidence(cell)\n const judgeErrorCount = Math.max(\n quality.raw.judge_error_count ?? 0,\n execution.judgeErrorCount ?? 0,\n )\n const costProvenance = campaignCellRunCostProvenance(cell, options.defaultCostUsd)\n const costUsd = costProvenance.usd\n const raw: Record<string, number> = {\n ...finiteMetrics(options.raw),\n ...quality.raw,\n rep: cell.rep,\n duration_ms: cell.durationMs,\n ...(costUsd === null ? {} : { cost_usd: costUsd }),\n tokens_input: cell.tokenUsage.input,\n tokens_output: cell.tokenUsage.output,\n tokens_known: cell.tokenUsage.tokensKnown === false ? 0 : 1,\n latency_ms: cell.durationMs,\n ...(execution.executionErrorCount === undefined\n ? {}\n : { execution_error_count: execution.executionErrorCount }),\n ...(judgeErrorCount > 0 ? { judge_error_count: judgeErrorCount } : {}),\n ...(execution.unclassifiedErrorCount === undefined\n ? {}\n : { unclassified_error_count: execution.unclassifiedErrorCount }),\n }\n if (typeof cell.generation === 'number') raw.generation = cell.generation\n if (cell.tokenUsage.reasoning !== undefined) {\n raw.tokens_reasoning = cell.tokenUsage.reasoning\n }\n if (cell.tokenUsage.cached !== undefined) raw.tokens_cached = cell.tokenUsage.cached\n if (cell.tokenUsage.cacheWrite !== undefined) {\n raw.tokens_cache_write = cell.tokenUsage.cacheWrite\n }\n if (cell.tokenUsage.tokensKnown !== false && costUsd !== null && costUsd > 0) {\n raw.tokens_per_dollar = (cell.tokenUsage.input + cell.tokenUsage.output) / costUsd\n }\n if (costUsd !== null && quality.score !== undefined && quality.score > 0.01) {\n raw.cost_per_quality = costUsd / quality.score\n }\n\n const outcome: RunOutcome = {\n raw,\n ...(quality.judgeScores ? { judgeScores: quality.judgeScores } : {}),\n }\n if (quality.score !== undefined) {\n if (options.splitTag === 'holdout') outcome.holdoutScore = quality.score\n else outcome.searchScore = quality.score\n }\n\n return validateRunRecord({\n runId: options.runId,\n experimentId: options.experimentId,\n candidateId: options.candidateId,\n seed: options.seed ?? cell.seed,\n model: options.model,\n promptHash: options.promptHash,\n configHash: options.configHash,\n commitSha: options.commitSha,\n wallMs: cell.durationMs,\n costUsd,\n costProvenance,\n tokenUsage: { ...cell.tokenUsage },\n terminalOutcome: execution.terminalOutcome,\n ...(execution.terminalFailureReason\n ? { terminalFailureReason: execution.terminalFailureReason }\n : {}),\n outcome,\n splitTag: options.splitTag,\n scenarioId: options.scenarioId ?? cell.scenarioId,\n ...(options.agentProfile ? { agentProfile: options.agentProfile } : {}),\n ...(options.search ? { search: options.search } : {}),\n ...(options.traceRef ? { traceRef: options.traceRef } : {}),\n })\n}\n\n/**\n * A cell's cost as a RunRecord states it. An uncaptured cell's `costUsd` is\n * the spend its receipts proved, so a positive one is the run's floor. The\n * caller's `defaultCostUsd` stands in only when nothing was proved: a proven\n * floor is never replaced by a guess.\n */\nfunction campaignCellRunCostProvenance<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n defaultCostUsd: number | undefined,\n): RunCostProvenance {\n const provenance = campaignCellCostProvenance(cell)\n if (provenance.kind !== 'uncaptured') return provenance\n if (cell.costUsd > 0) return { kind: 'lower-bound', usd: null, knownLowerBoundUsd: cell.costUsd }\n return defaultCostUsd === undefined ? provenance : { kind: 'estimated', usd: defaultCostUsd }\n}\n\n/**\n * Validate the cost fields that cross campaign cache and RunRecord boundaries.\n * `costUsd` is a known subtotal for uncaptured cells, but it must equal the\n * authoritative total whenever that total is observed or estimated.\n */\nexport function campaignCellCostProvenance<TArtifact>(\n cell: Pick<CampaignCellResult<TArtifact>, 'cellId' | 'costUsd' | 'costProvenance'>,\n): CostProvenance {\n if (!Number.isFinite(cell.costUsd) || cell.costUsd < 0) {\n throw new Error(`campaign cell '${cell.cellId}' has invalid costUsd`)\n }\n const provenance = cell.costProvenance\n if (!provenance || typeof provenance !== 'object') {\n throw new Error(`campaign cell '${cell.cellId}' has no costProvenance`)\n }\n if (provenance.kind === 'uncaptured') {\n if (provenance.usd !== null) {\n throw new Error(`campaign cell '${cell.cellId}' has invalid uncaptured costProvenance`)\n }\n return { kind: 'uncaptured', usd: null }\n }\n if (\n (provenance.kind !== 'observed' && provenance.kind !== 'estimated') ||\n !Number.isFinite(provenance.usd) ||\n provenance.usd < 0\n ) {\n throw new Error(`campaign cell '${cell.cellId}' has invalid costProvenance`)\n }\n if (provenance.usd !== cell.costUsd) {\n throw new Error(`campaign cell '${cell.cellId}' has costUsd inconsistent with costProvenance`)\n }\n return { kind: provenance.kind, usd: provenance.usd }\n}\n\nfunction campaignCellExecutionEvidence<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n): CampaignCellExecutionEvidence {\n if (cell.errorStage === 'dispatch') {\n return {\n terminalOutcome: 'failed',\n executionErrorCount: 1,\n ...(cell.error ? { terminalFailureReason: cell.error } : {}),\n }\n }\n if (cell.errorStage === 'judge') {\n return {\n terminalOutcome: 'succeeded',\n executionErrorCount: 0,\n judgeErrorCount: 1,\n }\n }\n if (!cell.error) {\n return { terminalOutcome: 'succeeded', executionErrorCount: 0 }\n }\n return {\n terminalOutcome: 'unknown',\n unclassifiedErrorCount: 1,\n }\n}\n\n/**\n * Produce the only task-quality view used by campaign aggregates and exports.\n *\n * Successful judge results remain available for diagnosis after another judge\n * fails, but a task score exists only for an error-free cell whose reported\n * judge values are all finite.\n */\nexport function projectCampaignCellQuality<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n): CampaignCellQualityProjection {\n if (cell.errorStage === 'dispatch') {\n return { successfulJudgeScores: {}, failedJudges: [], raw: {} }\n }\n\n const perJudge: Record<string, Record<string, number>> = {}\n const successfulJudgeScores: Record<string, JudgeScore> = {}\n const dimensionValues = new Map<string, number[]>()\n const composites: number[] = []\n const notes: string[] = []\n const failedJudges = new Set<string>(\n cell.errorStage === 'judge' ? [cell.errorJudge ?? 'unknown-judge'] : [],\n )\n const raw: Record<string, number> = {}\n\n for (const [judgeName, score] of Object.entries(cell.judgeScores)) {\n const dimensionsShape = (score as { dimensions?: unknown }).dimensions\n if (\n typeof dimensionsShape !== 'object' ||\n dimensionsShape === null ||\n Array.isArray(dimensionsShape)\n ) {\n throw new CampaignJudgeScoreShapeError(judgeName)\n }\n const finiteDimensions = Object.values(score.dimensions).every(Number.isFinite)\n if (score.failed || !Number.isFinite(score.composite) || !finiteDimensions) {\n failedJudges.add(judgeName)\n continue\n }\n\n composites.push(score.composite)\n successfulJudgeScores[judgeName] = score\n const dimensions = { ...score.dimensions }\n perJudge[judgeName] = dimensions\n for (const [dimension, value] of Object.entries(dimensions)) {\n raw[`${judgeName}.${dimension}`] = value\n const values = dimensionValues.get(dimension) ?? []\n values.push(value)\n dimensionValues.set(dimension, values)\n }\n if (score.notes) notes.push(`${judgeName}: ${score.notes}`)\n for (const failedJudge of score.failedJudges ?? []) {\n failedJudges.add(`${judgeName}/${failedJudge}`)\n }\n }\n\n if (failedJudges.size > 0) raw.judge_error_count = failedJudges.size\n const sortedFailedJudges = [...failedJudges].sort()\n if (composites.length === 0) {\n return {\n successfulJudgeScores,\n failedJudges: sortedFailedJudges,\n raw,\n }\n }\n\n const composite = mean(composites)\n const perDimMean = Object.fromEntries(\n [...dimensionValues.entries()].map(([dimension, values]) => [dimension, mean(values)]),\n )\n const complete =\n cell.error === undefined && cell.errorStage === undefined && failedJudges.size === 0\n if (complete) raw.composite = composite\n\n return {\n ...(complete ? { score: composite } : {}),\n raw,\n successfulJudgeScores,\n failedJudges: sortedFailedJudges,\n judgeScores: {\n perJudge,\n perDimMean,\n composite,\n ...(sortedFailedJudges.length > 0 ? { failedJudges: sortedFailedJudges } : {}),\n ...(notes.length > 0 ? { notes: notes.join(' | ') } : {}),\n },\n }\n}\n\nfunction finiteMetrics(metrics: Record<string, number> | undefined): Record<string, number> {\n const finite: Record<string, number> = {}\n for (const [key, value] of Object.entries(metrics ?? {})) {\n if (Number.isFinite(value)) finite[key] = value\n }\n return finite\n}\n"],"mappings":";;;;;;;;;;;;;AAuDA,IAAa,+BAAb,cAAkD,UAAU;CAC1D,YAAY,WAAmB;EAC7B,MACE,wBAAwB,UAAU,mQAIpC;EACA,KAAK,OAAO;CACd;AACF;;;;;;;;;AAkBA,SAAgB,wBACd,MACA,SACW;CACX,MAAM,UAAU,2BAA2B,IAAI;CAC/C,MAAM,YAAY,8BAA8B,IAAI;CACpD,MAAM,kBAAkB,KAAK,IAC3B,QAAQ,IAAI,qBAAqB,GACjC,UAAU,mBAAmB,CAC/B;CACA,MAAM,iBAAiB,8BAA8B,MAAM,QAAQ,cAAc;CACjF,MAAM,UAAU,eAAe;CAC/B,MAAM,MAA8B;EAClC,GAAG,cAAc,QAAQ,GAAG;EAC5B,GAAG,QAAQ;EACX,KAAK,KAAK;EACV,aAAa,KAAK;EAClB,GAAI,YAAY,OAAO,CAAC,IAAI,EAAE,UAAU,QAAQ;EAChD,cAAc,KAAK,WAAW;EAC9B,eAAe,KAAK,WAAW;EAC/B,cAAc,KAAK,WAAW,gBAAgB,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xC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,WAAW,CAAC,CAAC,GACrD,IAAI,OAAO,SAAS,KAAK,GAAG,OAAO,OAAO;CAE5C,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"run-record-CZy4-TnZ.js","names":[],"sources":["../src/campaign/run-record.ts"],"sourcesContent":["import type { AgentProfileCell } from '../agent-profile-cell'\nimport type { CostProvenance } from '../cost-ledger'\nimport type {\n JudgeScoresRecord,\n RunCostProvenance,\n RunOutcome,\n RunRecord,\n RunSearchCoordinates,\n RunSplitTag,\n RunTerminalOutcome,\n RunTraceRef,\n} from '../run-record'\nimport { validateRunRecord } from '../run-record'\nimport { mean } from '../statistics/mean'\nimport type { CampaignCellResult, JudgeScore } from './types'\n\ninterface CampaignCellRunRecordOptions {\n /** With `search`, this must be `searchCellRunId(search)`. */\n runId: string\n experimentId: string\n candidateId: string\n model: string\n promptHash: string\n configHash: string\n commitSha: string\n splitTag: RunSplitTag\n seed?: number\n scenarioId?: string\n /** Estimated total for a cell that proved no spend at all. A cell that\n * proved part of its spend keeps that floor instead. */\n defaultCostUsd?: number\n agentProfile?: AgentProfileCell\n raw?: Record<string, number>\n search?: RunSearchCoordinates\n traceRef?: RunTraceRef\n}\n\ninterface CampaignCellQualityProjection {\n score?: number\n judgeScores?: JudgeScoresRecord\n successfulJudgeScores: Record<string, JudgeScore>\n failedJudges: string[]\n raw: Record<string, number>\n}\n\n/**\n * A campaign cell carried a judge score without a `dimensions` record.\n *\n * Two exported types share the name `JudgeScore`: the campaign verdict\n * (`{ dimensions, composite, notes }` from `@tangle-network/agent-eval/campaign`)\n * and the root export's flat per-dimension row (`{ judgeName, dimension, score }`\n * from `@tangle-network/agent-eval`). Campaign aggregation accepts only the\n * campaign shape; the flat shape previously crashed here with an opaque\n * TypeError deep inside aggregation.\n */\nexport class CampaignJudgeScoreShapeError extends TypeError {\n constructor(judgeName: string) {\n super(\n `campaign cell judge '${judgeName}' carries a score without a 'dimensions' record. ` +\n `Use the campaign JudgeScore ({ dimensions, composite, notes }) from ` +\n `'@tangle-network/agent-eval/campaign'; the root export's JudgeScore ` +\n `({ judgeName, dimension, score }) is a different type with the same name.`,\n )\n this.name = 'CampaignJudgeScoreShapeError'\n }\n}\n\ninterface CampaignCellExecutionEvidence {\n terminalOutcome: RunTerminalOutcome\n executionErrorCount?: number\n judgeErrorCount?: number\n unclassifiedErrorCount?: number\n terminalFailureReason?: string\n}\n\n/**\n * Project one campaign cell into the canonical run format.\n *\n * A dispatch error establishes terminal execution failure. A judge error only\n * establishes that quality measurement failed after dispatch completed.\n * Failures without a stage remain unknown. No failure becomes a zero-quality\n * label.\n */\nexport function campaignCellToRunRecord<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n options: CampaignCellRunRecordOptions,\n): RunRecord {\n const quality = projectCampaignCellQuality(cell)\n const execution = campaignCellExecutionEvidence(cell)\n const judgeErrorCount = Math.max(\n quality.raw.judge_error_count ?? 0,\n execution.judgeErrorCount ?? 0,\n )\n const costProvenance = campaignCellRunCostProvenance(cell, options.defaultCostUsd)\n const costUsd = costProvenance.usd\n const raw: Record<string, number> = {\n ...finiteMetrics(options.raw),\n ...quality.raw,\n rep: cell.rep,\n duration_ms: cell.durationMs,\n ...(costUsd === null ? {} : { cost_usd: costUsd }),\n tokens_input: cell.tokenUsage.input,\n tokens_output: cell.tokenUsage.output,\n tokens_known: cell.tokenUsage.tokensKnown === false ? 0 : 1,\n latency_ms: cell.durationMs,\n ...(execution.executionErrorCount === undefined\n ? {}\n : { execution_error_count: execution.executionErrorCount }),\n ...(judgeErrorCount > 0 ? { judge_error_count: judgeErrorCount } : {}),\n ...(execution.unclassifiedErrorCount === undefined\n ? {}\n : { unclassified_error_count: execution.unclassifiedErrorCount }),\n }\n if (typeof cell.generation === 'number') raw.generation = cell.generation\n if (cell.tokenUsage.reasoning !== undefined) {\n raw.tokens_reasoning = cell.tokenUsage.reasoning\n }\n if (cell.tokenUsage.cached !== undefined) raw.tokens_cached = cell.tokenUsage.cached\n if (cell.tokenUsage.cacheWrite !== undefined) {\n raw.tokens_cache_write = cell.tokenUsage.cacheWrite\n }\n if (cell.tokenUsage.tokensKnown !== false && costUsd !== null && costUsd > 0) {\n raw.tokens_per_dollar = (cell.tokenUsage.input + cell.tokenUsage.output) / costUsd\n }\n if (costUsd !== null && quality.score !== undefined && quality.score > 0.01) {\n raw.cost_per_quality = costUsd / quality.score\n }\n\n const outcome: RunOutcome = {\n raw,\n ...(quality.judgeScores ? { judgeScores: quality.judgeScores } : {}),\n }\n if (quality.score !== undefined) {\n if (options.splitTag === 'holdout') outcome.holdoutScore = quality.score\n else outcome.searchScore = quality.score\n }\n\n return validateRunRecord({\n runId: options.runId,\n experimentId: options.experimentId,\n candidateId: options.candidateId,\n seed: options.seed ?? cell.seed,\n model: options.model,\n promptHash: options.promptHash,\n configHash: options.configHash,\n commitSha: options.commitSha,\n wallMs: cell.durationMs,\n costUsd,\n costProvenance,\n tokenUsage: { ...cell.tokenUsage },\n terminalOutcome: execution.terminalOutcome,\n ...(execution.terminalFailureReason\n ? { terminalFailureReason: execution.terminalFailureReason }\n : {}),\n outcome,\n splitTag: options.splitTag,\n scenarioId: options.scenarioId ?? cell.scenarioId,\n ...(options.agentProfile ? { agentProfile: options.agentProfile } : {}),\n ...(options.search ? { search: options.search } : {}),\n ...(options.traceRef ? { traceRef: options.traceRef } : {}),\n })\n}\n\n/**\n * A cell's cost as a RunRecord states it. An uncaptured cell's `costUsd` is\n * the spend its receipts proved, so a positive one is the run's floor. The\n * caller's `defaultCostUsd` stands in only when nothing was proved: a proven\n * floor is never replaced by a guess.\n */\nfunction campaignCellRunCostProvenance<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n defaultCostUsd: number | undefined,\n): RunCostProvenance {\n const provenance = campaignCellCostProvenance(cell)\n if (provenance.kind !== 'uncaptured') return provenance\n if (cell.costUsd > 0) return { kind: 'lower-bound', usd: null, knownLowerBoundUsd: cell.costUsd }\n return defaultCostUsd === undefined ? provenance : { kind: 'estimated', usd: defaultCostUsd }\n}\n\n/**\n * Validate the cost fields that cross campaign cache and RunRecord boundaries.\n * `costUsd` is a known subtotal for uncaptured cells, but it must equal the\n * authoritative total whenever that total is observed or estimated.\n */\nexport function campaignCellCostProvenance<TArtifact>(\n cell: Pick<CampaignCellResult<TArtifact>, 'cellId' | 'costUsd' | 'costProvenance'>,\n): CostProvenance {\n if (!Number.isFinite(cell.costUsd) || cell.costUsd < 0) {\n throw new Error(`campaign cell '${cell.cellId}' has invalid costUsd`)\n }\n const provenance = cell.costProvenance\n if (!provenance || typeof provenance !== 'object') {\n throw new Error(`campaign cell '${cell.cellId}' has no costProvenance`)\n }\n if (provenance.kind === 'uncaptured') {\n if (provenance.usd !== null) {\n throw new Error(`campaign cell '${cell.cellId}' has invalid uncaptured costProvenance`)\n }\n return { kind: 'uncaptured', usd: null }\n }\n if (\n (provenance.kind !== 'observed' && provenance.kind !== 'estimated') ||\n !Number.isFinite(provenance.usd) ||\n provenance.usd < 0\n ) {\n throw new Error(`campaign cell '${cell.cellId}' has invalid costProvenance`)\n }\n if (provenance.usd !== cell.costUsd) {\n throw new Error(`campaign cell '${cell.cellId}' has costUsd inconsistent with costProvenance`)\n }\n return { kind: provenance.kind, usd: provenance.usd }\n}\n\nfunction campaignCellExecutionEvidence<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n): CampaignCellExecutionEvidence {\n if (cell.errorStage === 'dispatch') {\n return {\n terminalOutcome: 'failed',\n executionErrorCount: 1,\n ...(cell.error ? { terminalFailureReason: cell.error } : {}),\n }\n }\n if (cell.errorStage === 'judge') {\n return {\n terminalOutcome: 'succeeded',\n executionErrorCount: 0,\n judgeErrorCount: 1,\n }\n }\n if (!cell.error) {\n return { terminalOutcome: 'succeeded', executionErrorCount: 0 }\n }\n return {\n terminalOutcome: 'unknown',\n unclassifiedErrorCount: 1,\n }\n}\n\n/**\n * Produce the only task-quality view used by campaign aggregates and exports.\n *\n * Successful judge results remain available for diagnosis after another judge\n * fails, but a task score exists only for an error-free cell whose reported\n * judge values are all finite.\n */\nexport function projectCampaignCellQuality<TArtifact>(\n cell: CampaignCellResult<TArtifact>,\n): CampaignCellQualityProjection {\n if (cell.errorStage === 'dispatch') {\n return { successfulJudgeScores: {}, failedJudges: [], raw: {} }\n }\n\n const perJudge: Record<string, Record<string, number>> = {}\n const successfulJudgeScores: Record<string, JudgeScore> = {}\n const dimensionValues = new Map<string, number[]>()\n const composites: number[] = []\n const notes: string[] = []\n const failedJudges = new Set<string>(\n cell.errorStage === 'judge' ? [cell.errorJudge ?? 'unknown-judge'] : [],\n )\n const raw: Record<string, number> = {}\n\n for (const [judgeName, score] of Object.entries(cell.judgeScores)) {\n const dimensionsShape = (score as { dimensions?: unknown }).dimensions\n if (\n typeof dimensionsShape !== 'object' ||\n dimensionsShape === null ||\n Array.isArray(dimensionsShape)\n ) {\n throw new CampaignJudgeScoreShapeError(judgeName)\n }\n const finiteDimensions = Object.values(score.dimensions).every(Number.isFinite)\n if (score.failed || !Number.isFinite(score.composite) || !finiteDimensions) {\n failedJudges.add(judgeName)\n continue\n }\n\n composites.push(score.composite)\n successfulJudgeScores[judgeName] = score\n const dimensions = { ...score.dimensions }\n perJudge[judgeName] = dimensions\n for (const [dimension, value] of Object.entries(dimensions)) {\n raw[`${judgeName}.${dimension}`] = value\n const values = dimensionValues.get(dimension) ?? []\n values.push(value)\n dimensionValues.set(dimension, values)\n }\n if (score.notes) notes.push(`${judgeName}: ${score.notes}`)\n for (const failedJudge of score.failedJudges ?? []) {\n failedJudges.add(`${judgeName}/${failedJudge}`)\n }\n }\n\n if (failedJudges.size > 0) raw.judge_error_count = failedJudges.size\n const sortedFailedJudges = [...failedJudges].sort()\n if (composites.length === 0) {\n return {\n successfulJudgeScores,\n failedJudges: sortedFailedJudges,\n raw,\n }\n }\n\n const composite = mean(composites)\n const perDimMean = Object.fromEntries(\n [...dimensionValues.entries()].map(([dimension, values]) => [dimension, mean(values)]),\n )\n const complete =\n cell.error === undefined && cell.errorStage === undefined && failedJudges.size === 0\n if (complete) raw.composite = composite\n\n return {\n ...(complete ? { score: composite } : {}),\n raw,\n successfulJudgeScores,\n failedJudges: sortedFailedJudges,\n judgeScores: {\n perJudge,\n perDimMean,\n composite,\n ...(sortedFailedJudges.length > 0 ? { failedJudges: sortedFailedJudges } : {}),\n ...(notes.length > 0 ? { notes: notes.join(' | ') } : {}),\n },\n }\n}\n\nfunction finiteMetrics(metrics: Record<string, number> | undefined): Record<string, number> {\n const finite: Record<string, number> = {}\n for (const [key, value] of Object.entries(metrics ?? {})) {\n if (Number.isFinite(value)) finite[key] = value\n }\n return finite\n}\n"],"mappings":";;;;;;;;;;;;;AAuDA,IAAa,+BAAb,cAAkD,UAAU;CAC1D,YAAY,WAAmB;EAC7B,MACE,wBAAwB,UAAU,mQAIpC;EACA,KAAK,OAAO;CACd;AACF;;;;;;;;;AAkBA,SAAgB,wBACd,MACA,SACW;CACX,MAAM,UAAU,2BAA2B,IAAI;CAC/C,MAAM,YAAY,8BAA8B,IAAI;CACpD,MAAM,kBAAkB,KAAK,IAC3B,QAAQ,IAAI,qBAAqB,GACjC,UAAU,mBAAmB,CAC/B;CACA,MAAM,iBAAiB,8BAA8B,MAAM,QAAQ,cAAc;CACjF,MAAM,UAAU,eAAe;CAC/B,MAAM,MAA8B;EAClC,GAAG,cAAc,QAAQ,GAAG;EAC5B,GAAG,QAAQ;EACX,KAAK,KAAK;EACV,aAAa,KAAK;EAClB,GAAI,YAAY,OAAO,CAAC,IAAI,EAAE,UAAU,QAAQ;EAChD,cAAc,KAAK,WAAW;EAC9B,eAAe,KAAK,WAAW;EAC/B,cAAc,KAAK,WAAW,gBAAgB,QAAQ,IAAI;EAC1D,YAAY,KAAK;EACjB,GAAI,UAAU,wBAAwB,KAAA,IAClC,CAAC,IACD,EAAE,uBAAuB,UAAU,oBAAoB;EAC3D,GAAI,kBAAkB,IAAI,EAAE,mBAAmB,gBAAgB,IAAI,CAAC;EACpE,G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venance } from "./cost-ledger-
|
|
2
|
-
import { c as ValidationError } from "./errors-
|
|
3
|
-
import { r as AgentProfileCell } from "./agent-profile-cell-
|
|
4
|
-
import { o as FailureClass } from "./schema-
|
|
5
|
-
//#region src/run-record.d.ts
|
|
1
|
+
import { u as CostProvenance } from "./cost-ledger-Czro9wmo.js";
|
|
2
|
+
import { c as ValidationError } from "./errors-E9I2hldP.js";
|
|
3
|
+
import { r as AgentProfileCell } from "./agent-profile-cell-3kYxUsK2.js";
|
|
4
|
+
import { o as FailureClass } from "./schema-CkIvnmLU.js";
|
|
6
5
|
/** Search/dev/holdout split tag. 'search' is the paper-grade alias for the
|
|
7
6
|
* combined train+test pool that the optimizer is allowed to read. */
|
|
8
7
|
type RunSplitTag = 'search' | 'dev' | 'holdout';
|
|
@@ -284,6 +283,5 @@ declare function parseRunRecordSafe(input: unknown): {
|
|
|
284
283
|
* immutable model identities.
|
|
285
284
|
*/
|
|
286
285
|
declare function modelHasSnapshot(model: string): boolean;
|
|
287
|
-
//#endregion
|
|
288
286
|
export { runTaskScore as _, RunRecord as a, RunSplitTag as c, RunTokenUsage as d, RunTraceRef as f, parseRunRecordSafe as g, modelHasSnapshot as h, RunOutcome as i, RunTaskFailure as l, isRunRecord as m, RunCostProvenance as n, RunRecordValidationError as o, UNKNOWN_MODEL as p, RunJudgeMetadata as r, RunSearchCoordinates as s, JudgeScoresRecord as t, RunTerminalOutcome as u, validateRunRecord as v };
|
|
289
|
-
//# sourceMappingURL=run-record-
|
|
287
|
+
//# sourceMappingURL=run-record-D2BFMPGl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-D2BFMPGl.d.ts","names":[],"sources":["../src/run-record.ts"],"mappings":";;;;;;KAsCY;;;;;;;KAQA;;cAGC;UAEI;EACf;;EAEA;;;EAGA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;KAgBU,oBACR;EACE;EAAqB;EAAW;;;;;;;UAOrB;EACf;EACA;;;EAGA;;EAEA;;;UAIe;;EAEf;;EAEA;;UAYe;EACf;EACA;;;EAGA;;;EAGA;;;;;;;;;;;;;;;;;;;;;UAsBe;;EAEf,UAAU,eAAe;;EAEzB,YAAY;;;EAGZ;;;;EAIA;;;EAGA;;UAGe;;;EAGf;;;EAGA;;;;EAIA,KAAK;;;;;;EAML,cAAc;;;;;;;EAOd;IAAa;IAAe;IAAgB;;;;;;;;;;;;;;;;;;;;;;UAsB7B;;EAEf;;;EAGA;;;EAGA;;;EAGA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;EAGA,gBAAgB;;EAEhB,YAAY;;EAEZ,iBAAiB;;;EAGjB;;EAEA,gBAAgB;;EAEhB,SAAS;;;;;EAKT,eAAe;;;EAGf;;EAEA,UAAU;;;;;EAKV;;;;;;;;EAQA,eAAe;;;EAGf,SAAS;;;EAGT,WAAW;;;;;;;;;KAUD;EACN;EAA0B;;EAC1B;EAAyB;;EAEzB,cAAc,QAAQ;EACtB;;;;;;;;;;iBAWU,aAAa,QAAQ;cAmCxB,iCAAiC;WACnC;EACG,YAAA,iBAAiB;;;;;;;iBAWf,kBAAkB,iBAAiB;;iBA2SnC,YAAY,iBAAiB,SAAS;;iBAUtC,mBACd;EACG;EAAU,OAAO;;EAAgB;EAAW,OAAO;;;;;;;;iBA2FxC,iBAAiB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { s as ValidationError } from "./errors-
|
|
2
|
-
import { s as validateAgentProfileCell } from "./agent-profile-cell-
|
|
3
|
-
import { n as observedScore } from "./reward-
|
|
4
|
-
import { t as FAILURE_CLASSES } from "./schema-
|
|
5
|
-
|
|
1
|
+
import { s as ValidationError } from "./errors-DeEEV9Vx.js";
|
|
2
|
+
import { s as validateAgentProfileCell } from "./agent-profile-cell-CT5JYueM.js";
|
|
3
|
+
import { n as observedScore } from "./reward-P0VD_Aft.js";
|
|
4
|
+
import { t as FAILURE_CLASSES } from "./schema-D-xu3MU_.js";
|
|
5
|
+
// src/run-record.ts
|
|
6
6
|
/** Explicit model value for a row that never produced a served model snapshot. */
|
|
7
7
|
const UNKNOWN_MODEL = "unknown";
|
|
8
8
|
/**
|
|
@@ -280,7 +280,6 @@ function validSnapshotDate(year, month, day) {
|
|
|
280
280
|
];
|
|
281
281
|
return Number.isInteger(dayNumber) && dayNumber >= 1 && dayNumber <= daysInMonth[monthNumber - 1];
|
|
282
282
|
}
|
|
283
|
-
//#endregion
|
|
284
283
|
export { parseRunRecordSafe as a, validateRunRecord as c, modelHasSnapshot as i, UNKNOWN_MODEL as n, runTaskScore as o, isRunRecord as r, searchCellRunId as s, RunRecordValidationError as t };
|
|
285
284
|
|
|
286
|
-
//# sourceMappingURL=run-record-
|
|
285
|
+
//# sourceMappingURL=run-record-DEjx43cI.js.map
|