niceeval 0.13.3-canary.37 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/dist/agents/bub.cjs +4 -4
  2. package/dist/agents/bub.cjs.map +1 -1
  3. package/dist/agents/bub.d.cts +2 -2
  4. package/dist/agents/bub.d.mts +2 -2
  5. package/dist/agents/bub.d.ts +2 -2
  6. package/dist/agents/codex-app-server.cjs +2 -3
  7. package/dist/agents/codex-app-server.cjs.map +1 -1
  8. package/dist/agents/codex.cjs +4 -4
  9. package/dist/agents/codex.cjs.map +1 -1
  10. package/dist/agents/codex.d.cts +3 -3
  11. package/dist/agents/codex.d.mts +3 -3
  12. package/dist/agents/codex.d.ts +3 -3
  13. package/dist/agents/sdk-streams.cjs +11 -4
  14. package/dist/agents/sdk-streams.cjs.map +1 -1
  15. package/dist/analysis/bindings.cjs +74 -19
  16. package/dist/analysis/bindings.cjs.map +1 -1
  17. package/dist/analysis/bindings.d.cts +534 -156
  18. package/dist/analysis/bindings.d.mts +534 -156
  19. package/dist/analysis/bindings.d.ts +534 -156
  20. package/dist/analysis/domain-view.cjs.map +1 -1
  21. package/dist/analysis/domain-view.d.cts +137 -8
  22. package/dist/analysis/domain-view.d.mts +137 -8
  23. package/dist/analysis/domain-view.d.ts +137 -8
  24. package/dist/analysis/index.cjs.map +1 -1
  25. package/dist/analysis/index.d.cts +1 -1
  26. package/dist/analysis/index.d.mts +1 -1
  27. package/dist/analysis/index.d.ts +1 -1
  28. package/dist/assertions/api.cjs.map +1 -1
  29. package/dist/assertions/api.d.cts +62 -0
  30. package/dist/assertions/api.d.mts +62 -0
  31. package/dist/assertions/api.d.ts +62 -0
  32. package/dist/assertions/judge.cjs +56 -5
  33. package/dist/assertions/judge.cjs.map +1 -1
  34. package/dist/assertions/match.cjs +66 -42
  35. package/dist/assertions/match.cjs.map +1 -1
  36. package/dist/assertions/match.d.cts +13 -0
  37. package/dist/assertions/match.d.mts +13 -0
  38. package/dist/assertions/match.d.ts +13 -0
  39. package/dist/assertions/record/attachment.cjs +104 -33
  40. package/dist/assertions/record/attachment.cjs.map +1 -1
  41. package/dist/assertions/record/attachment.d.cts +294 -57
  42. package/dist/assertions/record/attachment.d.mts +294 -57
  43. package/dist/assertions/record/attachment.d.ts +294 -57
  44. package/dist/assertions/record/codec.cjs +91 -17
  45. package/dist/assertions/record/codec.cjs.map +1 -1
  46. package/dist/assertions/record/codec.d.cts +280 -52
  47. package/dist/assertions/record/codec.d.mts +280 -52
  48. package/dist/assertions/record/codec.d.ts +280 -52
  49. package/dist/assertions/record/index.js +2 -0
  50. package/dist/assertions/record/model.cjs +16 -0
  51. package/dist/assertions/record/model.cjs.map +1 -1
  52. package/dist/assertions/record/model.d.cts +120 -13
  53. package/dist/assertions/record/model.d.mts +120 -13
  54. package/dist/assertions/record/model.d.ts +120 -13
  55. package/dist/assertions/record/model.js +2 -0
  56. package/dist/assertions/record/producer.cjs +70 -50
  57. package/dist/assertions/record/producer.cjs.map +1 -1
  58. package/dist/assertions/record/producer.d.cts +8 -7
  59. package/dist/assertions/record/producer.d.mts +8 -7
  60. package/dist/assertions/record/producer.d.ts +8 -7
  61. package/dist/assertions/runtime.cjs +49 -7
  62. package/dist/assertions/runtime.cjs.map +1 -1
  63. package/dist/cli/application.cjs +40 -0
  64. package/dist/cli/application.cjs.map +1 -0
  65. package/dist/cli/application.d.cts +129 -0
  66. package/dist/cli/application.d.mts +129 -0
  67. package/dist/cli/application.d.ts +129 -0
  68. package/dist/cli/application.js +24 -0
  69. package/dist/cli/application.js.map +1 -0
  70. package/dist/cli/bootstrap.cjs +10 -4
  71. package/dist/cli/bootstrap.cjs.map +1 -1
  72. package/dist/cli/node-application.cjs +123 -0
  73. package/dist/cli/node-application.cjs.map +1 -0
  74. package/dist/cli/node-application.d.cts +14 -0
  75. package/dist/cli/node-application.d.mts +14 -0
  76. package/dist/cli/node-application.d.ts +14 -0
  77. package/dist/cli/node-application.js +26 -0
  78. package/dist/cli/node-application.js.map +1 -0
  79. package/dist/cli/program.cjs +2807 -0
  80. package/dist/cli/program.cjs.map +1 -0
  81. package/dist/cli/program.d.cts +352 -0
  82. package/dist/cli/program.d.mts +352 -0
  83. package/dist/cli/program.d.ts +352 -0
  84. package/dist/cli/program.js +36 -0
  85. package/dist/cli/program.js.map +1 -0
  86. package/dist/cli/project-configuration.cjs +134 -0
  87. package/dist/cli/project-configuration.cjs.map +1 -0
  88. package/dist/cli/project-configuration.d.cts +64 -0
  89. package/dist/cli/project-configuration.d.mts +64 -0
  90. package/dist/cli/project-configuration.d.ts +64 -0
  91. package/dist/cli/project-configuration.js +22 -0
  92. package/dist/cli/project-configuration.js.map +1 -0
  93. package/dist/cli/record.cjs +20 -4
  94. package/dist/cli/record.cjs.map +1 -1
  95. package/dist/cli/record.d.cts +3 -3
  96. package/dist/cli/record.d.mts +3 -3
  97. package/dist/cli/record.d.ts +3 -3
  98. package/dist/cli.cjs +19 -3130
  99. package/dist/cli.cjs.map +1 -1
  100. package/dist/cli.d.cts +2 -148
  101. package/dist/cli.d.mts +2 -148
  102. package/dist/cli.d.ts +2 -148
  103. package/dist/cli.js +22 -30
  104. package/dist/context/assert-first.cjs +20 -15
  105. package/dist/context/assert-first.cjs.map +1 -1
  106. package/dist/eval/record/verdict.cjs +3 -2
  107. package/dist/eval/record/verdict.cjs.map +1 -1
  108. package/dist/experiment/host/index.cjs +1 -6
  109. package/dist/experiment/host/index.cjs.map +1 -1
  110. package/dist/experiment/host/index.d.cts +1 -0
  111. package/dist/experiment/host/index.d.mts +1 -0
  112. package/dist/experiment/host/index.d.ts +1 -0
  113. package/dist/load-config.cjs +13 -4
  114. package/dist/load-config.cjs.map +1 -1
  115. package/dist/load-config.d.cts +4 -3
  116. package/dist/load-config.d.mts +4 -3
  117. package/dist/load-config.d.ts +4 -3
  118. package/dist/load-config.js +4 -2
  119. package/dist/o11y/parsers/codex.cjs +29 -7
  120. package/dist/o11y/parsers/codex.cjs.map +1 -1
  121. package/dist/record/codec/core.d.cts +0 -2
  122. package/dist/record/codec/core.d.mts +0 -2
  123. package/dist/record/codec/core.d.ts +0 -2
  124. package/dist/record/codec/identifiers.cjs +2 -3
  125. package/dist/record/codec/identifiers.cjs.map +1 -1
  126. package/dist/record/codec/identifiers.d.cts +1 -2
  127. package/dist/record/codec/identifiers.d.mts +1 -2
  128. package/dist/record/codec/identifiers.d.ts +1 -2
  129. package/dist/record/codec/identifiers.js +10 -12
  130. package/dist/record/codec/index.js +42 -44
  131. package/dist/record/definition/attachment.cjs +1 -0
  132. package/dist/record/definition/attachment.cjs.map +1 -1
  133. package/dist/record/definition/attachment.d.cts +14 -0
  134. package/dist/record/definition/attachment.d.mts +14 -0
  135. package/dist/record/definition/attachment.d.ts +14 -0
  136. package/dist/record/family/assertions-v1.cjs +104 -0
  137. package/dist/record/family/assertions-v1.cjs.map +1 -0
  138. package/dist/record/family/assertions-v1.d.cts +2 -0
  139. package/dist/record/family/assertions-v1.d.mts +2 -0
  140. package/dist/record/family/assertions-v1.d.ts +2 -0
  141. package/dist/record/family/assertions-v1.js +6 -0
  142. package/dist/record/family/assertions-v1.js.map +1 -0
  143. package/dist/record/family/assertions.cjs +16 -5
  144. package/dist/record/family/assertions.cjs.map +1 -1
  145. package/dist/record/family/assertions.d.cts +510 -56
  146. package/dist/record/family/assertions.d.mts +510 -56
  147. package/dist/record/family/assertions.d.ts +510 -56
  148. package/dist/record/family/assertions.js +14 -10
  149. package/dist/record/family/catalog.cjs +17 -1
  150. package/dist/record/family/catalog.cjs.map +1 -1
  151. package/dist/record/family/catalog.d.cts +1292 -104
  152. package/dist/record/family/catalog.d.mts +1292 -104
  153. package/dist/record/family/catalog.d.ts +1292 -104
  154. package/dist/record/family/catalog.js +22 -20
  155. package/dist/record/family/index.js +144 -138
  156. package/dist/record/family/observability-v1.cjs +5 -0
  157. package/dist/record/family/observability-v1.cjs.map +1 -1
  158. package/dist/record/family/observability.cjs +1 -1
  159. package/dist/record/family/observability.cjs.map +1 -1
  160. package/dist/record/host/runtime.cjs +323 -173
  161. package/dist/record/host/runtime.cjs.map +1 -1
  162. package/dist/record/host/types.cjs.map +1 -1
  163. package/dist/record/host/types.d.cts +9 -7
  164. package/dist/record/host/types.d.mts +9 -7
  165. package/dist/record/host/types.d.ts +9 -7
  166. package/dist/record/model/core.cjs.map +1 -1
  167. package/dist/record/model/core.d.cts +1 -2
  168. package/dist/record/model/core.d.mts +1 -2
  169. package/dist/record/model/core.d.ts +1 -2
  170. package/dist/record/model/definition.cjs +1 -2
  171. package/dist/record/model/definition.cjs.map +1 -1
  172. package/dist/record/model/definition.d.cts +1 -7
  173. package/dist/record/model/definition.d.mts +1 -7
  174. package/dist/record/model/definition.d.ts +1 -7
  175. package/dist/record/model/identifiers.cjs +2 -3
  176. package/dist/record/model/identifiers.cjs.map +1 -1
  177. package/dist/record/model/identifiers.d.cts +1 -3
  178. package/dist/record/model/identifiers.d.mts +1 -3
  179. package/dist/record/model/identifiers.d.ts +1 -3
  180. package/dist/record/model/identifiers.js +36 -38
  181. package/dist/record/model/index.js +60 -62
  182. package/dist/record/platform/node.cjs +17 -7
  183. package/dist/record/platform/node.cjs.map +1 -1
  184. package/dist/record/platform/services.cjs.map +1 -1
  185. package/dist/record/platform/services.d.cts +8 -3
  186. package/dist/record/platform/services.d.mts +8 -3
  187. package/dist/record/platform/services.d.ts +8 -3
  188. package/dist/record/reader/format.cjs +16 -65
  189. package/dist/record/reader/format.cjs.map +1 -1
  190. package/dist/record/reader/format.d.cts +5 -9
  191. package/dist/record/reader/format.d.mts +5 -9
  192. package/dist/record/reader/format.d.ts +5 -9
  193. package/dist/record/reader/index.js +10 -8
  194. package/dist/record/reader/runtime.cjs +63 -32
  195. package/dist/record/reader/runtime.cjs.map +1 -1
  196. package/dist/record/reader/runtime.d.cts +40 -4
  197. package/dist/record/reader/runtime.d.mts +40 -4
  198. package/dist/record/reader/runtime.d.ts +40 -4
  199. package/dist/record/reader/runtime.js +6 -4
  200. package/dist/report/assets/enhance.js +5 -5
  201. package/dist/report/assets/styles.css +186 -24
  202. package/dist/report/built-in/result-components.cjs +8 -5
  203. package/dist/report/built-in/result-components.cjs.map +1 -1
  204. package/dist/report/built-in/standard.cjs +3 -0
  205. package/dist/report/built-in/standard.cjs.map +1 -1
  206. package/dist/report/built-in/standard.d.cts +2 -0
  207. package/dist/report/built-in/standard.d.mts +2 -0
  208. package/dist/report/built-in/standard.d.ts +2 -0
  209. package/dist/report/client-dist/app.js +53 -0
  210. package/dist/report/components/attempt-detail/compute.cjs +106 -231
  211. package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
  212. package/dist/report/components/attempt-detail/compute.d.cts +9 -43
  213. package/dist/report/components/attempt-detail/compute.d.mts +9 -43
  214. package/dist/report/components/attempt-detail/compute.d.ts +9 -43
  215. package/dist/report/components/attempt-detail/compute.js +2 -4
  216. package/dist/report/components/attempt-detail/content.cjs +3 -4
  217. package/dist/report/components/attempt-detail/content.cjs.map +1 -1
  218. package/dist/report/components/attempt-detail/validate.cjs +44 -2
  219. package/dist/report/components/attempt-detail/validate.cjs.map +1 -1
  220. package/dist/report/components/entity-lists/compute.cjs +9 -15
  221. package/dist/report/components/entity-lists/compute.cjs.map +1 -1
  222. package/dist/report/components/entity-lists/content.cjs +53 -40
  223. package/dist/report/components/entity-lists/content.cjs.map +1 -1
  224. package/dist/report/components/entity-lists/index.cjs +1 -3
  225. package/dist/report/components/entity-lists/index.cjs.map +1 -1
  226. package/dist/report/components/experiment-detail/compute.cjs +4 -6
  227. package/dist/report/components/experiment-detail/compute.cjs.map +1 -1
  228. package/dist/report/definition/cell.cjs +14 -7
  229. package/dist/report/definition/cell.cjs.map +1 -1
  230. package/dist/report/definition/cell.d.cts +4 -0
  231. package/dist/report/definition/cell.d.mts +4 -0
  232. package/dist/report/definition/cell.d.ts +4 -0
  233. package/dist/report/definition/primitives/assertion-evidence.cjs +96 -0
  234. package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -0
  235. package/dist/report/definition/primitives/assertion-evidence.d.cts +11 -0
  236. package/dist/report/definition/primitives/assertion-evidence.d.mts +11 -0
  237. package/dist/report/definition/primitives/assertion-evidence.d.ts +11 -0
  238. package/dist/report/definition/primitives/assertion-evidence.js +6 -0
  239. package/dist/report/definition/primitives/assertion-evidence.js.map +1 -0
  240. package/dist/report/definition/primitives.cjs +14 -1
  241. package/dist/report/definition/primitives.cjs.map +1 -1
  242. package/dist/report/definition/report.cjs +16 -8
  243. package/dist/report/definition/report.cjs.map +1 -1
  244. package/dist/report/definition/report.d.cts +6 -0
  245. package/dist/report/definition/report.d.mts +6 -0
  246. package/dist/report/definition/report.d.ts +6 -0
  247. package/dist/report/definition/table-text.cjs +12 -3
  248. package/dist/report/definition/table-text.cjs.map +1 -1
  249. package/dist/report/definition/table-text.d.cts +6 -1
  250. package/dist/report/definition/table-text.d.mts +6 -1
  251. package/dist/report/definition/table-text.d.ts +6 -1
  252. package/dist/report/execution/model.cjs +6 -14
  253. package/dist/report/execution/model.cjs.map +1 -1
  254. package/dist/report/execution/model.d.cts +5 -10
  255. package/dist/report/execution/model.d.mts +5 -10
  256. package/dist/report/execution/model.d.ts +5 -10
  257. package/dist/report/execution/model.js +6 -6
  258. package/dist/report/execution/paths.cjs +0 -11
  259. package/dist/report/execution/paths.cjs.map +1 -1
  260. package/dist/report/execution/paths.d.cts +0 -1
  261. package/dist/report/execution/paths.d.mts +0 -1
  262. package/dist/report/execution/paths.d.ts +0 -1
  263. package/dist/report/execution/paths.js +6 -8
  264. package/dist/report/host/execute.cjs +13 -22
  265. package/dist/report/host/execute.cjs.map +1 -1
  266. package/dist/report/host/execute.d.cts +1 -4
  267. package/dist/report/host/execute.d.mts +1 -4
  268. package/dist/report/host/execute.d.ts +1 -4
  269. package/dist/report/host/from-record.cjs +3 -0
  270. package/dist/report/host/from-record.cjs.map +1 -1
  271. package/dist/report/host/from-record.d.cts +4 -1
  272. package/dist/report/host/from-record.d.mts +4 -1
  273. package/dist/report/host/from-record.d.ts +4 -1
  274. package/dist/report/host/site-assets.cjs +1 -2
  275. package/dist/report/host/site-assets.cjs.map +1 -1
  276. package/dist/report/host/site-assets.d.cts +0 -1
  277. package/dist/report/host/site-assets.d.mts +0 -1
  278. package/dist/report/host/site-assets.d.ts +0 -1
  279. package/dist/report/host/site-assets.js +2 -4
  280. package/dist/report/host/static.cjs +71 -346
  281. package/dist/report/host/static.cjs.map +1 -1
  282. package/dist/report/host/static.d.cts +1 -3
  283. package/dist/report/host/static.d.mts +1 -3
  284. package/dist/report/host/static.d.ts +1 -3
  285. package/dist/report/host/static.js +2 -2
  286. package/dist/report/host/view-session.cjs.map +1 -1
  287. package/dist/report/host/view-session.d.cts +1 -1
  288. package/dist/report/host/view-session.d.mts +1 -1
  289. package/dist/report/host/view-session.d.ts +1 -1
  290. package/dist/report/model/locale.cjs +1 -1
  291. package/dist/report/model/locale.cjs.map +1 -1
  292. package/dist/report/model/locale.d.cts +1 -1
  293. package/dist/report/model/locale.d.mts +1 -1
  294. package/dist/report/model/locale.d.ts +1 -1
  295. package/dist/report/model/pricing.cjs +2 -2
  296. package/dist/report/model/pricing.cjs.map +1 -1
  297. package/dist/report/react/enhance.js +5 -5
  298. package/dist/report/react/styles.css +186 -24
  299. package/dist/runner/adoption.cjs +4 -7
  300. package/dist/runner/adoption.cjs.map +1 -1
  301. package/dist/runner/feedback/failure.cjs +77 -2
  302. package/dist/runner/feedback/failure.cjs.map +1 -1
  303. package/dist/runner/feedback/failure.d.cts +2 -1
  304. package/dist/runner/feedback/failure.d.mts +2 -1
  305. package/dist/runner/feedback/failure.d.ts +2 -1
  306. package/dist/runner/project-current.cjs +2 -13
  307. package/dist/runner/project-current.cjs.map +1 -1
  308. package/dist/runner/project-current.d.cts +4 -2
  309. package/dist/runner/project-current.d.mts +4 -2
  310. package/dist/runner/project-current.d.ts +4 -2
  311. package/dist/runner/reporters/braintrust.cjs +7 -7
  312. package/dist/runner/reporters/braintrust.cjs.map +1 -1
  313. package/dist/runner/reuse-readback.cjs +3 -4
  314. package/dist/runner/reuse-readback.cjs.map +1 -1
  315. package/dist/runner/run.cjs +5 -2
  316. package/dist/runner/run.cjs.map +1 -1
  317. package/dist/view/server.cjs +2 -37
  318. package/dist/view/server.cjs.map +1 -1
  319. package/dist/view/server.d.cts +0 -3
  320. package/dist/view/server.d.mts +0 -3
  321. package/dist/view/server.d.ts +0 -3
  322. package/docs-site/zh/reference/builtin-agents.mdx +7 -7
  323. package/docs-site/zh/reference/official-adapters.mdx +4 -4
  324. package/docs-site/zh/reference/report-components.mdx +2 -2
  325. package/docs-site/zh/tutorials/configuration.mdx +2 -2
  326. package/docs-site/zh/tutorials/deploy-report-site.mdx +24 -2
  327. package/docs-site/zh/tutorials/publish-report.mdx +4 -4
  328. package/docs-site/zh/tutorials/sandbox-agent.mdx +5 -5
  329. package/docs-site/zh/tutorials/theming.mdx +2 -2
  330. package/package.json +4 -6
  331. package/dist/record/migration/index.cjs +0 -5
  332. package/dist/record/migration/index.cjs.map +0 -1
  333. package/dist/record/migration/index.d.cts +0 -11
  334. package/dist/record/migration/index.d.mts +0 -11
  335. package/dist/record/migration/index.d.ts +0 -11
  336. package/dist/record/migration/index.js +0 -6
  337. package/dist/record/migration/index.js.map +0 -1
  338. package/dist/report/host/site-runtime.cjs +0 -92
  339. package/dist/report/host/site-runtime.cjs.map +0 -1
  340. package/dist/report/host/site-runtime.d.cts +0 -9
  341. package/dist/report/host/site-runtime.d.mts +0 -9
  342. package/dist/report/host/site-runtime.d.ts +0 -9
  343. package/dist/report/host/site-runtime.js +0 -10
  344. package/dist/report/host/site-runtime.js.map +0 -1
  345. package/dist/view/client-dist/app.css +0 -2
  346. package/dist/view/client-dist/app.js +0 -49
  347. package/dist/view/data.cjs +0 -3
  348. package/dist/view/data.cjs.map +0 -1
  349. package/dist/view/data.d.cts +0 -9
  350. package/dist/view/data.d.mts +0 -9
  351. package/dist/view/data.d.ts +0 -9
  352. package/dist/view/data.js +0 -4
  353. package/dist/view/data.js.map +0 -1
  354. package/dist/view/index.cjs +0 -24
  355. package/dist/view/index.cjs.map +0 -1
  356. package/dist/view/index.d.cts +0 -9
  357. package/dist/view/index.d.mts +0 -9
  358. package/dist/view/index.d.ts +0 -9
  359. package/dist/view/index.js +0 -28
  360. package/dist/view/index.js.map +0 -1
  361. package/dist/view/report-view-cache.cjs +0 -200
  362. package/dist/view/report-view-cache.cjs.map +0 -1
  363. package/dist/view/report-view-cache.d.cts +0 -67
  364. package/dist/view/report-view-cache.d.mts +0 -67
  365. package/dist/view/report-view-cache.d.ts +0 -67
  366. package/dist/view/report-view-cache.js +0 -8
  367. package/dist/view/report-view-cache.js.map +0 -1
  368. package/dist/view/shared/types.cjs +0 -3
  369. package/dist/view/shared/types.cjs.map +0 -1
  370. package/dist/view/shared/types.d.cts +0 -51
  371. package/dist/view/shared/types.d.mts +0 -51
  372. package/dist/view/shared/types.d.ts +0 -51
  373. package/dist/view/shared/types.js +0 -4
  374. package/dist/view/shared/types.js.map +0 -1
  375. package/dist/view/site.cjs +0 -32
  376. package/dist/view/site.cjs.map +0 -1
  377. package/dist/view/site.d.cts +0 -24
  378. package/dist/view/site.d.mts +0 -24
  379. package/dist/view/site.d.ts +0 -24
  380. package/dist/view/site.js +0 -8
  381. package/dist/view/site.js.map +0 -1
  382. package/dist/view/styles.css +0 -170
  383. package/dist/view/template.html +0 -17
@@ -27,7 +27,6 @@ export declare const RecordAttemptRefSchema: Schema.Struct<{
27
27
  }>;
28
28
  export declare const RecordDocumentSchema: Schema.Struct<{
29
29
  format: Schema.Schema<import("../model/identifiers.cjs").RecordFormat, "niceeval.record", never>;
30
- schemaVersion: Schema.Schema<2, 2, never>;
31
30
  recordId: Schema.Schema<import("../model/identifiers.cjs").RecordId, string, never>;
32
31
  }>;
33
32
  export declare const RecordSlotIdentitySchema: Schema.Struct<{
@@ -135,7 +134,6 @@ export declare const RunCoreSchema: Schema.Struct<{
135
134
  export declare const RecordCoreSchema: Schema.filter<Schema.Struct<{
136
135
  record: Schema.Struct<{
137
136
  format: Schema.Schema<import("../model/identifiers.cjs").RecordFormat, "niceeval.record", never>;
138
- schemaVersion: Schema.Schema<2, 2, never>;
139
137
  recordId: Schema.Schema<import("../model/identifiers.cjs").RecordId, string, never>;
140
138
  }>;
141
139
  runs: Schema.Array$<Schema.Struct<{
@@ -27,7 +27,6 @@ export declare const RecordAttemptRefSchema: Schema.Struct<{
27
27
  }>;
28
28
  export declare const RecordDocumentSchema: Schema.Struct<{
29
29
  format: Schema.Schema<import("../model/identifiers.mjs").RecordFormat, "niceeval.record", never>;
30
- schemaVersion: Schema.Schema<2, 2, never>;
31
30
  recordId: Schema.Schema<import("../model/identifiers.mjs").RecordId, string, never>;
32
31
  }>;
33
32
  export declare const RecordSlotIdentitySchema: Schema.Struct<{
@@ -135,7 +134,6 @@ export declare const RunCoreSchema: Schema.Struct<{
135
134
  export declare const RecordCoreSchema: Schema.filter<Schema.Struct<{
136
135
  record: Schema.Struct<{
137
136
  format: Schema.Schema<import("../model/identifiers.mjs").RecordFormat, "niceeval.record", never>;
138
- schemaVersion: Schema.Schema<2, 2, never>;
139
137
  recordId: Schema.Schema<import("../model/identifiers.mjs").RecordId, string, never>;
140
138
  }>;
141
139
  runs: Schema.Array$<Schema.Struct<{
@@ -27,7 +27,6 @@ export declare const RecordAttemptRefSchema: Schema.Struct<{
27
27
  }>;
28
28
  export declare const RecordDocumentSchema: Schema.Struct<{
29
29
  format: Schema.Schema<import("../model/identifiers.js").RecordFormat, "niceeval.record", never>;
30
- schemaVersion: Schema.Schema<2, 2, never>;
31
30
  recordId: Schema.Schema<import("../model/identifiers.js").RecordId, string, never>;
32
31
  }>;
33
32
  export declare const RecordSlotIdentitySchema: Schema.Struct<{
@@ -135,7 +134,6 @@ export declare const RunCoreSchema: Schema.Struct<{
135
134
  export declare const RecordCoreSchema: Schema.filter<Schema.Struct<{
136
135
  record: Schema.Struct<{
137
136
  format: Schema.Schema<import("../model/identifiers.js").RecordFormat, "niceeval.record", never>;
138
- schemaVersion: Schema.Schema<2, 2, never>;
139
137
  recordId: Schema.Schema<import("../model/identifiers.js").RecordId, string, never>;
140
138
  }>;
141
139
  runs: Schema.Array$<Schema.Struct<{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecordFormatSchema = exports.RecordSchemaVersionSchema = exports.RecordFormatIdSchema = exports.RecordAttachmentSchemaIdSchema = exports.RecordAttachmentNameSchema = exports.UtcMillisSchema = exports.CanonicalProjectRelativePathSchema = exports.ArtifactIdSchema = exports.FileChangeIdSchema = exports.SourceItemIdSchema = exports.Sha256DigestSchema = exports.ExecutionIdentityDigestSchema = exports.EvalIdSchema = exports.ExperimentIdSchema = exports.AttemptIdSchema = exports.SlotIdSchema = exports.RunIdSchema = exports.RecordIdSchema = void 0;
3
+ exports.RecordFormatSchema = exports.RecordFormatIdSchema = exports.RecordAttachmentSchemaIdSchema = exports.RecordAttachmentNameSchema = exports.UtcMillisSchema = exports.CanonicalProjectRelativePathSchema = exports.ArtifactIdSchema = exports.FileChangeIdSchema = exports.SourceItemIdSchema = exports.Sha256DigestSchema = exports.ExecutionIdentityDigestSchema = exports.EvalIdSchema = exports.ExperimentIdSchema = exports.AttemptIdSchema = exports.SlotIdSchema = exports.RunIdSchema = exports.RecordIdSchema = void 0;
4
4
  const effect_1 = require("effect");
5
5
  const identifiers_ts_1 = require("../model/identifiers.cjs");
6
6
  const PortableSegmentTextSchema = effect_1.Schema.String.pipe(effect_1.Schema.filter(identifiers_ts_1.isPortableSegment, {
@@ -46,8 +46,7 @@ exports.RecordAttachmentSchemaIdSchema = effect_1.Schema.String.pipe(effect_1.Sc
46
46
  }), effect_1.Schema.brand(identifiers_ts_1.RECORD_ATTACHMENT_SCHEMA_ID_BRAND));
47
47
  exports.RecordFormatIdSchema = effect_1.Schema.String.pipe(effect_1.Schema.filter(identifiers_ts_1.isRecordFormatId, {
48
48
  identifier: "RecordFormatId",
49
- description: "a niceeval.record/vN format identity",
49
+ description: "a fixed niceeval.record format identity",
50
50
  }), effect_1.Schema.brand(identifiers_ts_1.RECORD_FORMAT_ID_BRAND));
51
- exports.RecordSchemaVersionSchema = effect_1.Schema.Literal(identifiers_ts_1.RECORD_SCHEMA_VERSION);
52
51
  exports.RecordFormatSchema = effect_1.Schema.Literal(identifiers_ts_1.RECORD_FORMAT).pipe(effect_1.Schema.brand(identifiers_ts_1.RECORD_FORMAT_ID_BRAND));
53
52
  //# sourceMappingURL=identifiers.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"identifiers.js","sourceRoot":"","sources":["identifiers.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,4DAAw9B;AACx9B,MAAM,yBAAyB,GAAG,eAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAM,CAAC,MAAM,CAAC,kCAAiB,EAAE;IAClF,UAAU,EAAE,uBAAuB;IACnC,WAAW,EAAE,sFAAsF;CACtG,CAAC,CAAC,CAAC;AACS,QAAA,cAAc,GAAoC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,gCAAe,CAAC,CAAC,CAAC;AAChH,QAAA,WAAW,GAAiC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,6BAAY,CAAC,CAAC,CAAC;AACvG,QAAA,YAAY,GAAkC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,8BAAa,CAAC,CAAC,CAAC;AAC1G,QAAA,eAAe,GAAqC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,iCAAgB,CAAC,CAAC,CAAC;AAChI,MAAM,0BAA0B,GAAG,eAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAM,CAAC,MAAM,CAAC,uCAAsB,EAAE;IACxF,UAAU,EAAE,sBAAsB;IAClC,WAAW,EAAE,uDAAuD;CACvE,CAAC,CAAC,CAAC;AACS,QAAA,kBAAkB,GAAwC,0BAA0B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Segment, isCanonicalProjectRelativePath, isRecordDomainIdentity, isRecordAttachmentName, isRecordAttachmentSchemaId, isRecordFormatId, isSha256Digest, isUtcMillis, RECORD_ATTACHMENT_NAME_BRAND, RECORD_ATTACHMENT_SCHEMA_ID_BRAND, RECORD_FORMAT, RECORD_FORMAT_ID_BRAND, RECORD_SCHEMA_VERSION, RECORD_ID_BRAND, RUN_ID_BRAND, SHA256_DIGEST_BRAND, SLOT_ID_BRAND, SOURCE_ITEM_ID_BRAND, UTC_MILLIS_BRAND, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RecordSchemaVersion, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis, } from \"../model/identifiers.ts\";\nconst PortableSegmentTextSchema = Schema.String.pipe(Schema.filter(isPortableSegment, {\n identifier: \"RecordPortableSegment\",\n description: \"an ASCII portable file-name segment without path separators or reserved device names\",\n}));\nexport const RecordIdSchema: Schema.Schema<RecordId, string> = PortableSegmentTextSchema.pipe(Schema.brand(RECORD_ID_BRAND));\nexport const RunIdSchema: Schema.Schema<RunId, string> = PortableSegmentTextSchema.pipe(Schema.brand(RUN_ID_BRAND));\nexport const SlotIdSchema: Schema.Schema<SlotId, string> = PortableSegmentTextSchema.pipe(Schema.brand(SLOT_ID_BRAND));\nexport const AttemptIdSchema: Schema.Schema<AttemptId, string> = PortableSegmentTextSchema.pipe(Schema.brand(ATTEMPT_ID_BRAND));\nconst RecordDomainIdentitySchema = Schema.String.pipe(Schema.filter(isRecordDomainIdentity, {\n identifier: \"RecordDomainIdentity\",\n description: \"a bounded durable identity without control characters\",\n}));\nexport const ExperimentIdSchema: Schema.Schema<ExperimentId, string> = RecordDomainIdentitySchema.pipe(Schema.brand(EXPERIMENT_ID_BRAND));\nexport const EvalIdSchema: Schema.Schema<EvalId, string> = RecordDomainIdentitySchema.pipe(Schema.brand(EVAL_ID_BRAND));\nexport const ExecutionIdentityDigestSchema: Schema.Schema<ExecutionIdentityDigest, string> = Schema.String.pipe(Schema.filter(isSha256Digest, {\n identifier: \"ExecutionIdentityDigest\",\n description: \"a lowercase hexadecimal SHA-256 execution identity digest\",\n}), Schema.brand(EXECUTION_IDENTITY_DIGEST_BRAND));\nexport const Sha256DigestSchema: Schema.Schema<Sha256Digest, string> = Schema.String.pipe(Schema.filter(isSha256Digest, {\n identifier: \"Sha256Digest\",\n description: \"a lowercase hexadecimal SHA-256 digest\",\n}), Schema.brand(SHA256_DIGEST_BRAND));\nexport const SourceItemIdSchema: Schema.Schema<SourceItemId, string> = PortableSegmentTextSchema.pipe(Schema.brand(SOURCE_ITEM_ID_BRAND));\nexport const FileChangeIdSchema: Schema.Schema<FileChangeId, string> = PortableSegmentTextSchema.pipe(Schema.brand(FILE_CHANGE_ID_BRAND));\nexport const ArtifactIdSchema: Schema.Schema<ArtifactId, string> = PortableSegmentTextSchema.pipe(Schema.brand(ARTIFACT_ID_BRAND));\nexport const CanonicalProjectRelativePathSchema: Schema.Schema<CanonicalProjectRelativePath, string> = Schema.String.pipe(Schema.filter(isCanonicalProjectRelativePath, {\n identifier: \"CanonicalProjectRelativePath\",\n description: \"a slash-separated project-relative path without dot segments\",\n}), Schema.brand(CANONICAL_PROJECT_RELATIVE_PATH_BRAND));\nexport const UtcMillisSchema: Schema.Schema<UtcMillis, number> = Schema.Number.pipe(Schema.filter(isUtcMillis, {\n identifier: \"UtcMillis\",\n description: \"a non-negative JSON-safe Unix-epoch millisecond value\",\n}), Schema.brand(UTC_MILLIS_BRAND));\nexport const RecordAttachmentNameSchema: Schema.Schema<RecordAttachmentName, string> = Schema.String.pipe(Schema.filter(isRecordAttachmentName, {\n identifier: \"RecordAttachmentName\",\n description: \"a lowercase reverse-domain portable Attachment name\",\n}), Schema.brand(RECORD_ATTACHMENT_NAME_BRAND));\nexport const RecordAttachmentSchemaIdSchema: Schema.Schema<RecordAttachmentSchemaId, string> = Schema.String.pipe(Schema.filter(isRecordAttachmentSchemaId, {\n identifier: \"RecordAttachmentSchemaId\",\n description: \"a RecordAttachment name followed by /vN\",\n}), Schema.brand(RECORD_ATTACHMENT_SCHEMA_ID_BRAND));\nexport const RecordFormatIdSchema: Schema.Schema<RecordFormatId, string> = Schema.String.pipe(Schema.filter(isRecordFormatId, {\n identifier: \"RecordFormatId\",\n description: \"a niceeval.record/vN format identity\",\n}), Schema.brand(RECORD_FORMAT_ID_BRAND));\nexport const RecordSchemaVersionSchema: Schema.Schema<RecordSchemaVersion, typeof RECORD_SCHEMA_VERSION> = Schema.Literal(RECORD_SCHEMA_VERSION);\nexport const RecordFormatSchema: Schema.Schema<RecordFormat, typeof RECORD_FORMAT> = Schema.Literal(RECORD_FORMAT).pipe(Schema.brand(RECORD_FORMAT_ID_BRAND));\n"]}
1
+ {"version":3,"file":"identifiers.js","sourceRoot":"","sources":["identifiers.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,4DAAu6B;AACv6B,MAAM,yBAAyB,GAAG,eAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAM,CAAC,MAAM,CAAC,kCAAiB,EAAE;IAClF,UAAU,EAAE,uBAAuB;IACnC,WAAW,EAAE,sFAAsF;CACtG,CAAC,CAAC,CAAC;AACS,QAAA,cAAc,GAAoC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,gCAAe,CAAC,CAAC,CAAC;AAChH,QAAA,WAAW,GAAiC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,6BAAY,CAAC,CAAC,CAAC;AACvG,QAAA,YAAY,GAAkC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,8BAAa,CAAC,CAAC,CAAC;AAC1G,QAAA,eAAe,GAAqC,yBAAyB,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,iCAAgB,CAAC,CAAC,CAAC;AAChI,M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RAND, CANONICAL_PROJECT_RELATIVE_PATH_BRAND, EVAL_ID_BRAND, EXECUTION_IDENTITY_DIGEST_BRAND, EXPERIMENT_ID_BRAND, FILE_CHANGE_ID_BRAND, isPortableSegment, isCanonicalProjectRelativePath, isRecordDomainIdentity, isRecordAttachmentName, isRecordAttachmentSchemaId, isRecordFormatId, isSha256Digest, isUtcMillis, RECORD_ATTACHMENT_NAME_BRAND, RECORD_ATTACHMENT_SCHEMA_ID_BRAND, RECORD_FORMAT, RECORD_FORMAT_ID_BRAND, RECORD_ID_BRAND, RUN_ID_BRAND, SHA256_DIGEST_BRAND, SLOT_ID_BRAND, SOURCE_ITEM_ID_BRAND, UTC_MILLIS_BRAND, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis, } from \"../model/identifiers.ts\";\nconst PortableSegmentTextSchema = Schema.String.pipe(Schema.filter(isPortableSegment, {\n identifier: \"RecordPortableSegment\",\n description: \"an ASCII portable file-name segment without path separators or reserved device names\",\n}));\nexport const RecordIdSchema: Schema.Schema<RecordId, string> = PortableSegmentTextSchema.pipe(Schema.brand(RECORD_ID_BRAND));\nexport const RunIdSchema: Schema.Schema<RunId, string> = PortableSegmentTextSchema.pipe(Schema.brand(RUN_ID_BRAND));\nexport const SlotIdSchema: Schema.Schema<SlotId, string> = PortableSegmentTextSchema.pipe(Schema.brand(SLOT_ID_BRAND));\nexport const AttemptIdSchema: Schema.Schema<AttemptId, string> = PortableSegmentTextSchema.pipe(Schema.brand(ATTEMPT_ID_BRAND));\nconst RecordDomainIdentitySchema = Schema.String.pipe(Schema.filter(isRecordDomainIdentity, {\n identifier: \"RecordDomainIdentity\",\n description: \"a bounded durable identity without control characters\",\n}));\nexport const ExperimentIdSchema: Schema.Schema<ExperimentId, string> = RecordDomainIdentitySchema.pipe(Schema.brand(EXPERIMENT_ID_BRAND));\nexport const EvalIdSchema: Schema.Schema<EvalId, string> = RecordDomainIdentitySchema.pipe(Schema.brand(EVAL_ID_BRAND));\nexport const ExecutionIdentityDigestSchema: Schema.Schema<ExecutionIdentityDigest, string> = Schema.String.pipe(Schema.filter(isSha256Digest, {\n identifier: \"ExecutionIdentityDigest\",\n description: \"a lowercase hexadecimal SHA-256 execution identity digest\",\n}), Schema.brand(EXECUTION_IDENTITY_DIGEST_BRAND));\nexport const Sha256DigestSchema: Schema.Schema<Sha256Digest, string> = Schema.String.pipe(Schema.filter(isSha256Digest, {\n identifier: \"Sha256Digest\",\n description: \"a lowercase hexadecimal SHA-256 digest\",\n}), Schema.brand(SHA256_DIGEST_BRAND));\nexport const SourceItemIdSchema: Schema.Schema<SourceItemId, string> = PortableSegmentTextSchema.pipe(Schema.brand(SOURCE_ITEM_ID_BRAND));\nexport const FileChangeIdSchema: Schema.Schema<FileChangeId, string> = PortableSegmentTextSchema.pipe(Schema.brand(FILE_CHANGE_ID_BRAND));\nexport const ArtifactIdSchema: Schema.Schema<ArtifactId, string> = PortableSegmentTextSchema.pipe(Schema.brand(ARTIFACT_ID_BRAND));\nexport const CanonicalProjectRelativePathSchema: Schema.Schema<CanonicalProjectRelativePath, string> = Schema.String.pipe(Schema.filter(isCanonicalProjectRelativePath, {\n identifier: \"CanonicalProjectRelativePath\",\n description: \"a slash-separated project-relative path without dot segments\",\n}), Schema.brand(CANONICAL_PROJECT_RELATIVE_PATH_BRAND));\nexport const UtcMillisSchema: Schema.Schema<UtcMillis, number> = Schema.Number.pipe(Schema.filter(isUtcMillis, {\n identifier: \"UtcMillis\",\n description: \"a non-negative JSON-safe Unix-epoch millisecond value\",\n}), Schema.brand(UTC_MILLIS_BRAND));\nexport const RecordAttachmentNameSchema: Schema.Schema<RecordAttachmentName, string> = Schema.String.pipe(Schema.filter(isRecordAttachmentName, {\n identifier: \"RecordAttachmentName\",\n description: \"a lowercase reverse-domain portable Attachment name\",\n}), Schema.brand(RECORD_ATTACHMENT_NAME_BRAND));\nexport const RecordAttachmentSchemaIdSchema: Schema.Schema<RecordAttachmentSchemaId, string> = Schema.String.pipe(Schema.filter(isRecordAttachmentSchemaId, {\n identifier: \"RecordAttachmentSchemaId\",\n description: \"a RecordAttachment name followed by /vN\",\n}), Schema.brand(RECORD_ATTACHMENT_SCHEMA_ID_BRAND));\nexport const RecordFormatIdSchema: Schema.Schema<RecordFormatId, string> = Schema.String.pipe(Schema.filter(isRecordFormatId, {\n identifier: \"RecordFormatId\",\n description: \"a fixed niceeval.record format identity\",\n}), Schema.brand(RECORD_FORMAT_ID_BRAND));\nexport const RecordFormatSchema: Schema.Schema<RecordFormat, typeof RECORD_FORMAT> = Schema.Literal(RECORD_FORMAT).pipe(Schema.brand(RECORD_FORMAT_ID_BRAND));\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { RECORD_FORMAT, RECORD_SCHEMA_VERSION, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RecordSchemaVersion, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis } from "../model/identifiers.cjs";
2
+ import { RECORD_FORMAT, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis } from "../model/identifiers.cjs";
3
3
  export declare const RecordIdSchema: Schema.Schema<RecordId, string>;
4
4
  export declare const RunIdSchema: Schema.Schema<RunId, string>;
5
5
  export declare const SlotIdSchema: Schema.Schema<SlotId, string>;
@@ -16,5 +16,4 @@ export declare const UtcMillisSchema: Schema.Schema<UtcMillis, number>;
16
16
  export declare const RecordAttachmentNameSchema: Schema.Schema<RecordAttachmentName, string>;
17
17
  export declare const RecordAttachmentSchemaIdSchema: Schema.Schema<RecordAttachmentSchemaId, string>;
18
18
  export declare const RecordFormatIdSchema: Schema.Schema<RecordFormatId, string>;
19
- export declare const RecordSchemaVersionSchema: Schema.Schema<RecordSchemaVersion, typeof RECORD_SCHEMA_VERSION>;
20
19
  export declare const RecordFormatSchema: Schema.Schema<RecordFormat, typeof RECORD_FORMAT>;
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { RECORD_FORMAT, RECORD_SCHEMA_VERSION, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RecordSchemaVersion, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis } from "../model/identifiers.mjs";
2
+ import { RECORD_FORMAT, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis } from "../model/identifiers.mjs";
3
3
  export declare const RecordIdSchema: Schema.Schema<RecordId, string>;
4
4
  export declare const RunIdSchema: Schema.Schema<RunId, string>;
5
5
  export declare const SlotIdSchema: Schema.Schema<SlotId, string>;
@@ -16,5 +16,4 @@ export declare const UtcMillisSchema: Schema.Schema<UtcMillis, number>;
16
16
  export declare const RecordAttachmentNameSchema: Schema.Schema<RecordAttachmentName, string>;
17
17
  export declare const RecordAttachmentSchemaIdSchema: Schema.Schema<RecordAttachmentSchemaId, string>;
18
18
  export declare const RecordFormatIdSchema: Schema.Schema<RecordFormatId, string>;
19
- export declare const RecordSchemaVersionSchema: Schema.Schema<RecordSchemaVersion, typeof RECORD_SCHEMA_VERSION>;
20
19
  export declare const RecordFormatSchema: Schema.Schema<RecordFormat, typeof RECORD_FORMAT>;
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { RECORD_FORMAT, RECORD_SCHEMA_VERSION, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RecordSchemaVersion, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis } from "../model/identifiers.js";
2
+ import { RECORD_FORMAT, type AttemptId, type ArtifactId, type CanonicalProjectRelativePath, type EvalId, type ExecutionIdentityDigest, type ExperimentId, type FileChangeId, type RecordAttachmentName, type RecordAttachmentSchemaId, type RecordFormat, type RecordFormatId, type RecordId, type RunId, type Sha256Digest, type SlotId, type SourceItemId, type UtcMillis } from "../model/identifiers.js";
3
3
  export declare const RecordIdSchema: Schema.Schema<RecordId, string>;
4
4
  export declare const RunIdSchema: Schema.Schema<RunId, string>;
5
5
  export declare const SlotIdSchema: Schema.Schema<SlotId, string>;
@@ -16,5 +16,4 @@ export declare const UtcMillisSchema: Schema.Schema<UtcMillis, number>;
16
16
  export declare const RecordAttachmentNameSchema: Schema.Schema<RecordAttachmentName, string>;
17
17
  export declare const RecordAttachmentSchemaIdSchema: Schema.Schema<RecordAttachmentSchemaId, string>;
18
18
  export declare const RecordFormatIdSchema: Schema.Schema<RecordFormatId, string>;
19
- export declare const RecordSchemaVersionSchema: Schema.Schema<RecordSchemaVersion, typeof RECORD_SCHEMA_VERSION>;
20
19
  export declare const RecordFormatSchema: Schema.Schema<RecordFormat, typeof RECORD_FORMAT>;
@@ -25,16 +25,14 @@ const __niceevalExport10 = __niceevalCanonical["RecordFormatSchema"];
25
25
  export { __niceevalExport10 as RecordFormatSchema };
26
26
  const __niceevalExport11 = __niceevalCanonical["RecordIdSchema"];
27
27
  export { __niceevalExport11 as RecordIdSchema };
28
- const __niceevalExport12 = __niceevalCanonical["RecordSchemaVersionSchema"];
29
- export { __niceevalExport12 as RecordSchemaVersionSchema };
30
- const __niceevalExport13 = __niceevalCanonical["RunIdSchema"];
31
- export { __niceevalExport13 as RunIdSchema };
32
- const __niceevalExport14 = __niceevalCanonical["Sha256DigestSchema"];
33
- export { __niceevalExport14 as Sha256DigestSchema };
34
- const __niceevalExport15 = __niceevalCanonical["SlotIdSchema"];
35
- export { __niceevalExport15 as SlotIdSchema };
36
- const __niceevalExport16 = __niceevalCanonical["SourceItemIdSchema"];
37
- export { __niceevalExport16 as SourceItemIdSchema };
38
- const __niceevalExport17 = __niceevalCanonical["UtcMillisSchema"];
39
- export { __niceevalExport17 as UtcMillisSchema };
28
+ const __niceevalExport12 = __niceevalCanonical["RunIdSchema"];
29
+ export { __niceevalExport12 as RunIdSchema };
30
+ const __niceevalExport13 = __niceevalCanonical["Sha256DigestSchema"];
31
+ export { __niceevalExport13 as Sha256DigestSchema };
32
+ const __niceevalExport14 = __niceevalCanonical["SlotIdSchema"];
33
+ export { __niceevalExport14 as SlotIdSchema };
34
+ const __niceevalExport15 = __niceevalCanonical["SourceItemIdSchema"];
35
+ export { __niceevalExport15 as SourceItemIdSchema };
36
+ const __niceevalExport16 = __niceevalCanonical["UtcMillisSchema"];
37
+ export { __niceevalExport16 as UtcMillisSchema };
40
38
  //# sourceMappingURL=identifiers.js.map
@@ -43,48 +43,46 @@ const __niceevalExport19 = __niceevalCanonical["RecordFormatSchema"];
43
43
  export { __niceevalExport19 as RecordFormatSchema };
44
44
  const __niceevalExport20 = __niceevalCanonical["RecordIdSchema"];
45
45
  export { __niceevalExport20 as RecordIdSchema };
46
- const __niceevalExport21 = __niceevalCanonical["RecordSchemaVersionSchema"];
47
- export { __niceevalExport21 as RecordSchemaVersionSchema };
48
- const __niceevalExport22 = __niceevalCanonical["RecordSlotIdentitySchema"];
49
- export { __niceevalExport22 as RecordSlotIdentitySchema };
50
- const __niceevalExport23 = __niceevalCanonical["RunContextCurrentSchema"];
51
- export { __niceevalExport23 as RunContextCurrentSchema };
52
- const __niceevalExport24 = __niceevalCanonical["RunCoreSchema"];
53
- export { __niceevalExport24 as RunCoreSchema };
54
- const __niceevalExport25 = __niceevalCanonical["RunDocumentSchema"];
55
- export { __niceevalExport25 as RunDocumentSchema };
56
- const __niceevalExport26 = __niceevalCanonical["RunIdSchema"];
57
- export { __niceevalExport26 as RunIdSchema };
58
- const __niceevalExport27 = __niceevalCanonical["Sha256DigestSchema"];
59
- export { __niceevalExport27 as Sha256DigestSchema };
60
- const __niceevalExport28 = __niceevalCanonical["SlotIdSchema"];
61
- export { __niceevalExport28 as SlotIdSchema };
62
- const __niceevalExport29 = __niceevalCanonical["SourceItemIdSchema"];
63
- export { __niceevalExport29 as SourceItemIdSchema };
64
- const __niceevalExport30 = __niceevalCanonical["UtcMillisSchema"];
65
- export { __niceevalExport30 as UtcMillisSchema };
66
- const __niceevalExport31 = __niceevalCanonical["decodeAttemptDocument"];
67
- export { __niceevalExport31 as decodeAttemptDocument };
68
- const __niceevalExport32 = __niceevalCanonical["decodeMemberDocument"];
69
- export { __niceevalExport32 as decodeMemberDocument };
70
- const __niceevalExport33 = __niceevalCanonical["decodeRecordAttachmentEnvelope"];
71
- export { __niceevalExport33 as decodeRecordAttachmentEnvelope };
72
- const __niceevalExport34 = __niceevalCanonical["decodeRecordCore"];
73
- export { __niceevalExport34 as decodeRecordCore };
74
- const __niceevalExport35 = __niceevalCanonical["decodeRecordDocument"];
75
- export { __niceevalExport35 as decodeRecordDocument };
76
- const __niceevalExport36 = __niceevalCanonical["decodeRunDocument"];
77
- export { __niceevalExport36 as decodeRunDocument };
78
- const __niceevalExport37 = __niceevalCanonical["encodeAttemptDocument"];
79
- export { __niceevalExport37 as encodeAttemptDocument };
80
- const __niceevalExport38 = __niceevalCanonical["encodeMemberDocument"];
81
- export { __niceevalExport38 as encodeMemberDocument };
82
- const __niceevalExport39 = __niceevalCanonical["encodeRecordAttachmentEnvelope"];
83
- export { __niceevalExport39 as encodeRecordAttachmentEnvelope };
84
- const __niceevalExport40 = __niceevalCanonical["encodeRecordCore"];
85
- export { __niceevalExport40 as encodeRecordCore };
86
- const __niceevalExport41 = __niceevalCanonical["encodeRecordDocument"];
87
- export { __niceevalExport41 as encodeRecordDocument };
88
- const __niceevalExport42 = __niceevalCanonical["encodeRunDocument"];
89
- export { __niceevalExport42 as encodeRunDocument };
46
+ const __niceevalExport21 = __niceevalCanonical["RecordSlotIdentitySchema"];
47
+ export { __niceevalExport21 as RecordSlotIdentitySchema };
48
+ const __niceevalExport22 = __niceevalCanonical["RunContextCurrentSchema"];
49
+ export { __niceevalExport22 as RunContextCurrentSchema };
50
+ const __niceevalExport23 = __niceevalCanonical["RunCoreSchema"];
51
+ export { __niceevalExport23 as RunCoreSchema };
52
+ const __niceevalExport24 = __niceevalCanonical["RunDocumentSchema"];
53
+ export { __niceevalExport24 as RunDocumentSchema };
54
+ const __niceevalExport25 = __niceevalCanonical["RunIdSchema"];
55
+ export { __niceevalExport25 as RunIdSchema };
56
+ const __niceevalExport26 = __niceevalCanonical["Sha256DigestSchema"];
57
+ export { __niceevalExport26 as Sha256DigestSchema };
58
+ const __niceevalExport27 = __niceevalCanonical["SlotIdSchema"];
59
+ export { __niceevalExport27 as SlotIdSchema };
60
+ const __niceevalExport28 = __niceevalCanonical["SourceItemIdSchema"];
61
+ export { __niceevalExport28 as SourceItemIdSchema };
62
+ const __niceevalExport29 = __niceevalCanonical["UtcMillisSchema"];
63
+ export { __niceevalExport29 as UtcMillisSchema };
64
+ const __niceevalExport30 = __niceevalCanonical["decodeAttemptDocument"];
65
+ export { __niceevalExport30 as decodeAttemptDocument };
66
+ const __niceevalExport31 = __niceevalCanonical["decodeMemberDocument"];
67
+ export { __niceevalExport31 as decodeMemberDocument };
68
+ const __niceevalExport32 = __niceevalCanonical["decodeRecordAttachmentEnvelope"];
69
+ export { __niceevalExport32 as decodeRecordAttachmentEnvelope };
70
+ const __niceevalExport33 = __niceevalCanonical["decodeRecordCore"];
71
+ export { __niceevalExport33 as decodeRecordCore };
72
+ const __niceevalExport34 = __niceevalCanonical["decodeRecordDocument"];
73
+ export { __niceevalExport34 as decodeRecordDocument };
74
+ const __niceevalExport35 = __niceevalCanonical["decodeRunDocument"];
75
+ export { __niceevalExport35 as decodeRunDocument };
76
+ const __niceevalExport36 = __niceevalCanonical["encodeAttemptDocument"];
77
+ export { __niceevalExport36 as encodeAttemptDocument };
78
+ const __niceevalExport37 = __niceevalCanonical["encodeMemberDocument"];
79
+ export { __niceevalExport37 as encodeMemberDocument };
80
+ const __niceevalExport38 = __niceevalCanonical["encodeRecordAttachmentEnvelope"];
81
+ export { __niceevalExport38 as encodeRecordAttachmentEnvelope };
82
+ const __niceevalExport39 = __niceevalCanonical["encodeRecordCore"];
83
+ export { __niceevalExport39 as encodeRecordCore };
84
+ const __niceevalExport40 = __niceevalCanonical["encodeRecordDocument"];
85
+ export { __niceevalExport40 as encodeRecordDocument };
86
+ const __niceevalExport41 = __niceevalCanonical["encodeRunDocument"];
87
+ export { __niceevalExport41 as encodeRunDocument };
90
88
  //# sourceMappingURL=index.js.map
@@ -73,6 +73,7 @@ function defineRecordAttachment(input) {
73
73
  link.fromSchemaVersion <= 0 ||
74
74
  link.toSchemaVersion !== link.fromSchemaVersion + 1 ||
75
75
  link.toSchemaVersion > input.current.schemaVersion ||
76
+ typeof link.rewritePayload !== "boolean" ||
76
77
  migrationStarts.has(link.fromSchemaVersion)) {
77
78
  throw new TypeError("Record Attachment migration links must be unique adjacent upgrades to current history");
78
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.js","sourceRoot":"","sources":["attachment.ts"],"names":[],"mappings":";;AAyGA,8EAEC;AAKD,wDAyDC;AAxKD,2DAAsG;AAGtG,uDAA+G;AAC/G,MAAM,qCAAqC,GAAkB,MAAM,CAAC,kDAAkD,CAAC,CAAC;AACxH,MAAM,cAAc,GAAG,IAAI,OAAO,EAAU,CAAC;AAyD7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,CAAC,CAAC;QAC/B,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,SAAS,CAAC,+DAA+D,CAAC,CAAC;QACzF,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;YACnB,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa;YAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAA6C;SAC9E,CAAC;QACF,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,sBAAsB,EAAE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;KAC1G,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Schema } from \"effect\";\nimport { RecordBlobRefSchema, isRecordBlobRef, type RecordBlobRef, } from \"../attachment/blob-ref.ts\";\nimport type { RecordAttachmentBlobBudget, RecordAttachmentBlobRefs, RecordAttachmentMaterializedRefine, } from \"../attachment/blob-policy.ts\";\nimport type { RecordAttachmentOwner } from \"../model/core.ts\";\nimport { compileRecordSchemaCodec, type RecordSchemaCodec, type RecordSchemaLimits, } from \"./schema-codec.ts\";\nconst recordAttachmentOwnerDefinitionTypeId: unique symbol = Symbol(\"@niceeval/record/RecordAttachmentOwnerDefinition\");\nconst compiledOwners = new WeakSet<object>();\nexport type { RecordAttachmentOwner } from \"../model/core.ts\";\nexport interface RecordAttachmentOwnerInput<SourceSchema extends Schema.Schema.AnyNoContext = Schema.Schema.AnyNoContext> {\n readonly schema: SourceSchema;\n readonly limits: RecordSchemaLimits;\n readonly blobs: Readonly<{\n readonly refs: RecordAttachmentBlobRefs<Schema.Schema.Type<SourceSchema>>;\n readonly budget: RecordAttachmentBlobBudget;\n readonly verify: RecordAttachmentMaterializedRefine<Schema.Schema.Type<SourceSchema>>;\n }>;\n}\nexport type RecordAttachmentOwnerInputs = Readonly<Partial<Record<RecordAttachmentOwner, RecordAttachmentOwnerInput<Schema.Schema.AnyNoContext>>>>;\n/** One owner compiled exactly once from a fixed family declaration. */\nexport interface RecordAttachmentOwnerDefinition<Owner extends RecordAttachmentOwner, Payload, SourceSchema extends Schema.Schema.AnyNoContext = Schema.Schema.AnyNoContext> {\n readonly family: string;\n readonly schemaVersion: number;\n readonly owner: Owner;\n readonly codec: RecordSchemaCodec<Payload, RecordBlobRef, SourceSchema>;\n readonly refs: RecordAttachmentBlobRefs<Payload>;\n readonly budget: RecordAttachmentBlobBudget;\n readonly verify: RecordAttachmentMaterializedRefine<Payload>;\n readonly [recordAttachmentOwnerDefinitionTypeId]: () => void;\n}\ntype OwnerDefinitionFor<Owner extends RecordAttachmentOwner, Input> = Input extends RecordAttachmentOwnerInput<infer SourceSchema> ? RecordAttachmentOwnerDefinition<Owner, Schema.Schema.Type<SourceSchema>, SourceSchema> : never;\nexport type RecordAttachmentOwnerDefinitions<Owners extends RecordAttachmentOwnerInputs> = Readonly<{\n readonly [Owner in keyof Owners]: Owner extends RecordAttachmentOwner ? OwnerDefinitionFor<Owner, Owners[Owner]> : never;\n}>;\n/** Historical codecs stay opaque to the current import graph until maintenance asks for them. */\nexport interface RecordAttachmentHistoricalCodec {\n readonly schemaVersion: number;\n readonly decode: (input: unknown) => unknown;\n}\n/** Only adjacent, package-owned migrations may be declared for a fixed family. */\nexport interface RecordAttachmentAdjacentMigration {\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly migrate: (input: unknown) => unknown;\n}\n/** Eager metadata only: implementation remains behind `maintenance`. */\nexport interface RecordAttachmentAdjacentMigrationLink {\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n}\nexport interface RecordAttachmentMaintenanceFacet {\n /** Historical codecs and adjacent migrations remain behind this lazy boundary. */\n readonly historicalCodecs: readonly RecordAttachmentHistoricalCodec[];\n readonly adjacentMigrations: readonly RecordAttachmentAdjacentMigration[];\n}\nexport interface RecordAttachmentDefinition<out Family extends string = string, Owners extends RecordAttachmentOwnerInputs = RecordAttachmentOwnerInputs> {\n readonly family: Family;\n readonly current: Readonly<{\n readonly schemaVersion: number;\n readonly owners: RecordAttachmentOwnerDefinitions<Owners>;\n }>;\n readonly maintenance: (() => Promise<RecordAttachmentMaintenanceFacet>) | undefined;\n readonly adjacentMigrationLinks: readonly RecordAttachmentAdjacentMigrationLink[];\n}\nfunction validFamily(value: string): boolean {\n return /^niceeval\\.[a-z0-9][a-z0-9.-]*$/.test(value) && !value.includes(\"/\");\n}\nfunction validBlobBudget(value: unknown): value is RecordAttachmentBlobBudget {\n if (typeof value !== \"object\" || value === null)\n return false;\n const budget = value as Record<string, unknown>;\n return [budget.maximumBlobs, budget.maximumBlobBytes, budget.maximumTotalBytes]\n .every((limit) => Number.isSafeInteger(limit) && (limit as number) > 0);\n}\nfunction compileOwner<Owner extends RecordAttachmentOwner, SourceSchema extends Schema.Schema.AnyNoContext>(family: string, schemaVersion: number, owner: Owner, input: RecordAttachmentOwnerInput<SourceSchema>): RecordAttachmentOwnerDefinition<Owner, Schema.Schema.Type<SourceSchema>, SourceSchema> {\n if (typeof input !== \"object\" ||\n input === null ||\n typeof input.blobs !== \"object\" ||\n input.blobs === null ||\n typeof input.blobs.refs !== \"function\" ||\n !validBlobBudget(input.blobs.budget) ||\n typeof input.blobs.verify !== \"function\") {\n throw new TypeError(\"Record Attachment owners must declare a bounded blob policy\");\n }\n const codec = compileRecordSchemaCodec({\n schema: input.schema,\n limits: input.limits,\n blobRef: {\n schema: RecordBlobRefSchema,\n isBlobRef: isRecordBlobRef,\n },\n });\n const definition: RecordAttachmentOwnerDefinition<Owner, Schema.Schema.Type<SourceSchema>, SourceSchema> = {\n family,\n schemaVersion,\n owner,\n codec,\n refs: input.blobs.refs,\n budget: Object.freeze({ ...input.blobs.budget }),\n verify: input.blobs.verify,\n [recordAttachmentOwnerDefinitionTypeId]: () => undefined,\n };\n compiledOwners.add(definition);\n return Object.freeze(definition);\n}\n/** @internal Runtime factories accept only owners minted by defineRecordAttachment. */\nexport function isRecordAttachmentOwnerDefinition(value: unknown): value is RecordAttachmentOwnerDefinition<RecordAttachmentOwner, unknown> {\n return typeof value === \"object\" && value !== null && compiledOwners.has(value);\n}\n/**\n * NiceEval-only fixed-family declaration. It stores no registry and exposes no\n * plugin hook: the static catalog is assembled by package code alone.\n */\nexport function defineRecordAttachment<const Family extends string, const Owners extends RecordAttachmentOwnerInputs>(input: {\n readonly family: Family;\n readonly current: {\n readonly schemaVersion: number;\n readonly owners: Owners;\n };\n readonly maintenance?: () => Promise<RecordAttachmentMaintenanceFacet>;\n readonly adjacentMigrationLinks?: readonly RecordAttachmentAdjacentMigrationLink[];\n}): RecordAttachmentDefinition<Family, Owners> {\n if (!validFamily(input.family)) {\n throw new TypeError(\"Record Attachment family must be a stable niceeval.* identity without a version suffix\");\n }\n if (!Number.isSafeInteger(input.current.schemaVersion) || input.current.schemaVersion <= 0) {\n throw new TypeError(\"Record Attachment schemaVersion must be a positive safe integer\");\n }\n if (input.maintenance !== undefined && typeof input.maintenance !== \"function\") {\n throw new TypeError(\"Record Attachment maintenance must be a lazy function\");\n }\n const adjacentMigrationLinks = input.adjacentMigrationLinks ?? Object.freeze([]);\n const migrationStarts = new Set<number>();\n for (const link of adjacentMigrationLinks) {\n if (!Number.isSafeInteger(link.fromSchemaVersion) ||\n !Number.isSafeInteger(link.toSchemaVersion) ||\n link.fromSchemaVersion <= 0 ||\n link.toSchemaVersion !== link.fromSchemaVersion + 1 ||\n link.toSchemaVersion > input.current.schemaVersion ||\n migrationStarts.has(link.fromSchemaVersion)) {\n throw new TypeError(\"Record Attachment migration links must be unique adjacent upgrades to current history\");\n }\n migrationStarts.add(link.fromSchemaVersion);\n }\n if (adjacentMigrationLinks.length > 0 && input.maintenance === undefined) {\n throw new TypeError(\"Record Attachment migration links require a lazy maintenance implementation\");\n }\n const keys = Reflect.ownKeys(input.current.owners);\n if (keys.length === 0 ||\n keys.some((key) => key !== \"attempt\" && key !== \"run\")) {\n throw new TypeError(\"Record Attachment owners may contain only attempt and run\");\n }\n const owners = input.current.owners as RecordAttachmentOwnerInputs;\n const compiled: Partial<Record<RecordAttachmentOwner, RecordAttachmentOwnerDefinition<RecordAttachmentOwner, unknown>>> = {};\n for (const key of keys as readonly RecordAttachmentOwner[]) {\n const ownerInput = owners[key];\n if (ownerInput === undefined) {\n throw new TypeError(\"Record Attachment owners must have one schema and blob policy\");\n }\n compiled[key] = compileOwner(input.family, input.current.schemaVersion, key, ownerInput);\n }\n return Object.freeze({\n family: input.family,\n current: Object.freeze({\n schemaVersion: input.current.schemaVersion,\n owners: Object.freeze(compiled) as RecordAttachmentOwnerDefinitions<Owners>,\n }),\n maintenance: input.maintenance,\n adjacentMigrationLinks: Object.freeze(adjacentMigrationLinks.map((link) => Object.freeze({ ...link }))),\n });\n}\n"]}
1
+ {"version":3,"file":"attachment.js","sourceRoot":"","sources":["attachment.ts"],"names":[],"mappings":";;AAuHA,8EAEC;AAKD,wDA0DC;AAvLD,2DAAsG;AAGtG,uDAA+G;AAC/G,MAAM,qCAAqC,GAAkB,MAAM,CAAC,kDAAkD,CAAC,CAAC;AACxH,MAAM,cAAc,GAAG,IAAI,OAAO,EAAU,CAAC;AAuE7C,SAAS,WAAW,CAAC,KAAa;IAC9B,OAAO,iCAAiC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACjF,CAAC;AACD,SAAS,eAAe,CAAC,KAAc;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KA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C,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;YACnB,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa;YAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAA6C;SAC9E,CAAC;QACF,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,sBAAsB,EAAE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;KAC1G,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Schema } from \"effect\";\nimport { RecordBlobRefSchema, isRecordBlobRef, type RecordBlobRef, } from \"../attachment/blob-ref.ts\";\nimport type { RecordAttachmentBlobBudget, RecordAttachmentBlobRefs, RecordAttachmentMaterializedRefine, } from \"../attachment/blob-policy.ts\";\nimport type { RecordAttachmentOwner } from \"../model/core.ts\";\nimport { compileRecordSchemaCodec, type RecordSchemaCodec, type RecordSchemaLimits, } from \"./schema-codec.ts\";\nconst recordAttachmentOwnerDefinitionTypeId: unique symbol = Symbol(\"@niceeval/record/RecordAttachmentOwnerDefinition\");\nconst compiledOwners = new WeakSet<object>();\nexport type { RecordAttachmentOwner } from \"../model/core.ts\";\nexport interface RecordAttachmentOwnerInput<SourceSchema extends Schema.Schema.AnyNoContext = Schema.Schema.AnyNoContext> {\n readonly schema: SourceSchema;\n readonly limits: RecordSchemaLimits;\n readonly blobs: Readonly<{\n readonly refs: RecordAttachmentBlobRefs<Schema.Schema.Type<SourceSchema>>;\n readonly budget: RecordAttachmentBlobBudget;\n readonly verify: RecordAttachmentMaterializedRefine<Schema.Schema.Type<SourceSchema>>;\n }>;\n}\nexport type RecordAttachmentOwnerInputs = Readonly<Partial<Record<RecordAttachmentOwner, RecordAttachmentOwnerInput<Schema.Schema.AnyNoContext>>>>;\n/** One owner compiled exactly once from a fixed family declaration. */\nexport interface RecordAttachmentOwnerDefinition<Owner extends RecordAttachmentOwner, Payload, SourceSchema extends Schema.Schema.AnyNoContext = Schema.Schema.AnyNoContext> {\n readonly family: string;\n readonly schemaVersion: number;\n readonly owner: Owner;\n readonly codec: RecordSchemaCodec<Payload, RecordBlobRef, SourceSchema>;\n readonly refs: RecordAttachmentBlobRefs<Payload>;\n readonly budget: RecordAttachmentBlobBudget;\n readonly verify: RecordAttachmentMaterializedRefine<Payload>;\n readonly [recordAttachmentOwnerDefinitionTypeId]: () => void;\n}\ntype OwnerDefinitionFor<Owner extends RecordAttachmentOwner, Input> = Input extends RecordAttachmentOwnerInput<infer SourceSchema> ? RecordAttachmentOwnerDefinition<Owner, Schema.Schema.Type<SourceSchema>, SourceSchema> : never;\nexport type RecordAttachmentOwnerDefinitions<Owners extends RecordAttachmentOwnerInputs> = Readonly<{\n readonly [Owner in keyof Owners]: Owner extends RecordAttachmentOwner ? OwnerDefinitionFor<Owner, Owners[Owner]> : never;\n}>;\n/** Historical codecs stay opaque to the current import graph until maintenance asks for them. */\nexport interface RecordAttachmentHistoricalCodec {\n readonly schemaVersion: number;\n readonly decode: (input: unknown) => unknown;\n /** Optional historical own-blob integrity check, run before a lossy transform. */\n readonly verify?: (payload: unknown, blobs: readonly {\n readonly ref: RecordBlobRef;\n readonly bytes: Uint8Array;\n }[]) => boolean;\n}\n/** Only adjacent, package-owned migrations may be declared for a fixed family. */\nexport interface RecordAttachmentAdjacentMigration {\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n /** User-visible semantic impact shared by plan and receipt surfaces. */\n readonly retention: RecordAttachmentMigrationRetention;\n readonly migrate: (input: unknown) => unknown;\n}\nexport interface RecordAttachmentMigrationRetention {\n readonly retainedFacts: readonly string[];\n readonly droppedFacts: readonly string[];\n readonly rerunRecommendation: string | null;\n}\n/** Eager metadata only: implementation remains behind `maintenance`. */\nexport interface RecordAttachmentAdjacentMigrationLink {\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n /** Physical plan metadata shared by planning, execution, and interrupted recovery. */\n readonly rewritePayload: boolean;\n}\nexport interface RecordAttachmentMaintenanceFacet {\n /** Historical codecs and adjacent migrations remain behind this lazy boundary. */\n readonly historicalCodecs: readonly RecordAttachmentHistoricalCodec[];\n readonly adjacentMigrations: readonly RecordAttachmentAdjacentMigration[];\n}\nexport interface RecordAttachmentDefinition<out Family extends string = string, Owners extends RecordAttachmentOwnerInputs = RecordAttachmentOwnerInputs> {\n readonly family: Family;\n readonly current: Readonly<{\n readonly schemaVersion: number;\n readonly owners: RecordAttachmentOwnerDefinitions<Owners>;\n }>;\n readonly maintenance: (() => Promise<RecordAttachmentMaintenanceFacet>) | undefined;\n readonly adjacentMigrationLinks: readonly RecordAttachmentAdjacentMigrationLink[];\n}\nfunction validFamily(value: string): boolean {\n return /^niceeval\\.[a-z0-9][a-z0-9.-]*$/.test(value) && !value.includes(\"/\");\n}\nfunction validBlobBudget(value: unknown): value is RecordAttachmentBlobBudget {\n if (typeof value !== \"object\" || value === null)\n return false;\n const budget = value as Record<string, unknown>;\n return [budget.maximumBlobs, budget.maximumBlobBytes, budget.maximumTotalBytes]\n .every((limit) => Number.isSafeInteger(limit) && (limit as number) > 0);\n}\nfunction compileOwner<Owner extends RecordAttachmentOwner, SourceSchema extends Schema.Schema.AnyNoContext>(family: string, schemaVersion: number, owner: Owner, input: RecordAttachmentOwnerInput<SourceSchema>): RecordAttachmentOwnerDefinition<Owner, Schema.Schema.Type<SourceSchema>, SourceSchema> {\n if (typeof input !== \"object\" ||\n input === null ||\n typeof input.blobs !== \"object\" ||\n input.blobs === null ||\n typeof input.blobs.refs !== \"function\" ||\n !validBlobBudget(input.blobs.budget) ||\n typeof input.blobs.verify !== \"function\") {\n throw new TypeError(\"Record Attachment owners must declare a bounded blob policy\");\n }\n const codec = compileRecordSchemaCodec({\n schema: input.schema,\n limits: input.limits,\n blobRef: {\n schema: RecordBlobRefSchema,\n isBlobRef: isRecordBlobRef,\n },\n });\n const definition: RecordAttachmentOwnerDefinition<Owner, Schema.Schema.Type<SourceSchema>, SourceSchema> = {\n family,\n schemaVersion,\n owner,\n codec,\n refs: input.blobs.refs,\n budget: Object.freeze({ ...input.blobs.budget }),\n verify: input.blobs.verify,\n [recordAttachmentOwnerDefinitionTypeId]: () => undefined,\n };\n compiledOwners.add(definition);\n return Object.freeze(definition);\n}\n/** @internal Runtime factories accept only owners minted by defineRecordAttachment. */\nexport function isRecordAttachmentOwnerDefinition(value: unknown): value is RecordAttachmentOwnerDefinition<RecordAttachmentOwner, unknown> {\n return typeof value === \"object\" && value !== null && compiledOwners.has(value);\n}\n/**\n * NiceEval-only fixed-family declaration. It stores no registry and exposes no\n * plugin hook: the static catalog is assembled by package code alone.\n */\nexport function defineRecordAttachment<const Family extends string, const Owners extends RecordAttachmentOwnerInputs>(input: {\n readonly family: Family;\n readonly current: {\n readonly schemaVersion: number;\n readonly owners: Owners;\n };\n readonly maintenance?: () => Promise<RecordAttachmentMaintenanceFacet>;\n readonly adjacentMigrationLinks?: readonly RecordAttachmentAdjacentMigrationLink[];\n}): RecordAttachmentDefinition<Family, Owners> {\n if (!validFamily(input.family)) {\n throw new TypeError(\"Record Attachment family must be a stable niceeval.* identity without a version suffix\");\n }\n if (!Number.isSafeInteger(input.current.schemaVersion) || input.current.schemaVersion <= 0) {\n throw new TypeError(\"Record Attachment schemaVersion must be a positive safe integer\");\n }\n if (input.maintenance !== undefined && typeof input.maintenance !== \"function\") {\n throw new TypeError(\"Record Attachment maintenance must be a lazy function\");\n }\n const adjacentMigrationLinks = input.adjacentMigrationLinks ?? Object.freeze([]);\n const migrationStarts = new Set<number>();\n for (const link of adjacentMigrationLinks) {\n if (!Number.isSafeInteger(link.fromSchemaVersion) ||\n !Number.isSafeInteger(link.toSchemaVersion) ||\n link.fromSchemaVersion <= 0 ||\n link.toSchemaVersion !== link.fromSchemaVersion + 1 ||\n link.toSchemaVersion > input.current.schemaVersion ||\n typeof link.rewritePayload !== \"boolean\" ||\n migrationStarts.has(link.fromSchemaVersion)) {\n throw new TypeError(\"Record Attachment migration links must be unique adjacent upgrades to current history\");\n }\n migrationStarts.add(link.fromSchemaVersion);\n }\n if (adjacentMigrationLinks.length > 0 && input.maintenance === undefined) {\n throw new TypeError(\"Record Attachment migration links require a lazy maintenance implementation\");\n }\n const keys = Reflect.ownKeys(input.current.owners);\n if (keys.length === 0 ||\n keys.some((key) => key !== \"attempt\" && key !== \"run\")) {\n throw new TypeError(\"Record Attachment owners may contain only attempt and run\");\n }\n const owners = input.current.owners as RecordAttachmentOwnerInputs;\n const compiled: Partial<Record<RecordAttachmentOwner, RecordAttachmentOwnerDefinition<RecordAttachmentOwner, unknown>>> = {};\n for (const key of keys as readonly RecordAttachmentOwner[]) {\n const ownerInput = owners[key];\n if (ownerInput === undefined) {\n throw new TypeError(\"Record Attachment owners must have one schema and blob policy\");\n }\n compiled[key] = compileOwner(input.family, input.current.schemaVersion, key, ownerInput);\n }\n return Object.freeze({\n family: input.family,\n current: Object.freeze({\n schemaVersion: input.current.schemaVersion,\n owners: Object.freeze(compiled) as RecordAttachmentOwnerDefinitions<Owners>,\n }),\n maintenance: input.maintenance,\n adjacentMigrationLinks: Object.freeze(adjacentMigrationLinks.map((link) => Object.freeze({ ...link }))),\n });\n}\n"]}
@@ -34,17 +34,31 @@ export type RecordAttachmentOwnerDefinitions<Owners extends RecordAttachmentOwne
34
34
  export interface RecordAttachmentHistoricalCodec {
35
35
  readonly schemaVersion: number;
36
36
  readonly decode: (input: unknown) => unknown;
37
+ /** Optional historical own-blob integrity check, run before a lossy transform. */
38
+ readonly verify?: (payload: unknown, blobs: readonly {
39
+ readonly ref: RecordBlobRef;
40
+ readonly bytes: Uint8Array;
41
+ }[]) => boolean;
37
42
  }
38
43
  /** Only adjacent, package-owned migrations may be declared for a fixed family. */
39
44
  export interface RecordAttachmentAdjacentMigration {
40
45
  readonly fromSchemaVersion: number;
41
46
  readonly toSchemaVersion: number;
47
+ /** User-visible semantic impact shared by plan and receipt surfaces. */
48
+ readonly retention: RecordAttachmentMigrationRetention;
42
49
  readonly migrate: (input: unknown) => unknown;
43
50
  }
51
+ export interface RecordAttachmentMigrationRetention {
52
+ readonly retainedFacts: readonly string[];
53
+ readonly droppedFacts: readonly string[];
54
+ readonly rerunRecommendation: string | null;
55
+ }
44
56
  /** Eager metadata only: implementation remains behind `maintenance`. */
45
57
  export interface RecordAttachmentAdjacentMigrationLink {
46
58
  readonly fromSchemaVersion: number;
47
59
  readonly toSchemaVersion: number;
60
+ /** Physical plan metadata shared by planning, execution, and interrupted recovery. */
61
+ readonly rewritePayload: boolean;
48
62
  }
49
63
  export interface RecordAttachmentMaintenanceFacet {
50
64
  /** Historical codecs and adjacent migrations remain behind this lazy boundary. */
@@ -34,17 +34,31 @@ export type RecordAttachmentOwnerDefinitions<Owners extends RecordAttachmentOwne
34
34
  export interface RecordAttachmentHistoricalCodec {
35
35
  readonly schemaVersion: number;
36
36
  readonly decode: (input: unknown) => unknown;
37
+ /** Optional historical own-blob integrity check, run before a lossy transform. */
38
+ readonly verify?: (payload: unknown, blobs: readonly {
39
+ readonly ref: RecordBlobRef;
40
+ readonly bytes: Uint8Array;
41
+ }[]) => boolean;
37
42
  }
38
43
  /** Only adjacent, package-owned migrations may be declared for a fixed family. */
39
44
  export interface RecordAttachmentAdjacentMigration {
40
45
  readonly fromSchemaVersion: number;
41
46
  readonly toSchemaVersion: number;
47
+ /** User-visible semantic impact shared by plan and receipt surfaces. */
48
+ readonly retention: RecordAttachmentMigrationRetention;
42
49
  readonly migrate: (input: unknown) => unknown;
43
50
  }
51
+ export interface RecordAttachmentMigrationRetention {
52
+ readonly retainedFacts: readonly string[];
53
+ readonly droppedFacts: readonly string[];
54
+ readonly rerunRecommendation: string | null;
55
+ }
44
56
  /** Eager metadata only: implementation remains behind `maintenance`. */
45
57
  export interface RecordAttachmentAdjacentMigrationLink {
46
58
  readonly fromSchemaVersion: number;
47
59
  readonly toSchemaVersion: number;
60
+ /** Physical plan metadata shared by planning, execution, and interrupted recovery. */
61
+ readonly rewritePayload: boolean;
48
62
  }
49
63
  export interface RecordAttachmentMaintenanceFacet {
50
64
  /** Historical codecs and adjacent migrations remain behind this lazy boundary. */
@@ -34,17 +34,31 @@ export type RecordAttachmentOwnerDefinitions<Owners extends RecordAttachmentOwne
34
34
  export interface RecordAttachmentHistoricalCodec {
35
35
  readonly schemaVersion: number;
36
36
  readonly decode: (input: unknown) => unknown;
37
+ /** Optional historical own-blob integrity check, run before a lossy transform. */
38
+ readonly verify?: (payload: unknown, blobs: readonly {
39
+ readonly ref: RecordBlobRef;
40
+ readonly bytes: Uint8Array;
41
+ }[]) => boolean;
37
42
  }
38
43
  /** Only adjacent, package-owned migrations may be declared for a fixed family. */
39
44
  export interface RecordAttachmentAdjacentMigration {
40
45
  readonly fromSchemaVersion: number;
41
46
  readonly toSchemaVersion: number;
47
+ /** User-visible semantic impact shared by plan and receipt surfaces. */
48
+ readonly retention: RecordAttachmentMigrationRetention;
42
49
  readonly migrate: (input: unknown) => unknown;
43
50
  }
51
+ export interface RecordAttachmentMigrationRetention {
52
+ readonly retainedFacts: readonly string[];
53
+ readonly droppedFacts: readonly string[];
54
+ readonly rerunRecommendation: string | null;
55
+ }
44
56
  /** Eager metadata only: implementation remains behind `maintenance`. */
45
57
  export interface RecordAttachmentAdjacentMigrationLink {
46
58
  readonly fromSchemaVersion: number;
47
59
  readonly toSchemaVersion: number;
60
+ /** Physical plan metadata shared by planning, execution, and interrupted recovery. */
61
+ readonly rewritePayload: boolean;
48
62
  }
49
63
  export interface RecordAttachmentMaintenanceFacet {
50
64
  /** Historical codecs and adjacent migrations remain behind this lazy boundary. */
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertionsV1Maintenance = void 0;
4
+ const node_crypto_1 = require("node:crypto");
5
+ const effect_1 = require("effect");
6
+ const core_ts_1 = require("../codec/core.cjs");
7
+ const assertions_ts_1 = require("./assertions.cjs");
8
+ function parseAssertionsV1(value) {
9
+ const decoded = effect_1.Schema.decodeUnknownEither(assertions_ts_1.AssertionsAttachmentV1Schema, core_ts_1.RecordExactParseOptions)(value);
10
+ if (effect_1.Either.isLeft(decoded))
11
+ throw new Error("Assertions v1 payload is invalid");
12
+ return decoded.right;
13
+ }
14
+ function decodeAssertionsV1(value) {
15
+ parseAssertionsV1(value);
16
+ return value;
17
+ }
18
+ /** Pure adjacent payload transform. Record maintenance exclusively owns physical I/O. */
19
+ function migrateAssertionsV1(value) {
20
+ const previous = parseAssertionsV1(value);
21
+ const migrated = Object.freeze({
22
+ "entries-data": Object.freeze(previous.entries.map((entry) => Object.freeze({
23
+ entryId: entry.entryId,
24
+ display: entry.display,
25
+ criterion: Object.freeze({ state: "unavailable", reason: "not-recorded" }),
26
+ materials: Object.freeze({
27
+ source: Object.freeze({ kind: "unavailable", reason: "not-recorded" }),
28
+ evidence: Object.freeze([]),
29
+ coverage: Object.freeze({ state: "unavailable", reason: "not-collected" }),
30
+ limitations: Object.freeze([]),
31
+ }),
32
+ evaluation: Object.freeze({
33
+ observed: Object.freeze({ kind: "unavailable", reason: "not-recorded" }),
34
+ }),
35
+ decision: Object.freeze({
36
+ result: entry.result.state,
37
+ reason: "reason" in entry.result ? entry.result.reason : null,
38
+ gate: entry.result.gate,
39
+ }),
40
+ policy: Object.freeze({
41
+ requirement: entry.result.gate === "not-gate"
42
+ ? Object.freeze({ state: "unavailable", reason: "not-recorded" })
43
+ : Object.freeze({ state: "available", value: "required" }),
44
+ condition: Object.freeze({ state: "unavailable", reason: "not-recorded" }),
45
+ }),
46
+ contribution: entry.result.score,
47
+ explanationRetention: Object.freeze({ state: "unavailable", reason: "not-recorded" }),
48
+ }))),
49
+ "source-sites-data": previous.sourceSites,
50
+ });
51
+ const decoded = effect_1.Schema.decodeUnknownEither(assertions_ts_1.AssertionsAttachmentSchema, core_ts_1.RecordExactParseOptions)(migrated);
52
+ if (effect_1.Either.isLeft(decoded)) {
53
+ throw new Error(`Assertions v1 migration did not produce a current payload: ${effect_1.ParseResult.TreeFormatter.formatErrorSync(decoded.left)}`);
54
+ }
55
+ return migrated;
56
+ }
57
+ exports.assertionsV1Maintenance = Object.freeze({
58
+ historicalCodecs: Object.freeze([
59
+ Object.freeze({
60
+ schemaVersion: 1,
61
+ decode: decodeAssertionsV1,
62
+ verify: (payload, blobs) => {
63
+ const previous = parseAssertionsV1(payload);
64
+ const byRef = new Map(blobs.map((blob) => [blob.ref, blob.bytes]));
65
+ const materials = previous.entries.flatMap((entry) => [entry.subject, ...entry.evidence]);
66
+ return materials.every((material) => {
67
+ if (material.kind !== "blob")
68
+ return true;
69
+ const bytes = byRef.get(material.ref);
70
+ return bytes !== undefined &&
71
+ bytes.byteLength === material.byteLength &&
72
+ (0, node_crypto_1.createHash)("sha256").update(bytes).digest("hex") === material.sha256;
73
+ });
74
+ },
75
+ }),
76
+ ]),
77
+ adjacentMigrations: Object.freeze([
78
+ Object.freeze({
79
+ fromSchemaVersion: 1,
80
+ toSchemaVersion: 2,
81
+ retention: Object.freeze({
82
+ retainedFacts: Object.freeze([
83
+ "display",
84
+ "decision",
85
+ "provable-policy",
86
+ "contribution",
87
+ "source-sites",
88
+ ]),
89
+ droppedFacts: Object.freeze([
90
+ "criterion",
91
+ "subject",
92
+ "evidence",
93
+ "coverage",
94
+ "limitations",
95
+ "result.diagnostic",
96
+ "result.receipt",
97
+ ]),
98
+ rerunRecommendation: "Rerun the affected evaluation to collect current assertion facts.",
99
+ }),
100
+ migrate: migrateAssertionsV1,
101
+ }),
102
+ ]),
103
+ });
104
+ //# sourceMappingURL=assertions-v1.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions-v1.js","sourceRoot":"","sources":["ass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ACxC,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,MAAM,CAAC;gBAC7E,CAAC,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;KACL,CAAC;IACF,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC;QAC9B,MAAM,CAAC,MAAM,CAAC;YACV,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;gBACrB,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;oBACzB,SAAS;oBACT,UAAU;oBACV,iBAAiB;oBACjB,cAAc;oBACd,cAAc;iBACjB,CAAC;gBACF,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;oBACxB,WAAW;oBACX,SAAS;oBACT,UAAU;oBACV,UAAU;oBACV,aAAa;oBACb,mBAAmB;oBACnB,gBAAgB;iBACnB,CAAC;gBACF,mBAAmB,EAAE,mEAAmE;aAC3F,CAAC;YACF,OAAO,EAAE,mBAAmB;SAC/B,CAAC;KACL,CAAC;CACL,CAAC,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { Either, ParseResult, Schema } from \"effect\";\nimport type { RecordBlobRef } from \"../attachment/blob-ref.ts\";\nimport { RecordExactParseOptions } from \"../codec/core.ts\";\nimport type { RecordAttachmentMaintenanceFacet } from \"../definition/attachment.ts\";\nimport { AssertionsAttachmentSchema, AssertionsAttachmentV1Schema } from \"./assertions.ts\";\nfunction parseAssertionsV1(value: unknown): Schema.Schema.Type<typeof AssertionsAttachmentV1Schema> {\n const decoded = Schema.decodeUnknownEither(AssertionsAttachmentV1Schema, RecordExactParseOptions)(value);\n if (Either.isLeft(decoded))\n throw new Error(\"Assertions v1 payload is invalid\");\n return decoded.right;\n}\nfunction decodeAssertionsV1(value: unknown): unknown {\n parseAssertionsV1(value);\n return value;\n}\n/** Pure adjacent payload transform. Record maintenance exclusively owns physical I/O. */\nfunction migrateAssertionsV1(value: unknown): unknown {\n const previous = parseAssertionsV1(value);\n const migrated = Object.freeze({\n \"entries-data\": Object.freeze(previous.entries.map((entry) => Object.freeze({\n entryId: entry.entryId,\n display: entry.display,\n criterion: Object.freeze({ state: \"unavailable\" as const, reason: \"not-recorded\" as const }),\n materials: Object.freeze({\n source: Object.freeze({ kind: \"unavailable\" as const, reason: \"not-recorded\" as const }),\n evidence: Object.freeze([]),\n coverage: Object.freeze({ state: \"unavailable\" as const, reason: \"not-collected\" as const }),\n limitations: Object.freeze([]),\n }),\n evaluation: Object.freeze({\n observed: Object.freeze({ kind: \"unavailable\" as const, reason: \"not-recorded\" as const }),\n }),\n decision: Object.freeze({\n result: entry.result.state,\n reason: \"reason\" in entry.result ? entry.result.reason : null,\n gate: entry.result.gate,\n }),\n policy: Object.freeze({\n requirement: entry.result.gate === \"not-gate\"\n ? Object.freeze({ state: \"unavailable\" as const, reason: \"not-recorded\" as const })\n : Object.freeze({ state: \"available\" as const, value: \"required\" as const }),\n condition: Object.freeze({ state: \"unavailable\" as const, reason: \"not-recorded\" as const }),\n }),\n contribution: entry.result.score,\n explanationRetention: Object.freeze({ state: \"unavailable\" as const, reason: \"not-recorded\" as const }),\n }))),\n \"source-sites-data\": previous.sourceSites,\n });\n const decoded = Schema.decodeUnknownEither(AssertionsAttachmentSchema, RecordExactParseOptions)(migrated);\n if (Either.isLeft(decoded)) {\n throw new Error(`Assertions v1 migration did not produce a current payload: ${ParseResult.TreeFormatter.formatErrorSync(decoded.left)}`);\n }\n return migrated;\n}\nexport const assertionsV1Maintenance: RecordAttachmentMaintenanceFacet = Object.freeze({\n historicalCodecs: Object.freeze([\n Object.freeze({\n schemaVersion: 1,\n decode: decodeAssertionsV1,\n verify: (payload: unknown, blobs: readonly {\n readonly ref: RecordBlobRef;\n readonly bytes: Uint8Array;\n }[]) => {\n const previous = parseAssertionsV1(payload);\n const byRef = new Map(blobs.map((blob) => [blob.ref, blob.bytes] as const));\n const materials = previous.entries.flatMap((entry) => [entry.subject, ...entry.evidence]);\n return materials.every((material) => {\n if (material.kind !== \"blob\")\n return true;\n const bytes = byRef.get(material.ref);\n return bytes !== undefined &&\n bytes.byteLength === material.byteLength &&\n createHash(\"sha256\").update(bytes).digest(\"hex\") === material.sha256;\n });\n },\n }),\n ]),\n adjacentMigrations: Object.freeze([\n Object.freeze({\n fromSchemaVersion: 1,\n toSchemaVersion: 2,\n retention: Object.freeze({\n retainedFacts: Object.freeze([\n \"display\",\n \"decision\",\n \"provable-policy\",\n \"contribution\",\n \"source-sites\",\n ]),\n droppedFacts: Object.freeze([\n \"criterion\",\n \"subject\",\n \"evidence\",\n \"coverage\",\n \"limitations\",\n \"result.diagnostic\",\n \"result.receipt\",\n ]),\n rerunRecommendation: \"Rerun the affected evaluation to collect current assertion facts.\",\n }),\n migrate: migrateAssertionsV1,\n }),\n ]),\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import type { RecordAttachmentMaintenanceFacet } from "../definition/attachment.cjs";
2
+ export declare const assertionsV1Maintenance: RecordAttachmentMaintenanceFacet;
@@ -0,0 +1,2 @@
1
+ import type { RecordAttachmentMaintenanceFacet } from "../definition/attachment.mjs";
2
+ export declare const assertionsV1Maintenance: RecordAttachmentMaintenanceFacet;
@@ -0,0 +1,2 @@
1
+ import type { RecordAttachmentMaintenanceFacet } from "../definition/attachment.js";
2
+ export declare const assertionsV1Maintenance: RecordAttachmentMaintenanceFacet;
@@ -0,0 +1,6 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./assertions-v1.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["assertionsV1Maintenance"];
5
+ export { __niceevalExport0 as assertionsV1Maintenance };
6
+ //# sourceMappingURL=assertions-v1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions-v1.js","sources":[],"names":[],"mappings":""}