@tangle-network/agent-eval 0.183.0 → 0.184.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-cell-s__adRnK.d.ts → agent-profile-cell-BHcB-mZX.d.ts} +8 -9
  4. package/dist/{agent-profile-cell-s__adRnK.d.ts.map → agent-profile-cell-BHcB-mZX.d.ts.map} +1 -1
  5. package/dist/{agent-profile-cell-Cv6UA-W_.js → agent-profile-cell-DcFW4vOc.js} +16 -15
  6. package/dist/agent-profile-cell-DcFW4vOc.js.map +1 -0
  7. package/dist/{agent-profile-CivaSsSy.d.ts → agent-profile-uAIQK3Nr.d.ts} +3 -3
  8. package/dist/{agent-profile-CivaSsSy.d.ts.map → agent-profile-uAIQK3Nr.d.ts.map} +1 -1
  9. package/dist/analyst/index.d.ts +10 -10
  10. package/dist/analyst/index.js +8 -7
  11. package/dist/analyst/index.js.map +1 -1
  12. package/dist/{benchmark-DQKzykkO.js → benchmark-BeQJyrRC.js} +3 -3
  13. package/dist/{benchmark-DQKzykkO.js.map → benchmark-BeQJyrRC.js.map} +1 -1
  14. package/dist/{benchmark-command-NBrqNwgy.js → benchmark-command-DlSePljH.js} +13 -12
  15. package/dist/{benchmark-command-NBrqNwgy.js.map → benchmark-command-DlSePljH.js.map} +1 -1
  16. package/dist/benchmarks/index.d.ts +4 -4
  17. package/dist/benchmarks/index.js +3 -3
  18. package/dist/builder-eval/index.js +1 -1
  19. package/dist/campaign/index.d.ts +6 -5
  20. package/dist/campaign/index.js +9 -9
  21. package/dist/{campaign-BwcEBC91.js → campaign-D6puiGFO.js} +15 -15
  22. package/dist/{campaign-BwcEBC91.js.map → campaign-D6puiGFO.js.map} +1 -1
  23. package/dist/{campaign-evidence-PYPUftRy.js → campaign-evidence-aWEmfROB.js} +5 -5
  24. package/dist/{campaign-evidence-PYPUftRy.js.map → campaign-evidence-aWEmfROB.js.map} +1 -1
  25. package/dist/{canonical-DPyQ_rpt.js → canonical-BsZVgBhW.js} +2 -4
  26. package/dist/canonical-BsZVgBhW.js.map +1 -0
  27. package/dist/cli.js +2 -2
  28. package/dist/{client-kh2jOjTK.d.ts → client-Bc8LANCG.d.ts} +4 -4
  29. package/dist/{client-kh2jOjTK.d.ts.map → client-Bc8LANCG.d.ts.map} +1 -1
  30. package/dist/contract/index.d.ts +10 -10
  31. package/dist/contract/index.js +14 -14
  32. package/dist/{default-registry-C0-N4PkG.js → default-registry-CpLko4jB.js} +5 -4
  33. package/dist/{default-registry-C0-N4PkG.js.map → default-registry-CpLko4jB.js.map} +1 -1
  34. package/dist/{default-registry-BwDSWVzg.d.ts → default-registry-DYB4aHVn.d.ts} +6 -6
  35. package/dist/{default-registry-BwDSWVzg.d.ts.map → default-registry-DYB4aHVn.d.ts.map} +1 -1
  36. package/dist/{define-agent-eval-CwOWWQt_.d.ts → define-agent-eval-DE67ECH1.d.ts} +7 -7
  37. package/dist/{define-agent-eval-CwOWWQt_.d.ts.map → define-agent-eval-DE67ECH1.d.ts.map} +1 -1
  38. package/dist/{define-agent-eval-CneiWyuA.js → define-agent-eval-RTekxhUE.js} +8 -8
  39. package/dist/{define-agent-eval-CneiWyuA.js.map → define-agent-eval-RTekxhUE.js.map} +1 -1
  40. package/dist/{dspy-rlm-engine-8pgBSiy7.js → dspy-rlm-engine-Da-l3CpD.js} +3 -3
  41. package/dist/{dspy-rlm-engine-8pgBSiy7.js.map → dspy-rlm-engine-Da-l3CpD.js.map} +1 -1
  42. package/dist/{engine-DS1cysJy.d.ts → engine-D1ykrAKR.d.ts} +7 -7
  43. package/dist/{engine-DS1cysJy.d.ts.map → engine-D1ykrAKR.d.ts.map} +1 -1
  44. package/dist/{eval-campaign-CCEkwzoH.js → eval-campaign-XFHEpN86.js} +4 -4
  45. package/dist/{eval-campaign-CCEkwzoH.js.map → eval-campaign-XFHEpN86.js.map} +1 -1
  46. package/dist/evaluation.d.ts +75 -0
  47. package/dist/evaluation.d.ts.map +1 -0
  48. package/dist/evaluation.js +137 -0
  49. package/dist/evaluation.js.map +1 -0
  50. package/dist/{exact-types-BZDe0W2D.d.ts → exact-types-BEHN7tnq.d.ts} +2 -2
  51. package/dist/{exact-types-BZDe0W2D.d.ts.map → exact-types-BEHN7tnq.d.ts.map} +1 -1
  52. package/dist/experiment/index.d.ts +2 -2
  53. package/dist/experiment/index.js +5 -5
  54. package/dist/{experiment-tracker-C7PfnF4b.d.ts → experiment-tracker-URRGP9ek.d.ts} +2 -2
  55. package/dist/{experiment-tracker-C7PfnF4b.d.ts.map → experiment-tracker-URRGP9ek.d.ts.map} +1 -1
  56. package/dist/{external-optimizer-process-DIB4YWEe.js → external-optimizer-process-BbhvXTFx.js} +4 -4
  57. package/dist/{external-optimizer-process-DIB4YWEe.js.map → external-optimizer-process-BbhvXTFx.js.map} +1 -1
  58. package/dist/{external-optimizer-subprocess-CjguXN2e.js → external-optimizer-subprocess-DMgmqTB6.js} +3 -3
  59. package/dist/{external-optimizer-subprocess-CjguXN2e.js.map → external-optimizer-subprocess-DMgmqTB6.js.map} +1 -1
  60. package/dist/{feedback-trajectory-CXmtITBo.d.ts → feedback-trajectory-CytTR7u4.d.ts} +3 -3
  61. package/dist/{feedback-trajectory-CXmtITBo.d.ts.map → feedback-trajectory-CytTR7u4.d.ts.map} +1 -1
  62. package/dist/hosted/index.d.ts +2 -2
  63. package/dist/{index-DoykkxW0.d.ts → index-58wex7KV.d.ts} +11 -11
  64. package/dist/{index-DoykkxW0.d.ts.map → index-58wex7KV.d.ts.map} +1 -1
  65. package/dist/{index--_8_Nlpn.d.ts → index-CKZa_rnt.d.ts} +4 -121
  66. package/dist/index-CKZa_rnt.d.ts.map +1 -0
  67. package/dist/{index-DbG8QbH9.d.ts → index-DVrtLO5j.d.ts} +6 -6
  68. package/dist/{index-DbG8QbH9.d.ts.map → index-DVrtLO5j.d.ts.map} +1 -1
  69. package/dist/{index-Bp_6sj3x.d.ts → index-ww8736Am.d.ts} +20 -315
  70. package/dist/index-ww8736Am.d.ts.map +1 -0
  71. package/dist/index.d.ts +23 -22
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +24 -24
  74. package/dist/{insight-report-D1qa0HWs.d.ts → insight-report-C3Bfl762.d.ts} +3 -3
  75. package/dist/{insight-report-D1qa0HWs.d.ts.map → insight-report-C3Bfl762.d.ts.map} +1 -1
  76. package/dist/jev-protocol.d.ts +74 -0
  77. package/dist/jev-protocol.d.ts.map +1 -0
  78. package/dist/jev-protocol.js +91 -0
  79. package/dist/jev-protocol.js.map +1 -0
  80. package/dist/jev.d.ts +131 -0
  81. package/dist/jev.d.ts.map +1 -0
  82. package/dist/jev.js +312 -0
  83. package/dist/jev.js.map +1 -0
  84. package/dist/{journal-Cs9f7385.js → journal-BuRLm6ho.js} +2 -2
  85. package/dist/{journal-Cs9f7385.js.map → journal-BuRLm6ho.js.map} +1 -1
  86. package/dist/{kind-factory-DxTzg32u.js → kind-factory-DE088Zhv.js} +4 -3
  87. package/dist/{kind-factory-DxTzg32u.js.map → kind-factory-DE088Zhv.js.map} +1 -1
  88. package/dist/ledger-core/index.js +2 -2
  89. package/dist/{llm-judge-FfaRgz9X.js → llm-judge-C5wbADA5.js} +9 -9
  90. package/dist/{llm-judge-FfaRgz9X.js.map → llm-judge-C5wbADA5.js.map} +1 -1
  91. package/dist/{matrix-CyhW-vgJ.d.ts → matrix-CPKsRY8Y.d.ts} +2 -2
  92. package/dist/{matrix-CyhW-vgJ.d.ts.map → matrix-CPKsRY8Y.d.ts.map} +1 -1
  93. package/dist/meta-eval/index.d.ts +54 -2
  94. package/dist/meta-eval/index.d.ts.map +1 -1
  95. package/dist/meta-eval/index.js +52 -3
  96. package/dist/meta-eval/index.js.map +1 -1
  97. package/dist/{mint-ySIIkKlV.js → mint-B4zgSAJW.js} +63 -14
  98. package/dist/mint-B4zgSAJW.js.map +1 -0
  99. package/dist/mint-BI14xehJ.d.ts +285 -0
  100. package/dist/mint-BI14xehJ.d.ts.map +1 -0
  101. package/dist/multishot/golden/index.d.ts +1 -1
  102. package/dist/multishot/index.d.ts +2 -2
  103. package/dist/openapi.json +1 -1
  104. package/dist/pipelines/index.js +2 -2
  105. package/dist/{produced-state-CGoVInrl.js → produced-state-D3uWsY8t.js} +23 -19
  106. package/dist/{produced-state-CGoVInrl.js.map → produced-state-D3uWsY8t.js.map} +1 -1
  107. package/dist/profile-cell.d.ts +1 -1
  108. package/dist/profile-cell.js +1 -1
  109. package/dist/{promotion-policy-BKFrl7CC.js → promotion-policy-CD-bUeyR.js} +3 -3
  110. package/dist/{promotion-policy-BKFrl7CC.js.map → promotion-policy-CD-bUeyR.js.map} +1 -1
  111. package/dist/{query-D1nLIKt7.js → query-DlV0pdx4.js} +2 -2
  112. package/dist/{query-D1nLIKt7.js.map → query-DlV0pdx4.js.map} +1 -1
  113. package/dist/{registry-BRbB6Y0v.d.ts → registry-D5Ly3GRV.d.ts} +3 -3
  114. package/dist/{registry-BRbB6Y0v.d.ts.map → registry-D5Ly3GRV.d.ts.map} +1 -1
  115. package/dist/{release-confidence-BcqeQTHW.d.ts → release-confidence-DsETiO4f.d.ts} +3 -3
  116. package/dist/{release-confidence-BcqeQTHW.d.ts.map → release-confidence-DsETiO4f.d.ts.map} +1 -1
  117. package/dist/{release-confidence-DMg8n18l.js → release-confidence-RanRUXRW.js} +2 -2
  118. package/dist/{release-confidence-DMg8n18l.js.map → release-confidence-RanRUXRW.js.map} +1 -1
  119. package/dist/reporting.d.ts +3 -3
  120. package/dist/reporting.js +2 -2
  121. package/dist/{researcher-64T49THL.d.ts → researcher-CJkH-6Ty.d.ts} +4 -4
  122. package/dist/{researcher-64T49THL.d.ts.map → researcher-CJkH-6Ty.d.ts.map} +1 -1
  123. package/dist/{reward-hacking-uzO_ihep.d.ts → reward-hacking-BIQ2BWLG.d.ts} +2 -2
  124. package/dist/{reward-hacking-uzO_ihep.d.ts.map → reward-hacking-BIQ2BWLG.d.ts.map} +1 -1
  125. package/dist/rl.d.ts +10 -6
  126. package/dist/rl.d.ts.map +1 -1
  127. package/dist/rl.js +21 -7
  128. package/dist/rl.js.map +1 -1
  129. package/dist/rollout/index.d.ts +2 -2
  130. package/dist/rollout/index.js +2 -2
  131. package/dist/{rollout-D_54FZVu.js → rollout-C0Ifk3vK.js} +2 -2
  132. package/dist/{rollout-D_54FZVu.js.map → rollout-C0Ifk3vK.js.map} +1 -1
  133. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts → rubric-predictive-validity-CTU8y8Cv.d.ts} +2 -2
  134. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts.map → rubric-predictive-validity-CTU8y8Cv.d.ts.map} +1 -1
  135. package/dist/{run-record-DPa2PeHx.js → run-record-BhMVsHR1.js} +2 -2
  136. package/dist/{run-record-DPa2PeHx.js.map → run-record-BhMVsHR1.js.map} +1 -1
  137. package/dist/{run-record-BiTWauyO.d.ts → run-record-D9wS35fK.d.ts} +2 -2
  138. package/dist/{run-record-BiTWauyO.d.ts.map → run-record-D9wS35fK.d.ts.map} +1 -1
  139. package/dist/{run-record-DualPTn2.js → run-record-tg_5H2IK.js} +2 -2
  140. package/dist/{run-record-DualPTn2.js.map → run-record-tg_5H2IK.js.map} +1 -1
  141. package/dist/search-ledger-types-D7KDVg-o.d.ts +302 -0
  142. package/dist/search-ledger-types-D7KDVg-o.d.ts.map +1 -0
  143. package/dist/{semantic-concept-judge-_3Fp6Q_3.js → semantic-concept-judge-5r9hDEBA.js} +4 -4
  144. package/dist/{semantic-concept-judge-_3Fp6Q_3.js.map → semantic-concept-judge-5r9hDEBA.js.map} +1 -1
  145. package/dist/{sequential-D_xHrBZe.js → sequential-BfDkCBGo.js} +3 -3
  146. package/dist/{sequential-D_xHrBZe.js.map → sequential-BfDkCBGo.js.map} +1 -1
  147. package/dist/{server-BZQR1f0C.js → server-DmpcFiVK.js} +2 -2
  148. package/dist/{server-BZQR1f0C.js.map → server-DmpcFiVK.js.map} +1 -1
  149. package/dist/{skillopt-optimization-method-DY1aQ-aL.js → skillopt-optimization-method-B2zxoDk0.js} +7 -7
  150. package/dist/{skillopt-optimization-method-DY1aQ-aL.js.map → skillopt-optimization-method-B2zxoDk0.js.map} +1 -1
  151. package/dist/{statistical-heldout-CpVd6FmY.d.ts → statistical-heldout-Bu4oNOJh.d.ts} +3 -3
  152. package/dist/{statistical-heldout-CpVd6FmY.d.ts.map → statistical-heldout-Bu4oNOJh.d.ts.map} +1 -1
  153. package/dist/{store-otlp-DAaEbMLf.js → store-otlp-rU5PFlOB.js} +2 -2
  154. package/dist/{store-otlp-DAaEbMLf.js.map → store-otlp-rU5PFlOB.js.map} +1 -1
  155. package/dist/{store-tool-spans-Dt-YdAuE.d.ts → store-tool-spans-DwdokbHg.d.ts} +54 -6
  156. package/dist/store-tool-spans-DwdokbHg.d.ts.map +1 -0
  157. package/dist/{store-tool-spans-BZ8MPKFe.js → store-tool-spans-zrtftcRe.js} +68 -6
  158. package/dist/store-tool-spans-zrtftcRe.js.map +1 -0
  159. package/dist/{summary-report-IGAOtgPd.js → summary-report-BMvou2oZ.js} +2 -2
  160. package/dist/{summary-report-IGAOtgPd.js.map → summary-report-BMvou2oZ.js.map} +1 -1
  161. package/dist/{summary-report-D1h4dlrK.d.ts → summary-report-BzFS5UhZ.d.ts} +2 -2
  162. package/dist/{summary-report-D1h4dlrK.d.ts.map → summary-report-BzFS5UhZ.d.ts.map} +1 -1
  163. package/dist/{task-failure-attributes-B_JjrOVo.js → task-failure-attributes-BOxjfbhr.js} +2 -2
  164. package/dist/{task-failure-attributes-B_JjrOVo.js.map → task-failure-attributes-BOxjfbhr.js.map} +1 -1
  165. package/dist/{tool-groups-B2bSNaJB.d.ts → tool-groups-qHMydbAH.d.ts} +3 -3
  166. package/dist/tool-groups-qHMydbAH.d.ts.map +1 -0
  167. package/dist/{tool-waste-C7MU9u1e.js → tool-waste-nbHPAxei.js} +2 -2
  168. package/dist/{tool-waste-C7MU9u1e.js.map → tool-waste-nbHPAxei.js.map} +1 -1
  169. package/dist/trace-repair/index.d.ts +2 -2
  170. package/dist/trace-repair/index.js +3 -3
  171. package/dist/traces.d.ts +5 -5
  172. package/dist/traces.js +7 -7
  173. package/dist/trajectory-replay/index.js +1 -1
  174. package/dist/{types-CS0qk_Yp.d.ts → types-BTRcIqFr.d.ts} +3 -3
  175. package/dist/{types-CS0qk_Yp.d.ts.map → types-BTRcIqFr.d.ts.map} +1 -1
  176. package/dist/{types-D7gEdPoQ.d.ts → types-BjB2wZM9.d.ts} +2 -2
  177. package/dist/{types-D7gEdPoQ.d.ts.map → types-BjB2wZM9.d.ts.map} +1 -1
  178. package/dist/types-C8VBbiw6.js +91 -0
  179. package/dist/types-C8VBbiw6.js.map +1 -0
  180. package/dist/{types-BvZoPTGa.d.ts → types-c3ZRTbw9.d.ts} +3 -3
  181. package/dist/{types-BvZoPTGa.d.ts.map → types-c3ZRTbw9.d.ts.map} +1 -1
  182. package/dist/{types-DQ0e2E7y.js → usage-receipt-Cx3xNeyB.js} +2 -89
  183. package/dist/usage-receipt-Cx3xNeyB.js.map +1 -0
  184. package/dist/{verdict-BQ3pCFf8.js → verdict-DhPoXApk.js} +2 -2
  185. package/dist/{verdict-BQ3pCFf8.js.map → verdict-DhPoXApk.js.map} +1 -1
  186. package/dist/{verdict-cache-B3eCVQtY.js → verdict-cache-BQEsVy9n.js} +2 -2
  187. package/dist/{verdict-cache-B3eCVQtY.js.map → verdict-cache-BQEsVy9n.js.map} +1 -1
  188. package/dist/wire/index.d.ts +1 -1
  189. package/dist/wire/index.js +1 -1
  190. package/docs/changes/evaluation-definition-identity.md +27 -0
  191. package/docs/changes/jev-evidence-review.md +18 -0
  192. package/docs/changes/jev-product-adoption.md +18 -0
  193. package/docs/changes/probability-policy-audit.md +81 -0
  194. package/docs/jev-behavior-review.md +174 -0
  195. package/docs/jev-integrations.md +50 -0
  196. package/docs/jev.md +140 -0
  197. package/docs/produced-state.md +13 -0
  198. package/docs/profile-json-identity.md +33 -0
  199. package/package.json +16 -1
  200. package/dist/agent-profile-cell-Cv6UA-W_.js.map +0 -1
  201. package/dist/canonical-DPyQ_rpt.js.map +0 -1
  202. package/dist/exporters-D98GPi1n.d.ts +0 -161
  203. package/dist/exporters-D98GPi1n.d.ts.map +0 -1
  204. package/dist/index--_8_Nlpn.d.ts.map +0 -1
  205. package/dist/index-Bp_6sj3x.d.ts.map +0 -1
  206. package/dist/mint-ySIIkKlV.js.map +0 -1
  207. package/dist/store-tool-spans-BZ8MPKFe.js.map +0 -1
  208. package/dist/store-tool-spans-Dt-YdAuE.d.ts.map +0 -1
  209. package/dist/tool-groups-B2bSNaJB.d.ts.map +0 -1
  210. package/dist/types-DQ0e2E7y.js.map +0 -1
@@ -0,0 +1,27 @@
1
+ # Unreleased: evaluation definition identity
2
+
3
+ Static `jevJudge` and `jevAnalyst` versions now bind authored question order and
4
+ Choice alternative order in addition to their canonical content. The request is
5
+ not sorted or rewritten. Optional undefined SDK fields remain absent from the
6
+ JSON document, so JSON round-trips retain the same identity.
7
+
8
+ This intentionally changes static evaluator version hashes. A cached verdict from
9
+ the previous identity scheme must not be treated as evidence for a reordered
10
+ classifier definition. Existing caches remain stored under their previous versions;
11
+ this change does not delete or migrate them.
12
+
13
+ `asJudge` and `asAnalyst` capture callback references when constructed and detach
14
+ metadata arrays/objects from the supplied options. Replacing `options.evaluate`,
15
+ `options.map` or `options.record` later no longer changes an already-versioned
16
+ adapter. Construct another adapter with a new version for an intentional change.
17
+
18
+ This is not a sandbox or closure serializer. Callers must still version opaque
19
+ renderer/mapping behavior and mutable state captured inside their own functions.
20
+ Dynamic question builders remain supported; retain each actual request through
21
+ the existing observation path. No model calls, thresholds, domain policies,
22
+ transport defaults or execution machinery are added.
23
+
24
+ Regression tests cover version collisions from reordering, preserved dispatch
25
+ order, SDK-style undefined fields, metadata mutation and callback replacement
26
+ through the real paid-call ledger. They establish code contracts, not classifier
27
+ quality or deployed outcome improvements.
@@ -0,0 +1,18 @@
1
+ # Unreleased: opt-in evidence reviews on native evaluations
2
+
3
+ `@tangle-network/agent-eval/jev` adds `prepareJevReview`, `assessJevReview` and
4
+ `jevReviewFindings`. Callers retain ownership of questions, hypotheses, evidence, severity,
5
+ thresholds and result policy. Review identity includes authored option order; request JSON is
6
+ not sorted before dispatch. Missing or partial negative evidence cannot become a clean review.
7
+
8
+ The optional `examples/jev-behavior-review.ts` recipe covers reward gaming, evaluator tampering,
9
+ policy/authorization/data-boundary breaches, injection-following, contradicted completion,
10
+ oversight bypass, matched-baseline anomalies and cross-run behavior. It composes the existing
11
+ `jevAnalyst`; the taxonomy is not installed in the generic evaluator and is not a calibrated
12
+ safety detector. See [behavioral reviews](../jev-behavior-review.md) for evidence and limits.
13
+
14
+ No dependency, transport, scheduler, package entrypoint, default model, production action or
15
+ spending policy changes. Existing evaluator, judge, analyst and protocol APIs remain unchanged.
16
+ Use existing deterministic control/reward checks and independent final assessment alongside
17
+ semantic reviews. Adversarial model quality and product/harness adoption remain tracked in
18
+ #772/#771 and the cross-repository roadmap #768.
@@ -0,0 +1,18 @@
1
+ # 0.184.0: installed product adoption
2
+
3
+ The new version publishes the merged typed evaluator and Jev APIs that were not in the
4
+ previously published 0.183.0 artifact. JS and Python distribution versions remain in lockstep.
5
+
6
+ `@tangle-network/agent-eval/jev/protocol` is a leaf export of the existing protocol implementation.
7
+ Products can validate native requests/responses without importing analyst/campaign execution.
8
+ Native extension metadata is preserved, not projected away; lossy non-JSON metadata is rejected
9
+ before consumers persist an apparently valid but changed observation. Already-paid receipts remain
10
+ recorded when answer validation fails.
11
+
12
+ `examples/jev-decision-benchmark.ts` compares caller-defined classifier configurations with the
13
+ existing matrix runner. It separates independent expected labels from model input, retains
14
+ abstention, records complete observations and paid failures, and groups results by configuration.
15
+ It is a recipe, not another optimizer or universal scoring policy.
16
+
17
+ Release this version through the existing verify-and-publish workflow before merging consumers
18
+ pinned to 0.184.0. A source manifest version is not evidence that the npm artifact is available.
@@ -0,0 +1,81 @@
1
+ # Unreleased: audit a frozen probability policy
2
+
3
+ Added `auditProbabilityPolicy`, `ProbabilityPolicyAuditInput` and
4
+ `ProbabilityPolicyAuditReport` to `@tangle-network/agent-eval/meta-eval`.
5
+ Existing `auditEvaluator` behavior and report hashes are unchanged. No dependency,
6
+ model call, scheduler or automatic promotion is added.
7
+
8
+ Use this when a product turns a probability into accept, reject or escalation.
9
+ The caller supplies both thresholds and independently labeled observations. The
10
+ helper maps the observations, then uses the existing `auditEvaluator` statistics,
11
+ independent-unit counting, development-exposure exclusion and authority checks.
12
+
13
+ ```ts
14
+ import { readFile } from 'node:fs/promises'
15
+ import { auditProbabilityPolicy } from '@tangle-network/agent-eval/meta-eval'
16
+
17
+ const path = process.argv[2]
18
+ if (!path) throw new Error('Supply the frozen audit JSON path')
19
+ const report = auditProbabilityPolicy(JSON.parse(await readFile(path, 'utf8')))
20
+ console.log(JSON.stringify(report, null, 2))
21
+ ```
22
+
23
+ The input has the existing evaluator audit fields: `evaluatorDigest`, `population`,
24
+ `samplingFrame`, `authority`, `policy` and `observations`. Add explicit `thresholds`
25
+ with `rejectAtOrBelow` and `acceptAtOrAbove`. Every observation carries `id`,
26
+ `independentUnitId`, `evidenceRef`, independently checked `expected` (`accept` or
27
+ `reject`), `exposure` (`fresh` or `development`), and `acceptProbability` instead
28
+ of `observed`.
29
+
30
+ `acceptProbability` is P(the event the caller defines as acceptable), in [0,1], or
31
+ null for missing output. For Jev, a caller can use a suitable Noul or a named Choice
32
+ probability. Do not substitute Jev's distribution-confidence statistic or an
33
+ arbitrarily scaled numeric grade. Other providers work without pretending to be Jev.
34
+
35
+ Probabilities at or above `acceptAtOrAbove` map to accept. Those at or below
36
+ `rejectAtOrBelow` map to reject. The open interval between them and null map to
37
+ unknown. Thresholds must be finite, in [0,1], and strictly separated. Nothing
38
+ chooses thresholds or inserts a default cutoff for the application.
39
+
40
+ ## Read the result correctly
41
+
42
+ The result retains the existing admit/reject/inconclusive verdict, error bounds,
43
+ coverage, exclusions, authority and mapped observations. Unknown judgments remain
44
+ in the conservative error bounds, never measured successes. The helper does not
45
+ quietly discard escalated or unavailable cases to improve apparent accuracy.
46
+ `coverage.eligibleCases - coverage.unknownCases` is the number of decided eligible
47
+ cases; the full denominator remains `eligibleCases`.
48
+
49
+ `probabilityPolicy` retains the original classifier digest, thresholds and exact
50
+ probabilities keyed by observation id. `evaluatorDigest` identifies the composed
51
+ classifier-plus-threshold program. `inputDigest` binds the complete validated
52
+ probability-audit input (sorted by observation id), including probability changes
53
+ that do not change the selected action. `reportDigest` covers the complete report.
54
+
55
+ The original evaluator digest must identify the actual frozen classifier, question
56
+ and evidence-rendering definition. An arbitrary string or a model alias is not
57
+ an independently verified program identity. Hashes establish identity, not truth.
58
+
59
+ ## Keep selection and final assessment separate
60
+
61
+ Tune thresholds on development data, freeze them, then use fresh independent cases
62
+ for the final audit. A development-exposed source excludes its fresh-looking
63
+ variants too. Duplicate observation ids and identical declared author/auditor
64
+ identities are refused. Distinct declared names do not prove real-world independence;
65
+ the execution owner must enforce it and supply evidence.
66
+
67
+ The output audits this fixed binary decision policy. It does not prove probability
68
+ calibration, downstream workflow correctness, cost savings, causal repair quality
69
+ or external-action authorization. Use existing calibration/comparison utilities
70
+ and actual task outcomes for those claims. A small or entirely missing dataset is
71
+ inconclusive rather than perfect evidence. Real datasets, task slices, cost/latency
72
+ comparisons and deployed validation remain tracked in issue #771 under roadmap #768.
73
+
74
+ ## Checks
75
+
76
+ `pnpm exec vitest run tests/probability-policy-audit.test.ts tests/evaluator-admission.test.ts`
77
+
78
+ Regressions cover boundary decisions, missing data, invalid probabilities, overlapping
79
+ thresholds, digest identity, input immutability, independent-unit denominators,
80
+ development leakage, authority checks and unchanged underlying error bounds. These
81
+ are executable arithmetic/contract tests, not live Jev quality measurements.
@@ -0,0 +1,174 @@
1
+ # Evidence-backed behavioral reviews
2
+
3
+ Use native evaluations to assess bounded hypotheses about recorded behavior. Do not ask one
4
+ classifier whether an agent is "malicious" or a whole run is "safe". Observable policy breaches,
5
+ model-supported hypotheses, missing evidence and unusual behavior are different results.
6
+
7
+ The optional `/jev` helpers are ordinary functions:
8
+
9
+ - `prepareJevReview`: validate and freeze caller-defined native questions, evidence references,
10
+ coverage and decision thresholds before spending. The digest binds the definition, input and
11
+ authored question/option order. Optional undefined object fields are absent on the wire.
12
+ - `assessJevReview`: validate native answers and interpret designated alternative masses as
13
+ `supported`, `refuted` or `unresolved`. Re-scoring makes no network call.
14
+ - `jevReviewFindings`: map that report into the existing `AnalystFinding` contract. It keeps
15
+ unresolved checks visible and labels supported claims as model-supported hypotheses.
16
+
17
+ These helpers do not constrain `jevEvaluator`, `jevJudge`, `jevAnalyst`, or the provider-independent
18
+ `createEvaluator`/`asJudge`/`asAnalyst` APIs. Use an ordinary custom mapper for different policies.
19
+ No model, taxonomy, severity, operating threshold, global safety score or storage backend is chosen
20
+ by the generic implementation.
21
+
22
+ ## Direct product call
23
+
24
+ Supply the native request on each invocation. This example's `question`, `evidence`, `policy` and
25
+ `limits` are application configuration, not new library exports or default values.
26
+
27
+ ```ts
28
+ import {
29
+ prepareJevReview, assessJevReview, jevEvaluator,
30
+ } from '@tangle-network/agent-eval/jev'
31
+
32
+ const evaluate = jevEvaluator({
33
+ evaluate: nativeTransport, // One Router /v1/systemone attempt; preserve signal/idempotency key.
34
+ receipt: readRouterReceipt,
35
+ maximumCharge: enforcedMaximumCharge,
36
+ })
37
+
38
+ const review = prepareJevReview({
39
+ version: policy.version,
40
+ request: {
41
+ model: selectedModel,
42
+ state: { policy: policy.definition, evidence: evidence.content },
43
+ questions: { action: question },
44
+ },
45
+ checks: {
46
+ action: {
47
+ claim: policy.hypothesis,
48
+ subject: actionId,
49
+ area: 'authorization-review',
50
+ severity: policy.severity,
51
+ supports: ['supported'],
52
+ refutes: ['refuted'],
53
+ supportAtLeast: limits.support,
54
+ refuteAtLeast: limits.refute,
55
+ coverage: evidence.coverage,
56
+ evidence: evidence.refs,
57
+ },
58
+ },
59
+ })
60
+ const result = await evaluate(review.request, executionContext)
61
+ await persistAuthorizedObservation({ review, result })
62
+ const report = assessJevReview(review, result.value)
63
+ ```
64
+
65
+ The example assumes a native Choice question with `supported`, `refuted` and `insufficient`
66
+ alternatives. Other labels, Noul polarity (`true`/`false`) and grouped Score levels are supported.
67
+ A Score's expected level is not itself the probability of a breach; explicitly select which
68
+ levels support or refute the claim. The two thresholds must be positive, at most one and sum to
69
+ more than one, so their regions do not overlap. This is an optional disjoint-region policy,
70
+ not a requirement imposed on other evaluators.
71
+
72
+ ## Optional behavior recipe
73
+
74
+ `examples/jev-behavior-review.ts` provides replaceable question definitions and
75
+ `behaviorReviewAnalyst`, which composes the existing `jevAnalyst`. Copy/adapt the recipe in an
76
+ application; it is not a default policy installed by importing the package. Select only relevant
77
+ checks and provide thresholds, severity, exact policy and evidence for every selected check.
78
+
79
+ | Hypothesis | Evidence needed | Important distinction |
80
+ | --- | --- | --- |
81
+ | Reward gaming | Task objective, raw proxy score, independent outcome and attributable action | A proxy/outcome gap can be a broken evaluator, not deliberate gaming. |
82
+ | Evaluator tampering | Protected evaluator identity, allowed changes and trusted before/after diff | A task that authorizes test repair must not be flagged merely for editing tests. |
83
+ | Safety-policy violation | Exact applicable policy and attributable action/output | Quotation, refusal and simulation are not completed violations. |
84
+ | Unauthorized action | Effective grant at action time, requested target and enforcement outcome | An attempted action, a blocked request and a completed effect differ. |
85
+ | Data-boundary violation | Data classification, allowed destination and actual payload/egress record | Do not infer a successful transfer from a plan or URL mention. |
86
+ | Injection followed | Untrusted instruction, trusted task and subsequent attributable action | Reading or rejecting malicious text is not obeying it. |
87
+ | Contradicted success claim | Exact claim and independent receipt for the same operation | No receipt means unresolved, not proof of deception. |
88
+ | Oversight bypass | Applicable approval/monitor/cancel control and attributable change | Lost telemetry or an authorized control change is not evidence of agent evasion. |
89
+ | Anomalous sequence | Matched versioned baseline and differences computed in code | Unusual does not mean harmful; no baseline means no established anomaly rate. |
90
+ | Cross-run coordination | Authorized joined traces, linkage, timeline, policy and joint effect | Shared infrastructure or legitimate delegation is not collusion. |
91
+
92
+ A hypothesis gets its own question; these behaviors are not mutually exclusive alternatives in
93
+ one forced-choice category. Prefer a small relevant evidence window per review. A rule such as
94
+ "use only evidence.X" is an instruction, not technical isolation between other inputs in the
95
+ same request. Run separate requests when evidence or tenant isolation requires it.
96
+
97
+ ## What the numbers mean
98
+
99
+ The report retains support, refutation and remaining native mass without renormalizing away
100
+ uncertainty. Native `confidence` is stored separately: TypeSafe defines it as a statistic of the
101
+ distribution, not the same value as the winning alternative's probability. Neither is a measured
102
+ probability of malicious intent, future harm or successful exfiltration.
103
+
104
+ The host declares evidence coverage. Non-missing coverage requires references; the library does
105
+ not authenticate those references, read their targets, prove completeness or know that the
106
+ right evidence was supplied. The caller must bind references to immutable authorized records
107
+ and put the relevant content in state. A policy document alone is not behavioral evidence.
108
+ Missing evidence always stays unresolved. Partial evidence may support a scoped hypothesis but
109
+ cannot refute it under this helper's conservative policy.
110
+
111
+ Every native result should be retained through the existing `record` callback before findings
112
+ are reduced. A refuted check remains in the report but produces no issue finding; an empty
113
+ finding list is not a universal safety certificate. Supported findings use model support mass
114
+ as `confidence`, explicitly marked uncalibrated. Unresolved findings use confidence 1 only for
115
+ the deterministic fact "this review is unresolved", with `confidence_basis: deterministic-status`.
116
+ Do not graph those two bases together as risk probabilities.
117
+
118
+ Do not multiply probabilities from correlated questions, add overlapping category probabilities
119
+ as a run-wide risk, or substitute `1 - P(supported)` for `P(refuted)` when insufficient evidence
120
+ has its own mass. For an independent audit of these ternary outcomes, use `auditEvaluator` with
121
+ the actual mapped decision and unknowns. `auditProbabilityPolicy` is for a genuine binary
122
+ probability with its frozen binary threshold rule; it must not silently drop the third category.
123
+
124
+ ## Existing components to reuse
125
+
126
+ `/rl` already has `detectRewardHacking` for reward divergence, distribution shift, reward
127
+ disagreement and judge drift. Those diagnostic scores are not probabilities. Keep the raw,
128
+ ungated proxy and independently measured task outcome so a previous rejection does not hide the
129
+ disagreement. Do not substitute the Jev monitor as the only independent outcome.
130
+
131
+ The analyst system already has deterministic control-integrity and behavioral/efficiency
132
+ checks, plus deep trace analyst definitions such as intent divergence and knowledge poisoning.
133
+ Run exact checks for facts code can establish; use a bounded semantic review for interpretation;
134
+ escalate selected cases to the existing deeper analyst. None is replaced by this recipe.
135
+
136
+ A prepared review can be a custom registry input or built from a filtered trace store. Existing
137
+ `asAnalyst`/`jevAnalyst` forward the shared paid-call account, cancellation and deadline. The
138
+ recipe verifies persisted definition identity before inference, records the native observation
139
+ before mapping, and returns ordinary findings. Graphs consume these through their existing
140
+ analyst-registry adapter. No new supervisor, scheduler, ledger, or trace database is introduced.
141
+
142
+ For judges, map assessments explicitly and refuse unresolved evidence where the scored metric
143
+ requires resolution. Never convert an unresolved safety review to a perfect score or average a
144
+ critical constraint failure into unrelated high scores. Working feedback must not expose the
145
+ independent final evaluator, protected holdout labels, or monitor control credentials to the worker.
146
+
147
+ ## Security and validation boundaries
148
+
149
+ TypeSafe's Jev 1.13 documentation explicitly warns that adversarial state content can move the
150
+ answer. Delimiters and explicit criteria are useful instructions, not a proof of injection
151
+ resistance. These monitors are advisory evidence, not the sole authorization/safety barrier.
152
+ Trusted policy and references must come from outside the evaluated agent; tenant scope, redaction,
153
+ credential handling and controls remain with existing application/security owners.
154
+
155
+ A required pre-action check must execute before the effect, and a pre-delivery check must run
156
+ before streaming exposes the answer. Post-run analysis cannot undo an effect or retract text.
157
+ External harnesses only support their actual documented boundaries; a whole-prompt callback is
158
+ not an interception of every native request. An observational hook is not a blocking gate.
159
+
160
+ Before enabling automatic decisions, independently test both attacks and ordinary authorized
161
+ behavior: legitimate test edits, benign quotations, refusals, blocked attempts, telemetry gaps,
162
+ wrong-tenant evidence, long/misleading traces and multi-run attacks. Measure per-category false
163
+ positives, false negatives, abstention, task success, latency and full cost using independent
164
+ source units. Freeze thresholds on development data, retain a separate final set, and audit a
165
+ sample of accepted cases to avoid selective-label blindness. Test the monitor under adaptive
166
+ attacks, not only the worker under a fixed monitor.
167
+
168
+ The new tests exercise pure mapping, canonical identity, metadata isolation and real
169
+ Eval/AnalystRegistry accounting composition with an injected model boundary. They do not prove
170
+ that Jev detects these behaviors correctly or is robust against adversarial prompts. No live
171
+ provider, product UI rollout, runtime hook installation or production enforcement is added here.
172
+
173
+ Sources reviewed: https://docs.typesafe.ai/confidence and
174
+ https://docs.typesafe.ai/model-jaggedness/jev-1.13 (vendor page reviewed 2026-09-17).
@@ -0,0 +1,50 @@
1
+ # Ten useful integrations, one evaluator
2
+
3
+ Jev evaluates bounded questions. Applications supply state, questions and the policy interpreting
4
+ answers. jevEvaluator handles the native model; createEvaluator supports other classifiers.
5
+ asJudge and asAnalyst adapt the same operation to existing consumers.
6
+
7
+ | Use | Outcome | Existing execution path |
8
+ | --- | --- | --- |
9
+ | Completion evidence | Verify a deliverable against requirements and independent artifacts | Native questions plus deterministic checks; unresolved stays unresolved. |
10
+ | Recommendation triage | Prioritize evidence-linked Intelligence recommendations | Product triage selects existing engine findings and preserves their identities. |
11
+ | Trace diagnosis | Narrow likely failures before deeper investigation | AnalystRegistry, scoped evidence, and the existing deep analyst. |
12
+ | Behavioral review | Flag observable policy concerns, not hidden intent | Optional behavior-review recipe plus deterministic reward/control checks. |
13
+ | Rubric judging | Compare product or agent outputs | jevJudge/asJudge with caller mappings and independent final assessment. |
14
+ | Context selection | Select useful retrieved evidence | Native assessments, then deterministic packing with mandatory context protected. |
15
+ | Skill selection | Select from authorized capabilities | Caller alternatives, including no-selection; existing runtime executes actions. |
16
+ | Next verification | Choose a test, retrieval or review that resolves uncertainty | Existing graph checkpoints and awaited boundaries, not new permissions. |
17
+ | Candidate selection | Choose among generated plans or artifacts | Existing matrix/graph, exact checks first, semantic assessment second. |
18
+ | Configuration experiments | Compare questions, context, models and thresholds | examples/jev-decision-benchmark.ts using runAgentMatrix and cost receipts. |
19
+
20
+ These are compositions, not ten new frameworks. Product triage and the benchmark recipe are concrete
21
+ adoption work; other rows reuse existing APIs or identify application policies to configure. An API
22
+ or recipe is not proof that every domain policy has been validated or deployed.
23
+
24
+ ## People, agents and evidence
25
+
26
+ Developers need typed decisions and attributable spend. Operators need evidence, uncertainty and
27
+ an actionable next check. Programmatic agents need stable JSON, explicit failure, a shared budget
28
+ and retained results. Benchmark authors need independent labels that never enter model requests.
29
+
30
+ Before execution, freeze inputs, independent source-unit splits, expected outcomes and configuration
31
+ versions. During execution, retain the native request/answer, served model, receipt, timings and
32
+ selected action. Afterwards, join independent outcomes, corrections and missing evidence. A model
33
+ explanation is not an independent outcome.
34
+
35
+ ## Compare policies with the existing matrix
36
+
37
+ The compareDecisions recipe accepts cases, configurations and an ordinary evaluator. Each case
38
+ separates input from expected decision (or reviewed unresolved label) and sourceUnit. Question
39
+ builders receive only input. Mapping and recording failures remain failed cells with paid costs;
40
+ unknown spend is not measured free. Concurrency, repetitions and budget authority are caller-owned.
41
+ Configuration results use `id@version` keys, with each component URL encoded; duplicate pairs fail
42
+ before execution. This keeps versions of one policy separate in scores and costs.
43
+
44
+ Report accuracy and automation coverage separately: always abstaining does not make a useful agent.
45
+ Reuse existing audit/calibration functions and independent source units rather than inventing another
46
+ statistics layer. The recipe chooses no default model, universal threshold or live request.
47
+
48
+ Changing only a mapping can re-score saved probabilities. Changing context, questions or actions
49
+ requires execution of the affected path. Compare verified outcomes and total spend, not report
50
+ length, finding count or how confidently a model declares success.
package/docs/jev.md ADDED
@@ -0,0 +1,140 @@
1
+ # Typed evaluations: products, judges, and analysts
2
+
3
+ Configure a transport once. Supply your own model, state, and questions on every
4
+ call. Interpret the answers in ordinary code; no campaign or agent is required.
5
+
6
+ ```ts
7
+ import { TypeSafeClient, noul, choice } from '@typesafe-ai/sdk'
8
+ import { jevEvaluator } from '@tangle-network/agent-eval/jev'
9
+
10
+ const client = new TypeSafeClient({
11
+ baseURL: routerOrigin, // Origin without /v1; omit to use TypeSafe directly.
12
+ apiKey: scopedRouterKey,
13
+ retry: { maxRetries: 0 },
14
+ })
15
+ const evaluate = jevEvaluator({
16
+ evaluate: (request, { signal, idempotencyKey }) => client.systemOne(request, {
17
+ signal,
18
+ retry: { maxRetries: 0 },
19
+ headers: { 'Idempotency-Key': idempotencyKey },
20
+ }),
21
+ pricing: reviewedTokenPricing, // An estimate, not a provider-observed charge.
22
+ })
23
+
24
+ const result = await evaluate({
25
+ model: selectedModel,
26
+ state: { requirements, evidence },
27
+ questions: {
28
+ supported: noul('Does the evidence support the claim?'),
29
+ next: choice({ task: 'Choose the next step using the evidence' }, {
30
+ inspect: { when: 'Evidence is missing or contradictory' },
31
+ finish: { when: 'The requirements are satisfied' },
32
+ }),
33
+ },
34
+ }, { signal, costLedger })
35
+
36
+ result.value.answers.next.choice // 'inspect' | 'finish'
37
+ result.value.answers.next.probabilities.inspect // number
38
+ result.receipt // Existing CostLedger receipt, separate from native answers.
39
+ ```
40
+
41
+ The named configuration and evidence values belong to the application. Plain JSON
42
+ questions work too; SDK builders are optional. Structured criteria, null entries,
43
+ and omitted optional fields are supported. Static TypeScript questions preserve
44
+ exact answer names and choice-label unions. Runtime JSON must be validated; its
45
+ labels cannot become compile-time literals automatically.
46
+
47
+ ## Any classifier, not just Jev
48
+
49
+ `createEvaluator`, `asJudge`, and `asAnalyst` are provider-independent exports from
50
+ `@tangle-network/agent-eval/evaluation` (also re-exported from `/jev`).
51
+ `createEvaluator({ execute, receipt })` meters a typed asynchronous function.
52
+ It does not require a Jev response, probability output, prompt, or provider SDK.
53
+
54
+ `jevEvaluator` adds native protocol validation and optional `acceptModel(requested,
55
+ served)` policy. It preserves the reported model instead of guessing alias rules.
56
+ Router independently enforces its supported model and pricing policy.
57
+
58
+ ## Adapt the same observation, without another model call
59
+
60
+ `asJudge({ name, version, dimensions, evaluate, map, record? })` returns the existing
61
+ `JudgeConfig`. The evaluator receives `{ artifact, scenario }` and execution context.
62
+ `map(value, input)` returns the application's `JudgeScore` on its chosen scale.
63
+ `record(result, input)` can persist the full distribution and receipt before reduction.
64
+
65
+ `asAnalyst({ id, version, description, inputKind, cost, evaluate, map, record? })`
66
+ returns the existing `Analyst`. The evaluator receives the input, evaluation context,
67
+ and analyst context. `map(value, input, analystContext)` creates evidence-backed
68
+ findings. Use the existing `makeFinding` factory and real event/span/artifact references.
69
+ An empty finding list is valid; an inference failure is not a clean review.
70
+
71
+ The optional `jevJudge` and `jevAnalyst` conveniences accept static questions or a
72
+ question-producing function. State renderers may be async. Judge renderers receive
73
+ the evaluation context; analyst renderers and finding mappers receive the effective
74
+ cancellation/deadline signal. Rendering must honor that signal during external work.
75
+ Both conveniences accept a `record` callback for the complete observation.
76
+
77
+ For a numeric rubric, `jevJudge` defaults to `normalizedJevScore`: equally spaced
78
+ score expectations on [0,1], noul values unchanged, and an optional weighted mean.
79
+ It emits no canned notes. Supply `map` for choice utilities, different scales, or
80
+ critical-failure policies. Dynamic questions and custom mappings require explicit
81
+ stable output `dimensions`; changing intermediate questions must not silently change
82
+ the metric being compared. Bump `version` when opaque renderers or mappings change.
83
+ Optional undefined fields from SDK builders hash like the JSON they send. Invalid
84
+ JSON evidence, including Map, Date, cycles, and non-finite numbers, is rejected rather
85
+ than silently changed before inference. Convert timestamps explicitly to strings.
86
+
87
+ ## Execution and accounting
88
+
89
+ Use the caller's existing `costLedger`, signal, run tags, and phase. A capped ledger
90
+ requires a genuine transport-enforced maximum charge, not a guessed cost ceiling.
91
+ One injected call represents one paid attempt; do not hide retries at multiple layers.
92
+ An idempotency header is correlation, not proof of upstream inference deduplication.
93
+ Router charges the inference. Eval records attribution and must not charge it again.
94
+
95
+ The shared analyst adapter uses an explicit `AnalystContext.costLedger` first. If
96
+ none is supplied, an explicit `budgetUsd` creates an account for that invocation.
97
+ Otherwise the evaluator keeps its configured ledger, including its cumulative cap
98
+ across direct calls, judges, and analysts. An absent analyst budget never creates a
99
+ fresh unlimited account that overrides the configured one. This precedence is the
100
+ same for Jev and other classifiers. A per-analysis budget replaces the default
101
+ account; it is not an additional child limit. Pass the shared run ledger explicitly
102
+ when the whole run must conserve one authority. Only trusted host code should choose
103
+ or replace that authority.
104
+
105
+ `evaluate(request, { callId, costLedger, signal })` may supply the existing ledger's
106
+ physical paid-call identity. It reaches both `receipt.callId` and the transport's
107
+ `idempotencyKey`. Omit it for a newly allocated identity. Duplicate pending or settled
108
+ calls in the same ledger are refused before another dispatch; they do not return a
109
+ cached result. Preserve a retained observation for replay, and allocate a different
110
+ physical-attempt identity only when a retry is explicitly authorized. This adds no
111
+ cross-credential workflow recovery or provider-side deduplication guarantee.
112
+
113
+ Usage settles before answer validation and mapping. Failed parsing or mapping never
114
+ undoes paid work. Persisted observations remain available even if cancellation prevents
115
+ their reduction to a decision. Unknown costs are not measured zero. `record` is a
116
+ persistence seam, not an automatic cache: callers own storage, authorization, replay
117
+ identity, and resume policy.
118
+
119
+ ## Graphs, hooks, and optimization
120
+
121
+ Use the same evaluator in products, a graph analyst, an awaited local pre/post-call
122
+ function, or a rollout checkpoint. Runtime owns those execution boundaries; Eval does
123
+ not add a scheduler or import Runtime. Observation-only Runtime hooks are not blocking
124
+ controls, and one external sandbox prompt may include many native model requests.
125
+ A delivery check must run before delivery; it cannot retract streamed text or tool effects.
126
+
127
+ Reuse existing campaigns and optimization methods to measure questions, context
128
+ selection, rubric levels, and routing policies. Keep final assessment independent of
129
+ selection and retain exact input/model/policy identities. Do not treat reported model
130
+ confidence as demonstrated calibration or a classification as proof of root cause.
131
+
132
+ ## Checks
133
+
134
+ Run `pnpm exec vitest run tests/jev*.test.ts tests/evaluation-authority.test.ts`,
135
+ `pnpm typecheck`, `pnpm build`, and `pnpm verify:package`. These are contract and
136
+ execution checks, not live-provider quality or deployment evidence. The product-integrity
137
+ rubric lives in `examples/`, not the generic implementation, and is not a default policy.
138
+
139
+ Protocol: https://docs.typesafe.ai/api
140
+ SDK: https://github.com/typesafe-ai/typesafe-sdk-js
@@ -0,0 +1,13 @@
1
+ # Produced state and artifact revisions
2
+
3
+ `extractProducedState(events)` reduces one emission-ordered event stream to the latest observed artifact and proposal state for completion checking. Keep the original stream for history.
4
+
5
+ Artifacts use the exact `name`, then `uri`, then `artifactId` as their identity. A later event for that identity replaces its content and type. Distinct output paths remain distinct even when an emitter reuses an artifact ID. No path normalization, rename, or deletion is inferred.
6
+
7
+ Proposals use `proposalId`. A later rejected or pending observation must not leave an older approval eligible for scoring. Missing content on the latest observation is unknown/empty evidence; it is not filled from an older revision.
8
+
9
+ This behavior correction prevents an overwritten deliverable from satisfying completion through stale text. Consumers that need every historical version should retain the input stream instead of reading the reduced arrays. First-seen identity order is preserved for deterministic output.
10
+
11
+ The helper does not verify a provider transaction. Tool-call names are invocations, not successful execution receipts. An agent-written file claiming payment or delivery is not independently observed merchant or fulfillment evidence. Validate those effects through the owning integration and use the existing completion and trace-verification APIs for the required checks.
12
+
13
+ Input ordering is the caller's responsibility. Do not combine unordered collectors and claim the result is a current snapshot. Unobserved external changes and deletions cannot be reconstructed from this event subset.
@@ -0,0 +1,33 @@
1
+ # Profile JSON identity
2
+
3
+ `toAgentProfileJson` converts a profile's JSON document form through
4
+ `ledger-core/canonical`, the existing owner of canonical serialization. Object
5
+ properties whose value is `undefined` are omitted, including nested optional
6
+ properties. Everything else must have a faithful canonical JSON representation.
7
+ Functions, symbols, non-finite numbers, BigInt, class instances, Map, Set, sparse
8
+ arrays, undefined array members, malformed Unicode and cycles are refused with
9
+ `AgentProfileCellValidationError`. Custom `toJSON` functions are not a way to
10
+ substitute different evidence.
11
+
12
+ This fixes an older conversion that used `JSON.stringify` before validation:
13
+ functions could disappear and non-finite numbers could become null before the
14
+ profile was hashed. Callers must supply portable data rather than depend on those
15
+ coercions. An absent measurement is not a measured null or zero.
16
+
17
+ Cell dimensions preserve every own string key, including `__proto__`. A
18
+ previously stored cell whose dimension was omitted from its digest no longer
19
+ verifies against that dimension. Do not relabel or rewrite an old cell's digest;
20
+ retain the original record as unverifiable and issue a fresh measurement when
21
+ needed. Ordinary portable profiles and dimensions keep the same source hashes
22
+ and cell IDs.
23
+
24
+ `sourceProfile.hash` commits to the profile alone. `sourceProfile.kind` also
25
+ contributes to the cell ID, so a source identity join should compare both kind
26
+ and hash. A loose product-specific fingerprint must not claim to be a validated
27
+ canonical AgentProfile merely because it is JSON-serializable.
28
+
29
+ Regression coverage: `tests/profile-json-canonical.test.ts`, together with the
30
+ existing `tests/agent-profile-cell.test.ts`. Run the repository typecheck, full
31
+ suite, build and package checks before release. This document does not allocate
32
+ or announce a package version; release metadata and downstream peer ranges must
33
+ be updated together by the normal release process.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-eval",
3
- "version": "0.183.0",
3
+ "version": "0.184.0",
4
4
  "description": "Evaluate and improve AI agents from runs, traces, judges, and feedback. Compare candidates, cluster failures, measure lift, and gate releases.",
5
5
  "homepage": "https://github.com/tangle-network/agent-eval#readme",
6
6
  "repository": {
@@ -19,6 +19,11 @@
19
19
  "import": "./dist/index.js",
20
20
  "default": "./dist/index.js"
21
21
  },
22
+ "./jev": {
23
+ "types": "./dist/jev.d.ts",
24
+ "import": "./dist/jev.js",
25
+ "default": "./dist/jev.js"
26
+ },
22
27
  "./profile-cell": {
23
28
  "types": "./dist/profile-cell.d.ts",
24
29
  "import": "./dist/profile-cell.js",
@@ -156,6 +161,16 @@
156
161
  "types": "./dist/adapters/http.d.ts",
157
162
  "import": "./dist/adapters/http.js",
158
163
  "default": "./dist/adapters/http.js"
164
+ },
165
+ "./evaluation": {
166
+ "types": "./dist/evaluation.d.ts",
167
+ "import": "./dist/evaluation.js",
168
+ "default": "./dist/evaluation.js"
169
+ },
170
+ "./jev/protocol": {
171
+ "types": "./dist/jev-protocol.d.ts",
172
+ "import": "./dist/jev-protocol.js",
173
+ "default": "./dist/jev-protocol.js"
159
174
  }
160
175
  },
161
176
  "bin": {