@tangle-network/agent-eval 0.183.0 → 0.185.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 (248) hide show
  1. package/CHANGELOG.md +28 -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 +11 -336
  10. package/dist/analyst/index.d.ts.map +1 -1
  11. package/dist/analyst/index.js +10 -8
  12. package/dist/analyst/index.js.map +1 -1
  13. package/dist/analyze-runs-CrYhqXop.d.ts +75 -0
  14. package/dist/analyze-runs-CrYhqXop.d.ts.map +1 -0
  15. package/dist/{define-agent-eval-CneiWyuA.js → analyze-runs-sTygaDyD.js} +6 -813
  16. package/dist/analyze-runs-sTygaDyD.js.map +1 -0
  17. package/dist/{benchmark-DQKzykkO.js → benchmark-BeQJyrRC.js} +3 -3
  18. package/dist/{benchmark-DQKzykkO.js.map → benchmark-BeQJyrRC.js.map} +1 -1
  19. package/dist/{benchmark-command-NBrqNwgy.js → benchmark-command-kvq7yFY4.js} +17 -54
  20. package/dist/benchmark-command-kvq7yFY4.js.map +1 -0
  21. package/dist/benchmarks/index.d.ts +4 -4
  22. package/dist/benchmarks/index.js +3 -3
  23. package/dist/builder-eval/index.js +1 -1
  24. package/dist/campaign/index.d.ts +6 -5
  25. package/dist/campaign/index.js +10 -9
  26. package/dist/{campaign-BwcEBC91.js → campaign-eJgtRs-W.js} +16 -15
  27. package/dist/{campaign-BwcEBC91.js.map → campaign-eJgtRs-W.js.map} +1 -1
  28. package/dist/{campaign-evidence-PYPUftRy.js → campaign-evidence-BsrCmBSE.js} +7 -258
  29. package/dist/campaign-evidence-BsrCmBSE.js.map +1 -0
  30. package/dist/{canonical-DPyQ_rpt.js → canonical-BsZVgBhW.js} +2 -4
  31. package/dist/canonical-BsZVgBhW.js.map +1 -0
  32. package/dist/cli.js +2 -2
  33. package/dist/{client-kh2jOjTK.d.ts → client-Bc8LANCG.d.ts} +4 -4
  34. package/dist/{client-kh2jOjTK.d.ts.map → client-Bc8LANCG.d.ts.map} +1 -1
  35. package/dist/contract/index.d.ts +10 -10
  36. package/dist/contract/index.js +15 -284
  37. package/dist/contract/index.js.map +1 -1
  38. package/dist/{default-registry-BwDSWVzg.d.ts → default-registry-CXv9kHMt.d.ts} +6 -6
  39. package/dist/{default-registry-BwDSWVzg.d.ts.map → default-registry-CXv9kHMt.d.ts.map} +1 -1
  40. package/dist/{default-registry-C0-N4PkG.js → default-registry-xiHrldW8.js} +6 -4
  41. package/dist/{default-registry-C0-N4PkG.js.map → default-registry-xiHrldW8.js.map} +1 -1
  42. package/dist/define-agent-eval-D4uumjl3.js +813 -0
  43. package/dist/define-agent-eval-D4uumjl3.js.map +1 -0
  44. package/dist/{define-agent-eval-CwOWWQt_.d.ts → define-agent-eval-DE67ECH1.d.ts} +7 -7
  45. package/dist/{define-agent-eval-CwOWWQt_.d.ts.map → define-agent-eval-DE67ECH1.d.ts.map} +1 -1
  46. package/dist/diagnosis/index.d.ts +319 -0
  47. package/dist/diagnosis/index.d.ts.map +1 -0
  48. package/dist/diagnosis/index.js +1328 -0
  49. package/dist/diagnosis/index.js.map +1 -0
  50. package/dist/{dspy-rlm-engine-8pgBSiy7.js → dspy-rlm-engine-BE9lCzzL.js} +3 -3
  51. package/dist/{dspy-rlm-engine-8pgBSiy7.js.map → dspy-rlm-engine-BE9lCzzL.js.map} +1 -1
  52. package/dist/{engine-DS1cysJy.d.ts → engine-cXUK-WHS.d.ts} +5 -77
  53. package/dist/engine-cXUK-WHS.d.ts.map +1 -0
  54. package/dist/equal-terms-Blx9Zk5I.js +25 -0
  55. package/dist/equal-terms-Blx9Zk5I.js.map +1 -0
  56. package/dist/{eval-campaign-CCEkwzoH.js → eval-campaign-XFHEpN86.js} +4 -4
  57. package/dist/{eval-campaign-CCEkwzoH.js.map → eval-campaign-XFHEpN86.js.map} +1 -1
  58. package/dist/evaluation.d.ts +75 -0
  59. package/dist/evaluation.d.ts.map +1 -0
  60. package/dist/evaluation.js +137 -0
  61. package/dist/evaluation.js.map +1 -0
  62. package/dist/{exact-types-BZDe0W2D.d.ts → exact-types-BEHN7tnq.d.ts} +2 -2
  63. package/dist/{exact-types-BZDe0W2D.d.ts.map → exact-types-BEHN7tnq.d.ts.map} +1 -1
  64. package/dist/experiment/index.d.ts +2 -2
  65. package/dist/experiment/index.js +6 -5
  66. package/dist/experiment/index.js.map +1 -1
  67. package/dist/{experiment-tracker-C7PfnF4b.d.ts → experiment-tracker-URRGP9ek.d.ts} +2 -2
  68. package/dist/{experiment-tracker-C7PfnF4b.d.ts.map → experiment-tracker-URRGP9ek.d.ts.map} +1 -1
  69. package/dist/{external-optimizer-process-DIB4YWEe.js → external-optimizer-process-BbhvXTFx.js} +4 -4
  70. package/dist/{external-optimizer-process-DIB4YWEe.js.map → external-optimizer-process-BbhvXTFx.js.map} +1 -1
  71. package/dist/{external-optimizer-subprocess-CjguXN2e.js → external-optimizer-subprocess-DMgmqTB6.js} +3 -3
  72. package/dist/{external-optimizer-subprocess-CjguXN2e.js.map → external-optimizer-subprocess-DMgmqTB6.js.map} +1 -1
  73. package/dist/{feedback-trajectory-CXmtITBo.d.ts → feedback-trajectory-CytTR7u4.d.ts} +3 -3
  74. package/dist/{feedback-trajectory-CXmtITBo.d.ts.map → feedback-trajectory-CytTR7u4.d.ts.map} +1 -1
  75. package/dist/hosted/index.d.ts +2 -2
  76. package/dist/{index-DoykkxW0.d.ts → index-BQWfAFeH.d.ts} +11 -11
  77. package/dist/{index-DoykkxW0.d.ts.map → index-BQWfAFeH.d.ts.map} +1 -1
  78. package/dist/{index-DbG8QbH9.d.ts → index-C8_iU8KL.d.ts} +6 -6
  79. package/dist/{index-DbG8QbH9.d.ts.map → index-C8_iU8KL.d.ts.map} +1 -1
  80. package/dist/{index--_8_Nlpn.d.ts → index-CKZa_rnt.d.ts} +4 -121
  81. package/dist/index-CKZa_rnt.d.ts.map +1 -0
  82. package/dist/{index-Bp_6sj3x.d.ts → index-ww8736Am.d.ts} +20 -315
  83. package/dist/index-ww8736Am.d.ts.map +1 -0
  84. package/dist/index.d.ts +24 -22
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +25 -24
  87. package/dist/index.js.map +1 -1
  88. package/dist/{insight-report-D1qa0HWs.d.ts → insight-report-C3Bfl762.d.ts} +3 -3
  89. package/dist/{insight-report-D1qa0HWs.d.ts.map → insight-report-C3Bfl762.d.ts.map} +1 -1
  90. package/dist/jev-protocol.d.ts +74 -0
  91. package/dist/jev-protocol.d.ts.map +1 -0
  92. package/dist/jev-protocol.js +91 -0
  93. package/dist/jev-protocol.js.map +1 -0
  94. package/dist/jev.d.ts +131 -0
  95. package/dist/jev.d.ts.map +1 -0
  96. package/dist/jev.js +312 -0
  97. package/dist/jev.js.map +1 -0
  98. package/dist/{journal-Cs9f7385.js → journal-BuRLm6ho.js} +2 -2
  99. package/dist/{journal-Cs9f7385.js.map → journal-BuRLm6ho.js.map} +1 -1
  100. package/dist/{kind-factory-DxTzg32u.js → kind-factory-V79Hw0AU.js} +7 -84
  101. package/dist/kind-factory-V79Hw0AU.js.map +1 -0
  102. package/dist/ledger-core/index.js +2 -2
  103. package/dist/{llm-judge-FfaRgz9X.js → llm-judge-FWWhEb31.js} +11 -9
  104. package/dist/{llm-judge-FfaRgz9X.js.map → llm-judge-FWWhEb31.js.map} +1 -1
  105. package/dist/{matrix-CyhW-vgJ.d.ts → matrix-CPKsRY8Y.d.ts} +2 -2
  106. package/dist/{matrix-CyhW-vgJ.d.ts.map → matrix-CPKsRY8Y.d.ts.map} +1 -1
  107. package/dist/meta-eval/index.d.ts +54 -2
  108. package/dist/meta-eval/index.d.ts.map +1 -1
  109. package/dist/meta-eval/index.js +52 -3
  110. package/dist/meta-eval/index.js.map +1 -1
  111. package/dist/{mint-ySIIkKlV.js → mint-B4zgSAJW.js} +63 -14
  112. package/dist/mint-B4zgSAJW.js.map +1 -0
  113. package/dist/mint-BI14xehJ.d.ts +285 -0
  114. package/dist/mint-BI14xehJ.d.ts.map +1 -0
  115. package/dist/multishot/golden/index.d.ts +1 -1
  116. package/dist/multishot/index.d.ts +2 -2
  117. package/dist/openapi.json +1 -1
  118. package/dist/otel-spans-CQY1pNiN.js +275 -0
  119. package/dist/otel-spans-CQY1pNiN.js.map +1 -0
  120. package/dist/otlp-attributes-BpC_blLF.js +83 -0
  121. package/dist/otlp-attributes-BpC_blLF.js.map +1 -0
  122. package/dist/{run-record-DPa2PeHx.js → paired-promotion-decision-ClJh_9nK.js} +2 -215
  123. package/dist/paired-promotion-decision-ClJh_9nK.js.map +1 -0
  124. package/dist/pipelines/index.js +2 -2
  125. package/dist/prime-bridge-transport-Z3cpKGoV.js +43 -0
  126. package/dist/prime-bridge-transport-Z3cpKGoV.js.map +1 -0
  127. package/dist/prime-protocol-CDBcL9NM.d.ts +331 -0
  128. package/dist/prime-protocol-CDBcL9NM.d.ts.map +1 -0
  129. package/dist/{prime-protocol-6tZTVsWm.js → prime-protocol-DcAK9pC8.js} +2 -23
  130. package/dist/prime-protocol-DcAK9pC8.js.map +1 -0
  131. package/dist/{produced-state-CGoVInrl.js → produced-state-CmB02tr2.js} +23 -19
  132. package/dist/{produced-state-CGoVInrl.js.map → produced-state-CmB02tr2.js.map} +1 -1
  133. package/dist/profile-cell.d.ts +1 -1
  134. package/dist/profile-cell.js +1 -1
  135. package/dist/{promotion-policy-BKFrl7CC.js → promotion-policy-DdrYWHDh.js} +3 -3
  136. package/dist/{promotion-policy-BKFrl7CC.js.map → promotion-policy-DdrYWHDh.js.map} +1 -1
  137. package/dist/{query-D1nLIKt7.js → query-DlV0pdx4.js} +2 -2
  138. package/dist/{query-D1nLIKt7.js.map → query-DlV0pdx4.js.map} +1 -1
  139. package/dist/{registry-BRbB6Y0v.d.ts → registry-D5Ly3GRV.d.ts} +3 -3
  140. package/dist/{registry-BRbB6Y0v.d.ts.map → registry-D5Ly3GRV.d.ts.map} +1 -1
  141. package/dist/{release-confidence-BcqeQTHW.d.ts → release-confidence-DsETiO4f.d.ts} +3 -3
  142. package/dist/{release-confidence-BcqeQTHW.d.ts.map → release-confidence-DsETiO4f.d.ts.map} +1 -1
  143. package/dist/{release-confidence-DMg8n18l.js → release-confidence-RanRUXRW.js} +2 -2
  144. package/dist/{release-confidence-DMg8n18l.js.map → release-confidence-RanRUXRW.js.map} +1 -1
  145. package/dist/reporting.d.ts +3 -3
  146. package/dist/reporting.js +2 -2
  147. package/dist/{researcher-64T49THL.d.ts → researcher-CJkH-6Ty.d.ts} +4 -4
  148. package/dist/{researcher-64T49THL.d.ts.map → researcher-CJkH-6Ty.d.ts.map} +1 -1
  149. package/dist/{reward-hacking-uzO_ihep.d.ts → reward-hacking-BIQ2BWLG.d.ts} +2 -2
  150. package/dist/{reward-hacking-uzO_ihep.d.ts.map → reward-hacking-BIQ2BWLG.d.ts.map} +1 -1
  151. package/dist/rl.d.ts +10 -6
  152. package/dist/rl.d.ts.map +1 -1
  153. package/dist/rl.js +22 -7
  154. package/dist/rl.js.map +1 -1
  155. package/dist/rollout/index.d.ts +2 -2
  156. package/dist/rollout/index.js +2 -2
  157. package/dist/{rollout-D_54FZVu.js → rollout-C0Ifk3vK.js} +2 -2
  158. package/dist/{rollout-D_54FZVu.js.map → rollout-C0Ifk3vK.js.map} +1 -1
  159. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts → rubric-predictive-validity-CTU8y8Cv.d.ts} +2 -2
  160. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts.map → rubric-predictive-validity-CTU8y8Cv.d.ts.map} +1 -1
  161. package/dist/run-record-CNNzWGpB.js +216 -0
  162. package/dist/run-record-CNNzWGpB.js.map +1 -0
  163. package/dist/{run-record-BiTWauyO.d.ts → run-record-D9wS35fK.d.ts} +2 -2
  164. package/dist/{run-record-BiTWauyO.d.ts.map → run-record-D9wS35fK.d.ts.map} +1 -1
  165. package/dist/{run-record-DualPTn2.js → run-record-tg_5H2IK.js} +2 -2
  166. package/dist/{run-record-DualPTn2.js.map → run-record-tg_5H2IK.js.map} +1 -1
  167. package/dist/search-ledger-types-D7KDVg-o.d.ts +302 -0
  168. package/dist/search-ledger-types-D7KDVg-o.d.ts.map +1 -0
  169. package/dist/{semantic-concept-judge-_3Fp6Q_3.js → semantic-concept-judge-Cnt0TWp0.js} +4 -4
  170. package/dist/{semantic-concept-judge-_3Fp6Q_3.js.map → semantic-concept-judge-Cnt0TWp0.js.map} +1 -1
  171. package/dist/{sequential-D_xHrBZe.js → sequential-PgLEqcTJ.js} +3 -3
  172. package/dist/{sequential-D_xHrBZe.js.map → sequential-PgLEqcTJ.js.map} +1 -1
  173. package/dist/{server-BZQR1f0C.js → server-DmpcFiVK.js} +2 -2
  174. package/dist/{server-BZQR1f0C.js.map → server-DmpcFiVK.js.map} +1 -1
  175. package/dist/{skillopt-optimization-method-DY1aQ-aL.js → skillopt-optimization-method-FSk8b5FQ.js} +8 -7
  176. package/dist/{skillopt-optimization-method-DY1aQ-aL.js.map → skillopt-optimization-method-FSk8b5FQ.js.map} +1 -1
  177. package/dist/{statistical-heldout-CpVd6FmY.d.ts → statistical-heldout-Bu4oNOJh.d.ts} +3 -3
  178. package/dist/{statistical-heldout-CpVd6FmY.d.ts.map → statistical-heldout-Bu4oNOJh.d.ts.map} +1 -1
  179. package/dist/statistical-heldout-CeWT_W7y.js +256 -0
  180. package/dist/statistical-heldout-CeWT_W7y.js.map +1 -0
  181. package/dist/{store-otlp-DAaEbMLf.js → store-otlp-2gYCy-v0.js} +2 -2
  182. package/dist/{store-otlp-DAaEbMLf.js.map → store-otlp-2gYCy-v0.js.map} +1 -1
  183. package/dist/{store-tool-spans-BZ8MPKFe.js → store-tool-spans-B1e6Auc2.js} +69 -6
  184. package/dist/store-tool-spans-B1e6Auc2.js.map +1 -0
  185. package/dist/{store-tool-spans-Dt-YdAuE.d.ts → store-tool-spans-BrdfPaVh.d.ts} +54 -6
  186. package/dist/store-tool-spans-BrdfPaVh.d.ts.map +1 -0
  187. package/dist/{summary-report-IGAOtgPd.js → summary-report-BMvou2oZ.js} +2 -2
  188. package/dist/{summary-report-IGAOtgPd.js.map → summary-report-BMvou2oZ.js.map} +1 -1
  189. package/dist/{summary-report-D1h4dlrK.d.ts → summary-report-BzFS5UhZ.d.ts} +2 -2
  190. package/dist/{summary-report-D1h4dlrK.d.ts.map → summary-report-BzFS5UhZ.d.ts.map} +1 -1
  191. package/dist/{task-failure-attributes-B_JjrOVo.js → task-failure-attributes-B34TiMBe.js} +2 -2
  192. package/dist/{task-failure-attributes-B_JjrOVo.js.map → task-failure-attributes-B34TiMBe.js.map} +1 -1
  193. package/dist/{tool-groups-B2bSNaJB.d.ts → tool-groups-eOOgYGaM.d.ts} +3 -3
  194. package/dist/tool-groups-eOOgYGaM.d.ts.map +1 -0
  195. package/dist/{tool-waste-C7MU9u1e.js → tool-waste-nbHPAxei.js} +2 -2
  196. package/dist/{tool-waste-C7MU9u1e.js.map → tool-waste-nbHPAxei.js.map} +1 -1
  197. package/dist/trace-repair/index.d.ts +2 -2
  198. package/dist/trace-repair/index.js +5 -4
  199. package/dist/trace-repair/index.js.map +1 -1
  200. package/dist/traces.d.ts +5 -5
  201. package/dist/traces.js +8 -7
  202. package/dist/traces.js.map +1 -1
  203. package/dist/trajectory-replay/index.js +1 -1
  204. package/dist/{types-CS0qk_Yp.d.ts → types-BTRcIqFr.d.ts} +3 -3
  205. package/dist/{types-CS0qk_Yp.d.ts.map → types-BTRcIqFr.d.ts.map} +1 -1
  206. package/dist/{types-D7gEdPoQ.d.ts → types-BjB2wZM9.d.ts} +2 -2
  207. package/dist/{types-D7gEdPoQ.d.ts.map → types-BjB2wZM9.d.ts.map} +1 -1
  208. package/dist/types-C8VBbiw6.js +91 -0
  209. package/dist/types-C8VBbiw6.js.map +1 -0
  210. package/dist/{types-BvZoPTGa.d.ts → types-c3ZRTbw9.d.ts} +3 -3
  211. package/dist/{types-BvZoPTGa.d.ts.map → types-c3ZRTbw9.d.ts.map} +1 -1
  212. package/dist/{types-DQ0e2E7y.js → usage-receipt-Cx3xNeyB.js} +2 -89
  213. package/dist/usage-receipt-Cx3xNeyB.js.map +1 -0
  214. package/dist/{verdict-BQ3pCFf8.js → verdict-DhPoXApk.js} +2 -2
  215. package/dist/{verdict-BQ3pCFf8.js.map → verdict-DhPoXApk.js.map} +1 -1
  216. package/dist/{verdict-cache-B3eCVQtY.js → verdict-cache-BQEsVy9n.js} +2 -2
  217. package/dist/{verdict-cache-B3eCVQtY.js.map → verdict-cache-BQEsVy9n.js.map} +1 -1
  218. package/dist/wire/index.d.ts +1 -1
  219. package/dist/wire/index.js +1 -1
  220. package/docs/changes/evaluation-definition-identity.md +27 -0
  221. package/docs/changes/jev-evidence-review.md +18 -0
  222. package/docs/changes/jev-product-adoption.md +18 -0
  223. package/docs/changes/probability-policy-audit.md +81 -0
  224. package/docs/diagnosis.md +42 -0
  225. package/docs/jev-behavior-review.md +174 -0
  226. package/docs/jev-integrations.md +50 -0
  227. package/docs/jev.md +140 -0
  228. package/docs/produced-state.md +13 -0
  229. package/docs/profile-json-identity.md +33 -0
  230. package/package.json +22 -1
  231. package/dist/agent-profile-cell-Cv6UA-W_.js.map +0 -1
  232. package/dist/benchmark-command-NBrqNwgy.js.map +0 -1
  233. package/dist/campaign-evidence-PYPUftRy.js.map +0 -1
  234. package/dist/canonical-DPyQ_rpt.js.map +0 -1
  235. package/dist/define-agent-eval-CneiWyuA.js.map +0 -1
  236. package/dist/engine-DS1cysJy.d.ts.map +0 -1
  237. package/dist/exporters-D98GPi1n.d.ts +0 -161
  238. package/dist/exporters-D98GPi1n.d.ts.map +0 -1
  239. package/dist/index--_8_Nlpn.d.ts.map +0 -1
  240. package/dist/index-Bp_6sj3x.d.ts.map +0 -1
  241. package/dist/kind-factory-DxTzg32u.js.map +0 -1
  242. package/dist/mint-ySIIkKlV.js.map +0 -1
  243. package/dist/prime-protocol-6tZTVsWm.js.map +0 -1
  244. package/dist/run-record-DPa2PeHx.js.map +0 -1
  245. package/dist/store-tool-spans-BZ8MPKFe.js.map +0 -1
  246. package/dist/store-tool-spans-Dt-YdAuE.d.ts.map +0 -1
  247. package/dist/tool-groups-B2bSNaJB.d.ts.map +0 -1
  248. package/dist/types-DQ0e2E7y.js.map +0 -1
@@ -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.185.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",
@@ -134,6 +139,11 @@
134
139
  "import": "./dist/trace-repair/index.js",
135
140
  "default": "./dist/trace-repair/index.js"
136
141
  },
142
+ "./diagnosis": {
143
+ "types": "./dist/diagnosis/index.d.ts",
144
+ "import": "./dist/diagnosis/index.js",
145
+ "default": "./dist/diagnosis/index.js"
146
+ },
137
147
  "./experiment": {
138
148
  "types": "./dist/experiment/index.d.ts",
139
149
  "import": "./dist/experiment/index.js",
@@ -156,6 +166,16 @@
156
166
  "types": "./dist/adapters/http.d.ts",
157
167
  "import": "./dist/adapters/http.js",
158
168
  "default": "./dist/adapters/http.js"
169
+ },
170
+ "./evaluation": {
171
+ "types": "./dist/evaluation.d.ts",
172
+ "import": "./dist/evaluation.js",
173
+ "default": "./dist/evaluation.js"
174
+ },
175
+ "./jev/protocol": {
176
+ "types": "./dist/jev-protocol.d.ts",
177
+ "import": "./dist/jev-protocol.js",
178
+ "default": "./dist/jev-protocol.js"
159
179
  }
160
180
  },
161
181
  "bin": {
@@ -211,6 +231,7 @@
211
231
  "@arizeai/phoenix-evals": "^2.3.0",
212
232
  "@biomejs/biome": "^2.5.11",
213
233
  "@types/node": "^26.4.0",
234
+ "ajv": "8.20.0",
214
235
  "autoevals": "^0.3.0",
215
236
  "esbuild": "^0.28.2",
216
237
  "fast-check": "^4.9.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-profile-cell-Cv6UA-W_.js","names":[],"sources":["../src/pre-registration.ts","../src/agent-profile-cell.ts"],"sourcesContent":["/**\n * Pre-registered hypotheses — declare what you're testing BEFORE the\n * run, check it AFTER. Prevents p-hacking, optional stopping, and the\n * \"we ran until it looked good\" failure mode.\n *\n * Manifest is a plain JSON-friendly object. Sign it with a content hash\n * + timestamp; the registered record becomes immutable. Post-run,\n * evaluate the manifest against observed results — the library refuses\n * to let you re-interpret a different metric as the declared one.\n *\n * A signed manifest carries its required digest scheme. Verification accepts\n * only RFC 8785 canonical JSON, using the same encoder as every new identity.\n */\n\nimport { hashCanonical } from './ledger-core/canonical'\n\nexport interface HypothesisManifest {\n id: string\n /** Human prose — goes into the audit trail. */\n hypothesis: string\n /** Metric the hypothesis claims to move. */\n metric: string\n /** 'increase' = candidate should score higher than baseline; 'decrease' = lower. */\n direction: 'increase' | 'decrease'\n /** Minimum effect size to count (same units as the metric). */\n minEffect: number\n /** Alpha threshold. */\n alpha: number\n /** Target statistical power at which sample size was pre-computed. */\n power: number\n /** Declared N per arm before running. */\n preRegisteredN: number\n /** ISO8601 timestamp the manifest was registered. */\n registeredAt: string\n /** Optional identifiers to tie into the trace corpus. */\n baselineLabel?: string\n candidateLabel?: string\n}\n\n/** SHA-256 over RFC 8785 canonical JSON, excluding `contentHash` and `algo`. */\nexport type SignedManifestAlgo = 'sha256-rfc8785'\n\nexport interface SignedManifest extends HypothesisManifest {\n /** sha256 hex of canonicalized manifest (everything except contentHash and algo). */\n contentHash: string\n /** Required digest scheme. Missing or unsupported schemes fail verification. */\n algo: SignedManifestAlgo\n}\n\nexport interface HypothesisResult {\n manifest: SignedManifest\n observedN: number\n observedEffect: number\n observedPValue: number\n /** True iff the observed effect hits the pre-declared direction with\n * magnitude ≥ minEffect AND p < alpha. */\n confirmed: boolean\n /** Enumerated reasons the hypothesis was rejected (each a machine-tag). */\n rejectionReasons: Array<\n 'wrong_direction' | 'effect_too_small' | 'not_significant' | 'undersampled'\n >\n notes?: string\n}\n\n/**\n * SHA-256 hex (full 64 chars) over the RFC 8785 canonical JSON encoding of\n * `obj` — the package's one identity scheme, shared with `ledger-core`.\n *\n * Values canonical JSON cannot represent faithfully — `undefined`, `NaN`,\n * class instances, cycles — are refused rather than coerced, because a\n * coercion maps two distinct records onto one digest.\n *\n * Named `hashJson` to disambiguate from `prompt-registry.ts`'s `hashContent`,\n * which takes a string input and returns a truncated 12-char prompt id.\n *\n * @example\n * const hash = await hashJson({ id: '1', kind: 'spec' })\n * // 'a3f1...' (64 hex chars)\n */\nexport async function hashJson<T>(obj: T): Promise<string> {\n return hashCanonical(obj).slice('sha256:'.length)\n}\n\n/**\n * Digest a manifest after validating its scheme, excluding `contentHash` and\n * `algo`. This synchronous check can refuse a manifest before consuming data.\n */\nexport function manifestContentDigest(manifest: SignedManifest): string {\n const { contentHash: _contentHash, algo, ...rest } = manifest\n void _contentHash\n if (algo !== 'sha256-rfc8785') {\n throw new Error(`pre-registration: unsupported manifest hash algo '${String(algo)}'`)\n }\n return hashCanonical(rest).slice('sha256:'.length)\n}\n\n/**\n * Sign a manifest with a SHA-256 content hash over its RFC 8785 canonical\n * JSON, with `contentHash` and `algo` stripped, and stamp the scheme in\n * `algo` so a later reader knows which encoder to verify with.\n */\nexport async function signManifest(m: HypothesisManifest): Promise<SignedManifest> {\n const signed: SignedManifest = { ...m, contentHash: '', algo: 'sha256-rfc8785' }\n return { ...signed, contentHash: manifestContentDigest(signed) }\n}\n\n/**\n * Verify that a signed manifest has not been tampered with, under the scheme\n * the manifest itself declares.\n */\nexport async function verifyManifest(m: SignedManifest): Promise<boolean> {\n try {\n return manifestContentDigest(m) === m.contentHash\n } catch {\n return false\n }\n}\n\n/**\n * Evaluate a pre-registered hypothesis against observed results.\n * Mechanical — no re-interpretation permitted.\n */\nexport async function evaluateHypothesis(\n manifest: SignedManifest,\n observed: { n: number; effect: number; pValue: number },\n): Promise<HypothesisResult> {\n if (!(await verifyManifest(manifest))) {\n throw new Error('evaluateHypothesis: unsupported manifest hash scheme or content hash mismatch')\n }\n const reasons: HypothesisResult['rejectionReasons'] = []\n const directionOk = manifest.direction === 'increase' ? observed.effect > 0 : observed.effect < 0\n if (!directionOk) reasons.push('wrong_direction')\n if (Math.abs(observed.effect) < manifest.minEffect) reasons.push('effect_too_small')\n if (observed.pValue >= manifest.alpha) reasons.push('not_significant')\n if (observed.n < manifest.preRegisteredN) reasons.push('undersampled')\n return {\n manifest,\n observedN: observed.n,\n observedEffect: observed.effect,\n observedPValue: observed.pValue,\n confirmed: reasons.length === 0,\n rejectionReasons: reasons,\n }\n}\n","import type { AgentProfile } from '@tangle-network/agent-interface'\nimport { ValidationError } from './errors'\nimport { hashJson } from './pre-registration'\n\nexport type AgentProfileCellSchemaVersion = 'agent-profile-cell/v1'\n\nexport type AgentProfileJsonObject = { [key: string]: AgentProfileJson }\n\nexport type AgentProfileJson =\n | string\n | number\n | boolean\n | null\n | AgentProfileJson[]\n | AgentProfileJsonObject\n\nexport type AgentProfileDimensionValue = string | number | boolean | null\n\nexport interface AgentProfileSource {\n /** Runtime/profile contract being fingerprinted, e.g. `agent-interface-profile`. */\n kind: string\n /** sha256 over the canonical source profile object. */\n hash: string\n}\n\nexport interface AgentProfileSourceInput {\n kind: string\n /** Precomputed sha256 for callers that already sign their profile artifact. */\n hash?: string\n /** Full canonical runtime profile; hashed and then discarded from the cell. */\n profile?: AgentProfileJson\n}\n\nexport interface AgentProfileHarness {\n id: string\n version?: string\n hash?: string\n}\n\nexport interface AgentProfileCellInput {\n profileId: string\n sourceProfile: AgentProfileSourceInput\n harness?: AgentProfileHarness\n model?: string\n promptHash?: string\n dimensions?: Record<string, AgentProfileDimensionValue>\n}\n\nexport interface AgentProfileCell {\n schemaVersion: AgentProfileCellSchemaVersion\n cellId: string\n profileId: string\n sourceProfile: AgentProfileSource\n harness?: AgentProfileHarness\n model?: string\n promptHash?: string\n dimensions?: Record<string, AgentProfileDimensionValue>\n}\n\nexport class AgentProfileCellValidationError extends ValidationError {\n readonly path: string\n constructor(message: string, path = '') {\n super(path ? `${message} (at ${path})` : message)\n this.path = path\n }\n}\n\nconst SHA256_HEX = /^[0-9a-f]{64}$/\n/** A cell id carries the canonical digest scheme required for verification. */\nconst CELL_ID = /^agent-profile-cell:sha256-rfc8785:[0-9a-f]{64}$/\nconst CELL_ID_PREFIX = 'agent-profile-cell:sha256-rfc8785:'\n\nexport async function buildAgentProfileCell(\n input: AgentProfileCellInput,\n): Promise<AgentProfileCell> {\n const material = await normalizeAgentProfileCellInput(input)\n const cellId = `${CELL_ID_PREFIX}${await hashJson(material)}`\n return { ...material, cellId }\n}\n\nexport function agentProfileCellHashMaterial(\n cell: AgentProfileCell,\n): Omit<AgentProfileCell, 'cellId'> {\n const { cellId: _cellId, ...material } = cell\n void _cellId\n return normalizeAgentProfileCell(material)\n}\n\n/**\n * Verify an `AgentProfileCell`'s `cellId` matches the sha256 of its hash-material\n * fields, confirming the record has not been tampered with. Unsupported digest\n * schemes are refused before comparing the material.\n */\nexport async function verifyAgentProfileCell(cell: AgentProfileCell): Promise<boolean> {\n validateAgentProfileCell(cell)\n const material = agentProfileCellHashMaterial(cell)\n return cell.cellId === `${CELL_ID_PREFIX}${await hashJson(material)}`\n}\n\nexport function validateAgentProfileCell(input: unknown): AgentProfileCell {\n if (input === null || typeof input !== 'object') {\n throw new AgentProfileCellValidationError('expected object')\n }\n const obj = input as Record<string, unknown>\n expectLiteral(obj.schemaVersion, 'agent-profile-cell/v1', 'schemaVersion')\n if (typeof obj.cellId !== 'string' || !CELL_ID.test(obj.cellId)) {\n throw new AgentProfileCellValidationError(\n 'cellId must match agent-profile-cell:sha256-rfc8785:<64 lowercase hex chars>',\n 'cellId',\n )\n }\n expectString(obj.profileId, 'profileId')\n validateSource(obj.sourceProfile, 'sourceProfile')\n if (obj.harness !== undefined) validateHarness(obj.harness, 'harness')\n if (obj.model !== undefined) expectString(obj.model, 'model')\n if (obj.promptHash !== undefined) expectString(obj.promptHash, 'promptHash')\n if (obj.dimensions !== undefined) validateDimensions(obj.dimensions, 'dimensions')\n return input as AgentProfileCell\n}\n\nexport function requireAgentProfileCell(record: {\n runId: string\n agentProfile?: AgentProfileCell\n}): AgentProfileCell {\n if (!record.agentProfile) {\n throw new AgentProfileCellValidationError(\n `run \"${record.runId}\" is missing agentProfile; profile-cell grouping requires explicit profile identity`,\n 'agentProfile',\n )\n }\n return validateAgentProfileCell(record.agentProfile)\n}\n\nexport function agentProfileCellKey(record: {\n runId: string\n agentProfile?: AgentProfileCell\n}): string {\n return requireAgentProfileCell(record).cellId\n}\n\nexport async function assertRunAgentProfileCell(record: {\n runId: string\n model: string\n promptHash: string\n agentProfile?: AgentProfileCell\n}): Promise<AgentProfileCell> {\n const profile = requireAgentProfileCell(record)\n if (!(await verifyAgentProfileCell(profile))) {\n throw new AgentProfileCellValidationError(\n `run \"${record.runId}\" has an agentProfile.cellId that does not match its content`,\n 'agentProfile.cellId',\n )\n }\n if (profile.model !== undefined && profile.model !== record.model) {\n throw new AgentProfileCellValidationError(\n `run \"${record.runId}\" agentProfile.model \"${profile.model}\" does not match model \"${record.model}\"`,\n 'agentProfile.model',\n )\n }\n if (profile.promptHash !== undefined && profile.promptHash !== record.promptHash) {\n throw new AgentProfileCellValidationError(\n `run \"${record.runId}\" agentProfile.promptHash \"${profile.promptHash}\" does not match promptHash \"${record.promptHash}\"`,\n 'agentProfile.promptHash',\n )\n }\n return profile\n}\n\nexport function groupRunsByAgentProfileCell<\n T extends { runId: string; agentProfile?: AgentProfileCell },\n>(records: readonly T[]): Map<string, T[]> {\n const groups = new Map<string, T[]>()\n for (const record of records) {\n const key = agentProfileCellKey(record)\n const bucket = groups.get(key)\n if (bucket) bucket.push(record)\n else groups.set(key, [record])\n }\n return groups\n}\n\nasync function normalizeAgentProfileCellInput(\n input: AgentProfileCellInput,\n): Promise<Omit<AgentProfileCell, 'cellId'>> {\n return normalizeAgentProfileCell({\n schemaVersion: 'agent-profile-cell/v1',\n profileId: input.profileId,\n sourceProfile: await normalizeSourceInput(input.sourceProfile),\n harness: input.harness,\n model: input.model,\n promptHash: input.promptHash,\n dimensions: input.dimensions,\n })\n}\n\nfunction normalizeAgentProfileCell(\n input: Omit<AgentProfileCell, 'cellId'>,\n): Omit<AgentProfileCell, 'cellId'> {\n return compactObject({\n schemaVersion: 'agent-profile-cell/v1' as const,\n profileId: requireNonEmpty(input.profileId, 'profileId'),\n sourceProfile: normalizeSource(input.sourceProfile),\n harness: input.harness ? normalizeHarness(input.harness, 'harness') : undefined,\n model: optionalNonEmpty(input.model, 'model'),\n promptHash: optionalNonEmpty(input.promptHash, 'promptHash'),\n dimensions: input.dimensions\n ? nonEmptyRecord(normalizeDimensions(input.dimensions))\n : undefined,\n })\n}\n\nasync function normalizeSourceInput(input: AgentProfileSourceInput): Promise<AgentProfileSource> {\n const kind = requireNonEmpty(input.kind, 'sourceProfile.kind')\n if (input.hash !== undefined && input.profile !== undefined) {\n throw new AgentProfileCellValidationError(\n 'sourceProfile must provide either hash or profile, not both',\n 'sourceProfile',\n )\n }\n if (input.hash !== undefined) {\n return { kind, hash: requireSha256Hex(input.hash, 'sourceProfile.hash') }\n }\n if (input.profile === undefined) {\n throw new AgentProfileCellValidationError(\n 'sourceProfile must provide hash or profile',\n 'sourceProfile',\n )\n }\n assertJson(input.profile, 'sourceProfile.profile')\n return { kind, hash: await hashJson(input.profile) }\n}\n\nfunction normalizeSource(input: AgentProfileSource): AgentProfileSource {\n return {\n kind: requireNonEmpty(input.kind, 'sourceProfile.kind'),\n hash: requireSha256Hex(input.hash, 'sourceProfile.hash'),\n }\n}\n\nfunction normalizeHarness(input: AgentProfileHarness, path: string): AgentProfileHarness {\n return compactObject({\n id: requireNonEmpty(input.id, `${path}.id`),\n version: optionalNonEmpty(input.version, `${path}.version`),\n hash: optionalNonEmpty(input.hash, `${path}.hash`),\n })\n}\n\nfunction normalizeDimensions(\n input: Record<string, AgentProfileDimensionValue>,\n): Record<string, AgentProfileDimensionValue> {\n const out: Record<string, AgentProfileDimensionValue> = {}\n for (const key of Object.keys(input).sort()) {\n const value = input[key]\n requireNonEmpty(key, 'dimensions.<key>')\n if (\n value !== null &&\n typeof value !== 'string' &&\n typeof value !== 'number' &&\n typeof value !== 'boolean'\n ) {\n throw new AgentProfileCellValidationError(\n 'expected primitive dimension value',\n `dimensions.${key}`,\n )\n }\n if (typeof value === 'number' && !Number.isFinite(value)) {\n throw new AgentProfileCellValidationError('expected finite number', `dimensions.${key}`)\n }\n out[key] = value\n }\n return out\n}\n\nfunction compactObject<T extends Record<string, unknown>>(input: T): T {\n const out: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(input)) {\n if (value !== undefined) out[key] = value\n }\n return out as T\n}\n\nfunction nonEmptyRecord<T extends Record<string, unknown>>(input: T): T | undefined {\n return Object.keys(input).length > 0 ? input : undefined\n}\n\nfunction validateSource(value: unknown, path: string): void {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new AgentProfileCellValidationError('expected object', path)\n }\n const rec = value as Record<string, unknown>\n expectString(rec.kind, `${path}.kind`)\n requireSha256Hex(rec.hash, `${path}.hash`)\n}\n\nfunction validateHarness(value: unknown, path: string): void {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new AgentProfileCellValidationError('expected object', path)\n }\n const rec = value as Record<string, unknown>\n expectString(rec.id, `${path}.id`)\n if (rec.version !== undefined) expectString(rec.version, `${path}.version`)\n if (rec.hash !== undefined) expectString(rec.hash, `${path}.hash`)\n}\n\nfunction validateDimensions(value: unknown, path: string): void {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new AgentProfileCellValidationError('expected object', path)\n }\n normalizeDimensions(value as Record<string, AgentProfileDimensionValue>)\n}\n\nfunction assertJson(value: AgentProfileJson, path: string): void {\n if (value === null) return\n const type = typeof value\n if (type === 'string' || type === 'boolean') return\n if (type === 'number') {\n if (!Number.isFinite(value)) {\n throw new AgentProfileCellValidationError('expected finite number', path)\n }\n return\n }\n if (Array.isArray(value)) {\n value.forEach((item, index) => {\n assertJson(item, `${path}[${index}]`)\n })\n return\n }\n if (type === 'object') {\n for (const [key, nested] of Object.entries(value)) {\n requireNonEmpty(key, `${path}.<key>`)\n assertJson(nested, `${path}.${key}`)\n }\n return\n }\n throw new AgentProfileCellValidationError('expected JSON-compatible value', path)\n}\n\nfunction expectLiteral(value: unknown, expected: string, path: string): void {\n if (value !== expected) {\n throw new AgentProfileCellValidationError(`expected ${expected}`, path)\n }\n}\n\nfunction expectString(value: unknown, path: string): void {\n if (typeof value !== 'string' || value.length === 0) {\n throw new AgentProfileCellValidationError('expected non-empty string', path)\n }\n}\n\nfunction requireNonEmpty(value: string, path: string): string {\n if (typeof value !== 'string' || value.length === 0) {\n throw new AgentProfileCellValidationError('expected non-empty string', path)\n }\n return value\n}\n\nfunction optionalNonEmpty(value: string | undefined, path: string): string | undefined {\n if (value === undefined) return undefined\n return requireNonEmpty(value, path)\n}\n\nfunction requireSha256Hex(value: unknown, path: string): string {\n if (typeof value !== 'string' || !SHA256_HEX.test(value)) {\n throw new AgentProfileCellValidationError('expected 64 lowercase sha256 hex chars', path)\n }\n return value\n}\n\n// ── Consumer helpers ─────────────────────────────────────────────────\n//\n// Boilerplate every product consuming `buildAgentProfileCell` used to duplicate:\n//\n// 1. A `JSON.parse(JSON.stringify(value))` helper that canonicalizes an\n// arbitrary `@tangle-network/agent-interface` `AgentProfile` into the recursive\n// `AgentProfileJson` shape, with a fail-loud error when the profile\n// is not JSON-serializable.\n//\n// 2. The magic string `'agent-interface-profile'` for `sourceProfile.kind`.\n//\n// Both belong here so the cross-product cell join (same canonical profile\n// hashes to the same `sourceProfile.hash` across products) is enforced by\n// the type system, not by every consumer remembering to do it right.\n// See blueprint-agent issue tangle-network/agent-eval#82.\n\n/** Canonical `sourceProfile.kind` values. Two products fingerprinting the\n * same canonical profile MUST use the same kind for their cells to share\n * `sourceProfile.hash`. Extend rather than create new strings — adding a\n * new kind is a deliberate cross-product schema change. */\nexport const AGENT_PROFILE_KINDS = {\n /** A profile declared via `defineAgentProfile(...)` from\n * `@tangle-network/agent-interface`. The default kind for router-backed\n * and sandbox-backed products. */\n AGENT_INTERFACE_PROFILE: 'agent-interface-profile',\n} as const\n\nexport type AgentProfileKind = (typeof AGENT_PROFILE_KINDS)[keyof typeof AGENT_PROFILE_KINDS]\n\n/** Canonicalize an arbitrary value into `AgentProfileJson` by JSON\n * round-trip. Throws when the value contains anything not representable\n * as JSON (functions, BigInt, cycles) — non-portable profiles fail loud\n * rather than silently dropping fields. */\nexport function toAgentProfileJson(value: unknown): AgentProfileJson {\n let serialized: string | undefined\n try {\n serialized = JSON.stringify(value)\n } catch (err) {\n throw new AgentProfileCellValidationError(\n `agent profile must be JSON-serializable: ${err instanceof Error ? err.message : String(err)}`,\n 'sourceProfile.profile',\n )\n }\n if (serialized === undefined) {\n throw new AgentProfileCellValidationError(\n 'agent profile must be JSON-serializable (got undefined after JSON.stringify)',\n 'sourceProfile.profile',\n )\n }\n return JSON.parse(serialized) as AgentProfileJson\n}\n\n/** Canonical AgentProfile shape required when deriving a stable cell id. */\nexport type AgentInterfaceProfileLike = AgentProfile & { name: string; version: string }\n\n/** Higher-level helper that hard-codes the canonical\n * `agent-interface-profile` kind plus the JSON canonicalization. Equivalent\n * to calling `buildAgentProfileCell` with `profileId = \\`${name}@${version}\\``\n * and `sourceProfile = { kind: AGENT_INTERFACE_PROFILE, profile: <round-tripped> }`.\n *\n * Use this from any product consuming an agent-interface `AgentProfile`; the\n * manual `buildAgentProfileCell` call is reserved for advanced cases\n * (custom kinds, pre-computed source hashes, alternate profileId\n * conventions). */\nexport async function buildAgentInterfaceProfileCell(\n profile: AgentInterfaceProfileLike,\n input: Omit<AgentProfileCellInput, 'profileId' | 'sourceProfile'>,\n): Promise<AgentProfileCell> {\n if (!profile || typeof profile !== 'object') {\n throw new AgentProfileCellValidationError('AgentProfile must be an object', 'profile')\n }\n if (typeof profile.name !== 'string' || profile.name.length === 0) {\n throw new AgentProfileCellValidationError(\n 'AgentProfile must have a non-empty `name`',\n 'profile.name',\n )\n }\n if (typeof profile.version !== 'string' || profile.version.length === 0) {\n throw new AgentProfileCellValidationError(\n 'AgentProfile must have a non-empty `version`',\n 'profile.version',\n )\n }\n return buildAgentProfileCell({\n ...input,\n profileId: `${profile.name}@${profile.version}`,\n sourceProfile: {\n kind: AGENT_PROFILE_KINDS.AGENT_IN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