niceeval 0.13.2 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (494) hide show
  1. package/dist/agents/bub.cjs +4 -4
  2. package/dist/agents/bub.cjs.map +1 -1
  3. package/dist/agents/bub.d.cts +2 -2
  4. package/dist/agents/bub.d.mts +2 -2
  5. package/dist/agents/bub.d.ts +2 -2
  6. package/dist/agents/claude-code-native.cjs +213 -0
  7. package/dist/agents/claude-code-native.cjs.map +1 -0
  8. package/dist/agents/claude-code-native.d.cts +5 -0
  9. package/dist/agents/claude-code-native.d.mts +5 -0
  10. package/dist/agents/claude-code-native.d.ts +5 -0
  11. package/dist/agents/claude-code-native.js +6 -0
  12. package/dist/agents/claude-code-native.js.map +1 -0
  13. package/dist/agents/claude-code.cjs +26 -80
  14. package/dist/agents/claude-code.cjs.map +1 -1
  15. package/dist/agents/codex-app-server.cjs +314 -0
  16. package/dist/agents/codex-app-server.cjs.map +1 -0
  17. package/dist/agents/codex-app-server.d.cts +9 -0
  18. package/dist/agents/codex-app-server.d.mts +9 -0
  19. package/dist/agents/codex-app-server.d.ts +9 -0
  20. package/dist/agents/codex-app-server.js +6 -0
  21. package/dist/agents/codex-app-server.js.map +1 -0
  22. package/dist/agents/codex.cjs +19 -68
  23. package/dist/agents/codex.cjs.map +1 -1
  24. package/dist/agents/codex.d.cts +3 -3
  25. package/dist/agents/codex.d.mts +3 -3
  26. package/dist/agents/codex.d.ts +3 -3
  27. package/dist/agents/index.cjs +3 -1
  28. package/dist/agents/index.cjs.map +1 -1
  29. package/dist/agents/index.d.cts +1 -0
  30. package/dist/agents/index.d.mts +1 -0
  31. package/dist/agents/index.d.ts +1 -0
  32. package/dist/agents/index.js +84 -82
  33. package/dist/agents/index.mjs +84 -82
  34. package/dist/agents/managed-jsonl.cjs +207 -0
  35. package/dist/agents/managed-jsonl.cjs.map +1 -0
  36. package/dist/agents/managed-jsonl.d.cts +39 -0
  37. package/dist/agents/managed-jsonl.d.mts +39 -0
  38. package/dist/agents/managed-jsonl.d.ts +39 -0
  39. package/dist/agents/managed-jsonl.js +6 -0
  40. package/dist/agents/managed-jsonl.js.map +1 -0
  41. package/dist/agents/managed-process.cjs +31 -0
  42. package/dist/agents/managed-process.cjs.map +1 -0
  43. package/dist/agents/managed-process.d.cts +3 -0
  44. package/dist/agents/managed-process.d.mts +3 -0
  45. package/dist/agents/managed-process.d.ts +3 -0
  46. package/dist/agents/managed-process.js +6 -0
  47. package/dist/agents/managed-process.js.map +1 -0
  48. package/dist/agents/omp.cjs +18 -1
  49. package/dist/agents/omp.cjs.map +1 -1
  50. package/dist/agents/sdk-streams.cjs +11 -4
  51. package/dist/agents/sdk-streams.cjs.map +1 -1
  52. package/dist/agents/types.cjs.map +1 -1
  53. package/dist/agents/types.d.cts +8 -0
  54. package/dist/agents/types.d.mts +8 -0
  55. package/dist/agents/types.d.ts +8 -0
  56. package/dist/analysis/bindings.cjs +74 -19
  57. package/dist/analysis/bindings.cjs.map +1 -1
  58. package/dist/analysis/bindings.d.cts +534 -156
  59. package/dist/analysis/bindings.d.mts +534 -156
  60. package/dist/analysis/bindings.d.ts +534 -156
  61. package/dist/analysis/domain-view.cjs.map +1 -1
  62. package/dist/analysis/domain-view.d.cts +137 -8
  63. package/dist/analysis/domain-view.d.mts +137 -8
  64. package/dist/analysis/domain-view.d.ts +137 -8
  65. package/dist/analysis/index.cjs.map +1 -1
  66. package/dist/analysis/index.d.cts +1 -1
  67. package/dist/analysis/index.d.mts +1 -1
  68. package/dist/analysis/index.d.ts +1 -1
  69. package/dist/assertions/api.cjs.map +1 -1
  70. package/dist/assertions/api.d.cts +62 -0
  71. package/dist/assertions/api.d.mts +62 -0
  72. package/dist/assertions/api.d.ts +62 -0
  73. package/dist/assertions/judge.cjs +56 -5
  74. package/dist/assertions/judge.cjs.map +1 -1
  75. package/dist/assertions/match.cjs +66 -42
  76. package/dist/assertions/match.cjs.map +1 -1
  77. package/dist/assertions/match.d.cts +13 -0
  78. package/dist/assertions/match.d.mts +13 -0
  79. package/dist/assertions/match.d.ts +13 -0
  80. package/dist/assertions/record/attachment.cjs +104 -33
  81. package/dist/assertions/record/attachment.cjs.map +1 -1
  82. package/dist/assertions/record/attachment.d.cts +294 -57
  83. package/dist/assertions/record/attachment.d.mts +294 -57
  84. package/dist/assertions/record/attachment.d.ts +294 -57
  85. package/dist/assertions/record/codec.cjs +91 -17
  86. package/dist/assertions/record/codec.cjs.map +1 -1
  87. package/dist/assertions/record/codec.d.cts +280 -52
  88. package/dist/assertions/record/codec.d.mts +280 -52
  89. package/dist/assertions/record/codec.d.ts +280 -52
  90. package/dist/assertions/record/index.js +2 -0
  91. package/dist/assertions/record/model.cjs +16 -0
  92. package/dist/assertions/record/model.cjs.map +1 -1
  93. package/dist/assertions/record/model.d.cts +120 -13
  94. package/dist/assertions/record/model.d.mts +120 -13
  95. package/dist/assertions/record/model.d.ts +120 -13
  96. package/dist/assertions/record/model.js +2 -0
  97. package/dist/assertions/record/producer.cjs +70 -50
  98. package/dist/assertions/record/producer.cjs.map +1 -1
  99. package/dist/assertions/record/producer.d.cts +8 -7
  100. package/dist/assertions/record/producer.d.mts +8 -7
  101. package/dist/assertions/record/producer.d.ts +8 -7
  102. package/dist/assertions/runtime.cjs +49 -7
  103. package/dist/assertions/runtime.cjs.map +1 -1
  104. package/dist/cli/application.cjs +40 -0
  105. package/dist/cli/application.cjs.map +1 -0
  106. package/dist/cli/application.d.cts +129 -0
  107. package/dist/cli/application.d.mts +129 -0
  108. package/dist/cli/application.d.ts +129 -0
  109. package/dist/cli/application.js +24 -0
  110. package/dist/cli/application.js.map +1 -0
  111. package/dist/cli/bootstrap.cjs +10 -4
  112. package/dist/cli/bootstrap.cjs.map +1 -1
  113. package/dist/cli/node-application.cjs +123 -0
  114. package/dist/cli/node-application.cjs.map +1 -0
  115. package/dist/cli/node-application.d.cts +14 -0
  116. package/dist/cli/node-application.d.mts +14 -0
  117. package/dist/cli/node-application.d.ts +14 -0
  118. package/dist/cli/node-application.js +26 -0
  119. package/dist/cli/node-application.js.map +1 -0
  120. package/dist/cli/program.cjs +2807 -0
  121. package/dist/cli/program.cjs.map +1 -0
  122. package/dist/cli/program.d.cts +352 -0
  123. package/dist/cli/program.d.mts +352 -0
  124. package/dist/cli/program.d.ts +352 -0
  125. package/dist/cli/program.js +36 -0
  126. package/dist/cli/program.js.map +1 -0
  127. package/dist/cli/project-configuration.cjs +134 -0
  128. package/dist/cli/project-configuration.cjs.map +1 -0
  129. package/dist/cli/project-configuration.d.cts +64 -0
  130. package/dist/cli/project-configuration.d.mts +64 -0
  131. package/dist/cli/project-configuration.d.ts +64 -0
  132. package/dist/cli/project-configuration.js +22 -0
  133. package/dist/cli/project-configuration.js.map +1 -0
  134. package/dist/cli/record.cjs +20 -4
  135. package/dist/cli/record.cjs.map +1 -1
  136. package/dist/cli/record.d.cts +3 -3
  137. package/dist/cli/record.d.mts +3 -3
  138. package/dist/cli/record.d.ts +3 -3
  139. package/dist/cli.cjs +19 -3130
  140. package/dist/cli.cjs.map +1 -1
  141. package/dist/cli.d.cts +2 -148
  142. package/dist/cli.d.mts +2 -148
  143. package/dist/cli.d.ts +2 -148
  144. package/dist/cli.js +22 -30
  145. package/dist/context/assert-first.cjs +21 -15
  146. package/dist/context/assert-first.cjs.map +1 -1
  147. package/dist/context/assert-first.d.cts +1 -0
  148. package/dist/context/assert-first.d.mts +1 -0
  149. package/dist/context/assert-first.d.ts +1 -0
  150. package/dist/context/attempt-resources.cjs +13 -0
  151. package/dist/context/attempt-resources.cjs.map +1 -0
  152. package/dist/context/attempt-resources.d.cts +3 -0
  153. package/dist/context/attempt-resources.d.mts +3 -0
  154. package/dist/context/attempt-resources.d.ts +3 -0
  155. package/dist/context/attempt-resources.js +8 -0
  156. package/dist/context/attempt-resources.js.map +1 -0
  157. package/dist/context/session.cjs +4 -3
  158. package/dist/context/session.cjs.map +1 -1
  159. package/dist/context/session.d.cts +1 -0
  160. package/dist/context/session.d.mts +1 -0
  161. package/dist/context/session.d.ts +1 -0
  162. package/dist/eval/record/verdict.cjs +3 -2
  163. package/dist/eval/record/verdict.cjs.map +1 -1
  164. package/dist/experiment/host/index.cjs +1 -6
  165. package/dist/experiment/host/index.cjs.map +1 -1
  166. package/dist/experiment/host/index.d.cts +1 -0
  167. package/dist/experiment/host/index.d.mts +1 -0
  168. package/dist/experiment/host/index.d.ts +1 -0
  169. package/dist/load-config.cjs +13 -4
  170. package/dist/load-config.cjs.map +1 -1
  171. package/dist/load-config.d.cts +4 -3
  172. package/dist/load-config.d.mts +4 -3
  173. package/dist/load-config.d.ts +4 -3
  174. package/dist/load-config.js +4 -2
  175. package/dist/o11y/parsers/codex.cjs +29 -7
  176. package/dist/o11y/parsers/codex.cjs.map +1 -1
  177. package/dist/record/codec/core.d.cts +0 -2
  178. package/dist/record/codec/core.d.mts +0 -2
  179. package/dist/record/codec/core.d.ts +0 -2
  180. package/dist/record/codec/identifiers.cjs +2 -3
  181. package/dist/record/codec/identifiers.cjs.map +1 -1
  182. package/dist/record/codec/identifiers.d.cts +1 -2
  183. package/dist/record/codec/identifiers.d.mts +1 -2
  184. package/dist/record/codec/identifiers.d.ts +1 -2
  185. package/dist/record/codec/identifiers.js +10 -12
  186. package/dist/record/codec/index.js +42 -44
  187. package/dist/record/definition/attachment.cjs +1 -0
  188. package/dist/record/definition/attachment.cjs.map +1 -1
  189. package/dist/record/definition/attachment.d.cts +14 -0
  190. package/dist/record/definition/attachment.d.mts +14 -0
  191. package/dist/record/definition/attachment.d.ts +14 -0
  192. package/dist/record/family/assertions-v1.cjs +104 -0
  193. package/dist/record/family/assertions-v1.cjs.map +1 -0
  194. package/dist/record/family/assertions-v1.d.cts +2 -0
  195. package/dist/record/family/assertions-v1.d.mts +2 -0
  196. package/dist/record/family/assertions-v1.d.ts +2 -0
  197. package/dist/record/family/assertions-v1.js +6 -0
  198. package/dist/record/family/assertions-v1.js.map +1 -0
  199. package/dist/record/family/assertions.cjs +16 -5
  200. package/dist/record/family/assertions.cjs.map +1 -1
  201. package/dist/record/family/assertions.d.cts +510 -56
  202. package/dist/record/family/assertions.d.mts +510 -56
  203. package/dist/record/family/assertions.d.ts +510 -56
  204. package/dist/record/family/assertions.js +14 -10
  205. package/dist/record/family/catalog.cjs +17 -1
  206. package/dist/record/family/catalog.cjs.map +1 -1
  207. package/dist/record/family/catalog.d.cts +1292 -104
  208. package/dist/record/family/catalog.d.mts +1292 -104
  209. package/dist/record/family/catalog.d.ts +1292 -104
  210. package/dist/record/family/catalog.js +22 -20
  211. package/dist/record/family/index.js +144 -138
  212. package/dist/record/family/observability-v1.cjs +5 -0
  213. package/dist/record/family/observability-v1.cjs.map +1 -1
  214. package/dist/record/family/observability.cjs +1 -1
  215. package/dist/record/family/observability.cjs.map +1 -1
  216. package/dist/record/host/runtime.cjs +323 -173
  217. package/dist/record/host/runtime.cjs.map +1 -1
  218. package/dist/record/host/types.cjs.map +1 -1
  219. package/dist/record/host/types.d.cts +9 -7
  220. package/dist/record/host/types.d.mts +9 -7
  221. package/dist/record/host/types.d.ts +9 -7
  222. package/dist/record/model/core.cjs.map +1 -1
  223. package/dist/record/model/core.d.cts +1 -2
  224. package/dist/record/model/core.d.mts +1 -2
  225. package/dist/record/model/core.d.ts +1 -2
  226. package/dist/record/model/definition.cjs +1 -2
  227. package/dist/record/model/definition.cjs.map +1 -1
  228. package/dist/record/model/definition.d.cts +1 -7
  229. package/dist/record/model/definition.d.mts +1 -7
  230. package/dist/record/model/definition.d.ts +1 -7
  231. package/dist/record/model/identifiers.cjs +2 -3
  232. package/dist/record/model/identifiers.cjs.map +1 -1
  233. package/dist/record/model/identifiers.d.cts +1 -3
  234. package/dist/record/model/identifiers.d.mts +1 -3
  235. package/dist/record/model/identifiers.d.ts +1 -3
  236. package/dist/record/model/identifiers.js +36 -38
  237. package/dist/record/model/index.js +60 -62
  238. package/dist/record/platform/node.cjs +17 -7
  239. package/dist/record/platform/node.cjs.map +1 -1
  240. package/dist/record/platform/services.cjs.map +1 -1
  241. package/dist/record/platform/services.d.cts +8 -3
  242. package/dist/record/platform/services.d.mts +8 -3
  243. package/dist/record/platform/services.d.ts +8 -3
  244. package/dist/record/reader/format.cjs +16 -65
  245. package/dist/record/reader/format.cjs.map +1 -1
  246. package/dist/record/reader/format.d.cts +5 -9
  247. package/dist/record/reader/format.d.mts +5 -9
  248. package/dist/record/reader/format.d.ts +5 -9
  249. package/dist/record/reader/index.js +10 -8
  250. package/dist/record/reader/runtime.cjs +63 -32
  251. package/dist/record/reader/runtime.cjs.map +1 -1
  252. package/dist/record/reader/runtime.d.cts +40 -4
  253. package/dist/record/reader/runtime.d.mts +40 -4
  254. package/dist/record/reader/runtime.d.ts +40 -4
  255. package/dist/record/reader/runtime.js +6 -4
  256. package/dist/report/assets/enhance.js +5 -5
  257. package/dist/report/assets/styles.css +190 -24
  258. package/dist/report/built-in/result-components.cjs +8 -5
  259. package/dist/report/built-in/result-components.cjs.map +1 -1
  260. package/dist/report/built-in/standard.cjs +3 -0
  261. package/dist/report/built-in/standard.cjs.map +1 -1
  262. package/dist/report/built-in/standard.d.cts +2 -0
  263. package/dist/report/built-in/standard.d.mts +2 -0
  264. package/dist/report/built-in/standard.d.ts +2 -0
  265. package/dist/report/client-dist/app.js +53 -0
  266. package/dist/report/components/attempt-detail/compute.cjs +108 -231
  267. package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
  268. package/dist/report/components/attempt-detail/compute.d.cts +11 -45
  269. package/dist/report/components/attempt-detail/compute.d.mts +11 -45
  270. package/dist/report/components/attempt-detail/compute.d.ts +11 -45
  271. package/dist/report/components/attempt-detail/compute.js +2 -4
  272. package/dist/report/components/attempt-detail/content.cjs +4 -4
  273. package/dist/report/components/attempt-detail/content.cjs.map +1 -1
  274. package/dist/report/components/attempt-detail/validate.cjs +47 -4
  275. package/dist/report/components/attempt-detail/validate.cjs.map +1 -1
  276. package/dist/report/components/entity-lists/compute.cjs +9 -15
  277. package/dist/report/components/entity-lists/compute.cjs.map +1 -1
  278. package/dist/report/components/entity-lists/content.cjs +53 -40
  279. package/dist/report/components/entity-lists/content.cjs.map +1 -1
  280. package/dist/report/components/entity-lists/index.cjs +1 -3
  281. package/dist/report/components/entity-lists/index.cjs.map +1 -1
  282. package/dist/report/components/experiment-detail/compute.cjs +4 -6
  283. package/dist/report/components/experiment-detail/compute.cjs.map +1 -1
  284. package/dist/report/components/summaries/index.cjs +5 -1
  285. package/dist/report/components/summaries/index.cjs.map +1 -1
  286. package/dist/report/definition/cell.cjs +14 -7
  287. package/dist/report/definition/cell.cjs.map +1 -1
  288. package/dist/report/definition/cell.d.cts +4 -0
  289. package/dist/report/definition/cell.d.mts +4 -0
  290. package/dist/report/definition/cell.d.ts +4 -0
  291. package/dist/report/definition/primitives/assertion-evidence.cjs +96 -0
  292. package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -0
  293. package/dist/report/definition/primitives/assertion-evidence.d.cts +11 -0
  294. package/dist/report/definition/primitives/assertion-evidence.d.mts +11 -0
  295. package/dist/report/definition/primitives/assertion-evidence.d.ts +11 -0
  296. package/dist/report/definition/primitives/assertion-evidence.js +6 -0
  297. package/dist/report/definition/primitives/assertion-evidence.js.map +1 -0
  298. package/dist/report/definition/primitives/conversation.cjs +7 -0
  299. package/dist/report/definition/primitives/conversation.cjs.map +1 -1
  300. package/dist/report/definition/primitives/conversation.d.cts +2 -0
  301. package/dist/report/definition/primitives/conversation.d.mts +2 -0
  302. package/dist/report/definition/primitives/conversation.d.ts +2 -0
  303. package/dist/report/definition/primitives/turn-trace.cjs +53 -3
  304. package/dist/report/definition/primitives/turn-trace.cjs.map +1 -1
  305. package/dist/report/definition/primitives.cjs +14 -1
  306. package/dist/report/definition/primitives.cjs.map +1 -1
  307. package/dist/report/definition/report.cjs +16 -8
  308. package/dist/report/definition/report.cjs.map +1 -1
  309. package/dist/report/definition/report.d.cts +6 -0
  310. package/dist/report/definition/report.d.mts +6 -0
  311. package/dist/report/definition/report.d.ts +6 -0
  312. package/dist/report/definition/table-text.cjs +12 -3
  313. package/dist/report/definition/table-text.cjs.map +1 -1
  314. package/dist/report/definition/table-text.d.cts +6 -1
  315. package/dist/report/definition/table-text.d.mts +6 -1
  316. package/dist/report/definition/table-text.d.ts +6 -1
  317. package/dist/report/execution/model.cjs +6 -14
  318. package/dist/report/execution/model.cjs.map +1 -1
  319. package/dist/report/execution/model.d.cts +5 -10
  320. package/dist/report/execution/model.d.mts +5 -10
  321. package/dist/report/execution/model.d.ts +5 -10
  322. package/dist/report/execution/model.js +6 -6
  323. package/dist/report/execution/paths.cjs +0 -11
  324. package/dist/report/execution/paths.cjs.map +1 -1
  325. package/dist/report/execution/paths.d.cts +0 -1
  326. package/dist/report/execution/paths.d.mts +0 -1
  327. package/dist/report/execution/paths.d.ts +0 -1
  328. package/dist/report/execution/paths.js +6 -8
  329. package/dist/report/host/execute.cjs +13 -22
  330. package/dist/report/host/execute.cjs.map +1 -1
  331. package/dist/report/host/execute.d.cts +1 -4
  332. package/dist/report/host/execute.d.mts +1 -4
  333. package/dist/report/host/execute.d.ts +1 -4
  334. package/dist/report/host/from-record.cjs +3 -0
  335. package/dist/report/host/from-record.cjs.map +1 -1
  336. package/dist/report/host/from-record.d.cts +4 -1
  337. package/dist/report/host/from-record.d.mts +4 -1
  338. package/dist/report/host/from-record.d.ts +4 -1
  339. package/dist/report/host/site-assets.cjs +1 -2
  340. package/dist/report/host/site-assets.cjs.map +1 -1
  341. package/dist/report/host/site-assets.d.cts +0 -1
  342. package/dist/report/host/site-assets.d.mts +0 -1
  343. package/dist/report/host/site-assets.d.ts +0 -1
  344. package/dist/report/host/site-assets.js +2 -4
  345. package/dist/report/host/static.cjs +71 -346
  346. package/dist/report/host/static.cjs.map +1 -1
  347. package/dist/report/host/static.d.cts +1 -3
  348. package/dist/report/host/static.d.mts +1 -3
  349. package/dist/report/host/static.d.ts +1 -3
  350. package/dist/report/host/static.js +2 -2
  351. package/dist/report/host/view-session.cjs.map +1 -1
  352. package/dist/report/host/view-session.d.cts +1 -1
  353. package/dist/report/host/view-session.d.mts +1 -1
  354. package/dist/report/host/view-session.d.ts +1 -1
  355. package/dist/report/model/locale.cjs +1 -1
  356. package/dist/report/model/locale.cjs.map +1 -1
  357. package/dist/report/model/locale.d.cts +1 -1
  358. package/dist/report/model/locale.d.mts +1 -1
  359. package/dist/report/model/locale.d.ts +1 -1
  360. package/dist/report/model/pricing.cjs +2 -2
  361. package/dist/report/model/pricing.cjs.map +1 -1
  362. package/dist/report/react/enhance.js +5 -5
  363. package/dist/report/react/styles.css +190 -24
  364. package/dist/runner/adoption.cjs +4 -7
  365. package/dist/runner/adoption.cjs.map +1 -1
  366. package/dist/runner/attempt-resources.cjs +60 -0
  367. package/dist/runner/attempt-resources.cjs.map +1 -0
  368. package/dist/runner/attempt-resources.d.cts +13 -0
  369. package/dist/runner/attempt-resources.d.mts +13 -0
  370. package/dist/runner/attempt-resources.d.ts +13 -0
  371. package/dist/runner/attempt-resources.js +6 -0
  372. package/dist/runner/attempt-resources.js.map +1 -0
  373. package/dist/runner/attempt.cjs +37 -3
  374. package/dist/runner/attempt.cjs.map +1 -1
  375. package/dist/runner/feedback/failure.cjs +77 -2
  376. package/dist/runner/feedback/failure.cjs.map +1 -1
  377. package/dist/runner/feedback/failure.d.cts +2 -1
  378. package/dist/runner/feedback/failure.d.mts +2 -1
  379. package/dist/runner/feedback/failure.d.ts +2 -1
  380. package/dist/runner/project-current.cjs +2 -13
  381. package/dist/runner/project-current.cjs.map +1 -1
  382. package/dist/runner/project-current.d.cts +4 -2
  383. package/dist/runner/project-current.d.mts +4 -2
  384. package/dist/runner/project-current.d.ts +4 -2
  385. package/dist/runner/reporters/braintrust.cjs +7 -7
  386. package/dist/runner/reporters/braintrust.cjs.map +1 -1
  387. package/dist/runner/reuse-readback.cjs +3 -4
  388. package/dist/runner/reuse-readback.cjs.map +1 -1
  389. package/dist/runner/run.cjs +5 -2
  390. package/dist/runner/run.cjs.map +1 -1
  391. package/dist/sandbox/backend.cjs +32 -2
  392. package/dist/sandbox/backend.cjs.map +1 -1
  393. package/dist/sandbox/backend.d.cts +12 -1
  394. package/dist/sandbox/backend.d.mts +12 -1
  395. package/dist/sandbox/backend.d.ts +12 -1
  396. package/dist/sandbox/backend.js +28 -22
  397. package/dist/sandbox/docker.cjs +140 -0
  398. package/dist/sandbox/docker.cjs.map +1 -1
  399. package/dist/sandbox/docker.d.cts +3 -1
  400. package/dist/sandbox/docker.d.mts +3 -1
  401. package/dist/sandbox/docker.d.ts +3 -1
  402. package/dist/sandbox/e2b.cjs +42 -0
  403. package/dist/sandbox/e2b.cjs.map +1 -1
  404. package/dist/sandbox/e2b.d.cts +2 -0
  405. package/dist/sandbox/e2b.d.mts +2 -0
  406. package/dist/sandbox/e2b.d.ts +2 -0
  407. package/dist/sandbox/local.cjs +64 -0
  408. package/dist/sandbox/local.cjs.map +1 -1
  409. package/dist/sandbox/local.d.cts +3 -1
  410. package/dist/sandbox/local.d.mts +3 -1
  411. package/dist/sandbox/local.d.ts +3 -1
  412. package/dist/sandbox/managed-process.cjs +49 -0
  413. package/dist/sandbox/managed-process.cjs.map +1 -0
  414. package/dist/sandbox/managed-process.d.cts +11 -0
  415. package/dist/sandbox/managed-process.d.mts +11 -0
  416. package/dist/sandbox/managed-process.d.ts +11 -0
  417. package/dist/sandbox/managed-process.js +6 -0
  418. package/dist/sandbox/managed-process.js.map +1 -0
  419. package/dist/sandbox/types.cjs.map +1 -1
  420. package/dist/sandbox/types.d.cts +24 -0
  421. package/dist/sandbox/types.d.mts +24 -0
  422. package/dist/sandbox/types.d.ts +24 -0
  423. package/dist/sandbox/vercel.cjs +1 -0
  424. package/dist/sandbox/vercel.cjs.map +1 -1
  425. package/dist/sandbox/vercel.d.cts +1 -0
  426. package/dist/sandbox/vercel.d.mts +1 -0
  427. package/dist/sandbox/vercel.d.ts +1 -0
  428. package/dist/view/server.cjs +2 -37
  429. package/dist/view/server.cjs.map +1 -1
  430. package/dist/view/server.d.cts +0 -3
  431. package/dist/view/server.d.mts +0 -3
  432. package/dist/view/server.d.ts +0 -3
  433. package/docs-site/zh/reference/builtin-agents.mdx +7 -7
  434. package/docs-site/zh/reference/official-adapters.mdx +4 -4
  435. package/docs-site/zh/reference/report-components.mdx +2 -2
  436. package/docs-site/zh/tutorials/configuration.mdx +2 -2
  437. package/docs-site/zh/tutorials/deploy-report-site.mdx +24 -2
  438. package/docs-site/zh/tutorials/publish-report.mdx +4 -4
  439. package/docs-site/zh/tutorials/sandbox-agent.mdx +5 -5
  440. package/docs-site/zh/tutorials/theming.mdx +2 -2
  441. package/package.json +4 -6
  442. package/dist/record/migration/index.cjs +0 -5
  443. package/dist/record/migration/index.cjs.map +0 -1
  444. package/dist/record/migration/index.d.cts +0 -11
  445. package/dist/record/migration/index.d.mts +0 -11
  446. package/dist/record/migration/index.d.ts +0 -11
  447. package/dist/record/migration/index.js +0 -6
  448. package/dist/record/migration/index.js.map +0 -1
  449. package/dist/report/host/site-runtime.cjs +0 -92
  450. package/dist/report/host/site-runtime.cjs.map +0 -1
  451. package/dist/report/host/site-runtime.d.cts +0 -9
  452. package/dist/report/host/site-runtime.d.mts +0 -9
  453. package/dist/report/host/site-runtime.d.ts +0 -9
  454. package/dist/report/host/site-runtime.js +0 -10
  455. package/dist/report/host/site-runtime.js.map +0 -1
  456. package/dist/view/client-dist/app.css +0 -2
  457. package/dist/view/client-dist/app.js +0 -49
  458. package/dist/view/data.cjs +0 -3
  459. package/dist/view/data.cjs.map +0 -1
  460. package/dist/view/data.d.cts +0 -9
  461. package/dist/view/data.d.mts +0 -9
  462. package/dist/view/data.d.ts +0 -9
  463. package/dist/view/data.js +0 -4
  464. package/dist/view/data.js.map +0 -1
  465. package/dist/view/index.cjs +0 -24
  466. package/dist/view/index.cjs.map +0 -1
  467. package/dist/view/index.d.cts +0 -9
  468. package/dist/view/index.d.mts +0 -9
  469. package/dist/view/index.d.ts +0 -9
  470. package/dist/view/index.js +0 -28
  471. package/dist/view/index.js.map +0 -1
  472. package/dist/view/report-view-cache.cjs +0 -200
  473. package/dist/view/report-view-cache.cjs.map +0 -1
  474. package/dist/view/report-view-cache.d.cts +0 -67
  475. package/dist/view/report-view-cache.d.mts +0 -67
  476. package/dist/view/report-view-cache.d.ts +0 -67
  477. package/dist/view/report-view-cache.js +0 -8
  478. package/dist/view/report-view-cache.js.map +0 -1
  479. package/dist/view/shared/types.cjs +0 -3
  480. package/dist/view/shared/types.cjs.map +0 -1
  481. package/dist/view/shared/types.d.cts +0 -51
  482. package/dist/view/shared/types.d.mts +0 -51
  483. package/dist/view/shared/types.d.ts +0 -51
  484. package/dist/view/shared/types.js +0 -4
  485. package/dist/view/shared/types.js.map +0 -1
  486. package/dist/view/site.cjs +0 -32
  487. package/dist/view/site.cjs.map +0 -1
  488. package/dist/view/site.d.cts +0 -24
  489. package/dist/view/site.d.mts +0 -24
  490. package/dist/view/site.d.ts +0 -24
  491. package/dist/view/site.js +0 -8
  492. package/dist/view/site.js.map +0 -1
  493. package/dist/view/styles.css +0 -170
  494. package/dist/view/template.html +0 -17
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;AAiBa,QAAA,mBAAmB,GAAkB,MAAM,CAAC,iCAAiC,CAAC,CAAC;AAC/E,QAAA,uBAAuB,GAAkB,MAAM,CAAC,qCAAqC,CAAC,CAAC;AACvF,QAAA,qBAAqB,GAAkB,MAAM,CAAC,mCAAmC,CAAC,CAAC;AACnF,QAAA,oBAAoB,GAAkB,MAAM,CAAC,kCAAkC,CAAC,CAAC;AACjF,QAAA,wBAAwB,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC","sourcesContent":["import type { Effect } from \"effect\";\nimport type { RecordAttachmentBlobs, RecordAttachmentPayloadSnapshot, RecordAttachmentWrite, } from \"../attachment/types.ts\";\nimport type { AssertionsAttachment, } from \"../family/assertions.ts\";\nimport type { ArtifactsAttachment, } from \"../family/artifacts.ts\";\nimport type { FileChangesAttachment, } from \"../family/file-changes.ts\";\nimport type { AttemptObservabilityAttachment, RunObservabilityAttachment, } from \"../family/observability.ts\";\nimport type { SourcesAttachment, } from \"../family/sources.ts\";\nimport type { SourceNavigationAttachment, } from \"../family/source-navigation.ts\";\nimport type { AttemptDocument, MemberDocument, RecordSlotIdentity, RunDocument, } from \"../model/core.ts\";\nimport type { RunContext } from \"../model/run-context.ts\";\nimport type { AttemptId, ExperimentId, RunId, SlotId, UtcMillis, } from \"../model/identifiers.ts\";\nimport type { RecordRoot } from \"../platform/root.ts\";\nimport type { RecordBackupState } from \"../platform/services.ts\";\nimport type { RecordCoreRead, RecordWarning } from \"../model/read-state.ts\";\nimport type { NonEmptyRecordIssues } from \"../errors/record-errors.ts\";\nimport type { RecordMaintenanceError, RecordMaintenanceOpenError, RecordReaderOpenError, RecordReaderReadError, } from \"../reader/errors.ts\";\nimport type { RecordWriteError } from \"../writer/types.ts\";\nexport const selectedRunRefBrand: unique symbol = Symbol(\"@niceeval/record/SelectedRunRef\");\nexport const selectedAttemptRefBrand: unique symbol = Symbol(\"@niceeval/record/SelectedAttemptRef\");\nexport const selectedOwnerRefBrand: unique symbol = Symbol(\"@niceeval/record/SelectedOwnerRef\");\nexport const runWriteSessionBrand: unique symbol = Symbol(\"@niceeval/record/RunWriteSession\");\nexport const attemptWriteSessionBrand: unique symbol = Symbol(\"@niceeval/record/AttemptWriteSession\");\n/** Nominal ref issued only by one live RecordReadSession. */\nexport interface SelectedRunRef {\n readonly runId: RunId;\n readonly [selectedRunRefBrand]: () => void;\n}\n/** Nominal exact reference to one immutable origin Attempt. */\nexport interface SelectedAttemptRef {\n readonly originRunId: RunId;\n readonly attemptId: AttemptId;\n readonly [selectedAttemptRefBrand]: () => void;\n}\n/** Owner handle for a later lazy fixed-family read. */\nexport interface SelectedOwnerRef {\n readonly [selectedOwnerRefBrand]: () => void;\n}\n/**\n * The Host exposes the fixed-family states without importing maintenance.\n * A reachable older version is migration-required. Any other well-formed,\n * non-current version remains unsupported data; malformed envelopes and\n * closures are invalid, never a reader-wide failure.\n */\nexport type FixedFamilyRead<Payload> = {\n readonly state: \"migration-required\";\n readonly family: string;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly command: \"niceeval migrate\";\n} | {\n readonly state: \"available\";\n /** Direct business fields from the current owner value definition. */\n readonly value: RecordAttachmentPayloadSnapshot<Payload>;\n /** Owner-local blob closure for refs found inside `value`. */\n readonly blobs: RecordAttachmentBlobs;\n} | {\n readonly state: \"not-recorded\";\n} | {\n readonly state: \"unsupported\";\n readonly family: string;\n readonly schemaVersion: number;\n} | {\n readonly state: \"invalid\";\n readonly issues: NonEmptyRecordIssues;\n};\n/**\n * These aliases are deliberately owner- and method-specific. Runtime checks\n * additionally require the one installed static descriptor for each method,\n * so a caller cannot introduce another family through this boundary.\n */\nexport type SourcesWrite<E = never, R = never> = RecordAttachmentWrite<\"run\", E, R>;\nexport type RunObservabilityWrite<E = never, R = never> = RecordAttachmentWrite<\"run\", E, R>;\nexport type RunArtifactsWrite<E = never, R = never> = RecordAttachmentWrite<\"run\", E, R>;\nexport type AssertionsWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type AttemptObservabilityWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type FileChangesWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type SourceNavigationWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type AttemptArtifactsWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type RecordSelectionProblem = {\n readonly code: \"incomplete-run\";\n readonly runId: RunId;\n} | {\n readonly code: \"record-core-invalid\";\n readonly runId: RunId;\n} | {\n readonly code: \"selection-run-missing\";\n readonly runId: RunId;\n};\nexport interface RecordSelectionRequest {\n /** Omitted means every Run whose complete marker existed during this scan. */\n readonly runIds?: readonly RunId[];\n}\n/**\n * Closed Run facts verified by scanSelection. They retain the denominator\n * frame if a later member read becomes unavailable; they are not a durable\n * schema and contain no owner capability.\n */\nexport interface SelectedRunFacts {\n readonly run: SelectedRunRef;\n readonly experimentId: ExperimentId;\n readonly startedAt: UtcMillis;\n readonly completedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\n/** A closed candidate set with only selected minimal Core; never Attachment payloads. */\nexport interface RecordSelection {\n readonly runRefs: readonly SelectedRunRef[];\n readonly runFacts: readonly SelectedRunFacts[];\n readonly expectedSlots: readonly {\n readonly run: SelectedRunRef;\n /** Closed at scan time from the selected Run, not stored in RecordSlotIdentity. */\n readonly experimentId: ExperimentId;\n readonly slot: RecordSlotIdentity;\n }[];\n readonly problems: readonly RecordSelectionProblem[];\n readonly warnings: readonly RecordWarning[];\n}\nexport interface ReadableRun {\n readonly ref: SelectedRunRef;\n readonly owner: SelectedOwnerRef;\n readonly document: RunDocument;\n readonly members: readonly {\n readonly document: MemberDocument;\n readonly attempt: SelectedAttemptRef | null;\n }[];\n}\nexport interface ReadableAttempt {\n readonly ref: SelectedAttemptRef;\n readonly owner: SelectedOwnerRef;\n readonly document: AttemptDocument;\n /**\n * Verified while resolving the exact nominal Attempt reference. It is the\n * only origin Run Core projection Sample may use. In particular, a carried\n * or accepted member must retain this origin's execution facts rather than\n * substituting the selected target Run.\n */\n readonly origin: {\n readonly owner: SelectedOwnerRef;\n readonly runId: RunId;\n readonly experimentId: ExperimentId;\n readonly startedAt: UtcMillis;\n readonly context: RunContext;\n };\n}\nexport interface RecordReadSession {\n readonly selectRuns: (request?: RecordSelectionRequest) => Effect.Effect<RecordSelection, RecordReaderReadError>;\n readonly readRun: (ref: SelectedRunRef) => Effect.Effect<RecordCoreRead<ReadableRun>, RecordReaderReadError>;\n readonly readAttempt: (ref: SelectedAttemptRef) => Effect.Effect<RecordCoreRead<ReadableAttempt>, RecordReaderReadError>;\n readonly readAssertions: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<AssertionsAttachment>, RecordReaderReadError>;\n readonly readAttemptObservability: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<AttemptObservabilityAttachment>, RecordReaderReadError>;\n readonly readFileChanges: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<FileChangesAttachment>, RecordReaderReadError>;\n readonly readSourceNavigation: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<SourceNavigationAttachment>, RecordReaderReadError>;\n readonly readAttemptArtifacts: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<ArtifactsAttachment>, RecordReaderReadError>;\n readonly readSources: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<SourcesAttachment>, RecordReaderReadError>;\n readonly readRunObservability: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<RunObservabilityAttachment>, RecordReaderReadError>;\n readonly readRunArtifacts: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<ArtifactsAttachment>, RecordReaderReadError>;\n}\nexport interface CreateRunRequest {\n readonly root: RecordRoot;\n readonly experimentId: ExperimentId;\n /** Required historical interpretation facts, written once into `run.json`. */\n readonly context: RunContext;\n readonly startedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\nexport interface CreateReferenceRunRequest extends CreateRunRequest {\n}\nexport interface RunCompletion {\n readonly completedAt: UtcMillis;\n}\nexport interface RecordSealReceipt {\n readonly runId: RunId;\n readonly state: \"sealed\";\n}\nexport interface AttemptWriteSession {\n readonly attemptId: AttemptId;\n readonly slotId: SlotId;\n readonly [attemptWriteSessionBrand]: () => void;\n readonly complete: (outcome: AttemptDocument[\"outcome\"]) => Effect.Effect<void, RecordWriteError>;\n readonly writeAssertions: <E, R>(value: AssertionsWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeAttemptObservability: <E, R>(value: AttemptObservabilityWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeFileChanges: <E, R>(value: FileChangesWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeSourceNavigation: <E, R>(value: SourceNavigationWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeAttemptArtifacts: <E, R>(value: AttemptArtifactsWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n}\n/** One session owns exactly one freshly exclusive RunId directory. */\nexport interface RunWriteSession {\n readonly runId: RunId;\n readonly [runWriteSessionBrand]: () => void;\n readonly createAttempt: (input: {\n readonly slotId: SlotId;\n }) => Effect.Effect<AttemptWriteSession, RecordWriteError>;\n readonly referenceAttempt: (input: {\n readonly slotId: SlotId;\n readonly action: \"carried\" | \"accepted\";\n readonly attempt: SelectedAttemptRef;\n }) => Effect.Effect<void, RecordWriteError>;\n /**\n * Explicit adoption / rename: occupy one current target Slot with an already\n * selected origin Attempt. The target Slot identity may differ from the\n * origin Attempt. This is not a generic Attachment writer.\n */\n readonly recordAcceptedMembership: (input: {\n readonly slotId: SlotId;\n readonly attempt: SelectedAttemptRef;\n }) => Effect.Effect<void, RecordWriteError>;\n readonly recordTerminalMember: (input: {\n readonly slotId: SlotId;\n readonly action: \"not-dispatched\" | \"interrupted\";\n }) => Effect.Effect<void, RecordWriteError>;\n readonly writeSources: <E, R>(value: SourcesWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeRunObservability: <E, R>(value: RunObservabilityWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeRunArtifacts: <E, R>(value: RunArtifactsWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly seal: (completion: RunCompletion) => Effect.Effect<RecordSealReceipt, RecordWriteError>;\n}\n/** A Run created solely from already-selected, sealed Attempts. */\nexport interface ReferenceRunWriteSession {\n readonly runId: RunId;\n readonly [runWriteSessionBrand]: () => void;\n readonly referenceAttempt: RunWriteSession[\"referenceAttempt\"];\n readonly recordAcceptedMembership: RunWriteSession[\"recordAcceptedMembership\"];\n readonly recordTerminalMember: RunWriteSession[\"recordTerminalMember\"];\n readonly writeRunObservability: RunWriteSession[\"writeRunObservability\"];\n readonly writeRunArtifacts: RunWriteSession[\"writeRunArtifacts\"];\n readonly seal: RunWriteSession[\"seal\"];\n}\nexport type RecordFormatInspection = {\n readonly state: \"already-current\";\n readonly format: \"niceeval.record\";\n} | {\n readonly state: \"migration-required\";\n readonly format: \"niceeval.record\";\n} | {\n readonly state: \"unsupported-format\";\n readonly format: string;\n};\nexport interface RecordAttachmentMigrationTarget {\n readonly family: string;\n readonly owner: \"attempt\" | \"run\";\n readonly runId: RunId;\n readonly attemptId?: AttemptId;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n}\nexport type RecordMigrationPlan = {\n readonly state: \"already-current\";\n readonly format: \"niceeval.record\";\n} | {\n readonly state: \"migration-required\";\n readonly format: \"niceeval.record\";\n readonly backup: RecordBackupState;\n readonly root: {\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n } | null;\n readonly attachments: readonly RecordAttachmentMigrationTarget[];\n} | {\n readonly state: \"unsupported-format\";\n readonly format: string;\n};\nexport interface RecordMigrationReceipt {\n readonly state: \"already-current\" | \"migrated\";\n readonly format: \"niceeval.record\";\n}\nexport interface RecordMaintenanceSession {\n readonly inspect: () => Effect.Effect<RecordFormatInspection, RecordMaintenanceError>;\n readonly planMigrate: () => Effect.Effect<RecordMigrationPlan, RecordMaintenanceError>;\n readonly applyMigrate: (plan: RecordMigrationPlan) => Effect.Effect<RecordMigrationReceipt, RecordMaintenanceError>;\n}\nexport interface RecordHostSDK {\n readonly current: {\n readonly openRead: (input: {\n readonly root: RecordRoot;\n }) => Effect.Effect<RecordReadSession, RecordReaderOpenError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n readonly createRun: (request: CreateRunRequest) => Effect.Effect<RunWriteSession, RecordReaderOpenError | RecordWriteError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../platform/services.ts\").RecordEntropy | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n readonly createReferenceRun: (request: CreateReferenceRunRequest) => Effect.Effect<ReferenceRunWriteSession, RecordReaderOpenError | RecordWriteError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../platform/services.ts\").RecordEntropy | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n };\n readonly maintenance: {\n readonly open: (input: {\n readonly root: RecordRoot;\n }) => Effect.Effect<RecordMaintenanceSession, RecordMaintenanceOpenError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../platform/services.ts\").RecordGit | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n };\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;AAkBa,QAAA,mBAAmB,GAAkB,MAAM,CAAC,iCAAiC,CAAC,CAAC;AAC/E,QAAA,uBAAuB,GAAkB,MAAM,CAAC,qCAAqC,CAAC,CAAC;AACvF,QAAA,qBAAqB,GAAkB,MAAM,CAAC,mCAAmC,CAAC,CAAC;AACnF,QAAA,oBAAoB,GAAkB,MAAM,CAAC,kCAAkC,CAAC,CAAC;AACjF,QAAA,wBAAwB,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC","sourcesContent":["import type { Effect } from \"effect\";\nimport type { RecordAttachmentBlobs, RecordAttachmentPayloadSnapshot, RecordAttachmentWrite, } from \"../attachment/types.ts\";\nimport type { AssertionsAttachment, } from \"../family/assertions.ts\";\nimport type { ArtifactsAttachment, } from \"../family/artifacts.ts\";\nimport type { FileChangesAttachment, } from \"../family/file-changes.ts\";\nimport type { AttemptObservabilityAttachment, RunObservabilityAttachment, } from \"../family/observability.ts\";\nimport type { SourcesAttachment, } from \"../family/sources.ts\";\nimport type { SourceNavigationAttachment, } from \"../family/source-navigation.ts\";\nimport type { AttemptDocument, MemberDocument, RecordSlotIdentity, RunDocument, } from \"../model/core.ts\";\nimport type { RunContext } from \"../model/run-context.ts\";\nimport type { AttemptId, ExperimentId, RunId, SlotId, UtcMillis, } from \"../model/identifiers.ts\";\nimport type { RecordRoot } from \"../platform/root.ts\";\nimport type { RecordBackupState } from \"../platform/services.ts\";\nimport type { RecordCoreRead, RecordWarning } from \"../model/read-state.ts\";\nimport type { NonEmptyRecordIssues } from \"../errors/record-errors.ts\";\nimport type { RecordMaintenanceError, RecordMaintenanceOpenError, RecordReaderOpenError, RecordReaderReadError, } from \"../reader/errors.ts\";\nimport type { RecordWriteError } from \"../writer/types.ts\";\nimport type { RecordAttachmentMigrationRetention } from \"../definition/attachment.ts\";\nexport const selectedRunRefBrand: unique symbol = Symbol(\"@niceeval/record/SelectedRunRef\");\nexport const selectedAttemptRefBrand: unique symbol = Symbol(\"@niceeval/record/SelectedAttemptRef\");\nexport const selectedOwnerRefBrand: unique symbol = Symbol(\"@niceeval/record/SelectedOwnerRef\");\nexport const runWriteSessionBrand: unique symbol = Symbol(\"@niceeval/record/RunWriteSession\");\nexport const attemptWriteSessionBrand: unique symbol = Symbol(\"@niceeval/record/AttemptWriteSession\");\n/** Nominal ref issued only by one live RecordReadSession. */\nexport interface SelectedRunRef {\n readonly runId: RunId;\n readonly [selectedRunRefBrand]: () => void;\n}\n/** Nominal exact reference to one immutable origin Attempt. */\nexport interface SelectedAttemptRef {\n readonly originRunId: RunId;\n readonly attemptId: AttemptId;\n readonly [selectedAttemptRefBrand]: () => void;\n}\n/** Owner handle for a later lazy fixed-family read. */\nexport interface SelectedOwnerRef {\n readonly [selectedOwnerRefBrand]: () => void;\n}\n/**\n * The Host exposes the fixed-family states without importing maintenance.\n * A reachable older version is migration-required. Any other well-formed,\n * non-current version remains unsupported data; malformed envelopes and\n * closures are invalid, never a reader-wide failure.\n */\nexport type FixedFamilyRead<Payload> = {\n readonly state: \"migration-required\";\n readonly family: string;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly command: \"niceeval migrate\";\n} | {\n readonly state: \"available\";\n /** Direct business fields from the current owner value definition. */\n readonly value: RecordAttachmentPayloadSnapshot<Payload>;\n /** Owner-local blob closure for refs found inside `value`. */\n readonly blobs: RecordAttachmentBlobs;\n} | {\n readonly state: \"not-recorded\";\n} | {\n readonly state: \"unsupported\";\n readonly family: string;\n readonly schemaVersion: number;\n} | {\n readonly state: \"invalid\";\n readonly issues: NonEmptyRecordIssues;\n};\n/**\n * These aliases are deliberately owner- and method-specific. Runtime checks\n * additionally require the one installed static descriptor for each method,\n * so a caller cannot introduce another family through this boundary.\n */\nexport type SourcesWrite<E = never, R = never> = RecordAttachmentWrite<\"run\", E, R>;\nexport type RunObservabilityWrite<E = never, R = never> = RecordAttachmentWrite<\"run\", E, R>;\nexport type RunArtifactsWrite<E = never, R = never> = RecordAttachmentWrite<\"run\", E, R>;\nexport type AssertionsWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type AttemptObservabilityWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type FileChangesWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type SourceNavigationWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type AttemptArtifactsWrite<E = never, R = never> = RecordAttachmentWrite<\"attempt\", E, R>;\nexport type RecordSelectionProblem = {\n readonly code: \"incomplete-run\";\n readonly runId: RunId;\n} | {\n readonly code: \"record-core-invalid\";\n readonly runId: RunId;\n} | {\n readonly code: \"selection-run-missing\";\n readonly runId: RunId;\n};\nexport interface RecordSelectionRequest {\n /** Omitted means every Run whose complete marker existed during this scan. */\n readonly runIds?: readonly RunId[];\n}\n/**\n * Closed Run facts verified by scanSelection. They retain the denominator\n * frame if a later member read becomes unavailable; they are not a durable\n * schema and contain no owner capability.\n */\nexport interface SelectedRunFacts {\n readonly run: SelectedRunRef;\n readonly experimentId: ExperimentId;\n readonly startedAt: UtcMillis;\n readonly completedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\n/** A closed candidate set with only selected minimal Core; never Attachment payloads. */\nexport interface RecordSelection {\n readonly runRefs: readonly SelectedRunRef[];\n readonly runFacts: readonly SelectedRunFacts[];\n readonly expectedSlots: readonly {\n readonly run: SelectedRunRef;\n /** Closed at scan time from the selected Run, not stored in RecordSlotIdentity. */\n readonly experimentId: ExperimentId;\n readonly slot: RecordSlotIdentity;\n }[];\n readonly problems: readonly RecordSelectionProblem[];\n readonly warnings: readonly RecordWarning[];\n}\nexport interface ReadableRun {\n readonly ref: SelectedRunRef;\n readonly owner: SelectedOwnerRef;\n readonly document: RunDocument;\n readonly members: readonly {\n readonly document: MemberDocument;\n readonly attempt: SelectedAttemptRef | null;\n }[];\n}\nexport interface ReadableAttempt {\n readonly ref: SelectedAttemptRef;\n readonly owner: SelectedOwnerRef;\n readonly document: AttemptDocument;\n /**\n * Verified while resolving the exact nominal Attempt reference. It is the\n * only origin Run Core projection Sample may use. In particular, a carried\n * or accepted member must retain this origin's execution facts rather than\n * substituting the selected target Run.\n */\n readonly origin: {\n readonly owner: SelectedOwnerRef;\n readonly runId: RunId;\n readonly experimentId: ExperimentId;\n readonly startedAt: UtcMillis;\n readonly context: RunContext;\n };\n}\nexport interface RecordReadSession {\n readonly selectRuns: (request?: RecordSelectionRequest) => Effect.Effect<RecordSelection, RecordReaderReadError>;\n readonly readRun: (ref: SelectedRunRef) => Effect.Effect<RecordCoreRead<ReadableRun>, RecordReaderReadError>;\n readonly readAttempt: (ref: SelectedAttemptRef) => Effect.Effect<RecordCoreRead<ReadableAttempt>, RecordReaderReadError>;\n readonly readAssertions: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<AssertionsAttachment>, RecordReaderReadError>;\n readonly readAttemptObservability: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<AttemptObservabilityAttachment>, RecordReaderReadError>;\n readonly readFileChanges: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<FileChangesAttachment>, RecordReaderReadError>;\n readonly readSourceNavigation: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<SourceNavigationAttachment>, RecordReaderReadError>;\n readonly readAttemptArtifacts: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<ArtifactsAttachment>, RecordReaderReadError>;\n readonly readSources: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<SourcesAttachment>, RecordReaderReadError>;\n readonly readRunObservability: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<RunObservabilityAttachment>, RecordReaderReadError>;\n readonly readRunArtifacts: (owner: SelectedOwnerRef) => Effect.Effect<FixedFamilyRead<ArtifactsAttachment>, RecordReaderReadError>;\n}\nexport interface CreateRunRequest {\n readonly root: RecordRoot;\n readonly experimentId: ExperimentId;\n /** Required historical interpretation facts, written once into `run.json`. */\n readonly context: RunContext;\n readonly startedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\nexport interface CreateReferenceRunRequest extends CreateRunRequest {\n}\nexport interface RunCompletion {\n readonly completedAt: UtcMillis;\n}\nexport interface RecordSealReceipt {\n readonly runId: RunId;\n readonly state: \"sealed\";\n}\nexport interface AttemptWriteSession {\n readonly attemptId: AttemptId;\n readonly slotId: SlotId;\n readonly [attemptWriteSessionBrand]: () => void;\n readonly complete: (outcome: AttemptDocument[\"outcome\"]) => Effect.Effect<void, RecordWriteError>;\n readonly writeAssertions: <E, R>(value: AssertionsWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeAttemptObservability: <E, R>(value: AttemptObservabilityWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeFileChanges: <E, R>(value: FileChangesWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeSourceNavigation: <E, R>(value: SourceNavigationWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeAttemptArtifacts: <E, R>(value: AttemptArtifactsWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n}\n/** One session owns exactly one freshly exclusive RunId directory. */\nexport interface RunWriteSession {\n readonly runId: RunId;\n readonly [runWriteSessionBrand]: () => void;\n readonly createAttempt: (input: {\n readonly slotId: SlotId;\n }) => Effect.Effect<AttemptWriteSession, RecordWriteError>;\n readonly referenceAttempt: (input: {\n readonly slotId: SlotId;\n readonly action: \"carried\" | \"accepted\";\n readonly attempt: SelectedAttemptRef;\n }) => Effect.Effect<void, RecordWriteError>;\n /**\n * Explicit adoption / rename: occupy one current target Slot with an already\n * selected origin Attempt. The target Slot identity may differ from the\n * origin Attempt. This is not a generic Attachment writer.\n */\n readonly recordAcceptedMembership: (input: {\n readonly slotId: SlotId;\n readonly attempt: SelectedAttemptRef;\n }) => Effect.Effect<void, RecordWriteError>;\n readonly recordTerminalMember: (input: {\n readonly slotId: SlotId;\n readonly action: \"not-dispatched\" | \"interrupted\";\n }) => Effect.Effect<void, RecordWriteError>;\n readonly writeSources: <E, R>(value: SourcesWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeRunObservability: <E, R>(value: RunObservabilityWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly writeRunArtifacts: <E, R>(value: RunArtifactsWrite<E, R>) => Effect.Effect<void, RecordWriteError | E, R>;\n readonly seal: (completion: RunCompletion) => Effect.Effect<RecordSealReceipt, RecordWriteError>;\n}\n/** A Run created solely from already-selected, sealed Attempts. */\nexport interface ReferenceRunWriteSession {\n readonly runId: RunId;\n readonly [runWriteSessionBrand]: () => void;\n readonly referenceAttempt: RunWriteSession[\"referenceAttempt\"];\n readonly recordAcceptedMembership: RunWriteSession[\"recordAcceptedMembership\"];\n readonly recordTerminalMember: RunWriteSession[\"recordTerminalMember\"];\n readonly writeRunObservability: RunWriteSession[\"writeRunObservability\"];\n readonly writeRunArtifacts: RunWriteSession[\"writeRunArtifacts\"];\n readonly seal: RunWriteSession[\"seal\"];\n}\nexport type RecordFormatInspection = {\n readonly state: \"already-current\";\n readonly format: \"niceeval.record\";\n} | {\n readonly state: \"migration-required\";\n readonly format: \"niceeval.record\";\n} | {\n readonly state: \"unsupported-format\";\n readonly format: string;\n};\nexport interface RecordAttachmentMigrationTarget {\n readonly family: string;\n readonly owner: \"attempt\" | \"run\";\n readonly runId: RunId;\n readonly attemptId?: AttemptId;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly retention: RecordAttachmentMigrationRetention;\n}\nexport type RecordMigrationPlan = {\n readonly state: \"already-current\";\n readonly format: \"niceeval.record\";\n} | {\n readonly state: \"migration-required\";\n readonly format: \"niceeval.record\";\n readonly backup: RecordBackupState;\n readonly attachments: readonly RecordAttachmentMigrationTarget[];\n} | {\n readonly state: \"unsupported-format\";\n readonly format: string;\n};\nexport type RecordMigrationReceipt = {\n readonly state: \"already-current\";\n readonly format: \"niceeval.record\";\n} | {\n readonly state: \"migrated\";\n readonly format: \"niceeval.record\";\n readonly attachments: readonly RecordAttachmentMigrationTarget[];\n};\nexport interface RecordMaintenanceSession {\n readonly inspect: () => Effect.Effect<RecordFormatInspection, RecordMaintenanceError>;\n readonly planMigrate: () => Effect.Effect<RecordMigrationPlan, RecordMaintenanceError>;\n readonly applyMigrate: (plan: RecordMigrationPlan) => Effect.Effect<RecordMigrationReceipt, RecordMaintenanceError>;\n}\nexport interface RecordHostSDK {\n readonly current: {\n readonly openRead: (input: {\n readonly root: RecordRoot;\n }) => Effect.Effect<RecordReadSession, RecordReaderOpenError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n readonly createRun: (request: CreateRunRequest) => Effect.Effect<RunWriteSession, RecordReaderOpenError | RecordWriteError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../platform/services.ts\").RecordEntropy | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n readonly createReferenceRun: (request: CreateReferenceRunRequest) => Effect.Effect<ReferenceRunWriteSession, RecordReaderOpenError | RecordWriteError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../platform/services.ts\").RecordEntropy | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n };\n readonly maintenance: {\n readonly open: (input: {\n readonly root: RecordRoot;\n }) => Effect.Effect<RecordMaintenanceSession, RecordMaintenanceOpenError, import(\"effect\").Scope.Scope | import(\"../platform/services.ts\").RecordFileSystem | import(\"../platform/services.ts\").RecordGit | import(\"../../coordination/record-leases.ts\").RecordCoordination>;\n };\n}\n"]}
@@ -15,6 +15,7 @@ import type { RecordCoreRead, RecordWarning } from "../model/read-state.cjs";
15
15
  import type { NonEmptyRecordIssues } from "../errors/record-errors.cjs";
16
16
  import type { RecordMaintenanceError, RecordMaintenanceOpenError, RecordReaderOpenError, RecordReaderReadError } from "../reader/errors.cjs";
17
17
  import type { RecordWriteError } from "../writer/types.cjs";
18
+ import type { RecordAttachmentMigrationRetention } from "../definition/attachment.cjs";
18
19
  export declare const selectedRunRefBrand: unique symbol;
19
20
  export declare const selectedAttemptRefBrand: unique symbol;
20
21
  export declare const selectedOwnerRefBrand: unique symbol;
@@ -241,6 +242,7 @@ export interface RecordAttachmentMigrationTarget {
241
242
  readonly attemptId?: AttemptId;
242
243
  readonly fromSchemaVersion: number;
243
244
  readonly toSchemaVersion: number;
245
+ readonly retention: RecordAttachmentMigrationRetention;
244
246
  }
245
247
  export type RecordMigrationPlan = {
246
248
  readonly state: "already-current";
@@ -249,19 +251,19 @@ export type RecordMigrationPlan = {
249
251
  readonly state: "migration-required";
250
252
  readonly format: "niceeval.record";
251
253
  readonly backup: RecordBackupState;
252
- readonly root: {
253
- readonly fromSchemaVersion: number;
254
- readonly toSchemaVersion: number;
255
- } | null;
256
254
  readonly attachments: readonly RecordAttachmentMigrationTarget[];
257
255
  } | {
258
256
  readonly state: "unsupported-format";
259
257
  readonly format: string;
260
258
  };
261
- export interface RecordMigrationReceipt {
262
- readonly state: "already-current" | "migrated";
259
+ export type RecordMigrationReceipt = {
260
+ readonly state: "already-current";
263
261
  readonly format: "niceeval.record";
264
- }
262
+ } | {
263
+ readonly state: "migrated";
264
+ readonly format: "niceeval.record";
265
+ readonly attachments: readonly RecordAttachmentMigrationTarget[];
266
+ };
265
267
  export interface RecordMaintenanceSession {
266
268
  readonly inspect: () => Effect.Effect<RecordFormatInspection, RecordMaintenanceError>;
267
269
  readonly planMigrate: () => Effect.Effect<RecordMigrationPlan, RecordMaintenanceError>;
@@ -15,6 +15,7 @@ import type { RecordCoreRead, RecordWarning } from "../model/read-state.mjs";
15
15
  import type { NonEmptyRecordIssues } from "../errors/record-errors.mjs";
16
16
  import type { RecordMaintenanceError, RecordMaintenanceOpenError, RecordReaderOpenError, RecordReaderReadError } from "../reader/errors.mjs";
17
17
  import type { RecordWriteError } from "../writer/types.mjs";
18
+ import type { RecordAttachmentMigrationRetention } from "../definition/attachment.mjs";
18
19
  export declare const selectedRunRefBrand: unique symbol;
19
20
  export declare const selectedAttemptRefBrand: unique symbol;
20
21
  export declare const selectedOwnerRefBrand: unique symbol;
@@ -241,6 +242,7 @@ export interface RecordAttachmentMigrationTarget {
241
242
  readonly attemptId?: AttemptId;
242
243
  readonly fromSchemaVersion: number;
243
244
  readonly toSchemaVersion: number;
245
+ readonly retention: RecordAttachmentMigrationRetention;
244
246
  }
245
247
  export type RecordMigrationPlan = {
246
248
  readonly state: "already-current";
@@ -249,19 +251,19 @@ export type RecordMigrationPlan = {
249
251
  readonly state: "migration-required";
250
252
  readonly format: "niceeval.record";
251
253
  readonly backup: RecordBackupState;
252
- readonly root: {
253
- readonly fromSchemaVersion: number;
254
- readonly toSchemaVersion: number;
255
- } | null;
256
254
  readonly attachments: readonly RecordAttachmentMigrationTarget[];
257
255
  } | {
258
256
  readonly state: "unsupported-format";
259
257
  readonly format: string;
260
258
  };
261
- export interface RecordMigrationReceipt {
262
- readonly state: "already-current" | "migrated";
259
+ export type RecordMigrationReceipt = {
260
+ readonly state: "already-current";
263
261
  readonly format: "niceeval.record";
264
- }
262
+ } | {
263
+ readonly state: "migrated";
264
+ readonly format: "niceeval.record";
265
+ readonly attachments: readonly RecordAttachmentMigrationTarget[];
266
+ };
265
267
  export interface RecordMaintenanceSession {
266
268
  readonly inspect: () => Effect.Effect<RecordFormatInspection, RecordMaintenanceError>;
267
269
  readonly planMigrate: () => Effect.Effect<RecordMigrationPlan, RecordMaintenanceError>;
@@ -15,6 +15,7 @@ import type { RecordCoreRead, RecordWarning } from "../model/read-state.js";
15
15
  import type { NonEmptyRecordIssues } from "../errors/record-errors.js";
16
16
  import type { RecordMaintenanceError, RecordMaintenanceOpenError, RecordReaderOpenError, RecordReaderReadError } from "../reader/errors.js";
17
17
  import type { RecordWriteError } from "../writer/types.js";
18
+ import type { RecordAttachmentMigrationRetention } from "../definition/attachment.js";
18
19
  export declare const selectedRunRefBrand: unique symbol;
19
20
  export declare const selectedAttemptRefBrand: unique symbol;
20
21
  export declare const selectedOwnerRefBrand: unique symbol;
@@ -241,6 +242,7 @@ export interface RecordAttachmentMigrationTarget {
241
242
  readonly attemptId?: AttemptId;
242
243
  readonly fromSchemaVersion: number;
243
244
  readonly toSchemaVersion: number;
245
+ readonly retention: RecordAttachmentMigrationRetention;
244
246
  }
245
247
  export type RecordMigrationPlan = {
246
248
  readonly state: "already-current";
@@ -249,19 +251,19 @@ export type RecordMigrationPlan = {
249
251
  readonly state: "migration-required";
250
252
  readonly format: "niceeval.record";
251
253
  readonly backup: RecordBackupState;
252
- readonly root: {
253
- readonly fromSchemaVersion: number;
254
- readonly toSchemaVersion: number;
255
- } | null;
256
254
  readonly attachments: readonly RecordAttachmentMigrationTarget[];
257
255
  } | {
258
256
  readonly state: "unsupported-format";
259
257
  readonly format: string;
260
258
  };
261
- export interface RecordMigrationReceipt {
262
- readonly state: "already-current" | "migrated";
259
+ export type RecordMigrationReceipt = {
260
+ readonly state: "already-current";
263
261
  readonly format: "niceeval.record";
264
- }
262
+ } | {
263
+ readonly state: "migrated";
264
+ readonly format: "niceeval.record";
265
+ readonly attachments: readonly RecordAttachmentMigrationTarget[];
266
+ };
265
267
  export interface RecordMaintenanceSession {
266
268
  readonly inspect: () => Effect.Effect<RecordFormatInspection, RecordMaintenanceError>;
267
269
  readonly planMigrate: () => Effect.Effect<RecordMigrationPlan, RecordMaintenanceError>;
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":";;AAwEA,8DAEC;AAHD,kFAAkF;AAClF,SAAgB,yBAAyB,CAAC,GAAqB;IAC3D,OAAO,GAAG,GAAG,CAAC,WAAW,SAAS,GAAG,CAAC,SAAS,EAAE,CAAC;AACtD,CAAC","sourcesContent":["import type { AttemptId, EvalId, ExecutionIdentityDigest, ExperimentId, RecordFormat, RecordId, RunId, SlotId, UtcMillis, } from \"./identifiers.ts\";\nimport type { RunContext } from \"./run-context.ts\";\n/** The current root header keeps stable identity separate from schema version. */\nexport interface RecordDocument {\n readonly format: RecordFormat;\n readonly schemaVersion: 2;\n readonly recordId: RecordId;\n}\n/** An exact reference to an immutable origin Attempt. */\nexport interface RecordAttemptRef {\n readonly originRunId: RunId;\n readonly attemptId: AttemptId;\n}\n/** The terminal execution fact required to interpret an origin Attempt. */\nexport type AttemptOutcome = \"completed\" | \"errored\" | \"cancelled\" | \"interrupted\";\n/** The immutable final action for one planned denominator Slot. */\nexport type MembershipAction = \"executed\" | \"carried\" | \"accepted\" | \"not-dispatched\" | \"interrupted\";\n/** Exact planned identity; its existing digest remains the only execution identity. */\nexport interface RecordSlotIdentity {\n readonly slotId: SlotId;\n readonly evalId: EvalId;\n /** Zero-based planned attempt identity; never inferred from array position. */\n readonly attemptOrdinal: number;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n}\n/** The exact durable contents of one sealed `run.json`. */\nexport interface RunDocument {\n readonly runId: RunId;\n readonly experimentId: ExperimentId;\n /** Mandatory historical Core, sealed once with the Run. */\n readonly context: RunContext;\n readonly startedAt: UtcMillis;\n readonly completedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\n/** The exact durable contents of `members/<SlotId>.json`. */\nexport type MemberDocument = {\n readonly slotId: SlotId;\n readonly action: \"executed\" | \"carried\" | \"accepted\";\n readonly attempt: RecordAttemptRef;\n} | {\n readonly slotId: SlotId;\n readonly action: \"not-dispatched\" | \"interrupted\";\n readonly attempt: null;\n};\n/** The exact durable contents of `attempts/<AttemptId>/attempt.json`. */\nexport interface AttemptDocument {\n readonly attemptId: AttemptId;\n readonly originRunId: RunId;\n readonly slotId: SlotId;\n readonly evalId: EvalId;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n readonly outcome: AttemptOutcome;\n}\n/** Stable fixed-family identity plus the numeric shape version. */\nexport interface RecordAttachmentEnvelope<Family extends string = string> {\n readonly family: Family;\n readonly schemaVersion: number;\n}\nexport type RecordAttachmentOwner = \"run\" | \"attempt\";\n/** In-memory aggregate for cross-document Core refine; never a second disk document. */\nexport interface RunCore {\n readonly run: RunDocument;\n readonly members: readonly MemberDocument[];\n readonly attempts: readonly AttemptDocument[];\n}\n/** A complete already-published Record Core snapshot. */\nexport interface RecordCore {\n readonly record: RecordDocument;\n readonly runs: readonly RunCore[];\n}\n/** NUL cannot appear in a portable segment, so this map key is collision-free. */\nexport function recordAttemptReferenceKey(ref: RecordAttemptRef): string {\n return `${ref.originRunId}\\u0000${ref.attemptId}`;\n}\n"]}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":";;AAuEA,8DAEC;AAHD,kFAAkF;AAClF,SAAgB,yBAAyB,CAAC,GAAqB;IAC3D,OAAO,GAAG,GAAG,CAAC,WAAW,SAAS,GAAG,CAAC,SAAS,EAAE,CAAC;AACtD,CAAC","sourcesContent":["import type { AttemptId, EvalId, ExecutionIdentityDigest, ExperimentId, RecordFormat, RecordId, RunId, SlotId, UtcMillis, } from \"./identifiers.ts\";\nimport type { RunContext } from \"./run-context.ts\";\n/** The versionless root header; a future incompatible root uses a new format identity. */\nexport interface RecordDocument {\n readonly format: RecordFormat;\n readonly recordId: RecordId;\n}\n/** An exact reference to an immutable origin Attempt. */\nexport interface RecordAttemptRef {\n readonly originRunId: RunId;\n readonly attemptId: AttemptId;\n}\n/** The terminal execution fact required to interpret an origin Attempt. */\nexport type AttemptOutcome = \"completed\" | \"errored\" | \"cancelled\" | \"interrupted\";\n/** The immutable final action for one planned denominator Slot. */\nexport type MembershipAction = \"executed\" | \"carried\" | \"accepted\" | \"not-dispatched\" | \"interrupted\";\n/** Exact planned identity; its existing digest remains the only execution identity. */\nexport interface RecordSlotIdentity {\n readonly slotId: SlotId;\n readonly evalId: EvalId;\n /** Zero-based planned attempt identity; never inferred from array position. */\n readonly attemptOrdinal: number;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n}\n/** The exact durable contents of one sealed `run.json`. */\nexport interface RunDocument {\n readonly runId: RunId;\n readonly experimentId: ExperimentId;\n /** Mandatory historical Core, sealed once with the Run. */\n readonly context: RunContext;\n readonly startedAt: UtcMillis;\n readonly completedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\n/** The exact durable contents of `members/<SlotId>.json`. */\nexport type MemberDocument = {\n readonly slotId: SlotId;\n readonly action: \"executed\" | \"carried\" | \"accepted\";\n readonly attempt: RecordAttemptRef;\n} | {\n readonly slotId: SlotId;\n readonly action: \"not-dispatched\" | \"interrupted\";\n readonly attempt: null;\n};\n/** The exact durable contents of `attempts/<AttemptId>/attempt.json`. */\nexport interface AttemptDocument {\n readonly attemptId: AttemptId;\n readonly originRunId: RunId;\n readonly slotId: SlotId;\n readonly evalId: EvalId;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n readonly outcome: AttemptOutcome;\n}\n/** Stable fixed-family identity plus the numeric shape version. */\nexport interface RecordAttachmentEnvelope<Family extends string = string> {\n readonly family: Family;\n readonly schemaVersion: number;\n}\nexport type RecordAttachmentOwner = \"run\" | \"attempt\";\n/** In-memory aggregate for cross-document Core refine; never a second disk document. */\nexport interface RunCore {\n readonly run: RunDocument;\n readonly members: readonly MemberDocument[];\n readonly attempts: readonly AttemptDocument[];\n}\n/** A complete already-published Record Core snapshot. */\nexport interface RecordCore {\n readonly record: RecordDocument;\n readonly runs: readonly RunCore[];\n}\n/** NUL cannot appear in a portable segment, so this map key is collision-free. */\nexport function recordAttemptReferenceKey(ref: RecordAttemptRef): string {\n return `${ref.originRunId}\\u0000${ref.attemptId}`;\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  import type { AttemptId, EvalId, ExecutionIdentityDigest, ExperimentId, RecordFormat, RecordId, RunId, SlotId, UtcMillis } from "./identifiers.cjs";
2
2
  import type { RunContext } from "./run-context.cjs";
3
- /** The current root header keeps stable identity separate from schema version. */
3
+ /** The versionless root header; a future incompatible root uses a new format identity. */
4
4
  export interface RecordDocument {
5
5
  readonly format: RecordFormat;
6
- readonly schemaVersion: 2;
7
6
  readonly recordId: RecordId;
8
7
  }
9
8
  /** An exact reference to an immutable origin Attempt. */
@@ -1,9 +1,8 @@
1
1
  import type { AttemptId, EvalId, ExecutionIdentityDigest, ExperimentId, RecordFormat, RecordId, RunId, SlotId, UtcMillis } from "./identifiers.mjs";
2
2
  import type { RunContext } from "./run-context.mjs";
3
- /** The current root header keeps stable identity separate from schema version. */
3
+ /** The versionless root header; a future incompatible root uses a new format identity. */
4
4
  export interface RecordDocument {
5
5
  readonly format: RecordFormat;
6
- readonly schemaVersion: 2;
7
6
  readonly recordId: RecordId;
8
7
  }
9
8
  /** An exact reference to an immutable origin Attempt. */
@@ -1,9 +1,8 @@
1
1
  import type { AttemptId, EvalId, ExecutionIdentityDigest, ExperimentId, RecordFormat, RecordId, RunId, SlotId, UtcMillis } from "./identifiers.js";
2
2
  import type { RunContext } from "./run-context.js";
3
- /** The current root header keeps stable identity separate from schema version. */
3
+ /** The versionless root header; a future incompatible root uses a new format identity. */
4
4
  export interface RecordDocument {
5
5
  readonly format: RecordFormat;
6
- readonly schemaVersion: 2;
7
6
  readonly recordId: RecordId;
8
7
  }
9
8
  /** An exact reference to an immutable origin Attempt. */
@@ -60,10 +60,9 @@ exports.RecordSlotIdentityDefinition = (0, index_ts_1.defineRecordCore)({
60
60
  exports.RecordSlotIdentitySchema = exports.RecordSlotIdentityDefinition.schema;
61
61
  const RecordDocumentCurrentSchema = effect_1.Schema.Struct({
62
62
  format: identifiers_ts_1.RecordFormatSchema,
63
- schemaVersion: identifiers_ts_1.RecordSchemaVersionSchema,
64
63
  recordId: identifiers_ts_1.RecordIdSchema,
65
64
  });
66
- /** The current root header definition, with identity separate from numeric version. */
65
+ /** The exact versionless root header definition. */
67
66
  exports.RecordDocumentDefinition = (0, index_ts_1.defineRecordCore)({
68
67
  schema: RecordDocumentCurrentSchema,
69
68
  limits: exports.RecordCoreDocumentLimits,
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["definition.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,qDAAoF;AACpF,4DAAuO;AAEvO,qDAAoD;AACpD,mDAA4H;AAE5H,6EAA6E;AAChE,QAAA,wBAAwB,GAAuB,MAAM,CAAC,MAAM,CAAC;IACtE,gBAAgB,EAAE,IAAI,GAAG,IAAI;IAC7B,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,EAAE;IACrB,iBAAiB,EAAE,GAAG;IACtB,mBAAmB,EAAE,GAAG;IACxB,sBAAsB,EAAE,CAAC,GAAG,IAAI;CACnC,CAAC,CAAC;AACH,mFAAmF;AACtE,QAAA,yBAAyB,GAAuB,MAAM,CAAC,MAAM,CAAC;IACvE,GAAG,gCAAwB;IAC3B,gBAAgB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACjC,YAAY,EAAE,KAAK;IACnB,iBAAiB,EAAE,IAAI;CAC1B,CAAC,CAAC;AACH,SAAS,kBAAkB,CAAC,MAA8B;IACtD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC;QACtB,CAAC,CAAC,SAAS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CAAyB,CAAC,MAAM,CAAC;AACtE,MAAM,oBAAoB,GAAG,eAAM,CAAC,MAAM,CAAC;IACvC,GAAG,EAAE,yBAAiB;IACtB,OAAO,EAAE,eAAM,CAAC,KAAK,CAAC,4BAAoB,CAAC;IAC3C,QAAQ,EAAE,eAAM,CAAC,KAAK,CAAC,6BAAqB,CAAC;CAChD,CAAC,CAAC;AACU,QAAA,iBAAiB,GAAG,IAAA,2BAAgB,EAAC;IAC9C,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,iCAAyB;CACpC,CAAC,CAAC;AACU,QAAA,aAAa,GAAG,yBAAiB,CAAC,MAAM,CAAC;AACtD,MAAM,uBAAuB,GAAG,eAAM,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,4BAAoB;IAC5B,IAAI,EAAE,eAAM,CAAC,KAAK,CAAC,qBAAa,CAAC;CACpC,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAA,kCAAkB,EAAC,KAAK,CAAC,CAAC,EAAE;IAC5E,UAAU,EAAE,qBAAqB;IACjC,WAAW,EAAE,2EAA2E;CAC3F,CAAC,CAAC,CAAC;AACJ,yEAAyE;AAC5D,QAAA,oBAAoB,GAAG,IAAA,2BAAgB,EAAC;IACjD,MAAM,EAAE,uBAAuB;IAC/B,MAAM,EAAE,iCAAyB;CACpC,CAAC,CAAC;AACU,QAAA,gBAAgB,GAAG,4BAAoB,CAAC,MAAM,CAAC","sourcesContent":["import { Schema } from \"effect\";\nimport { defineRecordCore, type RecordSchemaLimits, } from \"../definition/index.ts\";\nimport { AttemptIdSchema, EvalIdSchema, ExecutionIdentityDigestSchema, ExperimentIdSchema, RecordFormatSchema, RecordIdSchema, RecordSchemaVersionSchema, RunIdSchema, SlotIdSchema, UtcMillisSchema, } from \"../codec/identifiers.ts\";\nimport type { AttemptOutcome, MemberDocument, MembershipAction, } from \"./core.ts\";\nimport { RunContextSchema } from \"./run-context.ts\";\nimport { validateAttemptDocument, validateMemberDocument, validateRecordCore, validateRunDocument, } from \"./validation.ts\";\nimport type { RecordIssue } from \"../errors/record-errors.ts\";\n/** Full durable-document budget; Host separately caps each read at 1 MiB. */\nexport const RecordCoreDocumentLimits: RecordSchemaLimits = Object.freeze({\n maximumJsonBytes: 1024 * 1024,\n maximumDepth: 8,\n maximumNodes: 4096,\n maximumObjectKeys: 64,\n maximumArrayItems: 256,\n maximumKeyUtf8Bytes: 256,\n maximumStringUtf8Bytes: 8 * 1024,\n});\n/** The in-memory aggregate has the same hostile-JS rules but a larger run list. */\nexport const RecordCoreAggregateLimits: RecordSchemaLimits = Object.freeze({\n ...RecordCoreDocumentLimits,\n maximumJsonBytes: 8 * 1024 * 1024,\n maximumNodes: 32768,\n maximumArrayItems: 4096,\n});\nfunction schemaFilterIssues(issues: readonly RecordIssue[]): readonly Schema.FilterIssue[] | undefined {\n return issues.length === 0\n ? undefined\n : issues.map((issue) => ({\n path: issue.path,\n message: issue.code,\n }));\n}\nconst AttemptOutcomeSchema: Schema.Schema<AttemptOutcome> = Schema.Literal(\"completed\", \"errored\", \"cancelled\", \"interrupted\");\nconst MembershipActionSchema: Schema.Schema<MembershipAction> = Schema.Literal(\"executed\", \"carried\", \"accepted\", \"not-dispatched\", \"interrupted\");\n/** Durable Slot ordinals are zero-based JSON-safe integers, not array indexes. */\nconst AttemptOrdinalSchema = Schema.JsonNumber.pipe(Schema.filter((value) => Number.isSafeInteger(value) && value >= 0, {\n identifier: \"RecordAttemptOrdinal\",\n description: \"a zero-based non-negative JSON-safe attempt ordinal\",\n}));\nconst RecordAttemptRefCurrentSchema = Schema.Struct({\n originRunId: RunIdSchema,\n attemptId: AttemptIdSchema,\n});\nexport const RecordAttemptRefDefinition = defineRecordCore({\n schema: RecordAttemptRefCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RecordAttemptRefSchema = RecordAttemptRefDefinition.schema;\nconst RecordSlotIdentityCurrentSchema = Schema.Struct({\n slotId: SlotIdSchema,\n evalId: EvalIdSchema,\n attemptOrdinal: AttemptOrdinalSchema,\n executionIdentityDigest: ExecutionIdentityDigestSchema,\n});\nexport const RecordSlotIdentityDefinition = defineRecordCore({\n schema: RecordSlotIdentityCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RecordSlotIdentitySchema = RecordSlotIdentityDefinition.schema;\nconst RecordDocumentCurrentSchema = Schema.Struct({\n format: RecordFormatSchema,\n schemaVersion: RecordSchemaVersionSchema,\n recordId: RecordIdSchema,\n});\n/** The current root header definition, with identity separate from numeric version. */\nexport const RecordDocumentDefinition = defineRecordCore({\n schema: RecordDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RecordDocumentSchema = RecordDocumentDefinition.schema;\nconst RunDocumentCurrentSchema = Schema.Struct({\n runId: RunIdSchema,\n experimentId: ExperimentIdSchema,\n context: RunContextSchema,\n startedAt: UtcMillisSchema,\n completedAt: UtcMillisSchema,\n expectedSlots: Schema.Array(RecordSlotIdentitySchema),\n}).pipe(Schema.filter((value) => schemaFilterIssues(validateRunDocument(value)), {\n identifier: \"RecordRunDocumentInvariant\",\n description: \"a Run document with valid chronology, context, and expected Slots\",\n}));\n/** Current sealed `run.json`; its contextual and ordering axioms live in this Schema. */\nexport const RunDocumentDefinition = defineRecordCore({\n schema: RunDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RunDocumentSchema = RunDocumentDefinition.schema;\nconst MemberDocumentBaseSchema = Schema.Struct({\n slotId: SlotIdSchema,\n action: MembershipActionSchema,\n attempt: Schema.NullOr(RecordAttemptRefSchema),\n});\nconst MemberDocumentCurrentSchema = MemberDocumentBaseSchema.pipe(Schema.filter((value) => schemaFilterIssues(validateMemberDocument(value)), {\n identifier: \"RecordMemberDocumentInvariant\",\n description: \"a Member action paired with its required Attempt reference\",\n}), Schema.filter((value): value is MemberDocument => validateMemberDocument(value).length === 0, {\n identifier: \"RecordMemberDocumentType\",\n description: \"a Member document with an action/reference-correlated type\",\n}));\n/** Current `members/<SlotId>.json`; action/reference coupling lives in this Schema. */\nexport const MemberDocumentDefinition = defineRecordCore({\n schema: MemberDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const MemberDocumentSchema = MemberDocumentDefinition.schema;\nconst AttemptDocumentCurrentSchema = Schema.Struct({\n attemptId: AttemptIdSchema,\n originRunId: RunIdSchema,\n slotId: SlotIdSchema,\n evalId: EvalIdSchema,\n executionIdentityDigest: ExecutionIdentityDigestSchema,\n outcome: AttemptOutcomeSchema,\n}).pipe(Schema.filter((value) => schemaFilterIssues(validateAttemptDocument(value)), {\n identifier: \"RecordAttemptDocumentInvariant\",\n description: \"an Attempt document satisfying its local invariant\",\n}));\n/** Current immutable `attempt.json`; aggregate ownership is checked by Record Core. */\nexport const AttemptDocumentDefinition = defineRecordCore({\n schema: AttemptDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const AttemptDocumentSchema = AttemptDocumentDefinition.schema;\nconst RunCoreCurrentSchema = Schema.Struct({\n run: RunDocumentSchema,\n members: Schema.Array(MemberDocumentSchema),\n attempts: Schema.Array(AttemptDocumentSchema),\n});\nexport const RunCoreDefinition = defineRecordCore({\n schema: RunCoreCurrentSchema,\n limits: RecordCoreAggregateLimits,\n});\nexport const RunCoreSchema = RunCoreDefinition.schema;\nconst RecordCoreCurrentSchema = Schema.Struct({\n record: RecordDocumentSchema,\n runs: Schema.Array(RunCoreSchema),\n}).pipe(Schema.filter((value) => schemaFilterIssues(validateRecordCore(value)), {\n identifier: \"RecordCoreInvariant\",\n description: \"a complete Record Core with consistent Run, Member, and Attempt documents\",\n}));\n/** Cross-document Run/Member/Attempt axioms are owned by this Schema. */\nexport const RecordCoreDefinition = defineRecordCore({\n schema: RecordCoreCurrentSchema,\n limits: RecordCoreAggregateLimits,\n});\nexport const RecordCoreSchema = RecordCoreDefinition.schema;\n"]}
1
+ {"version":3,"file":"definition.js","sourceRo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AAI,CAAC,eAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAA,kCAAkB,EAAC,KAAK,CAAC,CAAC,EAAE;IAC5E,UAAU,EAAE,qBAAqB;IACjC,WAAW,EAAE,2EAA2E;CAC3F,CAAC,CAAC,CAAC;AACJ,yEAAyE;AAC5D,QAAA,oBAAoB,GAAG,IAAA,2BAAgB,EAAC;IACjD,MAAM,EAAE,uBAAuB;IAC/B,MAAM,EAAE,iCAAyB;CACpC,CAAC,CAAC;AACU,QAAA,gBAAgB,GAAG,4BAAoB,CAAC,MAAM,CAAC","sourcesContent":["import { Schema } from \"effect\";\nimport { defineRecordCore, type RecordSchemaLimits, } from \"../definition/index.ts\";\nimport { AttemptIdSchema, EvalIdSchema, ExecutionIdentityDigestSchema, ExperimentIdSchema, RecordFormatSchema, RecordIdSchema, RunIdSchema, SlotIdSchema, UtcMillisSchema, } from \"../codec/identifiers.ts\";\nimport type { AttemptOutcome, MemberDocument, MembershipAction, } from \"./core.ts\";\nimport { RunContextSchema } from \"./run-context.ts\";\nimport { validateAttemptDocument, validateMemberDocument, validateRecordCore, validateRunDocument, } from \"./validation.ts\";\nimport type { RecordIssue } from \"../errors/record-errors.ts\";\n/** Full durable-document budget; Host separately caps each read at 1 MiB. */\nexport const RecordCoreDocumentLimits: RecordSchemaLimits = Object.freeze({\n maximumJsonBytes: 1024 * 1024,\n maximumDepth: 8,\n maximumNodes: 4096,\n maximumObjectKeys: 64,\n maximumArrayItems: 256,\n maximumKeyUtf8Bytes: 256,\n maximumStringUtf8Bytes: 8 * 1024,\n});\n/** The in-memory aggregate has the same hostile-JS rules but a larger run list. */\nexport const RecordCoreAggregateLimits: RecordSchemaLimits = Object.freeze({\n ...RecordCoreDocumentLimits,\n maximumJsonBytes: 8 * 1024 * 1024,\n maximumNodes: 32768,\n maximumArrayItems: 4096,\n});\nfunction schemaFilterIssues(issues: readonly RecordIssue[]): readonly Schema.FilterIssue[] | undefined {\n return issues.length === 0\n ? undefined\n : issues.map((issue) => ({\n path: issue.path,\n message: issue.code,\n }));\n}\nconst AttemptOutcomeSchema: Schema.Schema<AttemptOutcome> = Schema.Literal(\"completed\", \"errored\", \"cancelled\", \"interrupted\");\nconst MembershipActionSchema: Schema.Schema<MembershipAction> = Schema.Literal(\"executed\", \"carried\", \"accepted\", \"not-dispatched\", \"interrupted\");\n/** Durable Slot ordinals are zero-based JSON-safe integers, not array indexes. */\nconst AttemptOrdinalSchema = Schema.JsonNumber.pipe(Schema.filter((value) => Number.isSafeInteger(value) && value >= 0, {\n identifier: \"RecordAttemptOrdinal\",\n description: \"a zero-based non-negative JSON-safe attempt ordinal\",\n}));\nconst RecordAttemptRefCurrentSchema = Schema.Struct({\n originRunId: RunIdSchema,\n attemptId: AttemptIdSchema,\n});\nexport const RecordAttemptRefDefinition = defineRecordCore({\n schema: RecordAttemptRefCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RecordAttemptRefSchema = RecordAttemptRefDefinition.schema;\nconst RecordSlotIdentityCurrentSchema = Schema.Struct({\n slotId: SlotIdSchema,\n evalId: EvalIdSchema,\n attemptOrdinal: AttemptOrdinalSchema,\n executionIdentityDigest: ExecutionIdentityDigestSchema,\n});\nexport const RecordSlotIdentityDefinition = defineRecordCore({\n schema: RecordSlotIdentityCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RecordSlotIdentitySchema = RecordSlotIdentityDefinition.schema;\nconst RecordDocumentCurrentSchema = Schema.Struct({\n format: RecordFormatSchema,\n recordId: RecordIdSchema,\n});\n/** The exact versionless root header definition. */\nexport const RecordDocumentDefinition = defineRecordCore({\n schema: RecordDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RecordDocumentSchema = RecordDocumentDefinition.schema;\nconst RunDocumentCurrentSchema = Schema.Struct({\n runId: RunIdSchema,\n experimentId: ExperimentIdSchema,\n context: RunContextSchema,\n startedAt: UtcMillisSchema,\n completedAt: UtcMillisSchema,\n expectedSlots: Schema.Array(RecordSlotIdentitySchema),\n}).pipe(Schema.filter((value) => schemaFilterIssues(validateRunDocument(value)), {\n identifier: \"RecordRunDocumentInvariant\",\n description: \"a Run document with valid chronology, context, and expected Slots\",\n}));\n/** Current sealed `run.json`; its contextual and ordering axioms live in this Schema. */\nexport const RunDocumentDefinition = defineRecordCore({\n schema: RunDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const RunDocumentSchema = RunDocumentDefinition.schema;\nconst MemberDocumentBaseSchema = Schema.Struct({\n slotId: SlotIdSchema,\n action: MembershipActionSchema,\n attempt: Schema.NullOr(RecordAttemptRefSchema),\n});\nconst MemberDocumentCurrentSchema = MemberDocumentBaseSchema.pipe(Schema.filter((value) => schemaFilterIssues(validateMemberDocument(value)), {\n identifier: \"RecordMemberDocumentInvariant\",\n description: \"a Member action paired with its required Attempt reference\",\n}), Schema.filter((value): value is MemberDocument => validateMemberDocument(value).length === 0, {\n identifier: \"RecordMemberDocumentType\",\n description: \"a Member document with an action/reference-correlated type\",\n}));\n/** Current `members/<SlotId>.json`; action/reference coupling lives in this Schema. */\nexport const MemberDocumentDefinition = defineRecordCore({\n schema: MemberDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const MemberDocumentSchema = MemberDocumentDefinition.schema;\nconst AttemptDocumentCurrentSchema = Schema.Struct({\n attemptId: AttemptIdSchema,\n originRunId: RunIdSchema,\n slotId: SlotIdSchema,\n evalId: EvalIdSchema,\n executionIdentityDigest: ExecutionIdentityDigestSchema,\n outcome: AttemptOutcomeSchema,\n}).pipe(Schema.filter((value) => schemaFilterIssues(validateAttemptDocument(value)), {\n identifier: \"RecordAttemptDocumentInvariant\",\n description: \"an Attempt document satisfying its local invariant\",\n}));\n/** Current immutable `attempt.json`; aggregate ownership is checked by Record Core. */\nexport const AttemptDocumentDefinition = defineRecordCore({\n schema: AttemptDocumentCurrentSchema,\n limits: RecordCoreDocumentLimits,\n});\nexport const AttemptDocumentSchema = AttemptDocumentDefinition.schema;\nconst RunCoreCurrentSchema = Schema.Struct({\n run: RunDocumentSchema,\n members: Schema.Array(MemberDocumentSchema),\n attempts: Schema.Array(AttemptDocumentSchema),\n});\nexport const RunCoreDefinition = defineRecordCore({\n schema: RunCoreCurrentSchema,\n limits: RecordCoreAggregateLimits,\n});\nexport const RunCoreSchema = RunCoreDefinition.schema;\nconst RecordCoreCurrentSchema = Schema.Struct({\n record: RecordDocumentSchema,\n runs: Schema.Array(RunCoreSchema),\n}).pipe(Schema.filter((value) => schemaFilterIssues(validateRecordCore(value)), {\n identifier: \"RecordCoreInvariant\",\n description: \"a complete Record Core with consistent Run, Member, and Attempt documents\",\n}));\n/** Cross-document Run/Member/Attempt axioms are owned by this Schema. */\nexport const RecordCoreDefinition = defineRecordCore({\n schema: RecordCoreCurrentSchema,\n limits: RecordCoreAggregateLimits,\n});\nexport const RecordCoreSchema = RecordCoreDefinition.schema;\n"]}
@@ -33,19 +33,16 @@ export declare const RecordSlotIdentitySchema: Schema.Struct<{
33
33
  attemptOrdinal: Schema.filter<typeof Schema.JsonNumber>;
34
34
  executionIdentityDigest: Schema.Schema<import("./identifiers.cjs").ExecutionIdentityDigest, string, never>;
35
35
  }>;
36
- /** The current root header definition, with identity separate from numeric version. */
36
+ /** The exact versionless root header definition. */
37
37
  export declare const RecordDocumentDefinition: import("../definition/core.cjs").RecordCoreDefinition<{
38
- readonly schemaVersion: 2;
39
38
  readonly format: import("./identifiers.cjs").RecordFormat;
40
39
  readonly recordId: import("./identifiers.cjs").RecordId;
41
40
  }, Schema.Struct<{
42
41
  format: Schema.Schema<import("./identifiers.cjs").RecordFormat, "niceeval.record", never>;
43
- schemaVersion: Schema.Schema<2, 2, never>;
44
42
  recordId: Schema.Schema<import("./identifiers.cjs").RecordId, string, never>;
45
43
  }>>;
46
44
  export declare const RecordDocumentSchema: Schema.Struct<{
47
45
  format: Schema.Schema<import("./identifiers.cjs").RecordFormat, "niceeval.record", never>;
48
- schemaVersion: Schema.Schema<2, 2, never>;
49
46
  recordId: Schema.Schema<import("./identifiers.cjs").RecordId, string, never>;
50
47
  }>;
51
48
  /** Current sealed `run.json`; its contextual and ordering axioms live in this Schema. */
@@ -310,7 +307,6 @@ export declare const RunCoreSchema: Schema.Struct<{
310
307
  /** Cross-document Run/Member/Attempt axioms are owned by this Schema. */
311
308
  export declare const RecordCoreDefinition: import("../definition/core.cjs").RecordCoreDefinition<{
312
309
  readonly record: {
313
- readonly schemaVersion: 2;
314
310
  readonly format: import("./identifiers.cjs").RecordFormat;
315
311
  readonly recordId: import("./identifiers.cjs").RecordId;
316
312
  };
@@ -352,7 +348,6 @@ export declare const RecordCoreDefinition: import("../definition/core.cjs").Reco
352
348
  }, Schema.filter<Schema.Struct<{
353
349
  record: Schema.Struct<{
354
350
  format: Schema.Schema<import("./identifiers.cjs").RecordFormat, "niceeval.record", never>;
355
- schemaVersion: Schema.Schema<2, 2, never>;
356
351
  recordId: Schema.Schema<import("./identifiers.cjs").RecordId, string, never>;
357
352
  }>;
358
353
  runs: Schema.Array$<Schema.Struct<{
@@ -408,7 +403,6 @@ export declare const RecordCoreDefinition: import("../definition/core.cjs").Reco
408
403
  export declare const RecordCoreSchema: Schema.filter<Schema.Struct<{
409
404
  record: Schema.Struct<{
410
405
  format: Schema.Schema<import("./identifiers.cjs").RecordFormat, "niceeval.record", never>;
411
- schemaVersion: Schema.Schema<2, 2, never>;
412
406
  recordId: Schema.Schema<import("./identifiers.cjs").RecordId, string, never>;
413
407
  }>;
414
408
  runs: Schema.Array$<Schema.Struct<{
@@ -33,19 +33,16 @@ export declare const RecordSlotIdentitySchema: Schema.Struct<{
33
33
  attemptOrdinal: Schema.filter<typeof Schema.JsonNumber>;
34
34
  executionIdentityDigest: Schema.Schema<import("./identifiers.mjs").ExecutionIdentityDigest, string, never>;
35
35
  }>;
36
- /** The current root header definition, with identity separate from numeric version. */
36
+ /** The exact versionless root header definition. */
37
37
  export declare const RecordDocumentDefinition: import("../definition/core.mjs").RecordCoreDefinition<{
38
- readonly schemaVersion: 2;
39
38
  readonly format: import("./identifiers.mjs").RecordFormat;
40
39
  readonly recordId: import("./identifiers.mjs").RecordId;
41
40
  }, Schema.Struct<{
42
41
  format: Schema.Schema<import("./identifiers.mjs").RecordFormat, "niceeval.record", never>;
43
- schemaVersion: Schema.Schema<2, 2, never>;
44
42
  recordId: Schema.Schema<import("./identifiers.mjs").RecordId, string, never>;
45
43
  }>>;
46
44
  export declare const RecordDocumentSchema: Schema.Struct<{
47
45
  format: Schema.Schema<import("./identifiers.mjs").RecordFormat, "niceeval.record", never>;
48
- schemaVersion: Schema.Schema<2, 2, never>;
49
46
  recordId: Schema.Schema<import("./identifiers.mjs").RecordId, string, never>;
50
47
  }>;
51
48
  /** Current sealed `run.json`; its contextual and ordering axioms live in this Schema. */
@@ -310,7 +307,6 @@ export declare const RunCoreSchema: Schema.Struct<{
310
307
  /** Cross-document Run/Member/Attempt axioms are owned by this Schema. */
311
308
  export declare const RecordCoreDefinition: import("../definition/core.mjs").RecordCoreDefinition<{
312
309
  readonly record: {
313
- readonly schemaVersion: 2;
314
310
  readonly format: import("./identifiers.mjs").RecordFormat;
315
311
  readonly recordId: import("./identifiers.mjs").RecordId;
316
312
  };
@@ -352,7 +348,6 @@ export declare const RecordCoreDefinition: import("../definition/core.mjs").Reco
352
348
  }, Schema.filter<Schema.Struct<{
353
349
  record: Schema.Struct<{
354
350
  format: Schema.Schema<import("./identifiers.mjs").RecordFormat, "niceeval.record", never>;
355
- schemaVersion: Schema.Schema<2, 2, never>;
356
351
  recordId: Schema.Schema<import("./identifiers.mjs").RecordId, string, never>;
357
352
  }>;
358
353
  runs: Schema.Array$<Schema.Struct<{
@@ -408,7 +403,6 @@ export declare const RecordCoreDefinition: import("../definition/core.mjs").Reco
408
403
  export declare const RecordCoreSchema: Schema.filter<Schema.Struct<{
409
404
  record: Schema.Struct<{
410
405
  format: Schema.Schema<import("./identifiers.mjs").RecordFormat, "niceeval.record", never>;
411
- schemaVersion: Schema.Schema<2, 2, never>;
412
406
  recordId: Schema.Schema<import("./identifiers.mjs").RecordId, string, never>;
413
407
  }>;
414
408
  runs: Schema.Array$<Schema.Struct<{
@@ -33,19 +33,16 @@ export declare const RecordSlotIdentitySchema: Schema.Struct<{
33
33
  attemptOrdinal: Schema.filter<typeof Schema.JsonNumber>;
34
34
  executionIdentityDigest: Schema.Schema<import("./identifiers.js").ExecutionIdentityDigest, string, never>;
35
35
  }>;
36
- /** The current root header definition, with identity separate from numeric version. */
36
+ /** The exact versionless root header definition. */
37
37
  export declare const RecordDocumentDefinition: import("../definition/core.js").RecordCoreDefinition<{
38
- readonly schemaVersion: 2;
39
38
  readonly format: import("./identifiers.js").RecordFormat;
40
39
  readonly recordId: import("./identifiers.js").RecordId;
41
40
  }, Schema.Struct<{
42
41
  format: Schema.Schema<import("./identifiers.js").RecordFormat, "niceeval.record", never>;
43
- schemaVersion: Schema.Schema<2, 2, never>;
44
42
  recordId: Schema.Schema<import("./identifiers.js").RecordId, string, never>;
45
43
  }>>;
46
44
  export declare const RecordDocumentSchema: Schema.Struct<{
47
45
  format: Schema.Schema<import("./identifiers.js").RecordFormat, "niceeval.record", never>;
48
- schemaVersion: Schema.Schema<2, 2, never>;
49
46
  recordId: Schema.Schema<import("./identifiers.js").RecordId, string, never>;
50
47
  }>;
51
48
  /** Current sealed `run.json`; its contextual and ordering axioms live in this Schema. */
@@ -310,7 +307,6 @@ export declare const RunCoreSchema: Schema.Struct<{
310
307
  /** Cross-document Run/Member/Attempt axioms are owned by this Schema. */
311
308
  export declare const RecordCoreDefinition: import("../definition/core.js").RecordCoreDefinition<{
312
309
  readonly record: {
313
- readonly schemaVersion: 2;
314
310
  readonly format: import("./identifiers.js").RecordFormat;
315
311
  readonly recordId: import("./identifiers.js").RecordId;
316
312
  };
@@ -352,7 +348,6 @@ export declare const RecordCoreDefinition: import("../definition/core.js").Recor
352
348
  }, Schema.filter<Schema.Struct<{
353
349
  record: Schema.Struct<{
354
350
  format: Schema.Schema<import("./identifiers.js").RecordFormat, "niceeval.record", never>;
355
- schemaVersion: Schema.Schema<2, 2, never>;
356
351
  recordId: Schema.Schema<import("./identifiers.js").RecordId, string, never>;
357
352
  }>;
358
353
  runs: Schema.Array$<Schema.Struct<{
@@ -408,7 +403,6 @@ export declare const RecordCoreDefinition: import("../definition/core.js").Recor
408
403
  export declare const RecordCoreSchema: Schema.filter<Schema.Struct<{
409
404
  record: Schema.Struct<{
410
405
  format: Schema.Schema<import("./identifiers.js").RecordFormat, "niceeval.record", never>;
411
- schemaVersion: Schema.Schema<2, 2, never>;
412
406
  recordId: Schema.Schema<import("./identifiers.js").RecordId, string, never>;
413
407
  }>;
414
408
  runs: Schema.Array$<Schema.Struct<{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RECORD_SCHEMA_VERSION = exports.RECORD_FORMAT = exports.CANONICAL_PROJECT_RELATIVE_PATH_BRAND = exports.ARTIFACT_ID_BRAND = exports.FILE_CHANGE_ID_BRAND = exports.SOURCE_ITEM_ID_BRAND = exports.SHA256_DIGEST_BRAND = exports.EXECUTION_IDENTITY_DIGEST_BRAND = exports.EVAL_ID_BRAND = exports.EXPERIMENT_ID_BRAND = exports.RECORD_FORMAT_ID_BRAND = exports.RECORD_ATTACHMENT_SCHEMA_ID_BRAND = exports.RECORD_ATTACHMENT_NAME_BRAND = exports.UTC_MILLIS_BRAND = exports.ATTEMPT_ID_BRAND = exports.SLOT_ID_BRAND = exports.RUN_ID_BRAND = exports.RECORD_ID_BRAND = void 0;
3
+ exports.RECORD_FORMAT = exports.CANONICAL_PROJECT_RELATIVE_PATH_BRAND = exports.ARTIFACT_ID_BRAND = exports.FILE_CHANGE_ID_BRAND = exports.SOURCE_ITEM_ID_BRAND = exports.SHA256_DIGEST_BRAND = exports.EXECUTION_IDENTITY_DIGEST_BRAND = exports.EVAL_ID_BRAND = exports.EXPERIMENT_ID_BRAND = exports.RECORD_FORMAT_ID_BRAND = exports.RECORD_ATTACHMENT_SCHEMA_ID_BRAND = exports.RECORD_ATTACHMENT_NAME_BRAND = exports.UTC_MILLIS_BRAND = exports.ATTEMPT_ID_BRAND = exports.SLOT_ID_BRAND = exports.RUN_ID_BRAND = exports.RECORD_ID_BRAND = void 0;
4
4
  exports.isPortableSegment = isPortableSegment;
5
5
  exports.compareCanonicalIdentity = compareCanonicalIdentity;
6
6
  exports.isUtcMillis = isUtcMillis;
@@ -34,9 +34,8 @@ exports.SOURCE_ITEM_ID_BRAND = "@niceeval/record/SourceItemId";
34
34
  exports.FILE_CHANGE_ID_BRAND = "@niceeval/record/FileChangeId";
35
35
  exports.ARTIFACT_ID_BRAND = "@niceeval/record/ArtifactId";
36
36
  exports.CANONICAL_PROJECT_RELATIVE_PATH_BRAND = "@niceeval/record/CanonicalProjectRelativePath";
37
- /** Stable root identity; evolution is carried by the separate numeric header. */
37
+ /** Fixed root identity; an incompatible root format must use a different identity. */
38
38
  exports.RECORD_FORMAT = "niceeval.record";
39
- exports.RECORD_SCHEMA_VERSION = 2;
40
39
  const PORTABLE_SEGMENT_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,253}[A-Za-z0-9])?$/;
41
40
  const WINDOWS_RESERVED_SEGMENT_PATTERN = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;
42
41
  const RECORD_ATTACHMENT_LABEL = "[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?";
@@ -1 +1 @@
1
- {"version":3,"file":"identifiers.js","sourceRoot":"","sources":["identifiers.ts"],"names":[],"mappings":";;;AA4DA,8CAGC;AAED,4DAKC;AAED,kCAEC;AAMD,wDAIC;AACD,wCAEC;AAED,wEAQC;AAED,wDAIC;AAUD,sEAIC;AACD,gEAGC;AACD,gFAEC;AACD,4CAEC;AACD,wCAEC;AACD,wEAEC;AApID;;;GAGG;AACU,QAAA,eAAe,GAAG,2BAAoC,CAAC;AACvD,QAA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IAAI,GAAG;QACvB,iBAAiB,CAAC,KAAK,CAAC;QACxB,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AAKD;;;;GAIG;AACH,SAAgB,6BAA6B,CAAC,KAAa;IACvD,OAAO,sBAAsB,CAAC,KAAK,CAAC;QAChC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE;QAC/B,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC;AACD,SAAgB,0BAA0B,CAAC,KAAa;IACpD,MAAM,KAAK,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,KAAK,KAAK,SAAS,IAAI,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AACD,SAAgB,kCAAkC,CAAC,QAAgB;IAC/D,OAAO,6BAA6B,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;AACzD,CAAC;AACD,SAAgB,gBAAgB,CAAC,KAAa;IAC1C,OAAO,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AACD,SAAgB,cAAc,CAAC,KAAa;IACxC,OAAO,KAAK,KAAK,qBAAa,CAAC;AACnC,CAAC;AACD,SAAgB,8BAA8B,CAAC,IAA0B;IACrE,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import type { Brand } from \"effect\";\n/**\n * Brand identifiers are deliberately package-local names. Their runtime values\n * remain portable strings; construction belongs to the exact codecs.\n */\nexport const RECORD_ID_BRAND = \"@niceeval/record/RecordId\" as const;\nexport const RUN_ID_BRAND = \"@niceeval/record/RunId\" as const;\nexport const SLOT_ID_BRAND = \"@niceeval/record/SlotId\" as const;\nexport const ATTEMPT_ID_BRAND = \"@niceeval/record/AttemptId\" as const;\nexport const UTC_MILLIS_BRAND = \"@niceeval/record/UtcMillis\" as const;\nexport const RECORD_ATTACHMENT_NAME_BRAND = \"@niceeval/record/RecordAttachmentName\" as const;\nexport const RECORD_ATTACHMENT_SCHEMA_ID_BRAND = \"@niceeval/record/RecordAttachmentSchemaId\" as const;\nexport const RECORD_FORMAT_ID_BRAND = \"@niceeval/record/RecordFormatId\" as const;\nexport const EXPERIMENT_ID_BRAND = \"@niceeval/record/ExperimentId\" as const;\nexport const EVAL_ID_BRAND = \"@niceeval/record/EvalId\" as const;\nexport const EXECUTION_IDENTITY_DIGEST_BRAND = \"@niceeval/record/ExecutionIdentityDigest\" as const;\nexport const SHA256_DIGEST_BRAND = \"@niceeval/record/Sha256Digest\" as const;\nexport const SOURCE_ITEM_ID_BRAND = \"@niceeval/record/SourceItemId\" as const;\nexport const FILE_CHANGE_ID_BRAND = \"@niceeval/record/FileChangeId\" as const;\nexport const ARTIFACT_ID_BRAND = \"@niceeval/record/ArtifactId\" as const;\nexport const CANONICAL_PROJECT_RELATIVE_PATH_BRAND = \"@niceeval/record/CanonicalProjectRelativePath\" as const;\nexport type RecordId = string & Brand.Brand<typeof RECORD_ID_BRAND>;\nexport type RunId = string & Brand.Brand<typeof RUN_ID_BRAND>;\nexport type SlotId = string & Brand.Brand<typeof SLOT_ID_BRAND>;\nexport type AttemptId = string & Brand.Brand<typeof ATTEMPT_ID_BRAND>;\nexport type UtcMillis = number & Brand.Brand<typeof UTC_MILLIS_BRAND>;\nexport type RecordAttachmentName = string & Brand.Brand<typeof RECORD_ATTACHMENT_NAME_BRAND>;\nexport type RecordAttachmentSchemaId = string & Brand.Brand<typeof RECORD_ATTACHMENT_SCHEMA_ID_BRAND>;\nexport type RecordFormatId = string & Brand.Brand<typeof RECORD_FORMAT_ID_BRAND>;\n/** A durable Experiment identity. It is not a host path or a display label. */\nexport type ExperimentId = string & Brand.Brand<typeof EXPERIMENT_ID_BRAND>;\n/** A durable Eval identity. It is not reconstructed from the current worktree. */\nexport type EvalId = string & Brand.Brand<typeof EVAL_ID_BRAND>;\n/** SHA-256 identity of the exact execution inputs/configuration for a Slot. */\nexport type ExecutionIdentityDigest = string & Brand.Brand<typeof EXECUTION_IDENTITY_DIGEST_BRAND>;\n/** A lowercase hexadecimal SHA-256 digest for recorded bytes. */\nexport type Sha256Digest = string & Brand.Brand<typeof SHA256_DIGEST_BRAND>;\n/** An opaque identity inside one origin Run's Sources manifest. */\nexport type SourceItemId = string & Brand.Brand<typeof SOURCE_ITEM_ID_BRAND>;\n/** An opaque identity inside one FileChanges payload. */\nexport type FileChangeId = string & Brand.Brand<typeof FILE_CHANGE_ID_BRAND>;\n/** An opaque identity inside one Artifacts payload. */\nexport type ArtifactId = string & Brand.Brand<typeof ARTIFACT_ID_BRAND>;\n/** Slash-separated path relative to the recorded project root. */\nexport type CanonicalProjectRelativePath = string & Brand.Brand<typeof CANONICAL_PROJECT_RELATIVE_PATH_BRAND>;\n/** Stable root identity; evolution is carried by the separate numeric header. */\nexport const RECORD_FORMAT = \"niceeval.record\" as const;\nexport const RECORD_SCHEMA_VERSION = 2 as const;\nexport type RecordFormat = typeof RECORD_FORMAT & Brand.Brand<typeof RECORD_FORMAT_ID_BRAND>;\nexport type RecordSchemaVersion = typeof RECORD_SCHEMA_VERSION;\nconst PORTABLE_SEGMENT_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,253}[A-Za-z0-9])?$/;\nconst WINDOWS_RESERVED_SEGMENT_PATTERN = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/i;\nconst RECORD_ATTACHMENT_LABEL = \"[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\";\nconst RECORD_ATTACHMENT_NAME_PATTERN = new RegExp(`^(?:${RECORD_ATTACHMENT_LABEL}\\\\.)+${RECORD_ATTACHMENT_LABEL}$`);\nconst RECORD_FORMAT_ID_PATTERN = /^niceeval\\.record$/;\nconst SHA256_DIGEST_PATTERN = /^[a-f0-9]{64}$/;\n/**\n * A file-name segment that is safe to copy between the supported Record roots.\n * It is ASCII-only, has no platform separator, and excludes DOS device names.\n */\nexport function isPortableSegment(value: string): boolean {\n return (PORTABLE_SEGMENT_PATTERN.test(value) &&\n !WINDOWS_RESERVED_SEGMENT_PATTERN.test(value));\n}\n/** Canonical identity ordering is ASCII code-unit ordering, never locale order. */\nexport function compareCanonicalIdentity(left: string, right: string): number {\n if (left === right) {\n return 0;\n }\n return left < right ? -1 : 1;\n}\n/** Unix-epoch milliseconds that can round-trip through a JSON number exactly. */\nexport function isUtcMillis(value: number): boolean {\n return Number.isSafeInteger(value) && value >= 0;\n}\n/**\n * Domain identity is deliberately broader than a directory segment: Eval and\n * Experiment identities may be path-derived, but portable Core never accepts\n * controls, NUL, or an unbounded display value.\n */\nexport function isRecordDomainIdentity(value: string): boolean {\n return (value.length > 0 &&\n value.length <= 1024 &&\n !/[\\u0000-\\u001f\\u007f]/.test(value));\n}\nexport function isSha256Digest(value: string): boolean {\n return SHA256_DIGEST_PATTERN.test(value);\n}\n/** A project-relative portable path; it is never a host filesystem path. */\nexport function isCanonicalProjectRelativePath(value: string): boolean {\n return (value.length > 0 &&\n value.length <= 4096 &&\n !value.startsWith(\"/\") &&\n !value.startsWith(\"\\\\\") &&\n !value.includes(\"\\\\\") &&\n !/[\\u0000-\\u001f\\u007f]/.test(value) &&\n value.split(\"/\").every((segment) => segment.length > 0 && segment !== \".\" && segment !== \"..\"));\n}\n/** A RecordAttachment directory name is a lowercase reverse-domain namespace. */\nexport function isRecordAttachmentName(value: string): boolean {\n return (value.length <= 255 &&\n isPortableSegment(value) &&\n RECORD_ATTACHMENT_NAME_PATTERN.test(value));\n}\nexport interface RecordAttachmentSchemaIdParts {\n readonly name: string;\n readonly version: string;\n}\n/**\n * Legacy internal callers still use this structural helper while the fixed\n * catalog is being materialized. The durable identity is now the stable\n * family name; its numeric version is carried separately in the envelope.\n */\nexport function parseRecordAttachmentSchemaId(value: string): RecordAttachmentSchemaIdParts | undefined {\n return isRecordAttachmentName(value)\n ? { name: value, version: \"1\" }\n : undefined;\n}\nexport function isRecordAttachmentSchemaId(value: string): boolean {\n const parts = parseRecordAttachmentSchemaId(value);\n return parts !== undefined && isRecordAttachmentName(parts.name);\n}\nexport function recordAttachmentNameTextOfSchemaId(schemaId: string): string | undefined {\n return parseRecordAttachmentSchemaId(schemaId)?.name;\n}\nexport function isRecordFormatId(value: string): boolean {\n return RECORD_FORMAT_ID_PATTERN.test(value);\n}\nexport function isRecordFormat(value: string): value is typeof RECORD_FORMAT {\n return value === RECORD_FORMAT;\n}\nexport function isNiceEvalRecordAttachmentName(name: RecordAttachmentName): boolean {\n return name.startsWith(\"niceeval.\");\n}\n"]}
1
+ {"version":3,"file":"identifiers.js","sourceRoot":"","sources":["identifiers.ts"],"names":[],"mappings":";;;AA0DA,8CAGC;AAED,4DAKC;AAED,kCAEC;AAMD,wDAIC;AACD,wCAEC;AAED,wEAQC;AAED,wDAIC;AAUD,sEAIC;AACD,gEAGC;AACD,gFAEC;AACD,4CAEC;AACD,wCAEC;AACD,wEAEC;AAlID;;;GAGG;AACU,QAAA,eAAe,GAAG,2BAAoC,CAAC;AACvD,QAAA,YAAY,GAAG,wBAAiC,CAAC;AACjD,QAAA,aAAa,GAAG,yBAAkC,CAAC;AACnD,QAAA,gBAAgB,GAAG,4BAAqC,CAAC;AACzD,QAAA,gBAAgB,GAAG,4BAAqC,CAAC;AACzD,QAAA,4BAA4B,GAAG,uCAAgD,CAAC;AAChF,QAAA,iCAAiC,GAAG,2CAAoD,CAAC;AACzF,QAAA,sBAAsB,GAAG,iCAA0C,CAAC;AACpE,QAAA,mBAAmB,GAAG,+BAAwC,CAAC;AAC/D,QAAA,aAAa,GAAG,yBAAkC,CAAC;AACnD,QAAA,+BAA+B,GAAG,0CAAmD,CAAC;AACtF,QAAA,mBAAmB,GAAG,+BAAwC,CAAC;AAC/D,QAAA,oBAAoB,GAAG,+BAAwC,CAAC;AAChE,QAAA,oBAAoB,GAAG,+BAAwC,CAAC;AAChE,QAAA,iBAAiB,GAAG,6BAAsC,CAAC;AAC3D,QAAA,q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gBAAgB,CAAC,KAAa;IAC1C,OAAO,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AACD,SAAgB,cAAc,CAAC,KAAa;IACxC,OAAO,KAAK,KAAK,qBAAa,CAAC;AACnC,CAAC;AACD,SAAgB,8BAA8B,CAAC,IAA0B;IACrE,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import type { Brand } from \"effect\";\n/**\n * Brand identifiers are deliberately package-local names. Their runtime values\n * remain portable strings; construction belongs to the exact codecs.\n */\nexport const RECORD_ID_BRAND = \"@niceeval/record/RecordId\" as const;\nexport const RUN_ID_BRAND = \"@niceeval/record/RunId\" as const;\nexport const SLOT_ID_BRAND = \"@niceeval/record/SlotId\" as const;\nexport const ATTEMPT_ID_BRAND = \"@niceeval/record/AttemptId\" as const;\nexport const UTC_MILLIS_BRAND = \"@niceeval/record/UtcMillis\" as const;\nexport const RECORD_ATTACHMENT_NAME_BRAND = \"@niceeval/record/RecordAttachmentName\" as const;\nexport const RECORD_ATTACHMENT_SCHEMA_ID_BRAND = \"@niceeval/record/RecordAttachmentSchemaId\" as const;\nexport const RECORD_FORMAT_ID_BRAND = \"@niceeval/record/RecordFormatId\" as const;\nexport const EXPERIMENT_ID_BRAND = \"@niceeval/record/ExperimentId\" as const;\nexport const EVAL_ID_BRAND = \"@niceeval/record/EvalId\" as const;\nexport const EXECUTION_IDENTITY_DIGEST_BRAND = \"@niceeval/record/ExecutionIdentityDigest\" as const;\nexport const SHA256_DIGEST_BRAND = \"@niceeval/record/Sha256Digest\" as const;\nexport const SOURCE_ITEM_ID_BRAND = \"@niceeval/record/SourceItemId\" as const;\nexport const FILE_CHANGE_ID_BRAND = \"@niceeval/record/FileChangeId\" as const;\nexport const ARTIFACT_ID_BRAND = \"@niceeval/record/ArtifactId\" as const;\nexport const CANONICAL_PROJECT_RELATIVE_PATH_BRAND = \"@niceeval/record/CanonicalProjectRelativePath\" as const;\nexport type RecordId = string & Brand.Brand<typeof RECORD_ID_BRAND>;\nexport type RunId = string & Brand.Brand<typeof RUN_ID_BRAND>;\nexport type SlotId = string & Brand.Brand<typeof SLOT_ID_BRAND>;\nexport type AttemptId = string & Brand.Brand<typeof ATTEMPT_ID_BRAND>;\nexport type UtcMillis = number & Brand.Brand<typeof UTC_MILLIS_BRAND>;\nexport type RecordAttachmentName = string & Brand.Brand<typeof RECORD_ATTACHMENT_NAME_BRAND>;\nexport type RecordAttachmentSchemaId = string & Brand.Brand<typeof RECORD_ATTACHMENT_SCHEMA_ID_BRAND>;\nexport type RecordFormatId = string & Brand.Brand<typeof RECORD_FORMAT_ID_BRAND>;\n/** A durable Experiment identity. It is not a host path or a display label. */\nexport type ExperimentId = string & Brand.Brand<typeof EXPERIMENT_ID_BRAND>;\n/** A durable Eval identity. It is not reconstructed from the current worktree. */\nexport type EvalId = string & Brand.Brand<typeof EVAL_ID_BRAND>;\n/** SHA-256 identity of the exact execution inputs/configuration for a Slot. */\nexport type ExecutionIdentityDigest = string & Brand.Brand<typeof EXECUTION_IDENTITY_DIGEST_BRAND>;\n/** A lowercase hexadecimal SHA-256 digest for recorded bytes. */\nexport type Sha256Digest = string & Brand.Brand<typeof SHA256_DIGEST_BRAND>;\n/** An opaque identity inside one origin Run's Sources manifest. */\nexport type SourceItemId = string & Brand.Brand<typeof SOURCE_ITEM_ID_BRAND>;\n/** An opaque identity inside one FileChanges payload. */\nexport type FileChangeId = string & Brand.Brand<typeof FILE_CHANGE_ID_BRAND>;\n/** An opaque identity inside one Artifacts payload. */\nexport type ArtifactId = string & Brand.Brand<typeof ARTIFACT_ID_BRAND>;\n/** Slash-separated path relative to the recorded project root. */\nexport type CanonicalProjectRelativePath = string & Brand.Brand<typeof CANONICAL_PROJECT_RELATIVE_PATH_BRAND>;\n/** Fixed root identity; an incompatible root format must use a different identity. */\nexport const RECORD_FORMAT = \"niceeval.record\" as const;\nexport type RecordFormat = typeof RECORD_FORMAT & Brand.Brand<typeof RECORD_FORMAT_ID_BRAND>;\nconst PORTABLE_SEGMENT_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,253}[A-Za-z0-9])?$/;\nconst WINDOWS_RESERVED_SEGMENT_PATTERN = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/i;\nconst RECORD_ATTACHMENT_LABEL = \"[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\";\nconst RECORD_ATTACHMENT_NAME_PATTERN = new RegExp(`^(?:${RECORD_ATTACHMENT_LABEL}\\\\.)+${RECORD_ATTACHMENT_LABEL}$`);\nconst RECORD_FORMAT_ID_PATTERN = /^niceeval\\.record$/;\nconst SHA256_DIGEST_PATTERN = /^[a-f0-9]{64}$/;\n/**\n * A file-name segment that is safe to copy between the supported Record roots.\n * It is ASCII-only, has no platform separator, and excludes DOS device names.\n */\nexport function isPortableSegment(value: string): boolean {\n return (PORTABLE_SEGMENT_PATTERN.test(value) &&\n !WINDOWS_RESERVED_SEGMENT_PATTERN.test(value));\n}\n/** Canonical identity ordering is ASCII code-unit ordering, never locale order. */\nexport function compareCanonicalIdentity(left: string, right: string): number {\n if (left === right) {\n return 0;\n }\n return left < right ? -1 : 1;\n}\n/** Unix-epoch milliseconds that can round-trip through a JSON number exactly. */\nexport function isUtcMillis(value: number): boolean {\n return Number.isSafeInteger(value) && value >= 0;\n}\n/**\n * Domain identity is deliberately broader than a directory segment: Eval and\n * Experiment identities may be path-derived, but portable Core never accepts\n * controls, NUL, or an unbounded display value.\n */\nexport function isRecordDomainIdentity(value: string): boolean {\n return (value.length > 0 &&\n value.length <= 1024 &&\n !/[\\u0000-\\u001f\\u007f]/.test(value));\n}\nexport function isSha256Digest(value: string): boolean {\n return SHA256_DIGEST_PATTERN.test(value);\n}\n/** A project-relative portable path; it is never a host filesystem path. */\nexport function isCanonicalProjectRelativePath(value: string): boolean {\n return (value.length > 0 &&\n value.length <= 4096 &&\n !value.startsWith(\"/\") &&\n !value.startsWith(\"\\\\\") &&\n !value.includes(\"\\\\\") &&\n !/[\\u0000-\\u001f\\u007f]/.test(value) &&\n value.split(\"/\").every((segment) => segment.length > 0 && segment !== \".\" && segment !== \"..\"));\n}\n/** A RecordAttachment directory name is a lowercase reverse-domain namespace. */\nexport function isRecordAttachmentName(value: string): boolean {\n return (value.length <= 255 &&\n isPortableSegment(value) &&\n RECORD_ATTACHMENT_NAME_PATTERN.test(value));\n}\nexport interface RecordAttachmentSchemaIdParts {\n readonly name: string;\n readonly version: string;\n}\n/**\n * Legacy internal callers still use this structural helper while the fixed\n * catalog is being materialized. The durable identity is now the stable\n * family name; its numeric version is carried separately in the envelope.\n */\nexport function parseRecordAttachmentSchemaId(value: string): RecordAttachmentSchemaIdParts | undefined {\n return isRecordAttachmentName(value)\n ? { name: value, version: \"1\" }\n : undefined;\n}\nexport function isRecordAttachmentSchemaId(value: string): boolean {\n const parts = parseRecordAttachmentSchemaId(value);\n return parts !== undefined && isRecordAttachmentName(parts.name);\n}\nexport function recordAttachmentNameTextOfSchemaId(schemaId: string): string | undefined {\n return parseRecordAttachmentSchemaId(schemaId)?.name;\n}\nexport function isRecordFormatId(value: string): boolean {\n return RECORD_FORMAT_ID_PATTERN.test(value);\n}\nexport function isRecordFormat(value: string): value is typeof RECORD_FORMAT {\n return value === RECORD_FORMAT;\n}\nexport function isNiceEvalRecordAttachmentName(name: RecordAttachmentName): boolean {\n return name.startsWith(\"niceeval.\");\n}\n"]}
@@ -43,11 +43,9 @@ export type FileChangeId = string & Brand.Brand<typeof FILE_CHANGE_ID_BRAND>;
43
43
  export type ArtifactId = string & Brand.Brand<typeof ARTIFACT_ID_BRAND>;
44
44
  /** Slash-separated path relative to the recorded project root. */
45
45
  export type CanonicalProjectRelativePath = string & Brand.Brand<typeof CANONICAL_PROJECT_RELATIVE_PATH_BRAND>;
46
- /** Stable root identity; evolution is carried by the separate numeric header. */
46
+ /** Fixed root identity; an incompatible root format must use a different identity. */
47
47
  export declare const RECORD_FORMAT: "niceeval.record";
48
- export declare const RECORD_SCHEMA_VERSION: 2;
49
48
  export type RecordFormat = typeof RECORD_FORMAT & Brand.Brand<typeof RECORD_FORMAT_ID_BRAND>;
50
- export type RecordSchemaVersion = typeof RECORD_SCHEMA_VERSION;
51
49
  /**
52
50
  * A file-name segment that is safe to copy between the supported Record roots.
53
51
  * It is ASCII-only, has no platform separator, and excludes DOS device names.
@@ -43,11 +43,9 @@ export type FileChangeId = string & Brand.Brand<typeof FILE_CHANGE_ID_BRAND>;
43
43
  export type ArtifactId = string & Brand.Brand<typeof ARTIFACT_ID_BRAND>;
44
44
  /** Slash-separated path relative to the recorded project root. */
45
45
  export type CanonicalProjectRelativePath = string & Brand.Brand<typeof CANONICAL_PROJECT_RELATIVE_PATH_BRAND>;
46
- /** Stable root identity; evolution is carried by the separate numeric header. */
46
+ /** Fixed root identity; an incompatible root format must use a different identity. */
47
47
  export declare const RECORD_FORMAT: "niceeval.record";
48
- export declare const RECORD_SCHEMA_VERSION: 2;
49
48
  export type RecordFormat = typeof RECORD_FORMAT & Brand.Brand<typeof RECORD_FORMAT_ID_BRAND>;
50
- export type RecordSchemaVersion = typeof RECORD_SCHEMA_VERSION;
51
49
  /**
52
50
  * A file-name segment that is safe to copy between the supported Record roots.
53
51
  * It is ASCII-only, has no platform separator, and excludes DOS device names.
@@ -43,11 +43,9 @@ export type FileChangeId = string & Brand.Brand<typeof FILE_CHANGE_ID_BRAND>;
43
43
  export type ArtifactId = string & Brand.Brand<typeof ARTIFACT_ID_BRAND>;
44
44
  /** Slash-separated path relative to the recorded project root. */
45
45
  export type CanonicalProjectRelativePath = string & Brand.Brand<typeof CANONICAL_PROJECT_RELATIVE_PATH_BRAND>;
46
- /** Stable root identity; evolution is carried by the separate numeric header. */
46
+ /** Fixed root identity; an incompatible root format must use a different identity. */
47
47
  export declare const RECORD_FORMAT: "niceeval.record";
48
- export declare const RECORD_SCHEMA_VERSION: 2;
49
48
  export type RecordFormat = typeof RECORD_FORMAT & Brand.Brand<typeof RECORD_FORMAT_ID_BRAND>;
50
- export type RecordSchemaVersion = typeof RECORD_SCHEMA_VERSION;
51
49
  /**
52
50
  * A file-name segment that is safe to copy between the supported Record roots.
53
51
  * It is ASCII-only, has no platform separator, and excludes DOS device names.