@tangle-network/agent-eval 0.144.5 → 0.144.7
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 +30 -0
- package/README.md +2 -0
- package/dist/{benchmark-Fmo42QVE.d.ts → agent-profile-CgDTo40f.d.ts} +91 -4
- package/dist/agent-profile-CgDTo40f.d.ts.map +1 -0
- package/dist/{agent-profile-cell-Cw0PVwDr.d.ts → agent-profile-cell-BOP-iA9Q.d.ts} +2 -2
- package/dist/{agent-profile-cell-Cw0PVwDr.d.ts.map → agent-profile-cell-BOP-iA9Q.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +471 -89
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +24 -5
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-DWIvOAGk.js → analyze-runs-BNNK7irB.js} +3 -3
- package/dist/{analyze-runs-DWIvOAGk.js.map → analyze-runs-BNNK7irB.js.map} +1 -1
- package/dist/{baseline-D_fT6277.d.ts → baseline-CavEbRyH.d.ts} +2 -23
- package/dist/baseline-CavEbRyH.d.ts.map +1 -0
- package/dist/{benchmark-command-CA_NFOmy.js → benchmark-command-BCafwNrf.js} +664 -605
- package/dist/benchmark-command-BCafwNrf.js.map +1 -0
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +1 -1
- package/dist/{benchmarks-CWbsj0t4.js → benchmarks-CDSolHq7.js} +4 -4
- package/dist/{benchmarks-CWbsj0t4.js.map → benchmarks-CDSolHq7.js.map} +1 -1
- package/dist/campaign/index.d.ts +8 -6
- package/dist/campaign/index.js +5 -3
- package/dist/{campaign-ClpnD7Ug.js → campaign-Tdy3h62h.js} +17 -301
- package/dist/campaign-Tdy3h62h.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{client-DAb7MWtL.d.ts → client-DjXROWpx.d.ts} +4 -4
- package/dist/{client-DAb7MWtL.d.ts.map → client-DjXROWpx.d.ts.map} +1 -1
- package/dist/{completion-verifier-VvpHRu78.d.ts → completion-verifier-foUCLif_.d.ts} +6 -6
- package/dist/{completion-verifier-VvpHRu78.d.ts.map → completion-verifier-foUCLif_.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +11 -10
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +7 -6
- package/dist/contract/index.js.map +1 -1
- package/dist/control.d.ts +2 -2
- package/dist/control.js +1 -1
- package/dist/{cost-ledger-FuQvHxPm.d.ts → cost-ledger-Bv_e8XHY.d.ts} +2 -2
- package/dist/{cost-ledger-FuQvHxPm.d.ts.map → cost-ledger-Bv_e8XHY.d.ts.map} +1 -1
- package/dist/counterfactual-CWPTrMH7.js +126 -0
- package/dist/counterfactual-CWPTrMH7.js.map +1 -0
- package/dist/counterfactual-CxmxAONP.d.ts +72 -0
- package/dist/counterfactual-CxmxAONP.d.ts.map +1 -0
- package/dist/{dataset-v_Y5902-.d.ts → dataset-C8xaLXdY.d.ts} +2 -2
- package/dist/{dataset-v_Y5902-.d.ts.map → dataset-C8xaLXdY.d.ts.map} +1 -1
- package/dist/{default-registry-BwbZ9N9v.d.ts → default-registry-BZhStdjl.d.ts} +6 -5
- package/dist/default-registry-BZhStdjl.d.ts.map +1 -0
- package/dist/{default-registry-RLNNoeEP.js → default-registry-BaQXW1Ow.js} +2 -2
- package/dist/{default-registry-RLNNoeEP.js.map → default-registry-BaQXW1Ow.js.map} +1 -1
- package/dist/{dspy-rlm-engine-19FQEMBK.js → dspy-rlm-engine-BiN49gK6.js} +4 -3
- package/dist/{dspy-rlm-engine-19FQEMBK.js.map → dspy-rlm-engine-BiN49gK6.js.map} +1 -1
- package/dist/{tool-groups-ByZiqpVk.d.ts → engine-nB64f48I.d.ts} +21 -34
- package/dist/engine-nB64f48I.d.ts.map +1 -0
- package/dist/{errors-DkfjIDvD.d.ts → errors-CKPfb2aH.d.ts} +2 -2
- package/dist/{errors-DkfjIDvD.d.ts.map → errors-CKPfb2aH.d.ts.map} +1 -1
- package/dist/errors-D-LKuDhb.js.map +1 -1
- package/dist/{eval-campaign-lZcDIwQM.js → eval-campaign-DNjCvAm-.js} +7 -6
- package/dist/{eval-campaign-lZcDIwQM.js.map → eval-campaign-DNjCvAm-.js.map} +1 -1
- package/dist/{exact-types-BQ7W90C4.d.ts → exact-types-Djvzosly.d.ts} +2 -2
- package/dist/{exact-types-BQ7W90C4.d.ts.map → exact-types-Djvzosly.d.ts.map} +1 -1
- package/dist/exec-BLtYZdWo.js +49 -0
- package/dist/exec-BLtYZdWo.js.map +1 -0
- package/dist/experiment/index.d.ts +802 -0
- package/dist/experiment/index.d.ts.map +1 -0
- package/dist/experiment/index.js +1108 -0
- package/dist/experiment/index.js.map +1 -0
- package/dist/experiment-tracker-CnRICnMl.js +500 -0
- package/dist/experiment-tracker-CnRICnMl.js.map +1 -0
- package/dist/experiment-tracker-IMntXr6J.d.ts +299 -0
- package/dist/experiment-tracker-IMntXr6J.d.ts.map +1 -0
- package/dist/{external-optimizer-contracts-CdmX2K2S.d.ts → external-optimizer-contracts-CZuJNcT5.d.ts} +3 -3
- package/dist/{external-optimizer-contracts-CdmX2K2S.d.ts.map → external-optimizer-contracts-CZuJNcT5.d.ts.map} +1 -1
- package/dist/{feedback-trajectory-WK7x4mhy.d.ts → feedback-trajectory-Rh280oXo.d.ts} +4 -4
- package/dist/{feedback-trajectory-WK7x4mhy.d.ts.map → feedback-trajectory-Rh280oXo.d.ts.map} +1 -1
- package/dist/fuzz.d.ts +2 -2
- package/dist/hosted/index.d.ts +3 -3
- package/dist/{index-BZUe-ODI.d.ts → index-BZ3-y4YL.d.ts} +3 -3
- package/dist/{index-BZUe-ODI.d.ts.map → index-BZ3-y4YL.d.ts.map} +1 -1
- package/dist/{index-DSC51roc.d.ts → index-C3ssXVLv.d.ts} +2 -2
- package/dist/{index-DSC51roc.d.ts.map → index-C3ssXVLv.d.ts.map} +1 -1
- package/dist/{index-CsuAo2-J.d.ts → index-C5HOo4ZF2.d.ts} +5 -5
- package/dist/index-C5HOo4ZF2.d.ts.map +1 -0
- package/dist/{index-DEb46kc6.d.ts → index-CvSN3IG1.d.ts} +2 -2
- package/dist/{index-DEb46kc6.d.ts.map → index-CvSN3IG1.d.ts.map} +1 -1
- package/dist/{index-CNOCxBLh.d.ts → index-CvXXlyz7.d.ts} +3 -3
- package/dist/{index-CNOCxBLh.d.ts.map → index-CvXXlyz7.d.ts.map} +1 -1
- package/dist/{index-DGIzNtRv.d.ts → index-CwDrUMe0.d.ts} +3 -3
- package/dist/{index-DGIzNtRv.d.ts.map → index-CwDrUMe0.d.ts.map} +1 -1
- package/dist/{index-CpxZSlB7.d.ts → index-Sh2I0DRc.d.ts} +15 -649
- package/dist/index-Sh2I0DRc.d.ts.map +1 -0
- package/dist/index.d.ts +252 -451
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +271 -751
- package/dist/index.js.map +1 -1
- package/dist/{insight-report-D5m1z0_n.d.ts → insight-report-C6h6F_4L.d.ts} +4 -4
- package/dist/{insight-report-D5m1z0_n.d.ts.map → insight-report-C6h6F_4L.d.ts.map} +1 -1
- package/dist/{integrity-DRXobPEs.d.ts → integrity-BuqEKu-x.d.ts} +3 -3
- package/dist/{integrity-DRXobPEs.d.ts.map → integrity-BuqEKu-x.d.ts.map} +1 -1
- package/dist/integrity-MLzHOfV9.js +141 -0
- package/dist/integrity-MLzHOfV9.js.map +1 -0
- package/dist/kind-factory-BHIgPmzS.js.map +1 -1
- package/dist/ledger-core/index.d.ts +1 -1
- package/dist/{llm-client-D3EoChAU.js → llm-client-DzvMUsS_.js} +310 -10
- package/dist/llm-client-DzvMUsS_.js.map +1 -0
- package/dist/matrix/index.d.ts +2 -2
- package/dist/meta-eval/index.d.ts +2 -2
- package/dist/{mint-DD-0oQTA.js → mint-CGEkzPLf.js} +2 -2
- package/dist/{mint-DD-0oQTA.js.map → mint-CGEkzPLf.js.map} +1 -1
- package/dist/{multi-layer-verifier-BHY1gWAc.d.ts → multi-layer-verifier-DnAqwl0h.d.ts} +2 -2
- package/dist/{multi-layer-verifier-BHY1gWAc.d.ts.map → multi-layer-verifier-DnAqwl0h.d.ts.map} +1 -1
- package/dist/multishot/index.d.ts +3 -3
- package/dist/openapi.json +1 -1
- package/dist/paired-promotion-decision-B6zJ3gYM.d.ts +114 -0
- package/dist/paired-promotion-decision-B6zJ3gYM.d.ts.map +1 -0
- package/dist/pipelines/index.d.ts +2 -1
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pre-registration-DakwTRXk.js +96 -0
- package/dist/pre-registration-DakwTRXk.js.map +1 -0
- package/dist/prime-bridge-transport-6feEglLf.d.ts +49 -0
- package/dist/prime-bridge-transport-6feEglLf.d.ts.map +1 -0
- package/dist/prime-protocol-BfSalTfR.js +453 -0
- package/dist/prime-protocol-BfSalTfR.js.map +1 -0
- package/dist/profile-cell.d.ts +1 -1
- package/dist/profile-cell.js +242 -1
- package/dist/profile-cell.js.map +1 -0
- package/dist/promotion-policy-ChWhTDBH.d.ts +289 -0
- package/dist/promotion-policy-ChWhTDBH.d.ts.map +1 -0
- package/dist/promotion-policy-CrLrmys8.js +682 -0
- package/dist/promotion-policy-CrLrmys8.js.map +1 -0
- package/dist/{propose-review-control-BciUCZoh.js → propose-review-control-qgWLA6E9.js} +2 -2
- package/dist/{propose-review-control-BciUCZoh.js.map → propose-review-control-qgWLA6E9.js.map} +1 -1
- package/dist/{release-report-BZRWdq_t.d.ts → release-report-CI8uisI1.d.ts} +4 -4
- package/dist/{release-report-BZRWdq_t.d.ts.map → release-report-CI8uisI1.d.ts.map} +1 -1
- package/dist/{release-report-Sl0xfkFv.js → release-report-Dy39cbFF.js} +3 -3
- package/dist/{release-report-Sl0xfkFv.js.map → release-report-Dy39cbFF.js.map} +1 -1
- package/dist/{replay-B7S7Pdbw.d.ts → replay-DFf-teiC.d.ts} +8 -7
- package/dist/replay-DFf-teiC.d.ts.map +1 -0
- package/dist/{replay-GW61ezMW.js → replay-DyBLaKFc.js} +3 -3
- package/dist/{replay-GW61ezMW.js.map → replay-DyBLaKFc.js.map} +1 -1
- package/dist/reporting.d.ts +4 -4
- package/dist/reporting.js +2 -2
- package/dist/{researcher-BSiCoM1s.d.ts → researcher-BoaxeCzP.d.ts} +6 -6
- package/dist/{researcher-BSiCoM1s.d.ts.map → researcher-BoaxeCzP.d.ts.map} +1 -1
- package/dist/{reward-hacking-CyuzxKly.js → reward-hacking-B2tPL9a3.js} +12 -3
- package/dist/reward-hacking-B2tPL9a3.js.map +1 -0
- package/dist/{reward-hacking-DFgkEY4p.d.ts → reward-hacking-Cf1PtEOz.d.ts} +34 -4
- package/dist/reward-hacking-Cf1PtEOz.d.ts.map +1 -0
- package/dist/rl.d.ts +19 -9
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +16 -7
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +2 -2
- package/dist/rollout/index.js +2 -2
- package/dist/{rollout-C2fD1cf4.js → rollout-2ECTXb2N.js} +2 -2
- package/dist/{rollout-C2fD1cf4.js.map → rollout-2ECTXb2N.js.map} +1 -1
- package/dist/{rubric-predictive-validity-C4r4Y-q8.d.ts → rubric-predictive-validity-9qAwzkZm.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-C4r4Y-q8.d.ts.map → rubric-predictive-validity-9qAwzkZm.d.ts.map} +1 -1
- package/dist/{run-evidence-j5Ynww6L.d.ts → run-evidence-BDFFai9R.d.ts} +3 -3
- package/dist/{run-evidence-j5Ynww6L.d.ts.map → run-evidence-BDFFai9R.d.ts.map} +1 -1
- package/dist/{run-record-ooo9FWns.d.ts → run-record-DdSa93_W.d.ts} +4 -4
- package/dist/{run-record-ooo9FWns.d.ts.map → run-record-DdSa93_W.d.ts.map} +1 -1
- package/dist/{run-record-CWN8-VsV.js → run-record-DqOw5X6_.js} +2 -2
- package/dist/{run-record-CWN8-VsV.js.map → run-record-DqOw5X6_.js.map} +1 -1
- package/dist/{schema-Cef2cFmb.d.ts → schema-Cef2cFmb2.d.ts} +1 -1
- package/dist/schema-Cef2cFmb2.d.ts.map +1 -0
- package/dist/{semantic-concept-judge-DKRtp2sY.js → semantic-concept-judge-Bmrq6yqU.js} +2 -2
- package/dist/{semantic-concept-judge-DKRtp2sY.js.map → semantic-concept-judge-Bmrq6yqU.js.map} +1 -1
- package/dist/sequential-D-BLJBKU.js +299 -0
- package/dist/sequential-D-BLJBKU.js.map +1 -0
- package/dist/{server-Df00sdwz.js → server-iu0ede49.js} +2 -2
- package/dist/{server-Df00sdwz.js.map → server-iu0ede49.js.map} +1 -1
- package/dist/{single-run-lock-D5iN0Xzb.js → single-run-lock-BMQEv1wG.js} +7 -161
- package/dist/single-run-lock-BMQEv1wG.js.map +1 -0
- package/dist/{skill-usage-DUvvudWR.d.ts → skill-usage-CJlWEUFt.d.ts} +11 -11
- package/dist/{skill-usage-DUvvudWR.d.ts.map → skill-usage-CJlWEUFt.d.ts.map} +1 -1
- package/dist/{skillopt-optimization-method-CGz9ywhM.d.ts → skillopt-optimization-method-BO7NAl3b.d.ts} +11 -297
- package/dist/skillopt-optimization-method-BO7NAl3b.d.ts.map +1 -0
- package/dist/{skillopt-optimization-method-C4FX42dy.js → skillopt-optimization-method-CQwZ-ZX8.js} +8 -652
- package/dist/skillopt-optimization-method-CQwZ-ZX8.js.map +1 -0
- package/dist/statistical-heldout-Dn9ruizm.d.ts +555 -0
- package/dist/statistical-heldout-Dn9ruizm.d.ts.map +1 -0
- package/dist/{statistics-B4u_CiFd.d.ts → statistics-D6Uebe_4.d.ts} +2 -2
- package/dist/{statistics-B4u_CiFd.d.ts.map → statistics-D6Uebe_4.d.ts.map} +1 -1
- package/dist/steps-BArUxhna.d.ts +51 -0
- package/dist/steps-BArUxhna.d.ts.map +1 -0
- package/dist/{integrity-fdt8XPAv.js → store-DNe_Uv1Q.js} +2 -140
- package/dist/store-DNe_Uv1Q.js.map +1 -0
- package/dist/{summary-report-BOM6dfP7.d.ts → summary-report-DuUS_i7W.d.ts} +4 -115
- package/dist/summary-report-DuUS_i7W.d.ts.map +1 -0
- package/dist/{summary-report-9A5y7EsK.js → summary-report-Lf-5I7xh.js} +2 -2
- package/dist/{summary-report-9A5y7EsK.js.map → summary-report-Lf-5I7xh.js.map} +1 -1
- package/dist/supervisor-run/index.d.ts +2 -2
- package/dist/supervisor-run/index.js +1 -1
- package/dist/{supervisor-run-DiyQVczd.js → supervisor-run-D_sokXcO.js} +32 -8
- package/dist/{supervisor-run-DiyQVczd.js.map → supervisor-run-D_sokXcO.js.map} +1 -1
- package/dist/tool-groups-DIVBnJyl.d.ts +28 -0
- package/dist/tool-groups-DIVBnJyl.d.ts.map +1 -0
- package/dist/trace-repair/index.d.ts +2102 -0
- package/dist/trace-repair/index.d.ts.map +1 -0
- package/dist/trace-repair/index.js +3878 -0
- package/dist/trace-repair/index.js.map +1 -0
- package/dist/traces.d.ts +6 -6
- package/dist/traces.js +3 -2
- package/dist/trajectory-YC15QDYQ.d.ts +24 -0
- package/dist/trajectory-YC15QDYQ.d.ts.map +1 -0
- package/dist/trajectory-replay/index.d.ts +781 -0
- package/dist/trajectory-replay/index.d.ts.map +1 -0
- package/dist/trajectory-replay/index.js +2103 -0
- package/dist/trajectory-replay/index.js.map +1 -0
- package/dist/{types-BjMFz88h.d.ts → types-D216SgwM.d.ts} +228 -9
- package/dist/types-D216SgwM.d.ts.map +1 -0
- package/dist/{types-yLK8gXE9.d.ts → types-D4mog56g.d.ts} +2 -2
- package/dist/{types-yLK8gXE9.d.ts.map → types-D4mog56g.d.ts.map} +1 -1
- package/dist/{types-CZt1PBIk.d.ts → types-DF_Udrp-.d.ts} +54 -5
- package/dist/{types-CZt1PBIk.d.ts.map → types-DF_Udrp-.d.ts.map} +1 -1
- package/dist/{types-Dcoaqcsc.d.ts → types-DYuNHo9R.d.ts} +5 -5
- package/dist/{types-Dcoaqcsc.d.ts.map → types-DYuNHo9R.d.ts.map} +1 -1
- package/dist/usage-receipt-EVI8B8Xu.js.map +1 -1
- package/dist/verdict-DExhxfgR.d.ts +201 -0
- package/dist/verdict-DExhxfgR.d.ts.map +1 -0
- package/dist/verdict-cache-BCcOh0kF.js +159 -0
- package/dist/verdict-cache-BCcOh0kF.js.map +1 -0
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/building-doctrine.md +15 -0
- package/docs/charter.md +112 -0
- package/docs/experiment.md +104 -0
- package/docs/prime-analyst.md +1 -0
- package/docs/trace-analysis.md +26 -0
- package/docs/trace-repair-admission.md +194 -0
- package/docs/trace-repair-analyst-arms.md +121 -0
- package/docs/trace-repair-continuation.md +107 -0
- package/docs/trace-repair-grader.md +163 -0
- package/docs/trajectory-replay.md +110 -0
- package/docs/verification-strategies.md +103 -0
- package/package.json +21 -4
- package/dist/agent-profile-cell-CbfBm2g6.js +0 -335
- package/dist/agent-profile-cell-CbfBm2g6.js.map +0 -1
- package/dist/baseline-D_fT6277.d.ts.map +0 -1
- package/dist/benchmark-Fmo42QVE.d.ts.map +0 -1
- package/dist/benchmark-command-CA_NFOmy.js.map +0 -1
- package/dist/campaign-ClpnD7Ug.js.map +0 -1
- package/dist/default-registry-BwbZ9N9v.d.ts.map +0 -1
- package/dist/index-CpxZSlB7.d.ts.map +0 -1
- package/dist/index-CsuAo2-J.d.ts.map +0 -1
- package/dist/integrity-fdt8XPAv.js.map +0 -1
- package/dist/llm-client-D3EoChAU.js.map +0 -1
- package/dist/replay-B7S7Pdbw.d.ts.map +0 -1
- package/dist/reward-hacking-CyuzxKly.js.map +0 -1
- package/dist/reward-hacking-DFgkEY4p.d.ts.map +0 -1
- package/dist/schema-Cef2cFmb.d.ts.map +0 -1
- package/dist/single-run-lock-D5iN0Xzb.js.map +0 -1
- package/dist/skillopt-optimization-method-C4FX42dy.js.map +0 -1
- package/dist/skillopt-optimization-method-CGz9ywhM.d.ts.map +0 -1
- package/dist/summary-report-BOM6dfP7.d.ts.map +0 -1
- package/dist/tool-groups-ByZiqpVk.d.ts.map +0 -1
- package/dist/types-BjMFz88h.d.ts.map +0 -1
- package/dist/verdict-Dps8_okt.d.ts +0 -37
- package/dist/verdict-Dps8_okt.d.ts.map +0 -1
|
@@ -0,0 +1,201 @@
|
|
|
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
|
+
* and the port shape only. A checker is an injected executable boundary
|
|
10
|
+
* that returns a typed outcome, so a consumer binds its own kernel (a Lean
|
|
11
|
+
* toolchain, a metamorphic harness, a replication runner) and this package
|
|
12
|
+
* never chooses one. Instruments, never methods.
|
|
13
|
+
*
|
|
14
|
+
* Full family doc, per-member failure modes in prose, and the BCWW pilot
|
|
15
|
+
* worked example: docs/verification-strategies.md.
|
|
16
|
+
*
|
|
17
|
+
* Leaf module: no imports from this package. `src/verdict.ts` and
|
|
18
|
+
* `src/rl/verifiable-reward.ts` both build on these types.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* One member of the verification-strategy family.
|
|
22
|
+
*
|
|
23
|
+
* Every member has a documented failure mode — the specific way it can
|
|
24
|
+
* certify a wrong result. A consumer that reads a certification must weigh
|
|
25
|
+
* the member's failure mode, not treat "certified" as one bit.
|
|
26
|
+
*
|
|
27
|
+
* - `'compile'` — typecheck / build / lint passed. Deterministic.
|
|
28
|
+
* Failure mode: code that compiles is not code that is correct; the
|
|
29
|
+
* weakest deterministic member.
|
|
30
|
+
* - `'test'` — unit / integration / held-out suite pass-rate. Deterministic.
|
|
31
|
+
* Failure mode: assumes an answer key exists; certifies nothing outside
|
|
32
|
+
* the suite's coverage, and a stubbed integration reports green.
|
|
33
|
+
* - `'schema'` — structured output validates. Deterministic.
|
|
34
|
+
* Failure mode: shape is not meaning; a well-formed wrong answer passes.
|
|
35
|
+
* - `'sandbox'` — sandbox execution exit code. Deterministic.
|
|
36
|
+
* Failure mode: an exit code compresses the whole run to one bit; a
|
|
37
|
+
* faked success exits 0.
|
|
38
|
+
* - `'judge'` — LLM judge score. Probabilistic.
|
|
39
|
+
* Failure mode: drifts across model versions and is Goodhart-gameable by
|
|
40
|
+
* the graded policy.
|
|
41
|
+
* - `'composite'` — weighted blend across members. Determinism inherited
|
|
42
|
+
* from its members.
|
|
43
|
+
* Failure mode: scalar collapse — the blend hides which member carried
|
|
44
|
+
* the score and which failed.
|
|
45
|
+
* - `'proof-kernel'` — a proof assistant's kernel accepted a formal proof.
|
|
46
|
+
* Deterministic.
|
|
47
|
+
* Failure mode: the formalization gap. The kernel certifies the formal
|
|
48
|
+
* statement, never that the formal statement matches the informal claim;
|
|
49
|
+
* a proved theorem about the wrong statement is a wrong result with a
|
|
50
|
+
* valid certificate. Discharge it with the blind statement-equivalence
|
|
51
|
+
* protocol (`src/equivalence-check.ts`).
|
|
52
|
+
* - `'invariant'` — invariant / metamorphic properties held on the result.
|
|
53
|
+
* Deterministic.
|
|
54
|
+
* Failure mode: weak invariants pass everything. An invariant set earns
|
|
55
|
+
* weight only through seeded-bug calibration — a mutation the set
|
|
56
|
+
* provably rejects; an uncalibrated set is a rubber stamp.
|
|
57
|
+
* - `'replication'` — an independent re-execution reproduced the result
|
|
58
|
+
* from pinned inputs. Deterministic given the pins.
|
|
59
|
+
* Failure mode: replication re-runs the method, so it catches
|
|
60
|
+
* nondeterminism and environment drift, never a methodological error the
|
|
61
|
+
* method itself carries.
|
|
62
|
+
* - `'agreement'` — independently-derived results agree. Probabilistic.
|
|
63
|
+
* Failure mode: the shared blind spot. Derivers that share training
|
|
64
|
+
* corpora, priors, or the same misread of the source agree for the same
|
|
65
|
+
* wrong reason; the blindness provenance of each arm is what the
|
|
66
|
+
* certificate rests on.
|
|
67
|
+
*/
|
|
68
|
+
type VerificationStrategySource = 'compile' | 'test' | 'schema' | 'sandbox' | 'judge' | 'composite' | 'proof-kernel' | 'invariant' | 'replication' | 'agreement';
|
|
69
|
+
/**
|
|
70
|
+
* What a strategy member can honestly claim about its outcomes.
|
|
71
|
+
*
|
|
72
|
+
* `determinism: 'inherited'` exists only for `'composite'`: a blend takes
|
|
73
|
+
* the class of its members. The reward axis stays binary
|
|
74
|
+
* (`VerifiableReward.determinism`); this registry describes the family,
|
|
75
|
+
* it never scores a run.
|
|
76
|
+
*/
|
|
77
|
+
interface VerificationStrategyProfile {
|
|
78
|
+
/** Determinism class a well-formed checker of this member can claim. */
|
|
79
|
+
determinism: 'deterministic' | 'probabilistic' | 'inherited';
|
|
80
|
+
/** The documented way this member certifies a wrong result. */
|
|
81
|
+
failureMode: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The family registry. `Record` over the union keeps it exhaustive: adding
|
|
85
|
+
* a member to `VerificationStrategySource` without a profile here fails to
|
|
86
|
+
* compile. The failure mode travels with the taxonomy so a reader of a
|
|
87
|
+
* certification can surface it without this package's docs at hand.
|
|
88
|
+
*/
|
|
89
|
+
declare const VERIFICATION_STRATEGIES: Record<VerificationStrategySource, VerificationStrategyProfile>;
|
|
90
|
+
/** Every family member, derived from the registry so it cannot drift. */
|
|
91
|
+
declare const VERIFICATION_STRATEGY_SOURCES: readonly VerificationStrategySource[];
|
|
92
|
+
/**
|
|
93
|
+
* Exact identity of the thing that checked. "lean4 4.33.0 with Mathlib
|
|
94
|
+
* db584cd6d46c" and "lean4, some version" are different certificates: the
|
|
95
|
+
* first is re-runnable, the second is a story.
|
|
96
|
+
*/
|
|
97
|
+
interface CheckerIdentity {
|
|
98
|
+
/** Toolchain or model name, e.g. `'lean4'` or a judge model id. */
|
|
99
|
+
name: string;
|
|
100
|
+
/** Exact version or snapshot, e.g. `'4.33.0'` or a model snapshot id. */
|
|
101
|
+
version: string;
|
|
102
|
+
/**
|
|
103
|
+
* Content pins the version alone does not capture, e.g.
|
|
104
|
+
* `{ mathlib: 'db584cd6d46c' }`. Keyed by dependency name.
|
|
105
|
+
*/
|
|
106
|
+
pins?: Record<string, string>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Typed outcome of an external checker call. Callers MUST inspect
|
|
110
|
+
* `succeeded` before touching `value`; a failed check keeps its full error
|
|
111
|
+
* text instead of collapsing to null.
|
|
112
|
+
*/
|
|
113
|
+
type CheckerOutcome<Result> = {
|
|
114
|
+
succeeded: true;
|
|
115
|
+
value: Result;
|
|
116
|
+
} | {
|
|
117
|
+
succeeded: false;
|
|
118
|
+
error: string;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The port shape every strategy binds through: an injected executable
|
|
122
|
+
* boundary. This package defines the port and refuses to ship any
|
|
123
|
+
* implementation behind it — the consumer binds its own kernel, invariant
|
|
124
|
+
* harness, replication runner, or judge, and the binding carries its own
|
|
125
|
+
* identity and determinism claim.
|
|
126
|
+
*
|
|
127
|
+
* A checker that ran but could not decide returns
|
|
128
|
+
* `{ succeeded: false, error }` with the reason; `succeeded: true` is
|
|
129
|
+
* reserved for a discharged check.
|
|
130
|
+
*/
|
|
131
|
+
interface StrategyChecker<Input, Result> {
|
|
132
|
+
/** Which family member this checker discharges obligations for. */
|
|
133
|
+
strategy: VerificationStrategySource;
|
|
134
|
+
identity: CheckerIdentity;
|
|
135
|
+
/** Determinism class this checker claims for its outcomes. */
|
|
136
|
+
determinism: 'deterministic' | 'probabilistic';
|
|
137
|
+
check(input: Input): Promise<CheckerOutcome<Result>>;
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/verdict.d.ts
|
|
141
|
+
/**
|
|
142
|
+
* What certified a verdict — the epistemics a bare `valid` + `score` pair
|
|
143
|
+
* cannot carry. A kernel-checked proof and an LLM judge can produce the
|
|
144
|
+
* same `{ valid: true, score: 1 }`; this record is what tells them apart.
|
|
145
|
+
*
|
|
146
|
+
* Every field is required on purpose. A certification without a checker
|
|
147
|
+
* identity or an evidence digest is exactly the unverifiable claim this
|
|
148
|
+
* record exists to kill.
|
|
149
|
+
*/
|
|
150
|
+
interface VerdictCertification {
|
|
151
|
+
/**
|
|
152
|
+
* Which verification-strategy member produced the certificate. Each
|
|
153
|
+
* member's failure mode is documented on the family type and in
|
|
154
|
+
* `VERIFICATION_STRATEGIES` (src/verification-strategy.ts).
|
|
155
|
+
*/
|
|
156
|
+
strategy: VerificationStrategySource;
|
|
157
|
+
/**
|
|
158
|
+
* Exact checker identity, e.g. `{ name: 'lean4', version: '4.33.0',
|
|
159
|
+
* pins: { mathlib: 'db584cd6d46c' } }` for a kernel, or a judge model
|
|
160
|
+
* id + snapshot for a judge.
|
|
161
|
+
*/
|
|
162
|
+
checker: CheckerIdentity;
|
|
163
|
+
/**
|
|
164
|
+
* Every step the certificate rests on that the checker did NOT verify,
|
|
165
|
+
* e.g. 'diagonal embedding argued in prose' or 'agreement arms share
|
|
166
|
+
* training-corpus blind spots'. An empty array is the producer's
|
|
167
|
+
* explicit, auditable claim that there are none — it is not a default.
|
|
168
|
+
*/
|
|
169
|
+
assumptions: string[];
|
|
170
|
+
/** Digest (e.g. sha256) of the evidence artifact the checker consumed or produced. */
|
|
171
|
+
evidenceDigest: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Minimal verdict shape — `valid` + `score` are required; `scores` +
|
|
175
|
+
* `notes` are optional surface. Validators that need richer shapes
|
|
176
|
+
* parameterise `Validator<Output, MyVerdict>` with their own type.
|
|
177
|
+
*
|
|
178
|
+
* Need structured extras? Extend DefaultVerdict with typed fields — never
|
|
179
|
+
* serialize extras into `notes`.
|
|
180
|
+
*/
|
|
181
|
+
interface DefaultVerdict {
|
|
182
|
+
/** Whether the output meets the validator's pass criteria. */
|
|
183
|
+
valid: boolean;
|
|
184
|
+
/** Aggregate score in [0, 1]. Drivers use this for winner selection. */
|
|
185
|
+
score: number;
|
|
186
|
+
/** Per-dimension scores. Free-form; weighted into `score` by the validator. */
|
|
187
|
+
scores?: Record<string, number>;
|
|
188
|
+
/** Human-readable rationale; surfaces in trace + final-result `winner.verdict`. */
|
|
189
|
+
notes?: string;
|
|
190
|
+
/**
|
|
191
|
+
* What certified this verdict, when anything did. Absent = uncertified:
|
|
192
|
+
* scored, but no strategy vouches for it. A consumer that cares reads
|
|
193
|
+
* `certification.strategy` to tell a kernel-checked verdict from a
|
|
194
|
+
* judge-scored one; a consumer that does not read it sees the exact
|
|
195
|
+
* verdict it always saw.
|
|
196
|
+
*/
|
|
197
|
+
certification?: VerdictCertification;
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
export { StrategyChecker as a, VerificationStrategyProfile as c, CheckerOutcome as i, VerificationStrategySource as l, VerdictCertification as n, VERIFICATION_STRATEGIES as o, CheckerIdentity as r, VERIFICATION_STRATEGY_SOURCES as s, DefaultVerdict as t };
|
|
201
|
+
//# sourceMappingURL=verdict-DExhxfgR.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdict-DExhxfgR.d.ts","names":[],"sources":["../src/verification-strategy.ts","../src/verdict.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmEY;;;;;;;;;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;;;;;;;;;;;;;UC5K7B;;;;;;EAMf,UAAU;;;;;;EAMV,SAAS;;;;;;;EAOT;;EAEA;;;;;;;;;;UAWe;;EAEf;;EAEA;;EAEA,SAAS;;EAET;;;;;;;;EAQA,gBAAgB"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
//#region src/verdict-cache.ts
|
|
4
|
+
/**
|
|
5
|
+
* Content-addressed judge-verdict caching.
|
|
6
|
+
*
|
|
7
|
+
* LAW: cache JUDGE VERDICTS only — judging the same artifact with the same
|
|
8
|
+
* judge+rubric is pure. NEVER cache agent rollouts. (A router that cached
|
|
9
|
+
* identical fanout prompts silently destroyed best-of-N diversity; rollout
|
|
10
|
+
* caching reintroduces that failure class. Judging has no diversity to
|
|
11
|
+
* destroy — same artifact + same rubric ⇒ same verdict is the desired
|
|
12
|
+
* property, not a bug.)
|
|
13
|
+
*
|
|
14
|
+
* The cache key is a sha-256 over the canonical JSON of everything that can
|
|
15
|
+
* change a verdict: the artifact content, the scenario id, the judge name,
|
|
16
|
+
* the full dimension list (key + description — the description IS the rubric
|
|
17
|
+
* text shown to the judge), and a caller-supplied `judgeVersion`.
|
|
18
|
+
* `judgeVersion` is REQUIRED: a judge whose prompt/model/ensemble changes
|
|
19
|
+
* without a version bump would otherwise silently serve stale verdicts.
|
|
20
|
+
*
|
|
21
|
+
* Strict canonicalization (`canonicalJson`) throws on undefined / function /
|
|
22
|
+
* symbol / non-finite numbers — an artifact that cannot be unambiguously
|
|
23
|
+
* serialized cannot be content-addressed, and coercing it would let two
|
|
24
|
+
* different artifacts collide on one key.
|
|
25
|
+
*/
|
|
26
|
+
function canonicalizeAt(value, path) {
|
|
27
|
+
if (value === null) return "null";
|
|
28
|
+
switch (typeof value) {
|
|
29
|
+
case "boolean": return value ? "true" : "false";
|
|
30
|
+
case "number":
|
|
31
|
+
if (!Number.isFinite(value)) throw new Error(`canonicalJson: non-finite number (${value}) at ${path} — ambiguity is an error, not a coercion`);
|
|
32
|
+
return JSON.stringify(value);
|
|
33
|
+
case "string": return JSON.stringify(value);
|
|
34
|
+
case "undefined":
|
|
35
|
+
case "function":
|
|
36
|
+
case "symbol": throw new Error(`canonicalJson: ${typeof value} at ${path} — ambiguity is an error, not a coercion`);
|
|
37
|
+
case "bigint": throw new Error(`canonicalJson: bigint at ${path} — not representable in JSON`);
|
|
38
|
+
case "object": break;
|
|
39
|
+
}
|
|
40
|
+
const obj = value;
|
|
41
|
+
if (typeof obj.toJSON === "function") return canonicalizeAt(obj.toJSON(), path);
|
|
42
|
+
if (Array.isArray(obj)) return `[${obj.map((item, i) => canonicalizeAt(item, `${path}[${i}]`)).join(",")}]`;
|
|
43
|
+
if (obj instanceof Map || obj instanceof Set) throw new Error(`canonicalJson: ${obj instanceof Map ? "Map" : "Set"} at ${path} — would serialize as '{}'; convert to a plain object/array first`);
|
|
44
|
+
return `{${Object.keys(obj).sort().map((k) => `${JSON.stringify(k)}:${canonicalizeAt(obj[k], `${path}.${k}`)}`).join(",")}}`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Stable JSON stringify: object keys sorted recursively, so two semantically
|
|
48
|
+
* equal values produce byte-identical output regardless of key insertion
|
|
49
|
+
* order. Throws on undefined / function / symbol / NaN / ±Infinity / bigint /
|
|
50
|
+
* Map / Set — anything JSON.stringify would coerce or drop silently.
|
|
51
|
+
*
|
|
52
|
+
* Distinct from `pre-registration.ts`'s `canonicalize`/`hashJson`, which are
|
|
53
|
+
* permissive (coercion allowed) and async (web-crypto). Use THIS pair when a
|
|
54
|
+
* hash collision or silent coercion would corrupt a cache key or attestation.
|
|
55
|
+
*/
|
|
56
|
+
function canonicalJson(value) {
|
|
57
|
+
return canonicalizeAt(value, "$");
|
|
58
|
+
}
|
|
59
|
+
/** Hex sha-256 over `canonicalJson(value)`. The content address used by the
|
|
60
|
+
* verdict cache and report attestation. */
|
|
61
|
+
function contentHash(value) {
|
|
62
|
+
return createHash("sha256").update(canonicalJson(value)).digest("hex");
|
|
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
|
+
function parseCacheLine(line, path, lineNo) {
|
|
75
|
+
let parsed;
|
|
76
|
+
try {
|
|
77
|
+
parsed = JSON.parse(line);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
throw new Error(`fileVerdictCache: corrupt JSONL at ${path}:${lineNo} — ${err instanceof Error ? err.message : String(err)}`);
|
|
80
|
+
}
|
|
81
|
+
const rec = parsed;
|
|
82
|
+
if (typeof rec !== "object" || rec === null || typeof rec.key !== "string" || typeof rec.score !== "object" || rec.score === null || typeof rec.score.composite !== "number" || typeof rec.score.dimensions !== "object") throw new Error(`fileVerdictCache: invalid record shape at ${path}:${lineNo} — expected {key, score:{dimensions, composite, notes}}`);
|
|
83
|
+
return rec;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* JSONL-file-backed store: the full file is loaded into an in-memory index at
|
|
87
|
+
* construction; every `set` appends one line synchronously (durable before
|
|
88
|
+
* the verdict is returned). A corrupt or malformed line throws at load with
|
|
89
|
+
* file:line — a skipped line would silently re-judge (cost) or, worse, mask
|
|
90
|
+
* a half-written file that needs operator attention.
|
|
91
|
+
*/
|
|
92
|
+
function fileVerdictCache(path) {
|
|
93
|
+
const entries = /* @__PURE__ */ new Map();
|
|
94
|
+
if (existsSync(path)) {
|
|
95
|
+
const lines = readFileSync(path, "utf8").split("\n");
|
|
96
|
+
for (let i = 0; i < lines.length; i++) {
|
|
97
|
+
const line = lines[i];
|
|
98
|
+
if (line === void 0 || line.trim() === "") continue;
|
|
99
|
+
const rec = parseCacheLine(line, path, i + 1);
|
|
100
|
+
entries.set(rec.key, rec.score);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
get: (key) => entries.get(key),
|
|
105
|
+
set: (key, score) => {
|
|
106
|
+
appendFileSync(path, `${JSON.stringify({
|
|
107
|
+
key,
|
|
108
|
+
score
|
|
109
|
+
})}\n`, "utf8");
|
|
110
|
+
entries.set(key, score);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
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
|
+
//#endregion
|
|
157
|
+
export { inMemoryVerdictCache as a, fileVerdictCache as i, canonicalJson as n, contentHash as r, cachedJudge as t };
|
|
158
|
+
|
|
159
|
+
//# sourceMappingURL=verdict-cache-BCcOh0kF.js.map
|
|
@@ -0,0 +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":"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"}
|
package/dist/wire/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as CostLedgerHandle } from "../cost-ledger-
|
|
2
|
-
import { Z as LlmRouteRequirements, q as LlmClientOptions } from "../types-
|
|
1
|
+
import { c as CostLedgerHandle } from "../cost-ledger-Bv_e8XHY.js";
|
|
2
|
+
import { Z as LlmRouteRequirements, q as LlmClientOptions } from "../types-D216SgwM.js";
|
|
3
3
|
import { s as TraceStore } from "../store-CT9YIIve.js";
|
|
4
|
-
import { _ as FeedbackTrajectoryStore } from "../feedback-trajectory-
|
|
4
|
+
import { _ as FeedbackTrajectoryStore } from "../feedback-trajectory-Rh280oXo.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.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-iu0ede49.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 };
|
|
@@ -8,6 +8,21 @@ Every hard-coded model id or endpoint default is verifiable against the live rou
|
|
|
8
8
|
|
|
9
9
|
Enforced by: `preflightModels` (membership + optional probe) and `assertModelsServed` (gate that names every unreachable id with status + detail).
|
|
10
10
|
|
|
11
|
+
## 1a. Reachable is not the same as identified
|
|
12
|
+
|
|
13
|
+
A 200 proves something answered, never that the requested model answered.
|
|
14
|
+
A routing gateway can accept one id and reply from another, and the swap is silent: same status, same shape, only the response's `model` field betrays it.
|
|
15
|
+
Every claim that names a model — a leaderboard row, a per-model cost, a cross-family judge panel, a non-self-judging exclusion — must be built from the id the provider echoed, not the id we sent.
|
|
16
|
+
Requested is intent; served is evidence.
|
|
17
|
+
|
|
18
|
+
Two failure shapes, and only one is a defect.
|
|
19
|
+
Snapshot resolution (`gpt-4o-mini` → `gpt-4o-mini-2024-07-18`) pins a floating alias to a reproducible build and is the behaviour we want.
|
|
20
|
+
Substitution (`gpt-4.1-mini` → `gemini-2.5-flash-lite`) mislabels every number the call produces.
|
|
21
|
+
A response that echoes no model id at all is unproven, which fails closed rather than defaulting to agreement.
|
|
22
|
+
|
|
23
|
+
Enforced by: `assertServedModel` / `assertServedModels` per call, `assertCrossFamilyServed` for panel diversity computed over the ids that answered, `LlmClientOptions.assertServedModel` to enforce it at the transport, and `assertModelsServed` (probe mode), which now fails a substituted id exactly as it fails a dead one.
|
|
24
|
+
`assertCrossFamily` reads requested ids and therefore proves configuration only — reach for the served-side check wherever the diversity claim is load-bearing.
|
|
25
|
+
|
|
11
26
|
## 2. Probe the platform before peeling client layers
|
|
12
27
|
|
|
13
28
|
When a request fails, one direct call against the live endpoint bisects platform-versus-client before any code-level debugging begins. A 401 from the router on a `model_not_found` is the platform telling you the default is dead; a connection refused is the platform being unreachable. Establish which side is at fault with a probe first, then debug only the side that is actually broken.
|
package/docs/charter.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Charter: what agent-eval is for
|
|
2
|
+
|
|
3
|
+
This document states what this package is, derived from the four end-states the stack must reach.
|
|
4
|
+
It was written on 2026-08-10 from a measured inventory of this repo, agent-runtime, discovery, discovery-lab, braid, traces, and supervisor-lab.
|
|
5
|
+
Every claim about current code cites the module that carries it.
|
|
6
|
+
When behavior moves, move this document in the same change.
|
|
7
|
+
|
|
8
|
+
## One sentence
|
|
9
|
+
|
|
10
|
+
agent-eval is the honesty layer of the agent stack: instruments that make it structurally hard to fool ourselves at machine speed, and that never choose a research method.
|
|
11
|
+
|
|
12
|
+
The anchor is discovery's covenant (discovery `docs/01-vision.md`): shared code enforces evidence integrity and immutable observations; it never chooses roles, methods, or winners.
|
|
13
|
+
Everything above this package — runtime, discovery, braid, verticals — gets its freedom because honesty is enforced below.
|
|
14
|
+
|
|
15
|
+
## The four end-states, and what each demands from this package
|
|
16
|
+
|
|
17
|
+
1. **Build complex software rapidly, end to end, without issues.**
|
|
18
|
+
The gate is not generation.
|
|
19
|
+
The gate is knowing what is true about the work while it runs.
|
|
20
|
+
Measured on our own corpus: 87% of failed long runs end on a clean exit with the agent claiming success.
|
|
21
|
+
Demand: executable verification wired into the runtime loop, not beside it.
|
|
22
|
+
|
|
23
|
+
2. **Do novel research: physics, quantum computing, math, unsolved problems.**
|
|
24
|
+
An unsolved problem has no held-out test suite by definition.
|
|
25
|
+
Every grader this package shipped before 2026-08 assumes an answer key.
|
|
26
|
+
Demand: verification strategies that certify without one — proof kernels, invariant checks, independent derivation agreement, replication — plus the statistics of a careful experimentalist.
|
|
27
|
+
This demand is measured, not speculative: discovery-lab holds 99 pursuit directories and 71 blind-graded oracle files on frontier problems, all verified today by hand-rolled run tools outside this package.
|
|
28
|
+
|
|
29
|
+
3. **Build self-improving agents easily, and explain them easily.**
|
|
30
|
+
Improvement requires an ungameable signal; the grader, not the edit, decides improve-versus-game.
|
|
31
|
+
Explanation requires a portable artifact: the receipt that proves B beat A, verifiable by a third party who does not trust us.
|
|
32
|
+
|
|
33
|
+
4. **Build new interfaces (braid-class): detached sessions, forking, analysts on tap.**
|
|
34
|
+
An interface can only expose what the layer below makes addressable.
|
|
35
|
+
Demand: sessions, traces, experiments, and verdicts as durable, forkable, queryable objects.
|
|
36
|
+
|
|
37
|
+
## What already exists (the 2026-08-10 inventory, corrected)
|
|
38
|
+
|
|
39
|
+
The fragmentation story is smaller than it feels.
|
|
40
|
+
The audit refuted "built four times": traces imports this package's whole analyst suite; agent-runtime's live detectors import the detection kernel verbatim; supervisor-lab's judges are AgentProfiles dispatched through this package's judge primitives.
|
|
41
|
+
|
|
42
|
+
- **Ask any question over any trace: exists.**
|
|
43
|
+
`TraceAnalysisEngine` (`src/analyst/engine.ts`) takes a free-text question.
|
|
44
|
+
A new custom question costs zero library files: `defineTraceAnalyst` + `runTraceAnalyst` on the `./analyst` subpath, with the DSPy RLM engine, seven byte-budgeted trace tools, and a metered model proxy behind it.
|
|
45
|
+
- **Default failure analysts: exist.**
|
|
46
|
+
`buildDefaultAnalystRegistry` ships failure-mode, intent-divergence, knowledge-gap, knowledge-poisoning, improvement, control-integrity, and skill-usage kinds, engine-agnostic and versionable.
|
|
47
|
+
- **Statistics: most of an A-plus toolkit, publicly exported.**
|
|
48
|
+
Paired bootstrap, clustered paired binary, exact and score risk differences, McNemar with power and required-n, MDE, multiplicity (Holm, Benjamini-Hochberg), e-process sequential gates, corpus inter-rater agreement, pre-registration manifests with content hashes.
|
|
49
|
+
- **Executable process verification: proven this week.**
|
|
50
|
+
The trace-repair grader scores a proposed fix by executing it and running the task's own held-out suite from outside the container.
|
|
51
|
+
Oracle-fix separates from inert-probe (+0.353 vs 0.000 on milestone 1) with the floor pinned at zero.
|
|
52
|
+
- **Integrity instruments hardened by this week's burns:**
|
|
53
|
+
served-model assertions (a gateway can answer one id with another model), oracle determinism certification (a wall-clock grader flipped 8 of 16 units on identical bytes), control-policy declaration (a zero-step control screened two milestones and could never fire), and equal-terms refusal between comparison arms (`repairArmAsymmetries`).
|
|
54
|
+
|
|
55
|
+
## What is missing (the honest, short list)
|
|
56
|
+
|
|
57
|
+
1. **Cluster-aware power with design-time refusal.**
|
|
58
|
+
"Four task clusters cannot certify any effect size, including 1.0" was learned by running the experiment.
|
|
59
|
+
A `clusteredPower` simulator must refuse the design before a dollar is spent.
|
|
60
|
+
2. **Pre-registration as code, bound everywhere.**
|
|
61
|
+
The manifest binds exactly one statistic family today.
|
|
62
|
+
The registered decision rule must be the object the runner executes; drift between registered and ran must be unrepresentable.
|
|
63
|
+
3. **A general prime query surface.**
|
|
64
|
+
The prime engine is benchmark-bound; there is no `runPrimeAnalyst` symmetric to `runTraceAnalyst`.
|
|
65
|
+
4. **The funnel as a first-class object.**
|
|
66
|
+
Denominator chains are assembled by hand every run.
|
|
67
|
+
5. **The unified analyst definition.**
|
|
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
|
+
6. **Verification without an answer key.**
|
|
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 now exists (`docs/verification-strategies.md`): the reward-source union is open, verdicts carry certifications, and the blind statement-equivalence protocol grades the formalization gap.
|
|
72
|
+
What remains is execution: a real kernel checker bound through the port, and the certified records flowing from live runs.
|
|
73
|
+
7. **Session forking as one primitive.**
|
|
74
|
+
Both halves exist unjoined: agent-runtime's `SandboxLineage.fork` (live checkpoint) and this package's trajectory replay (recorded prefix).
|
|
75
|
+
Braid branches are metadata pointers; the provider session is always new.
|
|
76
|
+
8. **The improvement receipt.**
|
|
77
|
+
Digests, attestations, and sealed manifests exist; the single portable, third-party-verifiable file does not.
|
|
78
|
+
Five gaming attacks on the receipt are named; each refusal must live inside the receipt.
|
|
79
|
+
|
|
80
|
+
## Build order
|
|
81
|
+
|
|
82
|
+
Wave 1 — in flight now.
|
|
83
|
+
The analyst definition contract with its byte-identity CI kill test; prime as a HarnessType in agent-interface; the three-arm review fixes.
|
|
84
|
+
|
|
85
|
+
Wave 2 — the experiment subpath. **Shipped: [docs/experiment.md](./experiment.md).**
|
|
86
|
+
`./experiment`: compose the exported statistics into `defineExperiment` / `sealExperiment` with cluster-aware power refusal, pre-registration as executable decision rules, the funnel object, and matched-budget verification.
|
|
87
|
+
Kill test first: re-derive this week's three hand-written PREREG.md files as decision-rule objects; any rule that needs an opaque escape hatch kills or extends the design.
|
|
88
|
+
The kill test extended the design — ten node families beyond the seed AST, no opaque node — and the three preregistrations are the subpath's acceptance suite.
|
|
89
|
+
|
|
90
|
+
Wave 3 — runtime wiring (blocked until agent-runtime's supervision merge resolves).
|
|
91
|
+
The executable checker bound as a validator at the live-sandbox seam; a stop policy that consumes executable verdicts; then the supervisor budget-allocation experiment at equal compute.
|
|
92
|
+
The published negative result to beat: StateSeal, −3.0pp, CI [−8.5, 1.1], n=540.
|
|
93
|
+
Our measured headroom: blind continuation rescues 4.7% of rollouts; the done-signal has 62.5% precision.
|
|
94
|
+
|
|
95
|
+
Wave 4 — the joins.
|
|
96
|
+
`fork(session, step, modification)` joining lineage-fork and trajectory replay, consumed by braid; the improvement receipt v1 serializing evidence vector, pre-registration hash, grader calibration, and refusal outcomes into one attested file.
|
|
97
|
+
|
|
98
|
+
Wave 5 — science.
|
|
99
|
+
The verification-strategy family, proof kernels first.
|
|
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
|
+
A statement mismatch is a successful outcome; it is the formalization gap made visible.
|
|
102
|
+
The contract layer is shipped: the family and checker port (`src/verification-strategy.ts`), verdict certifications (`src/verdict.ts`), and the blind two-arm equivalence protocol (`src/equivalence-check.ts`) — see `docs/verification-strategies.md` for the family, each member's failure mode, and the pilot as the worked example.
|
|
103
|
+
|
|
104
|
+
## Standing principles (each earned by a measured burn)
|
|
105
|
+
|
|
106
|
+
- **Instruments, never methods.** This package refuses to choose roles, prompts, models, or winners; it makes whatever runs honest.
|
|
107
|
+
- **No upward dependencies.** Consumers import this package; never the reverse.
|
|
108
|
+
- **A check that cannot run must never render as green.** (505 of 5,459 automated reviews published verdicts no evidence supported.)
|
|
109
|
+
- **Certification is task-scoped.** A prompt certified on one task carries nothing onto another; re-authoring voids it.
|
|
110
|
+
- **Access to the world beats loop sophistication.** Measured twice in one week: the analyst that could execute beat the one that could only read; framing carried more than the agent loop.
|
|
111
|
+
- **Controls must be able to fire.** A screening control that cannot in principle produce the outcome it screens for is uncalibrated, not conservative.
|
|
112
|
+
- **The refusal lives inside the artifact.** An adequacy check, an equal-terms check, a determinism check that runs beside the result can be skipped; one that the artifact carries cannot.
|