@tangle-network/agent-eval 0.216.1 → 0.217.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +102 -57
- package/README.md +2 -2
- package/dist/adapters/http.d.ts +2 -2
- package/dist/{agent-profile-VFcQncbW.d.ts → agent-profile-DTt8uGP9.d.ts} +4 -17
- package/dist/agent-profile-DTt8uGP9.d.ts.map +1 -0
- package/dist/{agent-profile-cell-BK8mlqlq.js → agent-profile-cell-B1V1gUZs.js} +4 -53
- package/dist/agent-profile-cell-B1V1gUZs.js.map +1 -0
- package/dist/{agent-profile-cell-BNp-Js9F.d.ts → agent-profile-cell-BcpFbNd5.d.ts} +2 -22
- package/dist/agent-profile-cell-BcpFbNd5.d.ts.map +1 -0
- package/dist/{agreement-irr-BEWLIF3_.js → agreement-irr-BhAqjluA.js} +5 -5
- package/dist/agreement-irr-BhAqjluA.js.map +1 -0
- package/dist/analyst/index.d.ts +36 -169
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +17 -192
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-C84irm4i.js → analyze-runs-DqPJaJ4X.js} +225 -21
- package/dist/analyze-runs-DqPJaJ4X.js.map +1 -0
- package/dist/{analyze-runs-D68fd-su.d.ts → analyze-runs-DyeNcenW.d.ts} +5 -5
- package/dist/{analyze-runs-D68fd-su.d.ts.map → analyze-runs-DyeNcenW.d.ts.map} +1 -1
- package/dist/authenticity/index.d.ts +0 -23
- package/dist/authenticity/index.d.ts.map +1 -1
- package/dist/authenticity/index.js +1 -34
- package/dist/authenticity/index.js.map +1 -1
- package/dist/{benchmark-command-By0vh8q7.js → benchmark-command-xQK8nOI6.js} +554 -89
- package/dist/benchmark-command-xQK8nOI6.js.map +1 -0
- package/dist/benchmarks/index.d.ts +5 -6
- package/dist/benchmarks/index.d.ts.map +1 -1
- package/dist/benchmarks/index.js +4 -4
- package/dist/benchmarks/index.js.map +1 -1
- package/dist/builder-eval/index.d.ts +3 -3
- package/dist/builder-eval/index.js +2 -2
- package/dist/builder-eval/index.js.map +1 -1
- package/dist/campaign/index.d.ts +7 -7
- package/dist/campaign/index.js +15 -15
- package/dist/{campaign-BudZ70zo.js → campaign-CJGkxAQ6.js} +23 -530
- package/dist/campaign-CJGkxAQ6.js.map +1 -0
- package/dist/{campaign-evidence-Clrn4hBV.js → campaign-evidence-CQYw8_0H.js} +10 -18
- package/dist/{campaign-evidence-Clrn4hBV.js.map → campaign-evidence-CQYw8_0H.js.map} +1 -1
- package/dist/{canonical-B2RqLofv.js → canonical-Dq2hOQ8L.js} +2 -2
- package/dist/{canonical-B2RqLofv.js.map → canonical-Dq2hOQ8L.js.map} +1 -1
- package/dist/cell-spend-DEWR3nj-.js +90 -0
- package/dist/cell-spend-DEWR3nj-.js.map +1 -0
- package/dist/{chat-client-l-MVDlDk.js → chat-client-ldqxYYTN.js} +2 -2
- package/dist/{chat-client-l-MVDlDk.js.map → chat-client-ldqxYYTN.js.map} +1 -1
- package/dist/{chat-json-call-puMArmtW.js → chat-json-call-DavzexSp.js} +3 -2
- package/dist/chat-json-call-DavzexSp.js.map +1 -0
- package/dist/{claim-q4HQhK1G.js → claim-BPVuyHuy.js} +3 -3
- package/dist/{claim-q4HQhK1G.js.map → claim-BPVuyHuy.js.map} +1 -1
- package/dist/cli.js +113 -12
- package/dist/cli.js.map +1 -1
- package/dist/{client-BzL9niqi.d.ts → client-hwo3cJjR.d.ts} +3 -16
- package/dist/client-hwo3cJjR.d.ts.map +1 -0
- package/dist/{cluster-bootstrap-qcUWYFl-.js → cluster-bootstrap-DEwwhl0C.js} +3 -3
- package/dist/{cluster-bootstrap-qcUWYFl-.js.map → cluster-bootstrap-DEwwhl0C.js.map} +1 -1
- package/dist/{produced-state-BsDmnwxc.js → completion-verifier-B_jw6C9p.js} +9 -64
- package/dist/completion-verifier-B_jw6C9p.js.map +1 -0
- package/dist/contract/index.d.ts +12 -12
- package/dist/contract/index.js +25 -401
- package/dist/contract/index.js.map +1 -1
- package/dist/{cost-ledger-BP8V4kUQ.js → cost-ledger-D0352Z4d.js} +4 -8
- package/dist/cost-ledger-D0352Z4d.js.map +1 -0
- package/dist/dataset-DQqhOCPt.d.ts.map +1 -1
- package/dist/{default-registry-COhk9g36.js → default-registry-ClYjq3QE.js} +8 -11
- package/dist/default-registry-ClYjq3QE.js.map +1 -0
- package/dist/{default-registry-DzHiGruW.d.ts → default-registry-DXgLmoDI.d.ts} +7 -50
- package/dist/default-registry-DXgLmoDI.d.ts.map +1 -0
- package/dist/{define-agent-eval-CNTPzIkp.js → define-agent-eval-BDxNlP3D.js} +10 -10
- package/dist/{define-agent-eval-CNTPzIkp.js.map → define-agent-eval-BDxNlP3D.js.map} +1 -1
- package/dist/{define-agent-eval-WSck0CZJ.d.ts → define-agent-eval-BIkH_gAR.d.ts} +8 -8
- package/dist/define-agent-eval-BIkH_gAR.d.ts.map +1 -0
- package/dist/{descriptive-DboxPZrG.js → descriptive-CVNy48rR.js} +2 -2
- package/dist/{descriptive-DboxPZrG.js.map → descriptive-CVNy48rR.js.map} +1 -1
- package/dist/diagnosis/index.d.ts +4 -14
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +67 -28
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{dspy-rlm-engine-LRCu61m5.js → dspy-rlm-engine-DhdCr1Dc.js} +5 -10
- package/dist/dspy-rlm-engine-DhdCr1Dc.js.map +1 -0
- package/dist/{emitter-HcCmFQl_.d.ts → emitter-DABYYTcH.d.ts} +5 -5
- package/dist/emitter-DABYYTcH.d.ts.map +1 -0
- package/dist/emitter-DbMXUIVP.js.map +1 -1
- package/dist/{engine-3A_4jOlI.d.ts → engine-BvZ0R-36.d.ts} +17 -21
- package/dist/engine-BvZ0R-36.d.ts.map +1 -0
- package/dist/{equal-terms-BtdXayCJ.js → equal-terms-DbPGcVtI.js} +2 -2
- package/dist/equal-terms-DbPGcVtI.js.map +1 -0
- package/dist/{errors-DVZiqS7K.js → errors-BcOs5MKW.js} +2 -8
- package/dist/{errors-DVZiqS7K.js.map → errors-BcOs5MKW.js.map} +1 -1
- package/dist/{eval-campaign-90jeaCAI.js → eval-campaign-BLEfBGbA.js} +6 -6
- package/dist/{eval-campaign-90jeaCAI.js.map → eval-campaign-BLEfBGbA.js.map} +1 -1
- package/dist/{evaluation-6Yoi74gM.d.ts → evaluation-jTjC_QQD.d.ts} +7 -7
- package/dist/evaluation-jTjC_QQD.d.ts.map +1 -0
- package/dist/evaluation.d.ts +2 -2
- package/dist/evaluation.js +1 -1
- package/dist/evaluation.js.map +1 -1
- package/dist/{exact-types-ClugMJfI.d.ts → exact-types-CflbJ9f3.d.ts} +2 -2
- package/dist/{exact-types-ClugMJfI.d.ts.map → exact-types-CflbJ9f3.d.ts.map} +1 -1
- package/dist/{exec-ChJ6d5if.js → exec-CpbtOXVt.js} +2 -24
- package/dist/{exec-ChJ6d5if.js.map → exec-CpbtOXVt.js.map} +1 -1
- package/dist/execution-tracks-CpgFPpS5.js.map +1 -1
- package/dist/experiment/index.d.ts +9 -112
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +149 -241
- package/dist/experiment/index.js.map +1 -1
- package/dist/{exporters-X4xwla8A.js → exporters-Cl6IeNAu.js} +3 -3
- package/dist/exporters-Cl6IeNAu.js.map +1 -0
- package/dist/{exporters-ChTnR90l.d.ts → exporters-Dk3oEbK_.d.ts} +2 -4
- package/dist/{exporters-ChTnR90l.d.ts.map → exporters-Dk3oEbK_.d.ts.map} +1 -1
- package/dist/{external-optimizer-process-BjMGUuds.js → external-optimizer-process-KVFGvYX1.js} +4 -3
- package/dist/external-optimizer-process-KVFGvYX1.js.map +1 -0
- package/dist/{external-optimizer-subprocess-BqW0hHcI.js → external-optimizer-subprocess-XIHBOSKt.js} +9 -11
- package/dist/external-optimizer-subprocess-XIHBOSKt.js.map +1 -0
- package/dist/{extract-usage-BrnzRJ6H.js → extract-usage-BZLU01kR.js} +2 -23
- package/dist/{extract-usage-BrnzRJ6H.js.map → extract-usage-BZLU01kR.js.map} +1 -1
- package/dist/{failure-cluster-CbgEDcFJ.d.ts → failure-cluster-DN0t63Z0.d.ts} +4 -43
- package/dist/failure-cluster-DN0t63Z0.d.ts.map +1 -0
- package/dist/{failure-taxonomy-CjabTATj.js → failure-taxonomy-Bx5oWqaW.js} +2 -19
- package/dist/{failure-taxonomy-CjabTATj.js.map → failure-taxonomy-Bx5oWqaW.js.map} +1 -1
- package/dist/{feedback-trajectory-C4EG0nNH.d.ts → feedback-trajectory-BWmhRBGu.d.ts} +7 -9
- package/dist/feedback-trajectory-BWmhRBGu.d.ts.map +1 -0
- package/dist/{semantic-concept-judge-BQF8te0T.js → findings-store-BMVQtEsm.js} +9 -249
- package/dist/findings-store-BMVQtEsm.js.map +1 -0
- package/dist/fuzz.d.ts +19 -62
- package/dist/fuzz.d.ts.map +1 -1
- package/dist/fuzz.js +62 -108
- package/dist/fuzz.js.map +1 -1
- package/dist/{hf-dataset-BR2yhuNn.js → hf-dataset-D9f7-oX7.js} +4 -24
- package/dist/hf-dataset-D9f7-oX7.js.map +1 -0
- package/dist/hosted/index.d.ts +2 -2
- package/dist/hosted/index.js +2 -2
- package/dist/{index-DHKEAv3s.d.ts → index-9jJ2fKSX.d.ts} +2 -64
- package/dist/index-9jJ2fKSX.d.ts.map +1 -0
- package/dist/{index-DV-jSzxF.d.ts → index-BLGqZ81N.d.ts} +10 -15
- package/dist/{index-DV-jSzxF.d.ts.map → index-BLGqZ81N.d.ts.map} +1 -1
- package/dist/{index-DPcngtwt.d.ts → index-BiT6RtNH.d.ts} +11 -36
- package/dist/index-BiT6RtNH.d.ts.map +1 -0
- package/dist/{index-BO41eGj5.d.ts → index-CX-GAUpw.d.ts} +3 -7
- package/dist/index-CX-GAUpw.d.ts.map +1 -0
- package/dist/{index-BFRO6chs.d.ts → index-CiRwLv2R.d.ts} +5 -69
- package/dist/index-CiRwLv2R.d.ts.map +1 -0
- package/dist/{index-CyszSg4O.d.ts → index-ZuWx52WG.d.ts} +115 -347
- package/dist/index-ZuWx52WG.d.ts.map +1 -0
- package/dist/index.d.ts +211 -218
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +402 -1040
- package/dist/index.js.map +1 -1
- package/dist/{integrity-dLiDe2kD.js → integrity-DOd9Q86O.js} +7 -9
- package/dist/integrity-DOd9Q86O.js.map +1 -0
- package/dist/{integrity-BXOsAb3i.js → integrity-W4CADcFc.js} +3 -7
- package/dist/{integrity-BXOsAb3i.js.map → integrity-W4CADcFc.js.map} +1 -1
- package/dist/{integrity-DAMEDFaC.d.ts → integrity-_qgZLA5p.d.ts} +4 -6
- package/dist/{integrity-DAMEDFaC.d.ts.map → integrity-_qgZLA5p.d.ts.map} +1 -1
- package/dist/{internal-Epl-YBZW.js → internal-BTK91Bqt.js} +3 -3
- package/dist/{internal-Epl-YBZW.js.map → internal-BTK91Bqt.js.map} +1 -1
- package/dist/{interval-CELpye1n.js → interval-Dq9gt7jx.js} +3 -3
- package/dist/{interval-CELpye1n.js.map → interval-Dq9gt7jx.js.map} +1 -1
- package/dist/{journal-DfRz9kps.js → journal-CR4QikYp.js} +110 -110
- package/dist/journal-CR4QikYp.js.map +1 -0
- package/dist/json-BhdsJaOQ.js +111 -0
- package/dist/json-BhdsJaOQ.js.map +1 -0
- package/dist/{judge-calibration-BpCy5XQl.js → judge-calibration-BkXMIWA4.js} +3 -3
- package/dist/{judge-calibration-BpCy5XQl.js.map → judge-calibration-BkXMIWA4.js.map} +1 -1
- package/dist/{judge-gate-iY9s4L44.js → judge-gate-Co5tuh57.js} +4 -27
- package/dist/{judge-gate-iY9s4L44.js.map → judge-gate-Co5tuh57.js.map} +1 -1
- package/dist/{judge-gate-CE7CQAgt.d.ts → judge-gate-DsL0yFcb.d.ts} +8 -9
- package/dist/judge-gate-DsL0yFcb.d.ts.map +1 -0
- package/dist/{kind-factory-BobI5Jy3.js → kind-factory-Gy4fXixd.js} +88 -17
- package/dist/kind-factory-Gy4fXixd.js.map +1 -0
- package/dist/ledger-core/index.d.ts +2 -2
- package/dist/ledger-core/index.js +4 -4
- package/dist/{ledger-core-Gq7yp8lP.js → ledger-core-DrJhbms9.js} +5 -84
- package/dist/ledger-core-DrJhbms9.js.map +1 -0
- package/dist/{llm-client-CyBAoYiX.js → llm-client-BshCREn6.js} +6 -108
- package/dist/llm-client-BshCREn6.js.map +1 -0
- package/dist/{llm-judge-CG12SQJq.js → llm-judge-C8jMTNNG.js} +24 -32
- package/dist/llm-judge-C8jMTNNG.js.map +1 -0
- package/dist/matrix/index.d.ts +3 -3
- package/dist/matrix/index.js +3 -2
- package/dist/{matrix-Dm0BQW7U.js → matrix-B8l-Nsxd.js} +3 -88
- package/dist/matrix-B8l-Nsxd.js.map +1 -0
- package/dist/{matrix-DSrSxjjy.d.ts → matrix-DHe-dwVJ.d.ts} +9 -18
- package/dist/matrix-DHe-dwVJ.d.ts.map +1 -0
- package/dist/{mean-DHoMiudD.js → mean-BbA_JCzW.js} +39 -5
- package/dist/mean-BbA_JCzW.js.map +1 -0
- package/dist/meta-eval/index.d.ts +5 -5
- package/dist/meta-eval/index.js +10 -10
- package/dist/metrics-BKaPBtIG.js.map +1 -1
- package/dist/{mint-DNU8QPG4.d.ts → mint-BRZXuwRi.d.ts} +4 -4
- package/dist/{mint-DNU8QPG4.d.ts.map → mint-BRZXuwRi.d.ts.map} +1 -1
- package/dist/{mint-QaD5cA0u.js → mint-zszyYlpA.js} +4 -4
- package/dist/{mint-QaD5cA0u.js.map → mint-zszyYlpA.js.map} +1 -1
- package/dist/{multi-layer-verifier-BUaQ4C17.d.ts → multi-layer-verifier-DEgMUk6v.d.ts} +2 -2
- package/dist/{multi-layer-verifier-BUaQ4C17.d.ts.map → multi-layer-verifier-DEgMUk6v.d.ts.map} +1 -1
- package/dist/{multiplicity-DQUFcbW4.js → multiplicity-Sg0U7h8j.js} +2 -2
- package/dist/{multiplicity-DQUFcbW4.js.map → multiplicity-Sg0U7h8j.js.map} +1 -1
- package/dist/multishot/golden/index.d.ts +1 -23
- package/dist/multishot/golden/index.d.ts.map +1 -1
- package/dist/multishot/golden/index.js +3 -3
- package/dist/multishot/golden/index.js.map +1 -1
- package/dist/multishot/index.d.ts +3 -12
- package/dist/multishot/index.d.ts.map +1 -1
- package/dist/multishot/index.js +4 -3
- package/dist/multishot/index.js.map +1 -1
- package/dist/openapi.json +114 -10
- package/dist/{otel-spans-B9tUXRHF.js → otel-spans-CdN909k1.js} +3 -3
- package/dist/{otel-spans-B9tUXRHF.js.map → otel-spans-CdN909k1.js.map} +1 -1
- package/dist/{paired-arms-CwMGJsrS.js → paired-arms-Ct4LTKc1.js} +32 -9
- package/dist/paired-arms-Ct4LTKc1.js.map +1 -0
- package/dist/{paired-binary-CvpFHfKZ.js → paired-binary-B_nejA44.js} +3 -36
- package/dist/paired-binary-B_nejA44.js.map +1 -0
- package/dist/{paired-promotion-decision-DPKz8ZnF.d.ts → paired-promotion-decision-CQMJ5xGN.d.ts} +2 -34
- package/dist/paired-promotion-decision-CQMJ5xGN.d.ts.map +1 -0
- package/dist/{paired-promotion-decision-DsAPYGCm.js → paired-promotion-decision-D0SHb-ZL.js} +3 -3
- package/dist/{paired-promotion-decision-DsAPYGCm.js.map → paired-promotion-decision-D0SHb-ZL.js.map} +1 -1
- package/dist/{pareto-Cm6ndrWN.js → pareto-BzsxidFD.js} +11 -11
- package/dist/pareto-BzsxidFD.js.map +1 -0
- package/dist/pipelines/index.d.ts +16 -19
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js +4 -68
- package/dist/pipelines/index.js.map +1 -1
- package/dist/{power-and-mde-Hj2ubb4B.js → power-and-mde-N5nU4_Ly.js} +3 -3
- package/dist/{power-and-mde-Hj2ubb4B.js.map → power-and-mde-N5nU4_Ly.js.map} +1 -1
- package/dist/{prime-protocol-CHKgA3a6.js → prime-protocol-BFgGrEMP.js} +3 -3
- package/dist/prime-protocol-BFgGrEMP.js.map +1 -0
- package/dist/{prime-protocol-HiB9HX7E.d.ts → prime-protocol-BWG2DQIk.d.ts} +3 -21
- package/dist/prime-protocol-BWG2DQIk.d.ts.map +1 -0
- package/dist/profile-cell.d.ts +2 -2
- package/dist/profile-cell.js +2 -2
- package/dist/{promotion-gate-BawrdPYr.d.ts → promotion-gate-DaY95yU6.d.ts} +7 -8
- package/dist/{promotion-gate-BawrdPYr.d.ts.map → promotion-gate-DaY95yU6.d.ts.map} +1 -1
- package/dist/{promotion-policy-KO57gbyV.js → promotion-policy-6A8osGr_.js} +4 -4
- package/dist/{promotion-policy-KO57gbyV.js.map → promotion-policy-6A8osGr_.js.map} +1 -1
- package/dist/{proposal-findings-CY1xKn_a.js → proposal-findings-BbWidvUk.js} +3 -3
- package/dist/proposal-findings-BbWidvUk.js.map +1 -0
- package/dist/{query-BUCZCK7F.js → query-B_RZ36an.js} +5 -5
- package/dist/query-B_RZ36an.js.map +1 -0
- package/dist/{query-DK1nWcmp.d.ts → query-Cmv_U8vf.d.ts} +4 -24
- package/dist/{query-DK1nWcmp.d.ts.map → query-Cmv_U8vf.d.ts.map} +1 -1
- package/dist/{random-ByUSnV9w.js → random-DDDcC7YU.js} +2 -2
- package/dist/{random-ByUSnV9w.js.map → random-DDDcC7YU.js.map} +1 -1
- package/dist/{raw-provider-sink-DoHz4JNG.js → raw-provider-sink-75w4FWBj.js} +2 -2
- package/dist/{raw-provider-sink-DoHz4JNG.js.map → raw-provider-sink-75w4FWBj.js.map} +1 -1
- package/dist/{redact-mtCCcT8z.d.ts → redact-DXdlFb_U.d.ts} +2 -3
- package/dist/redact-DXdlFb_U.d.ts.map +1 -0
- package/dist/{redact-B5xXKqQ3.js → redact-mtkTiJVk.js} +2 -7
- package/dist/{redact-B5xXKqQ3.js.map → redact-mtkTiJVk.js.map} +1 -1
- package/dist/{registry-D7_hm2fK.d.ts → registry-ssNoHzwD.d.ts} +4 -4
- package/dist/{registry-D7_hm2fK.d.ts.map → registry-ssNoHzwD.d.ts.map} +1 -1
- package/dist/{release-confidence-CpuP65S5.js → release-confidence-CYIFH-fp.js} +6 -11
- package/dist/release-confidence-CYIFH-fp.js.map +1 -0
- package/dist/{report-command-SC9nqb4M.js → render-C-w2EZ6p.js} +205 -363
- package/dist/render-C-w2EZ6p.js.map +1 -0
- package/dist/reporting.d.ts +6 -6
- package/dist/reporting.js +8 -8
- package/dist/{researcher-CEcfku-T.d.ts → researcher-0ABVIdGa.d.ts} +9 -9
- package/dist/{researcher-CEcfku-T.d.ts.map → researcher-0ABVIdGa.d.ts.map} +1 -1
- package/dist/{reward-CpCmAM8L.d.ts → reward-DrZ71vnf.d.ts} +3 -26
- package/dist/reward-DrZ71vnf.d.ts.map +1 -0
- package/dist/{reward-hacking-E0d-WVcP.js → reward-hacking-ByuETaIb.js} +3 -3
- package/dist/{reward-hacking-E0d-WVcP.js.map → reward-hacking-ByuETaIb.js.map} +1 -1
- package/dist/{reward-hacking-RVdZ6Kkt.d.ts → reward-hacking-E52wq86n.d.ts} +5 -18
- package/dist/reward-hacking-E52wq86n.d.ts.map +1 -0
- package/dist/reward-nw2xZGZG.js.map +1 -1
- package/dist/rl.d.ts +117 -295
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +27 -747
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +5 -5
- package/dist/rollout/index.js +7 -8
- package/dist/{rollout-DZV1t2Wg.js → rollout-D6C50mfA.js} +88 -13
- package/dist/rollout-D6C50mfA.js.map +1 -0
- package/dist/{rubric-predictive-validity-DaFW70y9.js → rubric-predictive-validity-D3_oI72N.js} +3 -3
- package/dist/{rubric-predictive-validity-DaFW70y9.js.map → rubric-predictive-validity-D3_oI72N.js.map} +1 -1
- package/dist/{rubric-predictive-validity-C03EC7ZE.d.ts → rubric-predictive-validity-DiwT8PbL.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-C03EC7ZE.d.ts.map → rubric-predictive-validity-DiwT8PbL.d.ts.map} +1 -1
- package/dist/{run-record-C1E24G2A.d.ts → run-record-CaxbLq6Y.d.ts} +4 -10
- package/dist/run-record-CaxbLq6Y.d.ts.map +1 -0
- package/dist/{run-record-C5e7FjhJ.js → run-record-CysKLB93.js} +3 -3
- package/dist/run-record-CysKLB93.js.map +1 -0
- package/dist/{run-record-Boc5IUTp.js → run-record-DhEJgoPz.js} +4 -4
- package/dist/{run-record-Boc5IUTp.js.map → run-record-DhEJgoPz.js.map} +1 -1
- package/dist/sandbox-harness-BlSOu4LX.d.ts.map +1 -1
- package/dist/{schema-CSf6qWgZ.js → schema-Bt2vLFm3.js} +2 -14
- package/dist/schema-Bt2vLFm3.js.map +1 -0
- package/dist/schema-C-ziyJD7.d.ts.map +1 -1
- package/dist/{schema-2g7trUwH.d.ts → schema-D6EVKzTB.d.ts} +4 -5
- package/dist/schema-D6EVKzTB.d.ts.map +1 -0
- package/dist/{schema-BuiujZ-g.js → schema-DxcKTzbi.js} +2 -2
- package/dist/schema-DxcKTzbi.js.map +1 -0
- package/dist/search/index.d.ts +3 -31
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +4 -4
- package/dist/{search-kernel-DyNEa6IU.d.ts → search-kernel-DxqjBxA-.d.ts} +10 -27
- package/dist/search-kernel-DxqjBxA-.d.ts.map +1 -0
- package/dist/{search-ledger-CVUGLDZp.js → search-ledger-TUvB5gWH.js} +7 -7
- package/dist/{search-ledger-CVUGLDZp.js.map → search-ledger-TUvB5gWH.js.map} +1 -1
- package/dist/{search-ledger-file-DDQUgvCg.js → search-ledger-file-UKCO2r8a.js} +4 -4
- package/dist/search-ledger-file-UKCO2r8a.js.map +1 -0
- package/dist/{search-shipper-BOSD46qv.js → search-shipper-Cw2z3-td.js} +4 -4
- package/dist/search-shipper-Cw2z3-td.js.map +1 -0
- package/dist/{search-summary-BQCSWf1g.js → search-summary-DQIvJsSB.js} +5 -5
- package/dist/{search-summary-BQCSWf1g.js.map → search-summary-DQIvJsSB.js.map} +1 -1
- package/dist/{sequential-CzK5DarL.js → sequential-BVv1sjsw.js} +2 -32
- package/dist/{sequential-CzK5DarL.js.map → sequential-BVv1sjsw.js.map} +1 -1
- package/dist/{sequential-Bf_pbE50.js → sequential-CimQrbjv.js} +5 -5
- package/dist/sequential-CimQrbjv.js.map +1 -0
- package/dist/{sequential-BhsrMupG.d.ts → sequential-KwGspfeR.d.ts} +2 -9
- package/dist/{sequential-BhsrMupG.d.ts.map → sequential-KwGspfeR.d.ts.map} +1 -1
- package/dist/{sequential-eprocess-DM_qENCl.js → sequential-eprocess-DodI6RoF.js} +2 -2
- package/dist/{sequential-eprocess-DM_qENCl.js.map → sequential-eprocess-DodI6RoF.js.map} +1 -1
- package/dist/{server-e9oWO_bN.js → server-DoVbqqtJ.js} +101 -101
- package/dist/server-DoVbqqtJ.js.map +1 -0
- package/dist/{single-run-lock-CV9Eyd_q.js → single-run-lock-U58yf8N6.js} +2 -2
- package/dist/{single-run-lock-CV9Eyd_q.js.map → single-run-lock-U58yf8N6.js.map} +1 -1
- package/dist/{skillopt-optimization-method-BiwA8nfX.js → skillopt-optimization-method-kyL94-ri.js} +17 -95
- package/dist/skillopt-optimization-method-kyL94-ri.js.map +1 -0
- package/dist/{spans-BHAUXMGN.d.ts → spans-CVngGij3.d.ts} +2 -2
- package/dist/{spans-BHAUXMGN.d.ts.map → spans-CVngGij3.d.ts.map} +1 -1
- package/dist/{statistical-heldout-42NlCNDe.js → statistical-heldout-Bksv92Th.js} +3 -3
- package/dist/statistical-heldout-Bksv92Th.js.map +1 -0
- package/dist/{statistical-heldout-CYpGaoDH.d.ts → statistical-heldout-C9AbgREN.d.ts} +8 -67
- package/dist/statistical-heldout-C9AbgREN.d.ts.map +1 -0
- package/dist/{steps-Bg5-KVx1.d.ts → steps-DlepJPwD.d.ts} +2 -56
- package/dist/steps-DlepJPwD.d.ts.map +1 -0
- package/dist/{store-C4avFjIi.d.ts → store-B3nWRy3B.d.ts} +2 -2
- package/dist/{store-C4avFjIi.d.ts.map → store-B3nWRy3B.d.ts.map} +1 -1
- package/dist/{store-otlp-DJ9dtA5x.js → store-otlp-BteDAbHK.js} +3 -3
- package/dist/{store-otlp-DJ9dtA5x.js.map → store-otlp-BteDAbHK.js.map} +1 -1
- package/dist/{store-tool-spans-CIX5arAG.js → store-tool-spans-D5l_OfTJ.js} +8 -8
- package/dist/store-tool-spans-D5l_OfTJ.js.map +1 -0
- package/dist/{store-tool-spans-DdCSPa7C.d.ts → store-tool-spans-DZS0HWVf.d.ts} +9 -18
- package/dist/store-tool-spans-DZS0HWVf.d.ts.map +1 -0
- package/dist/storyboard/index.d.ts +4 -11
- package/dist/storyboard/index.d.ts.map +1 -1
- package/dist/storyboard/index.js +1 -16
- package/dist/storyboard/index.js.map +1 -1
- package/dist/{summary-report-V_JACR4Y.js → summary-report-BsXJoYX5.js} +88 -10
- package/dist/summary-report-BsXJoYX5.js.map +1 -0
- package/dist/{summary-report-bdFDXq0b.d.ts → summary-report-DM7tlml1.d.ts} +10 -19
- package/dist/summary-report-DM7tlml1.d.ts.map +1 -0
- package/dist/supervisor-run/index.d.ts +60 -28
- package/dist/supervisor-run/index.d.ts.map +1 -1
- package/dist/supervisor-run/index.js +4 -458
- package/dist/supervisor-run/index.js.map +1 -1
- package/dist/{systemone-BomhHr2c.d.ts → systemone-Bp_Ac0p1.d.ts} +5 -5
- package/dist/{systemone-BomhHr2c.d.ts.map → systemone-Bp_Ac0p1.d.ts.map} +1 -1
- package/dist/systemone-protocol.js +1 -1
- package/dist/{systemone-review-CUVcQJu6.d.ts → systemone-review-CwE6JGIp.d.ts} +2 -2
- package/dist/{systemone-review-CUVcQJu6.d.ts.map → systemone-review-CwE6JGIp.d.ts.map} +1 -1
- package/dist/{systemone-review-D7sXwsqq.js → systemone-review-DzdOJ8I6.js} +3 -3
- package/dist/{systemone-review-D7sXwsqq.js.map → systemone-review-DzdOJ8I6.js.map} +1 -1
- package/dist/systemone.d.ts +5 -5
- package/dist/systemone.js +5 -5
- package/dist/systemone.js.map +1 -1
- package/dist/{task-failure-attributes-hEmASjix.js → task-failure-attributes-BMsblaDh.js} +3 -3
- package/dist/task-failure-attributes-BMsblaDh.js.map +1 -0
- package/dist/{terminal-record-DZyQZ3pz.js → terminal-record-78g6E4vh.js} +5 -5
- package/dist/terminal-record-78g6E4vh.js.map +1 -0
- package/dist/{tool-groups-C3NEcdCM.d.ts → tool-groups-DyNz2JZ_.d.ts} +3 -3
- package/dist/tool-groups-DyNz2JZ_.d.ts.map +1 -0
- package/dist/{tool-waste-BKgvd-TP.d.ts → tool-waste-CkjzWmeY.d.ts} +25 -28
- package/dist/tool-waste-CkjzWmeY.d.ts.map +1 -0
- package/dist/{tool-waste-BlesqTqW.js → tool-waste-DLsjS_p-.js} +5 -5
- package/dist/{tool-waste-BlesqTqW.js.map → tool-waste-DLsjS_p-.js.map} +1 -1
- package/dist/{trace-questions-CM2CAocU.d.ts → trace-questions-xxwgsuMi.d.ts} +4 -9
- package/dist/{trace-questions-CM2CAocU.d.ts.map → trace-questions-xxwgsuMi.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +14 -211
- package/dist/trace-repair/index.d.ts.map +1 -1
- package/dist/trace-repair/index.js +865 -981
- package/dist/trace-repair/index.js.map +1 -1
- package/dist/traces.d.ts +18 -46
- package/dist/traces.d.ts.map +1 -1
- package/dist/traces.js +13 -13
- package/dist/traces.js.map +1 -1
- package/dist/trajectory-replay/index.d.ts +3 -117
- package/dist/trajectory-replay/index.d.ts.map +1 -1
- package/dist/trajectory-replay/index.js +98 -56
- package/dist/trajectory-replay/index.js.map +1 -1
- package/dist/{tree-C1XYeXvy.js → tree-BGRglkKd.js} +13 -10
- package/dist/tree-BGRglkKd.js.map +1 -0
- package/dist/{types-B3jzCp0p.js → types-BXgASBCL.js} +2 -2
- package/dist/{types-B3jzCp0p.js.map → types-BXgASBCL.js.map} +1 -1
- package/dist/{types-C1tnkEgM.d.ts → types-CW8ewATZ.d.ts} +4 -113
- package/dist/types-CW8ewATZ.d.ts.map +1 -0
- package/dist/{types-BqkVmHfv.d.ts → types-CmXY0PQf.d.ts} +2 -4
- package/dist/types-CmXY0PQf.d.ts.map +1 -0
- package/dist/{types-C02qtnG8.d.ts → types-D-mgRzlh.d.ts} +7 -28
- package/dist/types-D-mgRzlh.d.ts.map +1 -0
- package/dist/{types-Cq8mSbq8.d.ts → types-D8GhJoHk.d.ts} +7 -9
- package/dist/{types-Cq8mSbq8.d.ts.map → types-D8GhJoHk.d.ts.map} +1 -1
- package/dist/{types-IXD2HJzu.js → types-DqFMNTgK.js} +2 -4
- package/dist/types-DqFMNTgK.js.map +1 -0
- package/dist/{types-Cbe2fWBa.d.ts → types-DtMbFw6U.d.ts} +3 -3
- package/dist/{types-Cbe2fWBa.d.ts.map → types-DtMbFw6U.d.ts.map} +1 -1
- package/dist/{verdict-Dl0tiT1X.js → verdict-BGQmxQ8A.js} +3 -3
- package/dist/verdict-BGQmxQ8A.js.map +1 -0
- package/dist/{verdict-E4eRNf7-.d.ts → verdict-C24NELtN.d.ts} +2 -15
- package/dist/{verdict-E4eRNf7-.d.ts.map → verdict-C24NELtN.d.ts.map} +1 -1
- package/dist/{verdict-cache-Bm8EKL2s.js → verdict-cache-CL_7tePD.js} +2 -2
- package/dist/verdict-cache-CL_7tePD.js.map +1 -0
- package/dist/wire/index.d.ts +31 -410
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +2 -2
- package/docs/changes/jev-evidence-review.md +1 -1
- package/docs/changes/jev-product-adoption.md +1 -1
- package/docs/changes/jev-recorded-evidence.md +1 -1
- package/docs/design/statistics-decisions.md +17 -17
- package/docs/design.md +1 -1
- package/docs/evaluation-integrity.md +1 -1
- package/docs/proofs/campaign-attempt-retention-20261001/README.md +2 -2
- package/docs/public-api.md +138 -529
- package/docs/rollout.md +1 -1
- package/docs/trace-repair-admission.md +1 -1
- package/docs/wire-protocol.md +1 -1
- package/package.json +1 -1
- package/dist/active-curriculum-B_Lc9kfO.js +0 -61
- package/dist/active-curriculum-B_Lc9kfO.js.map +0 -1
- package/dist/agent-profile-VFcQncbW.d.ts.map +0 -1
- package/dist/agent-profile-cell-BK8mlqlq.js.map +0 -1
- package/dist/agent-profile-cell-BNp-Js9F.d.ts.map +0 -1
- package/dist/agreement-irr-BEWLIF3_.js.map +0 -1
- package/dist/analyze-runs-C84irm4i.js.map +0 -1
- package/dist/baseline-Udi_PLuT.js +0 -259
- package/dist/baseline-Udi_PLuT.js.map +0 -1
- package/dist/benchmark-CXmVVHH2.js +0 -562
- package/dist/benchmark-CXmVVHH2.js.map +0 -1
- package/dist/benchmark-command-By0vh8q7.js.map +0 -1
- package/dist/campaign-BudZ70zo.js.map +0 -1
- package/dist/chat-json-call-puMArmtW.js.map +0 -1
- package/dist/claude-jsonl-dZir12m6.js +0 -86
- package/dist/claude-jsonl-dZir12m6.js.map +0 -1
- package/dist/client-BzL9niqi.d.ts.map +0 -1
- package/dist/cost-ledger-BP8V4kUQ.js.map +0 -1
- package/dist/counterfactual-CPaWN99-.d.ts +0 -60
- package/dist/counterfactual-CPaWN99-.d.ts.map +0 -1
- package/dist/counterfactual-Dn3veueY.js +0 -98
- package/dist/counterfactual-Dn3veueY.js.map +0 -1
- package/dist/default-registry-COhk9g36.js.map +0 -1
- package/dist/default-registry-DzHiGruW.d.ts.map +0 -1
- package/dist/define-agent-eval-WSck0CZJ.d.ts.map +0 -1
- package/dist/dspy-rlm-engine-LRCu61m5.js.map +0 -1
- package/dist/effect-sizes-BhzEpXMc.js +0 -82
- package/dist/effect-sizes-BhzEpXMc.js.map +0 -1
- package/dist/emitter-HcCmFQl_.d.ts.map +0 -1
- package/dist/engine-3A_4jOlI.d.ts.map +0 -1
- package/dist/equal-terms-BtdXayCJ.js.map +0 -1
- package/dist/evaluation-6Yoi74gM.d.ts.map +0 -1
- package/dist/exporters-X4xwla8A.js.map +0 -1
- package/dist/external-optimizer-process-BjMGUuds.js.map +0 -1
- package/dist/external-optimizer-subprocess-BqW0hHcI.js.map +0 -1
- package/dist/failure-cluster-CbgEDcFJ.d.ts.map +0 -1
- package/dist/feedback-trajectory-C4EG0nNH.d.ts.map +0 -1
- package/dist/hf-dataset-BR2yhuNn.js.map +0 -1
- package/dist/index-BFRO6chs.d.ts.map +0 -1
- package/dist/index-BO41eGj5.d.ts.map +0 -1
- package/dist/index-CyszSg4O.d.ts.map +0 -1
- package/dist/index-DHKEAv3s.d.ts.map +0 -1
- package/dist/index-DPcngtwt.d.ts.map +0 -1
- package/dist/integrity-dLiDe2kD.js.map +0 -1
- package/dist/journal-DfRz9kps.js.map +0 -1
- package/dist/judge-gate-CE7CQAgt.d.ts.map +0 -1
- package/dist/kind-factory-BobI5Jy3.js.map +0 -1
- package/dist/ledger-core-Gq7yp8lP.js.map +0 -1
- package/dist/llm-client-CyBAoYiX.js.map +0 -1
- package/dist/llm-judge-CG12SQJq.js.map +0 -1
- package/dist/matrix-DSrSxjjy.d.ts.map +0 -1
- package/dist/matrix-Dm0BQW7U.js.map +0 -1
- package/dist/mean-DHoMiudD.js.map +0 -1
- package/dist/normal-DsJZtrJc.js +0 -25
- package/dist/normal-DsJZtrJc.js.map +0 -1
- package/dist/paired-arms-CwMGJsrS.js.map +0 -1
- package/dist/paired-binary-CvpFHfKZ.js.map +0 -1
- package/dist/paired-promotion-decision-DPKz8ZnF.d.ts.map +0 -1
- package/dist/pareto-Cm6ndrWN.js.map +0 -1
- package/dist/prime-protocol-CHKgA3a6.js.map +0 -1
- package/dist/prime-protocol-HiB9HX7E.d.ts.map +0 -1
- package/dist/produced-state-BsDmnwxc.js.map +0 -1
- package/dist/proposal-findings-CY1xKn_a.js.map +0 -1
- package/dist/query-BUCZCK7F.js.map +0 -1
- package/dist/redact-mtCCcT8z.d.ts.map +0 -1
- package/dist/release-confidence-CpuP65S5.js.map +0 -1
- package/dist/report-command-SC9nqb4M.js.map +0 -1
- package/dist/reward-CpCmAM8L.d.ts.map +0 -1
- package/dist/reward-hacking-RVdZ6Kkt.d.ts.map +0 -1
- package/dist/rollout-DZV1t2Wg.js.map +0 -1
- package/dist/run-record-C1E24G2A.d.ts.map +0 -1
- package/dist/run-record-C5e7FjhJ.js.map +0 -1
- package/dist/schema-2g7trUwH.d.ts.map +0 -1
- package/dist/schema-BuiujZ-g.js.map +0 -1
- package/dist/schema-CSf6qWgZ.js.map +0 -1
- package/dist/search-kernel-DyNEa6IU.d.ts.map +0 -1
- package/dist/search-ledger-file-DDQUgvCg.js.map +0 -1
- package/dist/search-shipper-BOSD46qv.js.map +0 -1
- package/dist/semantic-concept-judge-BQF8te0T.js.map +0 -1
- package/dist/sequential-Bf_pbE50.js.map +0 -1
- package/dist/server-e9oWO_bN.js.map +0 -1
- package/dist/skillopt-optimization-method-BiwA8nfX.js.map +0 -1
- package/dist/statistical-heldout-42NlCNDe.js.map +0 -1
- package/dist/statistical-heldout-CYpGaoDH.d.ts.map +0 -1
- package/dist/steps-Bg5-KVx1.d.ts.map +0 -1
- package/dist/store-tool-spans-CIX5arAG.js.map +0 -1
- package/dist/store-tool-spans-DdCSPa7C.d.ts.map +0 -1
- package/dist/student-t-DVPW7CdL.js +0 -39
- package/dist/student-t-DVPW7CdL.js.map +0 -1
- package/dist/summary-report-V_JACR4Y.js.map +0 -1
- package/dist/summary-report-bdFDXq0b.d.ts.map +0 -1
- package/dist/task-failure-attributes-hEmASjix.js.map +0 -1
- package/dist/terminal-record-DZyQZ3pz.js.map +0 -1
- package/dist/tool-groups-C3NEcdCM.d.ts.map +0 -1
- package/dist/tool-waste-BKgvd-TP.d.ts.map +0 -1
- package/dist/trajectory-Y1fmdlw7.d.ts +0 -24
- package/dist/trajectory-Y1fmdlw7.d.ts.map +0 -1
- package/dist/tree-C1XYeXvy.js.map +0 -1
- package/dist/types-BqkVmHfv.d.ts.map +0 -1
- package/dist/types-C02qtnG8.d.ts.map +0 -1
- package/dist/types-C1tnkEgM.d.ts.map +0 -1
- package/dist/types-IXD2HJzu.js.map +0 -1
- package/dist/usage-receipt-Cx3xNeyB.js +0 -76
- package/dist/usage-receipt-Cx3xNeyB.js.map +0 -1
- package/dist/verdict-Dl0tiT1X.js.map +0 -1
- package/dist/verdict-cache-Bm8EKL2s.js.map +0 -1
- package/docs/design/self-improvement-evidence-audit.md +0 -263
package/dist/rl.js
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { s as ValidationError } from "./errors-
|
|
2
|
-
import { a as hashCanonical, i as compareCodeUnits } from "./canonical-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as evaluateInterimReleaseConfidence } from "./sequential-CzK5DarL.js";
|
|
18
|
-
import { n as prepareSystemOneReview } from "./systemone-review-D7sXwsqq.js";
|
|
19
|
-
import { n as assertUniqueObservationIds, s as validateOutcomeMetricSpecifications, t as rubricPredictiveValidity } from "./rubric-predictive-validity-DaFW70y9.js";
|
|
20
|
-
import { t as varianceBasedCurriculum } from "./active-curriculum-B_Lc9kfO.js";
|
|
1
|
+
import { s as ValidationError } from "./errors-BcOs5MKW.js";
|
|
2
|
+
import { a as hashCanonical, i as compareCodeUnits } from "./canonical-Dq2hOQ8L.js";
|
|
3
|
+
import { o as runTaskScore } from "./run-record-DhEJgoPz.js";
|
|
4
|
+
import { a as medianInPlace } from "./internal-BTK91Bqt.js";
|
|
5
|
+
import { a as wilcoxonSignedRank } from "./paired-arms-Ct4LTKc1.js";
|
|
6
|
+
import { i as pairedBootstrap } from "./mean-BbA_JCzW.js";
|
|
7
|
+
import { t as decidePairedPromotion } from "./paired-promotion-decision-D0SHb-ZL.js";
|
|
8
|
+
import { n as campaignCellToRunRecord } from "./run-record-CysKLB93.js";
|
|
9
|
+
import { n as extractVerifiableReward, r as extractVerifiableRewardsFromRecords, t as detectRewardHacking } from "./reward-hacking-ByuETaIb.js";
|
|
10
|
+
import { t as runEvalCampaign } from "./eval-campaign-BLEfBGbA.js";
|
|
11
|
+
import { s as assertRewardGate } from "./schema-DxcKTzbi.js";
|
|
12
|
+
import { n as isTrainingLineEligible, o as toSftRows, t as isSplitEligible } from "./exporters-Cl6IeNAu.js";
|
|
13
|
+
import { t as mintRolloutRows } from "./mint-zszyYlpA.js";
|
|
14
|
+
import { t as evaluateInterimReleaseConfidence } from "./sequential-BVv1sjsw.js";
|
|
15
|
+
import { n as prepareSystemOneReview } from "./systemone-review-DzdOJ8I6.js";
|
|
16
|
+
import { n as assertUniqueObservationIds, s as validateOutcomeMetricSpecifications, t as rubricPredictiveValidity } from "./rubric-predictive-validity-D3_oI72N.js";
|
|
21
17
|
import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "./outcome-store-DUcMj-3D.js";
|
|
22
18
|
import { createHash } from "node:crypto";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
19
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
20
|
+
import { join } from "node:path";
|
|
25
21
|
//#region src/rl/adaptation-eval.ts
|
|
26
22
|
/**
|
|
27
23
|
* Sample-efficient adaptation evaluation.
|
|
@@ -627,7 +623,7 @@ function claimIntegritySystemOneReview(claim, scope, options) {
|
|
|
627
623
|
}]
|
|
628
624
|
});
|
|
629
625
|
return prepareSystemOneReview({
|
|
630
|
-
version: options.version ?? `claim-integrity-systemone
|
|
626
|
+
version: options.version ?? `claim-integrity-systemone-${CLAIM_INTEGRITY_VERSION}`,
|
|
631
627
|
request: {
|
|
632
628
|
model: options.model,
|
|
633
629
|
state: claimBrief(claim, scope),
|
|
@@ -723,7 +719,7 @@ const CLAIM_INTEGRITY_VERSION = "2";
|
|
|
723
719
|
/** The digest a verdict cites: detector version, phrase set and policy. */
|
|
724
720
|
function claimIntegrityDigest(policy = {}) {
|
|
725
721
|
return hashCanonical({
|
|
726
|
-
version:
|
|
722
|
+
version: CLAIM_INTEGRITY_VERSION,
|
|
727
723
|
phrases: GRADER_REFERENCE_PHRASES,
|
|
728
724
|
recordOnly: [...policy.recordOnly ?? []].sort()
|
|
729
725
|
});
|
|
@@ -807,29 +803,6 @@ function claimIntegrityVerdict(signals, policy = {}) {
|
|
|
807
803
|
* or LLM-call count. We accept whatever the caller provides; the curve
|
|
808
804
|
* is on whatever axis they pick.
|
|
809
805
|
*/
|
|
810
|
-
async function runComputeCurve(opts) {
|
|
811
|
-
const points = [];
|
|
812
|
-
for (const budget of opts.budgets) {
|
|
813
|
-
const r = await opts.runAtBudget(budget);
|
|
814
|
-
points.push({
|
|
815
|
-
budgetId: budget.id,
|
|
816
|
-
cost: budget.cost,
|
|
817
|
-
score: r.score,
|
|
818
|
-
samples: r.samples,
|
|
819
|
-
std: r.std,
|
|
820
|
-
metrics: r.metrics
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
const sorted = [...points].sort((a, b) => a.cost - b.cost);
|
|
824
|
-
const logSlope = sorted.length >= 2 ? fitLogSlope(sorted) : null;
|
|
825
|
-
const best = points.reduce((a, b) => b.score > a.score ? b : a);
|
|
826
|
-
return {
|
|
827
|
-
candidateId: opts.candidateId,
|
|
828
|
-
points: sorted,
|
|
829
|
-
logSlope,
|
|
830
|
-
best
|
|
831
|
-
};
|
|
832
|
-
}
|
|
833
806
|
/** The simplest test-time scaling primitive. */
|
|
834
807
|
async function bestOfN(opts) {
|
|
835
808
|
if (opts.n <= 0) throw new ValidationError("bestOfN: n must be > 0");
|
|
@@ -851,54 +824,11 @@ async function bestOfN(opts) {
|
|
|
851
824
|
bestIndex
|
|
852
825
|
};
|
|
853
826
|
}
|
|
854
|
-
|
|
855
|
-
* Self-consistency / majority-vote test-time scaling. For tasks with a
|
|
856
|
-
* small categorical answer space (math problems, multiple choice).
|
|
857
|
-
*/
|
|
858
|
-
async function selfConsistency(opts) {
|
|
859
|
-
if (opts.n <= 0) throw new ValidationError("selfConsistency: n must be > 0");
|
|
860
|
-
const rollouts = [];
|
|
861
|
-
const histogram = {};
|
|
862
|
-
for (let i = 0; i < opts.n; i++) {
|
|
863
|
-
const r = await opts.sample(i);
|
|
864
|
-
rollouts.push(r);
|
|
865
|
-
const key = opts.answerKey(r);
|
|
866
|
-
histogram[key] = (histogram[key] ?? 0) + 1;
|
|
867
|
-
}
|
|
868
|
-
let answer = "";
|
|
869
|
-
let max = -1;
|
|
870
|
-
for (const [k, v] of Object.entries(histogram)) if (v > max) {
|
|
871
|
-
max = v;
|
|
872
|
-
answer = k;
|
|
873
|
-
}
|
|
874
|
-
const representative = rollouts.find((r) => opts.answerKey(r) === answer) ?? rollouts[0];
|
|
875
|
-
return {
|
|
876
|
-
answer,
|
|
877
|
-
agreement: max / opts.n,
|
|
878
|
-
histogram,
|
|
879
|
-
representative,
|
|
880
|
-
rollouts
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
function paretoFrontier(points) {
|
|
827
|
+
function paretoCostScoreFrontier(points) {
|
|
884
828
|
const onFrontier = [];
|
|
885
829
|
for (const p of points) if (!points.some((q) => q !== p && q.cost <= p.cost && q.score >= p.score && (q.cost < p.cost || q.score > p.score))) onFrontier.push(p);
|
|
886
830
|
return onFrontier.sort((a, b) => a.cost - b.cost);
|
|
887
831
|
}
|
|
888
|
-
function fitLogSlope(points) {
|
|
889
|
-
const xs = points.map((p) => Math.log(Math.max(1e-12, p.cost)));
|
|
890
|
-
const ys = points.map((p) => p.score);
|
|
891
|
-
const n = xs.length;
|
|
892
|
-
const mx = xs.reduce((s, x) => s + x, 0) / n;
|
|
893
|
-
const my = ys.reduce((s, y) => s + y, 0) / n;
|
|
894
|
-
let num = 0;
|
|
895
|
-
let den = 0;
|
|
896
|
-
for (let i = 0; i < n; i++) {
|
|
897
|
-
num += (xs[i] - mx) * (ys[i] - my);
|
|
898
|
-
den += (xs[i] - mx) ** 2;
|
|
899
|
-
}
|
|
900
|
-
return den === 0 ? 0 : num / den;
|
|
901
|
-
}
|
|
902
832
|
//#endregion
|
|
903
833
|
//#region src/rl/contamination.ts
|
|
904
834
|
/**
|
|
@@ -960,67 +890,6 @@ async function runContaminationProbe(input, opts = {}) {
|
|
|
960
890
|
excludedScenarioIds
|
|
961
891
|
};
|
|
962
892
|
}
|
|
963
|
-
/**
|
|
964
|
-
* Identifier-rename perturbation for code/text scenarios. Replaces every
|
|
965
|
-
* occurrence of the listed identifiers with synthesized aliases. Use when
|
|
966
|
-
* the scenario's structural difficulty is independent of variable names
|
|
967
|
-
* (e.g. SWE-Bench-style coding tasks).
|
|
968
|
-
*/
|
|
969
|
-
function renameVariables(identifiers, rename = (n, i) => `${n}_${(i % 26 + 10).toString(36)}`) {
|
|
970
|
-
return {
|
|
971
|
-
kind: "rename_variables",
|
|
972
|
-
apply(scenario) {
|
|
973
|
-
let prompt = scenario.prompt;
|
|
974
|
-
identifiers.forEach((id, i) => {
|
|
975
|
-
const replacement = rename(id, i);
|
|
976
|
-
const re = new RegExp(`\\b${escapeRegex(id)}\\b`, "g");
|
|
977
|
-
prompt = prompt.replace(re, replacement);
|
|
978
|
-
});
|
|
979
|
-
return {
|
|
980
|
-
...scenario,
|
|
981
|
-
prompt
|
|
982
|
-
};
|
|
983
|
-
}
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
/**
|
|
987
|
-
* Order-shuffle perturbation. Reshuffles a list-shaped section of the
|
|
988
|
-
* prompt (for QA scenarios that present options A/B/C/D — answer depends
|
|
989
|
-
* on the option labels, not order). Caller provides the section extractor.
|
|
990
|
-
*/
|
|
991
|
-
function shuffleOrder(shuffleSection, seed) {
|
|
992
|
-
const rng = mulberry32(seed);
|
|
993
|
-
return {
|
|
994
|
-
kind: "shuffle_order",
|
|
995
|
-
apply(scenario) {
|
|
996
|
-
const newPrompt = shuffleSection(scenario.prompt, rng);
|
|
997
|
-
return {
|
|
998
|
-
...scenario,
|
|
999
|
-
prompt: newPrompt
|
|
1000
|
-
};
|
|
1001
|
-
}
|
|
1002
|
-
};
|
|
1003
|
-
}
|
|
1004
|
-
/**
|
|
1005
|
-
* Inject-irrelevant-clause perturbation. Adds a benign sentence that
|
|
1006
|
-
* shouldn't change the answer. Tests for "did the model just memorize
|
|
1007
|
-
* the input string."
|
|
1008
|
-
*/
|
|
1009
|
-
function injectIrrelevantClause(clause, position = "prefix") {
|
|
1010
|
-
return {
|
|
1011
|
-
kind: "inject_irrelevant_clause",
|
|
1012
|
-
apply(scenario) {
|
|
1013
|
-
const prompt = position === "prefix" ? `${clause} ${scenario.prompt}` : `${scenario.prompt} ${clause}`;
|
|
1014
|
-
return {
|
|
1015
|
-
...scenario,
|
|
1016
|
-
prompt
|
|
1017
|
-
};
|
|
1018
|
-
}
|
|
1019
|
-
};
|
|
1020
|
-
}
|
|
1021
|
-
function escapeRegex(s) {
|
|
1022
|
-
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1023
|
-
}
|
|
1024
893
|
//#endregion
|
|
1025
894
|
//#region src/rl/rollout-input.ts
|
|
1026
895
|
/**
|
|
@@ -1315,7 +1184,7 @@ function toDpoJsonl(rows) {
|
|
|
1315
1184
|
* On the line path a realness-gated line stays in its group at reward 0 rather
|
|
1316
1185
|
* than being dropped. 0 is the honest label for a faked success and is usable
|
|
1317
1186
|
* signal; removing the line would also move the group's baseline, just in the
|
|
1318
|
-
* other direction. (SFT differs — see `
|
|
1187
|
+
* other direction. (SFT differs — see `toSftRowsWithLookups`.)
|
|
1319
1188
|
*/
|
|
1320
1189
|
async function toGrpoRows(lines, lookups) {
|
|
1321
1190
|
return grpoRowsFromLines(lines, lookups);
|
|
@@ -1381,7 +1250,7 @@ function toGrpoJsonl(rows) {
|
|
|
1381
1250
|
* says which path a row took. A captured transcript whose every turn is copied
|
|
1382
1251
|
* context yields no row rather than a lookup-built substitute.
|
|
1383
1252
|
*/
|
|
1384
|
-
async function
|
|
1253
|
+
async function toSftRowsWithLookups(lines, lookups) {
|
|
1385
1254
|
for (const line of lines) assertRewardGate(line, "SFT export");
|
|
1386
1255
|
const include = lookups.include ?? (() => true);
|
|
1387
1256
|
const rows = [];
|
|
@@ -1389,7 +1258,7 @@ async function toSftRows(lines, lookups) {
|
|
|
1389
1258
|
if (!isTrainingLineEligible(line, lookups) || !include(line)) continue;
|
|
1390
1259
|
const captured = line.messages.length > 0;
|
|
1391
1260
|
const messages = captured ? line.messages : await recoveredTranscript(line, lookups);
|
|
1392
|
-
const [row] = toSftRows
|
|
1261
|
+
const [row] = toSftRows([{
|
|
1393
1262
|
...line,
|
|
1394
1263
|
messages
|
|
1395
1264
|
}], lookups);
|
|
@@ -1511,35 +1380,6 @@ const PRM_CONTEXT_REQUIREMENT = {
|
|
|
1511
1380
|
function admitPrmTriples(triples, context) {
|
|
1512
1381
|
return admitUngatedByInvocation(triples, (t) => [t.prefixRunId, t.rejectedRunId], context, PRM_CONTEXT_REQUIREMENT, (line) => assertPrmTrainableLine(line, context.mintedWithMaxSteps));
|
|
1513
1382
|
}
|
|
1514
|
-
function toPrmJsonl(rows) {
|
|
1515
|
-
return rows.map((r) => JSON.stringify(r)).join("\n") + (rows.length > 0 ? "\n" : "");
|
|
1516
|
-
}
|
|
1517
|
-
const STEP_REWARD_CONTEXT_REQUIREMENT = {
|
|
1518
|
-
exporter: "step-reward export",
|
|
1519
|
-
contextType: "RolloutLineContext",
|
|
1520
|
-
because: "a StepReward carries a runId and a bare per-step reward, and nothing that says whether that run faked its success — so without the minted rollout lines this exporter ships the step-level components of a gamed run at full value while the run-level scalar sits at 0 elsewhere."
|
|
1521
|
-
};
|
|
1522
|
-
/**
|
|
1523
|
-
* Step-level reward rows as JSONL.
|
|
1524
|
-
*
|
|
1525
|
-
* `context` is REQUIRED for the same reason it is on `toDpoRows` and
|
|
1526
|
-
* `toPrmRows`: this is a line-less input carrying a reward number. Steps
|
|
1527
|
-
* belonging to a realness-gated run are dropped rather than zeroed — a
|
|
1528
|
-
* per-step reward of 0 across a whole trajectory is a claim that every step was
|
|
1529
|
-
* bad, which is a different (and false) statement from "this run's success was
|
|
1530
|
-
* fabricated, so its step-level credit assignment is meaningless".
|
|
1531
|
-
*/
|
|
1532
|
-
function stepRewardsToJsonl(stepRewards, context) {
|
|
1533
|
-
const rows = admitUngatedByInvocation(stepRewards, (s) => [s.runId], context, STEP_REWARD_CONTEXT_REQUIREMENT).map((s) => ({
|
|
1534
|
-
runId: s.runId,
|
|
1535
|
-
spanId: s.spanId,
|
|
1536
|
-
stepIndex: s.stepIndex,
|
|
1537
|
-
reward: s.reward,
|
|
1538
|
-
determinism: s.determinism,
|
|
1539
|
-
weight: s.weight ?? 1
|
|
1540
|
-
}));
|
|
1541
|
-
return rows.map((r) => JSON.stringify(r)).join("\n") + (rows.length > 0 ? "\n" : "");
|
|
1542
|
-
}
|
|
1543
1383
|
//#endregion
|
|
1544
1384
|
//#region src/rl/dataset.ts
|
|
1545
1385
|
const DATASET_FORMAT_SET = /* @__PURE__ */ new Set([
|
|
@@ -1644,7 +1484,7 @@ async function buildRlDataset(lines, lookups, config, preferences) {
|
|
|
1644
1484
|
rowCounts.grpo = rows.length;
|
|
1645
1485
|
}
|
|
1646
1486
|
if (formats.includes("sft")) {
|
|
1647
|
-
const rows = await
|
|
1487
|
+
const rows = await toSftRowsWithLookups(lines, lookups);
|
|
1648
1488
|
requireRows("sft", rows.length);
|
|
1649
1489
|
files["train.sft.jsonl"] = toSftJsonl(rows);
|
|
1650
1490
|
rowCounts.sft = rows.length;
|
|
@@ -1753,35 +1593,6 @@ function datasheetToMarkdown(m) {
|
|
|
1753
1593
|
* (what the eval harnesses capture; the RunRecord validator ignores the extra
|
|
1754
1594
|
* keys). The harvest reads them directly — no trace store round-trip needed.
|
|
1755
1595
|
*/
|
|
1756
|
-
/**
|
|
1757
|
-
* Append graded records to the corpus (append-only JSONL). Deduplicates by
|
|
1758
|
-
* `runId` against what's already on disk so re-running the same harness is
|
|
1759
|
-
* idempotent. Creates the file and parent dir. This is the call every eval
|
|
1760
|
-
* harness makes by default after producing its records.
|
|
1761
|
-
*/
|
|
1762
|
-
function appendToCorpus(records, corpusPath) {
|
|
1763
|
-
mkdirSync(dirname(corpusPath), { recursive: true });
|
|
1764
|
-
const existing = existsSync(corpusPath) ? readCorpus(corpusPath) : [];
|
|
1765
|
-
const seen = new Set(existing.map((r) => r.runId));
|
|
1766
|
-
const lines = [];
|
|
1767
|
-
let appended = 0;
|
|
1768
|
-
let skipped = 0;
|
|
1769
|
-
for (const r of records) {
|
|
1770
|
-
if (seen.has(r.runId)) {
|
|
1771
|
-
skipped++;
|
|
1772
|
-
continue;
|
|
1773
|
-
}
|
|
1774
|
-
seen.add(r.runId);
|
|
1775
|
-
lines.push(JSON.stringify(r));
|
|
1776
|
-
appended++;
|
|
1777
|
-
}
|
|
1778
|
-
if (lines.length > 0) appendFileSync(corpusPath, `${lines.join("\n")}\n`);
|
|
1779
|
-
return {
|
|
1780
|
-
appended,
|
|
1781
|
-
skipped,
|
|
1782
|
-
total: existing.length + appended
|
|
1783
|
-
};
|
|
1784
|
-
}
|
|
1785
1596
|
/** Read the full corpus. Returns [] if the corpus does not exist yet. */
|
|
1786
1597
|
function readCorpus(corpusPath) {
|
|
1787
1598
|
if (!existsSync(corpusPath)) return [];
|
|
@@ -1789,48 +1600,6 @@ function readCorpus(corpusPath) {
|
|
|
1789
1600
|
for (const line of readFileSync(corpusPath, "utf8").split("\n")) if (line.trim()) out.push(JSON.parse(line));
|
|
1790
1601
|
return out;
|
|
1791
1602
|
}
|
|
1792
|
-
/**
|
|
1793
|
-
* The harvest's score reader is GATED: a gamed run reads 0, so it cannot buy
|
|
1794
|
-
* its way past `minScore` into the published bundle with its claimed score.
|
|
1795
|
-
* `null` = unscored (a labeled gap, dropped before packaging, never a 0).
|
|
1796
|
-
*/
|
|
1797
|
-
function rewardOf(r) {
|
|
1798
|
-
const v = trainingScore(r);
|
|
1799
|
-
return typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
1800
|
-
}
|
|
1801
|
-
/**
|
|
1802
|
-
* Harvest the accumulated corpus into a publishable RL dataset bundle. Reads
|
|
1803
|
-
* trajectory text from each record's top-level `prompt`/`completion`; records
|
|
1804
|
-
* missing either are excluded (a graded score with no trajectory can't train).
|
|
1805
|
-
* Optionally filters by score / split. Throws (via buildRlDataset) if nothing
|
|
1806
|
-
* survives — an empty dataset must never be published.
|
|
1807
|
-
*
|
|
1808
|
-
* `minScore` is applied to the GATED reward (`trainingScore`), so a gamed run
|
|
1809
|
-
* cannot buy its way into the published bundle with its claimed score —
|
|
1810
|
-
* `minScore` is exactly the door a reward-hacked run would otherwise clear for
|
|
1811
|
-
* SFT. Unscored records are dropped before packaging: a missing label is not a
|
|
1812
|
-
* zero, and it is not publishable either.
|
|
1813
|
-
*/
|
|
1814
|
-
async function buildDatasetFromCorpus(corpusPath, config, opts = {}) {
|
|
1815
|
-
let records = readCorpus(corpusPath).filter((r) => typeof r.prompt === "string" && typeof r.completion === "string");
|
|
1816
|
-
if (opts.splits) records = records.filter((r) => opts.splits.includes(r.splitTag));
|
|
1817
|
-
records = records.filter((r) => rewardOf(r) !== null);
|
|
1818
|
-
if (opts.minScore != null) records = records.filter((r) => {
|
|
1819
|
-
const reward = rewardOf(r);
|
|
1820
|
-
return reward !== null && reward >= opts.minScore;
|
|
1821
|
-
});
|
|
1822
|
-
const text = new Map(records.map((r) => [r.runId, {
|
|
1823
|
-
prompt: r.prompt,
|
|
1824
|
-
completion: r.completion
|
|
1825
|
-
}]));
|
|
1826
|
-
const lookups = {
|
|
1827
|
-
promptOf: (id) => text.get(id)?.prompt ?? "",
|
|
1828
|
-
completionOf: (id) => text.get(id)?.completion ?? "",
|
|
1829
|
-
allowHeldOutTrainingData: opts.allowHeldOutTrainingData
|
|
1830
|
-
};
|
|
1831
|
-
const { rows } = await mintRolloutRows(records, new InMemoryTraceStore());
|
|
1832
|
-
return buildRlDataset(rows, lookups, config);
|
|
1833
|
-
}
|
|
1834
1603
|
//#endregion
|
|
1835
1604
|
//#region src/rl/off-policy.ts
|
|
1836
1605
|
/**
|
|
@@ -2022,18 +1791,6 @@ function doublyRobust(trajectories, opts = {}) {
|
|
|
2022
1791
|
contributionCounts
|
|
2023
1792
|
};
|
|
2024
1793
|
}
|
|
2025
|
-
/**
|
|
2026
|
-
* Convenience: run all three estimators and return them side-by-side.
|
|
2027
|
-
* The recommended diagnostic — agreement across estimators is a much
|
|
2028
|
-
* stronger signal than any single one.
|
|
2029
|
-
*/
|
|
2030
|
-
function offPolicyEstimateAll(trajectories, opts = {}) {
|
|
2031
|
-
return {
|
|
2032
|
-
ips: inverseProbabilityWeighting(trajectories, opts),
|
|
2033
|
-
snips: selfNormalizedImportanceWeighting(trajectories, opts),
|
|
2034
|
-
dr: doublyRobust(trajectories, opts)
|
|
2035
|
-
};
|
|
2036
|
-
}
|
|
2037
1794
|
function zeroEstimate() {
|
|
2038
1795
|
return {
|
|
2039
1796
|
value: 0,
|
|
@@ -2471,78 +2228,6 @@ function makePair(a, b, scenarioId, minMargin) {
|
|
|
2471
2228
|
}
|
|
2472
2229
|
//#endregion
|
|
2473
2230
|
//#region src/rl/process-reward.ts
|
|
2474
|
-
async function extractStepRewards(store, runId, opts) {
|
|
2475
|
-
const ordered = [...await store.spans({ runId })].sort((a, b) => a.startedAt - b.startedAt);
|
|
2476
|
-
const out = [];
|
|
2477
|
-
let idx = 0;
|
|
2478
|
-
for (const span of ordered) {
|
|
2479
|
-
if (opts.preFilter && !opts.preFilter(span)) continue;
|
|
2480
|
-
let scored = null;
|
|
2481
|
-
for (const s of opts.scorers) {
|
|
2482
|
-
if (!s.appliesTo.includes(span.kind)) continue;
|
|
2483
|
-
const r = await s.score(span);
|
|
2484
|
-
if (r) {
|
|
2485
|
-
scored = r;
|
|
2486
|
-
break;
|
|
2487
|
-
}
|
|
2488
|
-
}
|
|
2489
|
-
if (!scored) continue;
|
|
2490
|
-
out.push({
|
|
2491
|
-
spanId: span.spanId,
|
|
2492
|
-
runId,
|
|
2493
|
-
stepIndex: idx++,
|
|
2494
|
-
kind: span.kind,
|
|
2495
|
-
name: span.name,
|
|
2496
|
-
reward: scored.reward,
|
|
2497
|
-
determinism: scored.determinism,
|
|
2498
|
-
rationale: scored.rationale,
|
|
2499
|
-
weight: scored.weight
|
|
2500
|
-
});
|
|
2501
|
-
}
|
|
2502
|
-
return out;
|
|
2503
|
-
}
|
|
2504
|
-
function runwiseStepRewardSummary(stepRewards) {
|
|
2505
|
-
if (stepRewards.length === 0) return {
|
|
2506
|
-
runId: "",
|
|
2507
|
-
totalSteps: 0,
|
|
2508
|
-
meanReward: 0,
|
|
2509
|
-
sumWeightedReward: 0,
|
|
2510
|
-
failureFraction: 0,
|
|
2511
|
-
worstStepDelta: 0,
|
|
2512
|
-
worstStepIndex: null
|
|
2513
|
-
};
|
|
2514
|
-
const runId = stepRewards[0].runId;
|
|
2515
|
-
let sumW = 0;
|
|
2516
|
-
let sumWR = 0;
|
|
2517
|
-
let failures = 0;
|
|
2518
|
-
let worstDelta = 0;
|
|
2519
|
-
let worstIdx = null;
|
|
2520
|
-
let prev = stepRewards[0].reward;
|
|
2521
|
-
for (let i = 0; i < stepRewards.length; i++) {
|
|
2522
|
-
const s = stepRewards[i];
|
|
2523
|
-
const w = s.weight ?? 1;
|
|
2524
|
-
sumW += w;
|
|
2525
|
-
sumWR += w * s.reward;
|
|
2526
|
-
if (s.reward < .5) failures++;
|
|
2527
|
-
if (i > 0) {
|
|
2528
|
-
const delta = s.reward - prev;
|
|
2529
|
-
if (delta < worstDelta) {
|
|
2530
|
-
worstDelta = delta;
|
|
2531
|
-
worstIdx = i;
|
|
2532
|
-
}
|
|
2533
|
-
prev = s.reward;
|
|
2534
|
-
} else prev = s.reward;
|
|
2535
|
-
}
|
|
2536
|
-
return {
|
|
2537
|
-
runId,
|
|
2538
|
-
totalSteps: stepRewards.length,
|
|
2539
|
-
meanReward: sumW === 0 ? 0 : sumWR / sumW,
|
|
2540
|
-
sumWeightedReward: sumWR,
|
|
2541
|
-
failureFraction: failures / stepRewards.length,
|
|
2542
|
-
worstStepDelta: worstDelta,
|
|
2543
|
-
worstStepIndex: worstIdx
|
|
2544
|
-
};
|
|
2545
|
-
}
|
|
2546
2231
|
/**
|
|
2547
2232
|
* Build PRM training triples. The shape: pair runs that share an early
|
|
2548
2233
|
* prefix (same scenario, same first N steps) and diverge later — at the
|
|
@@ -2690,7 +2375,7 @@ async function runRLCampaign(opts) {
|
|
|
2690
2375
|
const trainerRows = {};
|
|
2691
2376
|
if (opts.trainerExport?.dpo) trainerRows.dpo = await toDpoRows(preferences.pairs, opts.trainerExport.dpo, { lines: rolloutLines });
|
|
2692
2377
|
if (opts.trainerExport?.grpo) trainerRows.grpo = await toGrpoRows(rolloutLines, opts.trainerExport.grpo);
|
|
2693
|
-
if (opts.trainerExport?.sft) trainerRows.sft = await
|
|
2378
|
+
if (opts.trainerExport?.sft) trainerRows.sft = await toSftRowsWithLookups(rolloutLines, opts.trainerExport.sft);
|
|
2694
2379
|
const summary = buildSummary({
|
|
2695
2380
|
campaign,
|
|
2696
2381
|
preferences,
|
|
@@ -2861,238 +2546,8 @@ function campaignToRunRecords(campaign, ctx) {
|
|
|
2861
2546
|
defaultCostUsd: ctx.defaultCostUsd
|
|
2862
2547
|
}));
|
|
2863
2548
|
}
|
|
2864
|
-
/**
|
|
2865
|
-
* Convert a `MultiLayerVerifier` `VerificationReport` into a `RunRecord`.
|
|
2866
|
-
* A split score is emitted only when `report.taskScore` proves the configured
|
|
2867
|
-
* scoring panel completed. Partial scores remain in `outcome.raw` for
|
|
2868
|
-
* diagnosis. Layer errors and timeouts become judge or execution telemetry;
|
|
2869
|
-
* only a scored `fail` layer may produce task-failure detail.
|
|
2870
|
-
*/
|
|
2871
|
-
function verificationReportToRunRecord(report, ctx, opts = {}) {
|
|
2872
|
-
const splitTag = ctx.splitTag ?? "search";
|
|
2873
|
-
const runId = opts.runId ?? `run-${ctx.candidateId}-${ctx.experimentId}-${report.startedAt}`;
|
|
2874
|
-
const taskScore = report.layers.some(hasValidTaskMeasurement) && isValidScore(report.taskScore) ? report.taskScore : void 0;
|
|
2875
|
-
let executionErrorCount = 0;
|
|
2876
|
-
let judgeErrorCount = 0;
|
|
2877
|
-
let layerErrorCount = 0;
|
|
2878
|
-
let layerTimeoutCount = 0;
|
|
2879
|
-
let unscoredLayerCount = 0;
|
|
2880
|
-
const raw = {
|
|
2881
|
-
pass_count: report.passCount,
|
|
2882
|
-
fail_count: report.failCount,
|
|
2883
|
-
error_count: report.errorCount,
|
|
2884
|
-
skipped_count: report.skippedCount,
|
|
2885
|
-
duration_ms: report.durationMs,
|
|
2886
|
-
execution_error_count: 0
|
|
2887
|
-
};
|
|
2888
|
-
for (const layer of report.layers) {
|
|
2889
|
-
if (hasValidTaskMeasurement(layer)) raw[`layer.${layer.layer}`] = layer.score;
|
|
2890
|
-
else unscoredLayerCount++;
|
|
2891
|
-
raw[`layer_${layer.layer}_pass`] = layer.status === "pass" ? 1 : 0;
|
|
2892
|
-
if (layer.status === "error" || layer.status === "timeout") {
|
|
2893
|
-
if (layer.errorSource === "judge") judgeErrorCount++;
|
|
2894
|
-
else executionErrorCount++;
|
|
2895
|
-
if (layer.status === "error") layerErrorCount++;
|
|
2896
|
-
else layerTimeoutCount++;
|
|
2897
|
-
}
|
|
2898
|
-
if (layer.diagnostics) {
|
|
2899
|
-
for (const [k, v] of Object.entries(layer.diagnostics)) if (typeof v === "number" && Number.isFinite(v)) raw[`layer.${layer.layer}.${k}`] = v;
|
|
2900
|
-
}
|
|
2901
|
-
}
|
|
2902
|
-
raw.execution_error_count = executionErrorCount;
|
|
2903
|
-
if (judgeErrorCount > 0) raw.judge_error_count = judgeErrorCount;
|
|
2904
|
-
if (layerErrorCount > 0) raw.layer_error_count = layerErrorCount;
|
|
2905
|
-
if (layerTimeoutCount > 0) raw.layer_timeout_count = layerTimeoutCount;
|
|
2906
|
-
if (unscoredLayerCount > 0) raw.unscored_layer_count = unscoredLayerCount;
|
|
2907
|
-
if (taskScore !== void 0) raw.blended_score = taskScore;
|
|
2908
|
-
const firstScoredFailure = report.layers.find((layer) => layer.status === "fail" && hasValidTaskMeasurement(layer));
|
|
2909
|
-
const outcome = { raw };
|
|
2910
|
-
if (taskScore !== void 0) {
|
|
2911
|
-
if (splitTag === "holdout") outcome.holdoutScore = taskScore;
|
|
2912
|
-
else outcome.searchScore = taskScore;
|
|
2913
|
-
}
|
|
2914
|
-
return {
|
|
2915
|
-
runId,
|
|
2916
|
-
experimentId: ctx.experimentId,
|
|
2917
|
-
candidateId: ctx.candidateId,
|
|
2918
|
-
seed: 0,
|
|
2919
|
-
model: ctx.model,
|
|
2920
|
-
promptHash: ctx.promptHash,
|
|
2921
|
-
configHash: ctx.configHash,
|
|
2922
|
-
commitSha: ctx.commitSha,
|
|
2923
|
-
wallMs: report.durationMs,
|
|
2924
|
-
costUsd: ctx.defaultCostUsd ?? null,
|
|
2925
|
-
costProvenance: ctx.defaultCostUsd === void 0 ? {
|
|
2926
|
-
kind: "uncaptured",
|
|
2927
|
-
usd: null
|
|
2928
|
-
} : {
|
|
2929
|
-
kind: "estimated",
|
|
2930
|
-
usd: ctx.defaultCostUsd
|
|
2931
|
-
},
|
|
2932
|
-
tokenUsage: {
|
|
2933
|
-
input: 0,
|
|
2934
|
-
output: 0
|
|
2935
|
-
},
|
|
2936
|
-
terminalOutcome: "succeeded",
|
|
2937
|
-
outcome,
|
|
2938
|
-
...firstScoredFailure ? {
|
|
2939
|
-
failureClass: "unknown",
|
|
2940
|
-
failureMode: `layer_${firstScoredFailure.layer}_fail`
|
|
2941
|
-
} : {},
|
|
2942
|
-
splitTag,
|
|
2943
|
-
scenarioId: ctx.scenarioId
|
|
2944
|
-
};
|
|
2945
|
-
}
|
|
2946
|
-
function hasValidTaskMeasurement(layer) {
|
|
2947
|
-
return (layer.status === "pass" || layer.status === "fail") && isValidScore(layer.score);
|
|
2948
|
-
}
|
|
2949
|
-
function isValidScore(score) {
|
|
2950
|
-
return typeof score === "number" && Number.isFinite(score) && score >= 0 && score <= 1;
|
|
2951
|
-
}
|
|
2952
2549
|
//#endregion
|
|
2953
2550
|
//#region src/rl/sim-fidelity.ts
|
|
2954
|
-
/**
|
|
2955
|
-
* Simulator fidelity — score a user SIMULATOR's realism against real-user
|
|
2956
|
-
* trace distributions.
|
|
2957
|
-
*
|
|
2958
|
-
* Synthetic-persona evals (`PersonaConfig`-driven canonical evals, fuzz
|
|
2959
|
-
* user-simulator objectives) stand in for real users in most of the numbers
|
|
2960
|
-
* we publish. The standing threat is the Sim2Real gap: a simulator that is
|
|
2961
|
-
* distributionally unlike production creates "easy mode" and silently
|
|
2962
|
-
* inflates every score built on it. This module measures that gap from the
|
|
2963
|
-
* SAME artifact both sides already produce — `RunRecord`s — so no new
|
|
2964
|
-
* capture pipeline is needed:
|
|
2965
|
-
*
|
|
2966
|
-
* - `simFidelityReport` — per-feature Jensen-Shannon divergence between
|
|
2967
|
-
* simulated and production record distributions, collapsed into a
|
|
2968
|
-
* fidelity coefficient in [0,1].
|
|
2969
|
-
* - `easyModeCheck` — the headline academic failure mode (sim inflates
|
|
2970
|
-
* pass-rate over production) as its own named artifact.
|
|
2971
|
-
*
|
|
2972
|
-
* Every synthetic-persona eval result should publish its fidelity
|
|
2973
|
-
* coefficient alongside the score — a number from an unrepresentative
|
|
2974
|
-
* simulator is an unlabeled estimate. Wire-in points:
|
|
2975
|
-
*
|
|
2976
|
-
* - canonical persona evals: pass the campaign's `RunRecord`s as
|
|
2977
|
-
* `simulated` and intake-adapter output (`contract/intake`: OTel spans,
|
|
2978
|
-
* feedback tables, coding-agent sessions) as `production`
|
|
2979
|
-
* - the fuzz user-sim objective: use `1 - report.fidelity` as a realism
|
|
2980
|
-
* penalty when searching over generated personas
|
|
2981
|
-
* - the durable corpus (`./corpus`): both sides read straight from
|
|
2982
|
-
* `readCorpus` — tag sim vs production by `experimentId`
|
|
2983
|
-
*/
|
|
2984
|
-
/** Reserved histogram category for `null` feature values. A capture-rate
|
|
2985
|
-
* difference (one side instruments a signal, the other does not) registers
|
|
2986
|
-
* as divergence by design: a simulator that produces no tool traces is not
|
|
2987
|
-
* representative of production that does. */
|
|
2988
|
-
const ABSENT_CATEGORY = "(absent)";
|
|
2989
|
-
/** Minimum non-null observations PER SIDE for a feature to enter the
|
|
2990
|
-
* fidelity mean. Below this the JSD estimate is sampling noise. */
|
|
2991
|
-
const DEFAULT_MIN_N_PER_FEATURE = 20;
|
|
2992
|
-
/** Quantile buckets used to discretize numeric features. Quartiles balance
|
|
2993
|
-
* resolution against per-bucket sample size at the default minN. */
|
|
2994
|
-
const DEFAULT_QUANTILE_BUCKETS = 4;
|
|
2995
|
-
/** Fidelity at or above this → 'representative'; below → 'skewed'.
|
|
2996
|
-
* 1 − 0.8 = mean JSD 0.2 ≈ distributions that mostly overlap with one
|
|
2997
|
-
* clearly shifted mode — the point where per-feature shifts start changing
|
|
2998
|
-
* which failure classes an eval can even observe. */
|
|
2999
|
-
const REPRESENTATIVE_MIN_FIDELITY = .8;
|
|
3000
|
-
const TOP_SHIFT_COUNT = 5;
|
|
3001
|
-
/**
|
|
3002
|
-
* Default feature set — ONLY fields verified present on both simulated and
|
|
3003
|
-
* production records:
|
|
3004
|
-
*
|
|
3005
|
-
* - `score`, `wall_ms`, `output_tokens` — mandatory per the `RunRecord`
|
|
3006
|
-
* validator (non-finite values read as absent rather than poisoning a
|
|
3007
|
-
* bucket).
|
|
3008
|
-
* - `failure_class` — optional taxonomy field; absent counted explicitly.
|
|
3009
|
-
* - `turn_count`, `tool_errors`, `tool_error_recovery` — derived from the
|
|
3010
|
-
* `outcome.raw` counters the intake adapters and eval harnesses write
|
|
3011
|
-
* (`turns_completed`, `assistant_messages`, `tool_errors`,
|
|
3012
|
-
* `turns_aborted`); absent on records whose producer did not capture
|
|
3013
|
-
* them, counted explicitly.
|
|
3014
|
-
* - `completion_length` — from the optional `CorpusRecord` trajectory
|
|
3015
|
-
* text; the message-length proxy when records come from the corpus.
|
|
3016
|
-
*
|
|
3017
|
-
* `RunRecord` carries event COUNTS, not event ordering, so
|
|
3018
|
-
* `tool_error_recovery` is a counts-only derivation: errors occurred and the
|
|
3019
|
-
* run still completed cleanly ('recovered') vs aborted or classified as a
|
|
3020
|
-
* failure ('unrecovered') — not a literal error→retry sequence check.
|
|
3021
|
-
*/
|
|
3022
|
-
const defaultBehaviorFeatures = (record) => {
|
|
3023
|
-
const raw = record.outcome?.raw ?? {};
|
|
3024
|
-
const toolErrors = finiteOrNull(raw.tool_errors);
|
|
3025
|
-
const turnsAborted = finiteOrNull(raw.turns_aborted);
|
|
3026
|
-
const completion = record.completion;
|
|
3027
|
-
return {
|
|
3028
|
-
score: finiteOrNull(observedSplitScore(record, "holdout")) ?? finiteOrNull(observedSplitScore(record, "search")),
|
|
3029
|
-
failure_class: record.failureClass ?? null,
|
|
3030
|
-
wall_ms: finiteOrNull(record.wallMs),
|
|
3031
|
-
output_tokens: finiteOrNull(record.tokenUsage?.output),
|
|
3032
|
-
turn_count: finiteOrNull(raw.turns_completed) ?? finiteOrNull(raw.assistant_messages),
|
|
3033
|
-
tool_errors: toolErrors,
|
|
3034
|
-
tool_error_recovery: toolErrorRecovery(toolErrors, turnsAborted, record.failureClass),
|
|
3035
|
-
completion_length: typeof completion === "string" ? completion.length : null
|
|
3036
|
-
};
|
|
3037
|
-
};
|
|
3038
|
-
function toolErrorRecovery(toolErrors, turnsAborted, failureClass) {
|
|
3039
|
-
if (toolErrors === null) return null;
|
|
3040
|
-
if (toolErrors === 0) return "no-tool-errors";
|
|
3041
|
-
return (turnsAborted ?? 0) > 0 || failureClass !== void 0 && failureClass !== "success" ? "unrecovered" : "recovered";
|
|
3042
|
-
}
|
|
3043
|
-
function finiteOrNull(value) {
|
|
3044
|
-
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
3045
|
-
}
|
|
3046
|
-
/**
|
|
3047
|
-
* Jensen-Shannon divergence between two categorical histograms (raw counts;
|
|
3048
|
-
* normalized internally). Log base 2 → bounded [0,1]: 0 = identical
|
|
3049
|
-
* distributions, 1 = disjoint support. Symmetric, defined even where the
|
|
3050
|
-
* supports differ — exactly the regime sim-vs-production comparison lives in.
|
|
3051
|
-
* Throws on zero-mass or negative/non-finite counts: an empty histogram has
|
|
3052
|
-
* no distribution and a silent 0 would read as "perfectly representative".
|
|
3053
|
-
*/
|
|
3054
|
-
function jsDivergence(p, q) {
|
|
3055
|
-
const keys = /* @__PURE__ */ new Set([...Object.keys(p), ...Object.keys(q)]);
|
|
3056
|
-
if (keys.size === 0) throw new ValidationError("jsDivergence: both histograms are empty");
|
|
3057
|
-
let pSum = 0;
|
|
3058
|
-
let qSum = 0;
|
|
3059
|
-
for (const key of keys) {
|
|
3060
|
-
const pv = p[key] ?? 0;
|
|
3061
|
-
const qv = q[key] ?? 0;
|
|
3062
|
-
if (!Number.isFinite(pv) || !Number.isFinite(qv) || pv < 0 || qv < 0) throw new ValidationError(`jsDivergence: negative or non-finite count for category "${key}"`);
|
|
3063
|
-
pSum += pv;
|
|
3064
|
-
qSum += qv;
|
|
3065
|
-
}
|
|
3066
|
-
if (pSum === 0 || qSum === 0) throw new ValidationError("jsDivergence: a histogram with zero total mass has no distribution");
|
|
3067
|
-
let divergence = 0;
|
|
3068
|
-
for (const key of keys) {
|
|
3069
|
-
const pp = (p[key] ?? 0) / pSum;
|
|
3070
|
-
const qp = (q[key] ?? 0) / qSum;
|
|
3071
|
-
const m = (pp + qp) / 2;
|
|
3072
|
-
if (pp > 0) divergence += .5 * pp * Math.log2(pp / m);
|
|
3073
|
-
if (qp > 0) divergence += .5 * qp * Math.log2(qp / m);
|
|
3074
|
-
}
|
|
3075
|
-
return Math.min(1, Math.max(0, divergence));
|
|
3076
|
-
}
|
|
3077
|
-
/**
|
|
3078
|
-
* Deterministic quantile edges over a value set (the UNION of both sides, so
|
|
3079
|
-
* sim and production land in the same buckets). Linear interpolation between
|
|
3080
|
-
* order statistics; duplicate edges from heavy ties collapse into fewer,
|
|
3081
|
-
* wider buckets. Returns `bucketCount - 1` edges before deduplication.
|
|
3082
|
-
*/
|
|
3083
|
-
function quantileEdges(values, bucketCount = DEFAULT_QUANTILE_BUCKETS) {
|
|
3084
|
-
if (values.length === 0) throw new ValidationError("quantileEdges: requires at least one value");
|
|
3085
|
-
if (!Number.isInteger(bucketCount) || bucketCount < 2) throw new ValidationError(`quantileEdges: bucketCount must be an integer >= 2, got ${bucketCount}`);
|
|
3086
|
-
const sorted = [...values].sort((a, b) => a - b);
|
|
3087
|
-
const edges = [];
|
|
3088
|
-
for (let k = 1; k < bucketCount; k++) {
|
|
3089
|
-
const pos = k / bucketCount * (sorted.length - 1);
|
|
3090
|
-
const lo = sorted[Math.floor(pos)];
|
|
3091
|
-
const hi = sorted[Math.ceil(pos)];
|
|
3092
|
-
edges.push(lo + (pos - Math.floor(pos)) * (hi - lo));
|
|
3093
|
-
}
|
|
3094
|
-
return [...new Set(edges)];
|
|
3095
|
-
}
|
|
3096
2551
|
/** Stable half-open bucket label for a value against quantile edges:
|
|
3097
2552
|
* `[-inf,e0)`, `[e0,e1)`, …, `[eLast,+inf)`. */
|
|
3098
2553
|
function bucketLabel(value, edges) {
|
|
@@ -3100,126 +2555,6 @@ function bucketLabel(value, edges) {
|
|
|
3100
2555
|
while (i < edges.length && value >= edges[i]) i++;
|
|
3101
2556
|
return `[${i === 0 ? "-inf" : String(edges[i - 1])},${i === edges.length ? "+inf" : String(edges[i])})`;
|
|
3102
2557
|
}
|
|
3103
|
-
/**
|
|
3104
|
-
* Compare a simulator's RunRecords against production RunRecords, feature by
|
|
3105
|
-
* feature. Numeric features are bucketed by deterministic quantiles of the
|
|
3106
|
-
* union; nulls count as an explicit `ABSENT_CATEGORY`. Throws on empty
|
|
3107
|
-
* inputs — "no records" is a wiring error, not a distribution.
|
|
3108
|
-
*/
|
|
3109
|
-
function simFidelityReport(simulated, production, opts = {}) {
|
|
3110
|
-
if (simulated.length === 0) throw new ValidationError("simFidelityReport: simulated records are empty");
|
|
3111
|
-
if (production.length === 0) throw new ValidationError("simFidelityReport: production records are empty");
|
|
3112
|
-
const extract = opts.features ?? defaultBehaviorFeatures;
|
|
3113
|
-
const minN = opts.minNPerFeature ?? DEFAULT_MIN_N_PER_FEATURE;
|
|
3114
|
-
const simMaps = simulated.map(extract);
|
|
3115
|
-
const prodMaps = production.map(extract);
|
|
3116
|
-
const featureNames = [];
|
|
3117
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3118
|
-
for (const map of [...simMaps, ...prodMaps]) for (const name of Object.keys(map)) if (!seen.has(name)) {
|
|
3119
|
-
seen.add(name);
|
|
3120
|
-
featureNames.push(name);
|
|
3121
|
-
}
|
|
3122
|
-
const perDimension = [];
|
|
3123
|
-
const insufficientData = [];
|
|
3124
|
-
for (const feature of featureNames) {
|
|
3125
|
-
const simVals = simMaps.map((m) => m[feature] ?? null);
|
|
3126
|
-
const prodVals = prodMaps.map((m) => m[feature] ?? null);
|
|
3127
|
-
const nSim = simVals.filter((v) => v !== null).length;
|
|
3128
|
-
const nProd = prodVals.filter((v) => v !== null).length;
|
|
3129
|
-
if (nSim < minN || nProd < minN) {
|
|
3130
|
-
insufficientData.push(feature);
|
|
3131
|
-
continue;
|
|
3132
|
-
}
|
|
3133
|
-
const { sim, prod } = histograms(feature, simVals, prodVals);
|
|
3134
|
-
perDimension.push({
|
|
3135
|
-
feature,
|
|
3136
|
-
divergence: jsDivergence(sim, prod),
|
|
3137
|
-
topShifts: topShifts(sim, simVals.length, prod, prodVals.length),
|
|
3138
|
-
nSim,
|
|
3139
|
-
nProd
|
|
3140
|
-
});
|
|
3141
|
-
}
|
|
3142
|
-
if (perDimension.length === 0) return {
|
|
3143
|
-
perDimension,
|
|
3144
|
-
fidelity: NaN,
|
|
3145
|
-
insufficientData,
|
|
3146
|
-
verdict: "insufficient-data"
|
|
3147
|
-
};
|
|
3148
|
-
const fidelity = 1 - perDimension.reduce((sum, d) => sum + d.divergence, 0) / perDimension.length;
|
|
3149
|
-
return {
|
|
3150
|
-
perDimension,
|
|
3151
|
-
fidelity,
|
|
3152
|
-
insufficientData,
|
|
3153
|
-
verdict: fidelity >= REPRESENTATIVE_MIN_FIDELITY ? "representative" : "skewed"
|
|
3154
|
-
};
|
|
3155
|
-
}
|
|
3156
|
-
function histograms(feature, simVals, prodVals) {
|
|
3157
|
-
const kinds = /* @__PURE__ */ new Set();
|
|
3158
|
-
for (const v of [...simVals, ...prodVals]) if (v !== null) kinds.add(typeof v);
|
|
3159
|
-
if (kinds.size > 1) throw new ValidationError(`simFidelityReport: feature "${feature}" mixes string and number values — an extractor must return one kind per feature`);
|
|
3160
|
-
let toCategory;
|
|
3161
|
-
if (kinds.has("number")) {
|
|
3162
|
-
const union = [];
|
|
3163
|
-
for (const v of [...simVals, ...prodVals]) if (v !== null) union.push(v);
|
|
3164
|
-
const edges = quantileEdges(union);
|
|
3165
|
-
toCategory = (v) => bucketLabel(v, edges);
|
|
3166
|
-
} else toCategory = (v) => v;
|
|
3167
|
-
const count = (vals) => {
|
|
3168
|
-
const hist = {};
|
|
3169
|
-
for (const v of vals) {
|
|
3170
|
-
const key = v === null ? ABSENT_CATEGORY : toCategory(v);
|
|
3171
|
-
hist[key] = (hist[key] ?? 0) + 1;
|
|
3172
|
-
}
|
|
3173
|
-
return hist;
|
|
3174
|
-
};
|
|
3175
|
-
return {
|
|
3176
|
-
sim: count(simVals),
|
|
3177
|
-
prod: count(prodVals)
|
|
3178
|
-
};
|
|
3179
|
-
}
|
|
3180
|
-
function topShifts(sim, simTotal, prod, prodTotal) {
|
|
3181
|
-
const shifts = [.../* @__PURE__ */ new Set([...Object.keys(sim), ...Object.keys(prod)])].map((value) => ({
|
|
3182
|
-
value,
|
|
3183
|
-
pSim: (sim[value] ?? 0) / simTotal,
|
|
3184
|
-
pProd: (prod[value] ?? 0) / prodTotal
|
|
3185
|
-
}));
|
|
3186
|
-
shifts.sort((a, b) => {
|
|
3187
|
-
const delta = Math.abs(b.pSim - b.pProd) - Math.abs(a.pSim - a.pProd);
|
|
3188
|
-
return delta !== 0 ? delta : a.value.localeCompare(b.value);
|
|
3189
|
-
});
|
|
3190
|
-
return shifts.slice(0, TOP_SHIFT_COUNT);
|
|
3191
|
-
}
|
|
3192
|
-
/**
|
|
3193
|
-
* The headline simulator failure mode as its own named artifact: a simulator
|
|
3194
|
-
* that creates "easy mode" inflates pass-rate relative to production, and
|
|
3195
|
-
* every score measured against it overstates reality. Throws on empty inputs
|
|
3196
|
-
* and on records carrying neither score — a silently-skipped record would
|
|
3197
|
-
* bias the very rate this check exists to keep honest.
|
|
3198
|
-
*/
|
|
3199
|
-
function easyModeCheck(simulated, production, opts = {}) {
|
|
3200
|
-
if (simulated.length === 0) throw new ValidationError("easyModeCheck: simulated records are empty");
|
|
3201
|
-
if (production.length === 0) throw new ValidationError("easyModeCheck: production records are empty");
|
|
3202
|
-
const threshold = opts.passThreshold ?? .5;
|
|
3203
|
-
const tolerance = opts.inflationTolerance ?? .1;
|
|
3204
|
-
const passRate = (records, side) => {
|
|
3205
|
-
let passes = 0;
|
|
3206
|
-
for (const r of records) {
|
|
3207
|
-
const score = finiteOrNull(observedSplitScore(r, "holdout")) ?? finiteOrNull(observedSplitScore(r, "search"));
|
|
3208
|
-
if (score === null) throw new ValidationError(`easyModeCheck: ${side} run "${r.runId}" carries neither holdoutScore nor searchScore`);
|
|
3209
|
-
if (score >= threshold) passes++;
|
|
3210
|
-
}
|
|
3211
|
-
return passes / records.length;
|
|
3212
|
-
};
|
|
3213
|
-
const simPassRate = passRate(simulated, "simulated");
|
|
3214
|
-
const prodPassRate = passRate(production, "production");
|
|
3215
|
-
const gap = simPassRate - prodPassRate;
|
|
3216
|
-
return {
|
|
3217
|
-
simPassRate,
|
|
3218
|
-
prodPassRate,
|
|
3219
|
-
gap,
|
|
3220
|
-
inflated: gap > tolerance
|
|
3221
|
-
};
|
|
3222
|
-
}
|
|
3223
2558
|
//#endregion
|
|
3224
2559
|
//#region src/rl/tournament.ts
|
|
3225
2560
|
/**
|
|
@@ -3321,58 +2656,6 @@ function fitBradleyTerry(outcomes, opts = {}) {
|
|
|
3321
2656
|
converged: delta < tol
|
|
3322
2657
|
};
|
|
3323
2658
|
}
|
|
3324
|
-
function applyEloUpdate(ratings, outcome, opts = {}) {
|
|
3325
|
-
const defaultRating = opts.defaultRating ?? 1500;
|
|
3326
|
-
const k = opts.kFactor ?? 32;
|
|
3327
|
-
const rW = ratings.get(outcome.winner) ?? defaultRating;
|
|
3328
|
-
const rL = ratings.get(outcome.loser) ?? defaultRating;
|
|
3329
|
-
const expectedW = 1 / (1 + 10 ** ((rL - rW) / 400));
|
|
3330
|
-
const scoreW = outcome.draw ? .5 : 1;
|
|
3331
|
-
const scoreL = outcome.draw ? .5 : 0;
|
|
3332
|
-
const w = outcome.weight ?? 1;
|
|
3333
|
-
const winnerDelta = k * w * (scoreW - expectedW);
|
|
3334
|
-
const loserDelta = k * w * (scoreL - (1 - expectedW));
|
|
3335
|
-
ratings.set(outcome.winner, rW + winnerDelta);
|
|
3336
|
-
ratings.set(outcome.loser, rL + loserDelta);
|
|
3337
|
-
return {
|
|
3338
|
-
winnerDelta,
|
|
3339
|
-
loserDelta
|
|
3340
|
-
};
|
|
3341
|
-
}
|
|
3342
|
-
function buildPairwiseFromCampaign(input) {
|
|
3343
|
-
const drawMargin = input.drawMargin ?? 0;
|
|
3344
|
-
const byKey = /* @__PURE__ */ new Map();
|
|
3345
|
-
for (const r of input.runs) {
|
|
3346
|
-
const arr = byKey.get(r.matchKey) ?? [];
|
|
3347
|
-
arr.push({
|
|
3348
|
-
candidateId: r.candidateId,
|
|
3349
|
-
score: r.score
|
|
3350
|
-
});
|
|
3351
|
-
byKey.set(r.matchKey, arr);
|
|
3352
|
-
}
|
|
3353
|
-
const outcomes = [];
|
|
3354
|
-
for (const arr of byKey.values()) for (let i = 0; i < arr.length; i++) for (let j = i + 1; j < arr.length; j++) {
|
|
3355
|
-
const a = arr[i];
|
|
3356
|
-
const b = arr[j];
|
|
3357
|
-
if (a.candidateId === b.candidateId) continue;
|
|
3358
|
-
const margin = Math.abs(a.score - b.score);
|
|
3359
|
-
if (margin <= drawMargin) outcomes.push({
|
|
3360
|
-
winner: a.candidateId,
|
|
3361
|
-
loser: b.candidateId,
|
|
3362
|
-
draw: true,
|
|
3363
|
-
weight: 1
|
|
3364
|
-
});
|
|
3365
|
-
else {
|
|
3366
|
-
const [winner, loser] = a.score > b.score ? [a, b] : [b, a];
|
|
3367
|
-
outcomes.push({
|
|
3368
|
-
winner: winner.candidateId,
|
|
3369
|
-
loser: loser.candidateId,
|
|
3370
|
-
weight: margin
|
|
3371
|
-
});
|
|
3372
|
-
}
|
|
3373
|
-
}
|
|
3374
|
-
return outcomes;
|
|
3375
|
-
}
|
|
3376
2659
|
//#endregion
|
|
3377
2660
|
//#region src/rl/verified-findings-dataset.ts
|
|
3378
2661
|
/**
|
|
@@ -3590,9 +2873,6 @@ function summarizeVerifiedFindings(rows) {
|
|
|
3590
2873
|
}
|
|
3591
2874
|
return summary;
|
|
3592
2875
|
}
|
|
3593
|
-
function verifiedFindingsToJsonl(rows) {
|
|
3594
|
-
return rows.map((row) => JSON.stringify(row)).join("\n") + (rows.length > 0 ? "\n" : "");
|
|
3595
|
-
}
|
|
3596
2876
|
function sha256(buffer) {
|
|
3597
2877
|
return createHash("sha256").update(buffer).digest("hex");
|
|
3598
2878
|
}
|
|
@@ -3711,6 +2991,6 @@ function loadVerifiedFindingsDataset(source) {
|
|
|
3711
2991
|
};
|
|
3712
2992
|
}
|
|
3713
2993
|
//#endregion
|
|
3714
|
-
export {
|
|
2994
|
+
export { FileSystemOutcomeStore, GRADER_REFERENCE_PHRASES, InMemoryOutcomeStore, PredictiveValidityResearcher, bestOfN, bucketLabel, buildRlDataset, campaignToRunRecords, checkerReadSignal, claimIntegrityDigest, claimIntegritySystemOneReview, claimIntegrityTraceQuestions, claimIntegrityVerdict, compareAdaptationCurves, detectRewardHacking, doublyRobust, extractPreferences, extractVerifiableReward, extractVerifiableRewardsFromRecords, farmingSignal, firstPassK, fitBradleyTerry, graderReferenceSignal, inverseProbabilityWeighting, loadVerifiedFindingsDataset, monitorSignal, paretoCostScoreFrontier, parseSourceScopeReferee, prmTrainingPairs, readCorpus, refereeSignal, ruleHolds, runAdaptationCurve, runContaminationProbe, runEvalCampaign, runRLCampaign, scopeSignals, selfNormalizedImportanceWeighting, sourceScopeRefereeMessages, systemOneSignal, toAnthropicFormat, toDpoRows, toGrpoRows, toPrmRows, toSftJsonl, toSftRowsWithLookups, toTRLFormat, validateDatasetFormats };
|
|
3715
2995
|
|
|
3716
2996
|
//# sourceMappingURL=rl.js.map
|