@tangle-network/agent-eval 0.144.11 → 0.144.13
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 +11 -0
- package/dist/agent-profile-B9_GGsG8.d.ts +84 -0
- package/dist/agent-profile-B9_GGsG8.d.ts.map +1 -0
- package/dist/{agent-profile-cell-BOP-iA9Q.d.ts → agent-profile-cell-BkcRDikH.d.ts} +2 -2
- package/dist/{agent-profile-cell-BOP-iA9Q.d.ts.map → agent-profile-cell-BkcRDikH.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +134 -16
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +364 -10
- package/dist/analyst/index.js.map +1 -1
- package/dist/backend-integrity-CsVin_Wb.d.ts +280 -0
- package/dist/backend-integrity-CsVin_Wb.d.ts.map +1 -0
- package/dist/{baseline-C-GocmIW.js → baseline-BhPRQBVn.js} +3 -2
- package/dist/{baseline-C-GocmIW.js.map → baseline-BhPRQBVn.js.map} +1 -1
- package/dist/{benchmark-CWeqGl7x.js → benchmark-BhT16ep9.js} +2 -2
- package/dist/{benchmark-CWeqGl7x.js.map → benchmark-BhT16ep9.js.map} +1 -1
- package/dist/{agent-profile-DPi7IZg7.d.ts → benchmark-Ceoan7vk.d.ts} +4 -91
- package/dist/benchmark-Ceoan7vk.d.ts.map +1 -0
- package/dist/{benchmark-command-BteMFN62.js → benchmark-command-CY6cbhOB.js} +36 -79
- package/dist/benchmark-command-CY6cbhOB.js.map +1 -0
- package/dist/benchmarks/index.d.ts +244 -2
- package/dist/benchmarks/index.d.ts.map +1 -0
- package/dist/benchmarks/index.js +733 -1
- package/dist/benchmarks/index.js.map +1 -0
- package/dist/builder-eval/index.d.ts +23 -2
- package/dist/builder-eval/index.d.ts.map +1 -1
- package/dist/builder-eval/index.js +227 -3
- package/dist/builder-eval/index.js.map +1 -1
- package/dist/campaign/index.d.ts +10 -8
- package/dist/campaign/index.js +9 -6
- package/dist/{campaign-C2TTzQII.js → campaign-BYjBAypg.js} +21 -634
- package/dist/campaign-BYjBAypg.js.map +1 -0
- package/dist/{canonical-D011XM8r.js → canonical-D-XsTQ6_.js} +2 -2
- package/dist/{canonical-D011XM8r.js.map → canonical-D-XsTQ6_.js.map} +1 -1
- package/dist/{index-CQTZ-4XN.d.ts → capture-fetch-DDvpjVRU.d.ts} +3 -3
- package/dist/capture-fetch-DDvpjVRU.d.ts.map +1 -0
- package/dist/{default-registry-BmktKy8r.js → chat-client-Bp4Ebuuc.js} +1276 -1276
- package/dist/chat-client-Bp4Ebuuc.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{client-C9gzZE59.d.ts → client-KUbGulm_.d.ts} +4 -4
- package/dist/{client-C9gzZE59.d.ts.map → client-KUbGulm_.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +13 -390
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +18 -542
- package/dist/contract/index.js.map +1 -1
- package/dist/{cost-ledger-DMFxsLKr.js → cost-ledger-BSe92yAV.js} +3 -3
- package/dist/{cost-ledger-DMFxsLKr.js.map → cost-ledger-BSe92yAV.js.map} +1 -1
- package/dist/{cost-ledger-Bv_e8XHY.d.ts → cost-ledger-DbQdN3nO.d.ts} +2 -2
- package/dist/{cost-ledger-Bv_e8XHY.d.ts.map → cost-ledger-DbQdN3nO.d.ts.map} +1 -1
- package/dist/{counterfactual-CxmxAONP.d.ts → counterfactual--bpysZF0.d.ts} +2 -14
- package/dist/{counterfactual-CxmxAONP.d.ts.map → counterfactual--bpysZF0.d.ts.map} +1 -1
- package/dist/{counterfactual-CWPTrMH7.js → counterfactual-lDfCx0Uz.js} +3 -31
- package/dist/{counterfactual-CWPTrMH7.js.map → counterfactual-lDfCx0Uz.js.map} +1 -1
- package/dist/{dataset-C8xaLXdY.d.ts → dataset-CJjKqQfA.d.ts} +2 -8
- package/dist/dataset-CJjKqQfA.d.ts.map +1 -0
- package/dist/{default-registry-Bf8Woqmq.d.ts → default-registry-Di6HP6pG.d.ts} +7 -12
- package/dist/default-registry-Di6HP6pG.d.ts.map +1 -0
- package/dist/{analyze-runs-C30yljDJ.js → define-agent-eval-iqjT--ZZ.js} +542 -130
- package/dist/define-agent-eval-iqjT--ZZ.js.map +1 -0
- package/dist/define-agent-eval-sH24zBfM.d.ts +388 -0
- package/dist/define-agent-eval-sH24zBfM.d.ts.map +1 -0
- package/dist/descriptive-B5MwKfbf.js +144 -0
- package/dist/descriptive-B5MwKfbf.js.map +1 -0
- package/dist/{dspy-rlm-engine-DbTk4JdR.js → dspy-rlm-engine-B_qhSc21.js} +4 -4
- package/dist/{dspy-rlm-engine-DbTk4JdR.js.map → dspy-rlm-engine-B_qhSc21.js.map} +1 -1
- package/dist/effect-sizes-DiH8MGOH.js +82 -0
- package/dist/effect-sizes-DiH8MGOH.js.map +1 -0
- package/dist/{engine-3hL-XqwJ.d.ts → engine-otFpE2gF.d.ts} +10 -38
- package/dist/engine-otFpE2gF.d.ts.map +1 -0
- package/dist/{errors-CKPfb2aH.d.ts → errors-DEE6u6ot.d.ts} +2 -14
- package/dist/{errors-CKPfb2aH.d.ts.map → errors-DEE6u6ot.d.ts.map} +1 -1
- package/dist/{errors-D-LKuDhb.js → errors-Dngq5h35.js} +2 -8
- package/dist/{errors-D-LKuDhb.js.map → errors-Dngq5h35.js.map} +1 -1
- package/dist/{eval-campaign-B_7wcnav.js → eval-campaign-UB-usSQ2.js} +6 -6
- package/dist/{eval-campaign-B_7wcnav.js.map → eval-campaign-UB-usSQ2.js.map} +1 -1
- package/dist/{exact-types-DSFFpLLI.d.ts → exact-types-BH1twmAJ.d.ts} +2 -2
- package/dist/{exact-types-DSFFpLLI.d.ts.map → exact-types-BH1twmAJ.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +9 -6
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +11 -7
- package/dist/experiment/index.js.map +1 -1
- package/dist/experiment-tracker-C29gXM4B.js +269 -0
- package/dist/experiment-tracker-C29gXM4B.js.map +1 -0
- package/dist/{experiment-tracker-IMntXr6J.d.ts → experiment-tracker-DWHZBAYL.d.ts} +77 -121
- package/dist/experiment-tracker-DWHZBAYL.d.ts.map +1 -0
- package/dist/{external-optimizer-contracts-CZuJNcT5.d.ts → external-optimizer-contracts-lixrOZdX.d.ts} +3 -3
- package/dist/{external-optimizer-contracts-CZuJNcT5.d.ts.map → external-optimizer-contracts-lixrOZdX.d.ts.map} +1 -1
- package/dist/external-optimizer-process-BTiNB-RH.js +301 -0
- package/dist/external-optimizer-process-BTiNB-RH.js.map +1 -0
- package/dist/{single-run-lock-DFWHEB09.js → external-optimizer-subprocess-DrJ9hR8u.js} +144 -438
- package/dist/external-optimizer-subprocess-DrJ9hR8u.js.map +1 -0
- package/dist/extract-usage-BrQ8mCLX.js +155 -0
- package/dist/extract-usage-BrQ8mCLX.js.map +1 -0
- package/dist/{failure-cluster-CqcvCcdR.d.ts → failure-cluster-BLURuWG4.d.ts} +2 -3
- package/dist/failure-cluster-BLURuWG4.d.ts.map +1 -0
- package/dist/{feedback-trajectory-CacHpxsp.d.ts → feedback-trajectory-juOozjAc.d.ts} +5 -36
- package/dist/feedback-trajectory-juOozjAc.d.ts.map +1 -0
- package/dist/fuzz.d.ts +2 -2
- package/dist/fuzz.js +2 -2
- package/dist/hosted/index.d.ts +3 -3
- package/dist/{index-CvSN3IG1.d.ts → index-B8Ui1mr1.d.ts} +2 -2
- package/dist/{index-CvSN3IG1.d.ts.map → index-B8Ui1mr1.d.ts.map} +1 -1
- package/dist/{skill-usage-CO9OLRBx.d.ts → index-BWDrSVfw.d.ts} +11 -136
- package/dist/index-BWDrSVfw.d.ts.map +1 -0
- package/dist/index-Ba3YrbAL.d.ts +1 -0
- package/dist/{index-BnEuDAK2.d.ts → index-COQYtuRF.d.ts} +3 -3
- package/dist/{index-BnEuDAK2.d.ts.map → index-COQYtuRF.d.ts.map} +1 -1
- package/dist/{index-C3ssXVLv.d.ts → index-CvjYbU0D.d.ts} +2 -2
- package/dist/{index-C3ssXVLv.d.ts.map → index-CvjYbU0D.d.ts.map} +1 -1
- package/dist/{index-DPPGNJ_R.d.ts → index-DSmEylT9.d.ts} +17 -115
- package/dist/index-DSmEylT9.d.ts.map +1 -0
- package/dist/index.d.ts +2397 -5308
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5914 -10496
- package/dist/index.js.map +1 -1
- package/dist/{insight-report-CgX_s0Ez.d.ts → insight-report-CRi-Ufrj.d.ts} +4 -4
- package/dist/{insight-report-CgX_s0Ez.d.ts.map → insight-report-CRi-Ufrj.d.ts.map} +1 -1
- package/dist/{integrity-MLzHOfV9.js → integrity-Cy9WHAtb.js} +2 -2
- package/dist/{integrity-MLzHOfV9.js.map → integrity-Cy9WHAtb.js.map} +1 -1
- package/dist/{integrity-DY6tIbl0.js → integrity-DysDBWDu.js} +2 -2
- package/dist/{integrity-DY6tIbl0.js.map → integrity-DysDBWDu.js.map} +1 -1
- package/dist/{integrity-BuqEKu-x.d.ts → integrity-OrcI9Nau.d.ts} +3 -3
- package/dist/{integrity-BuqEKu-x.d.ts.map → integrity-OrcI9Nau.d.ts.map} +1 -1
- package/dist/internal-BDHPCnjk.js +230 -0
- package/dist/internal-BDHPCnjk.js.map +1 -0
- package/dist/judge-calibration-C5CbMYce.d.ts +117 -0
- package/dist/judge-calibration-C5CbMYce.d.ts.map +1 -0
- package/dist/judge-calibration-DZkWrm5H.js +317 -0
- package/dist/judge-calibration-DZkWrm5H.js.map +1 -0
- package/dist/{kind-factory-B8-r8-y8.js → kind-factory-CPmSd58s.js} +208 -208
- package/dist/{kind-factory-B8-r8-y8.js.map → kind-factory-CPmSd58s.js.map} +1 -1
- package/dist/ledger-core/index.d.ts +1 -1
- package/dist/ledger-core/index.js +2 -2
- package/dist/{ledger-core-DXZIqu17.js → ledger-core-BmZt19oQ.js} +110 -110
- package/dist/{ledger-core-DXZIqu17.js.map → ledger-core-BmZt19oQ.js.map} +1 -1
- package/dist/{llm-client-DzvMUsS_.js → llm-client-d0-2TT1g.js} +4 -64
- package/dist/{llm-client-DzvMUsS_.js.map → llm-client-d0-2TT1g.js.map} +1 -1
- package/dist/{skillopt-optimization-method-CQdVeM8k.js → llm-judge-dZ8P6nGI.js} +3349 -5401
- package/dist/llm-judge-dZ8P6nGI.js.map +1 -0
- package/dist/matrix/index.d.ts +2 -2
- package/dist/meta-eval/index.d.ts +3 -3
- package/dist/meta-eval/index.js +3 -3
- package/dist/{metrics-C9YY1OcL.js → metrics-Cl0L1KUy.js} +2 -108
- package/dist/{metrics-C9YY1OcL.js.map → metrics-Cl0L1KUy.js.map} +1 -1
- package/dist/{mint-B2O60ACG.js → mint-Dj9Ww_3I.js} +4 -4
- package/dist/{mint-B2O60ACG.js.map → mint-Dj9Ww_3I.js.map} +1 -1
- package/dist/{multi-layer-verifier-DnAqwl0h.d.ts → multi-layer-verifier-DIguZc8Z.d.ts} +3 -3
- package/dist/{multi-layer-verifier-DnAqwl0h.d.ts.map → multi-layer-verifier-DIguZc8Z.d.ts.map} +1 -1
- package/dist/multiplicity-DIWHvysC.d.ts +43 -0
- package/dist/multiplicity-DIWHvysC.d.ts.map +1 -0
- package/dist/multishot/index.d.ts +3 -3
- package/dist/multishot/index.js +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{opencode-sqlite-8r6WUfHc.js → opencode-sqlite-DJWAXLms.js} +2 -2
- package/dist/{opencode-sqlite-8r6WUfHc.js.map → opencode-sqlite-DJWAXLms.js.map} +1 -1
- package/dist/package-version-D7lQHt_-.js +34 -0
- package/dist/package-version-D7lQHt_-.js.map +1 -0
- package/dist/paired-arms-D-XRF_fy.js +1045 -0
- package/dist/paired-arms-D-XRF_fy.js.map +1 -0
- package/dist/paired-promotion-decision-CGzg0cI_.d.ts +251 -0
- package/dist/paired-promotion-decision-CGzg0cI_.d.ts.map +1 -0
- package/dist/paired-tests-BHIhYVdu.js +213 -0
- package/dist/paired-tests-BHIhYVdu.js.map +1 -0
- package/dist/pareto-BqNW3LJR.d.ts +117 -0
- package/dist/pareto-BqNW3LJR.d.ts.map +1 -0
- package/dist/pipelines/index.d.ts +3 -64
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js +4 -284
- package/dist/pipelines/index.js.map +1 -1
- package/dist/power-and-mde-CHIrXJll.js +195 -0
- package/dist/power-and-mde-CHIrXJll.js.map +1 -0
- package/dist/{promotion-policy-CrLrmys8.js → power-preflight-DEw-uC7q.js} +4 -184
- package/dist/power-preflight-DEw-uC7q.js.map +1 -0
- package/dist/pre-registration-CZwSFQS4.d.ts +577 -0
- package/dist/pre-registration-CZwSFQS4.d.ts.map +1 -0
- package/dist/{prime-protocol-BfSalTfR.js → prime-protocol-6tZTVsWm.js} +72 -21
- package/dist/prime-protocol-6tZTVsWm.js.map +1 -0
- package/dist/produced-state-DU79a81m.js +586 -0
- package/dist/produced-state-DU79a81m.js.map +1 -0
- package/dist/profile-cell.d.ts +1 -1
- package/dist/profile-cell.js +1 -1
- package/dist/promotion-policy-D0nPhkSy.d.ts +134 -0
- package/dist/promotion-policy-D0nPhkSy.d.ts.map +1 -0
- package/dist/promotion-policy-xzA40Evo.js +186 -0
- package/dist/promotion-policy-xzA40Evo.js.map +1 -0
- package/dist/{skillopt-optimization-method-USDKhxSA.d.ts → provenance-CCdxgLDT.d.ts} +57 -478
- package/dist/provenance-CCdxgLDT.d.ts.map +1 -0
- package/dist/registry-oJeeI4-a.d.ts +178 -0
- package/dist/registry-oJeeI4-a.d.ts.map +1 -0
- package/dist/{release-report-DA2BCu5a.d.ts → release-confidence-BFRE5WSp.d.ts} +180 -112
- package/dist/release-confidence-BFRE5WSp.d.ts.map +1 -0
- package/dist/{release-report-BUYmoKo2.js → release-confidence-CxDuiAev.js} +125 -217
- package/dist/release-confidence-CxDuiAev.js.map +1 -0
- package/dist/reporting.d.ts +6 -5
- package/dist/reporting.js +7 -5
- package/dist/{researcher-BchpD55R.d.ts → researcher-DaN4GST-.d.ts} +7 -40
- package/dist/{researcher-BchpD55R.d.ts.map → researcher-DaN4GST-.d.ts.map} +1 -1
- package/dist/{reward-hacking-BDToousL.js → reward-hacking-DNgjilrV.js} +3 -3
- package/dist/reward-hacking-DNgjilrV.js.map +1 -0
- package/dist/{reward-hacking-BI0OMAlo.d.ts → reward-hacking-DSSTuI9r.d.ts} +5 -5
- package/dist/{reward-hacking-BI0OMAlo.d.ts.map → reward-hacking-DSSTuI9r.d.ts.map} +1 -1
- package/dist/rl.d.ts +7 -7
- package/dist/rl.js +11 -10
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +2 -2
- package/dist/rollout/index.js +4 -4
- package/dist/{rollout-DRrksrcV.js → rollout-BWtw0I_6.js} +3 -3
- package/dist/{rollout-DRrksrcV.js.map → rollout-BWtw0I_6.js.map} +1 -1
- package/dist/{rubric-predictive-validity-DvkjPYCe.d.ts → rubric-predictive-validity-BgxtKe4G.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-DvkjPYCe.d.ts.map → rubric-predictive-validity-BgxtKe4G.d.ts.map} +1 -1
- package/dist/{rubric-predictive-validity-BRR632r1.js → rubric-predictive-validity-Cwwyd7ah.js} +2 -2
- package/dist/{rubric-predictive-validity-BRR632r1.js.map → rubric-predictive-validity-Cwwyd7ah.js.map} +1 -1
- package/dist/{run-record-BmSPWXJR.js → run-record-BvHPVS-i.js} +3 -3
- package/dist/{run-record-BmSPWXJR.js.map → run-record-BvHPVS-i.js.map} +1 -1
- package/dist/{run-record-CF4Dwpxr.d.ts → run-record-CKiihE6f.d.ts} +4 -4
- package/dist/{run-record-CF4Dwpxr.d.ts.map → run-record-CKiihE6f.d.ts.map} +1 -1
- package/dist/{proposal-findings-2GIUo1et.js → run-score-lDzV0X8j.js} +31 -31
- package/dist/run-score-lDzV0X8j.js.map +1 -0
- package/dist/sandbox-harness-BlSOu4LX.d.ts +70 -0
- package/dist/sandbox-harness-BlSOu4LX.d.ts.map +1 -0
- package/dist/{schema-Cef2cFmb2.d.ts → schema-Cef2cFmb.d.ts} +1 -1
- package/dist/schema-Cef2cFmb.d.ts.map +1 -0
- package/dist/semantic-concept-judge-BiJxScqe.js +406 -0
- package/dist/semantic-concept-judge-BiJxScqe.js.map +1 -0
- package/dist/{sequential-D-BLJBKU.js → sequential-C458DXNf.js} +4 -3
- package/dist/{sequential-D-BLJBKU.js.map → sequential-C458DXNf.js.map} +1 -1
- package/dist/sequential-eprocess-CbUt2htw.js +83 -0
- package/dist/sequential-eprocess-CbUt2htw.js.map +1 -0
- package/dist/series-convergence-D1cL1f-4.d.ts +129 -0
- package/dist/series-convergence-D1cL1f-4.d.ts.map +1 -0
- package/dist/{server-iu0ede49.js → server-ulsOdrTI.js} +5 -21
- package/dist/server-ulsOdrTI.js.map +1 -0
- package/dist/skillopt-optimization-method-C5cotF4E.d.ts +427 -0
- package/dist/skillopt-optimization-method-C5cotF4E.d.ts.map +1 -0
- package/dist/skillopt-optimization-method-jjdnc3YK.js +1999 -0
- package/dist/skillopt-optimization-method-jjdnc3YK.js.map +1 -0
- package/dist/{statistical-heldout-TQ-4CYiN.d.ts → statistical-heldout-DoFF5KJX.d.ts} +5 -278
- package/dist/statistical-heldout-DoFF5KJX.d.ts.map +1 -0
- package/dist/{store-otlp-Dw8PPIlL.js → store-otlp-CsptLYpN.js} +3 -3
- package/dist/{store-otlp-Dw8PPIlL.js.map → store-otlp-CsptLYpN.js.map} +1 -1
- package/dist/store-tool-spans-Cq9mFd-q.js +667 -0
- package/dist/store-tool-spans-Cq9mFd-q.js.map +1 -0
- package/dist/store-tool-spans-DbDLOBOb.d.ts +342 -0
- package/dist/store-tool-spans-DbDLOBOb.d.ts.map +1 -0
- package/dist/student-t-CvBq2mve.js +38 -0
- package/dist/student-t-CvBq2mve.js.map +1 -0
- package/dist/{summary-report-Lf-5I7xh.js → summary-report-Blysd6Z2.js} +6 -3
- package/dist/{summary-report-Lf-5I7xh.js.map → summary-report-Blysd6Z2.js.map} +1 -1
- package/dist/{summary-report-BNR7DWTj.d.ts → summary-report-CaL-Hnxt.d.ts} +5 -5
- package/dist/{summary-report-BNR7DWTj.d.ts.map → summary-report-CaL-Hnxt.d.ts.map} +1 -1
- package/dist/supervisor-run/index.d.ts +391 -3
- package/dist/supervisor-run/index.d.ts.map +1 -0
- package/dist/supervisor-run/index.js +1689 -2
- package/dist/{supervisor-run-D_sokXcO.js.map → supervisor-run/index.js.map} +1 -1
- package/dist/{extract-usage-CdZdoj1s.js → task-failure-attributes-CpQ4y5RD.js} +5 -157
- package/dist/task-failure-attributes-CpQ4y5RD.js.map +1 -0
- package/dist/{tool-groups-CZPGGlHf.d.ts → tool-groups-Cteb03Ps.d.ts} +3 -3
- package/dist/tool-groups-Cteb03Ps.d.ts.map +1 -0
- package/dist/tool-waste-BDdBZG1F.js +803 -0
- package/dist/tool-waste-BDdBZG1F.js.map +1 -0
- package/dist/tool-waste-DjRDEsuI.d.ts +128 -0
- package/dist/tool-waste-DjRDEsuI.d.ts.map +1 -0
- package/dist/trace-repair/index.d.ts +14 -5
- package/dist/trace-repair/index.d.ts.map +1 -1
- package/dist/trace-repair/index.js +35 -7
- package/dist/trace-repair/index.js.map +1 -1
- package/dist/traces.d.ts +406 -7
- package/dist/traces.d.ts.map +1 -0
- package/dist/traces.js +1011 -10
- package/dist/traces.js.map +1 -0
- package/dist/trajectory-replay/index.d.ts +16 -3
- package/dist/trajectory-replay/index.d.ts.map +1 -1
- package/dist/trajectory-replay/index.js +52 -5
- package/dist/trajectory-replay/index.js.map +1 -1
- package/dist/types-BEPZc6eo.d.ts +93 -0
- package/dist/types-BEPZc6eo.d.ts.map +1 -0
- package/dist/{usage-receipt-t7vAzCRQ.js → types-BI4fT3HN.js} +67 -67
- package/dist/types-BI4fT3HN.js.map +1 -0
- package/dist/{types-BnjdJ70P.d.ts → types-BZ59Ahr8.d.ts} +5 -5
- package/dist/{types-BnjdJ70P.d.ts.map → types-BZ59Ahr8.d.ts.map} +1 -1
- package/dist/{types-D216SgwM.d.ts → types-Cx3YUh2r.d.ts} +4 -241
- package/dist/types-Cx3YUh2r.d.ts.map +1 -0
- package/dist/{types-BvDKaULh.d.ts → types-DLQx4mKU.d.ts} +4 -4
- package/dist/{types-BvDKaULh.d.ts.map → types-DLQx4mKU.d.ts.map} +1 -1
- package/dist/{types-D4mog56g.d.ts → types-yLK8gXE9.d.ts} +2 -2
- package/dist/{types-D4mog56g.d.ts.map → types-yLK8gXE9.d.ts.map} +1 -1
- package/dist/verdict-BndeTAh_.js +61 -0
- package/dist/verdict-BndeTAh_.js.map +1 -0
- package/dist/verdict-E4eRNf7-.d.ts +392 -0
- package/dist/verdict-E4eRNf7-.d.ts.map +1 -0
- package/dist/{verdict-cache-BCcOh0kF.js → verdict-cache-mZf5FEiY.js} +3 -55
- package/dist/{verdict-cache-BCcOh0kF.js.map → verdict-cache-mZf5FEiY.js.map} +1 -1
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +1 -1
- package/docs/charter.md +3 -3
- package/docs/control-runtime.md +3 -42
- package/docs/experiment.md +0 -1
- package/docs/feature-guide.md +2 -2
- package/docs/trace-repair-grader.md +1 -0
- package/docs/trajectory-replay.md +1 -0
- package/docs/verdicts.md +43 -0
- package/docs/verification-strategies.md +3 -2
- package/package.json +6 -11
- package/dist/agent-profile-DPi7IZg7.d.ts.map +0 -1
- package/dist/analyze-runs-C30yljDJ.js.map +0 -1
- package/dist/baseline-CavEbRyH.d.ts +0 -136
- package/dist/baseline-CavEbRyH.d.ts.map +0 -1
- package/dist/benchmark-command-BteMFN62.js.map +0 -1
- package/dist/benchmarks-Dzs8CKb1.js +0 -755
- package/dist/benchmarks-Dzs8CKb1.js.map +0 -1
- package/dist/campaign-C2TTzQII.js.map +0 -1
- package/dist/completion-verifier-DJA5BhPb.d.ts +0 -414
- package/dist/completion-verifier-DJA5BhPb.d.ts.map +0 -1
- package/dist/control.d.ts +0 -3
- package/dist/control.js +0 -2
- package/dist/dataset-C8xaLXdY.d.ts.map +0 -1
- package/dist/default-registry-Bf8Woqmq.d.ts.map +0 -1
- package/dist/default-registry-BmktKy8r.js.map +0 -1
- package/dist/engine-3hL-XqwJ.d.ts.map +0 -1
- package/dist/experiment-tracker-CnRICnMl.js +0 -500
- package/dist/experiment-tracker-CnRICnMl.js.map +0 -1
- package/dist/experiment-tracker-IMntXr6J.d.ts.map +0 -1
- package/dist/extract-usage-CdZdoj1s.js.map +0 -1
- package/dist/failure-cluster-CqcvCcdR.d.ts.map +0 -1
- package/dist/feedback-trajectory-CacHpxsp.d.ts.map +0 -1
- package/dist/index-BZ3-y4YL.d.ts +0 -391
- package/dist/index-BZ3-y4YL.d.ts.map +0 -1
- package/dist/index-CQTZ-4XN.d.ts.map +0 -1
- package/dist/index-DPPGNJ_R.d.ts.map +0 -1
- package/dist/index-YE4KdKbO2.d.ts +0 -335
- package/dist/index-YE4KdKbO2.d.ts.map +0 -1
- package/dist/paired-arms-iZ08VFMN.js +0 -260
- package/dist/paired-arms-iZ08VFMN.js.map +0 -1
- package/dist/paired-promotion-decision-B6zJ3gYM.d.ts +0 -114
- package/dist/paired-promotion-decision-B6zJ3gYM.d.ts.map +0 -1
- package/dist/prime-protocol-BfSalTfR.js.map +0 -1
- package/dist/promotion-policy-Ckjhzg_4.d.ts +0 -289
- package/dist/promotion-policy-Ckjhzg_4.d.ts.map +0 -1
- package/dist/promotion-policy-CrLrmys8.js.map +0 -1
- package/dist/proposal-findings-2GIUo1et.js.map +0 -1
- package/dist/propose-review-control-dSNPjFUH.js +0 -1458
- package/dist/propose-review-control-dSNPjFUH.js.map +0 -1
- package/dist/release-report-BUYmoKo2.js.map +0 -1
- package/dist/release-report-DA2BCu5a.d.ts.map +0 -1
- package/dist/replay-CohS93nE.js +0 -1859
- package/dist/replay-CohS93nE.js.map +0 -1
- package/dist/replay-DbhZ4Ked.d.ts +0 -834
- package/dist/replay-DbhZ4Ked.d.ts.map +0 -1
- package/dist/reward-hacking-BDToousL.js.map +0 -1
- package/dist/run-evidence-Dhi3C81V.d.ts +0 -225
- package/dist/run-evidence-Dhi3C81V.d.ts.map +0 -1
- package/dist/schema-Cef2cFmb2.d.ts.map +0 -1
- package/dist/semantic-concept-judge-D1z-KepS.js +0 -767
- package/dist/semantic-concept-judge-D1z-KepS.js.map +0 -1
- package/dist/series-convergence-ofsqPWhs.d.ts +0 -35
- package/dist/series-convergence-ofsqPWhs.d.ts.map +0 -1
- package/dist/server-iu0ede49.js.map +0 -1
- package/dist/single-run-lock-DFWHEB09.js.map +0 -1
- package/dist/skill-usage-CO9OLRBx.d.ts.map +0 -1
- package/dist/skillopt-optimization-method-CQdVeM8k.js.map +0 -1
- package/dist/skillopt-optimization-method-USDKhxSA.d.ts.map +0 -1
- package/dist/statistical-heldout-TQ-4CYiN.d.ts.map +0 -1
- package/dist/statistics-ByxzSiOM.js +0 -2212
- package/dist/statistics-ByxzSiOM.js.map +0 -1
- package/dist/statistics-D6Uebe_4.d.ts +0 -968
- package/dist/statistics-D6Uebe_4.d.ts.map +0 -1
- package/dist/supervisor-run-D_sokXcO.js +0 -1690
- package/dist/test-graded-scenario-D1TaI2va.d.ts +0 -141
- package/dist/test-graded-scenario-D1TaI2va.d.ts.map +0 -1
- package/dist/test-graded-scenario-JHcKQNpq.js +0 -318
- package/dist/test-graded-scenario-JHcKQNpq.js.map +0 -1
- package/dist/tool-groups-CZPGGlHf.d.ts.map +0 -1
- package/dist/tool-use-metrics-DEGMKycK.js +0 -370
- package/dist/tool-use-metrics-DEGMKycK.js.map +0 -1
- package/dist/types-D216SgwM.d.ts.map +0 -1
- package/dist/usage-receipt-t7vAzCRQ.js.map +0 -1
- package/dist/verdict-DExhxfgR.d.ts +0 -201
- package/dist/verdict-DExhxfgR.d.ts.map +0 -1
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
//#region src/verification-strategy.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Verification-strategy family — the shared vocabulary for "what certified
|
|
4
|
+
* this result", covering tasks with an answer key and tasks without one.
|
|
5
|
+
*
|
|
6
|
+
* Charter Wave 5 (docs/charter.md): an unsolved problem has no held-out
|
|
7
|
+
* suite by definition, so the held-out suite must be ONE member of a
|
|
8
|
+
* strategy family, not the family itself. This module carries the taxonomy,
|
|
9
|
+
* the port shape, and the one protocol built directly on that port: the
|
|
10
|
+
* blind two-arm statement-equivalence check. A checker is an injected
|
|
11
|
+
* executable boundary that returns a typed outcome, so a consumer binds its
|
|
12
|
+
* own kernel (a Lean toolchain, a metamorphic harness, a replication
|
|
13
|
+
* runner) and this package never chooses one. Instruments, never methods.
|
|
14
|
+
*
|
|
15
|
+
* Full family doc, per-member failure modes in prose, and the BCWW pilot
|
|
16
|
+
* worked example: docs/verification-strategies.md. How every executed
|
|
17
|
+
* verdict lands in `DefaultVerdict` with a certification: docs/verdicts.md.
|
|
18
|
+
*
|
|
19
|
+
* Leaf module: no imports from this package. `src/verdict.ts` and
|
|
20
|
+
* `src/rl/verifiable-reward.ts` both build on these types.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* One member of the verification-strategy family.
|
|
24
|
+
*
|
|
25
|
+
* Every member has a documented failure mode — the specific way it can
|
|
26
|
+
* certify a wrong result. A consumer that reads a certification must weigh
|
|
27
|
+
* the member's failure mode, not treat "certified" as one bit.
|
|
28
|
+
*
|
|
29
|
+
* - `'compile'` — typecheck / build / lint passed. Deterministic.
|
|
30
|
+
* Failure mode: code that compiles is not code that is correct; the
|
|
31
|
+
* weakest deterministic member.
|
|
32
|
+
* - `'test'` — unit / integration / held-out suite pass-rate. Deterministic.
|
|
33
|
+
* Failure mode: assumes an answer key exists; certifies nothing outside
|
|
34
|
+
* the suite's coverage, and a stubbed integration reports green.
|
|
35
|
+
* - `'schema'` — structured output validates. Deterministic.
|
|
36
|
+
* Failure mode: shape is not meaning; a well-formed wrong answer passes.
|
|
37
|
+
* - `'sandbox'` — sandbox execution exit code. Deterministic.
|
|
38
|
+
* Failure mode: an exit code compresses the whole run to one bit; a
|
|
39
|
+
* faked success exits 0.
|
|
40
|
+
* - `'judge'` — LLM judge score. Probabilistic.
|
|
41
|
+
* Failure mode: drifts across model versions and is Goodhart-gameable by
|
|
42
|
+
* the graded policy.
|
|
43
|
+
* - `'composite'` — weighted blend across members. Determinism inherited
|
|
44
|
+
* from its members.
|
|
45
|
+
* Failure mode: scalar collapse — the blend hides which member carried
|
|
46
|
+
* the score and which failed.
|
|
47
|
+
* - `'proof-kernel'` — a proof assistant's kernel accepted a formal proof.
|
|
48
|
+
* Deterministic.
|
|
49
|
+
* Failure mode: the formalization gap. The kernel certifies the formal
|
|
50
|
+
* statement, never that the formal statement matches the informal claim;
|
|
51
|
+
* a proved theorem about the wrong statement is a wrong result with a
|
|
52
|
+
* valid certificate. Discharge it with the blind statement-equivalence
|
|
53
|
+
* protocol (`runEquivalenceCheck` in this module).
|
|
54
|
+
* - `'invariant'` — invariant / metamorphic properties held on the result.
|
|
55
|
+
* Deterministic.
|
|
56
|
+
* Failure mode: weak invariants pass everything. An invariant set earns
|
|
57
|
+
* weight only through seeded-bug calibration — a mutation the set
|
|
58
|
+
* provably rejects; an uncalibrated set is a rubber stamp.
|
|
59
|
+
* - `'replication'` — an independent re-execution reproduced the result
|
|
60
|
+
* from pinned inputs. Deterministic given the pins.
|
|
61
|
+
* Failure mode: replication re-runs the method, so it catches
|
|
62
|
+
* nondeterminism and environment drift, never a methodological error the
|
|
63
|
+
* method itself carries.
|
|
64
|
+
* - `'agreement'` — independently-derived results agree. Probabilistic.
|
|
65
|
+
* Failure mode: the shared blind spot. Derivers that share training
|
|
66
|
+
* corpora, priors, or the same misread of the source agree for the same
|
|
67
|
+
* wrong reason; the blindness provenance of each arm is what the
|
|
68
|
+
* certificate rests on.
|
|
69
|
+
*/
|
|
70
|
+
type VerificationStrategySource = 'compile' | 'test' | 'schema' | 'sandbox' | 'judge' | 'composite' | 'proof-kernel' | 'invariant' | 'replication' | 'agreement';
|
|
71
|
+
/**
|
|
72
|
+
* What a strategy member can honestly claim about its outcomes.
|
|
73
|
+
*
|
|
74
|
+
* `determinism: 'inherited'` exists only for `'composite'`: a blend takes
|
|
75
|
+
* the class of its members. The reward axis stays binary
|
|
76
|
+
* (`VerifiableReward.determinism`); this registry describes the family,
|
|
77
|
+
* it never scores a run.
|
|
78
|
+
*/
|
|
79
|
+
interface VerificationStrategyProfile {
|
|
80
|
+
/** Determinism class a well-formed checker of this member can claim. */
|
|
81
|
+
determinism: 'deterministic' | 'probabilistic' | 'inherited';
|
|
82
|
+
/** The documented way this member certifies a wrong result. */
|
|
83
|
+
failureMode: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The family registry. `Record` over the union keeps it exhaustive: adding
|
|
87
|
+
* a member to `VerificationStrategySource` without a profile here fails to
|
|
88
|
+
* compile. The failure mode travels with the taxonomy so a reader of a
|
|
89
|
+
* certification can surface it without this package's docs at hand.
|
|
90
|
+
*/
|
|
91
|
+
declare const VERIFICATION_STRATEGIES: Record<VerificationStrategySource, VerificationStrategyProfile>;
|
|
92
|
+
/** Every family member, derived from the registry so it cannot drift. */
|
|
93
|
+
declare const VERIFICATION_STRATEGY_SOURCES: readonly VerificationStrategySource[];
|
|
94
|
+
/**
|
|
95
|
+
* Exact identity of the thing that checked. "lean4 4.33.0 with Mathlib
|
|
96
|
+
* db584cd6d46c" and "lean4, some version" are different certificates: the
|
|
97
|
+
* first is re-runnable, the second is a story.
|
|
98
|
+
*/
|
|
99
|
+
interface CheckerIdentity {
|
|
100
|
+
/** Toolchain or model name, e.g. `'lean4'` or a judge model id. */
|
|
101
|
+
name: string;
|
|
102
|
+
/** Exact version or snapshot, e.g. `'4.33.0'` or a model snapshot id. */
|
|
103
|
+
version: string;
|
|
104
|
+
/**
|
|
105
|
+
* Content pins the version alone does not capture, e.g.
|
|
106
|
+
* `{ mathlib: 'db584cd6d46c' }`. Keyed by dependency name.
|
|
107
|
+
*/
|
|
108
|
+
pins?: Record<string, string>;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Typed outcome of an external checker call. Callers MUST inspect
|
|
112
|
+
* `succeeded` before touching `value`; a failed check keeps its full error
|
|
113
|
+
* text instead of collapsing to null.
|
|
114
|
+
*/
|
|
115
|
+
type CheckerOutcome<Result> = {
|
|
116
|
+
succeeded: true;
|
|
117
|
+
value: Result;
|
|
118
|
+
} | {
|
|
119
|
+
succeeded: false;
|
|
120
|
+
error: string;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* The port shape every strategy binds through: an injected executable
|
|
124
|
+
* boundary. This package defines the port and refuses to ship any
|
|
125
|
+
* implementation behind it — the consumer binds its own kernel, invariant
|
|
126
|
+
* harness, replication runner, or judge, and the binding carries its own
|
|
127
|
+
* identity and determinism claim.
|
|
128
|
+
*
|
|
129
|
+
* A checker that ran but could not decide returns
|
|
130
|
+
* `{ succeeded: false, error }` with the reason; `succeeded: true` is
|
|
131
|
+
* reserved for a discharged check.
|
|
132
|
+
*/
|
|
133
|
+
interface StrategyChecker<Input, Result> {
|
|
134
|
+
/** Which family member this checker discharges obligations for. */
|
|
135
|
+
strategy: VerificationStrategySource;
|
|
136
|
+
identity: CheckerIdentity;
|
|
137
|
+
/** Determinism class this checker claims for its outcomes. */
|
|
138
|
+
determinism: 'deterministic' | 'probabilistic';
|
|
139
|
+
check(input: Input): Promise<CheckerOutcome<Result>>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Statement-equivalence protocol — the blind two-arm design as a typed
|
|
143
|
+
* primitive.
|
|
144
|
+
*
|
|
145
|
+
* The problem it closes is the proof-kernel failure mode (the
|
|
146
|
+
* formalization gap): a kernel certifies a formal statement, never that
|
|
147
|
+
* the formal statement matches the informal claim. The protocol makes the
|
|
148
|
+
* gap measurable: two arms derive the formal statement independently and
|
|
149
|
+
* blind to each other, then a checker discharges the obligation that the
|
|
150
|
+
* two statements are equivalent. A statement mismatch is a successful
|
|
151
|
+
* outcome — it is the formalization gap made visible with a separating
|
|
152
|
+
* witness in hand.
|
|
153
|
+
*
|
|
154
|
+
* The protocol is pure contract + record types + the asymmetry refusals.
|
|
155
|
+
* Execution binds through the same `StrategyChecker` port as every other
|
|
156
|
+
* strategy: the consumer injects its own kernel. The pilot record this
|
|
157
|
+
* shape reproduces was assembled by hand for the BCWW (4.6) inequality;
|
|
158
|
+
* docs/verification-strategies.md carries the worked example with artifact
|
|
159
|
+
* paths. `equivalenceVerdict` (src/verdict.ts) lands a finished record in
|
|
160
|
+
* the shared verdict spine.
|
|
161
|
+
*
|
|
162
|
+
* The refusals are the design. An arm that saw the other arm's statement,
|
|
163
|
+
* or the outcome it feeds, did not independently derive anything — the
|
|
164
|
+
* check is invalid, and this module throws rather than record it.
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* The two-arm blind design. `arms: 2` and `blind: true` are literal types
|
|
168
|
+
* on purpose: a wider design is a different protocol, not a parameter.
|
|
169
|
+
*/
|
|
170
|
+
interface EquivalenceCheckSpec {
|
|
171
|
+
/**
|
|
172
|
+
* The strategy member whose obligation the check discharges — the pilot
|
|
173
|
+
* used `'proof-kernel'`: the Lean kernel proved the two statements
|
|
174
|
+
* equivalent. The bound checker must declare the same member.
|
|
175
|
+
*/
|
|
176
|
+
source: VerificationStrategySource;
|
|
177
|
+
/**
|
|
178
|
+
* Stable identity of the claim under verification: a path, digest, or
|
|
179
|
+
* citation. Pilot: arXiv:1507.05650 inequality (4.6) plus the
|
|
180
|
+
* five-atom counterexample record.
|
|
181
|
+
*/
|
|
182
|
+
artifact: string;
|
|
183
|
+
/** Exactly two independent arms. An N-arm design is not this protocol. */
|
|
184
|
+
arms: 2;
|
|
185
|
+
/**
|
|
186
|
+
* Blind derivation is the point: a non-blind run is not a weaker check,
|
|
187
|
+
* it is no check. `false` is unrepresentable here and refused at runtime
|
|
188
|
+
* for untyped callers.
|
|
189
|
+
*/
|
|
190
|
+
blind: true;
|
|
191
|
+
}
|
|
192
|
+
/** A validated, frozen spec. Produced only by `defineEquivalenceCheck`. */
|
|
193
|
+
interface EquivalenceCheckDefinition {
|
|
194
|
+
readonly spec: Readonly<EquivalenceCheckSpec>;
|
|
195
|
+
}
|
|
196
|
+
/** One arm's committed statement plus the provenance the record rests on. */
|
|
197
|
+
interface EquivalenceArm {
|
|
198
|
+
armId: string;
|
|
199
|
+
/** The committed formal statement text (pilot: the arm's `Statement.lean` source). */
|
|
200
|
+
statement: string;
|
|
201
|
+
/**
|
|
202
|
+
* What this arm derived the statement from. Pilot arm A: the paper's
|
|
203
|
+
* LaTeX source; pilot arm B: the campaign's artifacts. The two arms
|
|
204
|
+
* SHOULD derive from different renderings of the claim — that is what
|
|
205
|
+
* makes agreement informative.
|
|
206
|
+
*/
|
|
207
|
+
derivedFrom: string;
|
|
208
|
+
/**
|
|
209
|
+
* The blindness declaration. Both flags must be `true`; a `false` value
|
|
210
|
+
* is refused loudly, because recording a non-blind arm would launder an
|
|
211
|
+
* invalid check into a valid-looking record.
|
|
212
|
+
*/
|
|
213
|
+
blindness: {
|
|
214
|
+
/** This arm never saw any other arm's statement before committing its own. */
|
|
215
|
+
toOtherArms: boolean;
|
|
216
|
+
/** This arm never saw the verification outcome before committing. */
|
|
217
|
+
toOutcome: boolean;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
type EquivalenceObligationStatus = 'proved' | 'refuted-with-separating-witness' | 'unresolved';
|
|
221
|
+
/**
|
|
222
|
+
* The discharged (or undischarged) equivalence obligation.
|
|
223
|
+
*
|
|
224
|
+
* Field presence is status-dependent and enforced by
|
|
225
|
+
* `buildEquivalenceRecord`:
|
|
226
|
+
* - `'proved'` requires `evidenceDigest` and forbids `separatingWitness`.
|
|
227
|
+
* - `'refuted-with-separating-witness'` requires both the witness and
|
|
228
|
+
* `evidenceDigest`.
|
|
229
|
+
* - `'unresolved'` requires `unresolvedReason` and forbids the witness —
|
|
230
|
+
* an undischarged obligation keeps its diagnostic instead of faking
|
|
231
|
+
* either verdict.
|
|
232
|
+
*/
|
|
233
|
+
interface EquivalenceObligation {
|
|
234
|
+
status: EquivalenceObligationStatus;
|
|
235
|
+
/** The input on which the two statements provably disagree. */
|
|
236
|
+
separatingWitness?: string;
|
|
237
|
+
/** Why the obligation could not be discharged (checker error text, coverage limit). */
|
|
238
|
+
unresolvedReason?: string;
|
|
239
|
+
/** The checker that ran (or failed to run) the obligation. */
|
|
240
|
+
checker: CheckerIdentity;
|
|
241
|
+
/** Digest of the checker's evidence artifact (pilot: the kernel-checked `Check.lean` run). */
|
|
242
|
+
evidenceDigest?: string;
|
|
243
|
+
}
|
|
244
|
+
/** The record the protocol produces — the by-hand pilot record, typed. */
|
|
245
|
+
interface EquivalenceRecord {
|
|
246
|
+
spec: Readonly<EquivalenceCheckSpec>;
|
|
247
|
+
arms: readonly [EquivalenceArm, EquivalenceArm];
|
|
248
|
+
obligation: EquivalenceObligation;
|
|
249
|
+
}
|
|
250
|
+
/** Input the bound checker receives: the artifact identity and both committed statements. */
|
|
251
|
+
interface EquivalenceCheckerInput {
|
|
252
|
+
artifact: string;
|
|
253
|
+
statements: readonly [string, string];
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* What a checker that RAN must return. `'unresolved'` is deliberately not
|
|
257
|
+
* a checker result: a checker that could not decide returns
|
|
258
|
+
* `{ succeeded: false, error }` through the port, and the protocol records
|
|
259
|
+
* the unresolved obligation with that reason.
|
|
260
|
+
*/
|
|
261
|
+
interface EquivalenceCheckerResult {
|
|
262
|
+
status: 'proved' | 'refuted-with-separating-witness';
|
|
263
|
+
/** Required when `status` is refuted. */
|
|
264
|
+
separatingWitness?: string;
|
|
265
|
+
evidenceDigest: string;
|
|
266
|
+
}
|
|
267
|
+
/** An equivalence checker is a `StrategyChecker` — same port as every strategy. */
|
|
268
|
+
type EquivalenceChecker = StrategyChecker<EquivalenceCheckerInput, EquivalenceCheckerResult>;
|
|
269
|
+
/** A refused equivalence check. `code` names the exact refusal for programmatic handling. */
|
|
270
|
+
declare class EquivalenceProtocolError extends Error {
|
|
271
|
+
readonly code: 'arm-count' | 'not-blind' | 'arm-saw-other' | 'arm-saw-outcome' | 'duplicate-arm-id' | 'empty-field' | 'unknown-source' | 'witness-missing' | 'witness-on-proved' | 'witness-on-unresolved' | 'reason-missing' | 'evidence-missing' | 'checker-strategy-mismatch';
|
|
272
|
+
constructor(code: EquivalenceProtocolError['code'], message: string);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Validate and freeze a two-arm blind equivalence check spec.
|
|
276
|
+
*
|
|
277
|
+
* The literal types already refuse a wide design at compile time; the
|
|
278
|
+
* runtime checks hold the same line for untyped callers. There is no
|
|
279
|
+
* escape hatch: `arms: 3` or `blind: false` throws, never downgrades.
|
|
280
|
+
*/
|
|
281
|
+
declare function defineEquivalenceCheck(spec: EquivalenceCheckSpec): EquivalenceCheckDefinition;
|
|
282
|
+
/**
|
|
283
|
+
* Assemble the equivalence record, refusing every asymmetry.
|
|
284
|
+
*
|
|
285
|
+
* Refusals (each throws `EquivalenceProtocolError`):
|
|
286
|
+
* - an arm whose `blindness.toOtherArms` is false — it saw the other
|
|
287
|
+
* statement, so nothing was independently derived;
|
|
288
|
+
* - an arm whose `blindness.toOutcome` is false — it could steer its
|
|
289
|
+
* statement toward (or away from) the known result;
|
|
290
|
+
* - duplicate arm ids, empty statements, empty derivations;
|
|
291
|
+
* - an obligation whose fields contradict its status (see
|
|
292
|
+
* `EquivalenceObligation`).
|
|
293
|
+
*/
|
|
294
|
+
declare function buildEquivalenceRecord(definition: EquivalenceCheckDefinition, arms: readonly [EquivalenceArm, EquivalenceArm], obligation: EquivalenceObligation): EquivalenceRecord;
|
|
295
|
+
/**
|
|
296
|
+
* Discharge the obligation through an injected checker and return the
|
|
297
|
+
* record.
|
|
298
|
+
*
|
|
299
|
+
* Order matters: every arm refusal fires BEFORE the checker runs — an
|
|
300
|
+
* invalid check must not spend. A checker whose `strategy` differs from
|
|
301
|
+
* `spec.source` is refused for the same reason: a judge cannot silently
|
|
302
|
+
* discharge a proof-kernel obligation.
|
|
303
|
+
*
|
|
304
|
+
* A checker failure (`succeeded: false`) is not thrown: it becomes an
|
|
305
|
+
* `'unresolved'` obligation carrying the full error text, which is the
|
|
306
|
+
* honest record of an undischarged check.
|
|
307
|
+
*/
|
|
308
|
+
declare function runEquivalenceCheck(definition: EquivalenceCheckDefinition, arms: readonly [EquivalenceArm, EquivalenceArm], checker: EquivalenceChecker): Promise<EquivalenceRecord>;
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/verdict.d.ts
|
|
311
|
+
/**
|
|
312
|
+
* What certified a verdict — the epistemics a bare `valid` + `score` pair
|
|
313
|
+
* cannot carry. A kernel-checked proof and an LLM judge can produce the
|
|
314
|
+
* same `{ valid: true, score: 1 }`; this record is what tells them apart.
|
|
315
|
+
*
|
|
316
|
+
* Every field is required on purpose. A certification without a checker
|
|
317
|
+
* identity or an evidence digest is exactly the unverifiable claim this
|
|
318
|
+
* record exists to kill.
|
|
319
|
+
*/
|
|
320
|
+
interface VerdictCertification {
|
|
321
|
+
/**
|
|
322
|
+
* Which verification-strategy member produced the certificate. Each
|
|
323
|
+
* member's failure mode is documented on the family type and in
|
|
324
|
+
* `VERIFICATION_STRATEGIES` (src/verification-strategy.ts).
|
|
325
|
+
*/
|
|
326
|
+
strategy: VerificationStrategySource;
|
|
327
|
+
/**
|
|
328
|
+
* Exact checker identity, e.g. `{ name: 'lean4', version: '4.33.0',
|
|
329
|
+
* pins: { mathlib: 'db584cd6d46c' } }` for a kernel, or a judge model
|
|
330
|
+
* id + snapshot for a judge.
|
|
331
|
+
*/
|
|
332
|
+
checker: CheckerIdentity;
|
|
333
|
+
/**
|
|
334
|
+
* Every step the certificate rests on that the checker did NOT verify,
|
|
335
|
+
* e.g. 'diagonal embedding argued in prose' or 'agreement arms share
|
|
336
|
+
* training-corpus blind spots'. An empty array is the producer's
|
|
337
|
+
* explicit, auditable claim that there are none — it is not a default.
|
|
338
|
+
*/
|
|
339
|
+
assumptions: string[];
|
|
340
|
+
/** Digest (e.g. sha256) of the evidence artifact the checker consumed or produced. */
|
|
341
|
+
evidenceDigest: string;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Minimal verdict shape — `valid` + `score` are required; `scores` +
|
|
345
|
+
* `notes` are optional surface. Validators that need richer shapes
|
|
346
|
+
* parameterise `Validator<Output, MyVerdict>` with their own type.
|
|
347
|
+
*
|
|
348
|
+
* Need structured extras? Extend DefaultVerdict with typed fields — never
|
|
349
|
+
* serialize extras into `notes`.
|
|
350
|
+
*/
|
|
351
|
+
interface DefaultVerdict {
|
|
352
|
+
/** Whether the output meets the validator's pass criteria. */
|
|
353
|
+
valid: boolean;
|
|
354
|
+
/** Aggregate score in [0, 1]. Drivers use this for winner selection. */
|
|
355
|
+
score: number;
|
|
356
|
+
/** Per-dimension scores. Free-form; weighted into `score` by the validator. */
|
|
357
|
+
scores?: Record<string, number>;
|
|
358
|
+
/** Human-readable rationale; surfaces in trace + final-result `winner.verdict`. */
|
|
359
|
+
notes?: string;
|
|
360
|
+
/**
|
|
361
|
+
* What certified this verdict, when anything did. Absent = uncertified:
|
|
362
|
+
* scored, but no strategy vouches for it. A consumer that cares reads
|
|
363
|
+
* `certification.strategy` to tell a kernel-checked verdict from a
|
|
364
|
+
* judge-scored one; a consumer that does not read it sees the exact
|
|
365
|
+
* verdict it always saw.
|
|
366
|
+
*/
|
|
367
|
+
certification?: VerdictCertification;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Digest a certification's evidence artifact: sha-256 over the canonical
|
|
371
|
+
* JSON of the evidence AS SERIALIZED. The JSON round-trip drops
|
|
372
|
+
* `undefined`-valued fields on purpose — certified verdicts persist as
|
|
373
|
+
* JSON, so the digest must cover exactly what a reader of the persisted
|
|
374
|
+
* artifact can re-digest, nothing the wire cannot carry. Throws when the
|
|
375
|
+
* evidence has no JSON form at all.
|
|
376
|
+
*/
|
|
377
|
+
declare function certificationEvidenceDigest(evidence: unknown): string;
|
|
378
|
+
/**
|
|
379
|
+
* Land a finished statement-equivalence record in the shared verdict
|
|
380
|
+
* spine. `valid` answers the protocol's question — are the two blind
|
|
381
|
+
* statements equivalent — so a refutation is `valid: false` even though a
|
|
382
|
+
* separating witness in hand is a successful protocol outcome.
|
|
383
|
+
*
|
|
384
|
+
* Certification is present exactly when the obligation was discharged
|
|
385
|
+
* (proved or refuted): the checker vouches for the discharge either way.
|
|
386
|
+
* An unresolved obligation certifies nothing and keeps its reason in
|
|
387
|
+
* `notes`.
|
|
388
|
+
*/
|
|
389
|
+
declare function equivalenceVerdict(record: EquivalenceRecord): DefaultVerdict;
|
|
390
|
+
//#endregion
|
|
391
|
+
export { defineEquivalenceCheck as C, buildEquivalenceRecord as S, StrategyChecker as _, CheckerIdentity as a, VerificationStrategyProfile as b, EquivalenceCheckDefinition as c, EquivalenceCheckerInput as d, EquivalenceCheckerResult as f, EquivalenceRecord as g, EquivalenceProtocolError as h, equivalenceVerdict as i, EquivalenceCheckSpec as l, EquivalenceObligationStatus as m, VerdictCertification as n, CheckerOutcome as o, EquivalenceObligation as p, certificationEvidenceDigest as r, EquivalenceArm as s, DefaultVerdict as t, EquivalenceChecker as u, VERIFICATION_STRATEGIES as v, runEquivalenceCheck as w, VerificationStrategySource as x, VERIFICATION_STRATEGY_SOURCES as y };
|
|
392
|
+
//# sourceMappingURL=verdict-E4eRNf7-.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdict-E4eRNf7-.d.ts","names":[],"sources":["../src/verification-strategy.ts","../src/verdict.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqEY;;;;;;;;;UAoBK;;EAEf;;EAEA;;;;;;;;cASW,yBAAyB,OACpC,4BACA;;cAkDW,wCAEC;;;;;;UAOG;;EAEf;;EAEA;;;;;EAKA,OAAO;;;;;;;KAQG,eAAe;EACrB;EAAiB,OAAO;;EACxB;EAAkB;;;;;;;;;;;;;UAaP,gBAAgB,OAAO;;EAEtC,UAAU;EACV,UAAU;;EAEV;EACA,MAAM,OAAO,QAAQ,QAAQ,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmC7B;;;;;;EAMf,QAAQ;;;;;;EAMR;;EAEA;;;;;;EAMA;;;UAIe;WACN,MAAM,SAAS;;;UAIT;EACf;;EAEA;;;;;;;EAOA;;;;;;EAMA;;IAEE;;IAEA;;;KAIQ;;;;;;;;;;;;;UAiBK;EACf,QAAQ;;EAER;;EAEA;;EAEA,SAAS;;EAET;;;UAIe;EACf,MAAM,SAAS;EACf,gBAAgB,gBAAgB;EAChC,YAAY;;;UAIG;EACf;EACA;;;;;;;;UASe;EACf;;EAEA;EACA;;;KAIU,qBAAqB,gBAAgB,yBAAyB;;cAG7D,iCAAiC;WACnC;EAeT,YAAY,MAAM,kCAAkC;;;;;;;;;iBActC,uBAAuB,MAAM,uBAAuB;;;;;;;;;;;;;iBAwCpD,uBACd,YAAY,4BACZ,gBAAgB,gBAAgB,iBAChC,YAAY,wBACX;;;;;;;;;;;;;;iBAuBmB,oBACpB,YAAY,4BACZ,gBAAgB,gBAAgB,iBAChC,SAAS,qBACR,QAAQ;;;;;;;;;;;;UCjaM;;;;;;EAMf,UAAU;;;;;;EAMV,SAAS;;;;;;;EAOT;;EAEA;;;;;;;;;;UAWe;;EAEf;;EAEA;;EAEA,SAAS;;EAET;;;;;;;;EAQA,gBAAgB;;;;;;;;;;iBAWF,4BAA4B;;;;;;;;;;;;iBAqB5B,mBAAmB,QAAQ,oBAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
2
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
3
3
|
//#region src/verdict-cache.ts
|
|
4
4
|
/**
|
|
5
5
|
* Content-addressed judge-verdict caching.
|
|
@@ -61,16 +61,6 @@ function canonicalJson(value) {
|
|
|
61
61
|
function contentHash(value) {
|
|
62
62
|
return createHash("sha256").update(canonicalJson(value)).digest("hex");
|
|
63
63
|
}
|
|
64
|
-
/** Process-local Map-backed store. */
|
|
65
|
-
function inMemoryVerdictCache() {
|
|
66
|
-
const entries = /* @__PURE__ */ new Map();
|
|
67
|
-
return {
|
|
68
|
-
get: (key) => entries.get(key),
|
|
69
|
-
set: (key, score) => {
|
|
70
|
-
entries.set(key, score);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
64
|
function parseCacheLine(line, path, lineNo) {
|
|
75
65
|
let parsed;
|
|
76
66
|
try {
|
|
@@ -111,49 +101,7 @@ function fileVerdictCache(path) {
|
|
|
111
101
|
}
|
|
112
102
|
};
|
|
113
103
|
}
|
|
114
|
-
/**
|
|
115
|
-
* Wrap a `JudgeConfig` so repeat judgments of the same artifact are served
|
|
116
|
-
* from the store instead of re-invoking `score()`. The wrapper is generic
|
|
117
|
-
* over the judge's own type parameters and preserves `appliesTo` — it is a
|
|
118
|
-
* drop-in replacement anywhere a `JudgeConfig` is accepted.
|
|
119
|
-
*
|
|
120
|
-
* A judge that throws is NOT cached: the error propagates and the next
|
|
121
|
-
* attempt re-judges (caching a failure would pin a transient outage forever).
|
|
122
|
-
*/
|
|
123
|
-
function cachedJudge(judge, store, options) {
|
|
124
|
-
if (typeof options.judgeVersion !== "string" || options.judgeVersion.trim() === "") throw new Error("cachedJudge: judgeVersion is required and must be a non-empty string");
|
|
125
|
-
const stats = {
|
|
126
|
-
hits: 0,
|
|
127
|
-
misses: 0
|
|
128
|
-
};
|
|
129
|
-
const wrapped = {
|
|
130
|
-
name: judge.name,
|
|
131
|
-
dimensions: judge.dimensions,
|
|
132
|
-
judgeVersion: options.judgeVersion,
|
|
133
|
-
async score(input) {
|
|
134
|
-
const key = contentHash({
|
|
135
|
-
artifact: canonicalJson(input.artifact),
|
|
136
|
-
scenarioId: input.scenario.id,
|
|
137
|
-
judgeName: judge.name,
|
|
138
|
-
dimensions: judge.dimensions,
|
|
139
|
-
judgeVersion: options.judgeVersion
|
|
140
|
-
});
|
|
141
|
-
const cached = await store.get(key);
|
|
142
|
-
if (cached !== void 0) {
|
|
143
|
-
stats.hits += 1;
|
|
144
|
-
return cached;
|
|
145
|
-
}
|
|
146
|
-
const score = await judge.score(input);
|
|
147
|
-
await store.set(key, score);
|
|
148
|
-
stats.misses += 1;
|
|
149
|
-
return score;
|
|
150
|
-
},
|
|
151
|
-
stats: () => ({ ...stats })
|
|
152
|
-
};
|
|
153
|
-
if (judge.appliesTo) wrapped.appliesTo = judge.appliesTo;
|
|
154
|
-
return wrapped;
|
|
155
|
-
}
|
|
156
104
|
//#endregion
|
|
157
|
-
export {
|
|
105
|
+
export { contentHash as n, fileVerdictCache as r, canonicalJson as t };
|
|
158
106
|
|
|
159
|
-
//# sourceMappingURL=verdict-cache-
|
|
107
|
+
//# sourceMappingURL=verdict-cache-mZf5FEiY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict-cache-BCcOh0kF.js","names":[],"sources":["../src/verdict-cache.ts"],"sourcesContent":["/**\n * Content-addressed judge-verdict caching.\n *\n * LAW: cache JUDGE VERDICTS only — judging the same artifact with the same\n * judge+rubric is pure. NEVER cache agent rollouts. (A router that cached\n * identical fanout prompts silently destroyed best-of-N diversity; rollout\n * caching reintroduces that failure class. Judging has no diversity to\n * destroy — same artifact + same rubric ⇒ same verdict is the desired\n * property, not a bug.)\n *\n * The cache key is a sha-256 over the canonical JSON of everything that can\n * change a verdict: the artifact content, the scenario id, the judge name,\n * the full dimension list (key + description — the description IS the rubric\n * text shown to the judge), and a caller-supplied `judgeVersion`.\n * `judgeVersion` is REQUIRED: a judge whose prompt/model/ensemble changes\n * without a version bump would otherwise silently serve stale verdicts.\n *\n * Strict canonicalization (`canonicalJson`) throws on undefined / function /\n * symbol / non-finite numbers — an artifact that cannot be unambiguously\n * serialized cannot be content-addressed, and coercing it would let two\n * different artifacts collide on one key.\n */\n\nimport { createHash } from 'node:crypto'\nimport { appendFileSync, existsSync, readFileSync } from 'node:fs'\nimport type { JudgeConfig, JudgeScore, Scenario } from './campaign/types'\n\n// ── canonical JSON + content hash ─────────────────────────────────────────\n\nfunction canonicalizeAt(value: unknown, path: string): string {\n if (value === null) return 'null'\n switch (typeof value) {\n case 'boolean':\n return value ? 'true' : 'false'\n case 'number':\n if (!Number.isFinite(value)) {\n throw new Error(\n `canonicalJson: non-finite number (${value}) at ${path} — ambiguity is an error, not a coercion`,\n )\n }\n return JSON.stringify(value)\n case 'string':\n return JSON.stringify(value)\n case 'undefined':\n case 'function':\n case 'symbol':\n throw new Error(\n `canonicalJson: ${typeof value} at ${path} — ambiguity is an error, not a coercion`,\n )\n case 'bigint':\n throw new Error(`canonicalJson: bigint at ${path} — not representable in JSON`)\n case 'object':\n break\n }\n const obj = value as Record<string, unknown>\n // Honor toJSON (Date → ISO string) before structural checks — without it a\n // Date would canonicalize to '{}' and every timestamp would collide.\n if (typeof obj.toJSON === 'function') {\n return canonicalizeAt((obj as { toJSON(): unknown }).toJSON(), path)\n }\n if (Array.isArray(obj)) {\n return `[${obj.map((item, i) => canonicalizeAt(item, `${path}[${i}]`)).join(',')}]`\n }\n if (obj instanceof Map || obj instanceof Set) {\n throw new Error(\n `canonicalJson: ${obj instanceof Map ? 'Map' : 'Set'} at ${path} — would serialize as '{}'; convert to a plain object/array first`,\n )\n }\n const keys = Object.keys(obj).sort()\n const parts = keys.map((k) => `${JSON.stringify(k)}:${canonicalizeAt(obj[k], `${path}.${k}`)}`)\n return `{${parts.join(',')}}`\n}\n\n/**\n * Stable JSON stringify: object keys sorted recursively, so two semantically\n * equal values produce byte-identical output regardless of key insertion\n * order. Throws on undefined / function / symbol / NaN / ±Infinity / bigint /\n * Map / Set — anything JSON.stringify would coerce or drop silently.\n *\n * Distinct from `pre-registration.ts`'s `canonicalize`/`hashJson`, which are\n * permissive (coercion allowed) and async (web-crypto). Use THIS pair when a\n * hash collision or silent coercion would corrupt a cache key or attestation.\n */\nexport function canonicalJson(value: unknown): string {\n return canonicalizeAt(value, '$')\n}\n\n/** Hex sha-256 over `canonicalJson(value)`. The content address used by the\n * verdict cache and report attestation. */\nexport function contentHash(value: unknown): string {\n return createHash('sha256').update(canonicalJson(value)).digest('hex')\n}\n\n// ── store contract ─────────────────────────────────────────────────────────\n\n/** Pluggable verdict store. Sync or async on both legs — `cachedJudge`\n * awaits the results either way. */\nexport interface VerdictCacheStore {\n get(key: string): Promise<JudgeScore | undefined> | JudgeScore | undefined\n set(key: string, score: JudgeScore): Promise<void> | void\n}\n\n/** Process-local Map-backed store. */\nexport function inMemoryVerdictCache(): VerdictCacheStore {\n const entries = new Map<string, JudgeScore>()\n return {\n get: (key) => entries.get(key),\n set: (key, score) => {\n entries.set(key, score)\n },\n }\n}\n\ninterface VerdictCacheLine {\n key: string\n score: JudgeScore\n}\n\nfunction parseCacheLine(line: string, path: string, lineNo: number): VerdictCacheLine {\n let parsed: unknown\n try {\n parsed = JSON.parse(line)\n } catch (err) {\n throw new Error(\n `fileVerdictCache: corrupt JSONL at ${path}:${lineNo} — ${err instanceof Error ? err.message : String(err)}`,\n )\n }\n const rec = parsed as Partial<VerdictCacheLine>\n if (\n typeof rec !== 'object' ||\n rec === null ||\n typeof rec.key !== 'string' ||\n typeof rec.score !== 'object' ||\n rec.score === null ||\n typeof rec.score.composite !== 'number' ||\n typeof rec.score.dimensions !== 'object'\n ) {\n throw new Error(\n `fileVerdictCache: invalid record shape at ${path}:${lineNo} — expected {key, score:{dimensions, composite, notes}}`,\n )\n }\n return rec as VerdictCacheLine\n}\n\n/**\n * JSONL-file-backed store: the full file is loaded into an in-memory index at\n * construction; every `set` appends one line synchronously (durable before\n * the verdict is returned). A corrupt or malformed line throws at load with\n * file:line — a skipped line would silently re-judge (cost) or, worse, mask\n * a half-written file that needs operator attention.\n */\nexport function fileVerdictCache(path: string): VerdictCacheStore {\n const entries = new Map<string, JudgeScore>()\n if (existsSync(path)) {\n const lines = readFileSync(path, 'utf8').split('\\n')\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n if (line === undefined || line.trim() === '') continue\n const rec = parseCacheLine(line, path, i + 1)\n entries.set(rec.key, rec.score)\n }\n }\n return {\n get: (key) => entries.get(key),\n set: (key, score) => {\n appendFileSync(path, `${JSON.stringify({ key, score })}\\n`, 'utf8')\n entries.set(key, score)\n },\n }\n}\n\n// ── cached judge wrapper ───────────────────────────────────────────────────\n\nexport interface VerdictCacheStats {\n hits: number\n misses: number\n}\n\nexport interface CachedJudgeOptions {\n /** REQUIRED — part of the cache key. Bump on any change to the judge's\n * prompt, model, ensemble, or scoring logic; silent judge upgrades must\n * never serve stale verdicts. */\n judgeVersion: string\n}\n\n/** The wrapped judge: same `JudgeConfig` seam, plus hit/miss observability. */\nexport type CachedJudge<TArtifact, TScenario extends Scenario = Scenario> = JudgeConfig<\n TArtifact,\n TScenario\n> & {\n stats(): VerdictCacheStats\n}\n\n/**\n * Wrap a `JudgeConfig` so repeat judgments of the same artifact are served\n * from the store instead of re-invoking `score()`. The wrapper is generic\n * over the judge's own type parameters and preserves `appliesTo` — it is a\n * drop-in replacement anywhere a `JudgeConfig` is accepted.\n *\n * A judge that throws is NOT cached: the error propagates and the next\n * attempt re-judges (caching a failure would pin a transient outage forever).\n */\nexport function cachedJudge<TArtifact, TScenario extends Scenario = Scenario>(\n judge: JudgeConfig<TArtifact, TScenario>,\n store: VerdictCacheStore,\n options: CachedJudgeOptions,\n): CachedJudge<TArtifact, TScenario> {\n if (typeof options.judgeVersion !== 'string' || options.judgeVersion.trim() === '') {\n throw new Error('cachedJudge: judgeVersion is required and must be a non-empty string')\n }\n const stats: VerdictCacheStats = { hits: 0, misses: 0 }\n const wrapped: CachedJudge<TArtifact, TScenario> = {\n name: judge.name,\n dimensions: judge.dimensions,\n judgeVersion: options.judgeVersion,\n async score(input) {\n const key = contentHash({\n artifact: canonicalJson(input.artifact),\n scenarioId: input.scenario.id,\n judgeName: judge.name,\n dimensions: judge.dimensions,\n judgeVersion: options.judgeVersion,\n })\n const cached = await store.get(key)\n if (cached !== undefined) {\n stats.hits += 1\n return cached\n }\n const score = await judge.score(input)\n await store.set(key, score)\n stats.misses += 1\n return score\n },\n stats: () => ({ ...stats }),\n }\n if (judge.appliesTo) wrapped.appliesTo = judge.appliesTo\n return wrapped\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,eAAe,OAAgB,MAAsB;CAC5D,IAAI,UAAU,MAAM,OAAO;CAC3B,QAAQ,OAAO,OAAf;EACE,KAAK,WACH,OAAO,QAAQ,SAAS;EAC1B,KAAK;GACH,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,MAAM,IAAI,MACR,qCAAqC,MAAM,OAAO,KAAK,yCACzD;GAEF,OAAO,KAAK,UAAU,KAAK;EAC7B,KAAK,UACH,OAAO,KAAK,UAAU,KAAK;EAC7B,KAAK;EACL,KAAK;EACL,KAAK,UACH,MAAM,IAAI,MACR,kBAAkB,OAAO,MAAM,MAAM,KAAK,yCAC5C;EACF,KAAK,UACH,MAAM,IAAI,MAAM,4BAA4B,KAAK,6BAA6B;EAChF,KAAK,UACH;CACJ;CACA,MAAM,MAAM;CAGZ,IAAI,OAAO,IAAI,WAAW,YACxB,OAAO,eAAgB,IAA8B,OAAO,GAAG,IAAI;CAErE,IAAI,MAAM,QAAQ,GAAG,GACnB,OAAO,IAAI,IAAI,KAAK,MAAM,MAAM,eAAe,MAAM,GAAG,KAAK,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;CAEnF,IAAI,eAAe,OAAO,eAAe,KACvC,MAAM,IAAI,MACR,kBAAkB,eAAe,MAAM,QAAQ,MAAM,MAAM,KAAK,kEAClE;CAIF,OAAO,IAFM,OAAO,KAAK,GAAG,CAAC,CAAC,KACb,CAAC,CAAC,KAAK,MAAM,GAAG,KAAK,UAAU,CAAC,EAAE,GAAG,eAAe,IAAI,IA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e,MAAM,MAAM,IAAI,CAAC;GAC5C,QAAQ,IAAI,IAAI,KAAK,IAAI,KAAK;EAChC;CACF;CACA,OAAO;EACL,MAAM,QAAQ,QAAQ,IAAI,GAAG;EAC7B,MAAM,KAAK,UAAU;GACnB,eAAe,MAAM,GAAG,KAAK,UAAU;IAAE;IAAK;GAAM,CAAC,EAAE,KAAK,MAAM;GAClE,QAAQ,IAAI,KAAK,KAAK;EACxB;CACF;AACF;;;;;;;;;;AAiCA,SAAgB,YACd,OACA,OACA,SACmC;CACnC,IAAI,OAAO,QAAQ,iBAAiB,YAAY,QAAQ,aAAa,KAAK,MAAM,IAC9E,MAAM,IAAI,MAAM,sEAAsE;CAExF,MAAM,QAA2B;EAAE,MAAM;EAAG,QAAQ;CAAE;CACtD,MAAM,UAA6C;EACjD,MAAM,MAAM;EACZ,YAAY,MAAM;EAClB,cAAc,QAAQ;EACtB,MAAM,MAAM,OAAO;GACjB,MAAM,MAAM,YAAY;IACtB,UAAU,cAAc,MAAM,QAAQ;IACtC,YAAY,MAAM,SAAS;IAC3B,WAAW,MAAM;IACjB,YAAY,MAAM;IAClB,cAAc,QAAQ;GACxB,CAAC;GACD,MAAM,SAAS,MAAM,MAAM,IAAI,GAAG;GAClC,IAAI,WAAW,KAAA,GAAW;IACxB,MAAM,QAAQ;IACd,OAAO;GACT;GACA,MAAM,QAAQ,MAAM,MAAM,MAAM,KAAK;GACrC,MAAM,MAAM,IAAI,KAAK,KAAK;GAC1B,MAAM,UAAU;GAChB,OAAO;EACT;EACA,cAAc,EAAE,GAAG,MAAM;CAC3B;CACA,IAAI,MAAM,WAAW,QAAQ,YAAY,MAAM;CAC/C,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"verdict-cache-mZf5FEiY.js","names":[],"sources":["../src/verdict-cache.ts"],"sourcesContent":["/**\n * Content-addressed judge-verdict caching.\n *\n * LAW: cache JUDGE VERDICTS only — judging the same artifact with the same\n * judge+rubric is pure. NEVER cache agent rollouts. (A router that cached\n * identical fanout prompts silently destroyed best-of-N diversity; rollout\n * caching reintroduces that failure class. Judging has no diversity to\n * destroy — same artifact + same rubric ⇒ same verdict is the desired\n * property, not a bug.)\n *\n * The cache key is a sha-256 over the canonical JSON of everything that can\n * change a verdict: the artifact content, the scenario id, the judge name,\n * the full dimension list (key + description — the description IS the rubric\n * text shown to the judge), and a caller-supplied `judgeVersion`.\n * `judgeVersion` is REQUIRED: a judge whose prompt/model/ensemble changes\n * without a version bump would otherwise silently serve stale verdicts.\n *\n * Strict canonicalization (`canonicalJson`) throws on undefined / function /\n * symbol / non-finite numbers — an artifact that cannot be unambiguously\n * serialized cannot be content-addressed, and coercing it would let two\n * different artifacts collide on one key.\n */\n\nimport { createHash } from 'node:crypto'\nimport { appendFileSync, existsSync, readFileSync } from 'node:fs'\nimport type { JudgeConfig, JudgeScore, Scenario } from './campaign/types'\n\n// ── canonical JSON + content hash ─────────────────────────────────────────\n\nfunction canonicalizeAt(value: unknown, path: string): string {\n if (value === null) return 'null'\n switch (typeof value) {\n case 'boolean':\n return value ? 'true' : 'false'\n case 'number':\n if (!Number.isFinite(value)) {\n throw new Error(\n `canonicalJson: non-finite number (${value}) at ${path} — ambiguity is an error, not a coercion`,\n )\n }\n return JSON.stringify(value)\n case 'string':\n return JSON.stringify(value)\n case 'undefined':\n case 'function':\n case 'symbol':\n throw new Error(\n `canonicalJson: ${typeof value} at ${path} — ambiguity is an error, not a coercion`,\n )\n case 'bigint':\n throw new Error(`canonicalJson: bigint at ${path} — not representable in JSON`)\n case 'object':\n break\n }\n const obj = value as Record<string, unknown>\n // Honor toJSON (Date → ISO string) before structural checks — without it a\n // Date would canonicalize to '{}' and every timestamp would collide.\n if (typeof obj.toJSON === 'function') {\n return canonicalizeAt((obj as { toJSON(): unknown }).toJSON(), path)\n }\n if (Array.isArray(obj)) {\n return `[${obj.map((item, i) => canonicalizeAt(item, `${path}[${i}]`)).join(',')}]`\n }\n if (obj instanceof Map || obj instanceof Set) {\n throw new Error(\n `canonicalJson: ${obj instanceof Map ? 'Map' : 'Set'} at ${path} — would serialize as '{}'; convert to a plain object/array first`,\n )\n }\n const keys = Object.keys(obj).sort()\n const parts = keys.map((k) => `${JSON.stringify(k)}:${canonicalizeAt(obj[k], `${path}.${k}`)}`)\n return `{${parts.join(',')}}`\n}\n\n/**\n * Stable JSON stringify: object keys sorted recursively, so two semantically\n * equal values produce byte-identical output regardless of key insertion\n * order. Throws on undefined / function / symbol / NaN / ±Infinity / bigint /\n * Map / Set — anything JSON.stringify would coerce or drop silently.\n *\n * Distinct from `pre-registration.ts`'s `canonicalize`/`hashJson`, which are\n * permissive (coercion allowed) and async (web-crypto). Use THIS pair when a\n * hash collision or silent coercion would corrupt a cache key or attestation.\n */\nexport function canonicalJson(value: unknown): string {\n return canonicalizeAt(value, '$')\n}\n\n/** Hex sha-256 over `canonicalJson(value)`. The content address used by the\n * verdict cache and report attestation. */\nexport function contentHash(value: unknown): string {\n return createHash('sha256').update(canonicalJson(value)).digest('hex')\n}\n\n// ── store contract ─────────────────────────────────────────────────────────\n\n/** Pluggable verdict store. Sync or async on both legs — `cachedJudge`\n * awaits the results either way. */\nexport interface VerdictCacheStore {\n get(key: string): Promise<JudgeScore | undefined> | JudgeScore | undefined\n set(key: string, score: JudgeScore): Promise<void> | void\n}\n\n/** Process-local Map-backed store. */\nexport function inMemoryVerdictCache(): VerdictCacheStore {\n const entries = new Map<string, JudgeScore>()\n return {\n get: (key) => entries.get(key),\n set: (key, score) => {\n entries.set(key, score)\n },\n }\n}\n\ninterface VerdictCacheLine {\n key: string\n score: JudgeScore\n}\n\nfunction parseCacheLine(line: string, path: string, lineNo: number): VerdictCacheLine {\n let parsed: unknown\n try {\n parsed = JSON.parse(line)\n } catch (err) {\n throw new Error(\n `fileVerdictCache: corrupt JSONL at ${path}:${lineNo} — ${err instanceof Error ? err.message : String(err)}`,\n )\n }\n const rec = parsed as Partial<VerdictCacheLine>\n if (\n typeof rec !== 'object' ||\n rec === null ||\n typeof rec.key !== 'string' ||\n typeof rec.score !== 'object' ||\n rec.score === null ||\n typeof rec.score.composite !== 'number' ||\n typeof rec.score.dimensions !== 'object'\n ) {\n throw new Error(\n `fileVerdictCache: invalid record shape at ${path}:${lineNo} — expected {key, score:{dimensions, composite, notes}}`,\n )\n }\n return rec as VerdictCacheLine\n}\n\n/**\n * JSONL-file-backed store: the full file is loaded into an in-memory index at\n * construction; every `set` appends one line synchronously (durable before\n * the verdict is returned). A corrupt or malformed line throws at load with\n * file:line — a skipped line would silently re-judge (cost) or, worse, mask\n * a half-written file that needs operator attention.\n */\nexport function fileVerdictCache(path: string): VerdictCacheStore {\n const entries = new Map<string, JudgeScore>()\n if (existsSync(path)) {\n const lines = readFileSync(path, 'utf8').split('\\n')\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n if (line === undefined || line.trim() === '') continue\n const rec = parseCacheLine(line, path, i + 1)\n entries.set(rec.key, rec.score)\n }\n }\n return {\n get: (key) => entries.get(key),\n set: (key, score) => {\n appendFileSync(path, `${JSON.stringify({ key, score })}\\n`, 'utf8')\n entries.set(key, score)\n },\n }\n}\n\n// ── cached judge wrapper ───────────────────────────────────────────────────\n\nexport interface VerdictCacheStats {\n hits: number\n misses: number\n}\n\nexport interface CachedJudgeOptions {\n /** REQUIRED — part of the cache key. Bump on any change to the judge's\n * prompt, model, ensemble, or scoring logic; silent judge upgrades must\n * never serve stale verdicts. */\n judgeVersion: string\n}\n\n/** The wrapped judge: same `JudgeConfig` seam, plus hit/miss observability. */\nexport type CachedJudge<TArtifact, TScenario extends Scenario = Scenario> = JudgeConfig<\n TArtifact,\n TScenario\n> & {\n stats(): VerdictCacheStats\n}\n\n/**\n * Wrap a `JudgeConfig` so repeat judgments of the same artifact are served\n * from the store instead of re-invoking `score()`. The wrapper is generic\n * over the judge's own type parameters and preserves `appliesTo` — it is a\n * drop-in replacement anywhere a `JudgeConfig` is accepted.\n *\n * A judge that throws is NOT cached: the error propagates and the next\n * attempt re-judges (caching a failure would pin a transient outage forever).\n */\nexport function cachedJudge<TArtifact, TScenario extends Scenario = Scenario>(\n judge: JudgeConfig<TArtifact, TScenario>,\n store: VerdictCacheStore,\n options: CachedJudgeOptions,\n): CachedJudge<TArtifact, TScenario> {\n if (typeof options.judgeVersion !== 'string' || options.judgeVersion.trim() === '') {\n throw new Error('cachedJudge: judgeVersion is required and must be a non-empty string')\n }\n const stats: VerdictCacheStats = { hits: 0, misses: 0 }\n const wrapped: CachedJudge<TArtifact, TScenario> = {\n name: judge.name,\n dimensions: judge.dimensions,\n judgeVersion: options.judgeVersion,\n async score(input) {\n const key = contentHash({\n artifact: canonicalJson(input.artifact),\n scenarioId: input.scenario.id,\n judgeName: judge.name,\n dimensions: judge.dimensions,\n judgeVersion: options.judgeVersion,\n })\n const cached = await store.get(key)\n if (cached !== undefined) {\n stats.hits += 1\n return cached\n }\n const score = await judge.score(input)\n await store.set(key, score)\n stats.misses += 1\n return score\n },\n stats: () => ({ ...stats }),\n }\n if (judge.appliesTo) wrapped.appliesTo = judge.appliesTo\n return wrapped\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,eAAe,OAAgB,MAAsB;CAC5D,IAAI,UAAU,MAAM,OAAO;CAC3B,QAAQ,OAAO,OAAf;EACE,KAAK,WACH,OAAO,QAAQ,SAAS;EAC1B,KAAK;GACH,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,MAAM,IAAI,MACR,qCAAqC,MAAM,OAAO,KAAK,yCACzD;GAEF,OAAO,KAAK,UAAU,KAAK;EAC7B,KAAK,UACH,OAAO,KAAK,UAAU,KAAK;EAC7B,KAAK;EACL,KAAK;EACL,KAAK,UACH,MAAM,IAAI,MACR,kBAAkB,OAAO,MAAM,MAAM,KAAK,yCAC5C;EACF,KAAK,UACH,MAAM,IAAI,MAAM,4BAA4B,KAAK,6BAA6B;EAChF,KAAK,UACH;CACJ;CACA,MAAM,MAAM;CAGZ,IAAI,OAAO,IAAI,WAAW,YACxB,OAAO,eA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AI,WAAW,IAAI,GAAG;EACpB,MAAM,QAAQ,aAAa,MAAM,MAAM,CAAC,CAAC,MAAM,IAAI;EACnD,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACrC,MAAM,OAAO,MAAM;GACnB,IAAI,SAAS,KAAA,KAAa,KAAK,KAAK,MAAM,IAAI;GAC9C,MAAM,MAAM,eAAe,MAAM,MAAM,IAAI,CAAC;GAC5C,QAAQ,IAAI,IAAI,KAAK,IAAI,KAAK;EAChC;CACF;CACA,OAAO;EACL,MAAM,QAAQ,QAAQ,IAAI,GAAG;EAC7B,MAAM,KAAK,UAAU;GACnB,eAAe,MAAM,GAAG,KAAK,UAAU;IAAE;IAAK;GAAM,CAAC,EAAE,KAAK,MAAM;GAClE,QAAQ,IAAI,KAAK,KAAK;EACxB;CACF;AACF"}
|
package/dist/wire/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as CostLedgerHandle } from "../cost-ledger-
|
|
2
|
-
import {
|
|
1
|
+
import { c as CostLedgerHandle } from "../cost-ledger-DbQdN3nO.js";
|
|
2
|
+
import { A as LlmClientOptions, N as LlmRouteRequirements } from "../types-Cx3YUh2r.js";
|
|
3
3
|
import { s as TraceStore } from "../store-CT9YIIve.js";
|
|
4
|
-
import {
|
|
4
|
+
import { m as FeedbackTrajectoryStore } from "../feedback-trajectory-juOozjAc.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { ServerType } from "@hono/node-server";
|
|
7
7
|
import { Hono } from "hono";
|
package/dist/wire/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/wire/schemas.ts","../../src/wire/handlers.ts","../../node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/specification-extension.d.ts","../../node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/oas-common.d.ts","../../node_modules/.pnpm/open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5B,sBAAsB,EAAE,aAAa;KACrC,uBAAuB,EAAE,aAAa;KACtC,qBAAqB,EAAE,aAAa;KACpC,yBAAyB,EAAE,aAAa;cAIvC,qBAAmB,EAAA;;;;;;GAcL,EAAA,KAAA;KAIf,kBAAkB,EAAE,aAAa;KACjC,cAAc,EAAE,aAAa;KAC7B,SAAS,EAAE,aAAa;KACxB,eAAe,EAAE,aAAa;KAC9B,cAAc,EAAE,aAAa;KAC7B,aAAa,EAAE,aAAa;KAC5B,sBAAsB,EAAE,aAAa;KACrC,kBAAkB,EAAE,aAAa;KACjC,gBAAgB,EAAE,aAAa;;;;;cAQ9B;;;;;iBAMG,WAAW,QAAQ;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/wire/schemas.ts","../../src/wire/handlers.ts","../../node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/specification-extension.d.ts","../../node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/oas-common.d.ts","../../node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/openapi31.d.ts","../../src/wire/openapi.ts","../../src/wire/rpc.ts","../../src/wire/rubrics.ts","../../src/wire/server.ts"],"x_google_ignoreList":[2,3,4],"mappings":";;;;;;;;cAmBa,uBAAqB,EAAA;;;;;;GAkBL,EAAA,KAAA;cAEhB,mBAAiB,EAAA;;;GAKL,EAAA,KAAA;cAIZ,cAAY,EAAA;;;;;;;;;;;;;;;;;;;GA6BL,EAAA,KAAA;cAIP,oBAAkB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAwBL,EAAA,KAAA;cAEb,mBAAiB,EAAA;;;;;;;;;GA6BL,EAAA,KAAA;cAIZ,kBAAgB,EAAA;;;;;;;;;;GAUL,EAAA,KAAA;cAEX,2BAAyB,EAAA;;;;;;;;;;;;GAIL,EAAA,KAAA;cAIpB,uBAAqB,EAAA;;;;;GAWL,EAAA,KAAA;cAEhB,sBAAo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EAC/B;EACA;EACA;EACA;EACA;;KAEQ;UACK,6BAA6B;EAC1C,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;;UAEa,yBAAyB;EACtC,WAAW;EACX,WAAW;EACX,oBAAoB;EACpB,oBAAoB;;UAEP,wBAAwB;EACrC;EACA;EACA;EACA,QAAQ;;UAEK,qBAAqB;GACjC;;UAEY;GACZ;;;;iBChRW,aAAa,yBAAyB;;;UCX5C;EACR;EACA;;UAGQ;EACR;;UAGQ;EACR;IAAS;IAAc;IAAiB;;;UAGzB;EACf,MAAM;EACN;EACA,uBAAuB;;iBAGH,YACpB,KAAK,YACL,UAAS,aACR,QAAQ,aAAa;;iBAsDF,WAAW,iBAAiB,UAAS,aAAkB;;iBAuBvD,YAAY,iBAAiB,UAAS,aAAkB;;;cCvBjE,iBAAiB,eAAe;;iBAK7B,iBAAiB,eAAe;;iBAKhC;;;;;;;;;;;;;UCtEC;;EAEf,SAAS;;EAET,MAAM;;EAEN;;EAEA,uBAAuB;;;;;;;;;;EAUvB;IACE,mBAAmB,4BAA4B;;;iBAMnC,UAAU,OAAM,mBAAqB,0BAAA,+BAAA;UA2IpC,qBAAqB;;EAEpC;;EAEA;;iBAGc,YAAY,OAAM,eAAoB;UAUrC;EACf,QAAQ;;;;EAIR;;EAEA;;EAEA,SAAS;;;;;;;iBAQK,iBAAiB,OAAM,eAAoB,QAAQ"}
|
package/dist/wire/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as TraceEventSchema, C as HealthResponseSchema, D as RubricDimensionSchema, E as ListRubricsResponseSchema, F as hashRubric, M as TracesIngestResponseSchema, N as VersionResponseSchema, O as RubricInfoSchema, P as WIRE_VERSION, S as FeedbackTrajectorySchema, T as JudgeResultSchema, _ as ErrorResponseSchema, a as runRpcBatch, b as FeedbackIngestResponseSchema, c as WireError, d as handleListRubrics, f as handleTracesIngest, g as listBuiltinRubrics, h as getBuiltinRubric, i as dispatchRpc, j as TracesIngestRequestSchema, k as RubricSchema, l as handleFeedbackIngest, m as BUILTIN_RUBRICS, n as startServer, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi, t as createApp, u as handleJudge, v as FailureModeSchema, w as JudgeRequestSchema, x as FeedbackLabelSchema, y as FeedbackAttemptSchema } from "../server-
|
|
1
|
+
import { A as TraceEventSchema, C as HealthResponseSchema, D as RubricDimensionSchema, E as ListRubricsResponseSchema, F as hashRubric, M as TracesIngestResponseSchema, N as VersionResponseSchema, O as RubricInfoSchema, P as WIRE_VERSION, S as FeedbackTrajectorySchema, T as JudgeResultSchema, _ as ErrorResponseSchema, a as runRpcBatch, b as FeedbackIngestResponseSchema, c as WireError, d as handleListRubrics, f as handleTracesIngest, g as listBuiltinRubrics, h as getBuiltinRubric, i as dispatchRpc, j as TracesIngestRequestSchema, k as RubricSchema, l as handleFeedbackIngest, m as BUILTIN_RUBRICS, n as startServer, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi, t as createApp, u as handleJudge, v as FailureModeSchema, w as JudgeRequestSchema, x as FeedbackLabelSchema, y as FeedbackAttemptSchema } from "../server-ulsOdrTI.js";
|
|
2
2
|
export { BUILTIN_RUBRICS, ErrorResponseSchema, FailureModeSchema, FeedbackAttemptSchema, FeedbackIngestResponseSchema, FeedbackLabelSchema, FeedbackTrajectorySchema, HealthResponseSchema, JudgeRequestSchema, JudgeResultSchema, ListRubricsResponseSchema, RubricDimensionSchema, RubricInfoSchema, RubricSchema, TraceEventSchema, TracesIngestRequestSchema, TracesIngestResponseSchema, VersionResponseSchema, WIRE_VERSION, WireError, buildOpenApi, createApp, dispatchRpc, getBuiltinRubric, handleFeedbackIngest, handleJudge, handleListRubrics, handleTracesIngest, handleVersion, hashRubric, listBuiltinRubrics, runRpcBatch, runRpcOnce, startServer, startServerAsync };
|
package/docs/charter.md
CHANGED
|
@@ -68,8 +68,8 @@ The audit refuted "built four times": traces imports this package's whole analys
|
|
|
68
68
|
One declarative unit — AgentProfile + evidence projection + reply contract + budget declaration — compiled to any engine, guarded by a byte-identity kill test against the bespoke arms.
|
|
69
69
|
6. **Verification without an answer key.**
|
|
70
70
|
A strategy family where the held-out suite is one member: proof kernels, invariant and metamorphic checks, independent derivation agreement, replication.
|
|
71
|
-
The type layer
|
|
72
|
-
What remains is execution: a real kernel checker bound through the port
|
|
71
|
+
The type layer exists (`docs/verification-strategies.md`) and the certifications are now produced, not just typed: every in-package verifier — the layer pipeline, the completion oracle, trace contracts, declarative oracles, trajectory replay, the repair grader — lands in `DefaultVerdict` with a certification naming its checker, strategy member, and unverified assumptions (`docs/verdicts.md`).
|
|
72
|
+
What remains is execution without an answer key: a real kernel checker bound through the port.
|
|
73
73
|
7. **Session forking as one primitive.**
|
|
74
74
|
Both halves exist unjoined: agent-runtime's `SandboxLineage.fork` (live checkpoint) and this package's trajectory replay (recorded prefix).
|
|
75
75
|
Braid branches are metadata pointers; the provider session is always new.
|
|
@@ -99,7 +99,7 @@ Wave 5 — science.
|
|
|
99
99
|
The verification-strategy family, proof kernels first.
|
|
100
100
|
Its pilot is live: two independent Lean formalizations of the BCWW (4.6) inequality — one from the paper, one from the campaign's artifacts — with a kernel-checked equivalence verdict and the campaign's counterexample checked against both.
|
|
101
101
|
A statement mismatch is a successful outcome; it is the formalization gap made visible.
|
|
102
|
-
The contract layer is shipped: the family
|
|
102
|
+
The contract layer is shipped: the family, checker port, and blind two-arm equivalence protocol (`src/verification-strategy.ts`) and verdict certifications (`src/verdict.ts`) — see `docs/verification-strategies.md` for the family, each member's failure mode, and the pilot as the worked example.
|
|
103
103
|
|
|
104
104
|
## Standing principles (each earned by a measured burn)
|
|
105
105
|
|