@tangle-network/agent-eval 0.216.1 → 0.218.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 +137 -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-D68fd-su.d.ts → analyze-runs-DjlZOVXx.d.ts} +5 -5
- package/dist/{analyze-runs-D68fd-su.d.ts.map → analyze-runs-DjlZOVXx.d.ts.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/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-BupdHRyf.js} +1225 -661
- package/dist/benchmark-command-BupdHRyf.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-CGvUTnmc.js} +324 -800
- package/dist/campaign-CGvUTnmc.js.map +1 -0
- package/dist/{campaign-evidence-Clrn4hBV.js → campaign-evidence-DunzcJGv.js} +10 -18
- package/dist/{campaign-evidence-Clrn4hBV.js.map → campaign-evidence-DunzcJGv.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-B2pXlPdx.js} +2 -2
- package/dist/{chat-client-l-MVDlDk.js.map → chat-client-B2pXlPdx.js.map} +1 -1
- package/dist/{chat-json-call-puMArmtW.js → chat-json-call-Dm9c-b41.js} +3 -2
- package/dist/chat-json-call-Dm9c-b41.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-DbLVf3i8.js} +9 -64
- package/dist/completion-verifier-DbLVf3i8.js.map +1 -0
- package/dist/contract/index.d.ts +12 -12
- package/dist/contract/index.js +107 -403
- 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-BJ-Pq6yL.js} +314 -285
- package/dist/default-registry-BJ-Pq6yL.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-BGdFKlrc.js} +170 -110
- package/dist/define-agent-eval-BGdFKlrc.js.map +1 -0
- package/dist/{define-agent-eval-WSck0CZJ.d.ts → define-agent-eval-BlH10zEw.d.ts} +8 -8
- package/dist/define-agent-eval-BlH10zEw.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-CSMwudLO.js} +5 -10
- package/dist/dspy-rlm-engine-CSMwudLO.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-BUMIxKTE.js +393 -0
- package/dist/eval-campaign-BUMIxKTE.js.map +1 -0
- package/dist/{evaluation-6Yoi74gM.d.ts → evaluation-BOZ38vOH.d.ts} +7 -7
- package/dist/evaluation-BOZ38vOH.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 +258 -311
- package/dist/experiment/index.js.map +1 -1
- package/dist/{exporters-X4xwla8A.js → exporters-DWvM16LE.js} +3 -3
- package/dist/exporters-DWvM16LE.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-C3Wm7Vhn.js} +4 -3
- package/dist/external-optimizer-process-C3Wm7Vhn.js.map +1 -0
- package/dist/{external-optimizer-subprocess-BqW0hHcI.js → external-optimizer-subprocess-B5gdLRZv.js} +9 -11
- package/dist/external-optimizer-subprocess-B5gdLRZv.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-BtTzPL0d.js} +9 -249
- package/dist/findings-store-BtTzPL0d.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-CKxIJQba.js} +4 -24
- package/dist/hf-dataset-CKxIJQba.js.map +1 -0
- package/dist/hosted/index.d.ts +2 -2
- package/dist/hosted/index.js +2 -2
- package/dist/{index-CyszSg4O.d.ts → index-B16FNdW5.d.ts} +145 -360
- package/dist/index-B16FNdW5.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-BO41eGj5.d.ts → index-CX-GAUpw.d.ts} +3 -7
- package/dist/index-CX-GAUpw.d.ts.map +1 -0
- package/dist/{index-DHKEAv3s.d.ts → index-CalAsXMR.d.ts} +8 -68
- package/dist/index-CalAsXMR.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-DPcngtwt.d.ts → index-DbMOXYnP.d.ts} +11 -36
- package/dist/index-DbMOXYnP.d.ts.map +1 -0
- package/dist/index.d.ts +211 -218
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +999 -1714
- package/dist/index.js.map +1 -1
- package/dist/{integrity-dLiDe2kD.js → integrity-C8oUeB0g.js} +326 -203
- package/dist/integrity-C8oUeB0g.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-C7om8Gum.js} +157 -147
- package/dist/journal-C7om8Gum.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/lock-holder.d.ts +2 -0
- package/dist/ledger-core/lock-holder.js +181 -0
- package/dist/ledger-core/lock-holder.js.map +1 -0
- package/dist/{ledger-core-Gq7yp8lP.js → ledger-core-CAxUdDk0.js} +5 -84
- package/dist/ledger-core-CAxUdDk0.js.map +1 -0
- package/dist/{llm-client-CyBAoYiX.js → llm-client-_Y6ic-tf.js} +243 -355
- package/dist/llm-client-_Y6ic-tf.js.map +1 -0
- package/dist/{llm-judge-CG12SQJq.js → llm-judge-Djxh-Uhs.js} +662 -482
- package/dist/llm-judge-Djxh-Uhs.js.map +1 -0
- package/dist/lock-holder-DaJbfpci.d.ts +86 -0
- package/dist/lock-holder-DaJbfpci.d.ts.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-CCSBna4q.d.ts} +9 -18
- package/dist/matrix-CCSBna4q.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-CbdwjTPW.js} +4 -4
- package/dist/{mint-QaD5cA0u.js.map → mint-CbdwjTPW.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-CTv8vozZ.js} +11 -11
- package/dist/pareto-CTv8vozZ.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-CxEHRsZW.d.ts} +7 -8
- package/dist/{promotion-gate-BawrdPYr.d.ts.map → promotion-gate-CxEHRsZW.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-n-5WBbEx.js} +3 -3
- package/dist/proposal-findings-n-5WBbEx.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-Cs34y0iX.js} +625 -587
- package/dist/render-Cs34y0iX.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-GU1tV4dn.d.ts} +9 -9
- package/dist/{researcher-CEcfku-T.d.ts.map → researcher-GU1tV4dn.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-Dd1ucT_M.js} +88 -13
- package/dist/rollout-Dd1ucT_M.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-BuiujZ-g.js → schema-CvhfLjtZ.js} +78 -48
- package/dist/schema-CvhfLjtZ.js.map +1 -0
- package/dist/{schema-2g7trUwH.d.ts → schema-D6EVKzTB.d.ts} +4 -5
- package/dist/schema-D6EVKzTB.d.ts.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-p9JB3SmL.d.ts} +10 -27
- package/dist/search-kernel-p9JB3SmL.d.ts.map +1 -0
- package/dist/{search-ledger-CVUGLDZp.js → search-ledger-ClpN4I3e.js} +7 -7
- package/dist/{search-ledger-CVUGLDZp.js.map → search-ledger-ClpN4I3e.js.map} +1 -1
- package/dist/{search-ledger-file-DDQUgvCg.js → search-ledger-file-Bd5Tioq6.js} +4 -4
- package/dist/search-ledger-file-Bd5Tioq6.js.map +1 -0
- package/dist/{search-shipper-BOSD46qv.js → search-shipper-Bg2HW3Uv.js} +4 -4
- package/dist/search-shipper-Bg2HW3Uv.js.map +1 -0
- package/dist/{search-summary-BQCSWf1g.js → search-summary-CrBuvVnf.js} +5 -5
- package/dist/{search-summary-BQCSWf1g.js.map → search-summary-CrBuvVnf.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-C6M0qR8h.js} +101 -101
- package/dist/server-C6M0qR8h.js.map +1 -0
- package/dist/{single-run-lock-CV9Eyd_q.js → single-run-lock-Dekd8_Wv.js} +7 -7
- package/dist/single-run-lock-Dekd8_Wv.js.map +1 -0
- package/dist/{skillopt-optimization-method-BiwA8nfX.js → skillopt-optimization-method-5dlex7MJ.js} +1386 -1184
- package/dist/skillopt-optimization-method-5dlex7MJ.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-CYpGaoDH.d.ts → statistical-heldout-BHfLZHrm.d.ts} +8 -67
- package/dist/statistical-heldout-BHfLZHrm.d.ts.map +1 -0
- package/dist/{statistical-heldout-42NlCNDe.js → statistical-heldout-Bksv92Th.js} +3 -3
- package/dist/statistical-heldout-Bksv92Th.js.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-CkbRcSuu.d.ts} +25 -19
- package/dist/summary-report-CkbRcSuu.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-BMzDJb1i.d.ts} +5 -5
- package/dist/{systemone-BomhHr2c.d.ts.map → systemone-BMzDJb1i.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-D4Rv-j1W.js} +244 -196
- package/dist/terminal-record-D4Rv-j1W.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 +7 -118
- package/dist/trajectory-replay/index.d.ts.map +1 -1
- package/dist/trajectory-replay/index.js +921 -869
- package/dist/trajectory-replay/index.js.map +1 -1
- package/dist/{tree-C1XYeXvy.js → tree-B5e1uAeL.js} +132 -21
- package/dist/tree-B5e1uAeL.js.map +1 -0
- package/dist/{types-Cbe2fWBa.d.ts → types-BKCzzmit.d.ts} +3 -3
- package/dist/{types-Cbe2fWBa.d.ts.map → types-BKCzzmit.d.ts.map} +1 -1
- 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-IXD2HJzu.js → types-DqFMNTgK.js} +2 -4
- package/dist/types-DqFMNTgK.js.map +1 -0
- package/dist/{types-Cq8mSbq8.d.ts → types-DtkO1G9L.d.ts} +7 -9
- package/dist/{types-Cq8mSbq8.d.ts.map → types-DtkO1G9L.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 +18 -18
- package/docs/design.md +1 -1
- package/docs/eval-surface-map.md +1 -0
- package/docs/evaluation-integrity.md +1 -1
- package/docs/profile-json-identity.md +1 -2
- package/docs/proofs/campaign-attempt-retention-20261001/README.md +2 -2
- package/docs/public-api.md +158 -538
- package/docs/rollout.md +1 -1
- package/docs/trace-repair-admission.md +1 -1
- package/docs/wire-protocol.md +1 -1
- package/package.json +7 -2
- 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-CNTPzIkp.js.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/eval-campaign-90jeaCAI.js +0 -343
- package/dist/eval-campaign-90jeaCAI.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/single-run-lock-CV9Eyd_q.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/contract/index.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { a as hashCanonical } from "../canonical-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { a as hashCanonical } from "../canonical-Dq2hOQ8L.js";
|
|
2
|
+
import "../run-record-DhEJgoPz.js";
|
|
3
|
+
import { r as summarizeExecution, t as analyzeRuns } from "../analyze-runs-DqPJaJ4X.js";
|
|
4
|
+
import { i as pairedBootstrap } from "../mean-BbA_JCzW.js";
|
|
5
|
+
import { t as decidePairedPromotion } from "../paired-promotion-decision-D0SHb-ZL.js";
|
|
6
|
+
import { a as heldoutSignificance } from "../statistical-heldout-Bksv92Th.js";
|
|
7
|
+
import { B as defaultProductionGate, Q as runCampaign, Z as runEval, i as transientDispatchFailure, o as clamp01, p as runImprovementLoop, t as llmJudge } from "../llm-judge-Djxh-Uhs.js";
|
|
8
8
|
import { i as isModelPriced, n as estimateCost } from "../metrics-BKaPBtIG.js";
|
|
9
|
-
import { t as CostLedger } from "../cost-ledger-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
9
|
+
import { t as CostLedger } from "../cost-ledger-D0352Z4d.js";
|
|
10
|
+
import { z as campaignSplitDigest } from "../campaign-evidence-DunzcJGv.js";
|
|
11
|
+
import { o as mapConcurrentRange } from "../journal-C7om8Gum.js";
|
|
12
|
+
import { M as fsCampaignStorage, N as inMemoryCampaignStorage } from "../external-optimizer-subprocess-B5gdLRZv.js";
|
|
13
|
+
import { a as makeProposalFinding } from "../types-DqFMNTgK.js";
|
|
14
|
+
import { n as isRecord } from "../json-BhdsJaOQ.js";
|
|
15
|
+
import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-BGdFKlrc.js";
|
|
16
|
+
import { t as buildDefaultAnalystRegistry } from "../default-registry-BJ-Pq6yL.js";
|
|
17
|
+
import { t as extractUsage } from "../extract-usage-BZLU01kR.js";
|
|
18
|
+
import { t as createChatClient } from "../chat-client-B2pXlPdx.js";
|
|
18
19
|
import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "../outcome-store-DUcMj-3D.js";
|
|
19
|
-
import {
|
|
20
|
-
import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-
|
|
21
|
-
import { t as fromOtelSpans } from "../otel-spans-
|
|
20
|
+
import { c as composeGate, l as externalTextOptimizationMethod, n as compareOptimizationMethods, r as gepaOptimizationMethod, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-5dlex7MJ.js";
|
|
21
|
+
import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-6A8osGr_.js";
|
|
22
|
+
import { t as fromOtelSpans } from "../otel-spans-CdN909k1.js";
|
|
22
23
|
import { createHash } from "node:crypto";
|
|
23
24
|
import { agentCandidateBenchmarkSuiteSchema, agentCandidateBenchmarkTaskSchema, agentCandidateBundleSchema, agentCandidateEvaluationPolicySchema, agentCandidateExperimentSchema, agentImprovementMeasuredComparisonSchema, agentProfileImprovementExperimentSchema, agentProfileImprovementMeasuredComparisonSchema, agentProfileImprovementRunCellSchema, agentProfileImprovementRunReceiptSchema, agentProfileImprovementSuiteInputsSchema, agentProfileImprovementSuiteSchema, agentProfileImprovementTaskSchema, candidateExecutionEvidenceSchema, canonicalCandidateDigest, canonicalCandidateJson, numbersApproximatelyEqual, omitTopLevelDigest } from "@tangle-network/agent-interface";
|
|
24
25
|
import { createReadStream } from "node:fs";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
26
|
+
import "node:path";
|
|
27
|
+
import "node:fs/promises";
|
|
27
28
|
import { readSessionInput, summarizeSessionInput } from "@tangle-network/harness-sessions";
|
|
28
29
|
//#region src/contract/fixed-spend.ts
|
|
29
30
|
function addFixedSpend(left, right) {
|
|
@@ -368,6 +369,11 @@ function assertKnownCost(cost, label) {
|
|
|
368
369
|
* only validates the projected measurements and derives their shared decision.
|
|
369
370
|
*/
|
|
370
371
|
function evaluatePairedMeasurements(options) {
|
|
372
|
+
return pairedVerdict(budgetAndChecks(runTotals(dimensionRegressions(pairedEstimates(validatePairedInput({ options }))))));
|
|
373
|
+
}
|
|
374
|
+
/** The checked policy and measurements, their cell ids, shared dimensions and score arrays. */
|
|
375
|
+
function validatePairedInput(prev) {
|
|
376
|
+
const { options } = prev;
|
|
371
377
|
if (options.measurements.length === 0) throw new Error("paired measurement evaluation requires at least one paired cell");
|
|
372
378
|
const preparationCost = options.preparationCost ?? {
|
|
373
379
|
usd: 0,
|
|
@@ -383,6 +389,28 @@ function evaluatePairedMeasurements(options) {
|
|
|
383
389
|
const baselineScores = measurements.map((measurement) => measurement.baseline.score);
|
|
384
390
|
const candidateScores = measurements.map((measurement) => measurement.candidate.score);
|
|
385
391
|
const { confidenceLevel: confidence, resamples, bootstrapSeed, deltaThreshold, minProductiveRuns, budgetUsd, criticalDimensions, regressionTolerance } = policy;
|
|
392
|
+
return {
|
|
393
|
+
...prev,
|
|
394
|
+
preparationCost,
|
|
395
|
+
policy,
|
|
396
|
+
measurements,
|
|
397
|
+
cellIds,
|
|
398
|
+
dimensions,
|
|
399
|
+
baselineScores,
|
|
400
|
+
candidateScores,
|
|
401
|
+
confidence,
|
|
402
|
+
resamples,
|
|
403
|
+
bootstrapSeed,
|
|
404
|
+
deltaThreshold,
|
|
405
|
+
minProductiveRuns,
|
|
406
|
+
budgetUsd,
|
|
407
|
+
criticalDimensions,
|
|
408
|
+
regressionTolerance
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
/** Held-out significance, the overall, cost and latency estimates, and the observed power. */
|
|
412
|
+
function pairedEstimates(prev) {
|
|
413
|
+
const { options, measurements, cellIds, dimensions, baselineScores, candidateScores, confidence, resamples, bootstrapSeed, deltaThreshold, minProductiveRuns } = prev;
|
|
386
414
|
const significance = heldoutSignificance({
|
|
387
415
|
before: baselineScores,
|
|
388
416
|
after: candidateScores,
|
|
@@ -455,6 +483,19 @@ function evaluatePairedMeasurements(options) {
|
|
|
455
483
|
confidence,
|
|
456
484
|
sharedScorerChannel: options.sharedScorerChannel
|
|
457
485
|
});
|
|
486
|
+
return {
|
|
487
|
+
...prev,
|
|
488
|
+
significance,
|
|
489
|
+
overall,
|
|
490
|
+
objectives,
|
|
491
|
+
cost,
|
|
492
|
+
latency,
|
|
493
|
+
power
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
/** Critical dimensions that regressed, on either burden of proof. */
|
|
497
|
+
function dimensionRegressions(prev) {
|
|
498
|
+
const { measurements, dimensions, confidence, resamples, bootstrapSeed, minProductiveRuns, criticalDimensions, regressionTolerance, objectives, power } = prev;
|
|
458
499
|
const powerSufficient = power.sufficient;
|
|
459
500
|
const guardedDimensions = new Set(criticalDimensions);
|
|
460
501
|
const missingCriticalDimensions = criticalDimensions.filter((dimension) => !dimensions.includes(dimension));
|
|
@@ -472,9 +513,22 @@ function evaluatePairedMeasurements(options) {
|
|
|
472
513
|
}).promote;
|
|
473
514
|
}));
|
|
474
515
|
const regressions = objectives.filter((objective) => objective.kind === "dimension" && guardedDimensions.has(objective.name) && objective.availability === "measured" && (objective.confidenceInterval.lower < -regressionTolerance || regressionProven.has(objective.name)));
|
|
516
|
+
return {
|
|
517
|
+
...prev,
|
|
518
|
+
powerSufficient,
|
|
519
|
+
guardedDimensions,
|
|
520
|
+
missingCriticalDimensions,
|
|
521
|
+
regressionProven,
|
|
522
|
+
regressions
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
/** Run completion, per-task regressions and the measurement cost. */
|
|
526
|
+
function runTotals(prev) {
|
|
527
|
+
const { options, measurements } = prev;
|
|
475
528
|
const measurementCostUsd = measurements.reduce((sum, measurement) => sum + measurement.baseline.costUsd + measurement.candidate.costUsd, 0);
|
|
476
529
|
const measurementWorkDurationMs = measurements.reduce((sum, measurement) => sum + measurement.baseline.latencyMs + measurement.candidate.latencyMs, 0);
|
|
477
|
-
const
|
|
530
|
+
const completedRuns = measurements.flatMap((measurement) => [measurement.baseline, measurement.candidate]);
|
|
531
|
+
const incompleteRuns = completedRuns.filter((run) => !run.completed);
|
|
478
532
|
const regressedTasks = measurements.filter((measurement) => !measurement.candidate.passed && measurement.baseline.passed);
|
|
479
533
|
const sharedTaskFailures = measurements.filter((measurement) => !measurement.candidate.passed && !measurement.baseline.passed);
|
|
480
534
|
const repairedTasks = measurements.filter((measurement) => measurement.candidate.passed && !measurement.baseline.passed);
|
|
@@ -483,7 +537,22 @@ function evaluatePairedMeasurements(options) {
|
|
|
483
537
|
provenance: measurements.every((measurement) => measurement.baseline.costProvenance === "observed" && measurement.candidate.costProvenance === "observed") ? "observed" : "estimated"
|
|
484
538
|
};
|
|
485
539
|
const measurementCost = options.measurementCost ?? derivedMeasurementCost;
|
|
486
|
-
|
|
540
|
+
return {
|
|
541
|
+
...prev,
|
|
542
|
+
measurementCostUsd,
|
|
543
|
+
measurementWorkDurationMs,
|
|
544
|
+
completedRuns,
|
|
545
|
+
incompleteRuns,
|
|
546
|
+
regressedTasks,
|
|
547
|
+
sharedTaskFailures,
|
|
548
|
+
repairedTasks,
|
|
549
|
+
derivedMeasurementCost,
|
|
550
|
+
measurementCost
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
/** Total cost against the budget, and the checks the verdict is drawn from. */
|
|
554
|
+
function budgetAndChecks(prev) {
|
|
555
|
+
const { options, preparationCost, budgetUsd, significance, powerSufficient, missingCriticalDimensions, regressions, incompleteRuns, regressedTasks, derivedMeasurementCost, measurementCost } = prev;
|
|
487
556
|
if (options.measurementCost !== void 0 && (measurementCost.provenance !== derivedMeasurementCost.provenance || !numbersApproximatelyEqual(measurementCost.usd, derivedMeasurementCost.usd))) throw new Error("paired measurement cost does not match its signed receipts");
|
|
488
557
|
const totalCost = {
|
|
489
558
|
usd: preparationCost.usd + measurementCost.usd,
|
|
@@ -518,6 +587,18 @@ function evaluatePairedMeasurements(options) {
|
|
|
518
587
|
];
|
|
519
588
|
const shipped = checks.every((check) => check.passed);
|
|
520
589
|
const hardFailure = incompleteRuns.length > 0 || regressedTasks.length > 0 || regressions.length > 0 || missingCriticalDimensions.length > 0 || !budgetPassed;
|
|
590
|
+
return {
|
|
591
|
+
...prev,
|
|
592
|
+
totalCost,
|
|
593
|
+
budgetPassed,
|
|
594
|
+
checks,
|
|
595
|
+
shipped,
|
|
596
|
+
hardFailure
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
/** The verdict, its reasons and the evaluation record. */
|
|
600
|
+
function pairedVerdict(prev) {
|
|
601
|
+
const { options, baselineScores, confidence, deltaThreshold, budgetUsd, significance, overall, objectives, power, powerSufficient, missingCriticalDimensions, regressions, measurementWorkDurationMs, incompleteRuns, regressedTasks, sharedTaskFailures, repairedTasks, measurementCost, totalCost, budgetPassed, checks, shipped, hardFailure } = prev;
|
|
521
602
|
const reasons = [
|
|
522
603
|
...significance.significant ? [] : [significanceReason(significance, deltaThreshold)],
|
|
523
604
|
...powerSufficient || significance.fewRuns ? [] : [power.reason],
|
|
@@ -1128,182 +1209,6 @@ const profileReceiptAdapter = {
|
|
|
1128
1209
|
passed: (receipt) => receipt.grading.passed
|
|
1129
1210
|
};
|
|
1130
1211
|
//#endregion
|
|
1131
|
-
//#region src/contract/intake/run-record-dir.ts
|
|
1132
|
-
/**
|
|
1133
|
-
* # `intake/run-record-dir` — load a directory or file of `RunRecord`s.
|
|
1134
|
-
*
|
|
1135
|
-
* The on-disk counterpart to the in-memory intake adapters: point it at a
|
|
1136
|
-
* single `.json` (array) / `.jsonl` (one record per line) file or at a
|
|
1137
|
-
* directory of such files, and it returns the substrate-canonical
|
|
1138
|
-
* `RunRecord[]` ready for `analyzeRuns({ runs })`.
|
|
1139
|
-
*
|
|
1140
|
-
* Validation is at the boundary: each parsed object goes through
|
|
1141
|
-
* `parseRunRecordSafe`. By default an invalid record fails loud with its
|
|
1142
|
-
* file + index; pass `onInvalid: 'collect'` to keep the valid records and
|
|
1143
|
-
* receive the rejects as structured diagnostics instead.
|
|
1144
|
-
*/
|
|
1145
|
-
const ANALYSIS_ARTIFACT$1 = "analysis.json";
|
|
1146
|
-
function defaultInclude(fileName) {
|
|
1147
|
-
if (fileName === ANALYSIS_ARTIFACT$1) return false;
|
|
1148
|
-
return fileName.endsWith(".json") || fileName.endsWith(".jsonl");
|
|
1149
|
-
}
|
|
1150
|
-
/**
|
|
1151
|
-
* Resolve a file or directory path into validated `RunRecord[]`.
|
|
1152
|
-
*
|
|
1153
|
-
* A `.json` file must parse to a top-level array; a `.jsonl` file is one
|
|
1154
|
-
* record per non-empty line. Directories are read shallowly by default
|
|
1155
|
-
* (set `recursive` to descend); the `analysis.json` output artifact is
|
|
1156
|
-
* always excluded.
|
|
1157
|
-
*/
|
|
1158
|
-
async function fromRunRecordDir(path, options = {}) {
|
|
1159
|
-
const onInvalid = options.onInvalid ?? "throw";
|
|
1160
|
-
const include = options.include ?? defaultInclude;
|
|
1161
|
-
const filePaths = (await stat(path)).isDirectory() ? await collectFiles(path, include, options.recursive ?? false) : [path];
|
|
1162
|
-
const runs = [];
|
|
1163
|
-
const rejected = [];
|
|
1164
|
-
for (const file of filePaths) {
|
|
1165
|
-
const raw = await parseRecordFile(file);
|
|
1166
|
-
for (const { index, value } of raw) {
|
|
1167
|
-
const parsed = parseRunRecordSafe(value);
|
|
1168
|
-
if (parsed.ok) {
|
|
1169
|
-
runs.push(parsed.value);
|
|
1170
|
-
continue;
|
|
1171
|
-
}
|
|
1172
|
-
const rejection = {
|
|
1173
|
-
file,
|
|
1174
|
-
index,
|
|
1175
|
-
reason: parsed.error.message
|
|
1176
|
-
};
|
|
1177
|
-
if (onInvalid === "throw") throw new Error(`fromRunRecordDir: invalid RunRecord in '${file}' at index ${index}: ${parsed.error.message}`);
|
|
1178
|
-
rejected.push(rejection);
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
return {
|
|
1182
|
-
runs,
|
|
1183
|
-
rejected,
|
|
1184
|
-
files: filePaths
|
|
1185
|
-
};
|
|
1186
|
-
}
|
|
1187
|
-
/** Read a single `.json` / `.jsonl` file into `{ index, value }` pairs. A
|
|
1188
|
-
* malformed JSONL line throws with its line number rather than being skipped —
|
|
1189
|
-
* silent line-dropping is how corpora quietly shrink. */
|
|
1190
|
-
async function parseRecordFile(file) {
|
|
1191
|
-
const trimmed = (await readFile(file, "utf8")).trim();
|
|
1192
|
-
if (trimmed.length === 0) return [];
|
|
1193
|
-
if (trimmed.startsWith("[")) {
|
|
1194
|
-
const parsed = JSON.parse(trimmed);
|
|
1195
|
-
if (!Array.isArray(parsed)) throw new Error(`fromRunRecordDir: file '${file}' did not parse to an array`);
|
|
1196
|
-
return parsed.map((value, index) => ({
|
|
1197
|
-
index,
|
|
1198
|
-
value
|
|
1199
|
-
}));
|
|
1200
|
-
}
|
|
1201
|
-
const out = [];
|
|
1202
|
-
const lines = trimmed.split("\n");
|
|
1203
|
-
for (let i = 0; i < lines.length; i++) {
|
|
1204
|
-
const line = lines[i].trim();
|
|
1205
|
-
if (line.length === 0) continue;
|
|
1206
|
-
try {
|
|
1207
|
-
out.push({
|
|
1208
|
-
index: i,
|
|
1209
|
-
value: JSON.parse(line)
|
|
1210
|
-
});
|
|
1211
|
-
} catch (err) {
|
|
1212
|
-
throw new Error(`fromRunRecordDir: file '${file}' line ${i + 1} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`);
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
return out;
|
|
1216
|
-
}
|
|
1217
|
-
/** Sorted file list under a directory, filtered by `include`. Sorted so the
|
|
1218
|
-
* resulting `RunRecord` order — and any downstream fingerprint — is stable
|
|
1219
|
-
* across filesystems. */
|
|
1220
|
-
async function collectFiles(dir, include, recursive) {
|
|
1221
|
-
const entries = await readdir(dir, { withFileTypes: true });
|
|
1222
|
-
const files = [];
|
|
1223
|
-
const subdirs = [];
|
|
1224
|
-
for (const entry of entries) {
|
|
1225
|
-
if (entry.isDirectory()) {
|
|
1226
|
-
if (recursive) subdirs.push(join(dir, entry.name));
|
|
1227
|
-
continue;
|
|
1228
|
-
}
|
|
1229
|
-
if (include(entry.name)) files.push(join(dir, entry.name));
|
|
1230
|
-
}
|
|
1231
|
-
files.sort();
|
|
1232
|
-
subdirs.sort();
|
|
1233
|
-
for (const sub of subdirs) files.push(...await collectFiles(sub, include, recursive));
|
|
1234
|
-
return files;
|
|
1235
|
-
}
|
|
1236
|
-
//#endregion
|
|
1237
|
-
//#region src/contract/eval-reporting-suite.ts
|
|
1238
|
-
/**
|
|
1239
|
-
* # `evalReportingSuite` — one call from runs (or a run dir) to `analysis.json`.
|
|
1240
|
-
*
|
|
1241
|
-
* A thin wrapper over the analysis primitive (`analyzeRuns`) and the on-disk
|
|
1242
|
-
* intake adapter (`fromRunRecordDir`). It does NOT reimplement any statistics,
|
|
1243
|
-
* distributions, or clustering — it resolves the input into validated
|
|
1244
|
-
* `RunRecord[]`, calls `analyzeRuns` with the options you'd pass it directly,
|
|
1245
|
-
* wraps the result in a small provenance envelope, and (optionally) writes a
|
|
1246
|
-
* single `analysis.json` artifact.
|
|
1247
|
-
*
|
|
1248
|
-
* ```ts
|
|
1249
|
-
* // From a directory of run files, write ./runs/analysis.json:
|
|
1250
|
-
* const suite = await evalReportingSuite('./runs', { write: true })
|
|
1251
|
-
* // From records already in memory, no write:
|
|
1252
|
-
* const suite = await evalReportingSuite(records, { analyze: { decisionThreshold: 0.03 } })
|
|
1253
|
-
* suite.report // the InsightReport — distributions, paired lift, findings rollup
|
|
1254
|
-
* ```
|
|
1255
|
-
*/
|
|
1256
|
-
const ANALYSIS_ARTIFACT = "analysis.json";
|
|
1257
|
-
/**
|
|
1258
|
-
* Resolve runs (or a run dir/file), run `analyzeRuns`, and optionally persist a
|
|
1259
|
-
* single `analysis.json`. The only analysis logic lives in `analyzeRuns`; this
|
|
1260
|
-
* function is composition + I/O.
|
|
1261
|
-
*/
|
|
1262
|
-
async function evalReportingSuite(input, options = {}) {
|
|
1263
|
-
const fromPath = typeof input === "string";
|
|
1264
|
-
let runs;
|
|
1265
|
-
let files = [];
|
|
1266
|
-
let rejected = [];
|
|
1267
|
-
if (fromPath) {
|
|
1268
|
-
const loaded = await fromRunRecordDir(input, options.load);
|
|
1269
|
-
runs = loaded.runs;
|
|
1270
|
-
files = loaded.files;
|
|
1271
|
-
rejected = loaded.rejected;
|
|
1272
|
-
} else runs = input;
|
|
1273
|
-
if (runs.length === 0) throw new Error(fromPath ? `evalReportingSuite: no RunRecords found at '${input}'` : "evalReportingSuite: no RunRecords to analyze");
|
|
1274
|
-
const result = {
|
|
1275
|
-
report: await analyzeRuns({
|
|
1276
|
-
...options.analyze,
|
|
1277
|
-
runs
|
|
1278
|
-
}),
|
|
1279
|
-
provenance: {
|
|
1280
|
-
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1281
|
-
runCount: runs.length,
|
|
1282
|
-
sourcePath: fromPath ? input : null,
|
|
1283
|
-
files,
|
|
1284
|
-
rejected
|
|
1285
|
-
},
|
|
1286
|
-
writtenTo: null
|
|
1287
|
-
};
|
|
1288
|
-
const target = resolveWriteTarget(options.write, fromPath ? input : null);
|
|
1289
|
-
if (target) {
|
|
1290
|
-
await mkdir(dirname(target), { recursive: true });
|
|
1291
|
-
await writeFile(target, `${JSON.stringify(result, null, 2)}\n`, "utf8");
|
|
1292
|
-
result.writtenTo = target;
|
|
1293
|
-
}
|
|
1294
|
-
return result;
|
|
1295
|
-
}
|
|
1296
|
-
/** Resolve where (if anywhere) to write `analysis.json`. Returns null when
|
|
1297
|
-
* writing is disabled. Throws on `write: true` with in-memory input — there is
|
|
1298
|
-
* no directory to anchor the artifact to, and silently inventing `cwd` would
|
|
1299
|
-
* scatter files. */
|
|
1300
|
-
function resolveWriteTarget(write, sourcePath) {
|
|
1301
|
-
if (!write) return null;
|
|
1302
|
-
if (typeof write === "string") return write.endsWith("/") || !write.endsWith(".json") && !write.endsWith(".jsonl") ? join(write, ANALYSIS_ARTIFACT) : write;
|
|
1303
|
-
if (sourcePath === null) throw new Error("evalReportingSuite: write:true needs a source path to anchor analysis.json — pass an explicit output path when analyzing in-memory records");
|
|
1304
|
-
return sourcePath.endsWith(".json") || sourcePath.endsWith(".jsonl") ? join(dirname(sourcePath), ANALYSIS_ARTIFACT) : join(sourcePath, ANALYSIS_ARTIFACT);
|
|
1305
|
-
}
|
|
1306
|
-
//#endregion
|
|
1307
1212
|
//#region src/contract/intake/agent-trace.ts
|
|
1308
1213
|
function rangeLines(r) {
|
|
1309
1214
|
return Math.max(0, r.end_line - r.start_line + 1);
|
|
@@ -1385,9 +1290,6 @@ function partitionRunsByAuthoringModel(runs, index) {
|
|
|
1385
1290
|
}
|
|
1386
1291
|
//#endregion
|
|
1387
1292
|
//#region src/contract/intake/code-agent-fields.ts
|
|
1388
|
-
function isRecord(value) {
|
|
1389
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1390
|
-
}
|
|
1391
1293
|
function record(value) {
|
|
1392
1294
|
return isRecord(value) ? value : null;
|
|
1393
1295
|
}
|
|
@@ -2200,7 +2102,8 @@ function emptyMetrics(entries) {
|
|
|
2200
2102
|
}
|
|
2201
2103
|
function penalizeErrors(base, metrics) {
|
|
2202
2104
|
const operations = Math.max(1, metrics.toolCalls + metrics.patchAttempts);
|
|
2203
|
-
|
|
2105
|
+
const errorRate = Math.min(1, (metrics.toolErrors + metrics.patchFailures) / operations);
|
|
2106
|
+
return clamp01(base * (1 - .5 * errorRate));
|
|
2204
2107
|
}
|
|
2205
2108
|
function emptyTokenTotals() {
|
|
2206
2109
|
return {
|
|
@@ -2291,10 +2194,6 @@ function resolveSessionCost(explicit, metrics, model) {
|
|
|
2291
2194
|
}
|
|
2292
2195
|
};
|
|
2293
2196
|
}
|
|
2294
|
-
function clamp01(value) {
|
|
2295
|
-
if (!Number.isFinite(value)) return 0;
|
|
2296
|
-
return Math.max(0, Math.min(1, value));
|
|
2297
|
-
}
|
|
2298
2197
|
//#endregion
|
|
2299
2198
|
//#region src/contract/intake/code-agent-codex-metrics.ts
|
|
2300
2199
|
function codexMetrics(entries) {
|
|
@@ -2740,10 +2639,6 @@ function fromKimiCodeSession(options) {
|
|
|
2740
2639
|
function fromPiSession(options) {
|
|
2741
2640
|
return fromCodeAgentSession("pi", options);
|
|
2742
2641
|
}
|
|
2743
|
-
/** The graph IR a Pi graph run exports (`nodes[].ir`), which is not a Pi session. */
|
|
2744
|
-
function fromPiGraphSession(options) {
|
|
2745
|
-
return fromCodeAgentSession("pi-graph", options);
|
|
2746
|
-
}
|
|
2747
2642
|
function fromCodeAgentSession(source, options) {
|
|
2748
2643
|
const entries = options.entries.filter(isRecord);
|
|
2749
2644
|
if (entries.length === 0) return {
|
|
@@ -2974,197 +2869,6 @@ function finiteScore(value) {
|
|
|
2974
2869
|
return value !== void 0 && Number.isFinite(value) ? clamp01(value) : void 0;
|
|
2975
2870
|
}
|
|
2976
2871
|
//#endregion
|
|
2977
|
-
//#region src/contract/intake/code-agent-store.ts
|
|
2978
|
-
const SESSION_SUFFIX = ".jsonl";
|
|
2979
|
-
const REJECTION_SAMPLE_LIMIT = 8;
|
|
2980
|
-
/**
|
|
2981
|
-
* Read every session this run captured under `scope.root` and project them.
|
|
2982
|
-
*
|
|
2983
|
-
* A store directory that does not exist, or that holds no session the scope attributes, returns
|
|
2984
|
-
* `status: 'unavailable'`. That is not an error: a run whose harness store was never synced back
|
|
2985
|
-
* has no evidence, and saying so is the correct answer.
|
|
2986
|
-
*/
|
|
2987
|
-
async function observeCodeAgentStore(scope) {
|
|
2988
|
-
if (!isAbsolute(scope.root)) throw new TypeError(`observeCodeAgentStore: scope.root must be an absolute path to this run's own store, received ${JSON.stringify(scope.root)}`);
|
|
2989
|
-
const workspaceRoot = scope.workspaceRoot === void 0 ? void 0 : resolve(scope.workspaceRoot);
|
|
2990
|
-
const paths = await listSessionFiles(resolve(scope.root));
|
|
2991
|
-
const sessions = [];
|
|
2992
|
-
const byReason = /* @__PURE__ */ new Map();
|
|
2993
|
-
const sample = [];
|
|
2994
|
-
const reject = (path, reason) => {
|
|
2995
|
-
byReason.set(reason, (byReason.get(reason) ?? 0) + 1);
|
|
2996
|
-
if (sample.length < REJECTION_SAMPLE_LIMIT) sample.push({
|
|
2997
|
-
path,
|
|
2998
|
-
reason
|
|
2999
|
-
});
|
|
3000
|
-
};
|
|
3001
|
-
for (const path of paths) {
|
|
3002
|
-
let entries;
|
|
3003
|
-
try {
|
|
3004
|
-
entries = (await parseCodeAgentJsonlFile(path)).entries;
|
|
3005
|
-
} catch {
|
|
3006
|
-
reject(path, "unreadable");
|
|
3007
|
-
continue;
|
|
3008
|
-
}
|
|
3009
|
-
if (entries.length === 0) {
|
|
3010
|
-
reject(path, "no-entries");
|
|
3011
|
-
continue;
|
|
3012
|
-
}
|
|
3013
|
-
const workspace = sessionWorkspace(entries);
|
|
3014
|
-
if (workspaceRoot !== void 0) {
|
|
3015
|
-
if (workspace === void 0) {
|
|
3016
|
-
reject(path, "no-workspace-recorded");
|
|
3017
|
-
continue;
|
|
3018
|
-
}
|
|
3019
|
-
if (!isSameOrBelow(workspaceRoot, workspace)) {
|
|
3020
|
-
reject(path, "outside-workspace");
|
|
3021
|
-
continue;
|
|
3022
|
-
}
|
|
3023
|
-
}
|
|
3024
|
-
const startedAtMs = sessionStartedAtMs(entries);
|
|
3025
|
-
if (scope.window !== void 0) {
|
|
3026
|
-
if (startedAtMs === void 0) {
|
|
3027
|
-
reject(path, "no-start-recorded");
|
|
3028
|
-
continue;
|
|
3029
|
-
}
|
|
3030
|
-
if (startedAtMs < scope.window.startedAtMs) {
|
|
3031
|
-
reject(path, "before-run");
|
|
3032
|
-
continue;
|
|
3033
|
-
}
|
|
3034
|
-
if (scope.window.finishedAtMs !== void 0 && startedAtMs > scope.window.finishedAtMs) {
|
|
3035
|
-
reject(path, "after-run");
|
|
3036
|
-
continue;
|
|
3037
|
-
}
|
|
3038
|
-
}
|
|
3039
|
-
const observation = observeCodeAgentSession({
|
|
3040
|
-
source: scope.source,
|
|
3041
|
-
entries,
|
|
3042
|
-
sourcePath: path
|
|
3043
|
-
});
|
|
3044
|
-
sessions.push({
|
|
3045
|
-
path,
|
|
3046
|
-
sessionId: observation.sessionId,
|
|
3047
|
-
...workspace === void 0 ? {} : { workspace },
|
|
3048
|
-
...startedAtMs === void 0 ? {} : { startedAtMs },
|
|
3049
|
-
observation
|
|
3050
|
-
});
|
|
3051
|
-
}
|
|
3052
|
-
const rejections = {
|
|
3053
|
-
total: [...byReason.values()].reduce((sum, count) => sum + count, 0),
|
|
3054
|
-
byReason: Object.fromEntries(byReason),
|
|
3055
|
-
sample
|
|
3056
|
-
};
|
|
3057
|
-
if (sessions.length === 0) return {
|
|
3058
|
-
status: "unavailable",
|
|
3059
|
-
scope,
|
|
3060
|
-
filesScanned: paths.length,
|
|
3061
|
-
reason: unavailableReason(paths.length, rejections),
|
|
3062
|
-
rejections
|
|
3063
|
-
};
|
|
3064
|
-
const bySurface = /* @__PURE__ */ new Map();
|
|
3065
|
-
let actions = 0;
|
|
3066
|
-
let subagentActions = 0;
|
|
3067
|
-
let sessionsWithSubagentActions = 0;
|
|
3068
|
-
for (const session of sessions) {
|
|
3069
|
-
let sessionSubagents = 0;
|
|
3070
|
-
for (const action of session.observation.actions) {
|
|
3071
|
-
actions += 1;
|
|
3072
|
-
bySurface.set(action.surface, (bySurface.get(action.surface) ?? 0) + 1);
|
|
3073
|
-
if (action.surface === "subagent") sessionSubagents += 1;
|
|
3074
|
-
}
|
|
3075
|
-
subagentActions += sessionSubagents;
|
|
3076
|
-
if (sessionSubagents > 0) sessionsWithSubagentActions += 1;
|
|
3077
|
-
}
|
|
3078
|
-
return {
|
|
3079
|
-
status: "observed",
|
|
3080
|
-
scope,
|
|
3081
|
-
filesScanned: paths.length,
|
|
3082
|
-
sessions,
|
|
3083
|
-
actions,
|
|
3084
|
-
subagentActions,
|
|
3085
|
-
sessionsWithSubagentActions,
|
|
3086
|
-
bySurface: Object.fromEntries(bySurface),
|
|
3087
|
-
rejections
|
|
3088
|
-
};
|
|
3089
|
-
}
|
|
3090
|
-
function unavailableReason(filesScanned, rejections) {
|
|
3091
|
-
if (filesScanned === 0) return "the run captured no session files in this store";
|
|
3092
|
-
return `no session in this store belongs to the run: ${filesScanned} file(s) scanned, all rejected (${Object.entries(rejections.byReason).map(([reason, count]) => `${count} ${reason}`).sort().join(", ")})`;
|
|
3093
|
-
}
|
|
3094
|
-
async function listSessionFiles(root) {
|
|
3095
|
-
const found = [];
|
|
3096
|
-
const walk = async (dir) => {
|
|
3097
|
-
let entries;
|
|
3098
|
-
try {
|
|
3099
|
-
entries = await readdir(dir, { withFileTypes: true });
|
|
3100
|
-
} catch {
|
|
3101
|
-
return;
|
|
3102
|
-
}
|
|
3103
|
-
for (const entry of entries) {
|
|
3104
|
-
const path = join(dir, entry.name);
|
|
3105
|
-
if (entry.isDirectory()) await walk(path);
|
|
3106
|
-
else if (entry.isFile() && entry.name.endsWith(SESSION_SUFFIX)) found.push(path);
|
|
3107
|
-
}
|
|
3108
|
-
};
|
|
3109
|
-
await walk(root);
|
|
3110
|
-
if (found.length === 0 && await isSessionFile(root)) found.push(root);
|
|
3111
|
-
return found.sort();
|
|
3112
|
-
}
|
|
3113
|
-
async function isSessionFile(path) {
|
|
3114
|
-
if (!path.endsWith(SESSION_SUFFIX)) return false;
|
|
3115
|
-
try {
|
|
3116
|
-
return (await stat(path)).isFile();
|
|
3117
|
-
} catch {
|
|
3118
|
-
return false;
|
|
3119
|
-
}
|
|
3120
|
-
}
|
|
3121
|
-
/**
|
|
3122
|
-
* The working directory the session RECORDED, from the first entry that states one.
|
|
3123
|
-
*
|
|
3124
|
-
* codex writes it on `session_meta.payload.cwd`; claude-code writes `cwd` on every line. Neither is
|
|
3125
|
-
* inferred from the file's own location: where a captured file was copied to says nothing about
|
|
3126
|
-
* where the agent ran.
|
|
3127
|
-
*/
|
|
3128
|
-
function sessionWorkspace(entries) {
|
|
3129
|
-
for (const entry of entries) {
|
|
3130
|
-
const record = plainRecord(entry);
|
|
3131
|
-
if (record === void 0) continue;
|
|
3132
|
-
const direct = stringOf(record.cwd);
|
|
3133
|
-
if (direct !== void 0) return direct;
|
|
3134
|
-
const nested = stringOf(plainRecord(record.payload)?.cwd);
|
|
3135
|
-
if (nested !== void 0) return nested;
|
|
3136
|
-
}
|
|
3137
|
-
}
|
|
3138
|
-
/** When the session itself says it started, from the first entry carrying a parseable timestamp. */
|
|
3139
|
-
function sessionStartedAtMs(entries) {
|
|
3140
|
-
for (const entry of entries) {
|
|
3141
|
-
const record = plainRecord(entry);
|
|
3142
|
-
if (record === void 0) continue;
|
|
3143
|
-
const payload = plainRecord(record.payload);
|
|
3144
|
-
for (const candidate of [payload?.timestamp, record.timestamp]) {
|
|
3145
|
-
const text = stringOf(candidate);
|
|
3146
|
-
if (text === void 0) continue;
|
|
3147
|
-
const parsed = Date.parse(text);
|
|
3148
|
-
if (Number.isFinite(parsed)) return parsed;
|
|
3149
|
-
}
|
|
3150
|
-
const epochMs = numberOf(record.timestampMs) ?? numberOf(payload?.timestampMs);
|
|
3151
|
-
if (epochMs !== void 0) return epochMs;
|
|
3152
|
-
}
|
|
3153
|
-
}
|
|
3154
|
-
function isSameOrBelow(root, candidate) {
|
|
3155
|
-
const rel = relative(root, resolve(candidate));
|
|
3156
|
-
return rel === "" || rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
|
|
3157
|
-
}
|
|
3158
|
-
function plainRecord(value) {
|
|
3159
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
3160
|
-
}
|
|
3161
|
-
function stringOf(value) {
|
|
3162
|
-
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
3163
|
-
}
|
|
3164
|
-
function numberOf(value) {
|
|
3165
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
3166
|
-
}
|
|
3167
|
-
//#endregion
|
|
3168
2872
|
//#region src/contract/intake/feedback-table.ts
|
|
3169
2873
|
function fromFeedbackTable(opts) {
|
|
3170
2874
|
const { ratings, meta = [], scale, emitRaterScores = true } = opts;
|
|
@@ -3244,6 +2948,6 @@ function fromFeedbackTable(opts) {
|
|
|
3244
2948
|
};
|
|
3245
2949
|
}
|
|
3246
2950
|
//#endregion
|
|
3247
|
-
export { FileSystemOutcomeStore, InMemoryOutcomeStore,
|
|
2951
|
+
export { FileSystemOutcomeStore, InMemoryOutcomeStore, SelfImproveRunError, analyzeRuns, buildDefaultAnalystRegistry, buildEvidenceVector, campaignSplitDigest, compareOptimizationMethods, composeGate, createChatClient, defaultProductionGate, defineAgentEval, evaluatePairedMeasurements, externalTextOptimizationMethod, fromClaudeCodeSession, fromCodexSession, fromFeedbackTable, fromKimiCodeSession, fromOpenCodeSession, fromOtelSpans, fromPiSession, fsCampaignStorage, gepaOptimizationMethod, heldOutGate, inMemoryCampaignStorage, llmJudge, makeProposalFinding, measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, observeCodeAgentSession, paretoPolicy, paretoSignificanceGate, parseAgentTrace, parseCodeAgentJsonl, parseCodeAgentJsonlFile, partitionRunsByAuthoringModel, runAgentProfileImprovementExperiment, runCampaign, runCandidateExperiment, runEval, runImprovementLoop, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateBenchmarkSuite, sealCandidateBenchmarkTask, sealCandidateExperiment, selfImprove, skillOptOptimizationMethod, streamCodeAgentJsonlFile, summarizeExecution, transientDispatchFailure, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison };
|
|
3248
2952
|
|
|
3249
2953
|
//# sourceMappingURL=index.js.map
|