niceeval 0.17.1 → 0.19.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 (692) hide show
  1. package/INDEX.md +5 -2
  2. package/dist/adapter-usage.cjs.map +1 -1
  3. package/dist/adapter-usage.d.cts +1 -1
  4. package/dist/adapter-usage.d.mts +1 -1
  5. package/dist/adapter-usage.d.ts +1 -1
  6. package/dist/adapter.cjs +8 -3
  7. package/dist/adapter.cjs.map +1 -1
  8. package/dist/adapter.d.cts +26 -15
  9. package/dist/adapter.d.mts +26 -15
  10. package/dist/adapter.d.ts +26 -15
  11. package/dist/agents/{effect-runtime.cjs → agent-effects.cjs} +12 -18
  12. package/dist/agents/agent-effects.cjs.map +1 -0
  13. package/dist/agents/agent-effects.d.cts +23 -0
  14. package/dist/agents/agent-effects.d.mts +23 -0
  15. package/dist/agents/agent-effects.d.ts +23 -0
  16. package/dist/agents/agent-effects.js +16 -0
  17. package/dist/agents/agent-effects.js.map +1 -0
  18. package/dist/agents/ai-sdk.cjs +1 -1
  19. package/dist/agents/ai-sdk.cjs.map +1 -1
  20. package/dist/agents/bub.cjs +31 -18
  21. package/dist/agents/bub.cjs.map +1 -1
  22. package/dist/agents/bub.d.cts +9 -12
  23. package/dist/agents/bub.d.mts +9 -12
  24. package/dist/agents/bub.d.ts +9 -12
  25. package/dist/agents/claude-code-native.cjs +2 -2
  26. package/dist/agents/claude-code-native.cjs.map +1 -1
  27. package/dist/agents/claude-code.cjs +17 -11
  28. package/dist/agents/claude-code.cjs.map +1 -1
  29. package/dist/agents/claude-code.d.cts +11 -11
  30. package/dist/agents/claude-code.d.mts +11 -11
  31. package/dist/agents/claude-code.d.ts +11 -11
  32. package/dist/agents/codex-app-server.cjs +2 -2
  33. package/dist/agents/codex-app-server.cjs.map +1 -1
  34. package/dist/agents/codex.cjs +18 -12
  35. package/dist/agents/codex.cjs.map +1 -1
  36. package/dist/agents/codex.d.cts +12 -12
  37. package/dist/agents/codex.d.mts +12 -12
  38. package/dist/agents/codex.d.ts +12 -12
  39. package/dist/agents/deepseek-harness.cjs +2 -2
  40. package/dist/agents/deepseek-harness.cjs.map +1 -1
  41. package/dist/agents/hermes.cjs +3 -3
  42. package/dist/agents/hermes.cjs.map +1 -1
  43. package/dist/agents/index.cjs +3 -3
  44. package/dist/agents/index.cjs.map +1 -1
  45. package/dist/agents/index.d.cts +3 -3
  46. package/dist/agents/index.d.mts +3 -3
  47. package/dist/agents/index.d.ts +3 -3
  48. package/dist/agents/index.js +2 -2
  49. package/dist/agents/index.mjs +2 -2
  50. package/dist/agents/mcp.cjs.map +1 -1
  51. package/dist/agents/mcp.d.cts +2 -2
  52. package/dist/agents/mcp.d.mts +2 -2
  53. package/dist/agents/mcp.d.ts +2 -2
  54. package/dist/agents/omp.cjs +2 -2
  55. package/dist/agents/omp.cjs.map +1 -1
  56. package/dist/agents/openai-compat.cjs +2 -2
  57. package/dist/agents/openai-compat.cjs.map +1 -1
  58. package/dist/agents/openclaw.cjs +3 -3
  59. package/dist/agents/openclaw.cjs.map +1 -1
  60. package/dist/agents/opencode.cjs +16 -4
  61. package/dist/agents/opencode.cjs.map +1 -1
  62. package/dist/agents/plugin-extensions.cjs +71 -0
  63. package/dist/agents/plugin-extensions.cjs.map +1 -0
  64. package/dist/agents/plugin-extensions.d.cts +26 -0
  65. package/dist/agents/plugin-extensions.d.mts +26 -0
  66. package/dist/agents/plugin-extensions.d.ts +26 -0
  67. package/dist/agents/plugin-extensions.js +8 -0
  68. package/dist/agents/plugin-extensions.js.map +1 -0
  69. package/dist/agents/post-setup.cjs +14 -3
  70. package/dist/agents/post-setup.cjs.map +1 -1
  71. package/dist/agents/post-setup.d.cts +4 -2
  72. package/dist/agents/post-setup.d.mts +4 -2
  73. package/dist/agents/post-setup.d.ts +4 -2
  74. package/dist/agents/post-setup.js +8 -6
  75. package/dist/agents/sdk-streams.cjs +3 -3
  76. package/dist/agents/sdk-streams.cjs.map +1 -1
  77. package/dist/agents/{session-slot.cjs → session-key.cjs} +4 -4
  78. package/dist/agents/session-key.cjs.map +1 -0
  79. package/dist/agents/session-key.d.cts +12 -0
  80. package/dist/agents/session-key.d.mts +12 -0
  81. package/dist/agents/session-key.d.ts +12 -0
  82. package/dist/agents/session-key.js +6 -0
  83. package/dist/agents/session-key.js.map +1 -0
  84. package/dist/agents/shared.cjs +2 -2
  85. package/dist/agents/shared.cjs.map +1 -1
  86. package/dist/agents/shared.d.cts +4 -4
  87. package/dist/agents/shared.d.mts +4 -4
  88. package/dist/agents/shared.d.ts +4 -4
  89. package/dist/agents/skills.cjs.map +1 -1
  90. package/dist/agents/skills.d.cts +3 -3
  91. package/dist/agents/skills.d.mts +3 -3
  92. package/dist/agents/skills.d.ts +3 -3
  93. package/dist/agents/types.cjs.map +1 -1
  94. package/dist/agents/types.d.cts +55 -54
  95. package/dist/agents/types.d.mts +55 -54
  96. package/dist/agents/types.d.ts +55 -54
  97. package/dist/agents/ui-message-stream.cjs +4 -4
  98. package/dist/agents/ui-message-stream.cjs.map +1 -1
  99. package/dist/agents/unrecognized-events.cjs +32 -0
  100. package/dist/agents/unrecognized-events.cjs.map +1 -0
  101. package/dist/agents/unrecognized-events.d.cts +8 -0
  102. package/dist/agents/unrecognized-events.d.mts +8 -0
  103. package/dist/agents/unrecognized-events.d.ts +8 -0
  104. package/dist/agents/unrecognized-events.js +6 -0
  105. package/dist/agents/unrecognized-events.js.map +1 -0
  106. package/dist/assertions/api.cjs.map +1 -1
  107. package/dist/assertions/api.d.cts +3 -0
  108. package/dist/assertions/api.d.mts +3 -0
  109. package/dist/assertions/api.d.ts +3 -0
  110. package/dist/assertions/collection.cjs +1 -1
  111. package/dist/assertions/collection.cjs.map +1 -1
  112. package/dist/assertions/judge.cjs +1 -1
  113. package/dist/assertions/judge.cjs.map +1 -1
  114. package/dist/assertions/match.cjs +52 -21
  115. package/dist/assertions/match.cjs.map +1 -1
  116. package/dist/assertions/match.d.cts +16 -5
  117. package/dist/assertions/match.d.mts +16 -5
  118. package/dist/assertions/match.d.ts +16 -5
  119. package/dist/assertions/match.js +96 -94
  120. package/dist/assertions/measurements.cjs +61 -0
  121. package/dist/assertions/measurements.cjs.map +1 -0
  122. package/dist/assertions/measurements.d.cts +24 -0
  123. package/dist/assertions/measurements.d.mts +24 -0
  124. package/dist/assertions/measurements.d.ts +24 -0
  125. package/dist/assertions/measurements.js +8 -0
  126. package/dist/assertions/measurements.js.map +1 -0
  127. package/dist/assertions/numeric.cjs +2 -0
  128. package/dist/assertions/numeric.cjs.map +1 -1
  129. package/dist/assertions/numeric.d.cts +1 -1
  130. package/dist/assertions/numeric.d.mts +1 -1
  131. package/dist/assertions/numeric.d.ts +1 -1
  132. package/dist/assertions/quantity.cjs +42 -0
  133. package/dist/assertions/quantity.cjs.map +1 -0
  134. package/dist/assertions/quantity.d.cts +18 -0
  135. package/dist/assertions/quantity.d.mts +18 -0
  136. package/dist/assertions/quantity.d.ts +18 -0
  137. package/dist/assertions/quantity.js +22 -0
  138. package/dist/assertions/quantity.js.map +1 -0
  139. package/dist/assertions/record/attachment.cjs +2 -0
  140. package/dist/assertions/record/attachment.cjs.map +1 -1
  141. package/dist/assertions/record/codec.cjs +5 -1
  142. package/dist/assertions/record/codec.cjs.map +1 -1
  143. package/dist/assertions/record/model.cjs.map +1 -1
  144. package/dist/assertions/record/model.d.cts +3 -1
  145. package/dist/assertions/record/model.d.mts +3 -1
  146. package/dist/assertions/record/model.d.ts +3 -1
  147. package/dist/assertions/runtime.cjs +11 -6
  148. package/dist/assertions/runtime.cjs.map +1 -1
  149. package/dist/cli/program.cjs +3 -0
  150. package/dist/cli/program.cjs.map +1 -1
  151. package/dist/context/assert-first.cjs +6 -4
  152. package/dist/context/assert-first.cjs.map +1 -1
  153. package/dist/context/assert-first.d.cts +9 -3
  154. package/dist/context/assert-first.d.mts +9 -3
  155. package/dist/context/assert-first.d.ts +9 -3
  156. package/dist/context/notes.cjs +47 -0
  157. package/dist/context/notes.cjs.map +1 -0
  158. package/dist/context/notes.d.cts +10 -0
  159. package/dist/context/notes.d.mts +10 -0
  160. package/dist/context/notes.d.ts +10 -0
  161. package/dist/context/notes.js +6 -0
  162. package/dist/context/notes.js.map +1 -0
  163. package/dist/context/send-failures.cjs +1 -7
  164. package/dist/context/send-failures.cjs.map +1 -1
  165. package/dist/context/send-failures.d.cts +2 -3
  166. package/dist/context/send-failures.d.mts +2 -3
  167. package/dist/context/send-failures.d.ts +2 -3
  168. package/dist/context/send-retry.cjs +0 -1
  169. package/dist/context/send-retry.cjs.map +1 -1
  170. package/dist/context/send-retry.d.cts +1 -2
  171. package/dist/context/send-retry.d.mts +1 -2
  172. package/dist/context/send-retry.d.ts +1 -2
  173. package/dist/context/session.cjs +10 -17
  174. package/dist/context/session.cjs.map +1 -1
  175. package/dist/context/session.d.cts +4 -10
  176. package/dist/context/session.d.mts +4 -10
  177. package/dist/context/session.d.ts +4 -10
  178. package/dist/define.cjs +89 -64
  179. package/dist/define.cjs.map +1 -1
  180. package/dist/define.d.cts +3 -3
  181. package/dist/define.d.mts +3 -3
  182. package/dist/define.d.ts +3 -3
  183. package/dist/eval/cli/contribution.cjs +1 -1
  184. package/dist/eval/cli/contribution.cjs.map +1 -1
  185. package/dist/eval/host/index.cjs +1 -1
  186. package/dist/eval/host/index.cjs.map +1 -1
  187. package/dist/eval/record/evaluation.cjs +1 -1
  188. package/dist/eval/record/evaluation.cjs.map +1 -1
  189. package/dist/eval/record/membership-provenance.d.cts +3 -3
  190. package/dist/eval/record/membership-provenance.d.mts +3 -3
  191. package/dist/eval/record/membership-provenance.d.ts +3 -3
  192. package/dist/eval/record/score.cjs +2 -2
  193. package/dist/eval/record/score.cjs.map +1 -1
  194. package/dist/eval/record/sealed-assertion.cjs +1 -1
  195. package/dist/eval/record/sealed-assertion.cjs.map +1 -1
  196. package/dist/eval/record/verdict.cjs +2 -2
  197. package/dist/eval/record/verdict.cjs.map +1 -1
  198. package/dist/expect/index.cjs +13 -1
  199. package/dist/expect/index.cjs.map +1 -1
  200. package/dist/expect/index.d.cts +5 -1
  201. package/dist/expect/index.d.mts +5 -1
  202. package/dist/expect/index.d.ts +5 -1
  203. package/dist/expect/index.js +92 -72
  204. package/dist/expect/index.mjs +92 -72
  205. package/dist/experiment/host/cli/contribution.cjs +52 -39
  206. package/dist/experiment/host/cli/contribution.cjs.map +1 -1
  207. package/dist/experiment/host/cli/contribution.d.cts +18 -4
  208. package/dist/experiment/host/cli/contribution.d.mts +18 -4
  209. package/dist/experiment/host/cli/contribution.d.ts +18 -4
  210. package/dist/experiment/host/cli/contribution.js +2 -2
  211. package/dist/experiment/host/cli/debug-protocol.cjs +2 -2
  212. package/dist/experiment/host/cli/debug-protocol.cjs.map +1 -1
  213. package/dist/experiment/host/cli/debug-protocol.d.cts +2 -2
  214. package/dist/experiment/host/cli/debug-protocol.d.mts +2 -2
  215. package/dist/experiment/host/cli/debug-protocol.d.ts +2 -2
  216. package/dist/experiment/host/cli/output-protocol.cjs +1 -1
  217. package/dist/experiment/host/cli/output-protocol.cjs.map +1 -1
  218. package/dist/experiment/host/cli/output-protocol.d.cts +2 -2
  219. package/dist/experiment/host/cli/output-protocol.d.mts +2 -2
  220. package/dist/experiment/host/cli/output-protocol.d.ts +2 -2
  221. package/dist/experiment/host/current.cjs +2 -2
  222. package/dist/experiment/host/current.cjs.map +1 -1
  223. package/dist/experiment/host/index.cjs +1 -1
  224. package/dist/experiment/host/index.cjs.map +1 -1
  225. package/dist/experiment/host/operations.cjs +24 -23
  226. package/dist/experiment/host/operations.cjs.map +1 -1
  227. package/dist/experiment/host/runtime.cjs +11 -10
  228. package/dist/experiment/host/runtime.cjs.map +1 -1
  229. package/dist/experiment/host/runtime.d.cts +3 -3
  230. package/dist/experiment/host/runtime.d.mts +3 -3
  231. package/dist/experiment/host/runtime.d.ts +3 -3
  232. package/dist/experiment/host/teardown.cjs +4 -3
  233. package/dist/experiment/host/teardown.cjs.map +1 -1
  234. package/dist/experiment/host/teardown.d.cts +3 -3
  235. package/dist/experiment/host/teardown.d.mts +3 -3
  236. package/dist/experiment/host/teardown.d.ts +3 -3
  237. package/dist/experiment/host/types.cjs.map +1 -1
  238. package/dist/experiment/host/types.d.cts +19 -19
  239. package/dist/experiment/host/types.d.mts +19 -19
  240. package/dist/experiment/host/types.d.ts +19 -19
  241. package/dist/index.cjs +3 -19
  242. package/dist/index.cjs.map +1 -1
  243. package/dist/index.d.cts +4 -8
  244. package/dist/index.d.mts +4 -8
  245. package/dist/index.d.ts +4 -8
  246. package/dist/index.js +12 -34
  247. package/dist/index.mjs +12 -34
  248. package/dist/inspection/assertions.cjs +1 -1
  249. package/dist/inspection/assertions.cjs.map +1 -1
  250. package/dist/inspection/cli/contribution.cjs +8 -7
  251. package/dist/inspection/cli/contribution.cjs.map +1 -1
  252. package/dist/inspection/facts.cjs +4 -4
  253. package/dist/inspection/facts.cjs.map +1 -1
  254. package/dist/inspection/index.cjs +1 -5
  255. package/dist/inspection/index.cjs.map +1 -1
  256. package/dist/inspection/index.d.cts +1 -2
  257. package/dist/inspection/index.d.mts +1 -2
  258. package/dist/inspection/index.d.ts +1 -2
  259. package/dist/inspection/index.js +20 -26
  260. package/dist/inspection/lifecycle.cjs +7 -0
  261. package/dist/inspection/lifecycle.cjs.map +1 -0
  262. package/dist/inspection/lifecycle.d.cts +4 -0
  263. package/dist/inspection/lifecycle.d.mts +4 -0
  264. package/dist/inspection/lifecycle.d.ts +4 -0
  265. package/dist/inspection/lifecycle.js +6 -0
  266. package/dist/inspection/lifecycle.js.map +1 -0
  267. package/dist/inspection/notes.cjs +40 -0
  268. package/dist/inspection/notes.cjs.map +1 -0
  269. package/dist/inspection/notes.d.cts +12 -0
  270. package/dist/inspection/notes.d.mts +12 -0
  271. package/dist/inspection/notes.d.ts +12 -0
  272. package/dist/inspection/notes.js +8 -0
  273. package/dist/inspection/notes.js.map +1 -0
  274. package/dist/inspection/overview.cjs +12 -15
  275. package/dist/inspection/overview.cjs.map +1 -1
  276. package/dist/inspection/overview.d.cts +8 -6
  277. package/dist/inspection/overview.d.mts +8 -6
  278. package/dist/inspection/overview.d.ts +8 -6
  279. package/dist/inspection/planned-attempt.cjs +45 -0
  280. package/dist/inspection/planned-attempt.cjs.map +1 -0
  281. package/dist/inspection/planned-attempt.d.cts +109 -0
  282. package/dist/inspection/planned-attempt.d.mts +109 -0
  283. package/dist/inspection/planned-attempt.d.ts +109 -0
  284. package/dist/inspection/planned-attempt.js +24 -0
  285. package/dist/inspection/planned-attempt.js.map +1 -0
  286. package/dist/inspection/project-result.cjs +5 -5
  287. package/dist/inspection/project-result.cjs.map +1 -1
  288. package/dist/inspection/project-result.d.cts +58 -57
  289. package/dist/inspection/project-result.d.mts +58 -57
  290. package/dist/inspection/project-result.d.ts +58 -57
  291. package/dist/inspection/project-result.js +4 -4
  292. package/dist/inspection/project.cjs +3 -3
  293. package/dist/inspection/project.cjs.map +1 -1
  294. package/dist/inspection/protocol-values.cjs +1 -1
  295. package/dist/inspection/protocol-values.cjs.map +1 -1
  296. package/dist/inspection/protocol-values.d.cts +1 -1
  297. package/dist/inspection/protocol-values.d.mts +1 -1
  298. package/dist/inspection/protocol-values.d.ts +1 -1
  299. package/dist/inspection/protocol.cjs +8 -8
  300. package/dist/inspection/protocol.cjs.map +1 -1
  301. package/dist/inspection/protocol.d.cts +237 -219
  302. package/dist/inspection/protocol.d.mts +237 -219
  303. package/dist/inspection/protocol.d.ts +237 -219
  304. package/dist/inspection/public.cjs +1 -5
  305. package/dist/inspection/public.cjs.map +1 -1
  306. package/dist/inspection/public.d.cts +1 -2
  307. package/dist/inspection/public.d.mts +1 -2
  308. package/dist/inspection/public.d.ts +1 -2
  309. package/dist/inspection/public.js +14 -20
  310. package/dist/inspection/public.mjs +166 -129
  311. package/dist/inspection/query.cjs +1 -1
  312. package/dist/inspection/query.cjs.map +1 -1
  313. package/dist/inspection/results.cjs +61 -52
  314. package/dist/inspection/results.cjs.map +1 -1
  315. package/dist/inspection/results.d.cts +157 -140
  316. package/dist/inspection/results.d.mts +157 -140
  317. package/dist/inspection/results.d.ts +157 -140
  318. package/dist/inspection/select.cjs +33 -28
  319. package/dist/inspection/select.cjs.map +1 -1
  320. package/dist/inspection/source.cjs +1 -1
  321. package/dist/inspection/source.cjs.map +1 -1
  322. package/dist/inspection/sources.cjs +2 -2
  323. package/dist/inspection/sources.cjs.map +1 -1
  324. package/dist/inspection/trace.cjs +9 -8
  325. package/dist/inspection/trace.cjs.map +1 -1
  326. package/dist/inspection/trace.d.cts +4 -4
  327. package/dist/inspection/trace.d.mts +4 -4
  328. package/dist/inspection/trace.d.ts +4 -4
  329. package/dist/loaders/index.cjs +7 -279
  330. package/dist/loaders/index.cjs.map +1 -1
  331. package/dist/loaders/index.d.cts +2 -95
  332. package/dist/loaders/index.d.mts +2 -95
  333. package/dist/loaders/index.d.ts +2 -95
  334. package/dist/loaders/index.js +10 -12
  335. package/dist/loaders/index.mjs +10 -12
  336. package/dist/loaders/runtime.cjs +283 -0
  337. package/dist/loaders/runtime.cjs.map +1 -0
  338. package/dist/loaders/runtime.d.cts +95 -0
  339. package/dist/loaders/runtime.d.mts +95 -0
  340. package/dist/loaders/runtime.d.ts +95 -0
  341. package/dist/loaders/runtime.js +16 -0
  342. package/dist/loaders/runtime.js.map +1 -0
  343. package/dist/migrations/judge-provider.md +6 -6
  344. package/dist/{model-slots.cjs → model-roles.cjs} +26 -7
  345. package/dist/model-roles.cjs.map +1 -0
  346. package/dist/model-roles.d.cts +26 -0
  347. package/dist/model-roles.d.mts +26 -0
  348. package/dist/model-roles.d.ts +26 -0
  349. package/dist/model-roles.js +14 -0
  350. package/dist/model-roles.js.map +1 -0
  351. package/dist/o11y/adapter-usage-projection.cjs +9 -8
  352. package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
  353. package/dist/o11y/adapter-usage-projection.d.cts +23 -15
  354. package/dist/o11y/adapter-usage-projection.d.mts +23 -15
  355. package/dist/o11y/adapter-usage-projection.d.ts +23 -15
  356. package/dist/o11y/cache-read.cjs +14 -14
  357. package/dist/o11y/cache-read.cjs.map +1 -1
  358. package/dist/o11y/cache-read.d.cts +5 -5
  359. package/dist/o11y/cache-read.d.mts +5 -5
  360. package/dist/o11y/cache-read.d.ts +5 -5
  361. package/dist/o11y/derive.cjs.map +1 -1
  362. package/dist/o11y/derive.d.cts +2 -2
  363. package/dist/o11y/derive.d.mts +2 -2
  364. package/dist/o11y/derive.d.ts +2 -2
  365. package/dist/o11y/eval-usage.cjs +9 -9
  366. package/dist/o11y/eval-usage.cjs.map +1 -1
  367. package/dist/o11y/eval-usage.d.cts +7 -7
  368. package/dist/o11y/eval-usage.d.mts +7 -7
  369. package/dist/o11y/eval-usage.d.ts +7 -7
  370. package/dist/o11y/parsers/bub.cjs +57 -81
  371. package/dist/o11y/parsers/bub.cjs.map +1 -1
  372. package/dist/o11y/parsers/index.cjs.map +1 -1
  373. package/dist/o11y/parsers/index.d.cts +2 -0
  374. package/dist/o11y/parsers/index.d.mts +2 -0
  375. package/dist/o11y/parsers/index.d.ts +2 -0
  376. package/dist/o11y/parsers/opencode.cjs +129 -217
  377. package/dist/o11y/parsers/opencode.cjs.map +1 -1
  378. package/dist/o11y/parsers/opencode.d.cts +2 -5
  379. package/dist/o11y/parsers/opencode.d.mts +2 -5
  380. package/dist/o11y/parsers/opencode.d.ts +2 -5
  381. package/dist/o11y/types.cjs.map +1 -1
  382. package/dist/o11y/types.d.cts +1 -1
  383. package/dist/o11y/types.d.mts +1 -1
  384. package/dist/o11y/types.d.ts +1 -1
  385. package/dist/plugin/contracts.cjs +170 -120
  386. package/dist/plugin/contracts.cjs.map +1 -1
  387. package/dist/plugin/contracts.d.cts +102 -90
  388. package/dist/plugin/contracts.d.mts +102 -90
  389. package/dist/plugin/contracts.d.ts +102 -90
  390. package/dist/plugin/contracts.js +16 -12
  391. package/dist/plugin/index.cjs.map +1 -1
  392. package/dist/plugin/index.d.cts +1 -1
  393. package/dist/plugin/index.d.mts +1 -1
  394. package/dist/plugin/index.d.ts +1 -1
  395. package/dist/plugin/link.cjs +69 -64
  396. package/dist/plugin/link.cjs.map +1 -1
  397. package/dist/plugin/link.d.cts +5 -3
  398. package/dist/plugin/link.d.mts +5 -3
  399. package/dist/plugin/link.d.ts +5 -3
  400. package/dist/plugin/link.js +12 -8
  401. package/dist/record/codec/seal-manifest.d.cts +3 -3
  402. package/dist/record/codec/seal-manifest.d.mts +3 -3
  403. package/dist/record/codec/seal-manifest.d.ts +3 -3
  404. package/dist/record/family/attempt-note/definition.cjs +12 -0
  405. package/dist/record/family/attempt-note/definition.cjs.map +1 -0
  406. package/dist/record/family/attempt-note/definition.d.cts +6 -0
  407. package/dist/record/family/attempt-note/definition.d.mts +6 -0
  408. package/dist/record/family/attempt-note/definition.d.ts +6 -0
  409. package/dist/record/family/attempt-note/definition.js +6 -0
  410. package/dist/record/family/attempt-note/definition.js.map +1 -0
  411. package/dist/record/family/attempt-note/persistence.cjs +10 -0
  412. package/dist/record/family/attempt-note/persistence.cjs.map +1 -0
  413. package/dist/record/family/attempt-note/persistence.d.cts +6 -0
  414. package/dist/record/family/attempt-note/persistence.d.mts +6 -0
  415. package/dist/record/family/attempt-note/persistence.d.ts +6 -0
  416. package/dist/record/family/attempt-note/persistence.js +6 -0
  417. package/dist/record/family/attempt-note/persistence.js.map +1 -0
  418. package/dist/record/family/attempt-note/schema.cjs +20 -0
  419. package/dist/record/family/attempt-note/schema.cjs.map +1 -0
  420. package/dist/record/family/attempt-note/schema.d.cts +21 -0
  421. package/dist/record/family/attempt-note/schema.d.mts +21 -0
  422. package/dist/record/family/attempt-note/schema.d.ts +21 -0
  423. package/dist/record/family/attempt-note/schema.js +10 -0
  424. package/dist/record/family/attempt-note/schema.js.map +1 -0
  425. package/dist/record/family/catalog.cjs +32 -29
  426. package/dist/record/family/catalog.cjs.map +1 -1
  427. package/dist/record/family/catalog.d.cts +7 -2
  428. package/dist/record/family/catalog.d.mts +7 -2
  429. package/dist/record/family/catalog.d.ts +7 -2
  430. package/dist/record/family/current.cjs +48 -45
  431. package/dist/record/family/current.cjs.map +1 -1
  432. package/dist/record/family/current.d.cts +15 -0
  433. package/dist/record/family/current.d.mts +15 -0
  434. package/dist/record/family/current.d.ts +15 -0
  435. package/dist/record/model/index.js +66 -64
  436. package/dist/record/model/run-context.cjs +9 -3
  437. package/dist/record/model/run-context.cjs.map +1 -1
  438. package/dist/record/model/run-context.d.cts +9 -2
  439. package/dist/record/model/run-context.d.mts +9 -2
  440. package/dist/record/model/run-context.d.ts +9 -2
  441. package/dist/record/model/run-context.js +8 -6
  442. package/dist/record/model/seal-manifest.d.cts +1 -1
  443. package/dist/record/model/seal-manifest.d.mts +1 -1
  444. package/dist/record/model/seal-manifest.d.ts +1 -1
  445. package/dist/run/cli/contribution.cjs +6 -32
  446. package/dist/run/cli/contribution.cjs.map +1 -1
  447. package/dist/run/host/runtime.cjs +1 -1
  448. package/dist/run/host/runtime.cjs.map +1 -1
  449. package/dist/run/storage/sqlite.cjs +7 -7
  450. package/dist/run/storage/sqlite.cjs.map +1 -1
  451. package/dist/runner/adapter-usage.cjs +5 -3
  452. package/dist/runner/adapter-usage.cjs.map +1 -1
  453. package/dist/runner/adapter-usage.d.cts +2 -2
  454. package/dist/runner/adapter-usage.d.mts +2 -2
  455. package/dist/runner/adapter-usage.d.ts +2 -2
  456. package/dist/runner/adoption.cjs +10 -12
  457. package/dist/runner/adoption.cjs.map +1 -1
  458. package/dist/runner/attempt-notes.cjs +8 -0
  459. package/dist/runner/attempt-notes.cjs.map +1 -0
  460. package/dist/runner/attempt-notes.d.cts +4 -0
  461. package/dist/runner/attempt-notes.d.mts +4 -0
  462. package/dist/runner/attempt-notes.d.ts +4 -0
  463. package/dist/runner/attempt-notes.js +8 -0
  464. package/dist/runner/attempt-notes.js.map +1 -0
  465. package/dist/runner/attempt.cjs +61 -73
  466. package/dist/runner/attempt.cjs.map +1 -1
  467. package/dist/runner/attempt.d.cts +3 -3
  468. package/dist/runner/attempt.d.mts +3 -3
  469. package/dist/runner/attempt.d.ts +3 -3
  470. package/dist/runner/command-plan.cjs +21 -26
  471. package/dist/runner/command-plan.cjs.map +1 -1
  472. package/dist/runner/command-plan.d.cts +4 -4
  473. package/dist/runner/command-plan.d.mts +4 -4
  474. package/dist/runner/command-plan.d.ts +4 -4
  475. package/dist/runner/command-plan.js +4 -4
  476. package/dist/runner/config-identity.cjs.map +1 -1
  477. package/dist/runner/config-identity.d.cts +2 -2
  478. package/dist/runner/config-identity.d.mts +2 -2
  479. package/dist/runner/config-identity.d.ts +2 -2
  480. package/dist/runner/discover.cjs +6 -6
  481. package/dist/runner/discover.cjs.map +1 -1
  482. package/dist/runner/eval-selection.cjs +15 -1
  483. package/dist/runner/eval-selection.cjs.map +1 -1
  484. package/dist/runner/eval-selection.d.cts +4 -0
  485. package/dist/runner/eval-selection.d.mts +4 -0
  486. package/dist/runner/eval-selection.d.ts +4 -0
  487. package/dist/runner/feedback/human.cjs +1 -1
  488. package/dist/runner/feedback/human.cjs.map +1 -1
  489. package/dist/runner/feedback/json.cjs +4 -2
  490. package/dist/runner/feedback/json.cjs.map +1 -1
  491. package/dist/runner/feedback/json.d.cts +1 -1
  492. package/dist/runner/feedback/json.d.mts +1 -1
  493. package/dist/runner/feedback/json.d.ts +1 -1
  494. package/dist/runner/feedback/sink.cjs +1 -1
  495. package/dist/runner/feedback/sink.cjs.map +1 -1
  496. package/dist/runner/feedback/sink.d.cts +1 -1
  497. package/dist/runner/feedback/sink.d.mts +1 -1
  498. package/dist/runner/feedback/sink.d.ts +1 -1
  499. package/dist/runner/fingerprint.cjs +1 -1
  500. package/dist/runner/fingerprint.cjs.map +1 -1
  501. package/dist/runner/lock.cjs +1 -3
  502. package/dist/runner/lock.cjs.map +1 -1
  503. package/dist/runner/lock.d.cts +0 -2
  504. package/dist/runner/lock.d.mts +0 -2
  505. package/dist/runner/lock.d.ts +0 -2
  506. package/dist/runner/lock.js +14 -16
  507. package/dist/runner/project-target.cjs.map +1 -1
  508. package/dist/runner/project-target.d.cts +2 -2
  509. package/dist/runner/project-target.d.mts +2 -2
  510. package/dist/runner/project-target.d.ts +2 -2
  511. package/dist/runner/record/attachments.cjs +2 -2
  512. package/dist/runner/record/attachments.cjs.map +1 -1
  513. package/dist/runner/record/planning.cjs +8 -2
  514. package/dist/runner/record/planning.cjs.map +1 -1
  515. package/dist/runner/record.cjs +2 -0
  516. package/dist/runner/record.cjs.map +1 -1
  517. package/dist/runner/report.cjs +3 -3
  518. package/dist/runner/report.cjs.map +1 -1
  519. package/dist/runner/report.d.cts +1 -1
  520. package/dist/runner/report.d.mts +1 -1
  521. package/dist/runner/report.d.ts +1 -1
  522. package/dist/runner/reuse-plan.cjs +2 -2
  523. package/dist/runner/reuse-plan.cjs.map +1 -1
  524. package/dist/runner/run.cjs +10 -45
  525. package/dist/runner/run.cjs.map +1 -1
  526. package/dist/runner/sandbox-pool.cjs +1 -2
  527. package/dist/runner/sandbox-pool.cjs.map +1 -1
  528. package/dist/runner/setup-prefix-preparation.cjs +1 -1
  529. package/dist/runner/setup-prefix-preparation.cjs.map +1 -1
  530. package/dist/runner/teardown-registry.cjs +2 -2
  531. package/dist/runner/teardown-registry.cjs.map +1 -1
  532. package/dist/runner/teardown-registry.d.cts +1 -1
  533. package/dist/runner/teardown-registry.d.mts +1 -1
  534. package/dist/runner/teardown-registry.d.ts +1 -1
  535. package/dist/runner/types.cjs +4 -4
  536. package/dist/runner/types.cjs.map +1 -1
  537. package/dist/runner/types.d.cts +64 -92
  538. package/dist/runner/types.d.mts +64 -92
  539. package/dist/runner/types.d.ts +64 -92
  540. package/dist/runner/types.js +2 -2
  541. package/dist/sandbox/action.cjs +1 -1
  542. package/dist/sandbox/action.cjs.map +1 -1
  543. package/dist/sandbox/cli/contribution.cjs +17 -14
  544. package/dist/sandbox/cli/contribution.cjs.map +1 -1
  545. package/dist/sandbox/cli/contribution.d.cts +1 -1
  546. package/dist/sandbox/cli/contribution.d.mts +1 -1
  547. package/dist/sandbox/cli/contribution.d.ts +1 -1
  548. package/dist/sandbox/commands.cjs +1 -1
  549. package/dist/sandbox/commands.cjs.map +1 -1
  550. package/dist/sandbox/commands.d.cts +1 -1
  551. package/dist/sandbox/commands.d.mts +1 -1
  552. package/dist/sandbox/commands.d.ts +1 -1
  553. package/dist/sandbox/compose.cjs +2 -2
  554. package/dist/sandbox/compose.cjs.map +1 -1
  555. package/dist/sandbox/docker-profile/registry.cjs +5 -10
  556. package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
  557. package/dist/sandbox/docker-profile/registry.d.cts +0 -4
  558. package/dist/sandbox/docker-profile/registry.d.mts +0 -4
  559. package/dist/sandbox/docker-profile/registry.d.ts +0 -4
  560. package/dist/sandbox/docker-profile/registry.js +6 -14
  561. package/dist/sandbox/docker-profile/runtime.cjs +1 -1
  562. package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
  563. package/dist/sandbox/docker-profile/schema.cjs +12 -16
  564. package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
  565. package/dist/sandbox/docker-profile/schema.d.cts +2 -6
  566. package/dist/sandbox/docker-profile/schema.d.mts +2 -6
  567. package/dist/sandbox/docker-profile/schema.d.ts +2 -6
  568. package/dist/sandbox/docker-profile/schema.js +24 -32
  569. package/dist/sandbox/incus.cjs +2 -2
  570. package/dist/sandbox/incus.cjs.map +1 -1
  571. package/dist/sandbox/index.cjs +4 -36
  572. package/dist/sandbox/index.cjs.map +1 -1
  573. package/dist/sandbox/index.d.cts +4 -8
  574. package/dist/sandbox/index.d.mts +4 -8
  575. package/dist/sandbox/index.d.ts +4 -8
  576. package/dist/sandbox/index.js +116 -174
  577. package/dist/sandbox/index.mjs +116 -174
  578. package/dist/sandbox/layer.cjs +3 -3
  579. package/dist/sandbox/layer.cjs.map +1 -1
  580. package/dist/sandbox/link.cjs +5 -0
  581. package/dist/sandbox/link.cjs.map +1 -1
  582. package/dist/sandbox/link.d.cts +3 -0
  583. package/dist/sandbox/link.d.mts +3 -0
  584. package/dist/sandbox/link.d.ts +3 -0
  585. package/dist/sandbox/runtime.cjs +9 -4
  586. package/dist/sandbox/runtime.cjs.map +1 -1
  587. package/dist/shared/failure-class.cjs +5 -5
  588. package/dist/shared/failure-class.cjs.map +1 -1
  589. package/dist/shared/failure-class.d.cts +4 -10
  590. package/dist/shared/failure-class.d.mts +4 -10
  591. package/dist/shared/failure-class.d.ts +4 -10
  592. package/dist/shared/types.cjs.map +1 -1
  593. package/dist/shared/types.d.cts +1 -1
  594. package/dist/shared/types.d.mts +1 -1
  595. package/dist/shared/types.d.ts +1 -1
  596. package/dist/show/contribution.cjs +17 -2
  597. package/dist/show/contribution.cjs.map +1 -1
  598. package/dist/show/contribution.d.cts +14 -0
  599. package/dist/show/contribution.d.mts +14 -0
  600. package/dist/show/contribution.d.ts +14 -0
  601. package/dist/show/model.cjs +8 -5
  602. package/dist/show/model.cjs.map +1 -1
  603. package/dist/show/model.d.cts +11 -8
  604. package/dist/show/model.d.mts +11 -8
  605. package/dist/show/model.d.ts +11 -8
  606. package/dist/show/render.cjs +34 -22
  607. package/dist/show/render.cjs.map +1 -1
  608. package/dist/sources/projector.cjs +1 -1
  609. package/dist/sources/projector.cjs.map +1 -1
  610. package/dist/types.cjs +1 -1
  611. package/dist/types.cjs.map +1 -1
  612. package/dist/types.d.cts +1 -1
  613. package/dist/types.d.mts +1 -1
  614. package/dist/types.d.ts +1 -1
  615. package/dist/types.js +2 -2
  616. package/dist/view/app-dist/.vite/manifest.json +2 -2
  617. package/dist/view/app-dist/assets/{index-B3ijZRph.js → index-CxrOUvHC.js} +17 -17
  618. package/dist/view/app-dist/assets/{quality-cost-scatter-B--DfJ9s.js → quality-cost-scatter-B6Aiss7x.js} +1 -1
  619. package/dist/view/app-dist/index.html +1 -1
  620. package/dist/view/cli/contribution.cjs +1 -1
  621. package/dist/view/cli/contribution.cjs.map +1 -1
  622. package/dist/view/function-runtime.mjs +318 -121
  623. package/dist/view/http-protocol.d.cts +1 -1
  624. package/dist/view/http-protocol.d.mts +1 -1
  625. package/dist/view/http-protocol.d.ts +1 -1
  626. package/dist/view/inspection-host.cjs +2 -2
  627. package/dist/view/inspection-host.cjs.map +1 -1
  628. package/dist/view/inspection-host.d.cts +349 -331
  629. package/dist/view/inspection-host.d.mts +349 -331
  630. package/dist/view/inspection-host.d.ts +349 -331
  631. package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +9 -9
  632. package/docs-site/zh/examples/integrations/claude-sdk.mdx +8 -8
  633. package/docs-site/zh/examples/integrations/codex-sdk.mdx +4 -4
  634. package/docs-site/zh/examples/integrations/langgraph.mdx +6 -6
  635. package/docs-site/zh/examples/integrations/pi-sdk.mdx +8 -8
  636. package/docs-site/zh/explanation/adapter.mdx +6 -6
  637. package/docs-site/zh/explanation/assert.mdx +7 -7
  638. package/docs-site/zh/explanation/drive.mdx +4 -4
  639. package/docs-site/zh/explanation/hitl.mdx +2 -2
  640. package/docs-site/zh/explanation/judge.mdx +3 -3
  641. package/docs-site/zh/index.mdx +18 -0
  642. package/docs-site/zh/introduction.mdx +4 -3
  643. package/docs-site/zh/reference/builtin-agents.mdx +46 -49
  644. package/docs-site/zh/reference/cli.mdx +16 -14
  645. package/docs-site/zh/reference/define-agent.mdx +19 -19
  646. package/docs-site/zh/reference/define-config.mdx +7 -15
  647. package/docs-site/zh/reference/define-eval.mdx +20 -14
  648. package/docs-site/zh/reference/define-experiment.mdx +18 -39
  649. package/docs-site/zh/reference/events.mdx +1 -1
  650. package/docs-site/zh/reference/expect.mdx +21 -0
  651. package/docs-site/zh/reference/official-adapters.mdx +12 -5
  652. package/docs-site/zh/troubleshooting/debugging.mdx +2 -2
  653. package/docs-site/zh/troubleshooting/recover-after-kill.mdx +1 -1
  654. package/docs-site/zh/tutorials/agent-onboarding.mdx +2 -2
  655. package/docs-site/zh/tutorials/authoring.mdx +4 -3
  656. package/docs-site/zh/tutorials/compare-runs.mdx +1 -1
  657. package/docs-site/zh/tutorials/concurrency.mdx +8 -8
  658. package/docs-site/zh/tutorials/configuration.mdx +5 -5
  659. package/docs-site/zh/tutorials/control-run-cost.mdx +49 -9
  660. package/docs-site/zh/tutorials/eval-groups.mdx +1 -1
  661. package/docs-site/zh/tutorials/evaluation-kinds.mdx +5 -5
  662. package/docs-site/zh/tutorials/experiment-services.mdx +32 -32
  663. package/docs-site/zh/tutorials/handle-execution-failures.mdx +2 -28
  664. package/docs-site/zh/tutorials/plugins.mdx +49 -143
  665. package/docs-site/zh/tutorials/sandbox-agent.mdx +1 -1
  666. package/docs-site/zh/tutorials/sandbox-reuse.mdx +7 -7
  667. package/docs-site/zh/tutorials/upgrade-0-18.mdx +64 -0
  668. package/docs-site/zh/tutorials/upgrade-0-19.mdx +121 -0
  669. package/docs-site/zh/tutorials/upgrade-0-20.mdx +12 -0
  670. package/docs-site/zh/tutorials/verify-judge.mdx +4 -3
  671. package/docs-site/zh/tutorials/viewing-results.mdx +2 -2
  672. package/docs-site/zh/tutorials/write-experiment.mdx +1 -1
  673. package/docs-site/zh/tutorials/write-send.mdx +13 -13
  674. package/package.json +1 -1
  675. package/dist/agents/effect-runtime.cjs.map +0 -1
  676. package/dist/agents/effect-runtime.d.cts +0 -29
  677. package/dist/agents/effect-runtime.d.mts +0 -29
  678. package/dist/agents/effect-runtime.d.ts +0 -29
  679. package/dist/agents/effect-runtime.js +0 -16
  680. package/dist/agents/effect-runtime.js.map +0 -1
  681. package/dist/agents/session-slot.cjs.map +0 -1
  682. package/dist/agents/session-slot.d.cts +0 -12
  683. package/dist/agents/session-slot.d.mts +0 -12
  684. package/dist/agents/session-slot.d.ts +0 -12
  685. package/dist/agents/session-slot.js +0 -6
  686. package/dist/agents/session-slot.js.map +0 -1
  687. package/dist/model-slots.cjs.map +0 -1
  688. package/dist/model-slots.d.cts +0 -19
  689. package/dist/model-slots.d.mts +0 -19
  690. package/dist/model-slots.d.ts +0 -19
  691. package/dist/model-slots.js +0 -8
  692. package/dist/model-slots.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.evalCatalogCliCommand = exports.EVAL_CATALOG_OPTIONS = void 0;
4
- // @concord-file ne-eval-cli-catalog
4
+ // @concord-file
5
5
  // @concord-implements docs/feature/eval/README.md
6
6
  const effect_1 = require("effect");
7
7
  const application_ts_1 = require("../../cli/application.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,kDAAkD;AAClD,mCAAgC;AAChC,6DAAkH;AAClH,+DAAyF;AACzF,iFAA0E;AAC1E,+CAA4C;AAC/B,QAAA,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;KAC/F,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;KAC5F,CAAC;CACmD,CAAC,CAAC;AAC3D,MAAM,iBAAiB,GAAG;;;;CAIzB,CAAC;AACF,MAAM,OAAO,GAAG,CAAC,SAAiB,EAAE,KAAc,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,iCAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC1I,SAAS,KAAK,CAAC,IAAY;IACvB,OAAO,eAAM,CAAC,OAAO,CAAC,0BAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI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BAAuB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAChH,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,+CAAoB,CAAC;QAClD,KAAK,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QACpH,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,mBAAQ,CAAC,OAAO,CAAC;YACpC,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/E,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7E,KAAK,CAAC,CAAC,KAAK,CAAC,cAAc,OAAO,CAAC,OAAO,CAAC,MAAM;CACxD,CAAC,CAAC;QACK,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAClC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC1F,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC,CAAC;CACL,CAAC,CAAC","sourcesContent":["// @concord-file ne-eval-cli-catalog\n// @concord-implements docs/feature/eval/README.md\nimport { Effect } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { ProjectConfiguration } from \"../../cli/project-configuration.ts\";\nimport { evalHost } from \"../host/index.ts\";\nexport const EVAL_CATALOG_OPTIONS = Object.freeze({\n tag: Object.freeze({\n type: \"string\",\n help: Object.freeze({ summary: \"List only evals carrying this tag.\", visibility: \"public\" }),\n }),\n help: Object.freeze({\n type: \"boolean\",\n short: \"h\",\n help: Object.freeze({ summary: \"Show Eval catalog command help.\", visibility: \"public\" }),\n }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst EVAL_CATALOG_HELP = `niceeval list — list discovered Evals\n\nUsage:\n niceeval list [--tag <tag>]\n`;\nconst failure = (operation: string, cause: unknown, exitCode = 1) => new CliFeatureError({ feature: \"eval\", operation, cause, exitCode });\nfunction write(text: string): Effect.Effect<void, CliFeatureError, CliOutput> {\n return Effect.flatMap(CliOutput, (output) => output.writeStdout(text)).pipe(Effect.mapError((cause) => failure(\"write eval catalog\", cause)));\n}\nexport const evalCatalogCliCommand: CliCommandContribution<CliArguments | CliInvocationFacts | CliOutput | ProjectConfiguration, CliFeatureError> = Object.freeze({\n name: \"list\",\n summary: \"list discovered evals\",\n options: EVAL_CATALOG_OPTIONS,\n run: (argv: readonly string[]) => Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parser.parse(argv, EVAL_CATALOG_OPTIONS),\n catch: (cause) => failure(\"parse eval catalog command\", cause),\n });\n if (parsed.positionals.length > 0) {\n return yield* Effect.fail(failure(\"parse eval catalog command\", new Error(\"niceeval list accepts no positional arguments.\")));\n }\n if (parsed.values.help === true) {\n yield* write(EVAL_CATALOG_HELP);\n return 0;\n }\n const invocation = yield* CliInvocationFacts;\n const facts = yield* invocation.facts.pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n const configuration = yield* ProjectConfiguration;\n yield* configuration.load(facts.cwd).pipe(Effect.mapError((cause) => failure(\"load project configuration\", cause)));\n const catalog = yield* evalHost.catalog({\n cwd: facts.cwd,\n ...(typeof parsed.values.tag === \"string\" ? { tag: parsed.values.tag } : {}),\n }).pipe(Effect.mapError((cause) => failure(\"discover eval catalog\", cause)));\n yield* write(`Discovered ${catalog.entries.length} evals:\n`);\n for (const entry of catalog.entries) {\n yield* write(` ${entry.id}${entry.description ? ` — ${entry.description}` : \"\"}\\n`);\n }\n return 0;\n }),\n});\n"]}
1
+ {"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,kDAAkD;AAClD,mCAAgC;AAChC,6DAAkH;AAClH,+DAAyF;AACzF,iFAA0E;AAC1E,+CAA4C;AAC/B,QAAA,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;KAC/F,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;KAC5F,CAAC;CACmD,CAAC,CAAC;AAC3D,MAAM,iBAAiB,GAAG;;;;CAIzB,CAAC;AACF,MAAM,OAAO,GAAG,CAAC,SAAiB,EAAE,KAAc,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,iCAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC1I,SAAS,KAAK,CAAC,IAAY;IACvB,OAAO,eAAM,CAAC,OAAO,CAAC,0BAAS,EAAE,CAAC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md\nimport { Effect } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { ProjectConfiguration } from \"../../cli/project-configuration.ts\";\nimport { evalHost } from \"../host/index.ts\";\nexport const EVAL_CATALOG_OPTIONS = Object.freeze({\n tag: Object.freeze({\n type: \"string\",\n help: Object.freeze({ summary: \"List only evals carrying this tag.\", visibility: \"public\" }),\n }),\n help: Object.freeze({\n type: \"boolean\",\n short: \"h\",\n help: Object.freeze({ summary: \"Show Eval catalog command help.\", visibility: \"public\" }),\n }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst EVAL_CATALOG_HELP = `niceeval list — list discovered Evals\n\nUsage:\n niceeval list [--tag <tag>]\n`;\nconst failure = (operation: string, cause: unknown, exitCode = 1) => new CliFeatureError({ feature: \"eval\", operation, cause, exitCode });\nfunction write(text: string): Effect.Effect<void, CliFeatureError, CliOutput> {\n return Effect.flatMap(CliOutput, (output) => output.writeStdout(text)).pipe(Effect.mapError((cause) => failure(\"write eval catalog\", cause)));\n}\nexport const evalCatalogCliCommand: CliCommandContribution<CliArguments | CliInvocationFacts | CliOutput | ProjectConfiguration, CliFeatureError> = Object.freeze({\n name: \"list\",\n summary: \"list discovered evals\",\n options: EVAL_CATALOG_OPTIONS,\n run: (argv: readonly string[]) => Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parser.parse(argv, EVAL_CATALOG_OPTIONS),\n catch: (cause) => failure(\"parse eval catalog command\", cause),\n });\n if (parsed.positionals.length > 0) {\n return yield* Effect.fail(failure(\"parse eval catalog command\", new Error(\"niceeval list accepts no positional arguments.\")));\n }\n if (parsed.values.help === true) {\n yield* write(EVAL_CATALOG_HELP);\n return 0;\n }\n const invocation = yield* CliInvocationFacts;\n const facts = yield* invocation.facts.pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n const configuration = yield* ProjectConfiguration;\n yield* configuration.load(facts.cwd).pipe(Effect.mapError((cause) => failure(\"load project configuration\", cause)));\n const catalog = yield* evalHost.catalog({\n cwd: facts.cwd,\n ...(typeof parsed.values.tag === \"string\" ? { tag: parsed.values.tag } : {}),\n }).pipe(Effect.mapError((cause) => failure(\"discover eval catalog\", cause)));\n yield* write(`Discovered ${catalog.entries.length} evals:\n`);\n for (const entry of catalog.entries) {\n yield* write(` ${entry.id}${entry.description ? ` — ${entry.description}` : \"\"}\\n`);\n }\n return 0;\n }),\n});\n"]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.evalHost = exports.EvalCatalogError = void 0;
4
- // @concord-file ne-eval-host-catalog
4
+ // @concord-file
5
5
  // @concord-implements docs/feature/eval/README.md
6
6
  const effect_1 = require("effect");
7
7
  const discover_ts_1 = require("../../runner/discover.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AACrC,kDAAkD;AAClD,mCAAsC;AACtC,0DAAyD;AAUzD,MAAa,gBAAiB,SAAQ,aAAI,CAAC,WAAW,CAAC,kBAAkB,CAGvE;CACD;AAJD,4CAIC;AACD,SAAS,OAAO,CAAC,KAGhB;IACG,OAAO,IAAA,2BAAa,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;QAC1E,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;aAC5B,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACvF,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;YACnC,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,GAAG,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC;YACxF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;YACjD,cAAc,EAAE,UAAU,CAAC,cAAc;SAC5C,CAAC,CAAC,CAAC;KACP,CAAC,CAAC,EAAE,eAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AACD,iGAAiG;AACpF,QAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC","sourcesContent":["// @concord-file ne-eval-host-catalog\n// @concord-implements docs/feature/eval/README.md\nimport { Data, Effect } from \"effect\";\nimport { discoverEvals } from \"../../runner/discover.ts\";\nexport interface EvalCatalogEntry {\n readonly id: string;\n readonly description?: string;\n readonly tags: readonly string[];\n readonly evaluationKind: \"pass\" | \"score\";\n}\nexport interface EvalCatalog {\n readonly entries: readonly EvalCatalogEntry[];\n}\nexport class EvalCatalogError extends Data.TaggedError(\"EvalCatalogError\")<{\n readonly operation: \"catalog\";\n readonly cause: unknown;\n}> {\n}\nfunction catalog(input: {\n readonly cwd: string;\n readonly tag?: string;\n}): Effect.Effect<EvalCatalog, EvalCatalogError> {\n return discoverEvals(input.cwd).pipe(Effect.map((discovered) => Object.freeze({\n entries: Object.freeze(discovered\n .filter((definition) => input.tag === undefined || definition.tags?.includes(input.tag))\n .map((definition) => Object.freeze({\n id: definition.id,\n ...(definition.description === undefined ? {} : { description: definition.description }),\n tags: Object.freeze([...(definition.tags ?? [])]),\n evaluationKind: definition.evaluationKind,\n }))),\n })), Effect.mapError((cause) => new EvalCatalogError({ operation: \"catalog\", cause })));\n}\n/** Eval discovery is a closed Host operation; CLI consumers never receive Runner definitions. */\nexport const evalHost = Object.freeze({ catalog });\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,kDAAkD;AAClD,mCAAsC;AACtC,0DAAyD;AAUzD,MAAa,gBAAiB,SAAQ,aAAI,CAAC,WAAW,CAAC,kBAAkB,CAGvE;CACD;AAJD,4CAIC;AACD,SAAS,OAAO,CAAC,KAGhB;IACG,OAAO,IAAA,2BAAa,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;QAC1E,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;aAC5B,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACvF,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;YACnC,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,GAAG,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC;YACxF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;YACjD,cAAc,EAAE,UAAU,CAAC,cAAc;SAC5C,CAAC,CAAC,CAAC;KACP,CAAC,CAAC,EAAE,eAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AACD,iGAAiG;AACpF,QAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/eval/README.md\nimport { Data, Effect } from \"effect\";\nimport { discoverEvals } from \"../../runner/discover.ts\";\nexport interface EvalCatalogEntry {\n readonly id: string;\n readonly description?: string;\n readonly tags: readonly string[];\n readonly evaluationKind: \"pass\" | \"score\";\n}\nexport interface EvalCatalog {\n readonly entries: readonly EvalCatalogEntry[];\n}\nexport class EvalCatalogError extends Data.TaggedError(\"EvalCatalogError\")<{\n readonly operation: \"catalog\";\n readonly cause: unknown;\n}> {\n}\nfunction catalog(input: {\n readonly cwd: string;\n readonly tag?: string;\n}): Effect.Effect<EvalCatalog, EvalCatalogError> {\n return discoverEvals(input.cwd).pipe(Effect.map((discovered) => Object.freeze({\n entries: Object.freeze(discovered\n .filter((definition) => input.tag === undefined || definition.tags?.includes(input.tag))\n .map((definition) => Object.freeze({\n id: definition.id,\n ...(definition.description === undefined ? {} : { description: definition.description }),\n tags: Object.freeze([...(definition.tags ?? [])]),\n evaluationKind: definition.evaluationKind,\n }))),\n })), Effect.mapError((cause) => new EvalCatalogError({ operation: \"catalog\", cause })));\n}\n/** Eval discovery is a closed Host operation; CLI consumers never receive Runner definitions. */\nexport const evalHost = Object.freeze({ catalog });\n"]}
@@ -6,7 +6,7 @@ exports.decodeEvaluationsPayload = decodeEvaluationsPayload;
6
6
  exports.buildEvaluationsPayload = buildEvaluationsPayload;
7
7
  exports.projectEvaluationsPayload = projectEvaluationsPayload;
8
8
  exports.projectEvaluations = projectEvaluations;
9
- // @concord-file ne-eval-record-evaluation
9
+ // @concord-file
10
10
  // @concord-implements docs/feature/eval/README.md
11
11
  // @concord-implements docs/feature/inspection/README.md
12
12
  const effect_1 = require("effect");
@@ -1 +1 @@
1
- {"version":3,"file":"evaluation.js","sourceRoot":"","sources":["evaluation.ts"],"names":[],"mappings":";;;AA8DA,gEA6BC;AASD,4DAKC;AACD,0DAQC;AAQD,8DAQC;AAUD,gDASC;AArJD,0CAA0C;AAC1C,kDAAkD;AAClD,wDAAwD;AACxD,mCAAwC;AACxC,sEAAiE;AACjE,sEAA0F;AAC1F,8DAA8D;AAC9D,mDAA+F;AAC/F;;;GAGG;AACU,QAAA,oBAAoB,GAAG,eAAM,CAAC,QAAQ,CAAC,gCAAgB,CAAC,CAAC;AAIzD,QAAA,8BAA8B,GAAG,eAAM,CAAC,MAAM,CAAC,KAAK,CAAC,eAAM,CAAC,KAAK,EAAE,EAAE,eAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvG,QAAA,oBAAoB,GAAG,eAAM,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,6BAAY;IACpB,OAAO,EAAE,sCAA8B;CAC1C,CAAC,CAAC;AAGU,QAAA,0BAA0B,GAAG,eAAM,CAAC,MAAM,CAAC;IACpD,MAAM,EAAE,8CAA8B;IACtC,cAAc,EAAE,4BAAoB;IACpC,KAAK,EAAE,eAAM,CAAC,aAAa,CAAC,4BAAoB,CAAC;CACpD,CAAC,CAAC;AAGH,MAAM,kCAAkC,GAAG,eAAM,CAAC,MAAM,CAAC;IACrD,YAAY,EAAE,8CAA8B;IAC5C,WAAW,EAAE,eAAM,CAAC,KAAK,CAAC,kCAA0B,CAAC;CACxD,CAAC,CAAC;AAuBH,SAAS,sBAAsB,CAAC,IAAoB,EAAE,KAAqB;IACvE,OAAO,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;QACjC,CAAC,CAAC,IAAA,yCAAwB,EAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;QACrD,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,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AAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACvF,CAAC;AAUD,SAAgB,kBAAkB,CAAC,OAA2B;IAC1D,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;YAC7E,EAAE,EAAE,UAAU,CAAC,MAAM;YACrB,IAAI,EAAE,UAAU,CAAC,cAAc;YAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;SAC9C,CAAC,CAAC,CAAC;KACP,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file ne-eval-record-evaluation\n// @concord-implements docs/feature/eval/README.md\n// @concord-implements docs/feature/inspection/README.md\nimport { Result, Schema } from \"effect\";\nimport { SlotIdSchema } from \"../../record/codec/identifiers.ts\";\nimport { compareCanonicalIdentity, type SlotId } from \"../../record/model/identifiers.ts\";\nimport { EVALUATION_KINDS } from \"../../shared/evaluation.ts\";\nimport { EvaluationRecordIdentitySchema, ExactEvaluationParseOptions, } from \"./attachment.ts\";\n/**\n * Eval-to-slot planning is transient. Core carries the immutable Slot identity\n * once a Run is created; no evaluations Attachment exists in Record v1.\n */\nexport const EvaluationKindSchema = Schema.Literals(EVALUATION_KINDS);\nexport type EvaluationKind = Schema.toType<typeof EvaluationKindSchema>[\"Type\"];\nexport type EvaluationId = Schema.toType<typeof EvaluationRecordIdentitySchema>[\"Type\"];\nexport type ExperimentId = Schema.toType<typeof EvaluationRecordIdentitySchema>[\"Type\"];\nexport const EvaluationAttemptOrdinalSchema = Schema.Number.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0));\nexport type EvaluationAttemptOrdinal = Schema.toType<typeof EvaluationAttemptOrdinalSchema>[\"Type\"];\nexport const EvaluationSlotSchema = Schema.Struct({\n slotId: SlotIdSchema,\n attempt: EvaluationAttemptOrdinalSchema,\n});\nexport type EvaluationSlot = Schema.toType<typeof EvaluationSlotSchema>[\"Type\"];\nexport type EvaluationSlotEncoded = Schema.Codec.Encoded<typeof EvaluationSlotSchema>;\nexport const EvaluationDefinitionSchema = Schema.Struct({\n evalId: EvaluationRecordIdentitySchema,\n evaluationKind: EvaluationKindSchema,\n slots: Schema.NonEmptyArray(EvaluationSlotSchema),\n});\nexport type EvaluationDefinition = Schema.toType<typeof EvaluationDefinitionSchema>[\"Type\"];\nexport type EvaluationDefinitionEncoded = Schema.Codec.Encoded<typeof EvaluationDefinitionSchema>;\nconst EvaluationsPayloadStructuralSchema = Schema.Struct({\n experimentId: EvaluationRecordIdentitySchema,\n evaluations: Schema.Array(EvaluationDefinitionSchema),\n});\nexport type EvaluationsPayload = Schema.toType<typeof EvaluationsPayloadStructuralSchema>[\"Type\"];\nexport type EvaluationsPayloadEncoded = Schema.Codec.Encoded<typeof EvaluationsPayloadStructuralSchema>;\nexport type EvaluationsPayloadIssue = {\n readonly code: \"evaluations-eval-order-invalid\";\n readonly index: number;\n readonly evalId: EvaluationId;\n} | {\n readonly code: \"evaluations-eval-duplicate\";\n readonly evalId: EvaluationId;\n} | {\n readonly code: \"evaluations-slot-order-invalid\";\n readonly evalId: EvaluationId;\n readonly index: number;\n readonly slotId: SlotId;\n} | {\n readonly code: \"evaluations-slot-duplicate\";\n readonly slotId: SlotId;\n} | {\n readonly code: \"evaluations-attempt-duplicate\";\n readonly evalId: EvaluationId;\n readonly attempt: EvaluationAttemptOrdinal;\n};\nfunction compareEvaluationSlots(left: EvaluationSlot, right: EvaluationSlot): number {\n return left.attempt === right.attempt\n ? compareCanonicalIdentity(left.slotId, right.slotId)\n : left.attempt < right.attempt ? -1 : 1;\n}\nexport function validateEvaluationsPayload(payload: EvaluationsPayload): readonly EvaluationsPayloadIssue[] {\n const issues: EvaluationsPayloadIssue[] = [];\n const slots = new Set<string>();\n let previousEvalId: EvaluationId | undefined;\n for (const [definitionIndex, definition] of payload.evaluations.entries()) {\n if (previousEvalId !== undefined && compareCanonicalIdentity(previousEvalId, definition.evalId) >= 0) {\n issues.push(Object.freeze(previousEvalId === definition.evalId\n ? { code: \"evaluations-eval-duplicate\" as const, evalId: definition.evalId }\n : { code: \"evaluations-eval-order-invalid\" as const, index: definitionIndex, evalId: definition.evalId }));\n }\n const attempts = new Set<number>();\n let previousSlot: EvaluationSlot | undefined;\n for (const [slotIndex, slot] of definition.slots.entries()) {\n if (previousSlot !== undefined && compareEvaluationSlots(previousSlot, slot) >= 0) {\n issues.push(Object.freeze({ code: \"evaluations-slot-order-invalid\" as const, evalId: definition.evalId, index: slotIndex, slotId: slot.slotId }));\n }\n if (slots.has(slot.slotId)) {\n issues.push(Object.freeze({ code: \"evaluations-slot-duplicate\" as const, slotId: slot.slotId }));\n }\n if (attempts.has(slot.attempt)) {\n issues.push(Object.freeze({ code: \"evaluations-attempt-duplicate\" as const, evalId: definition.evalId, attempt: slot.attempt }));\n }\n slots.add(slot.slotId);\n attempts.add(slot.attempt);\n previousSlot = slot;\n }\n previousEvalId = definition.evalId;\n }\n return Object.freeze(issues);\n}\nexport const EvaluationsPayloadSchema = EvaluationsPayloadStructuralSchema.pipe(Schema.refine((payload): payload is typeof payload => validateEvaluationsPayload(payload).length === 0, {\n identifier: \"EvaluationPlan\",\n description: \"canonical transient Eval definitions and Slot mapping\",\n}));\nexport type EvaluationsPayloadBuildError = {\n readonly code: \"evaluations-payload-schema-invalid\" | \"evaluations-payload-coherence-invalid\";\n readonly issues?: readonly EvaluationsPayloadIssue[];\n};\nexport function decodeEvaluationsPayload(input: unknown): Result.Result<EvaluationsPayload, EvaluationsPayloadBuildError> {\n const decoded = Schema.decodeUnknownResult(EvaluationsPayloadSchema, ExactEvaluationParseOptions)(input);\n return Result.isFailure(decoded)\n ? Result.fail(Object.freeze({ code: \"evaluations-payload-schema-invalid\" as const }))\n : Result.succeed(decoded.success);\n}\nexport function buildEvaluationsPayload(input: EvaluationsPayload): Result.Result<EvaluationsPayload, EvaluationsPayloadBuildError> {\n const decoded = Schema.decodeUnknownResult(EvaluationsPayloadStructuralSchema, ExactEvaluationParseOptions)(input);\n if (Result.isFailure(decoded))\n return Result.fail(Object.freeze({ code: \"evaluations-payload-schema-invalid\" as const }));\n const issues = validateEvaluationsPayload(decoded.success);\n if (issues.length > 0)\n return Result.fail(Object.freeze({ code: \"evaluations-payload-coherence-invalid\" as const, issues }));\n return Result.succeed(decoded.success);\n}\nexport interface EvaluationSlotProjection extends EvaluationSlot {\n readonly evalId: EvaluationId;\n readonly evaluationKind: EvaluationKind;\n}\nexport interface EvaluationsProjection {\n readonly evaluationForSlot: (slotId: SlotId) => EvaluationSlotProjection | undefined;\n}\nexport function projectEvaluationsPayload(payload: EvaluationsPayload): EvaluationsProjection {\n const slots = new Map<string, EvaluationSlotProjection>();\n for (const evaluation of payload.evaluations) {\n for (const slot of evaluation.slots) {\n slots.set(slot.slotId, Object.freeze({ ...slot, evalId: evaluation.evalId, evaluationKind: evaluation.evaluationKind }));\n }\n }\n return Object.freeze({ evaluationForSlot: (slotId: SlotId) => slots.get(slotId) });\n}\nexport interface Evaluation {\n readonly id: EvaluationId;\n readonly kind: EvaluationKind;\n readonly slots: readonly EvaluationSlot[];\n}\nexport interface Evaluations {\n readonly experimentId: ExperimentId;\n readonly evaluations: readonly Evaluation[];\n}\nexport function projectEvaluations(payload: EvaluationsPayload): Evaluations {\n return Object.freeze({\n experimentId: payload.experimentId,\n evaluations: Object.freeze(payload.evaluations.map((evaluation) => Object.freeze({\n id: evaluation.evalId,\n kind: evaluation.evaluationKind,\n slots: Object.freeze([...evaluation.slots]),\n }))),\n });\n}\n"]}
1
+ {"version":3,"file":"evaluation.js","sourceRoot":"","sources":["evaluation.ts"],"names":[],"mappings":";;;A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CAAC;AACvF,CAAC;AAUD,SAAgB,kBAAkB,CAAC,OAA2B;IAC1D,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;YAC7E,EAAE,EAAE,UAAU,CAAC,MAAM;YACrB,IAAI,EAAE,UAAU,CAAC,cAAc;YAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;SAC9C,CAAC,CAAC,CAAC;KACP,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/eval/README.md\n// @concord-implements docs/feature/inspection/README.md\nimport { Result, Schema } from \"effect\";\nimport { SlotIdSchema } from \"../../record/codec/identifiers.ts\";\nimport { compareCanonicalIdentity, type SlotId } from \"../../record/model/identifiers.ts\";\nimport { EVALUATION_KINDS } from \"../../shared/evaluation.ts\";\nimport { EvaluationRecordIdentitySchema, ExactEvaluationParseOptions, } from \"./attachment.ts\";\n/**\n * Eval-to-slot planning is transient. Core carries the immutable Slot identity\n * once a Run is created; no evaluations Attachment exists in Record v1.\n */\nexport const EvaluationKindSchema = Schema.Literals(EVALUATION_KINDS);\nexport type EvaluationKind = Schema.toType<typeof EvaluationKindSchema>[\"Type\"];\nexport type EvaluationId = Schema.toType<typeof EvaluationRecordIdentitySchema>[\"Type\"];\nexport type ExperimentId = Schema.toType<typeof EvaluationRecordIdentitySchema>[\"Type\"];\nexport const EvaluationAttemptOrdinalSchema = Schema.Number.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0));\nexport type EvaluationAttemptOrdinal = Schema.toType<typeof EvaluationAttemptOrdinalSchema>[\"Type\"];\nexport const EvaluationSlotSchema = Schema.Struct({\n slotId: SlotIdSchema,\n attempt: EvaluationAttemptOrdinalSchema,\n});\nexport type EvaluationSlot = Schema.toType<typeof EvaluationSlotSchema>[\"Type\"];\nexport type EvaluationSlotEncoded = Schema.Codec.Encoded<typeof EvaluationSlotSchema>;\nexport const EvaluationDefinitionSchema = Schema.Struct({\n evalId: EvaluationRecordIdentitySchema,\n evaluationKind: EvaluationKindSchema,\n slots: Schema.NonEmptyArray(EvaluationSlotSchema),\n});\nexport type EvaluationDefinition = Schema.toType<typeof EvaluationDefinitionSchema>[\"Type\"];\nexport type EvaluationDefinitionEncoded = Schema.Codec.Encoded<typeof EvaluationDefinitionSchema>;\nconst EvaluationsPayloadStructuralSchema = Schema.Struct({\n experimentId: EvaluationRecordIdentitySchema,\n evaluations: Schema.Array(EvaluationDefinitionSchema),\n});\nexport type EvaluationsPayload = Schema.toType<typeof EvaluationsPayloadStructuralSchema>[\"Type\"];\nexport type EvaluationsPayloadEncoded = Schema.Codec.Encoded<typeof EvaluationsPayloadStructuralSchema>;\nexport type EvaluationsPayloadIssue = {\n readonly code: \"evaluations-eval-order-invalid\";\n readonly index: number;\n readonly evalId: EvaluationId;\n} | {\n readonly code: \"evaluations-eval-duplicate\";\n readonly evalId: EvaluationId;\n} | {\n readonly code: \"evaluations-slot-order-invalid\";\n readonly evalId: EvaluationId;\n readonly index: number;\n readonly slotId: SlotId;\n} | {\n readonly code: \"evaluations-slot-duplicate\";\n readonly slotId: SlotId;\n} | {\n readonly code: \"evaluations-attempt-duplicate\";\n readonly evalId: EvaluationId;\n readonly attempt: EvaluationAttemptOrdinal;\n};\nfunction compareEvaluationSlots(left: EvaluationSlot, right: EvaluationSlot): number {\n return left.attempt === right.attempt\n ? compareCanonicalIdentity(left.slotId, right.slotId)\n : left.attempt < right.attempt ? -1 : 1;\n}\nexport function validateEvaluationsPayload(payload: EvaluationsPayload): readonly EvaluationsPayloadIssue[] {\n const issues: EvaluationsPayloadIssue[] = [];\n const slots = new Set<string>();\n let previousEvalId: EvaluationId | undefined;\n for (const [definitionIndex, definition] of payload.evaluations.entries()) {\n if (previousEvalId !== undefined && compareCanonicalIdentity(previousEvalId, definition.evalId) >= 0) {\n issues.push(Object.freeze(previousEvalId === definition.evalId\n ? { code: \"evaluations-eval-duplicate\" as const, evalId: definition.evalId }\n : { code: \"evaluations-eval-order-invalid\" as const, index: definitionIndex, evalId: definition.evalId }));\n }\n const attempts = new Set<number>();\n let previousSlot: EvaluationSlot | undefined;\n for (const [slotIndex, slot] of definition.slots.entries()) {\n if (previousSlot !== undefined && compareEvaluationSlots(previousSlot, slot) >= 0) {\n issues.push(Object.freeze({ code: \"evaluations-slot-order-invalid\" as const, evalId: definition.evalId, index: slotIndex, slotId: slot.slotId }));\n }\n if (slots.has(slot.slotId)) {\n issues.push(Object.freeze({ code: \"evaluations-slot-duplicate\" as const, slotId: slot.slotId }));\n }\n if (attempts.has(slot.attempt)) {\n issues.push(Object.freeze({ code: \"evaluations-attempt-duplicate\" as const, evalId: definition.evalId, attempt: slot.attempt }));\n }\n slots.add(slot.slotId);\n attempts.add(slot.attempt);\n previousSlot = slot;\n }\n previousEvalId = definition.evalId;\n }\n return Object.freeze(issues);\n}\nexport const EvaluationsPayloadSchema = EvaluationsPayloadStructuralSchema.pipe(Schema.refine((payload): payload is typeof payload => validateEvaluationsPayload(payload).length === 0, {\n identifier: \"EvaluationPlan\",\n description: \"canonical transient Eval definitions and Slot mapping\",\n}));\nexport type EvaluationsPayloadBuildError = {\n readonly code: \"evaluations-payload-schema-invalid\" | \"evaluations-payload-coherence-invalid\";\n readonly issues?: readonly EvaluationsPayloadIssue[];\n};\nexport function decodeEvaluationsPayload(input: unknown): Result.Result<EvaluationsPayload, EvaluationsPayloadBuildError> {\n const decoded = Schema.decodeUnknownResult(EvaluationsPayloadSchema, ExactEvaluationParseOptions)(input);\n return Result.isFailure(decoded)\n ? Result.fail(Object.freeze({ code: \"evaluations-payload-schema-invalid\" as const }))\n : Result.succeed(decoded.success);\n}\nexport function buildEvaluationsPayload(input: EvaluationsPayload): Result.Result<EvaluationsPayload, EvaluationsPayloadBuildError> {\n const decoded = Schema.decodeUnknownResult(EvaluationsPayloadStructuralSchema, ExactEvaluationParseOptions)(input);\n if (Result.isFailure(decoded))\n return Result.fail(Object.freeze({ code: \"evaluations-payload-schema-invalid\" as const }));\n const issues = validateEvaluationsPayload(decoded.success);\n if (issues.length > 0)\n return Result.fail(Object.freeze({ code: \"evaluations-payload-coherence-invalid\" as const, issues }));\n return Result.succeed(decoded.success);\n}\nexport interface EvaluationSlotProjection extends EvaluationSlot {\n readonly evalId: EvaluationId;\n readonly evaluationKind: EvaluationKind;\n}\nexport interface EvaluationsProjection {\n readonly evaluationForSlot: (slotId: SlotId) => EvaluationSlotProjection | undefined;\n}\nexport function projectEvaluationsPayload(payload: EvaluationsPayload): EvaluationsProjection {\n const slots = new Map<string, EvaluationSlotProjection>();\n for (const evaluation of payload.evaluations) {\n for (const slot of evaluation.slots) {\n slots.set(slot.slotId, Object.freeze({ ...slot, evalId: evaluation.evalId, evaluationKind: evaluation.evaluationKind }));\n }\n }\n return Object.freeze({ evaluationForSlot: (slotId: SlotId) => slots.get(slotId) });\n}\nexport interface Evaluation {\n readonly id: EvaluationId;\n readonly kind: EvaluationKind;\n readonly slots: readonly EvaluationSlot[];\n}\nexport interface Evaluations {\n readonly experimentId: ExperimentId;\n readonly evaluations: readonly Evaluation[];\n}\nexport function projectEvaluations(payload: EvaluationsPayload): Evaluations {\n return Object.freeze({\n experimentId: payload.experimentId,\n evaluations: Object.freeze(payload.evaluations.map((evaluation) => Object.freeze({\n id: evaluation.evalId,\n kind: evaluation.evaluationKind,\n slots: Object.freeze([...evaluation.slots]),\n }))),\n });\n}\n"]}
@@ -213,8 +213,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
213
213
  readonly attemptId: import("../../record/model/identifiers.cjs").AttemptId;
214
214
  readonly gap: {
215
215
  readonly reason: string;
216
- readonly scope: "experiment" | "target" | "slot";
217
216
  readonly issues: readonly RecordIssue[];
217
+ readonly scope: "experiment" | "target" | "slot";
218
218
  readonly sourceBarrier?: {
219
219
  readonly runId: import("../../record/model/identifiers.cjs").RunId;
220
220
  readonly startedAt: import("../../record/model/identifiers.cjs").UtcMillis;
@@ -232,8 +232,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
232
232
  readonly slotId: SlotId;
233
233
  readonly gap: {
234
234
  readonly reason: string;
235
- readonly scope: "experiment" | "target" | "slot";
236
235
  readonly issues: readonly RecordIssue[];
236
+ readonly scope: "experiment" | "target" | "slot";
237
237
  readonly sourceBarrier?: {
238
238
  readonly runId: import("../../record/model/identifiers.cjs").RunId;
239
239
  readonly startedAt: import("../../record/model/identifiers.cjs").UtcMillis;
@@ -251,8 +251,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
251
251
  readonly slotId: SlotId;
252
252
  readonly gap: {
253
253
  readonly reason: string;
254
- readonly scope: "experiment" | "target" | "slot";
255
254
  readonly issues: readonly RecordIssue[];
255
+ readonly scope: "experiment" | "target" | "slot";
256
256
  readonly sourceBarrier?: {
257
257
  readonly runId: import("../../record/model/identifiers.cjs").RunId;
258
258
  readonly startedAt: import("../../record/model/identifiers.cjs").UtcMillis;
@@ -213,8 +213,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
213
213
  readonly attemptId: import("../../record/model/identifiers.mjs").AttemptId;
214
214
  readonly gap: {
215
215
  readonly reason: string;
216
- readonly scope: "experiment" | "target" | "slot";
217
216
  readonly issues: readonly RecordIssue[];
217
+ readonly scope: "experiment" | "target" | "slot";
218
218
  readonly sourceBarrier?: {
219
219
  readonly runId: import("../../record/model/identifiers.mjs").RunId;
220
220
  readonly startedAt: import("../../record/model/identifiers.mjs").UtcMillis;
@@ -232,8 +232,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
232
232
  readonly slotId: SlotId;
233
233
  readonly gap: {
234
234
  readonly reason: string;
235
- readonly scope: "experiment" | "target" | "slot";
236
235
  readonly issues: readonly RecordIssue[];
236
+ readonly scope: "experiment" | "target" | "slot";
237
237
  readonly sourceBarrier?: {
238
238
  readonly runId: import("../../record/model/identifiers.mjs").RunId;
239
239
  readonly startedAt: import("../../record/model/identifiers.mjs").UtcMillis;
@@ -251,8 +251,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
251
251
  readonly slotId: SlotId;
252
252
  readonly gap: {
253
253
  readonly reason: string;
254
- readonly scope: "experiment" | "target" | "slot";
255
254
  readonly issues: readonly RecordIssue[];
255
+ readonly scope: "experiment" | "target" | "slot";
256
256
  readonly sourceBarrier?: {
257
257
  readonly runId: import("../../record/model/identifiers.mjs").RunId;
258
258
  readonly startedAt: import("../../record/model/identifiers.mjs").UtcMillis;
@@ -213,8 +213,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
213
213
  readonly attemptId: import("../../record/model/identifiers.js").AttemptId;
214
214
  readonly gap: {
215
215
  readonly reason: string;
216
- readonly scope: "experiment" | "target" | "slot";
217
216
  readonly issues: readonly RecordIssue[];
217
+ readonly scope: "experiment" | "target" | "slot";
218
218
  readonly sourceBarrier?: {
219
219
  readonly runId: import("../../record/model/identifiers.js").RunId;
220
220
  readonly startedAt: import("../../record/model/identifiers.js").UtcMillis;
@@ -232,8 +232,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
232
232
  readonly slotId: SlotId;
233
233
  readonly gap: {
234
234
  readonly reason: string;
235
- readonly scope: "experiment" | "target" | "slot";
236
235
  readonly issues: readonly RecordIssue[];
236
+ readonly scope: "experiment" | "target" | "slot";
237
237
  readonly sourceBarrier?: {
238
238
  readonly runId: import("../../record/model/identifiers.js").RunId;
239
239
  readonly startedAt: import("../../record/model/identifiers.js").UtcMillis;
@@ -251,8 +251,8 @@ export declare const MembershipProvenancePayloadSchema: Schema.refine<{
251
251
  readonly slotId: SlotId;
252
252
  readonly gap: {
253
253
  readonly reason: string;
254
- readonly scope: "experiment" | "target" | "slot";
255
254
  readonly issues: readonly RecordIssue[];
255
+ readonly scope: "experiment" | "target" | "slot";
256
256
  readonly sourceBarrier?: {
257
257
  readonly runId: import("../../record/model/identifiers.js").RunId;
258
258
  readonly startedAt: import("../../record/model/identifiers.js").UtcMillis;
@@ -6,7 +6,7 @@ exports.buildScorePayload = buildScorePayload;
6
6
  exports.foldRecordedAttemptScore = foldRecordedAttemptScore;
7
7
  exports.validateScoreCoherence = validateScoreCoherence;
8
8
  exports.projectScorePayload = projectScorePayload;
9
- // @concord-file ne-eval-record-score
9
+ // @concord-file
10
10
  // @concord-implements docs/feature/assertions/library/score-points.md
11
11
  // @concord-implements docs/feature/verdict/README.md
12
12
  // @concord-implements docs/feature/eval/use-case/rubric-points.md
@@ -118,7 +118,7 @@ function buildScorePayload(input) {
118
118
  : effect_1.Result.succeed(Object.freeze({ state: "unavailable", reasons: nonEmptyReasons }));
119
119
  }
120
120
  /** Folds Score from the same immutable Record/Core facts as Verdict. */
121
- // @concord-code ne-eval-fold-score
121
+ // @concord-code
122
122
  // @concord-implements docs/feature/assertions/library/score-points.md
123
123
  // @concord-implements docs/feature/eval/use-case/rubric-points.md
124
124
  function foldRecordedAttemptScore(input) {
@@ -1 +1 @@
1
- {"version":3,"file":"score.js","sourceRoot":"","sources":["score.ts"],"names":[],"mappings":";;;AA4DA,oDAgBC;AAsBD,8CAmCC;AAKD,4DAKC;AAmBD,wDAWC;AAsBD,kDAMC;AAzMD,qCAAqC;AACrC,sEAAsE;AACtE,qDAAqD;AACrD,kEAAkE;AAClE,mCAAwC;AACxC,mDAA4H;AAC5H,+DAAyH;AAGzH,+EAA+E;AAClE,QAAA,gBAAgB,GAAG,eAAM,CAAC,QAAQ,CAAC;IAC5C,UAAU;IACV,SAAS;IACT,aAAa;CAChB,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,eAAM,CAAC,QAAQ,CAAC;IACvD,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,gBAAgB;CACnB,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,eAAM,CAAC,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,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,wBAAiC,EAAE,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;AAgBD,SAAS,sBAAsB,CAAC,OAAyC;IACrE,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC;IACjC,IAAI,KAAK,KAAK,SAAS;QACnB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AAC3C,CAAC;AACD,SAAgB,mBAAmB,CAAC,OAAqB;IACrD,QAAQ,OAAO,CAAC,KAAK,EAAE,CAAC;QACpB,KAAK,UAAU,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,UAAmB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,IAAa,EAAE,CAAC,CAAC;QACzH,KAAK,SAAS,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,SAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,KAAc,EAAE,CAAC,CAAC;QAC1K,KAAK,aAAa,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,aAAsB,EAAE,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,KAAc,EAAE,CAAC,CAAC;IAC9J,CAAC;AACL,CAAC","sourcesContent":["// @concord-file ne-eval-record-score\n// @concord-implements docs/feature/assertions/library/score-points.md\n// @concord-implements docs/feature/verdict/README.md\n// @concord-implements docs/feature/eval/use-case/rubric-points.md\nimport { Result, Schema } from \"effect\";\nimport { ExactEvaluationParseOptions, FiniteNonNegativeNumberSchema, type FiniteNonNegativeNumber, } from \"./attachment.ts\";\nimport { EvaluationAttemptFactsSchema, recordedAttemptFacts, type EvaluationAttemptFacts, } from \"./sealed-assertion.ts\";\nimport type { AssertionsAttachment } from \"../../record/family/assertions/definition.ts\";\nimport type { AttemptOutcome } from \"../../record/model/core.ts\";\n/** Score is an Analysis calculation, not an independently persisted family. */\nexport const ScoreStateSchema = Schema.Literals([\n \"complete\",\n \"partial\",\n \"unavailable\",\n]);\nexport type ScoreState = Schema.toType<typeof ScoreStateSchema>[\"Type\"];\nexport const ScoreIncompleteReasonSchema = Schema.Literals([\n \"execution-errored\",\n \"source-unavailable\",\n \"evaluation-errored\",\n \"not-applicable\",\n]);\nexport type ScoreIncompleteReason = Schema.toType<typeof ScoreIncompleteReasonSchema>[\"Type\"];\nexport const ScoreIncompleteReasonsSchema = Schema.NonEmptyArray(ScoreIncompleteReasonSchema);\nexport type ScoreIncompleteReasons = Schema.toType<typeof ScoreIncompleteReasonsSchema>[\"Type\"];\nexport const EarnedScoreSchema = FiniteNonNegativeNumberSchema;\nexport type EarnedScore = FiniteNonNegativeNumber;\nconst ScorePayloadStructuralSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"complete\"), earned: EarnedScoreSchema }),\n Schema.Struct({\n state: Schema.Literal(\"partial\"),\n earned: EarnedScoreSchema,\n reasons: ScoreIncompleteReasonsSchema,\n }),\n Schema.Struct({\n state: Schema.Literal(\"unavailable\"),\n reasons: ScoreIncompleteReasonsSchema,\n }),\n]);\nexport type ScorePayload = Schema.toType<typeof ScorePayloadStructuralSchema>[\"Type\"];\nexport type ScorePayloadEncoded = Schema.Codec.Encoded<typeof ScorePayloadStructuralSchema>;\nexport type ScorePayloadIssue = {\n readonly code: \"score-incomplete-reason-duplicate\";\n readonly reason: ScoreIncompleteReason;\n} | {\n readonly code: \"score-incomplete-reason-order-invalid\";\n readonly index: number;\n readonly reason: ScoreIncompleteReason;\n};\nfunction scoreIncompleteReasonRank(reason: ScoreIncompleteReason): number {\n switch (reason) {\n case \"execution-errored\": return 0;\n case \"source-unavailable\": return 1;\n case \"evaluation-errored\": return 2;\n case \"not-applicable\": return 3;\n }\n}\nfunction incompleteReasonsOf(payload: ScorePayload): readonly ScoreIncompleteReason[] {\n return payload.state === \"complete\" ? [] : payload.reasons;\n}\nexport function validateScorePayload(payload: ScorePayload): readonly ScorePayloadIssue[] {\n const issues: ScorePayloadIssue[] = [];\n const seen = new Set<ScoreIncompleteReason>();\n let previousRank: number | undefined;\n for (const [index, reason] of incompleteReasonsOf(payload).entries()) {\n const rank = scoreIncompleteReasonRank(reason);\n if (seen.has(reason)) {\n issues.push(Object.freeze({ code: \"score-incomplete-reason-duplicate\" as const, reason }));\n }\n else if (previousRank !== undefined && previousRank >= rank) {\n issues.push(Object.freeze({ code: \"score-incomplete-reason-order-invalid\" as const, index, reason }));\n }\n seen.add(reason);\n previousRank = rank;\n }\n return Object.freeze(issues);\n}\nexport const ScorePayloadSchema = ScorePayloadStructuralSchema.pipe(Schema.refine((payload): payload is typeof payload => validateScorePayload(payload).length === 0, {\n identifier: \"ScoreCalculation\",\n description: \"a canonical transient score calculation\",\n}));\nexport type ScoreFoldInput = EvaluationAttemptFacts;\nexport const ScoreFoldInputSchema = EvaluationAttemptFactsSchema;\nexport type ScoreBuildInput = ScoreFoldInput;\nexport const ScoreBuildInputSchema = ScoreFoldInputSchema;\nexport type ScorePayloadBuildError = {\n readonly code: \"score-fold-input-invalid\";\n} | {\n readonly code: \"score-earned-overflow\";\n};\nfunction canonicalIncompleteReasons(reasons: readonly ScoreIncompleteReason[]): readonly ScoreIncompleteReason[] {\n return Object.freeze([...new Set(reasons)].sort((left, right) => scoreIncompleteReasonRank(left) - scoreIncompleteReasonRank(right)));\n}\nfunction asNonEmptyReasons(reasons: readonly ScoreIncompleteReason[]): ScoreIncompleteReasons | undefined {\n const [first, ...rest] = reasons;\n return first === undefined ? undefined : Object.freeze([first, ...rest]);\n}\n/** Folds sealed Assertion facts without producing a durable Record write. */\nexport function buildScorePayload(input: ScoreFoldInput): Result.Result<ScorePayload, ScorePayloadBuildError> {\n const decoded = Schema.decodeUnknownResult(Schema.toType(ScoreFoldInputSchema), ExactEvaluationParseOptions)(input);\n if (Result.isFailure(decoded)) {\n return Result.fail(Object.freeze({ code: \"score-fold-input-invalid\" as const }));\n }\n let earned = 0;\n let hasAuditableContribution = false;\n const incompleteReasons: ScoreIncompleteReason[] = [];\n for (const assertion of decoded.success.assertions) {\n switch (assertion.result.score.state) {\n case \"not-scored\": break;\n case \"earned\":\n hasAuditableContribution = true;\n earned += assertion.result.score.earned;\n if (!Number.isFinite(earned)) {\n return Result.fail(Object.freeze({ code: \"score-earned-overflow\" as const }));\n }\n break;\n case \"unavailable\":\n if (assertion.required)\n incompleteReasons.push(assertion.result.score.reason);\n break;\n }\n }\n if (decoded.success.execution === \"errored\")\n incompleteReasons.push(\"execution-errored\");\n const reasons = canonicalIncompleteReasons(incompleteReasons);\n if (reasons.length === 0)\n return Result.succeed(Object.freeze({ state: \"complete\" as const, earned }));\n const nonEmptyReasons = asNonEmptyReasons(reasons);\n if (nonEmptyReasons === undefined)\n throw new Error(\"Non-empty score reasons became empty\");\n return hasAuditableContribution\n ? Result.succeed(Object.freeze({ state: \"partial\" as const, earned, reasons: nonEmptyReasons }))\n : Result.succeed(Object.freeze({ state: \"unavailable\" as const, reasons: nonEmptyReasons }));\n}\n/** Folds Score from the same immutable Record/Core facts as Verdict. */\n// @concord-code ne-eval-fold-score\n// @concord-implements docs/feature/assertions/library/score-points.md\n// @concord-implements docs/feature/eval/use-case/rubric-points.md\nexport function foldRecordedAttemptScore(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): Result.Result<ScorePayload, ScorePayloadBuildError> {\n return buildScorePayload(recordedAttemptFacts(input));\n}\nexport type ScoreCoherenceIssue = {\n readonly code: \"score-fold-input-invalid\";\n readonly reason: ScorePayloadBuildError[\"code\"];\n} | {\n readonly code: \"score-payload-mismatch\";\n};\nfunction sameReasons(left: readonly ScoreIncompleteReason[], right: readonly ScoreIncompleteReason[]): boolean {\n return left.length === right.length && left.every((reason, index) => reason === right[index]);\n}\nfunction sameScorePayload(left: ScorePayload, right: ScorePayload): boolean {\n if (left.state !== right.state)\n return false;\n if (left.state === \"complete\")\n return right.state === \"complete\" && left.earned === right.earned;\n if (left.state === \"partial\")\n return right.state === \"partial\" && left.earned === right.earned && sameReasons(left.reasons, right.reasons);\n return right.state === \"unavailable\" && sameReasons(left.reasons, right.reasons);\n}\nexport function validateScoreCoherence(input: {\n readonly payload: ScorePayload;\n readonly fold: ScoreFoldInput;\n}): readonly ScoreCoherenceIssue[] {\n const expected = buildScorePayload(input.fold);\n if (Result.isFailure(expected)) {\n return Object.freeze([Object.freeze({ code: \"score-fold-input-invalid\" as const, reason: expected.failure.code })]);\n }\n return sameScorePayload(input.payload, expected.success)\n ? Object.freeze([])\n : Object.freeze([Object.freeze({ code: \"score-payload-mismatch\" as const })]);\n}\nexport type Score = {\n readonly state: \"complete\";\n readonly earned: number;\n readonly comparable: true;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: ScoreIncompleteReasons;\n readonly comparable: false;\n} | {\n readonly state: \"unavailable\";\n readonly reasons: ScoreIncompleteReasons;\n readonly comparable: false;\n};\nexport type ScoreProjection = Score;\nfunction scoreIncompleteReasons(reasons: readonly ScoreIncompleteReason[]): ScoreIncompleteReasons {\n const [first, ...rest] = reasons;\n if (first === undefined)\n throw new Error(\"An incomplete score needs a reason\");\n return Object.freeze([first, ...rest]);\n}\nexport function projectScorePayload(payload: ScorePayload): Score {\n switch (payload.state) {\n case \"complete\": return Object.freeze({ state: \"complete\" as const, earned: payload.earned, comparable: true as const });\n case \"partial\": return Object.freeze({ state: \"partial\" as const, earned: payload.earned, reasons: scoreIncompleteReasons(payload.reasons), comparable: false as const });\n case \"unavailable\": return Object.freeze({ state: \"unavailable\" as const, reasons: scoreIncompleteReasons(payload.reasons), comparable: false as const });\n }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,SAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,KAAc,EAAE,CAAC,CAAC;QAC1K,KAAK,aAAa,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,aAAsB,EAAE,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,KAAc,EAAE,CAAC,CAAC;IAC9J,CAAC;AACL,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/assertions/library/score-points.md\n// @concord-implements docs/feature/verdict/README.md\n// @concord-implements docs/feature/eval/use-case/rubric-points.md\nimport { Result, Schema } from \"effect\";\nimport { ExactEvaluationParseOptions, FiniteNonNegativeNumberSchema, type FiniteNonNegativeNumber, } from \"./attachment.ts\";\nimport { EvaluationAttemptFactsSchema, recordedAttemptFacts, type EvaluationAttemptFacts, } from \"./sealed-assertion.ts\";\nimport type { AssertionsAttachment } from \"../../record/family/assertions/definition.ts\";\nimport type { AttemptOutcome } from \"../../record/model/core.ts\";\n/** Score is an Analysis calculation, not an independently persisted family. */\nexport const ScoreStateSchema = Schema.Literals([\n \"complete\",\n \"partial\",\n \"unavailable\",\n]);\nexport type ScoreState = Schema.toType<typeof ScoreStateSchema>[\"Type\"];\nexport const ScoreIncompleteReasonSchema = Schema.Literals([\n \"execution-errored\",\n \"source-unavailable\",\n \"evaluation-errored\",\n \"not-applicable\",\n]);\nexport type ScoreIncompleteReason = Schema.toType<typeof ScoreIncompleteReasonSchema>[\"Type\"];\nexport const ScoreIncompleteReasonsSchema = Schema.NonEmptyArray(ScoreIncompleteReasonSchema);\nexport type ScoreIncompleteReasons = Schema.toType<typeof ScoreIncompleteReasonsSchema>[\"Type\"];\nexport const EarnedScoreSchema = FiniteNonNegativeNumberSchema;\nexport type EarnedScore = FiniteNonNegativeNumber;\nconst ScorePayloadStructuralSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"complete\"), earned: EarnedScoreSchema }),\n Schema.Struct({\n state: Schema.Literal(\"partial\"),\n earned: EarnedScoreSchema,\n reasons: ScoreIncompleteReasonsSchema,\n }),\n Schema.Struct({\n state: Schema.Literal(\"unavailable\"),\n reasons: ScoreIncompleteReasonsSchema,\n }),\n]);\nexport type ScorePayload = Schema.toType<typeof ScorePayloadStructuralSchema>[\"Type\"];\nexport type ScorePayloadEncoded = Schema.Codec.Encoded<typeof ScorePayloadStructuralSchema>;\nexport type ScorePayloadIssue = {\n readonly code: \"score-incomplete-reason-duplicate\";\n readonly reason: ScoreIncompleteReason;\n} | {\n readonly code: \"score-incomplete-reason-order-invalid\";\n readonly index: number;\n readonly reason: ScoreIncompleteReason;\n};\nfunction scoreIncompleteReasonRank(reason: ScoreIncompleteReason): number {\n switch (reason) {\n case \"execution-errored\": return 0;\n case \"source-unavailable\": return 1;\n case \"evaluation-errored\": return 2;\n case \"not-applicable\": return 3;\n }\n}\nfunction incompleteReasonsOf(payload: ScorePayload): readonly ScoreIncompleteReason[] {\n return payload.state === \"complete\" ? [] : payload.reasons;\n}\nexport function validateScorePayload(payload: ScorePayload): readonly ScorePayloadIssue[] {\n const issues: ScorePayloadIssue[] = [];\n const seen = new Set<ScoreIncompleteReason>();\n let previousRank: number | undefined;\n for (const [index, reason] of incompleteReasonsOf(payload).entries()) {\n const rank = scoreIncompleteReasonRank(reason);\n if (seen.has(reason)) {\n issues.push(Object.freeze({ code: \"score-incomplete-reason-duplicate\" as const, reason }));\n }\n else if (previousRank !== undefined && previousRank >= rank) {\n issues.push(Object.freeze({ code: \"score-incomplete-reason-order-invalid\" as const, index, reason }));\n }\n seen.add(reason);\n previousRank = rank;\n }\n return Object.freeze(issues);\n}\nexport const ScorePayloadSchema = ScorePayloadStructuralSchema.pipe(Schema.refine((payload): payload is typeof payload => validateScorePayload(payload).length === 0, {\n identifier: \"ScoreCalculation\",\n description: \"a canonical transient score calculation\",\n}));\nexport type ScoreFoldInput = EvaluationAttemptFacts;\nexport const ScoreFoldInputSchema = EvaluationAttemptFactsSchema;\nexport type ScoreBuildInput = ScoreFoldInput;\nexport const ScoreBuildInputSchema = ScoreFoldInputSchema;\nexport type ScorePayloadBuildError = {\n readonly code: \"score-fold-input-invalid\";\n} | {\n readonly code: \"score-earned-overflow\";\n};\nfunction canonicalIncompleteReasons(reasons: readonly ScoreIncompleteReason[]): readonly ScoreIncompleteReason[] {\n return Object.freeze([...new Set(reasons)].sort((left, right) => scoreIncompleteReasonRank(left) - scoreIncompleteReasonRank(right)));\n}\nfunction asNonEmptyReasons(reasons: readonly ScoreIncompleteReason[]): ScoreIncompleteReasons | undefined {\n const [first, ...rest] = reasons;\n return first === undefined ? undefined : Object.freeze([first, ...rest]);\n}\n/** Folds sealed Assertion facts without producing a durable Record write. */\nexport function buildScorePayload(input: ScoreFoldInput): Result.Result<ScorePayload, ScorePayloadBuildError> {\n const decoded = Schema.decodeUnknownResult(Schema.toType(ScoreFoldInputSchema), ExactEvaluationParseOptions)(input);\n if (Result.isFailure(decoded)) {\n return Result.fail(Object.freeze({ code: \"score-fold-input-invalid\" as const }));\n }\n let earned = 0;\n let hasAuditableContribution = false;\n const incompleteReasons: ScoreIncompleteReason[] = [];\n for (const assertion of decoded.success.assertions) {\n switch (assertion.result.score.state) {\n case \"not-scored\": break;\n case \"earned\":\n hasAuditableContribution = true;\n earned += assertion.result.score.earned;\n if (!Number.isFinite(earned)) {\n return Result.fail(Object.freeze({ code: \"score-earned-overflow\" as const }));\n }\n break;\n case \"unavailable\":\n if (assertion.required)\n incompleteReasons.push(assertion.result.score.reason);\n break;\n }\n }\n if (decoded.success.execution === \"errored\")\n incompleteReasons.push(\"execution-errored\");\n const reasons = canonicalIncompleteReasons(incompleteReasons);\n if (reasons.length === 0)\n return Result.succeed(Object.freeze({ state: \"complete\" as const, earned }));\n const nonEmptyReasons = asNonEmptyReasons(reasons);\n if (nonEmptyReasons === undefined)\n throw new Error(\"Non-empty score reasons became empty\");\n return hasAuditableContribution\n ? Result.succeed(Object.freeze({ state: \"partial\" as const, earned, reasons: nonEmptyReasons }))\n : Result.succeed(Object.freeze({ state: \"unavailable\" as const, reasons: nonEmptyReasons }));\n}\n/** Folds Score from the same immutable Record/Core facts as Verdict. */\n// @concord-code\n// @concord-implements docs/feature/assertions/library/score-points.md\n// @concord-implements docs/feature/eval/use-case/rubric-points.md\nexport function foldRecordedAttemptScore(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): Result.Result<ScorePayload, ScorePayloadBuildError> {\n return buildScorePayload(recordedAttemptFacts(input));\n}\nexport type ScoreCoherenceIssue = {\n readonly code: \"score-fold-input-invalid\";\n readonly reason: ScorePayloadBuildError[\"code\"];\n} | {\n readonly code: \"score-payload-mismatch\";\n};\nfunction sameReasons(left: readonly ScoreIncompleteReason[], right: readonly ScoreIncompleteReason[]): boolean {\n return left.length === right.length && left.every((reason, index) => reason === right[index]);\n}\nfunction sameScorePayload(left: ScorePayload, right: ScorePayload): boolean {\n if (left.state !== right.state)\n return false;\n if (left.state === \"complete\")\n return right.state === \"complete\" && left.earned === right.earned;\n if (left.state === \"partial\")\n return right.state === \"partial\" && left.earned === right.earned && sameReasons(left.reasons, right.reasons);\n return right.state === \"unavailable\" && sameReasons(left.reasons, right.reasons);\n}\nexport function validateScoreCoherence(input: {\n readonly payload: ScorePayload;\n readonly fold: ScoreFoldInput;\n}): readonly ScoreCoherenceIssue[] {\n const expected = buildScorePayload(input.fold);\n if (Result.isFailure(expected)) {\n return Object.freeze([Object.freeze({ code: \"score-fold-input-invalid\" as const, reason: expected.failure.code })]);\n }\n return sameScorePayload(input.payload, expected.success)\n ? Object.freeze([])\n : Object.freeze([Object.freeze({ code: \"score-payload-mismatch\" as const })]);\n}\nexport type Score = {\n readonly state: \"complete\";\n readonly earned: number;\n readonly comparable: true;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: ScoreIncompleteReasons;\n readonly comparable: false;\n} | {\n readonly state: \"unavailable\";\n readonly reasons: ScoreIncompleteReasons;\n readonly comparable: false;\n};\nexport type ScoreProjection = Score;\nfunction scoreIncompleteReasons(reasons: readonly ScoreIncompleteReason[]): ScoreIncompleteReasons {\n const [first, ...rest] = reasons;\n if (first === undefined)\n throw new Error(\"An incomplete score needs a reason\");\n return Object.freeze([first, ...rest]);\n}\nexport function projectScorePayload(payload: ScorePayload): Score {\n switch (payload.state) {\n case \"complete\": return Object.freeze({ state: \"complete\" as const, earned: payload.earned, comparable: true as const });\n case \"partial\": return Object.freeze({ state: \"partial\" as const, earned: payload.earned, reasons: scoreIncompleteReasons(payload.reasons), comparable: false as const });\n case \"unavailable\": return Object.freeze({ state: \"unavailable\" as const, reasons: scoreIncompleteReasons(payload.reasons), comparable: false as const });\n }\n}\n"]}
@@ -4,7 +4,7 @@ exports.EvaluationAttemptFactsSchema = exports.SealedAssertionForEvaluationSchem
4
4
  exports.recordedAttemptFacts = recordedAttemptFacts;
5
5
  exports.isRequiredAssertionUnavailableOrErrored = isRequiredAssertionUnavailableOrErrored;
6
6
  exports.isGateFailed = isGateFailed;
7
- // @concord-file ne-eval-sealed-assertion-facts
7
+ // @concord-file
8
8
  // @concord-implements docs/feature/assertions/README.md
9
9
  // @concord-implements docs/feature/verdict/README.md
10
10
  const effect_1 = require("effect");
@@ -1 +1 @@
1
- {"version":3,"file":"sealed-assertion.js","sourceRoot":"","sources":["sealed-assertion.ts"],"names":[],"mappings":";;;AAkCA,oDAcC;AACD,0FAGC;AACD,oCAEC;AAvDD,+CAA+C;AAC/C,wDAAwD;AACxD,qDAAqD;AACrD,mCAAgC;AAChC,+DAAwH;AAUtE,4GAVV,sCAAqC,OAUA;AAR7E,+DAAyE;AAUzE;;;;GAIG;AACU,QAAA,kCAAkC,GAAG,eAAM,CAAC,MAAM,CAAC;IAC5D,QAAQ,EAAE,eAAM,CAAC,OAAO;IACxB,MAAM,EAAE,sCAAqC;CAChD,CAAC,CA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ne-eval-sealed-assertion-facts\n// @concord-implements docs/feature/assertions/README.md\n// @concord-implements docs/feature/verdict/README.md\nimport { Schema } from \"effect\";\nimport { SealedAssertionResultSchema as AssertionsSealedAssertionResultSchema } from \"../../assertions/record/codec.ts\";\nimport type { EarnedScoreContribution, GateDisposition, NoScoreContribution, ScoreContribution, SealedAssertionResult, UnavailableScoreContribution, } from \"../../assertions/record/model.ts\";\nimport { sealedAssertionResult } from \"../../assertions/record/model.ts\";\nimport type { AssertionsAttachment } from \"../../record/family/assertions/definition.ts\";\nimport type { AttemptOutcome } from \"../../record/model/core.ts\";\n/**\n * Eval folds consume the Assertions owner's sealed-result contract directly.\n * They deliberately do not re-own the Assertions Attachment or its blob\n * closure; `required` below is Eval producer policy only.\n */\nexport { AssertionsSealedAssertionResultSchema as SealedAssertionResultSchema, };\nexport type { EarnedScoreContribution, GateDisposition, NoScoreContribution, ScoreContribution, SealedAssertionResult, UnavailableScoreContribution, };\n/**\n * `required` is producer policy, not a field added to the Assertions\n * Attachment. It determines whether an otherwise-local unavailable result\n * raises the Attempt Verdict to errored.\n */\nexport const SealedAssertionForEvaluationSchema = Schema.Struct({\n required: Schema.Boolean,\n result: AssertionsSealedAssertionResultSchema,\n});\nexport type SealedAssertionForEvaluation = Schema.toType<typeof SealedAssertionForEvaluationSchema>[\"Type\"];\n/** All producer facts shared by the independent Verdict and Score folds. */\nexport const EvaluationAttemptFactsSchema = Schema.Struct({\n execution: Schema.Literals([\"completed\", \"errored\"]),\n explicitlySkipped: Schema.Boolean,\n assertions: Schema.Array(SealedAssertionForEvaluationSchema),\n});\nexport type EvaluationAttemptFacts = Schema.toType<typeof EvaluationAttemptFactsSchema>[\"Type\"];\n/** The sole Record/Core adapter shared by the canonical Verdict and Score folds. */\nexport function recordedAttemptFacts(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): EvaluationAttemptFacts {\n return Object.freeze({\n execution: input.outcome === \"errored\" || input.outcome === \"interrupted\"\n ? \"errored\" as const\n : \"completed\" as const,\n explicitlySkipped: input.outcome === \"cancelled\",\n assertions: Object.freeze(input.assertions.entries.map((entry) => Object.freeze({\n required: entry.policy.requirement.state === \"available\" && entry.policy.requirement.value === \"required\",\n result: sealedAssertionResult(entry),\n }))),\n });\n}\nexport function isRequiredAssertionUnavailableOrErrored(assertion: SealedAssertionForEvaluation): boolean {\n return assertion.required && (assertion.result.state === \"unavailable\"\n || assertion.result.state === \"errored\");\n}\nexport function isGateFailed(assertion: SealedAssertionForEvaluation): boolean {\n return assertion.result.gate === \"failed\";\n}\n"]}
1
+ {"version":3,"file":"sealed-assertion.js","sourceRoot":"","sources":["sealed-assertion.ts"],"names":[],"mappings":";;;AAkCA,oDAcC;AACD,0FAGC;AACD,oCAEC;AAvDD,gBAAgB;AAChB,wDAAwD;AACxD,qDAAqD;AACrD,mCAAgC;AAChC,+DAAwH;AAUtE,4GAVV,sCAAqC,OAUA;AAR7E,+DAAyE;AAUzE;;;;GAIG;AACU,QAAA,kCAAkC,GAAG,eAAM,CAAC,MAAM,CAAC;IAC5D,QAAQ,EAAE,eAAM,CAAC,OAAO;IACxB,MAAM,EAAE,sCAAqC;CAChD,CAAC,CAAC;AAEH,4EAA4E;AAC/D,QAAA,4BAA4B,GAAG,eAAM,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,eAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACpD,iBAAiB,EAAE,eAAM,CAAC,OAAO;IACjC,UAAU,EAAE,eAAM,CAAC,KAAK,CAAC,0CAAkC,CAAC;CAC/D,CAAC,CAAC;AAEH,oFAAoF;AACpF,SAAgB,oBAAoB,CAAC,KAGpC;IACG,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,SAAS,EAAE,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,aAAa;YACrE,CAAC,CAAC,SAAkB;YACpB,CAAC,CAAC,WAAoB;QAC1B,iBAAiB,EAAE,KAAK,CAAC,OAAO,KAAK,WAAW;QAChD,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;YAC5E,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK,UAAU;YACzG,MAAM,EAAE,IAAA,gCAAqB,EAAC,KAAK,CAAC;SACvC,CAAC,CAAC,CAAC;KACP,CAAC,CAAC;AACP,CAAC;AACD,SAAgB,uCAAuC,CAAC,SAAuC;IAC3F,OAAO,SAAS,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,KAAK,aAAa;WAC/D,SAAS,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACjD,CAAC;AACD,SAAgB,YAAY,CAAC,SAAuC;IAChE,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC9C,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/assertions/README.md\n// @concord-implements docs/feature/verdict/README.md\nimport { Schema } from \"effect\";\nimport { SealedAssertionResultSchema as AssertionsSealedAssertionResultSchema } from \"../../assertions/record/codec.ts\";\nimport type { EarnedScoreContribution, GateDisposition, NoScoreContribution, ScoreContribution, SealedAssertionResult, UnavailableScoreContribution, } from \"../../assertions/record/model.ts\";\nimport { sealedAssertionResult } from \"../../assertions/record/model.ts\";\nimport type { AssertionsAttachment } from \"../../record/family/assertions/definition.ts\";\nimport type { AttemptOutcome } from \"../../record/model/core.ts\";\n/**\n * Eval folds consume the Assertions owner's sealed-result contract directly.\n * They deliberately do not re-own the Assertions Attachment or its blob\n * closure; `required` below is Eval producer policy only.\n */\nexport { AssertionsSealedAssertionResultSchema as SealedAssertionResultSchema, };\nexport type { EarnedScoreContribution, GateDisposition, NoScoreContribution, ScoreContribution, SealedAssertionResult, UnavailableScoreContribution, };\n/**\n * `required` is producer policy, not a field added to the Assertions\n * Attachment. It determines whether an otherwise-local unavailable result\n * raises the Attempt Verdict to errored.\n */\nexport const SealedAssertionForEvaluationSchema = Schema.Struct({\n required: Schema.Boolean,\n result: AssertionsSealedAssertionResultSchema,\n});\nexport type SealedAssertionForEvaluation = Schema.toType<typeof SealedAssertionForEvaluationSchema>[\"Type\"];\n/** All producer facts shared by the independent Verdict and Score folds. */\nexport const EvaluationAttemptFactsSchema = Schema.Struct({\n execution: Schema.Literals([\"completed\", \"errored\"]),\n explicitlySkipped: Schema.Boolean,\n assertions: Schema.Array(SealedAssertionForEvaluationSchema),\n});\nexport type EvaluationAttemptFacts = Schema.toType<typeof EvaluationAttemptFactsSchema>[\"Type\"];\n/** The sole Record/Core adapter shared by the canonical Verdict and Score folds. */\nexport function recordedAttemptFacts(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): EvaluationAttemptFacts {\n return Object.freeze({\n execution: input.outcome === \"errored\" || input.outcome === \"interrupted\"\n ? \"errored\" as const\n : \"completed\" as const,\n explicitlySkipped: input.outcome === \"cancelled\",\n assertions: Object.freeze(input.assertions.entries.map((entry) => Object.freeze({\n required: entry.policy.requirement.state === \"available\" && entry.policy.requirement.value === \"required\",\n result: sealedAssertionResult(entry),\n }))),\n });\n}\nexport function isRequiredAssertionUnavailableOrErrored(assertion: SealedAssertionForEvaluation): boolean {\n return assertion.required && (assertion.result.state === \"unavailable\"\n || assertion.result.state === \"errored\");\n}\nexport function isGateFailed(assertion: SealedAssertionForEvaluation): boolean {\n return assertion.result.gate === \"failed\";\n}\n"]}
@@ -6,7 +6,7 @@ exports.foldRecordedAttemptVerdict = foldRecordedAttemptVerdict;
6
6
  exports.buildVerdictPayload = buildVerdictPayload;
7
7
  exports.validateVerdictCoherence = validateVerdictCoherence;
8
8
  exports.projectVerdictPayload = projectVerdictPayload;
9
- // @concord-file ne-eval-record-verdict
9
+ // @concord-file
10
10
  // @concord-implements docs/feature/verdict/README.md
11
11
  // @concord-implements docs/feature/verdict/architecture.md
12
12
  // @concord-implements docs/feature/verdict/use-case/strict-quality-gate.md
@@ -22,7 +22,7 @@ exports.VerdictPayloadSchema = effect_1.Schema.Struct({
22
22
  state: exports.VerdictStateSchema,
23
23
  });
24
24
  exports.VerdictFoldInputSchema = sealed_assertion_ts_1.EvaluationAttemptFactsSchema;
25
- // @concord-code ne-eval-fold-verdict
25
+ // @concord-code
26
26
  // @concord-implements docs/feature/verdict/architecture.md
27
27
  // @concord-implements docs/feature/verdict/use-case/strict-quality-gate.md
28
28
  function foldVerdict(input) {
@@ -1 +1 @@
1
- {"version":3,"file":"verdict.js","sourceRoot":"","sources":["verdict.ts"],"names":[],"mappings":";;;AAyBA,kCAQC;AAMD,gEAKC;AACD,kDAEC;AAMD,4DAcC;AAED,sDAEC;AAvED,uCAAuC;AACvC,qDAAqD;AACrD,2DAA2D;AAC3D,2EAA2E;AAC3E,mCAAgC;AAGhC,oDAA+D;AAC/D,+DAAgL;AAChL;;;GAGG;AACU,QAAA,kBAAkB,GAAG,eAAM,CAAC,QAAQ,CAAC,mBAAQ,CAAC,CAAC;AAE/C,QAAA,oBAAoB,GAAG,eAAM,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,0BAAkB;CAC5B,CAAC,CAAC;AAIU,QAAA,sBAAsB,GAAG,kDAA4B,CAAC;AACnE,qCAAqC;AACrC,2DAA2D;AAC3D,2EAA2E;AAC3E,SAAgB,WAAW,CAAC,KAAuB;IAC/C,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;WAC1B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,6DAAuC,CAAC,EAAE,CAAC;QACpE,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,kCAAY,CAAC;QACnC,OAAO,QAAQ,CAAC;IACpB,OAAO,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC1D,CAAC;AACD;;;;GAIG;AACH,SAAgB,0BAA0B,CAAC,KAG1C;IACG,OAAO,WAAW,CAAC,IAAA,0CAAoB,EAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AACD,SAAgB,mBAAmB,CAAC,KAAuB;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACxD,CAAC;AAMD,SAAgB,wBAAwB,CAAC,KAGxC;IACG,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,KAAK,QAAQ;QACnC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACnB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YACZ,MAAM,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,uBAAgC;gBACtC,QAAQ;gBACR,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;aAC9B,CAAC;SACL,CAAC,CAAC;AACX,CAAC;AACD,+EAA+E;AAC/E,SAAgB,qBAAqB,CAAC,OAAuB;IACzD,OAAO,OAAO,CAAC,KAAK,CAAC;AACzB,CAAC","sourcesContent":["// @concord-file ne-eval-record-verdict\n// @concord-implements docs/feature/verdict/README.md\n// @concord-implements docs/feature/verdict/architecture.md\n// @concord-implements docs/feature/verdict/use-case/strict-quality-gate.md\nimport { Schema } from \"effect\";\nimport type { AssertionsAttachment } from \"../../record/family/assertions/definition.ts\";\nimport type { AttemptOutcome } from \"../../record/model/core.ts\";\nimport { VERDICTS, type Verdict } from \"../../shared/types.ts\";\nimport { EvaluationAttemptFactsSchema, isGateFailed, isRequiredAssertionUnavailableOrErrored, recordedAttemptFacts, type EvaluationAttemptFacts, } from \"./sealed-assertion.ts\";\n/**\n * A transient fold result. Verdict is derived from sealed Assertion facts and\n * Attempt outcome; it is deliberately not a Record Attachment family.\n */\nexport const VerdictStateSchema = Schema.Literals(VERDICTS);\nexport type VerdictState = Schema.toType<typeof VerdictStateSchema>[\"Type\"];\nexport const VerdictPayloadSchema = Schema.Struct({\n state: VerdictStateSchema,\n});\nexport type VerdictPayload = Schema.toType<typeof VerdictPayloadSchema>[\"Type\"];\nexport type VerdictPayloadEncoded = Schema.Codec.Encoded<typeof VerdictPayloadSchema>;\nexport type VerdictFoldInput = EvaluationAttemptFacts;\nexport const VerdictFoldInputSchema = EvaluationAttemptFactsSchema;\n// @concord-code ne-eval-fold-verdict\n// @concord-implements docs/feature/verdict/architecture.md\n// @concord-implements docs/feature/verdict/use-case/strict-quality-gate.md\nexport function foldVerdict(input: VerdictFoldInput): VerdictState {\n if (input.execution === \"errored\"\n || input.assertions.some(isRequiredAssertionUnavailableOrErrored)) {\n return \"errored\";\n }\n if (input.assertions.some(isGateFailed))\n return \"failed\";\n return input.explicitlySkipped ? \"skipped\" : \"passed\";\n}\n/**\n * Folds the public Verdict from the immutable Attempt outcome and verified\n * Assertions payload. This is the one adapter from Record's terminal Core\n * state into the verdict fold; consumers must not reproduce these rules.\n */\nexport function foldRecordedAttemptVerdict(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): VerdictState {\n return foldVerdict(recordedAttemptFacts(input));\n}\nexport function buildVerdictPayload(input: VerdictFoldInput): VerdictPayload {\n return Object.freeze({ state: foldVerdict(input) });\n}\nexport type VerdictCoherenceIssue = {\n readonly code: \"verdict-fold-mismatch\";\n readonly expected: VerdictState;\n readonly actual: VerdictState;\n};\nexport function validateVerdictCoherence(input: {\n readonly payload: VerdictPayload;\n readonly fold: VerdictFoldInput;\n}): readonly VerdictCoherenceIssue[] {\n const expected = foldVerdict(input.fold);\n return input.payload.state === expected\n ? Object.freeze([])\n : Object.freeze([\n Object.freeze({\n code: \"verdict-fold-mismatch\" as const,\n expected,\n actual: input.payload.state,\n }),\n ]);\n}\n/** Plain domain projection for callers that need NiceEval's public verdict. */\nexport function projectVerdictPayload(payload: VerdictPayload): Verdict {\n return payload.state;\n}\n"]}
1
+ {"version":3,"file":"verdict.js","sourceRoot":"","sources":["verdict.ts"],"names":[],"mappings":";;;AAyBA,kCAQC;AAMD,gEAKC;AACD,kDAEC;AAMD,4DAcC;AAED,sDAEC;AAvED,gBAAgB;AAChB,qDAAqD;AACrD,2DAA2D;AAC3D,2EAA2E;AAC3E,mCAAgC;AAGhC,oDAA+D;AAC/D,+DAAgL;AAChL;;;GAGG;AACU,QAAA,kBAAkB,GAAG,eAAM,CAAC,QAAQ,CAAC,mBAAQ,CAAC,CAAC;AAE/C,QAAA,oBAAoB,GAAG,eAAM,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,0BAAkB;CAC5B,CAAC,CAAC;AAIU,QAAA,sBAAsB,GAAG,kDAA4B,CAAC;AACnE,gBAAgB;AAChB,2DAA2D;AAC3D,2EAA2E;AAC3E,SAAgB,WAAW,CAAC,KAAuB;IAC/C,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;WAC1B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,6DAAuC,CAAC,EAAE,CAAC;QACpE,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,kCAAY,CAAC;QACnC,OAAO,QAAQ,CAAC;IACpB,OAAO,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC1D,CAAC;AACD;;;;GAIG;AACH,SAAgB,0BAA0B,CAAC,KAG1C;IACG,OAAO,WAAW,CAAC,IAAA,0CAAoB,EAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AACD,SAAgB,mBAAmB,CAAC,KAAuB;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACxD,CAAC;AAMD,SAAgB,wBAAwB,CAAC,KAGxC;IACG,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,KAAK,QAAQ;QACnC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACnB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YACZ,MAAM,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,uBAAgC;gBACtC,QAAQ;gBACR,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;aAC9B,CAAC;SACL,CAAC,CAAC;AACX,CAAC;AACD,+EAA+E;AAC/E,SAAgB,qBAAqB,CAAC,OAAuB;IACzD,OAAO,OAAO,CAAC,KAAK,CAAC;AACzB,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/verdict/README.md\n// @concord-implements docs/feature/verdict/architecture.md\n// @concord-implements docs/feature/verdict/use-case/strict-quality-gate.md\nimport { Schema } from \"effect\";\nimport type { AssertionsAttachment } from \"../../record/family/assertions/definition.ts\";\nimport type { AttemptOutcome } from \"../../record/model/core.ts\";\nimport { VERDICTS, type Verdict } from \"../../shared/types.ts\";\nimport { EvaluationAttemptFactsSchema, isGateFailed, isRequiredAssertionUnavailableOrErrored, recordedAttemptFacts, type EvaluationAttemptFacts, } from \"./sealed-assertion.ts\";\n/**\n * A transient fold result. Verdict is derived from sealed Assertion facts and\n * Attempt outcome; it is deliberately not a Record Attachment family.\n */\nexport const VerdictStateSchema = Schema.Literals(VERDICTS);\nexport type VerdictState = Schema.toType<typeof VerdictStateSchema>[\"Type\"];\nexport const VerdictPayloadSchema = Schema.Struct({\n state: VerdictStateSchema,\n});\nexport type VerdictPayload = Schema.toType<typeof VerdictPayloadSchema>[\"Type\"];\nexport type VerdictPayloadEncoded = Schema.Codec.Encoded<typeof VerdictPayloadSchema>;\nexport type VerdictFoldInput = EvaluationAttemptFacts;\nexport const VerdictFoldInputSchema = EvaluationAttemptFactsSchema;\n// @concord-code\n// @concord-implements docs/feature/verdict/architecture.md\n// @concord-implements docs/feature/verdict/use-case/strict-quality-gate.md\nexport function foldVerdict(input: VerdictFoldInput): VerdictState {\n if (input.execution === \"errored\"\n || input.assertions.some(isRequiredAssertionUnavailableOrErrored)) {\n return \"errored\";\n }\n if (input.assertions.some(isGateFailed))\n return \"failed\";\n return input.explicitlySkipped ? \"skipped\" : \"passed\";\n}\n/**\n * Folds the public Verdict from the immutable Attempt outcome and verified\n * Assertions payload. This is the one adapter from Record's terminal Core\n * state into the verdict fold; consumers must not reproduce these rules.\n */\nexport function foldRecordedAttemptVerdict(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): VerdictState {\n return foldVerdict(recordedAttemptFacts(input));\n}\nexport function buildVerdictPayload(input: VerdictFoldInput): VerdictPayload {\n return Object.freeze({ state: foldVerdict(input) });\n}\nexport type VerdictCoherenceIssue = {\n readonly code: \"verdict-fold-mismatch\";\n readonly expected: VerdictState;\n readonly actual: VerdictState;\n};\nexport function validateVerdictCoherence(input: {\n readonly payload: VerdictPayload;\n readonly fold: VerdictFoldInput;\n}): readonly VerdictCoherenceIssue[] {\n const expected = foldVerdict(input.fold);\n return input.payload.state === expected\n ? Object.freeze([])\n : Object.freeze([\n Object.freeze({\n code: \"verdict-fold-mismatch\" as const,\n expected,\n actual: input.payload.state,\n }),\n ]);\n}\n/** Plain domain projection for callers that need NiceEval's public verdict. */\nexport function projectVerdictPayload(payload: VerdictPayload): Verdict {\n return payload.state;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineContextMatch = exports.defineMaterialMatch = exports.pairwisePreference = exports.instructionFollowing = exports.faithfulness = exports.factuality = exports.toolMatch = exports.similarity = exports.satisfies = exports.referencesAnyPath = exports.pattern = exports.or = exports.not = exports.mapValue = exports.mapEach = exports.matches = exports.lessThan = exports.hasSections = exports.jsonMatch = exports.isTrue = exports.isFalse = exports.isDefined = exports.inOrder = exports.includesUrl = exports.includes = exports.greaterThan = exports.filterWhere = exports.excludes = exports.eventMatch = exports.equals = exports.defineValueMatch = exports.defineScoreMatch = exports.countWhere = exports.commandSucceeded = exports.commandMatch = exports.atMost = exports.atLeast = exports.and = exports.defineJudge = void 0;
3
+ exports.bytes = exports.count = exports.ratio = exports.usd = exports.tokens = exports.seconds = exports.ms = exports.quantile = exports.measured = exports.defineContextMatch = exports.defineMaterialMatch = exports.pairwisePreference = exports.instructionFollowing = exports.faithfulness = exports.factuality = exports.toolMatch = exports.similarity = exports.satisfies = exports.referencesAnyPath = exports.pattern = exports.or = exports.not = exports.mapValue = exports.mapEach = exports.matches = exports.lessThan = exports.hasSections = exports.jsonMatch = exports.isTrue = exports.isFalse = exports.isDefined = exports.inOrder = exports.includesUrl = exports.includes = exports.greaterThan = exports.filterWhere = exports.excludes = exports.eventMatch = exports.equals = exports.defineValueMatch = exports.defineScoreMatch = exports.countWhere = exports.commandSucceeded = exports.commandMatch = exports.between = exports.atMost = exports.atLeast = exports.and = exports.defineJudge = void 0;
4
4
  // niceeval/expect:只导出纯 Match factories。Fact、verdict 与 score use 由 context 负责。
5
5
  var judge_ts_1 = require("../assertions/judge.cjs");
6
6
  Object.defineProperty(exports, "defineJudge", { enumerable: true, get: function () { return judge_ts_1.defineJudge; } });
@@ -8,6 +8,7 @@ var match_ts_1 = require("../assertions/match.cjs");
8
8
  Object.defineProperty(exports, "and", { enumerable: true, get: function () { return match_ts_1.and; } });
9
9
  Object.defineProperty(exports, "atLeast", { enumerable: true, get: function () { return match_ts_1.atLeast; } });
10
10
  Object.defineProperty(exports, "atMost", { enumerable: true, get: function () { return match_ts_1.atMost; } });
11
+ Object.defineProperty(exports, "between", { enumerable: true, get: function () { return match_ts_1.between; } });
11
12
  Object.defineProperty(exports, "commandMatch", { enumerable: true, get: function () { return match_ts_1.commandMatch; } });
12
13
  Object.defineProperty(exports, "commandSucceeded", { enumerable: true, get: function () { return match_ts_1.commandSucceeded; } });
13
14
  Object.defineProperty(exports, "countWhere", { enumerable: true, get: function () { return match_ts_1.countWhere; } });
@@ -45,4 +46,15 @@ Object.defineProperty(exports, "pairwisePreference", { enumerable: true, get: fu
45
46
  var context_match_ts_1 = require("../assertions/context-match.cjs");
46
47
  Object.defineProperty(exports, "defineMaterialMatch", { enumerable: true, get: function () { return context_match_ts_1.defineMaterialMatch; } });
47
48
  Object.defineProperty(exports, "defineContextMatch", { enumerable: true, get: function () { return context_match_ts_1.defineContextMatch; } });
49
+ var measurements_ts_1 = require("../assertions/measurements.cjs");
50
+ Object.defineProperty(exports, "measured", { enumerable: true, get: function () { return measurements_ts_1.measured; } });
51
+ Object.defineProperty(exports, "quantile", { enumerable: true, get: function () { return measurements_ts_1.quantile; } });
52
+ var quantity_ts_1 = require("../assertions/quantity.cjs");
53
+ Object.defineProperty(exports, "ms", { enumerable: true, get: function () { return quantity_ts_1.ms; } });
54
+ Object.defineProperty(exports, "seconds", { enumerable: true, get: function () { return quantity_ts_1.seconds; } });
55
+ Object.defineProperty(exports, "tokens", { enumerable: true, get: function () { return quantity_ts_1.tokens; } });
56
+ Object.defineProperty(exports, "usd", { enumerable: true, get: function () { return quantity_ts_1.usd; } });
57
+ Object.defineProperty(exports, "ratio", { enumerable: true, get: function () { return quantity_ts_1.ratio; } });
58
+ Object.defineProperty(exports, "count", { enumerable: true, get: function () { return quantity_ts_1.count; } });
59
+ Object.defineProperty(exports, "bytes", { enumerable: true, get: function () { return quantity_ts_1.bytes; } });
48
60
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,8EAA8E;AAC9E,mDAAqD;AAA5C,uGAAA,WAAW,OAAA;AAEpB,mDAAwY;AAA/X,+FAAA,GAAG,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,kGAAA,MAAM,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,sGAAA,UAAU,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,kGAAA,MAAM,OAAA;AAAE,sGAAA,UAAU,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,kGAAA,MAAM,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,+FAAA,GAAG,OAAA;AAAE,8FAAA,EAAE,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,sGAAA,UAAU,OAAA;AAAE,qGAAA,SAAS,OAAA;AAEtW,mEAAoH;AAA3G,8GAAA,UAAU,OAAA;AAAE,gHAAA,YAAY,OAAA;AAAE,wHAAA,oBAAoB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAE3E,mEAAyF;AAAhF,uHAAA,mBAAmB,OAAA;AAAE,sHAAA,kBAAkB,OAAA","sourcesContent":["// niceeval/expect:只导出纯 Match factories。Fact、verdict 与 score use 由 context 负责。\nexport { defineJudge } from \"../assertions/judge.ts\";\nexport type { JudgeAnchor, JudgeDefinition, JudgeOptions } from \"../assertions/judge.ts\";\nexport { and, atLeast, atMost, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from \"../assertions/match.ts\";\nexport type { BooleanMatch, CollectionMatch, CollectionValue, CommandMatchOptions, EventMatch, EventOccurrenceMatch, EventOccurrenceQuantifiers, EventOccurrenceView, EventSequenceMatch, EventUpperBoundOccurrenceMatch, EventOptionsByType, LogicalCommandOccurrence, ManagedToolCalls, ManagedEventOccurrences, Match, MatchDomain, NumericComparisonMatch, TextMatchOptions, ToolMatch, ToolOccurrenceMatch, ToolSequenceMatch, ToolUpperBoundOccurrenceMatch, ToolMatchOptions, ToolOccurrenceQuantifiers, ToolOccurrenceView, ToolStatus, ValueMatch, ManagedScoreMatchOptions, ScoreMatch, ScoreMatchContext, ScoreMatchLlmFailure, ScoreMatchResult, ScoreMatchAnchor, } from \"../assertions/match.ts\";\nexport { factuality, faithfulness, instructionFollowing, pairwisePreference } from \"../assertions/judge-presets.ts\";\nexport type { JudgePresetOptions, FactualityMaterial, FaithfulnessMaterial, InstructionFollowingMaterial, PairwisePreferenceMaterial } from \"../assertions/judge-presets.ts\";\nexport { defineMaterialMatch, defineContextMatch } from \"../assertions/context-match.ts\";\nexport type { MaterialMatch, ContextBooleanMatch, ContextScoreMatch, MatchContext, ReadonlyMaterial, MatchFact, MaterialCollection, MaterialItem, MaterialCaptureBudget, FactCaptureBudget } from \"../assertions/context-match.ts\";\nexport type { NumericMaterial } from \"../assertions/match.ts\";\nexport type { EvalUsage, EvalCacheRead } from \"../o11y/eval-usage.ts\";\nexport type { CacheReadReport, CacheReadSummary } from \"../o11y/cache-read.ts\";\nexport type { AgentMatchContext } from \"../context/assert-first.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,8EAA8E;AAC9E,mDAAqD;AAA5C,uGAAA,WAAW,OAAA;AAEpB,mDAAiZ;AAAxY,+FAAA,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AAK,OAAA;AAAE,oGAAA,KAAK,OAAA;AAAE,oGAAA,KAAK,OAAA","sourcesContent":["// niceeval/expect:只导出纯 Match factories。Fact、verdict 与 score use 由 context 负责。\nexport { defineJudge } from \"../assertions/judge.ts\";\nexport type { JudgeAnchor, JudgeDefinition, JudgeOptions } from \"../assertions/judge.ts\";\nexport { and, atLeast, atMost, between, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from \"../assertions/match.ts\";\nexport type { BooleanMatch, CollectionMatch, CollectionValue, CommandMatchOptions, EventMatch, EventOccurrenceMatch, EventOccurrenceQuantifiers, EventOccurrenceView, EventSequenceMatch, EventUpperBoundOccurrenceMatch, EventOptionsByType, LogicalCommandOccurrence, ManagedToolCalls, ManagedEventOccurrences, Match, MatchDomain, NumericComparisonMatch, TextMatchOptions, ToolMatch, ToolOccurrenceMatch, ToolSequenceMatch, ToolUpperBoundOccurrenceMatch, ToolMatchOptions, ToolOccurrenceQuantifiers, ToolOccurrenceView, ToolStatus, ValueMatch, ManagedScoreMatchOptions, ScoreMatch, ScoreMatchContext, ScoreMatchLlmFailure, ScoreMatchResult, ScoreMatchAnchor, } from \"../assertions/match.ts\";\nexport { factuality, faithfulness, instructionFollowing, pairwisePreference } from \"../assertions/judge-presets.ts\";\nexport type { JudgePresetOptions, FactualityMaterial, FaithfulnessMaterial, InstructionFollowingMaterial, PairwisePreferenceMaterial } from \"../assertions/judge-presets.ts\";\nexport { defineMaterialMatch, defineContextMatch } from \"../assertions/context-match.ts\";\nexport type { MaterialMatch, ContextBooleanMatch, ContextScoreMatch, MatchContext, ReadonlyMaterial, MatchFact, MaterialCollection, MaterialItem, MaterialCaptureBudget, FactCaptureBudget } from \"../assertions/context-match.ts\";\nexport type { NumericMaterial } from \"../assertions/match.ts\";\nexport { measured, quantile } from \"../assertions/measurements.ts\";\nexport type { QuantileMethod, QuantileMaterial } from \"../assertions/measurements.ts\";\nexport type { EvalUsage, EvalCacheRead } from \"../o11y/eval-usage.ts\";\nexport type { CacheReadReport, CacheReadSummary } from \"../o11y/cache-read.ts\";\nexport type { AgentMatchContext } from \"../context/assert-first.ts\";\nexport { ms, seconds, tokens, usd, ratio, count, bytes } from \"../assertions/quantity.ts\";\nexport type { Quantity, Unit } from \"../assertions/quantity.ts\";\n"]}
@@ -1,12 +1,16 @@
1
1
  export { defineJudge } from "../assertions/judge.cjs";
2
2
  export type { JudgeAnchor, JudgeDefinition, JudgeOptions } from "../assertions/judge.cjs";
3
- export { and, atLeast, atMost, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from "../assertions/match.cjs";
3
+ export { and, atLeast, atMost, between, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from "../assertions/match.cjs";
4
4
  export type { BooleanMatch, CollectionMatch, CollectionValue, CommandMatchOptions, EventMatch, EventOccurrenceMatch, EventOccurrenceQuantifiers, EventOccurrenceView, EventSequenceMatch, EventUpperBoundOccurrenceMatch, EventOptionsByType, LogicalCommandOccurrence, ManagedToolCalls, ManagedEventOccurrences, Match, MatchDomain, NumericComparisonMatch, TextMatchOptions, ToolMatch, ToolOccurrenceMatch, ToolSequenceMatch, ToolUpperBoundOccurrenceMatch, ToolMatchOptions, ToolOccurrenceQuantifiers, ToolOccurrenceView, ToolStatus, ValueMatch, ManagedScoreMatchOptions, ScoreMatch, ScoreMatchContext, ScoreMatchLlmFailure, ScoreMatchResult, ScoreMatchAnchor, } from "../assertions/match.cjs";
5
5
  export { factuality, faithfulness, instructionFollowing, pairwisePreference } from "../assertions/judge-presets.cjs";
6
6
  export type { JudgePresetOptions, FactualityMaterial, FaithfulnessMaterial, InstructionFollowingMaterial, PairwisePreferenceMaterial } from "../assertions/judge-presets.cjs";
7
7
  export { defineMaterialMatch, defineContextMatch } from "../assertions/context-match.cjs";
8
8
  export type { MaterialMatch, ContextBooleanMatch, ContextScoreMatch, MatchContext, ReadonlyMaterial, MatchFact, MaterialCollection, MaterialItem, MaterialCaptureBudget, FactCaptureBudget } from "../assertions/context-match.cjs";
9
9
  export type { NumericMaterial } from "../assertions/match.cjs";
10
+ export { measured, quantile } from "../assertions/measurements.cjs";
11
+ export type { QuantileMethod, QuantileMaterial } from "../assertions/measurements.cjs";
10
12
  export type { EvalUsage, EvalCacheRead } from "../o11y/eval-usage.cjs";
11
13
  export type { CacheReadReport, CacheReadSummary } from "../o11y/cache-read.cjs";
12
14
  export type { AgentMatchContext } from "../context/assert-first.cjs";
15
+ export { ms, seconds, tokens, usd, ratio, count, bytes } from "../assertions/quantity.cjs";
16
+ export type { Quantity, Unit } from "../assertions/quantity.cjs";
@@ -1,12 +1,16 @@
1
1
  export { defineJudge } from "../assertions/judge.mjs";
2
2
  export type { JudgeAnchor, JudgeDefinition, JudgeOptions } from "../assertions/judge.mjs";
3
- export { and, atLeast, atMost, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from "../assertions/match.mjs";
3
+ export { and, atLeast, atMost, between, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from "../assertions/match.mjs";
4
4
  export type { BooleanMatch, CollectionMatch, CollectionValue, CommandMatchOptions, EventMatch, EventOccurrenceMatch, EventOccurrenceQuantifiers, EventOccurrenceView, EventSequenceMatch, EventUpperBoundOccurrenceMatch, EventOptionsByType, LogicalCommandOccurrence, ManagedToolCalls, ManagedEventOccurrences, Match, MatchDomain, NumericComparisonMatch, TextMatchOptions, ToolMatch, ToolOccurrenceMatch, ToolSequenceMatch, ToolUpperBoundOccurrenceMatch, ToolMatchOptions, ToolOccurrenceQuantifiers, ToolOccurrenceView, ToolStatus, ValueMatch, ManagedScoreMatchOptions, ScoreMatch, ScoreMatchContext, ScoreMatchLlmFailure, ScoreMatchResult, ScoreMatchAnchor, } from "../assertions/match.mjs";
5
5
  export { factuality, faithfulness, instructionFollowing, pairwisePreference } from "../assertions/judge-presets.mjs";
6
6
  export type { JudgePresetOptions, FactualityMaterial, FaithfulnessMaterial, InstructionFollowingMaterial, PairwisePreferenceMaterial } from "../assertions/judge-presets.mjs";
7
7
  export { defineMaterialMatch, defineContextMatch } from "../assertions/context-match.mjs";
8
8
  export type { MaterialMatch, ContextBooleanMatch, ContextScoreMatch, MatchContext, ReadonlyMaterial, MatchFact, MaterialCollection, MaterialItem, MaterialCaptureBudget, FactCaptureBudget } from "../assertions/context-match.mjs";
9
9
  export type { NumericMaterial } from "../assertions/match.mjs";
10
+ export { measured, quantile } from "../assertions/measurements.mjs";
11
+ export type { QuantileMethod, QuantileMaterial } from "../assertions/measurements.mjs";
10
12
  export type { EvalUsage, EvalCacheRead } from "../o11y/eval-usage.mjs";
11
13
  export type { CacheReadReport, CacheReadSummary } from "../o11y/cache-read.mjs";
12
14
  export type { AgentMatchContext } from "../context/assert-first.mjs";
15
+ export { ms, seconds, tokens, usd, ratio, count, bytes } from "../assertions/quantity.mjs";
16
+ export type { Quantity, Unit } from "../assertions/quantity.mjs";
@@ -1,12 +1,16 @@
1
1
  export { defineJudge } from "../assertions/judge.js";
2
2
  export type { JudgeAnchor, JudgeDefinition, JudgeOptions } from "../assertions/judge.js";
3
- export { and, atLeast, atMost, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from "../assertions/match.js";
3
+ export { and, atLeast, atMost, between, commandMatch, commandSucceeded, countWhere, defineScoreMatch, defineValueMatch, equals, eventMatch, excludes, filterWhere, greaterThan, includes, includesUrl, inOrder, isDefined, isFalse, isTrue, jsonMatch, hasSections, lessThan, matches, mapEach, mapValue, not, or, pattern, referencesAnyPath, satisfies, similarity, toolMatch, } from "../assertions/match.js";
4
4
  export type { BooleanMatch, CollectionMatch, CollectionValue, CommandMatchOptions, EventMatch, EventOccurrenceMatch, EventOccurrenceQuantifiers, EventOccurrenceView, EventSequenceMatch, EventUpperBoundOccurrenceMatch, EventOptionsByType, LogicalCommandOccurrence, ManagedToolCalls, ManagedEventOccurrences, Match, MatchDomain, NumericComparisonMatch, TextMatchOptions, ToolMatch, ToolOccurrenceMatch, ToolSequenceMatch, ToolUpperBoundOccurrenceMatch, ToolMatchOptions, ToolOccurrenceQuantifiers, ToolOccurrenceView, ToolStatus, ValueMatch, ManagedScoreMatchOptions, ScoreMatch, ScoreMatchContext, ScoreMatchLlmFailure, ScoreMatchResult, ScoreMatchAnchor, } from "../assertions/match.js";
5
5
  export { factuality, faithfulness, instructionFollowing, pairwisePreference } from "../assertions/judge-presets.js";
6
6
  export type { JudgePresetOptions, FactualityMaterial, FaithfulnessMaterial, InstructionFollowingMaterial, PairwisePreferenceMaterial } from "../assertions/judge-presets.js";
7
7
  export { defineMaterialMatch, defineContextMatch } from "../assertions/context-match.js";
8
8
  export type { MaterialMatch, ContextBooleanMatch, ContextScoreMatch, MatchContext, ReadonlyMaterial, MatchFact, MaterialCollection, MaterialItem, MaterialCaptureBudget, FactCaptureBudget } from "../assertions/context-match.js";
9
9
  export type { NumericMaterial } from "../assertions/match.js";
10
+ export { measured, quantile } from "../assertions/measurements.js";
11
+ export type { QuantileMethod, QuantileMaterial } from "../assertions/measurements.js";
10
12
  export type { EvalUsage, EvalCacheRead } from "../o11y/eval-usage.js";
11
13
  export type { CacheReadReport, CacheReadSummary } from "../o11y/cache-read.js";
12
14
  export type { AgentMatchContext } from "../context/assert-first.js";
15
+ export { ms, seconds, tokens, usd, ratio, count, bytes } from "../assertions/quantity.js";
16
+ export type { Quantity, Unit } from "../assertions/quantity.js";