niceeval 0.13.2 → 0.13.3

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 (494) hide show
  1. package/dist/agents/bub.cjs +4 -4
  2. package/dist/agents/bub.cjs.map +1 -1
  3. package/dist/agents/bub.d.cts +2 -2
  4. package/dist/agents/bub.d.mts +2 -2
  5. package/dist/agents/bub.d.ts +2 -2
  6. package/dist/agents/claude-code-native.cjs +213 -0
  7. package/dist/agents/claude-code-native.cjs.map +1 -0
  8. package/dist/agents/claude-code-native.d.cts +5 -0
  9. package/dist/agents/claude-code-native.d.mts +5 -0
  10. package/dist/agents/claude-code-native.d.ts +5 -0
  11. package/dist/agents/claude-code-native.js +6 -0
  12. package/dist/agents/claude-code-native.js.map +1 -0
  13. package/dist/agents/claude-code.cjs +26 -80
  14. package/dist/agents/claude-code.cjs.map +1 -1
  15. package/dist/agents/codex-app-server.cjs +314 -0
  16. package/dist/agents/codex-app-server.cjs.map +1 -0
  17. package/dist/agents/codex-app-server.d.cts +9 -0
  18. package/dist/agents/codex-app-server.d.mts +9 -0
  19. package/dist/agents/codex-app-server.d.ts +9 -0
  20. package/dist/agents/codex-app-server.js +6 -0
  21. package/dist/agents/codex-app-server.js.map +1 -0
  22. package/dist/agents/codex.cjs +19 -68
  23. package/dist/agents/codex.cjs.map +1 -1
  24. package/dist/agents/codex.d.cts +3 -3
  25. package/dist/agents/codex.d.mts +3 -3
  26. package/dist/agents/codex.d.ts +3 -3
  27. package/dist/agents/index.cjs +3 -1
  28. package/dist/agents/index.cjs.map +1 -1
  29. package/dist/agents/index.d.cts +1 -0
  30. package/dist/agents/index.d.mts +1 -0
  31. package/dist/agents/index.d.ts +1 -0
  32. package/dist/agents/index.js +84 -82
  33. package/dist/agents/index.mjs +84 -82
  34. package/dist/agents/managed-jsonl.cjs +207 -0
  35. package/dist/agents/managed-jsonl.cjs.map +1 -0
  36. package/dist/agents/managed-jsonl.d.cts +39 -0
  37. package/dist/agents/managed-jsonl.d.mts +39 -0
  38. package/dist/agents/managed-jsonl.d.ts +39 -0
  39. package/dist/agents/managed-jsonl.js +6 -0
  40. package/dist/agents/managed-jsonl.js.map +1 -0
  41. package/dist/agents/managed-process.cjs +31 -0
  42. package/dist/agents/managed-process.cjs.map +1 -0
  43. package/dist/agents/managed-process.d.cts +3 -0
  44. package/dist/agents/managed-process.d.mts +3 -0
  45. package/dist/agents/managed-process.d.ts +3 -0
  46. package/dist/agents/managed-process.js +6 -0
  47. package/dist/agents/managed-process.js.map +1 -0
  48. package/dist/agents/omp.cjs +18 -1
  49. package/dist/agents/omp.cjs.map +1 -1
  50. package/dist/agents/sdk-streams.cjs +11 -4
  51. package/dist/agents/sdk-streams.cjs.map +1 -1
  52. package/dist/agents/types.cjs.map +1 -1
  53. package/dist/agents/types.d.cts +8 -0
  54. package/dist/agents/types.d.mts +8 -0
  55. package/dist/agents/types.d.ts +8 -0
  56. package/dist/analysis/bindings.cjs +74 -19
  57. package/dist/analysis/bindings.cjs.map +1 -1
  58. package/dist/analysis/bindings.d.cts +534 -156
  59. package/dist/analysis/bindings.d.mts +534 -156
  60. package/dist/analysis/bindings.d.ts +534 -156
  61. package/dist/analysis/domain-view.cjs.map +1 -1
  62. package/dist/analysis/domain-view.d.cts +137 -8
  63. package/dist/analysis/domain-view.d.mts +137 -8
  64. package/dist/analysis/domain-view.d.ts +137 -8
  65. package/dist/analysis/index.cjs.map +1 -1
  66. package/dist/analysis/index.d.cts +1 -1
  67. package/dist/analysis/index.d.mts +1 -1
  68. package/dist/analysis/index.d.ts +1 -1
  69. package/dist/assertions/api.cjs.map +1 -1
  70. package/dist/assertions/api.d.cts +62 -0
  71. package/dist/assertions/api.d.mts +62 -0
  72. package/dist/assertions/api.d.ts +62 -0
  73. package/dist/assertions/judge.cjs +56 -5
  74. package/dist/assertions/judge.cjs.map +1 -1
  75. package/dist/assertions/match.cjs +66 -42
  76. package/dist/assertions/match.cjs.map +1 -1
  77. package/dist/assertions/match.d.cts +13 -0
  78. package/dist/assertions/match.d.mts +13 -0
  79. package/dist/assertions/match.d.ts +13 -0
  80. package/dist/assertions/record/attachment.cjs +104 -33
  81. package/dist/assertions/record/attachment.cjs.map +1 -1
  82. package/dist/assertions/record/attachment.d.cts +294 -57
  83. package/dist/assertions/record/attachment.d.mts +294 -57
  84. package/dist/assertions/record/attachment.d.ts +294 -57
  85. package/dist/assertions/record/codec.cjs +91 -17
  86. package/dist/assertions/record/codec.cjs.map +1 -1
  87. package/dist/assertions/record/codec.d.cts +280 -52
  88. package/dist/assertions/record/codec.d.mts +280 -52
  89. package/dist/assertions/record/codec.d.ts +280 -52
  90. package/dist/assertions/record/index.js +2 -0
  91. package/dist/assertions/record/model.cjs +16 -0
  92. package/dist/assertions/record/model.cjs.map +1 -1
  93. package/dist/assertions/record/model.d.cts +120 -13
  94. package/dist/assertions/record/model.d.mts +120 -13
  95. package/dist/assertions/record/model.d.ts +120 -13
  96. package/dist/assertions/record/model.js +2 -0
  97. package/dist/assertions/record/producer.cjs +70 -50
  98. package/dist/assertions/record/producer.cjs.map +1 -1
  99. package/dist/assertions/record/producer.d.cts +8 -7
  100. package/dist/assertions/record/producer.d.mts +8 -7
  101. package/dist/assertions/record/producer.d.ts +8 -7
  102. package/dist/assertions/runtime.cjs +49 -7
  103. package/dist/assertions/runtime.cjs.map +1 -1
  104. package/dist/cli/application.cjs +40 -0
  105. package/dist/cli/application.cjs.map +1 -0
  106. package/dist/cli/application.d.cts +129 -0
  107. package/dist/cli/application.d.mts +129 -0
  108. package/dist/cli/application.d.ts +129 -0
  109. package/dist/cli/application.js +24 -0
  110. package/dist/cli/application.js.map +1 -0
  111. package/dist/cli/bootstrap.cjs +10 -4
  112. package/dist/cli/bootstrap.cjs.map +1 -1
  113. package/dist/cli/node-application.cjs +123 -0
  114. package/dist/cli/node-application.cjs.map +1 -0
  115. package/dist/cli/node-application.d.cts +14 -0
  116. package/dist/cli/node-application.d.mts +14 -0
  117. package/dist/cli/node-application.d.ts +14 -0
  118. package/dist/cli/node-application.js +26 -0
  119. package/dist/cli/node-application.js.map +1 -0
  120. package/dist/cli/program.cjs +2807 -0
  121. package/dist/cli/program.cjs.map +1 -0
  122. package/dist/cli/program.d.cts +352 -0
  123. package/dist/cli/program.d.mts +352 -0
  124. package/dist/cli/program.d.ts +352 -0
  125. package/dist/cli/program.js +36 -0
  126. package/dist/cli/program.js.map +1 -0
  127. package/dist/cli/project-configuration.cjs +134 -0
  128. package/dist/cli/project-configuration.cjs.map +1 -0
  129. package/dist/cli/project-configuration.d.cts +64 -0
  130. package/dist/cli/project-configuration.d.mts +64 -0
  131. package/dist/cli/project-configuration.d.ts +64 -0
  132. package/dist/cli/project-configuration.js +22 -0
  133. package/dist/cli/project-configuration.js.map +1 -0
  134. package/dist/cli/record.cjs +20 -4
  135. package/dist/cli/record.cjs.map +1 -1
  136. package/dist/cli/record.d.cts +3 -3
  137. package/dist/cli/record.d.mts +3 -3
  138. package/dist/cli/record.d.ts +3 -3
  139. package/dist/cli.cjs +19 -3130
  140. package/dist/cli.cjs.map +1 -1
  141. package/dist/cli.d.cts +2 -148
  142. package/dist/cli.d.mts +2 -148
  143. package/dist/cli.d.ts +2 -148
  144. package/dist/cli.js +22 -30
  145. package/dist/context/assert-first.cjs +21 -15
  146. package/dist/context/assert-first.cjs.map +1 -1
  147. package/dist/context/assert-first.d.cts +1 -0
  148. package/dist/context/assert-first.d.mts +1 -0
  149. package/dist/context/assert-first.d.ts +1 -0
  150. package/dist/context/attempt-resources.cjs +13 -0
  151. package/dist/context/attempt-resources.cjs.map +1 -0
  152. package/dist/context/attempt-resources.d.cts +3 -0
  153. package/dist/context/attempt-resources.d.mts +3 -0
  154. package/dist/context/attempt-resources.d.ts +3 -0
  155. package/dist/context/attempt-resources.js +8 -0
  156. package/dist/context/attempt-resources.js.map +1 -0
  157. package/dist/context/session.cjs +4 -3
  158. package/dist/context/session.cjs.map +1 -1
  159. package/dist/context/session.d.cts +1 -0
  160. package/dist/context/session.d.mts +1 -0
  161. package/dist/context/session.d.ts +1 -0
  162. package/dist/eval/record/verdict.cjs +3 -2
  163. package/dist/eval/record/verdict.cjs.map +1 -1
  164. package/dist/experiment/host/index.cjs +1 -6
  165. package/dist/experiment/host/index.cjs.map +1 -1
  166. package/dist/experiment/host/index.d.cts +1 -0
  167. package/dist/experiment/host/index.d.mts +1 -0
  168. package/dist/experiment/host/index.d.ts +1 -0
  169. package/dist/load-config.cjs +13 -4
  170. package/dist/load-config.cjs.map +1 -1
  171. package/dist/load-config.d.cts +4 -3
  172. package/dist/load-config.d.mts +4 -3
  173. package/dist/load-config.d.ts +4 -3
  174. package/dist/load-config.js +4 -2
  175. package/dist/o11y/parsers/codex.cjs +29 -7
  176. package/dist/o11y/parsers/codex.cjs.map +1 -1
  177. package/dist/record/codec/core.d.cts +0 -2
  178. package/dist/record/codec/core.d.mts +0 -2
  179. package/dist/record/codec/core.d.ts +0 -2
  180. package/dist/record/codec/identifiers.cjs +2 -3
  181. package/dist/record/codec/identifiers.cjs.map +1 -1
  182. package/dist/record/codec/identifiers.d.cts +1 -2
  183. package/dist/record/codec/identifiers.d.mts +1 -2
  184. package/dist/record/codec/identifiers.d.ts +1 -2
  185. package/dist/record/codec/identifiers.js +10 -12
  186. package/dist/record/codec/index.js +42 -44
  187. package/dist/record/definition/attachment.cjs +1 -0
  188. package/dist/record/definition/attachment.cjs.map +1 -1
  189. package/dist/record/definition/attachment.d.cts +14 -0
  190. package/dist/record/definition/attachment.d.mts +14 -0
  191. package/dist/record/definition/attachment.d.ts +14 -0
  192. package/dist/record/family/assertions-v1.cjs +104 -0
  193. package/dist/record/family/assertions-v1.cjs.map +1 -0
  194. package/dist/record/family/assertions-v1.d.cts +2 -0
  195. package/dist/record/family/assertions-v1.d.mts +2 -0
  196. package/dist/record/family/assertions-v1.d.ts +2 -0
  197. package/dist/record/family/assertions-v1.js +6 -0
  198. package/dist/record/family/assertions-v1.js.map +1 -0
  199. package/dist/record/family/assertions.cjs +16 -5
  200. package/dist/record/family/assertions.cjs.map +1 -1
  201. package/dist/record/family/assertions.d.cts +510 -56
  202. package/dist/record/family/assertions.d.mts +510 -56
  203. package/dist/record/family/assertions.d.ts +510 -56
  204. package/dist/record/family/assertions.js +14 -10
  205. package/dist/record/family/catalog.cjs +17 -1
  206. package/dist/record/family/catalog.cjs.map +1 -1
  207. package/dist/record/family/catalog.d.cts +1292 -104
  208. package/dist/record/family/catalog.d.mts +1292 -104
  209. package/dist/record/family/catalog.d.ts +1292 -104
  210. package/dist/record/family/catalog.js +22 -20
  211. package/dist/record/family/index.js +144 -138
  212. package/dist/record/family/observability-v1.cjs +5 -0
  213. package/dist/record/family/observability-v1.cjs.map +1 -1
  214. package/dist/record/family/observability.cjs +1 -1
  215. package/dist/record/family/observability.cjs.map +1 -1
  216. package/dist/record/host/runtime.cjs +323 -173
  217. package/dist/record/host/runtime.cjs.map +1 -1
  218. package/dist/record/host/types.cjs.map +1 -1
  219. package/dist/record/host/types.d.cts +9 -7
  220. package/dist/record/host/types.d.mts +9 -7
  221. package/dist/record/host/types.d.ts +9 -7
  222. package/dist/record/model/core.cjs.map +1 -1
  223. package/dist/record/model/core.d.cts +1 -2
  224. package/dist/record/model/core.d.mts +1 -2
  225. package/dist/record/model/core.d.ts +1 -2
  226. package/dist/record/model/definition.cjs +1 -2
  227. package/dist/record/model/definition.cjs.map +1 -1
  228. package/dist/record/model/definition.d.cts +1 -7
  229. package/dist/record/model/definition.d.mts +1 -7
  230. package/dist/record/model/definition.d.ts +1 -7
  231. package/dist/record/model/identifiers.cjs +2 -3
  232. package/dist/record/model/identifiers.cjs.map +1 -1
  233. package/dist/record/model/identifiers.d.cts +1 -3
  234. package/dist/record/model/identifiers.d.mts +1 -3
  235. package/dist/record/model/identifiers.d.ts +1 -3
  236. package/dist/record/model/identifiers.js +36 -38
  237. package/dist/record/model/index.js +60 -62
  238. package/dist/record/platform/node.cjs +17 -7
  239. package/dist/record/platform/node.cjs.map +1 -1
  240. package/dist/record/platform/services.cjs.map +1 -1
  241. package/dist/record/platform/services.d.cts +8 -3
  242. package/dist/record/platform/services.d.mts +8 -3
  243. package/dist/record/platform/services.d.ts +8 -3
  244. package/dist/record/reader/format.cjs +16 -65
  245. package/dist/record/reader/format.cjs.map +1 -1
  246. package/dist/record/reader/format.d.cts +5 -9
  247. package/dist/record/reader/format.d.mts +5 -9
  248. package/dist/record/reader/format.d.ts +5 -9
  249. package/dist/record/reader/index.js +10 -8
  250. package/dist/record/reader/runtime.cjs +63 -32
  251. package/dist/record/reader/runtime.cjs.map +1 -1
  252. package/dist/record/reader/runtime.d.cts +40 -4
  253. package/dist/record/reader/runtime.d.mts +40 -4
  254. package/dist/record/reader/runtime.d.ts +40 -4
  255. package/dist/record/reader/runtime.js +6 -4
  256. package/dist/report/assets/enhance.js +5 -5
  257. package/dist/report/assets/styles.css +190 -24
  258. package/dist/report/built-in/result-components.cjs +8 -5
  259. package/dist/report/built-in/result-components.cjs.map +1 -1
  260. package/dist/report/built-in/standard.cjs +3 -0
  261. package/dist/report/built-in/standard.cjs.map +1 -1
  262. package/dist/report/built-in/standard.d.cts +2 -0
  263. package/dist/report/built-in/standard.d.mts +2 -0
  264. package/dist/report/built-in/standard.d.ts +2 -0
  265. package/dist/report/client-dist/app.js +53 -0
  266. package/dist/report/components/attempt-detail/compute.cjs +108 -231
  267. package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
  268. package/dist/report/components/attempt-detail/compute.d.cts +11 -45
  269. package/dist/report/components/attempt-detail/compute.d.mts +11 -45
  270. package/dist/report/components/attempt-detail/compute.d.ts +11 -45
  271. package/dist/report/components/attempt-detail/compute.js +2 -4
  272. package/dist/report/components/attempt-detail/content.cjs +4 -4
  273. package/dist/report/components/attempt-detail/content.cjs.map +1 -1
  274. package/dist/report/components/attempt-detail/validate.cjs +47 -4
  275. package/dist/report/components/attempt-detail/validate.cjs.map +1 -1
  276. package/dist/report/components/entity-lists/compute.cjs +9 -15
  277. package/dist/report/components/entity-lists/compute.cjs.map +1 -1
  278. package/dist/report/components/entity-lists/content.cjs +53 -40
  279. package/dist/report/components/entity-lists/content.cjs.map +1 -1
  280. package/dist/report/components/entity-lists/index.cjs +1 -3
  281. package/dist/report/components/entity-lists/index.cjs.map +1 -1
  282. package/dist/report/components/experiment-detail/compute.cjs +4 -6
  283. package/dist/report/components/experiment-detail/compute.cjs.map +1 -1
  284. package/dist/report/components/summaries/index.cjs +5 -1
  285. package/dist/report/components/summaries/index.cjs.map +1 -1
  286. package/dist/report/definition/cell.cjs +14 -7
  287. package/dist/report/definition/cell.cjs.map +1 -1
  288. package/dist/report/definition/cell.d.cts +4 -0
  289. package/dist/report/definition/cell.d.mts +4 -0
  290. package/dist/report/definition/cell.d.ts +4 -0
  291. package/dist/report/definition/primitives/assertion-evidence.cjs +96 -0
  292. package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -0
  293. package/dist/report/definition/primitives/assertion-evidence.d.cts +11 -0
  294. package/dist/report/definition/primitives/assertion-evidence.d.mts +11 -0
  295. package/dist/report/definition/primitives/assertion-evidence.d.ts +11 -0
  296. package/dist/report/definition/primitives/assertion-evidence.js +6 -0
  297. package/dist/report/definition/primitives/assertion-evidence.js.map +1 -0
  298. package/dist/report/definition/primitives/conversation.cjs +7 -0
  299. package/dist/report/definition/primitives/conversation.cjs.map +1 -1
  300. package/dist/report/definition/primitives/conversation.d.cts +2 -0
  301. package/dist/report/definition/primitives/conversation.d.mts +2 -0
  302. package/dist/report/definition/primitives/conversation.d.ts +2 -0
  303. package/dist/report/definition/primitives/turn-trace.cjs +53 -3
  304. package/dist/report/definition/primitives/turn-trace.cjs.map +1 -1
  305. package/dist/report/definition/primitives.cjs +14 -1
  306. package/dist/report/definition/primitives.cjs.map +1 -1
  307. package/dist/report/definition/report.cjs +16 -8
  308. package/dist/report/definition/report.cjs.map +1 -1
  309. package/dist/report/definition/report.d.cts +6 -0
  310. package/dist/report/definition/report.d.mts +6 -0
  311. package/dist/report/definition/report.d.ts +6 -0
  312. package/dist/report/definition/table-text.cjs +12 -3
  313. package/dist/report/definition/table-text.cjs.map +1 -1
  314. package/dist/report/definition/table-text.d.cts +6 -1
  315. package/dist/report/definition/table-text.d.mts +6 -1
  316. package/dist/report/definition/table-text.d.ts +6 -1
  317. package/dist/report/execution/model.cjs +6 -14
  318. package/dist/report/execution/model.cjs.map +1 -1
  319. package/dist/report/execution/model.d.cts +5 -10
  320. package/dist/report/execution/model.d.mts +5 -10
  321. package/dist/report/execution/model.d.ts +5 -10
  322. package/dist/report/execution/model.js +6 -6
  323. package/dist/report/execution/paths.cjs +0 -11
  324. package/dist/report/execution/paths.cjs.map +1 -1
  325. package/dist/report/execution/paths.d.cts +0 -1
  326. package/dist/report/execution/paths.d.mts +0 -1
  327. package/dist/report/execution/paths.d.ts +0 -1
  328. package/dist/report/execution/paths.js +6 -8
  329. package/dist/report/host/execute.cjs +13 -22
  330. package/dist/report/host/execute.cjs.map +1 -1
  331. package/dist/report/host/execute.d.cts +1 -4
  332. package/dist/report/host/execute.d.mts +1 -4
  333. package/dist/report/host/execute.d.ts +1 -4
  334. package/dist/report/host/from-record.cjs +3 -0
  335. package/dist/report/host/from-record.cjs.map +1 -1
  336. package/dist/report/host/from-record.d.cts +4 -1
  337. package/dist/report/host/from-record.d.mts +4 -1
  338. package/dist/report/host/from-record.d.ts +4 -1
  339. package/dist/report/host/site-assets.cjs +1 -2
  340. package/dist/report/host/site-assets.cjs.map +1 -1
  341. package/dist/report/host/site-assets.d.cts +0 -1
  342. package/dist/report/host/site-assets.d.mts +0 -1
  343. package/dist/report/host/site-assets.d.ts +0 -1
  344. package/dist/report/host/site-assets.js +2 -4
  345. package/dist/report/host/static.cjs +71 -346
  346. package/dist/report/host/static.cjs.map +1 -1
  347. package/dist/report/host/static.d.cts +1 -3
  348. package/dist/report/host/static.d.mts +1 -3
  349. package/dist/report/host/static.d.ts +1 -3
  350. package/dist/report/host/static.js +2 -2
  351. package/dist/report/host/view-session.cjs.map +1 -1
  352. package/dist/report/host/view-session.d.cts +1 -1
  353. package/dist/report/host/view-session.d.mts +1 -1
  354. package/dist/report/host/view-session.d.ts +1 -1
  355. package/dist/report/model/locale.cjs +1 -1
  356. package/dist/report/model/locale.cjs.map +1 -1
  357. package/dist/report/model/locale.d.cts +1 -1
  358. package/dist/report/model/locale.d.mts +1 -1
  359. package/dist/report/model/locale.d.ts +1 -1
  360. package/dist/report/model/pricing.cjs +2 -2
  361. package/dist/report/model/pricing.cjs.map +1 -1
  362. package/dist/report/react/enhance.js +5 -5
  363. package/dist/report/react/styles.css +190 -24
  364. package/dist/runner/adoption.cjs +4 -7
  365. package/dist/runner/adoption.cjs.map +1 -1
  366. package/dist/runner/attempt-resources.cjs +60 -0
  367. package/dist/runner/attempt-resources.cjs.map +1 -0
  368. package/dist/runner/attempt-resources.d.cts +13 -0
  369. package/dist/runner/attempt-resources.d.mts +13 -0
  370. package/dist/runner/attempt-resources.d.ts +13 -0
  371. package/dist/runner/attempt-resources.js +6 -0
  372. package/dist/runner/attempt-resources.js.map +1 -0
  373. package/dist/runner/attempt.cjs +37 -3
  374. package/dist/runner/attempt.cjs.map +1 -1
  375. package/dist/runner/feedback/failure.cjs +77 -2
  376. package/dist/runner/feedback/failure.cjs.map +1 -1
  377. package/dist/runner/feedback/failure.d.cts +2 -1
  378. package/dist/runner/feedback/failure.d.mts +2 -1
  379. package/dist/runner/feedback/failure.d.ts +2 -1
  380. package/dist/runner/project-current.cjs +2 -13
  381. package/dist/runner/project-current.cjs.map +1 -1
  382. package/dist/runner/project-current.d.cts +4 -2
  383. package/dist/runner/project-current.d.mts +4 -2
  384. package/dist/runner/project-current.d.ts +4 -2
  385. package/dist/runner/reporters/braintrust.cjs +7 -7
  386. package/dist/runner/reporters/braintrust.cjs.map +1 -1
  387. package/dist/runner/reuse-readback.cjs +3 -4
  388. package/dist/runner/reuse-readback.cjs.map +1 -1
  389. package/dist/runner/run.cjs +5 -2
  390. package/dist/runner/run.cjs.map +1 -1
  391. package/dist/sandbox/backend.cjs +32 -2
  392. package/dist/sandbox/backend.cjs.map +1 -1
  393. package/dist/sandbox/backend.d.cts +12 -1
  394. package/dist/sandbox/backend.d.mts +12 -1
  395. package/dist/sandbox/backend.d.ts +12 -1
  396. package/dist/sandbox/backend.js +28 -22
  397. package/dist/sandbox/docker.cjs +140 -0
  398. package/dist/sandbox/docker.cjs.map +1 -1
  399. package/dist/sandbox/docker.d.cts +3 -1
  400. package/dist/sandbox/docker.d.mts +3 -1
  401. package/dist/sandbox/docker.d.ts +3 -1
  402. package/dist/sandbox/e2b.cjs +42 -0
  403. package/dist/sandbox/e2b.cjs.map +1 -1
  404. package/dist/sandbox/e2b.d.cts +2 -0
  405. package/dist/sandbox/e2b.d.mts +2 -0
  406. package/dist/sandbox/e2b.d.ts +2 -0
  407. package/dist/sandbox/local.cjs +64 -0
  408. package/dist/sandbox/local.cjs.map +1 -1
  409. package/dist/sandbox/local.d.cts +3 -1
  410. package/dist/sandbox/local.d.mts +3 -1
  411. package/dist/sandbox/local.d.ts +3 -1
  412. package/dist/sandbox/managed-process.cjs +49 -0
  413. package/dist/sandbox/managed-process.cjs.map +1 -0
  414. package/dist/sandbox/managed-process.d.cts +11 -0
  415. package/dist/sandbox/managed-process.d.mts +11 -0
  416. package/dist/sandbox/managed-process.d.ts +11 -0
  417. package/dist/sandbox/managed-process.js +6 -0
  418. package/dist/sandbox/managed-process.js.map +1 -0
  419. package/dist/sandbox/types.cjs.map +1 -1
  420. package/dist/sandbox/types.d.cts +24 -0
  421. package/dist/sandbox/types.d.mts +24 -0
  422. package/dist/sandbox/types.d.ts +24 -0
  423. package/dist/sandbox/vercel.cjs +1 -0
  424. package/dist/sandbox/vercel.cjs.map +1 -1
  425. package/dist/sandbox/vercel.d.cts +1 -0
  426. package/dist/sandbox/vercel.d.mts +1 -0
  427. package/dist/sandbox/vercel.d.ts +1 -0
  428. package/dist/view/server.cjs +2 -37
  429. package/dist/view/server.cjs.map +1 -1
  430. package/dist/view/server.d.cts +0 -3
  431. package/dist/view/server.d.mts +0 -3
  432. package/dist/view/server.d.ts +0 -3
  433. package/docs-site/zh/reference/builtin-agents.mdx +7 -7
  434. package/docs-site/zh/reference/official-adapters.mdx +4 -4
  435. package/docs-site/zh/reference/report-components.mdx +2 -2
  436. package/docs-site/zh/tutorials/configuration.mdx +2 -2
  437. package/docs-site/zh/tutorials/deploy-report-site.mdx +24 -2
  438. package/docs-site/zh/tutorials/publish-report.mdx +4 -4
  439. package/docs-site/zh/tutorials/sandbox-agent.mdx +5 -5
  440. package/docs-site/zh/tutorials/theming.mdx +2 -2
  441. package/package.json +4 -6
  442. package/dist/record/migration/index.cjs +0 -5
  443. package/dist/record/migration/index.cjs.map +0 -1
  444. package/dist/record/migration/index.d.cts +0 -11
  445. package/dist/record/migration/index.d.mts +0 -11
  446. package/dist/record/migration/index.d.ts +0 -11
  447. package/dist/record/migration/index.js +0 -6
  448. package/dist/record/migration/index.js.map +0 -1
  449. package/dist/report/host/site-runtime.cjs +0 -92
  450. package/dist/report/host/site-runtime.cjs.map +0 -1
  451. package/dist/report/host/site-runtime.d.cts +0 -9
  452. package/dist/report/host/site-runtime.d.mts +0 -9
  453. package/dist/report/host/site-runtime.d.ts +0 -9
  454. package/dist/report/host/site-runtime.js +0 -10
  455. package/dist/report/host/site-runtime.js.map +0 -1
  456. package/dist/view/client-dist/app.css +0 -2
  457. package/dist/view/client-dist/app.js +0 -49
  458. package/dist/view/data.cjs +0 -3
  459. package/dist/view/data.cjs.map +0 -1
  460. package/dist/view/data.d.cts +0 -9
  461. package/dist/view/data.d.mts +0 -9
  462. package/dist/view/data.d.ts +0 -9
  463. package/dist/view/data.js +0 -4
  464. package/dist/view/data.js.map +0 -1
  465. package/dist/view/index.cjs +0 -24
  466. package/dist/view/index.cjs.map +0 -1
  467. package/dist/view/index.d.cts +0 -9
  468. package/dist/view/index.d.mts +0 -9
  469. package/dist/view/index.d.ts +0 -9
  470. package/dist/view/index.js +0 -28
  471. package/dist/view/index.js.map +0 -1
  472. package/dist/view/report-view-cache.cjs +0 -200
  473. package/dist/view/report-view-cache.cjs.map +0 -1
  474. package/dist/view/report-view-cache.d.cts +0 -67
  475. package/dist/view/report-view-cache.d.mts +0 -67
  476. package/dist/view/report-view-cache.d.ts +0 -67
  477. package/dist/view/report-view-cache.js +0 -8
  478. package/dist/view/report-view-cache.js.map +0 -1
  479. package/dist/view/shared/types.cjs +0 -3
  480. package/dist/view/shared/types.cjs.map +0 -1
  481. package/dist/view/shared/types.d.cts +0 -51
  482. package/dist/view/shared/types.d.mts +0 -51
  483. package/dist/view/shared/types.d.ts +0 -51
  484. package/dist/view/shared/types.js +0 -4
  485. package/dist/view/shared/types.js.map +0 -1
  486. package/dist/view/site.cjs +0 -32
  487. package/dist/view/site.cjs.map +0 -1
  488. package/dist/view/site.d.cts +0 -24
  489. package/dist/view/site.d.mts +0 -24
  490. package/dist/view/site.d.ts +0 -24
  491. package/dist/view/site.js +0 -8
  492. package/dist/view/site.js.map +0 -1
  493. package/dist/view/styles.css +0 -170
  494. package/dist/view/template.html +0 -17
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AA4KA;;;;GAIG;AACU,QAAA,oBAAoB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAevF;;;;;GAKG;AACH,MAAa,6BAA8B,SAAQ,KAAK;IAE/B;IADZ,IAAI,GAAG,+BAA+B,CAAC;IAChD,YAAqB,MAA4G;QAC7H,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;QADjD,WAAM,GAAN,MAAM,CAAsG;QAE7H,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAChD,CAAC;CACJ;AAND,sEAMC","sourcesContent":["import type { Effect } from \"effect\";\nimport type { BooleanMatch, MatchDiagnostic, ScoreMatch, ThresholdedScoreMatch, } from \"./match.ts\";\nimport type { AgentWorkspaceDiff } from \"./workspace-diff.ts\";\n/** The two Evaluation kinds deliberately share one Assertion entry model. */\nexport type AssertionEvaluationKind = \"pass\" | \"score\";\n/**\n * A bounded JSON-shaped value owned by the authoring runtime. It is a\n * domain value, not the durable Assertions attachment material type.\n */\nexport type AssertionSnapshotValue = null | boolean | number | string | readonly AssertionSnapshotValue[] | AssertionSnapshotObject;\nexport interface AssertionSnapshotObject {\n readonly [key: string]: AssertionSnapshotValue;\n}\nexport interface AssertionDisplay {\n readonly key?: string;\n readonly label?: string;\n readonly groupPath: readonly string[];\n}\nexport type AssertionCoverage = {\n readonly state: \"complete\";\n} | {\n readonly state: \"partial\";\n readonly reason: \"sampled\" | \"truncated\" | \"redacted\" | \"provider-limited\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"not-collected\" | \"source-unavailable\" | \"producer-failed\";\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"optional-material\" | \"unsupported-subject\";\n};\nexport type AssertionLimitation = {\n readonly kind: \"redacted\";\n readonly fieldCount: number;\n} | {\n readonly kind: \"sampled\";\n readonly captured: number;\n readonly knownTotal?: number;\n} | {\n readonly kind: \"truncated\";\n readonly omittedBytes: number;\n} | {\n readonly kind: \"provider-limited\";\n};\n/**\n * Authoring material intentionally has no blob ref, attachment entry ID, or\n * durable schema identity. The private producer adapter selects the exact\n * same-owner Attachment schema when it serializes this domain reference.\n */\nexport type AssertionMaterial = {\n readonly kind: \"snapshot\";\n readonly value: AssertionSnapshotValue;\n} | {\n readonly kind: \"record-attachment\";\n readonly preview: string;\n};\nexport type AssertionCriterion = {\n readonly kind: \"value-match\";\n readonly subject: \"explicit-value\";\n} | {\n readonly kind: \"scope-status\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly assertion: \"succeeded\" | \"no-failed-actions\";\n} | {\n readonly kind: \"occurrence\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly occurrence: \"tool\" | \"skill\" | \"event\";\n readonly assertion: \"present\" | \"absent\" | \"count\";\n readonly matcher?: string;\n readonly quantifier?: {\n readonly kind: \"absent\";\n } | {\n readonly kind: \"at-least\" | \"exact\";\n readonly count: number;\n };\n} | {\n readonly kind: \"judge-measurement\";\n readonly recipe: \"closed-qa\" | \"factuality\" | \"summarizes\";\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"changed-paths\";\n readonly paths: readonly string[];\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"no-changes\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-changed\";\n readonly path: string;\n readonly status?: \"added\" | \"modified\" | \"deleted\";\n readonly before?: string;\n readonly after?: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-deleted\";\n readonly path: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"not-in-diff\";\n readonly pattern: string;\n readonly flags: string;\n readonly content: \"added\" | \"removed\" | \"both\";\n} | {\n readonly kind: \"direct-score\";\n readonly source: \"author\";\n} | {\n readonly kind: \"third-party\";\n readonly name: string;\n readonly schemaId: string;\n readonly data: AssertionSnapshotValue;\n};\nexport type AssertionScoreContribution = {\n readonly state: \"not-scored\";\n} | {\n readonly state: \"earned\";\n readonly points: number;\n readonly earned: number;\n} | {\n readonly state: \"unavailable\";\n readonly points: number;\n readonly reason: \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n};\nexport type AssertionResult = {\n readonly state: \"matched\";\n readonly gate: \"not-gate\" | \"satisfied\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"mismatched\";\n readonly reason: \"condition-not-met\";\n readonly gate: \"not-gate\" | \"failed\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"errored\";\n readonly reason: \"evaluator-failed\" | \"producer-interrupted\" | \"invalid-subject\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"coverage-not-applicable\";\n readonly gate: \"not-gate\" | \"not-applicable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n};\n/** One fully formed author/runtime result, before durable attachment encoding. */\nexport interface SealedAssertionEntry {\n readonly display: AssertionDisplay;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence: readonly AssertionMaterial[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly result: AssertionResult;\n}\n/**\n * Assertion handles are runtime-owned capabilities, not subjects for another\n * `t.check`. The symbol is public only for TypeScript's nominal boundary; the\n * runtime also keeps an unforgeable ownership registry.\n */\nexport const assertionHandleBrand: unique symbol = Symbol(\"niceeval.assertion-handle\");\nexport interface AssertionHandleBase {\n readonly [assertionHandleBrand]: true;\n key(value: string): this;\n label(value: string): this;\n /** Adds one display-only group segment to this already registered entry. */\n group(title: string): this;\n}\n/** A value that is not an AssertionHandle. */\nexport type AssertionSubject<Value> = Value extends AssertionHandleBase ? never : Value;\nexport interface AssertionStopError {\n readonly _tag: \"AssertionStopError\";\n readonly entryIndex: number;\n readonly reason: \"condition-not-met\" | \"source-unavailable\" | \"evaluator-failed\" | \"not-applicable\";\n}\n/**\n * A public authoring call reached an Attempt boundary which is no longer able\n * to accept it. Keeping this distinct from an evaluator failure lets a\n * detached Promise diagnose its own lifecycle error instead of looking like a\n * failed assertion.\n */\nexport class AssertionAuthoringClosedError extends Error {\n readonly _tag = \"AssertionAuthoringClosedError\";\n constructor(readonly reason: \"stop-latched\" | \"attempt-sealing\" | \"attempt-sealed\" | \"attempt-interrupted\" | \"runtime-unattached\") {\n super(`Cannot use an Assertion authoring handle after ${reason}`);\n this.name = \"AssertionAuthoringClosedError\";\n }\n}\n/**\n * The owning Attempt executes a requested stop barrier in its existing Effect\n * scope. Handles only enqueue this request; they never create a runtime.\n */\nexport type AssertionStopExecutor = <Value>(effect: Effect.Effect<Value, AssertionStopError, never>) => Promise<Value>;\n/** A Boolean entry is evaluated once and may retain a refinement witness. */\nexport type BooleanAssertionEvaluation<Refined> = {\n readonly state: \"matched\";\n readonly value: Refined;\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"not-applicable\";\n readonly diagnostic?: MatchDiagnostic;\n};\n/** A measurement is always a finite unit-interval value when it is available. */\nexport type MeasurementAssertionEvaluation = {\n readonly state: \"measured\";\n readonly value: number;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n} | {\n readonly state: \"not-applicable\";\n} | {\n readonly state: \"errored\";\n};\nexport interface CapturedAssertionSnapshot {\n readonly material: Extract<AssertionMaterial, {\n readonly kind: \"snapshot\";\n }>;\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n}\nexport interface AssertionRegistrationBase {\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence?: readonly AssertionMaterial[];\n readonly coverage?: AssertionCoverage;\n readonly limitations?: readonly AssertionLimitation[];\n}\n/**\n * Scope, Judge, and Sandbox adapters use this internal registration shape.\n * They still register exactly one Assertion entry; they do not manufacture a\n * separate intermediate value for a later consumer.\n */\nexport interface BooleanAssertionRegistration<Refined> extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<BooleanAssertionEvaluation<Refined>, unknown, never>;\n}\nexport interface MeasurementAssertionRegistration extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<MeasurementAssertionEvaluation, unknown, never>;\n}\nexport interface PassBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n gate(): this;\n orStop(): Promise<Refined>;\n}\nexport interface ScoreBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n orStop(): Promise<Refined>;\n}\nexport interface PassMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n atLeast(value: number): PassMeasurementAssertionHandle<true>;\n gate(value: number): PassMeasurementAssertionHandle<true>;\n orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport interface ScoreMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n atLeast(value: number): ScoreMeasurementAssertionHandle<true>;\n score(points: number): this;\n orStop(this: ScoreMeasurementAssertionHandle<true>): Promise<number>;\n}\n/** A Boolean Assertion that intentionally has no author control-flow operation. */\ninterface PostRunPassBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n optional(): this;\n gate(): this;\n}\ninterface PostRunScoreBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n}\nexport type PostRunBooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PostRunPassBooleanAssertionHandle<Refined> : PostRunScoreBooleanAssertionHandle<Refined>;\n/** Direct score is an Assertion entry, but has no condition or stop barrier. */\nexport interface DirectScoreAssertionHandle extends AssertionHandleBase {\n readonly kind: \"direct-score\";\n}\nexport interface AssertionGroupContext {\n /**\n * Runs an ordinary author callback with one display-only group segment. The\n * callback remains inside the Attempt's outer Promise boundary; this facade\n * does not evaluate an Effect or create an independent runtime.\n */\n group<Value>(title: string, body: () => Value | PromiseLike<Value>): Promise<Awaited<Value>>;\n}\nexport interface PassAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"pass\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): PassBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle<true>;\n}\nexport interface ScoreAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"score\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): ScoreBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle<true>;\n score(points: number): DirectScoreAssertionHandle;\n}\nexport type AssertionsContext<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassAssertionsContext : ScoreAssertionsContext;\nexport type BooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PassBooleanAssertionHandle<Refined> : ScoreBooleanAssertionHandle<Refined>;\nexport type MeasurementAssertionHandle<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassMeasurementAssertionHandle : ScoreMeasurementAssertionHandle;\nexport interface AssertionSealOptions {\n readonly execution?: \"completed\" | \"errored\";\n readonly explicitlySkipped?: boolean;\n /**\n * The owning Attempt was interrupted before ordinary evaluation could\n * finish. Unsettled entries are sealed as producer-interrupted instead of\n * being silently omitted or evaluated on a detached runtime.\n */\n readonly interrupted?: boolean;\n}\nexport interface AssertionSealError {\n readonly _tag: \"AssertionSealError\";\n readonly code: \"pass-measurement-threshold-missing\";\n readonly entryIndex: number;\n}\n/** The sealed evaluation is a domain result, not a durable Record payload. */\nexport interface SealedAssertionEvaluationEntry {\n readonly required: boolean;\n readonly result: AssertionResult;\n}\nexport interface SealedAssertionEvaluation {\n readonly execution: \"completed\" | \"errored\";\n readonly explicitlySkipped: boolean;\n readonly assertions: readonly SealedAssertionEvaluationEntry[];\n}\n/**\n * One immutable result feeds the Verdict/Score fold and the private durable\n * producer adapter. No RecordAttachment writer type crosses this boundary.\n */\nexport interface SealedAssertionsRuntime {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n}\n/** The runtime Verdict is independent of the durable Verdict attachment codec. */\nexport interface AssertionVerdict {\n readonly state: \"passed\" | \"failed\" | \"errored\" | \"skipped\";\n}\nexport type AssertionScoreIncompleteReason = \"execution-errored\" | \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n/** The runtime Score is independent of the durable Score attachment codec. */\nexport type AssertionScore = {\n readonly state: \"complete\";\n readonly earned: number;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n} | {\n readonly state: \"unavailable\";\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n};\n/**\n * The attempt-owned frozen result is handed from Runner to the Evaluation\n * Record adapter. The adapter alone adds attachment schemas and writes.\n */\nexport interface SealedAttemptAssertions {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n readonly workspaceDiff?: AgentWorkspaceDiff;\n readonly verdict: AssertionVerdict;\n readonly score?: AssertionScore;\n}\nexport interface AssertionsRuntime<Kind extends AssertionEvaluationKind> {\n readonly evaluationKind: Kind;\n readonly t: AssertionsContext<Kind>;\n registerBoolean<Refined>(definition: BooleanAssertionRegistration<Refined>): BooleanAssertionHandle<Kind, Refined>;\n registerMeasurement(definition: MeasurementAssertionRegistration): MeasurementAssertionHandle<Kind>;\n seal(options?: AssertionSealOptions): Effect.Effect<SealedAssertionsRuntime, AssertionSealError, never>;\n}\n"]}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AAmOA;;;;GAIG;AACU,QAAA,oBAAoB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAevF;;;;;GAKG;AACH,MAAa,6BAA8B,SAAQ,KAAK;IAE/B;IADZ,IAAI,GAAG,+BAA+B,CAAC;IAChD,YAAqB,MAA4G;QAC7H,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;QADjD,WAAM,GAAN,MAAM,CAAsG;QAE7H,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAChD,CAAC;CACJ;AAND,sEAMC","sourcesContent":["import type { Effect } from \"effect\";\nimport type { BooleanMatch, MatchDiagnostic, ScoreMatch, ThresholdedScoreMatch, } from \"./match.ts\";\nimport type { AgentWorkspaceDiff } from \"./workspace-diff.ts\";\n/** The two Evaluation kinds deliberately share one Assertion entry model. */\nexport type AssertionEvaluationKind = \"pass\" | \"score\";\n/**\n * A bounded JSON-shaped value owned by the authoring runtime. It is a\n * domain value, not the durable Assertions attachment material type.\n */\nexport type AssertionSnapshotValue = null | boolean | number | string | readonly AssertionSnapshotValue[] | AssertionSnapshotObject;\nexport interface AssertionSnapshotObject {\n readonly [key: string]: AssertionSnapshotValue;\n}\nexport interface AssertionDisplay {\n readonly key?: string;\n readonly label?: string;\n readonly groupPath: readonly string[];\n}\nexport type AssertionCoverage = {\n readonly state: \"complete\";\n} | {\n readonly state: \"partial\";\n readonly reason: \"sampled\" | \"truncated\" | \"redacted\" | \"provider-limited\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"not-collected\" | \"source-unavailable\" | \"producer-failed\";\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"optional-material\" | \"unsupported-subject\";\n};\nexport type AssertionLimitation = {\n readonly kind: \"redacted\";\n readonly fieldCount: number;\n} | {\n readonly kind: \"sampled\";\n readonly captured: number;\n readonly knownTotal?: number;\n} | {\n readonly kind: \"truncated\";\n readonly omittedBytes: number;\n} | {\n readonly kind: \"provider-limited\";\n};\n/**\n * Authoring material intentionally has no blob ref, attachment entry ID, or\n * durable schema identity. The private producer adapter selects the exact\n * same-owner Attachment schema when it serializes this domain reference.\n */\nexport type AssertionMaterial = {\n readonly kind: \"snapshot\";\n readonly value: AssertionSnapshotValue;\n} | {\n readonly kind: \"record-attachment\";\n readonly preview: string;\n};\nexport type AssertionCriterion = {\n readonly kind: \"value-match\";\n readonly subject: \"explicit-value\";\n readonly matcher: {\n readonly state: \"declared\";\n readonly name: string;\n } | {\n readonly state: \"unavailable\";\n };\n} | {\n readonly kind: \"scope-status\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly assertion: \"succeeded\" | \"no-failed-actions\";\n} | {\n readonly kind: \"occurrence\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly occurrence: \"tool\" | \"skill\" | \"event\";\n readonly assertion: \"present\" | \"absent\" | \"count\";\n readonly matcher?: string;\n readonly quantifier?: {\n readonly kind: \"absent\";\n } | {\n readonly kind: \"at-least\" | \"exact\";\n readonly count: number;\n };\n} | {\n readonly kind: \"judge-measurement\";\n readonly recipe: \"closed-qa\" | \"factuality\" | \"summarizes\";\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"changed-paths\";\n readonly paths: readonly string[];\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"no-changes\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-changed\";\n readonly path: string;\n readonly status?: \"added\" | \"modified\" | \"deleted\";\n readonly before?: string;\n readonly after?: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-deleted\";\n readonly path: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"not-in-diff\";\n readonly pattern: string;\n readonly flags: string;\n readonly content: \"added\" | \"removed\" | \"both\";\n} | {\n readonly kind: \"direct-score\";\n readonly source: \"author\";\n} | {\n readonly kind: \"third-party\";\n readonly name: string;\n readonly schemaId: string;\n readonly data: AssertionSnapshotValue;\n};\nexport type AssertionScoreContribution = {\n readonly state: \"not-scored\";\n} | {\n readonly state: \"earned\";\n readonly points: number;\n readonly earned: number;\n} | {\n readonly state: \"unavailable\";\n readonly points: number;\n readonly reason: \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n};\n/** Constant-size semantic receipt for one collection evaluation. */\nexport interface AssertionCollectionReceipt {\n readonly examined: number;\n readonly matched: number;\n readonly mismatched: number;\n readonly unavailable: number;\n readonly knownTotal: number | null;\n readonly complete: boolean;\n readonly exhaustive: boolean;\n readonly decisive: boolean;\n}\nexport type AssertionConditionPolicy = {\n readonly kind: \"boolean\";\n readonly expected: true;\n} | {\n readonly kind: \"at-least\";\n readonly threshold: number;\n} | {\n readonly kind: \"record-only\";\n};\nexport interface AssertionPolicy {\n readonly requirement: \"required\" | \"optional\";\n readonly condition: AssertionConditionPolicy;\n}\nexport type AssertionObserved = {\n readonly kind: \"boolean\";\n readonly outcome: \"matched\" | \"mismatched\" | \"unavailable\" | \"errored\" | \"not-applicable\";\n} | {\n readonly kind: \"measurement\";\n readonly state: \"available\";\n readonly value: number;\n} | {\n readonly kind: \"measurement\";\n readonly state: \"unavailable\";\n} | {\n readonly kind: \"direct-score\";\n readonly state: \"available\";\n readonly value: number;\n} | {\n readonly kind: \"direct-score\";\n readonly state: \"unavailable\";\n};\nexport type AssertionResult = {\n readonly state: \"matched\";\n readonly gate: \"not-gate\" | \"satisfied\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"mismatched\";\n readonly reason: \"condition-not-met\";\n readonly gate: \"not-gate\" | \"failed\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"errored\";\n readonly reason: \"evaluator-failed\" | \"producer-interrupted\" | \"invalid-subject\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"coverage-not-applicable\";\n readonly gate: \"not-gate\" | \"not-applicable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n};\n/** One fully formed author/runtime result, before durable attachment encoding. */\nexport interface SealedAssertionEntry {\n readonly display: AssertionDisplay;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence: readonly AssertionMaterial[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly result: AssertionResult;\n readonly policy: AssertionPolicy;\n readonly observed: AssertionObserved;\n}\n/**\n * Assertion handles are runtime-owned capabilities, not subjects for another\n * `t.check`. The symbol is public only for TypeScript's nominal boundary; the\n * runtime also keeps an unforgeable ownership registry.\n */\nexport const assertionHandleBrand: unique symbol = Symbol(\"niceeval.assertion-handle\");\nexport interface AssertionHandleBase {\n readonly [assertionHandleBrand]: true;\n key(value: string): this;\n label(value: string): this;\n /** Adds one display-only group segment to this already registered entry. */\n group(title: string): this;\n}\n/** A value that is not an AssertionHandle. */\nexport type AssertionSubject<Value> = Value extends AssertionHandleBase ? never : Value;\nexport interface AssertionStopError {\n readonly _tag: \"AssertionStopError\";\n readonly entryIndex: number;\n readonly reason: \"condition-not-met\" | \"source-unavailable\" | \"evaluator-failed\" | \"not-applicable\";\n}\n/**\n * A public authoring call reached an Attempt boundary which is no longer able\n * to accept it. Keeping this distinct from an evaluator failure lets a\n * detached Promise diagnose its own lifecycle error instead of looking like a\n * failed assertion.\n */\nexport class AssertionAuthoringClosedError extends Error {\n readonly _tag = \"AssertionAuthoringClosedError\";\n constructor(readonly reason: \"stop-latched\" | \"attempt-sealing\" | \"attempt-sealed\" | \"attempt-interrupted\" | \"runtime-unattached\") {\n super(`Cannot use an Assertion authoring handle after ${reason}`);\n this.name = \"AssertionAuthoringClosedError\";\n }\n}\n/**\n * The owning Attempt executes a requested stop barrier in its existing Effect\n * scope. Handles only enqueue this request; they never create a runtime.\n */\nexport type AssertionStopExecutor = <Value>(effect: Effect.Effect<Value, AssertionStopError, never>) => Promise<Value>;\n/** A Boolean entry is evaluated once and may retain a refinement witness. */\nexport type BooleanAssertionEvaluation<Refined> = {\n readonly state: \"matched\";\n readonly value: Refined;\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"not-applicable\";\n readonly diagnostic?: MatchDiagnostic;\n};\n/** A measurement is always a finite unit-interval value when it is available. */\nexport type MeasurementAssertionEvaluation = {\n readonly state: \"measured\";\n readonly value: number;\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"not-applicable\";\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"errored\";\n readonly detail?: AssertionSnapshotObject;\n};\nexport interface CapturedAssertionSnapshot {\n readonly material: Extract<AssertionMaterial, {\n readonly kind: \"snapshot\";\n }>;\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n}\nexport interface AssertionRegistrationBase {\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence?: readonly AssertionMaterial[];\n readonly coverage?: AssertionCoverage;\n readonly limitations?: readonly AssertionLimitation[];\n}\n/**\n * Scope, Judge, and Sandbox adapters use this internal registration shape.\n * They still register exactly one Assertion entry; they do not manufacture a\n * separate intermediate value for a later consumer.\n */\nexport interface BooleanAssertionRegistration<Refined> extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<BooleanAssertionEvaluation<Refined>, unknown, never>;\n}\nexport interface MeasurementAssertionRegistration extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<MeasurementAssertionEvaluation, unknown, never>;\n}\nexport interface PassBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n gate(): this;\n orStop(): Promise<Refined>;\n}\nexport interface ScoreBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n orStop(): Promise<Refined>;\n}\nexport interface PassMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n atLeast(value: number): PassMeasurementAssertionHandle<true>;\n gate(value: number): PassMeasurementAssertionHandle<true>;\n orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport interface ScoreMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n atLeast(value: number): ScoreMeasurementAssertionHandle<true>;\n score(points: number): this;\n orStop(this: ScoreMeasurementAssertionHandle<true>): Promise<number>;\n}\n/** A Boolean Assertion that intentionally has no author control-flow operation. */\ninterface PostRunPassBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n optional(): this;\n gate(): this;\n}\ninterface PostRunScoreBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n}\nexport type PostRunBooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PostRunPassBooleanAssertionHandle<Refined> : PostRunScoreBooleanAssertionHandle<Refined>;\n/** Direct score is an Assertion entry, but has no condition or stop barrier. */\nexport interface DirectScoreAssertionHandle extends AssertionHandleBase {\n readonly kind: \"direct-score\";\n}\nexport interface AssertionGroupContext {\n /**\n * Runs an ordinary author callback with one display-only group segment. The\n * callback remains inside the Attempt's outer Promise boundary; this facade\n * does not evaluate an Effect or create an independent runtime.\n */\n group<Value>(title: string, body: () => Value | PromiseLike<Value>): Promise<Awaited<Value>>;\n}\nexport interface PassAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"pass\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): PassBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle<true>;\n}\nexport interface ScoreAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"score\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): ScoreBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle<true>;\n score(points: number): DirectScoreAssertionHandle;\n}\nexport type AssertionsContext<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassAssertionsContext : ScoreAssertionsContext;\nexport type BooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PassBooleanAssertionHandle<Refined> : ScoreBooleanAssertionHandle<Refined>;\nexport type MeasurementAssertionHandle<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassMeasurementAssertionHandle : ScoreMeasurementAssertionHandle;\nexport interface AssertionSealOptions {\n readonly execution?: \"completed\" | \"errored\";\n readonly explicitlySkipped?: boolean;\n /**\n * The owning Attempt was interrupted before ordinary evaluation could\n * finish. Unsettled entries are sealed as producer-interrupted instead of\n * being silently omitted or evaluated on a detached runtime.\n */\n readonly interrupted?: boolean;\n}\nexport interface AssertionSealError {\n readonly _tag: \"AssertionSealError\";\n readonly code: \"pass-measurement-threshold-missing\";\n readonly entryIndex: number;\n}\n/** The sealed evaluation is a domain result, not a durable Record payload. */\nexport interface SealedAssertionEvaluationEntry {\n readonly required: boolean;\n readonly result: AssertionResult;\n}\nexport interface SealedAssertionEvaluation {\n readonly execution: \"completed\" | \"errored\";\n readonly explicitlySkipped: boolean;\n readonly assertions: readonly SealedAssertionEvaluationEntry[];\n}\n/**\n * One immutable result feeds the Verdict/Score fold and the private durable\n * producer adapter. No RecordAttachment writer type crosses this boundary.\n */\nexport interface SealedAssertionsRuntime {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n}\n/** The runtime Verdict is independent of the durable Verdict attachment codec. */\nexport interface AssertionVerdict {\n readonly state: \"passed\" | \"failed\" | \"errored\" | \"skipped\";\n}\nexport type AssertionScoreIncompleteReason = \"execution-errored\" | \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n/** The runtime Score is independent of the durable Score attachment codec. */\nexport type AssertionScore = {\n readonly state: \"complete\";\n readonly earned: number;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n} | {\n readonly state: \"unavailable\";\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n};\n/**\n * The attempt-owned frozen result is handed from Runner to the Evaluation\n * Record adapter. The adapter alone adds attachment schemas and writes.\n */\nexport interface SealedAttemptAssertions {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n readonly workspaceDiff?: AgentWorkspaceDiff;\n readonly verdict: AssertionVerdict;\n readonly score?: AssertionScore;\n}\nexport interface AssertionsRuntime<Kind extends AssertionEvaluationKind> {\n readonly evaluationKind: Kind;\n readonly t: AssertionsContext<Kind>;\n registerBoolean<Refined>(definition: BooleanAssertionRegistration<Refined>): BooleanAssertionHandle<Kind, Refined>;\n registerMeasurement(definition: MeasurementAssertionRegistration): MeasurementAssertionHandle<Kind>;\n seal(options?: AssertionSealOptions): Effect.Effect<SealedAssertionsRuntime, AssertionSealError, never>;\n}\n"]}
@@ -56,6 +56,12 @@ export type AssertionMaterial = {
56
56
  export type AssertionCriterion = {
57
57
  readonly kind: "value-match";
58
58
  readonly subject: "explicit-value";
59
+ readonly matcher: {
60
+ readonly state: "declared";
61
+ readonly name: string;
62
+ } | {
63
+ readonly state: "unavailable";
64
+ };
59
65
  } | {
60
66
  readonly kind: "scope-status";
61
67
  readonly scope: "turn" | "session" | "attempt";
@@ -120,6 +126,48 @@ export type AssertionScoreContribution = {
120
126
  readonly points: number;
121
127
  readonly reason: "source-unavailable" | "evaluation-errored" | "not-applicable";
122
128
  };
129
+ /** Constant-size semantic receipt for one collection evaluation. */
130
+ export interface AssertionCollectionReceipt {
131
+ readonly examined: number;
132
+ readonly matched: number;
133
+ readonly mismatched: number;
134
+ readonly unavailable: number;
135
+ readonly knownTotal: number | null;
136
+ readonly complete: boolean;
137
+ readonly exhaustive: boolean;
138
+ readonly decisive: boolean;
139
+ }
140
+ export type AssertionConditionPolicy = {
141
+ readonly kind: "boolean";
142
+ readonly expected: true;
143
+ } | {
144
+ readonly kind: "at-least";
145
+ readonly threshold: number;
146
+ } | {
147
+ readonly kind: "record-only";
148
+ };
149
+ export interface AssertionPolicy {
150
+ readonly requirement: "required" | "optional";
151
+ readonly condition: AssertionConditionPolicy;
152
+ }
153
+ export type AssertionObserved = {
154
+ readonly kind: "boolean";
155
+ readonly outcome: "matched" | "mismatched" | "unavailable" | "errored" | "not-applicable";
156
+ } | {
157
+ readonly kind: "measurement";
158
+ readonly state: "available";
159
+ readonly value: number;
160
+ } | {
161
+ readonly kind: "measurement";
162
+ readonly state: "unavailable";
163
+ } | {
164
+ readonly kind: "direct-score";
165
+ readonly state: "available";
166
+ readonly value: number;
167
+ } | {
168
+ readonly kind: "direct-score";
169
+ readonly state: "unavailable";
170
+ };
123
171
  export type AssertionResult = {
124
172
  readonly state: "matched";
125
173
  readonly gate: "not-gate" | "satisfied";
@@ -127,6 +175,7 @@ export type AssertionResult = {
127
175
  readonly state: "not-scored" | "earned";
128
176
  }>;
129
177
  readonly diagnostic?: AssertionSnapshotObject;
178
+ readonly receipt?: AssertionCollectionReceipt;
130
179
  } | {
131
180
  readonly state: "mismatched";
132
181
  readonly reason: "condition-not-met";
@@ -135,6 +184,7 @@ export type AssertionResult = {
135
184
  readonly state: "not-scored" | "earned";
136
185
  }>;
137
186
  readonly diagnostic?: AssertionSnapshotObject;
187
+ readonly receipt?: AssertionCollectionReceipt;
138
188
  } | {
139
189
  readonly state: "unavailable";
140
190
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
@@ -143,6 +193,7 @@ export type AssertionResult = {
143
193
  readonly state: "not-scored" | "unavailable";
144
194
  }>;
145
195
  readonly diagnostic?: AssertionSnapshotObject;
196
+ readonly receipt?: AssertionCollectionReceipt;
146
197
  } | {
147
198
  readonly state: "errored";
148
199
  readonly reason: "evaluator-failed" | "producer-interrupted" | "invalid-subject";
@@ -151,6 +202,7 @@ export type AssertionResult = {
151
202
  readonly state: "not-scored" | "unavailable";
152
203
  }>;
153
204
  readonly diagnostic?: AssertionSnapshotObject;
205
+ readonly receipt?: AssertionCollectionReceipt;
154
206
  } | {
155
207
  readonly state: "not-applicable";
156
208
  readonly reason: "coverage-not-applicable";
@@ -159,6 +211,7 @@ export type AssertionResult = {
159
211
  readonly state: "not-scored" | "unavailable";
160
212
  }>;
161
213
  readonly diagnostic?: AssertionSnapshotObject;
214
+ readonly receipt?: AssertionCollectionReceipt;
162
215
  };
163
216
  /** One fully formed author/runtime result, before durable attachment encoding. */
164
217
  export interface SealedAssertionEntry {
@@ -169,6 +222,8 @@ export interface SealedAssertionEntry {
169
222
  readonly coverage: AssertionCoverage;
170
223
  readonly limitations: readonly AssertionLimitation[];
171
224
  readonly result: AssertionResult;
225
+ readonly policy: AssertionPolicy;
226
+ readonly observed: AssertionObserved;
172
227
  }
173
228
  /**
174
229
  * Assertion handles are runtime-owned capabilities, not subjects for another
@@ -211,13 +266,16 @@ export type BooleanAssertionEvaluation<Refined> = {
211
266
  readonly state: "matched";
212
267
  readonly value: Refined;
213
268
  readonly diagnostic?: MatchDiagnostic;
269
+ readonly receipt?: AssertionCollectionReceipt;
214
270
  } | {
215
271
  readonly state: "mismatched";
216
272
  readonly diagnostic?: MatchDiagnostic;
273
+ readonly receipt?: AssertionCollectionReceipt;
217
274
  } | {
218
275
  readonly state: "unavailable";
219
276
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
220
277
  readonly diagnostic?: MatchDiagnostic;
278
+ readonly receipt?: AssertionCollectionReceipt;
221
279
  } | {
222
280
  readonly state: "not-applicable";
223
281
  readonly diagnostic?: MatchDiagnostic;
@@ -226,13 +284,17 @@ export type BooleanAssertionEvaluation<Refined> = {
226
284
  export type MeasurementAssertionEvaluation = {
227
285
  readonly state: "measured";
228
286
  readonly value: number;
287
+ readonly detail?: AssertionSnapshotObject;
229
288
  } | {
230
289
  readonly state: "unavailable";
231
290
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
291
+ readonly detail?: AssertionSnapshotObject;
232
292
  } | {
233
293
  readonly state: "not-applicable";
294
+ readonly detail?: AssertionSnapshotObject;
234
295
  } | {
235
296
  readonly state: "errored";
297
+ readonly detail?: AssertionSnapshotObject;
236
298
  };
237
299
  export interface CapturedAssertionSnapshot {
238
300
  readonly material: Extract<AssertionMaterial, {
@@ -56,6 +56,12 @@ export type AssertionMaterial = {
56
56
  export type AssertionCriterion = {
57
57
  readonly kind: "value-match";
58
58
  readonly subject: "explicit-value";
59
+ readonly matcher: {
60
+ readonly state: "declared";
61
+ readonly name: string;
62
+ } | {
63
+ readonly state: "unavailable";
64
+ };
59
65
  } | {
60
66
  readonly kind: "scope-status";
61
67
  readonly scope: "turn" | "session" | "attempt";
@@ -120,6 +126,48 @@ export type AssertionScoreContribution = {
120
126
  readonly points: number;
121
127
  readonly reason: "source-unavailable" | "evaluation-errored" | "not-applicable";
122
128
  };
129
+ /** Constant-size semantic receipt for one collection evaluation. */
130
+ export interface AssertionCollectionReceipt {
131
+ readonly examined: number;
132
+ readonly matched: number;
133
+ readonly mismatched: number;
134
+ readonly unavailable: number;
135
+ readonly knownTotal: number | null;
136
+ readonly complete: boolean;
137
+ readonly exhaustive: boolean;
138
+ readonly decisive: boolean;
139
+ }
140
+ export type AssertionConditionPolicy = {
141
+ readonly kind: "boolean";
142
+ readonly expected: true;
143
+ } | {
144
+ readonly kind: "at-least";
145
+ readonly threshold: number;
146
+ } | {
147
+ readonly kind: "record-only";
148
+ };
149
+ export interface AssertionPolicy {
150
+ readonly requirement: "required" | "optional";
151
+ readonly condition: AssertionConditionPolicy;
152
+ }
153
+ export type AssertionObserved = {
154
+ readonly kind: "boolean";
155
+ readonly outcome: "matched" | "mismatched" | "unavailable" | "errored" | "not-applicable";
156
+ } | {
157
+ readonly kind: "measurement";
158
+ readonly state: "available";
159
+ readonly value: number;
160
+ } | {
161
+ readonly kind: "measurement";
162
+ readonly state: "unavailable";
163
+ } | {
164
+ readonly kind: "direct-score";
165
+ readonly state: "available";
166
+ readonly value: number;
167
+ } | {
168
+ readonly kind: "direct-score";
169
+ readonly state: "unavailable";
170
+ };
123
171
  export type AssertionResult = {
124
172
  readonly state: "matched";
125
173
  readonly gate: "not-gate" | "satisfied";
@@ -127,6 +175,7 @@ export type AssertionResult = {
127
175
  readonly state: "not-scored" | "earned";
128
176
  }>;
129
177
  readonly diagnostic?: AssertionSnapshotObject;
178
+ readonly receipt?: AssertionCollectionReceipt;
130
179
  } | {
131
180
  readonly state: "mismatched";
132
181
  readonly reason: "condition-not-met";
@@ -135,6 +184,7 @@ export type AssertionResult = {
135
184
  readonly state: "not-scored" | "earned";
136
185
  }>;
137
186
  readonly diagnostic?: AssertionSnapshotObject;
187
+ readonly receipt?: AssertionCollectionReceipt;
138
188
  } | {
139
189
  readonly state: "unavailable";
140
190
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
@@ -143,6 +193,7 @@ export type AssertionResult = {
143
193
  readonly state: "not-scored" | "unavailable";
144
194
  }>;
145
195
  readonly diagnostic?: AssertionSnapshotObject;
196
+ readonly receipt?: AssertionCollectionReceipt;
146
197
  } | {
147
198
  readonly state: "errored";
148
199
  readonly reason: "evaluator-failed" | "producer-interrupted" | "invalid-subject";
@@ -151,6 +202,7 @@ export type AssertionResult = {
151
202
  readonly state: "not-scored" | "unavailable";
152
203
  }>;
153
204
  readonly diagnostic?: AssertionSnapshotObject;
205
+ readonly receipt?: AssertionCollectionReceipt;
154
206
  } | {
155
207
  readonly state: "not-applicable";
156
208
  readonly reason: "coverage-not-applicable";
@@ -159,6 +211,7 @@ export type AssertionResult = {
159
211
  readonly state: "not-scored" | "unavailable";
160
212
  }>;
161
213
  readonly diagnostic?: AssertionSnapshotObject;
214
+ readonly receipt?: AssertionCollectionReceipt;
162
215
  };
163
216
  /** One fully formed author/runtime result, before durable attachment encoding. */
164
217
  export interface SealedAssertionEntry {
@@ -169,6 +222,8 @@ export interface SealedAssertionEntry {
169
222
  readonly coverage: AssertionCoverage;
170
223
  readonly limitations: readonly AssertionLimitation[];
171
224
  readonly result: AssertionResult;
225
+ readonly policy: AssertionPolicy;
226
+ readonly observed: AssertionObserved;
172
227
  }
173
228
  /**
174
229
  * Assertion handles are runtime-owned capabilities, not subjects for another
@@ -211,13 +266,16 @@ export type BooleanAssertionEvaluation<Refined> = {
211
266
  readonly state: "matched";
212
267
  readonly value: Refined;
213
268
  readonly diagnostic?: MatchDiagnostic;
269
+ readonly receipt?: AssertionCollectionReceipt;
214
270
  } | {
215
271
  readonly state: "mismatched";
216
272
  readonly diagnostic?: MatchDiagnostic;
273
+ readonly receipt?: AssertionCollectionReceipt;
217
274
  } | {
218
275
  readonly state: "unavailable";
219
276
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
220
277
  readonly diagnostic?: MatchDiagnostic;
278
+ readonly receipt?: AssertionCollectionReceipt;
221
279
  } | {
222
280
  readonly state: "not-applicable";
223
281
  readonly diagnostic?: MatchDiagnostic;
@@ -226,13 +284,17 @@ export type BooleanAssertionEvaluation<Refined> = {
226
284
  export type MeasurementAssertionEvaluation = {
227
285
  readonly state: "measured";
228
286
  readonly value: number;
287
+ readonly detail?: AssertionSnapshotObject;
229
288
  } | {
230
289
  readonly state: "unavailable";
231
290
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
291
+ readonly detail?: AssertionSnapshotObject;
232
292
  } | {
233
293
  readonly state: "not-applicable";
294
+ readonly detail?: AssertionSnapshotObject;
234
295
  } | {
235
296
  readonly state: "errored";
297
+ readonly detail?: AssertionSnapshotObject;
236
298
  };
237
299
  export interface CapturedAssertionSnapshot {
238
300
  readonly material: Extract<AssertionMaterial, {
@@ -56,6 +56,12 @@ export type AssertionMaterial = {
56
56
  export type AssertionCriterion = {
57
57
  readonly kind: "value-match";
58
58
  readonly subject: "explicit-value";
59
+ readonly matcher: {
60
+ readonly state: "declared";
61
+ readonly name: string;
62
+ } | {
63
+ readonly state: "unavailable";
64
+ };
59
65
  } | {
60
66
  readonly kind: "scope-status";
61
67
  readonly scope: "turn" | "session" | "attempt";
@@ -120,6 +126,48 @@ export type AssertionScoreContribution = {
120
126
  readonly points: number;
121
127
  readonly reason: "source-unavailable" | "evaluation-errored" | "not-applicable";
122
128
  };
129
+ /** Constant-size semantic receipt for one collection evaluation. */
130
+ export interface AssertionCollectionReceipt {
131
+ readonly examined: number;
132
+ readonly matched: number;
133
+ readonly mismatched: number;
134
+ readonly unavailable: number;
135
+ readonly knownTotal: number | null;
136
+ readonly complete: boolean;
137
+ readonly exhaustive: boolean;
138
+ readonly decisive: boolean;
139
+ }
140
+ export type AssertionConditionPolicy = {
141
+ readonly kind: "boolean";
142
+ readonly expected: true;
143
+ } | {
144
+ readonly kind: "at-least";
145
+ readonly threshold: number;
146
+ } | {
147
+ readonly kind: "record-only";
148
+ };
149
+ export interface AssertionPolicy {
150
+ readonly requirement: "required" | "optional";
151
+ readonly condition: AssertionConditionPolicy;
152
+ }
153
+ export type AssertionObserved = {
154
+ readonly kind: "boolean";
155
+ readonly outcome: "matched" | "mismatched" | "unavailable" | "errored" | "not-applicable";
156
+ } | {
157
+ readonly kind: "measurement";
158
+ readonly state: "available";
159
+ readonly value: number;
160
+ } | {
161
+ readonly kind: "measurement";
162
+ readonly state: "unavailable";
163
+ } | {
164
+ readonly kind: "direct-score";
165
+ readonly state: "available";
166
+ readonly value: number;
167
+ } | {
168
+ readonly kind: "direct-score";
169
+ readonly state: "unavailable";
170
+ };
123
171
  export type AssertionResult = {
124
172
  readonly state: "matched";
125
173
  readonly gate: "not-gate" | "satisfied";
@@ -127,6 +175,7 @@ export type AssertionResult = {
127
175
  readonly state: "not-scored" | "earned";
128
176
  }>;
129
177
  readonly diagnostic?: AssertionSnapshotObject;
178
+ readonly receipt?: AssertionCollectionReceipt;
130
179
  } | {
131
180
  readonly state: "mismatched";
132
181
  readonly reason: "condition-not-met";
@@ -135,6 +184,7 @@ export type AssertionResult = {
135
184
  readonly state: "not-scored" | "earned";
136
185
  }>;
137
186
  readonly diagnostic?: AssertionSnapshotObject;
187
+ readonly receipt?: AssertionCollectionReceipt;
138
188
  } | {
139
189
  readonly state: "unavailable";
140
190
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
@@ -143,6 +193,7 @@ export type AssertionResult = {
143
193
  readonly state: "not-scored" | "unavailable";
144
194
  }>;
145
195
  readonly diagnostic?: AssertionSnapshotObject;
196
+ readonly receipt?: AssertionCollectionReceipt;
146
197
  } | {
147
198
  readonly state: "errored";
148
199
  readonly reason: "evaluator-failed" | "producer-interrupted" | "invalid-subject";
@@ -151,6 +202,7 @@ export type AssertionResult = {
151
202
  readonly state: "not-scored" | "unavailable";
152
203
  }>;
153
204
  readonly diagnostic?: AssertionSnapshotObject;
205
+ readonly receipt?: AssertionCollectionReceipt;
154
206
  } | {
155
207
  readonly state: "not-applicable";
156
208
  readonly reason: "coverage-not-applicable";
@@ -159,6 +211,7 @@ export type AssertionResult = {
159
211
  readonly state: "not-scored" | "unavailable";
160
212
  }>;
161
213
  readonly diagnostic?: AssertionSnapshotObject;
214
+ readonly receipt?: AssertionCollectionReceipt;
162
215
  };
163
216
  /** One fully formed author/runtime result, before durable attachment encoding. */
164
217
  export interface SealedAssertionEntry {
@@ -169,6 +222,8 @@ export interface SealedAssertionEntry {
169
222
  readonly coverage: AssertionCoverage;
170
223
  readonly limitations: readonly AssertionLimitation[];
171
224
  readonly result: AssertionResult;
225
+ readonly policy: AssertionPolicy;
226
+ readonly observed: AssertionObserved;
172
227
  }
173
228
  /**
174
229
  * Assertion handles are runtime-owned capabilities, not subjects for another
@@ -211,13 +266,16 @@ export type BooleanAssertionEvaluation<Refined> = {
211
266
  readonly state: "matched";
212
267
  readonly value: Refined;
213
268
  readonly diagnostic?: MatchDiagnostic;
269
+ readonly receipt?: AssertionCollectionReceipt;
214
270
  } | {
215
271
  readonly state: "mismatched";
216
272
  readonly diagnostic?: MatchDiagnostic;
273
+ readonly receipt?: AssertionCollectionReceipt;
217
274
  } | {
218
275
  readonly state: "unavailable";
219
276
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
220
277
  readonly diagnostic?: MatchDiagnostic;
278
+ readonly receipt?: AssertionCollectionReceipt;
221
279
  } | {
222
280
  readonly state: "not-applicable";
223
281
  readonly diagnostic?: MatchDiagnostic;
@@ -226,13 +284,17 @@ export type BooleanAssertionEvaluation<Refined> = {
226
284
  export type MeasurementAssertionEvaluation = {
227
285
  readonly state: "measured";
228
286
  readonly value: number;
287
+ readonly detail?: AssertionSnapshotObject;
229
288
  } | {
230
289
  readonly state: "unavailable";
231
290
  readonly reason: "evidence-unavailable" | "source-unavailable" | "redacted";
291
+ readonly detail?: AssertionSnapshotObject;
232
292
  } | {
233
293
  readonly state: "not-applicable";
294
+ readonly detail?: AssertionSnapshotObject;
234
295
  } | {
235
296
  readonly state: "errored";
297
+ readonly detail?: AssertionSnapshotObject;
236
298
  };
237
299
  export interface CapturedAssertionSnapshot {
238
300
  readonly material: Extract<AssertionMaterial, {
@@ -181,9 +181,6 @@ function freezeJudgeMaterial(material) {
181
181
  }
182
182
  return Object.freeze({ input: material.input, output: material.output });
183
183
  }
184
- function evidenceFor(material) {
185
- return JSON.stringify({ input: (0, display_ts_1.summaryText)(material.input), output: (0, display_ts_1.summaryText)(material.output) });
186
- }
187
184
  function missingConfiguration(resolved) {
188
185
  if (!resolved.model)
189
186
  return unavailable("judge-model-unresolved");
@@ -309,11 +306,25 @@ function evaluateJudgeRecipe(input) {
309
306
  return effect_1.Effect.succeed(evaluatorError("judge-invalid-response", "Judge returned no finite score in [0, 1]"));
310
307
  }
311
308
  const rationale = result.metadata?.rationale;
309
+ const returnedEvidence = result.metadata?.evidence;
310
+ const returnedDetail = result.metadata?.detail;
311
+ const returnedCitations = result.metadata?.citations;
312
312
  return effect_1.Effect.succeed({
313
313
  state: "measured",
314
314
  value: result.score,
315
- evidence: evidenceFor(frozenMaterial),
315
+ ...(typeof returnedEvidence === "string" && returnedEvidence.trim() !== ""
316
+ ? { evidence: (0, display_ts_1.summaryText)(returnedEvidence) }
317
+ : {}),
316
318
  ...(typeof rationale === "string" && rationale.trim() !== "" ? { explanation: (0, display_ts_1.summaryText)(rationale) } : {}),
319
+ ...(typeof returnedDetail === "string" && returnedDetail.trim() !== "" ? { detail: (0, display_ts_1.summaryText)(returnedDetail) } : {}),
320
+ ...(Array.isArray(returnedCitations)
321
+ ? {
322
+ citations: Object.freeze(returnedCitations
323
+ .slice(0, 16)
324
+ .filter((citation) => typeof citation === "string" && citation.trim() !== "")
325
+ .map(display_ts_1.summaryText)),
326
+ }
327
+ : {}),
317
328
  });
318
329
  }), effect_1.Effect.catchAll((failure) => effect_1.Effect.gen(function* () {
319
330
  const error = failure.error;
@@ -338,6 +349,46 @@ function evaluateJudgeRecipe(input) {
338
349
  }
339
350
  /** Assert-first bridge: one provider Promise adaptation in the Attempt Effect. */
340
351
  function evaluateJudgeMeasurement(input) {
341
- return evaluateJudgeRecipe(input);
352
+ return evaluateJudgeRecipe(input).pipe(effect_1.Effect.map((result) => {
353
+ switch (result.state) {
354
+ case "measured":
355
+ return Object.freeze({
356
+ state: "measured",
357
+ value: result.value,
358
+ detail: Object.freeze({
359
+ evidence: result.evidence === undefined
360
+ ? Object.freeze({ state: "unavailable", reason: "not-recorded" })
361
+ : Object.freeze({ state: "available", value: result.evidence }),
362
+ rationale: result.explanation === undefined
363
+ ? Object.freeze({ state: "unavailable", reason: "not-recorded" })
364
+ : Object.freeze({ state: "available", value: result.explanation }),
365
+ detail: result.detail === undefined
366
+ ? Object.freeze({ state: "unavailable", reason: "not-recorded" })
367
+ : Object.freeze({ state: "available", value: result.detail }),
368
+ citations: result.citations === undefined
369
+ ? Object.freeze({ state: "unavailable", reason: "not-recorded" })
370
+ : Object.freeze({ state: "available", value: result.citations }),
371
+ }),
372
+ });
373
+ case "unavailable":
374
+ return Object.freeze({
375
+ state: "unavailable",
376
+ reason: result.reason,
377
+ detail: Object.freeze({
378
+ failureDetail: result.detail,
379
+ failureEvidence: result.evidence ?? Object.freeze({ state: "unavailable", reason: "not-recorded" }),
380
+ rationale: Object.freeze({ state: "unavailable", reason: "not-recorded" }),
381
+ evidence: Object.freeze({ state: "unavailable", reason: "not-recorded" }),
382
+ detail: Object.freeze({ state: "unavailable", reason: "not-recorded" }),
383
+ citations: Object.freeze({ state: "unavailable", reason: "not-recorded" }),
384
+ }),
385
+ });
386
+ case "errored":
387
+ return Object.freeze({
388
+ state: "errored",
389
+ detail: Object.freeze({ code: result.code, message: result.message }),
390
+ });
391
+ }
392
+ }));
342
393
  }
343
394
  //# sourceMappingURL=judge.cjs.map