@azx-pbc/axiom-runtime 0.0.0-stage → 0.0.5

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 (755) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +714 -2
  3. package/dist/cache/index.d.ts +191 -0
  4. package/dist/cache/index.d.ts.map +1 -0
  5. package/dist/cache/index.js +361 -0
  6. package/dist/cache/index.js.map +1 -0
  7. package/dist/canonical/jcs.d.ts +78 -0
  8. package/dist/canonical/jcs.d.ts.map +1 -0
  9. package/dist/canonical/jcs.js +500 -0
  10. package/dist/canonical/jcs.js.map +1 -0
  11. package/dist/canonical/restricted-json.d.ts +7 -0
  12. package/dist/canonical/restricted-json.d.ts.map +1 -0
  13. package/dist/canonical/restricted-json.js +318 -0
  14. package/dist/canonical/restricted-json.js.map +1 -0
  15. package/dist/canonical/restricted-value.d.ts +59 -0
  16. package/dist/canonical/restricted-value.d.ts.map +1 -0
  17. package/dist/canonical/restricted-value.js +156 -0
  18. package/dist/canonical/restricted-value.js.map +1 -0
  19. package/dist/canonical/restricted.d.ts +85 -0
  20. package/dist/canonical/restricted.d.ts.map +1 -0
  21. package/dist/canonical/restricted.js +163 -0
  22. package/dist/canonical/restricted.js.map +1 -0
  23. package/dist/canonical/signature.d.ts +38 -0
  24. package/dist/canonical/signature.d.ts.map +1 -0
  25. package/dist/canonical/signature.js +47 -0
  26. package/dist/canonical/signature.js.map +1 -0
  27. package/dist/eval/access/delivery.d.ts +63 -0
  28. package/dist/eval/access/delivery.d.ts.map +1 -0
  29. package/dist/eval/access/delivery.js +98 -0
  30. package/dist/eval/access/delivery.js.map +1 -0
  31. package/dist/eval/access/overlay.d.ts +72 -0
  32. package/dist/eval/access/overlay.d.ts.map +1 -0
  33. package/dist/eval/access/overlay.js +402 -0
  34. package/dist/eval/access/overlay.js.map +1 -0
  35. package/dist/eval/access/projection.d.ts +159 -0
  36. package/dist/eval/access/projection.d.ts.map +1 -0
  37. package/dist/eval/access/projection.js +211 -0
  38. package/dist/eval/access/projection.js.map +1 -0
  39. package/dist/eval/access/window.d.ts +128 -0
  40. package/dist/eval/access/window.d.ts.map +1 -0
  41. package/dist/eval/access/window.js +254 -0
  42. package/dist/eval/access/window.js.map +1 -0
  43. package/dist/eval/access/write.d.ts +113 -0
  44. package/dist/eval/access/write.d.ts.map +1 -0
  45. package/dist/eval/access/write.js +119 -0
  46. package/dist/eval/access/write.js.map +1 -0
  47. package/dist/eval/addressing.d.ts +131 -0
  48. package/dist/eval/addressing.d.ts.map +1 -0
  49. package/dist/eval/addressing.js +270 -0
  50. package/dist/eval/addressing.js.map +1 -0
  51. package/dist/eval/budget.d.ts +143 -0
  52. package/dist/eval/budget.d.ts.map +1 -0
  53. package/dist/eval/budget.js +387 -0
  54. package/dist/eval/budget.js.map +1 -0
  55. package/dist/eval/computed.d.ts +46 -0
  56. package/dist/eval/computed.d.ts.map +1 -0
  57. package/dist/eval/computed.js +89 -0
  58. package/dist/eval/computed.js.map +1 -0
  59. package/dist/eval/denials.d.ts +64 -0
  60. package/dist/eval/denials.d.ts.map +1 -0
  61. package/dist/eval/denials.js +87 -0
  62. package/dist/eval/denials.js.map +1 -0
  63. package/dist/eval/engine/cancellation.d.ts +12 -0
  64. package/dist/eval/engine/cancellation.d.ts.map +1 -0
  65. package/dist/eval/engine/cancellation.js +56 -0
  66. package/dist/eval/engine/cancellation.js.map +1 -0
  67. package/dist/eval/engine/delta.d.ts +104 -0
  68. package/dist/eval/engine/delta.d.ts.map +1 -0
  69. package/dist/eval/engine/delta.js +466 -0
  70. package/dist/eval/engine/delta.js.map +1 -0
  71. package/dist/eval/engine/deps.d.ts +136 -0
  72. package/dist/eval/engine/deps.d.ts.map +1 -0
  73. package/dist/eval/engine/deps.js +345 -0
  74. package/dist/eval/engine/deps.js.map +1 -0
  75. package/dist/eval/engine/identity.d.ts +128 -0
  76. package/dist/eval/engine/identity.d.ts.map +1 -0
  77. package/dist/eval/engine/identity.js +398 -0
  78. package/dist/eval/engine/identity.js.map +1 -0
  79. package/dist/eval/engine/index.d.ts +200 -0
  80. package/dist/eval/engine/index.d.ts.map +1 -0
  81. package/dist/eval/engine/index.js +1242 -0
  82. package/dist/eval/engine/index.js.map +1 -0
  83. package/dist/eval/engine/measurement.d.ts +23 -0
  84. package/dist/eval/engine/measurement.d.ts.map +1 -0
  85. package/dist/eval/engine/measurement.js +42 -0
  86. package/dist/eval/engine/measurement.js.map +1 -0
  87. package/dist/eval/engine/naive.d.ts +19 -0
  88. package/dist/eval/engine/naive.d.ts.map +1 -0
  89. package/dist/eval/engine/naive.js +59 -0
  90. package/dist/eval/engine/naive.js.map +1 -0
  91. package/dist/eval/engine/ops.d.ts +214 -0
  92. package/dist/eval/engine/ops.d.ts.map +1 -0
  93. package/dist/eval/engine/ops.js +1422 -0
  94. package/dist/eval/engine/ops.js.map +1 -0
  95. package/dist/eval/engine/patches.d.ts +40 -0
  96. package/dist/eval/engine/patches.d.ts.map +1 -0
  97. package/dist/eval/engine/patches.js +125 -0
  98. package/dist/eval/engine/patches.js.map +1 -0
  99. package/dist/eval/engine/ports.d.ts +71 -0
  100. package/dist/eval/engine/ports.d.ts.map +1 -0
  101. package/dist/eval/engine/ports.js +2 -0
  102. package/dist/eval/engine/ports.js.map +1 -0
  103. package/dist/eval/engine/session.d.ts +116 -0
  104. package/dist/eval/engine/session.d.ts.map +1 -0
  105. package/dist/eval/engine/session.js +653 -0
  106. package/dist/eval/engine/session.js.map +1 -0
  107. package/dist/eval/engine/snapshot.d.ts +97 -0
  108. package/dist/eval/engine/snapshot.d.ts.map +1 -0
  109. package/dist/eval/engine/snapshot.js +221 -0
  110. package/dist/eval/engine/snapshot.js.map +1 -0
  111. package/dist/eval/engine/subscriptions.d.ts +47 -0
  112. package/dist/eval/engine/subscriptions.d.ts.map +1 -0
  113. package/dist/eval/engine/subscriptions.js +103 -0
  114. package/dist/eval/engine/subscriptions.js.map +1 -0
  115. package/dist/eval/engine/trace.d.ts +77 -0
  116. package/dist/eval/engine/trace.d.ts.map +1 -0
  117. package/dist/eval/engine/trace.js +140 -0
  118. package/dist/eval/engine/trace.js.map +1 -0
  119. package/dist/eval/error-diagnostic.d.ts +26 -0
  120. package/dist/eval/error-diagnostic.d.ts.map +1 -0
  121. package/dist/eval/error-diagnostic.js +63 -0
  122. package/dist/eval/error-diagnostic.js.map +1 -0
  123. package/dist/eval/evaluate-expr.d.ts +44 -0
  124. package/dist/eval/evaluate-expr.d.ts.map +1 -0
  125. package/dist/eval/evaluate-expr.js +149 -0
  126. package/dist/eval/evaluate-expr.js.map +1 -0
  127. package/dist/eval/evaluate.d.ts +282 -0
  128. package/dist/eval/evaluate.d.ts.map +1 -0
  129. package/dist/eval/evaluate.js +391 -0
  130. package/dist/eval/evaluate.js.map +1 -0
  131. package/dist/eval/evolution/relocate.d.ts +72 -0
  132. package/dist/eval/evolution/relocate.d.ts.map +1 -0
  133. package/dist/eval/evolution/relocate.js +427 -0
  134. package/dist/eval/evolution/relocate.js.map +1 -0
  135. package/dist/eval/evolution/select.d.ts +11 -0
  136. package/dist/eval/evolution/select.d.ts.map +1 -0
  137. package/dist/eval/evolution/select.js +53 -0
  138. package/dist/eval/evolution/select.js.map +1 -0
  139. package/dist/eval/evolution/upcast.d.ts +13 -0
  140. package/dist/eval/evolution/upcast.d.ts.map +1 -0
  141. package/dist/eval/evolution/upcast.js +88 -0
  142. package/dist/eval/evolution/upcast.js.map +1 -0
  143. package/dist/eval/expr/aggregates.d.ts +75 -0
  144. package/dist/eval/expr/aggregates.d.ts.map +1 -0
  145. package/dist/eval/expr/aggregates.js +991 -0
  146. package/dist/eval/expr/aggregates.js.map +1 -0
  147. package/dist/eval/expr/arithmetic.d.ts +26 -0
  148. package/dist/eval/expr/arithmetic.d.ts.map +1 -0
  149. package/dist/eval/expr/arithmetic.js +387 -0
  150. package/dist/eval/expr/arithmetic.js.map +1 -0
  151. package/dist/eval/expr/between.d.ts +17 -0
  152. package/dist/eval/expr/between.d.ts.map +1 -0
  153. package/dist/eval/expr/between.js +46 -0
  154. package/dist/eval/expr/between.js.map +1 -0
  155. package/dist/eval/expr/binder.d.ts +96 -0
  156. package/dist/eval/expr/binder.d.ts.map +1 -0
  157. package/dist/eval/expr/binder.js +253 -0
  158. package/dist/eval/expr/binder.js.map +1 -0
  159. package/dist/eval/expr/call-dispatch.d.ts +28 -0
  160. package/dist/eval/expr/call-dispatch.d.ts.map +1 -0
  161. package/dist/eval/expr/call-dispatch.js +114 -0
  162. package/dist/eval/expr/call-dispatch.js.map +1 -0
  163. package/dist/eval/expr/collections.d.ts +20 -0
  164. package/dist/eval/expr/collections.d.ts.map +1 -0
  165. package/dist/eval/expr/collections.js +66 -0
  166. package/dist/eval/expr/collections.js.map +1 -0
  167. package/dist/eval/expr/compare.d.ts +36 -0
  168. package/dist/eval/expr/compare.d.ts.map +1 -0
  169. package/dist/eval/expr/compare.js +115 -0
  170. package/dist/eval/expr/compare.js.map +1 -0
  171. package/dist/eval/expr/datasets.d.ts +28 -0
  172. package/dist/eval/expr/datasets.d.ts.map +1 -0
  173. package/dist/eval/expr/datasets.js +304 -0
  174. package/dist/eval/expr/datasets.js.map +1 -0
  175. package/dist/eval/expr/digest.d.ts +23 -0
  176. package/dist/eval/expr/digest.d.ts.map +1 -0
  177. package/dist/eval/expr/digest.js +89 -0
  178. package/dist/eval/expr/digest.js.map +1 -0
  179. package/dist/eval/expr/domains.d.ts +19 -0
  180. package/dist/eval/expr/domains.d.ts.map +1 -0
  181. package/dist/eval/expr/domains.js +18 -0
  182. package/dist/eval/expr/domains.js.map +1 -0
  183. package/dist/eval/expr/host.d.ts +152 -0
  184. package/dist/eval/expr/host.d.ts.map +1 -0
  185. package/dist/eval/expr/host.js +36 -0
  186. package/dist/eval/expr/host.js.map +1 -0
  187. package/dist/eval/expr/lists.d.ts +24 -0
  188. package/dist/eval/expr/lists.d.ts.map +1 -0
  189. package/dist/eval/expr/lists.js +155 -0
  190. package/dist/eval/expr/lists.js.map +1 -0
  191. package/dist/eval/expr/member.d.ts +15 -0
  192. package/dist/eval/expr/member.d.ts.map +1 -0
  193. package/dist/eval/expr/member.js +32 -0
  194. package/dist/eval/expr/member.js.map +1 -0
  195. package/dist/eval/expr/money-ops.d.ts +10 -0
  196. package/dist/eval/expr/money-ops.d.ts.map +1 -0
  197. package/dist/eval/expr/money-ops.js +17 -0
  198. package/dist/eval/expr/money-ops.js.map +1 -0
  199. package/dist/eval/expr/operands.d.ts +27 -0
  200. package/dist/eval/expr/operands.d.ts.map +1 -0
  201. package/dist/eval/expr/operands.js +167 -0
  202. package/dist/eval/expr/operands.js.map +1 -0
  203. package/dist/eval/expr/presence.d.ts +27 -0
  204. package/dist/eval/expr/presence.d.ts.map +1 -0
  205. package/dist/eval/expr/presence.js +140 -0
  206. package/dist/eval/expr/presence.js.map +1 -0
  207. package/dist/eval/expr/records.d.ts +22 -0
  208. package/dist/eval/expr/records.d.ts.map +1 -0
  209. package/dist/eval/expr/records.js +101 -0
  210. package/dist/eval/expr/records.js.map +1 -0
  211. package/dist/eval/expr/rule-refs.d.ts +25 -0
  212. package/dist/eval/expr/rule-refs.d.ts.map +1 -0
  213. package/dist/eval/expr/rule-refs.js +60 -0
  214. package/dist/eval/expr/rule-refs.js.map +1 -0
  215. package/dist/eval/expr/sequences.d.ts +26 -0
  216. package/dist/eval/expr/sequences.d.ts.map +1 -0
  217. package/dist/eval/expr/sequences.js +151 -0
  218. package/dist/eval/expr/sequences.js.map +1 -0
  219. package/dist/eval/expr/value.d.ts +99 -0
  220. package/dist/eval/expr/value.d.ts.map +1 -0
  221. package/dist/eval/expr/value.js +14 -0
  222. package/dist/eval/expr/value.js.map +1 -0
  223. package/dist/eval/expression.d.ts +142 -0
  224. package/dist/eval/expression.d.ts.map +1 -0
  225. package/dist/eval/expression.js +446 -0
  226. package/dist/eval/expression.js.map +1 -0
  227. package/dist/eval/firing.d.ts +68 -0
  228. package/dist/eval/firing.d.ts.map +1 -0
  229. package/dist/eval/firing.js +222 -0
  230. package/dist/eval/firing.js.map +1 -0
  231. package/dist/eval/gate.d.ts +110 -0
  232. package/dist/eval/gate.d.ts.map +1 -0
  233. package/dist/eval/gate.js +278 -0
  234. package/dist/eval/gate.js.map +1 -0
  235. package/dist/eval/layout-visibility.d.ts +18 -0
  236. package/dist/eval/layout-visibility.d.ts.map +1 -0
  237. package/dist/eval/layout-visibility.js +61 -0
  238. package/dist/eval/layout-visibility.js.map +1 -0
  239. package/dist/eval/option-availability.d.ts +26 -0
  240. package/dist/eval/option-availability.d.ts.map +1 -0
  241. package/dist/eval/option-availability.js +580 -0
  242. package/dist/eval/option-availability.js.map +1 -0
  243. package/dist/eval/options-boundary.d.ts +15 -0
  244. package/dist/eval/options-boundary.d.ts.map +1 -0
  245. package/dist/eval/options-boundary.js +40 -0
  246. package/dist/eval/options-boundary.js.map +1 -0
  247. package/dist/eval/options.d.ts +99 -0
  248. package/dist/eval/options.d.ts.map +1 -0
  249. package/dist/eval/options.js +96 -0
  250. package/dist/eval/options.js.map +1 -0
  251. package/dist/eval/overrides.d.ts +116 -0
  252. package/dist/eval/overrides.d.ts.map +1 -0
  253. package/dist/eval/overrides.js +176 -0
  254. package/dist/eval/overrides.js.map +1 -0
  255. package/dist/eval/paths.d.ts +25 -0
  256. package/dist/eval/paths.d.ts.map +1 -0
  257. package/dist/eval/paths.js +47 -0
  258. package/dist/eval/paths.js.map +1 -0
  259. package/dist/eval/presentation-reads.d.ts +20 -0
  260. package/dist/eval/presentation-reads.d.ts.map +1 -0
  261. package/dist/eval/presentation-reads.js +2 -0
  262. package/dist/eval/presentation-reads.js.map +1 -0
  263. package/dist/eval/presentation.d.ts +122 -0
  264. package/dist/eval/presentation.d.ts.map +1 -0
  265. package/dist/eval/presentation.js +255 -0
  266. package/dist/eval/presentation.js.map +1 -0
  267. package/dist/eval/reader/context-value.d.ts +41 -0
  268. package/dist/eval/reader/context-value.d.ts.map +1 -0
  269. package/dist/eval/reader/context-value.js +129 -0
  270. package/dist/eval/reader/context-value.js.map +1 -0
  271. package/dist/eval/reader/covered.d.ts +53 -0
  272. package/dist/eval/reader/covered.d.ts.map +1 -0
  273. package/dist/eval/reader/covered.js +139 -0
  274. package/dist/eval/reader/covered.js.map +1 -0
  275. package/dist/eval/reader/declarations.d.ts +182 -0
  276. package/dist/eval/reader/declarations.d.ts.map +1 -0
  277. package/dist/eval/reader/declarations.js +153 -0
  278. package/dist/eval/reader/declarations.js.map +1 -0
  279. package/dist/eval/reader/member-access.d.ts +87 -0
  280. package/dist/eval/reader/member-access.d.ts.map +1 -0
  281. package/dist/eval/reader/member-access.js +212 -0
  282. package/dist/eval/reader/member-access.js.map +1 -0
  283. package/dist/eval/reader/memo.d.ts +34 -0
  284. package/dist/eval/reader/memo.d.ts.map +1 -0
  285. package/dist/eval/reader/memo.js +67 -0
  286. package/dist/eval/reader/memo.js.map +1 -0
  287. package/dist/eval/reader/overlay.d.ts +74 -0
  288. package/dist/eval/reader/overlay.d.ts.map +1 -0
  289. package/dist/eval/reader/overlay.js +365 -0
  290. package/dist/eval/reader/overlay.js.map +1 -0
  291. package/dist/eval/reader/questions.d.ts +37 -0
  292. package/dist/eval/reader/questions.d.ts.map +1 -0
  293. package/dist/eval/reader/questions.js +78 -0
  294. package/dist/eval/reader/questions.js.map +1 -0
  295. package/dist/eval/reader/resolve.d.ts +84 -0
  296. package/dist/eval/reader/resolve.d.ts.map +1 -0
  297. package/dist/eval/reader/resolve.js +310 -0
  298. package/dist/eval/reader/resolve.js.map +1 -0
  299. package/dist/eval/reader/value-read.d.ts +50 -0
  300. package/dist/eval/reader/value-read.d.ts.map +1 -0
  301. package/dist/eval/reader/value-read.js +133 -0
  302. package/dist/eval/reader/value-read.js.map +1 -0
  303. package/dist/eval/reader/withheld.d.ts +48 -0
  304. package/dist/eval/reader/withheld.d.ts.map +1 -0
  305. package/dist/eval/reader/withheld.js +108 -0
  306. package/dist/eval/reader/withheld.js.map +1 -0
  307. package/dist/eval/reader-paths.d.ts +24 -0
  308. package/dist/eval/reader-paths.d.ts.map +1 -0
  309. package/dist/eval/reader-paths.js +23 -0
  310. package/dist/eval/reader-paths.js.map +1 -0
  311. package/dist/eval/reader.d.ts +281 -0
  312. package/dist/eval/reader.d.ts.map +1 -0
  313. package/dist/eval/reader.js +560 -0
  314. package/dist/eval/reader.js.map +1 -0
  315. package/dist/eval/receipt.d.ts +37 -0
  316. package/dist/eval/receipt.d.ts.map +1 -0
  317. package/dist/eval/receipt.js +222 -0
  318. package/dist/eval/receipt.js.map +1 -0
  319. package/dist/eval/report/assemble.d.ts +84 -0
  320. package/dist/eval/report/assemble.d.ts.map +1 -0
  321. package/dist/eval/report/assemble.js +277 -0
  322. package/dist/eval/report/assemble.js.map +1 -0
  323. package/dist/eval/report/fold.d.ts +18 -0
  324. package/dist/eval/report/fold.d.ts.map +1 -0
  325. package/dist/eval/report/fold.js +58 -0
  326. package/dist/eval/report/fold.js.map +1 -0
  327. package/dist/eval/rule/alternatives.d.ts +23 -0
  328. package/dist/eval/rule/alternatives.d.ts.map +1 -0
  329. package/dist/eval/rule/alternatives.js +46 -0
  330. package/dist/eval/rule/alternatives.js.map +1 -0
  331. package/dist/eval/rule/behaviour.d.ts +47 -0
  332. package/dist/eval/rule/behaviour.d.ts.map +1 -0
  333. package/dist/eval/rule/behaviour.js +249 -0
  334. package/dist/eval/rule/behaviour.js.map +1 -0
  335. package/dist/eval/rule/compute.d.ts +46 -0
  336. package/dist/eval/rule/compute.d.ts.map +1 -0
  337. package/dist/eval/rule/compute.js +158 -0
  338. package/dist/eval/rule/compute.js.map +1 -0
  339. package/dist/eval/rule/create-state.d.ts +42 -0
  340. package/dist/eval/rule/create-state.d.ts.map +1 -0
  341. package/dist/eval/rule/create-state.js +134 -0
  342. package/dist/eval/rule/create-state.js.map +1 -0
  343. package/dist/eval/rule/diagnostics.d.ts +24 -0
  344. package/dist/eval/rule/diagnostics.d.ts.map +1 -0
  345. package/dist/eval/rule/diagnostics.js +45 -0
  346. package/dist/eval/rule/diagnostics.js.map +1 -0
  347. package/dist/eval/rule/execution.d.ts +24 -0
  348. package/dist/eval/rule/execution.d.ts.map +1 -0
  349. package/dist/eval/rule/execution.js +495 -0
  350. package/dist/eval/rule/execution.js.map +1 -0
  351. package/dist/eval/rule/gate.d.ts +12 -0
  352. package/dist/eval/rule/gate.d.ts.map +1 -0
  353. package/dist/eval/rule/gate.js +34 -0
  354. package/dist/eval/rule/gate.js.map +1 -0
  355. package/dist/eval/rule/item.d.ts +11 -0
  356. package/dist/eval/rule/item.d.ts.map +1 -0
  357. package/dist/eval/rule/item.js +265 -0
  358. package/dist/eval/rule/item.js.map +1 -0
  359. package/dist/eval/rule/prepare.d.ts +64 -0
  360. package/dist/eval/rule/prepare.d.ts.map +1 -0
  361. package/dist/eval/rule/prepare.js +131 -0
  362. package/dist/eval/rule/prepare.js.map +1 -0
  363. package/dist/eval/rule/result.d.ts +97 -0
  364. package/dist/eval/rule/result.d.ts.map +1 -0
  365. package/dist/eval/rule/result.js +347 -0
  366. package/dist/eval/rule/result.js.map +1 -0
  367. package/dist/eval/rule/runner.d.ts +128 -0
  368. package/dist/eval/rule/runner.d.ts.map +1 -0
  369. package/dist/eval/rule/runner.js +296 -0
  370. package/dist/eval/rule/runner.js.map +1 -0
  371. package/dist/eval/rule/screen.d.ts +32 -0
  372. package/dist/eval/rule/screen.d.ts.map +1 -0
  373. package/dist/eval/rule/screen.js +73 -0
  374. package/dist/eval/rule/screen.js.map +1 -0
  375. package/dist/eval/rule/state.d.ts +137 -0
  376. package/dist/eval/rule/state.d.ts.map +1 -0
  377. package/dist/eval/rule/state.js +2 -0
  378. package/dist/eval/rule/state.js.map +1 -0
  379. package/dist/eval/rule/steps.d.ts +44 -0
  380. package/dist/eval/rule/steps.d.ts.map +1 -0
  381. package/dist/eval/rule/steps.js +367 -0
  382. package/dist/eval/rule/steps.js.map +1 -0
  383. package/dist/eval/rule/visibility.d.ts +18 -0
  384. package/dist/eval/rule/visibility.d.ts.map +1 -0
  385. package/dist/eval/rule/visibility.js +79 -0
  386. package/dist/eval/rule/visibility.js.map +1 -0
  387. package/dist/eval/seal.d.ts +74 -0
  388. package/dist/eval/seal.d.ts.map +1 -0
  389. package/dist/eval/seal.js +154 -0
  390. package/dist/eval/seal.js.map +1 -0
  391. package/dist/eval/signature-coverage.d.ts +19 -0
  392. package/dist/eval/signature-coverage.d.ts.map +1 -0
  393. package/dist/eval/signature-coverage.js +160 -0
  394. package/dist/eval/signature-coverage.js.map +1 -0
  395. package/dist/eval/state/derive.d.ts +72 -0
  396. package/dist/eval/state/derive.d.ts.map +1 -0
  397. package/dist/eval/state/derive.js +61 -0
  398. package/dist/eval/state/derive.js.map +1 -0
  399. package/dist/eval/state/describe.d.ts +18 -0
  400. package/dist/eval/state/describe.d.ts.map +1 -0
  401. package/dist/eval/state/describe.js +19 -0
  402. package/dist/eval/state/describe.js.map +1 -0
  403. package/dist/eval/state/field-state.d.ts +471 -0
  404. package/dist/eval/state/field-state.d.ts.map +1 -0
  405. package/dist/eval/state/field-state.js +1604 -0
  406. package/dist/eval/state/field-state.js.map +1 -0
  407. package/dist/eval/state/measurement.d.ts +136 -0
  408. package/dist/eval/state/measurement.d.ts.map +1 -0
  409. package/dist/eval/state/measurement.js +209 -0
  410. package/dist/eval/state/measurement.js.map +1 -0
  411. package/dist/eval/state/options.d.ts +21 -0
  412. package/dist/eval/state/options.d.ts.map +1 -0
  413. package/dist/eval/state/options.js +3 -0
  414. package/dist/eval/state/options.js.map +1 -0
  415. package/dist/eval/state/readiness.d.ts +400 -0
  416. package/dist/eval/state/readiness.d.ts.map +1 -0
  417. package/dist/eval/state/readiness.js +1067 -0
  418. package/dist/eval/state/readiness.js.map +1 -0
  419. package/dist/eval/state/snapshot.d.ts +130 -0
  420. package/dist/eval/state/snapshot.d.ts.map +1 -0
  421. package/dist/eval/state/snapshot.js +35 -0
  422. package/dist/eval/state/snapshot.js.map +1 -0
  423. package/dist/eval/state/unavailable-options.d.ts +54 -0
  424. package/dist/eval/state/unavailable-options.d.ts.map +1 -0
  425. package/dist/eval/state/unavailable-options.js +82 -0
  426. package/dist/eval/state/unavailable-options.js.map +1 -0
  427. package/dist/eval/state/value-state.d.ts +38 -0
  428. package/dist/eval/state/value-state.d.ts.map +1 -0
  429. package/dist/eval/state/value-state.js +52 -0
  430. package/dist/eval/state/value-state.js.map +1 -0
  431. package/dist/eval/submission/admission.d.ts +50 -0
  432. package/dist/eval/submission/admission.d.ts.map +1 -0
  433. package/dist/eval/submission/admission.js +174 -0
  434. package/dist/eval/submission/admission.js.map +1 -0
  435. package/dist/eval/submission/authority.d.ts +71 -0
  436. package/dist/eval/submission/authority.d.ts.map +1 -0
  437. package/dist/eval/submission/authority.js +118 -0
  438. package/dist/eval/submission/authority.js.map +1 -0
  439. package/dist/eval/submission/datasets.d.ts +28 -0
  440. package/dist/eval/submission/datasets.d.ts.map +1 -0
  441. package/dist/eval/submission/datasets.js +109 -0
  442. package/dist/eval/submission/datasets.js.map +1 -0
  443. package/dist/eval/submission/index.d.ts +15 -0
  444. package/dist/eval/submission/index.d.ts.map +1 -0
  445. package/dist/eval/submission/index.js +13 -0
  446. package/dist/eval/submission/index.js.map +1 -0
  447. package/dist/eval/submission/refusals.d.ts +103 -0
  448. package/dist/eval/submission/refusals.d.ts.map +1 -0
  449. package/dist/eval/submission/refusals.js +15 -0
  450. package/dist/eval/submission/refusals.js.map +1 -0
  451. package/dist/eval/submission/signatures.d.ts +7 -0
  452. package/dist/eval/submission/signatures.d.ts.map +1 -0
  453. package/dist/eval/submission/signatures.js +215 -0
  454. package/dist/eval/submission/signatures.js.map +1 -0
  455. package/dist/eval/submission/writes.d.ts +51 -0
  456. package/dist/eval/submission/writes.d.ts.map +1 -0
  457. package/dist/eval/submission/writes.js +203 -0
  458. package/dist/eval/submission/writes.js.map +1 -0
  459. package/dist/eval/submission.d.ts +53 -0
  460. package/dist/eval/submission.d.ts.map +1 -0
  461. package/dist/eval/submission.js +521 -0
  462. package/dist/eval/submission.js.map +1 -0
  463. package/dist/eval/suggestions-to-engine.d.ts +18 -0
  464. package/dist/eval/suggestions-to-engine.d.ts.map +1 -0
  465. package/dist/eval/suggestions-to-engine.js +40 -0
  466. package/dist/eval/suggestions-to-engine.js.map +1 -0
  467. package/dist/eval/suggestions.d.ts +17 -0
  468. package/dist/eval/suggestions.d.ts.map +1 -0
  469. package/dist/eval/suggestions.js +314 -0
  470. package/dist/eval/suggestions.js.map +1 -0
  471. package/dist/eval/undecided.d.ts +64 -0
  472. package/dist/eval/undecided.d.ts.map +1 -0
  473. package/dist/eval/undecided.js +101 -0
  474. package/dist/eval/undecided.js.map +1 -0
  475. package/dist/eval/verdict.d.ts +66 -0
  476. package/dist/eval/verdict.d.ts.map +1 -0
  477. package/dist/eval/verdict.js +106 -0
  478. package/dist/eval/verdict.js.map +1 -0
  479. package/dist/eval/verify-signature.d.ts +78 -0
  480. package/dist/eval/verify-signature.d.ts.map +1 -0
  481. package/dist/eval/verify-signature.js +185 -0
  482. package/dist/eval/verify-signature.js.map +1 -0
  483. package/dist/eval/version-dispatch.d.ts +38 -0
  484. package/dist/eval/version-dispatch.d.ts.map +1 -0
  485. package/dist/eval/version-dispatch.js +61 -0
  486. package/dist/eval/version-dispatch.js.map +1 -0
  487. package/dist/eval/visibility.d.ts +33 -0
  488. package/dist/eval/visibility.d.ts.map +1 -0
  489. package/dist/eval/visibility.js +83 -0
  490. package/dist/eval/visibility.js.map +1 -0
  491. package/dist/evaluate.d.ts +24 -0
  492. package/dist/evaluate.d.ts.map +1 -0
  493. package/dist/evaluate.js +18 -0
  494. package/dist/evaluate.js.map +1 -0
  495. package/dist/expr/builtin-docs.d.ts +51 -0
  496. package/dist/expr/builtin-docs.d.ts.map +1 -0
  497. package/dist/expr/builtin-docs.js +874 -0
  498. package/dist/expr/builtin-docs.js.map +1 -0
  499. package/dist/expr/builtins.d.ts +50 -0
  500. package/dist/expr/builtins.d.ts.map +1 -0
  501. package/dist/expr/builtins.js +966 -0
  502. package/dist/expr/builtins.js.map +1 -0
  503. package/dist/expr/decimal-precision.d.ts +39 -0
  504. package/dist/expr/decimal-precision.d.ts.map +1 -0
  505. package/dist/expr/decimal-precision.js +62 -0
  506. package/dist/expr/decimal-precision.js.map +1 -0
  507. package/dist/expr/decimal.d.ts +172 -0
  508. package/dist/expr/decimal.d.ts.map +1 -0
  509. package/dist/expr/decimal.js +782 -0
  510. package/dist/expr/decimal.js.map +1 -0
  511. package/dist/expr/deprecations.d.ts +34 -0
  512. package/dist/expr/deprecations.d.ts.map +1 -0
  513. package/dist/expr/deprecations.js +17 -0
  514. package/dist/expr/deprecations.js.map +1 -0
  515. package/dist/expr/diagnostics.d.ts +21 -0
  516. package/dist/expr/diagnostics.d.ts.map +1 -0
  517. package/dist/expr/diagnostics.js +231 -0
  518. package/dist/expr/diagnostics.js.map +1 -0
  519. package/dist/expr/direction.d.ts +30 -0
  520. package/dist/expr/direction.d.ts.map +1 -0
  521. package/dist/expr/direction.js +77 -0
  522. package/dist/expr/direction.js.map +1 -0
  523. package/dist/expr/example-expression.d.ts +62 -0
  524. package/dist/expr/example-expression.d.ts.map +1 -0
  525. package/dist/expr/example-expression.js +670 -0
  526. package/dist/expr/example-expression.js.map +1 -0
  527. package/dist/expr/instant.d.ts +49 -0
  528. package/dist/expr/instant.d.ts.map +1 -0
  529. package/dist/expr/instant.js +111 -0
  530. package/dist/expr/instant.js.map +1 -0
  531. package/dist/expr/logic.d.ts +17 -0
  532. package/dist/expr/logic.d.ts.map +1 -0
  533. package/dist/expr/logic.js +65 -0
  534. package/dist/expr/logic.js.map +1 -0
  535. package/dist/expr/messages.d.ts +45 -0
  536. package/dist/expr/messages.d.ts.map +1 -0
  537. package/dist/expr/messages.js +280 -0
  538. package/dist/expr/messages.js.map +1 -0
  539. package/dist/expr/money.d.ts +38 -0
  540. package/dist/expr/money.d.ts.map +1 -0
  541. package/dist/expr/money.js +127 -0
  542. package/dist/expr/money.js.map +1 -0
  543. package/dist/expr/ordering.d.ts +56 -0
  544. package/dist/expr/ordering.d.ts.map +1 -0
  545. package/dist/expr/ordering.js +167 -0
  546. package/dist/expr/ordering.js.map +1 -0
  547. package/dist/expr/pattern.d.ts +44 -0
  548. package/dist/expr/pattern.d.ts.map +1 -0
  549. package/dist/expr/pattern.js +458 -0
  550. package/dist/expr/pattern.js.map +1 -0
  551. package/dist/expr/plain-date.d.ts +90 -0
  552. package/dist/expr/plain-date.d.ts.map +1 -0
  553. package/dist/expr/plain-date.js +230 -0
  554. package/dist/expr/plain-date.js.map +1 -0
  555. package/dist/expr/plural-categories.d.ts +8 -0
  556. package/dist/expr/plural-categories.d.ts.map +1 -0
  557. package/dist/expr/plural-categories.js +15 -0
  558. package/dist/expr/plural-categories.js.map +1 -0
  559. package/dist/expr/plural-keys.d.ts +39 -0
  560. package/dist/expr/plural-keys.d.ts.map +1 -0
  561. package/dist/expr/plural-keys.js +46 -0
  562. package/dist/expr/plural-keys.js.map +1 -0
  563. package/dist/expr/plural.d.ts +33 -0
  564. package/dist/expr/plural.d.ts.map +1 -0
  565. package/dist/expr/plural.js +50 -0
  566. package/dist/expr/plural.js.map +1 -0
  567. package/dist/expr/quantity.d.ts +31 -0
  568. package/dist/expr/quantity.d.ts.map +1 -0
  569. package/dist/expr/quantity.js +83 -0
  570. package/dist/expr/quantity.js.map +1 -0
  571. package/dist/expr/reduce.d.ts +50 -0
  572. package/dist/expr/reduce.d.ts.map +1 -0
  573. package/dist/expr/reduce.js +236 -0
  574. package/dist/expr/reduce.js.map +1 -0
  575. package/dist/expr/regex.d.ts +108 -0
  576. package/dist/expr/regex.d.ts.map +1 -0
  577. package/dist/expr/regex.js +1210 -0
  578. package/dist/expr/regex.js.map +1 -0
  579. package/dist/expr/select-locale.d.ts +67 -0
  580. package/dist/expr/select-locale.d.ts.map +1 -0
  581. package/dist/expr/select-locale.js +219 -0
  582. package/dist/expr/select-locale.js.map +1 -0
  583. package/dist/expr/sequences.d.ts +123 -0
  584. package/dist/expr/sequences.d.ts.map +1 -0
  585. package/dist/expr/sequences.js +234 -0
  586. package/dist/expr/sequences.js.map +1 -0
  587. package/dist/expr/strings.d.ts +50 -0
  588. package/dist/expr/strings.d.ts.map +1 -0
  589. package/dist/expr/strings.js +184 -0
  590. package/dist/expr/strings.js.map +1 -0
  591. package/dist/expr/validation.d.ts +32 -0
  592. package/dist/expr/validation.d.ts.map +1 -0
  593. package/dist/expr/validation.js +182 -0
  594. package/dist/expr/validation.js.map +1 -0
  595. package/dist/graph/freeze.d.ts +4 -0
  596. package/dist/graph/freeze.d.ts.map +1 -0
  597. package/dist/graph/freeze.js +52 -0
  598. package/dist/graph/freeze.js.map +1 -0
  599. package/dist/graph/index.d.ts +15 -0
  600. package/dist/graph/index.d.ts.map +1 -0
  601. package/dist/graph/index.js +13 -0
  602. package/dist/graph/index.js.map +1 -0
  603. package/dist/graph/inspect.d.ts +76 -0
  604. package/dist/graph/inspect.d.ts.map +1 -0
  605. package/dist/graph/inspect.js +263 -0
  606. package/dist/graph/inspect.js.map +1 -0
  607. package/dist/graph/read-walk.d.ts +101 -0
  608. package/dist/graph/read-walk.d.ts.map +1 -0
  609. package/dist/graph/read-walk.js +358 -0
  610. package/dist/graph/read-walk.js.map +1 -0
  611. package/dist/graph/record-index.d.ts +24 -0
  612. package/dist/graph/record-index.d.ts.map +1 -0
  613. package/dist/graph/record-index.js +35 -0
  614. package/dist/graph/record-index.js.map +1 -0
  615. package/dist/index.d.ts +104 -0
  616. package/dist/index.d.ts.map +1 -0
  617. package/dist/index.js +139 -0
  618. package/dist/index.js.map +1 -0
  619. package/dist/lookup/digest.d.ts +51 -0
  620. package/dist/lookup/digest.d.ts.map +1 -0
  621. package/dist/lookup/digest.js +46 -0
  622. package/dist/lookup/digest.js.map +1 -0
  623. package/dist/lookup/index.d.ts +28 -0
  624. package/dist/lookup/index.d.ts.map +1 -0
  625. package/dist/lookup/index.js +27 -0
  626. package/dist/lookup/index.js.map +1 -0
  627. package/dist/lookup/install.d.ts +48 -0
  628. package/dist/lookup/install.d.ts.map +1 -0
  629. package/dist/lookup/install.js +315 -0
  630. package/dist/lookup/install.js.map +1 -0
  631. package/dist/lookup/pass.d.ts +55 -0
  632. package/dist/lookup/pass.d.ts.map +1 -0
  633. package/dist/lookup/pass.js +212 -0
  634. package/dist/lookup/pass.js.map +1 -0
  635. package/dist/lookup/pins.d.ts +34 -0
  636. package/dist/lookup/pins.d.ts.map +1 -0
  637. package/dist/lookup/pins.js +39 -0
  638. package/dist/lookup/pins.js.map +1 -0
  639. package/dist/lookup/provenance.d.ts +23 -0
  640. package/dist/lookup/provenance.d.ts.map +1 -0
  641. package/dist/lookup/provenance.js +78 -0
  642. package/dist/lookup/provenance.js.map +1 -0
  643. package/dist/lookup/readiness.d.ts +13 -0
  644. package/dist/lookup/readiness.d.ts.map +1 -0
  645. package/dist/lookup/readiness.js +57 -0
  646. package/dist/lookup/readiness.js.map +1 -0
  647. package/dist/lookup/resolve.d.ts +24 -0
  648. package/dist/lookup/resolve.d.ts.map +1 -0
  649. package/dist/lookup/resolve.js +201 -0
  650. package/dist/lookup/resolve.js.map +1 -0
  651. package/dist/lookup/store.d.ts +41 -0
  652. package/dist/lookup/store.d.ts.map +1 -0
  653. package/dist/lookup/store.js +74 -0
  654. package/dist/lookup/store.js.map +1 -0
  655. package/dist/model/access.d.ts +200 -0
  656. package/dist/model/access.d.ts.map +1 -0
  657. package/dist/model/access.js +125 -0
  658. package/dist/model/access.js.map +1 -0
  659. package/dist/model/artifact-members.d.ts +3 -0
  660. package/dist/model/artifact-members.d.ts.map +1 -0
  661. package/dist/model/artifact-members.js +38 -0
  662. package/dist/model/artifact-members.js.map +1 -0
  663. package/dist/model/composition.d.ts +47 -0
  664. package/dist/model/composition.d.ts.map +1 -0
  665. package/dist/model/composition.js +66 -0
  666. package/dist/model/composition.js.map +1 -0
  667. package/dist/model/domain.d.ts +51 -0
  668. package/dist/model/domain.d.ts.map +1 -0
  669. package/dist/model/domain.js +75 -0
  670. package/dist/model/domain.js.map +1 -0
  671. package/dist/model/duration.d.ts +31 -0
  672. package/dist/model/duration.d.ts.map +1 -0
  673. package/dist/model/duration.js +136 -0
  674. package/dist/model/duration.js.map +1 -0
  675. package/dist/model/errors.d.ts +58 -0
  676. package/dist/model/errors.d.ts.map +1 -0
  677. package/dist/model/errors.js +81 -0
  678. package/dist/model/errors.js.map +1 -0
  679. package/dist/model/evolution.d.ts +177 -0
  680. package/dist/model/evolution.d.ts.map +1 -0
  681. package/dist/model/evolution.js +5 -0
  682. package/dist/model/evolution.js.map +1 -0
  683. package/dist/model/expr-children.d.ts +15 -0
  684. package/dist/model/expr-children.d.ts.map +1 -0
  685. package/dist/model/expr-children.js +45 -0
  686. package/dist/model/expr-children.js.map +1 -0
  687. package/dist/model/guards.d.ts +9 -0
  688. package/dist/model/guards.d.ts.map +1 -0
  689. package/dist/model/guards.js +11 -0
  690. package/dist/model/guards.js.map +1 -0
  691. package/dist/model/input.d.ts +42 -0
  692. package/dist/model/input.d.ts.map +1 -0
  693. package/dist/model/input.js +26 -0
  694. package/dist/model/input.js.map +1 -0
  695. package/dist/model/integer.d.ts +14 -0
  696. package/dist/model/integer.d.ts.map +1 -0
  697. package/dist/model/integer.js +16 -0
  698. package/dist/model/integer.js.map +1 -0
  699. package/dist/model/intrinsic.d.ts +18 -0
  700. package/dist/model/intrinsic.d.ts.map +1 -0
  701. package/dist/model/intrinsic.js +21 -0
  702. package/dist/model/intrinsic.js.map +1 -0
  703. package/dist/model/layout.d.ts +129 -0
  704. package/dist/model/layout.d.ts.map +1 -0
  705. package/dist/model/layout.js +2 -0
  706. package/dist/model/layout.js.map +1 -0
  707. package/dist/model/media.d.ts +33 -0
  708. package/dist/model/media.d.ts.map +1 -0
  709. package/dist/model/media.js +86 -0
  710. package/dist/model/media.js.map +1 -0
  711. package/dist/model/members.generated.d.ts +11 -0
  712. package/dist/model/members.generated.d.ts.map +1 -0
  713. package/dist/model/members.generated.js +71 -0
  714. package/dist/model/members.generated.js.map +1 -0
  715. package/dist/model/row-address.d.ts +27 -0
  716. package/dist/model/row-address.d.ts.map +1 -0
  717. package/dist/model/row-address.js +146 -0
  718. package/dist/model/row-address.js.map +1 -0
  719. package/dist/model/schema.d.ts +108 -0
  720. package/dist/model/schema.d.ts.map +1 -0
  721. package/dist/model/schema.js +2 -0
  722. package/dist/model/schema.js.map +1 -0
  723. package/dist/model/shape.d.ts +193 -0
  724. package/dist/model/shape.d.ts.map +1 -0
  725. package/dist/model/shape.js +2 -0
  726. package/dist/model/shape.js.map +1 -0
  727. package/dist/model/time.d.ts +61 -0
  728. package/dist/model/time.d.ts.map +1 -0
  729. package/dist/model/time.js +110 -0
  730. package/dist/model/time.js.map +1 -0
  731. package/dist/model/types.d.ts +1329 -0
  732. package/dist/model/types.d.ts.map +1 -0
  733. package/dist/model/types.js +424 -0
  734. package/dist/model/types.js.map +1 -0
  735. package/dist/model/values.d.ts +91 -0
  736. package/dist/model/values.d.ts.map +1 -0
  737. package/dist/model/values.js +195 -0
  738. package/dist/model/values.js.map +1 -0
  739. package/dist/model/wire.d.ts +356 -0
  740. package/dist/model/wire.d.ts.map +1 -0
  741. package/dist/model/wire.js +1504 -0
  742. package/dist/model/wire.js.map +1 -0
  743. package/dist/offline/index.d.ts +374 -0
  744. package/dist/offline/index.d.ts.map +1 -0
  745. package/dist/offline/index.js +422 -0
  746. package/dist/offline/index.js.map +1 -0
  747. package/dist/testing.d.ts +30 -0
  748. package/dist/testing.d.ts.map +1 -0
  749. package/dist/testing.js +42 -0
  750. package/dist/testing.js.map +1 -0
  751. package/dist/version.d.ts +30 -0
  752. package/dist/version.d.ts.map +1 -0
  753. package/dist/version.js +116 -0
  754. package/dist/version.js.map +1 -0
  755. package/package.json +98 -3
@@ -0,0 +1,1329 @@
1
+ /**
2
+ * Axiom's shared wire contracts.
3
+ *
4
+ * Everything here is the runtime's public vocabulary for a compiled artifact: the
5
+ * closed expression AST, the schema and rule shapes a compiler emits, the outcome
6
+ * lattice, and the frozen sentinels for a value the runtime could not determine.
7
+ * Shapes follow `spec/metaschema/schema.v1.json`; meaning follows
8
+ * `spec/semantics/*-v1.md`.
9
+ */
10
+ import type { CompositionReport } from './composition.js';
11
+ /** A JSON object holding only canonical wire values. */
12
+ export interface WireRecord {
13
+ readonly [fieldId: string]: WireValue;
14
+ }
15
+ /** A money amount in minor units, per `spec/semantics/model-v1.md`. */
16
+ export interface MoneyValue {
17
+ readonly minor: string;
18
+ readonly currency: string;
19
+ readonly scale: number;
20
+ }
21
+ /**
22
+ * A measured quantity, `spec/semantics/model-v1.md` `MODEL-2.1.21`.
23
+ *
24
+ * `value` is canonical decimal text at the declaration's scale and `unit` is one of the unit
25
+ * codes the field declares. Carrying the unit in the value is what makes a mixed-unit sum a
26
+ * refusal rather than a silent conversion: v1 defines no unit conversion.
27
+ */
28
+ export interface QuantityValue {
29
+ readonly value: string;
30
+ readonly unit: string;
31
+ }
32
+ /**
33
+ * A bookable slot, `spec/semantics/model-v1.md`.
34
+ *
35
+ * `start` and `end` are UTC instants and `localDate` is the service-local civil date of
36
+ * `start`. Axiom carries no timezone database, so `localDate` is a host commitment it cannot
37
+ * verify; `start < end` it does verify. `slotId` is the option identity, so two resources may
38
+ * share one range.
39
+ */
40
+ export interface TimeslotValue {
41
+ readonly slotId: string;
42
+ readonly localDate: string;
43
+ readonly start: string;
44
+ readonly end: string;
45
+ }
46
+ /** The three units a duration may state, `spec/semantics/model-v1.md` `MODEL-2.1.24`. */
47
+ export declare const DURATION_UNITS: readonly ['minutes', 'hours', 'seconds'];
48
+ export type DurationUnit = (typeof DURATION_UNITS)[number];
49
+ /** Whether an untrusted value names a duration unit. */
50
+ export declare function isDurationUnit(value: unknown): value is DurationUnit;
51
+ /**
52
+ * A length of time, `spec/semantics/model-v1.md` `MODEL-2.1.24`.
53
+ *
54
+ * `amount` is a whole number of units and `unit` travels with it, so a mixed-unit sum is a refusal
55
+ * rather than a silent conversion. v1 defines no unit conversion between minutes, hours and
56
+ * seconds; `duration_minutes` and `duration_seconds` are the explicit conversions.
57
+ */
58
+ export interface DurationValue {
59
+ readonly amount: number;
60
+ readonly unit: DurationUnit;
61
+ }
62
+ /**
63
+ * A postal address, `spec/semantics/model-v1.md` `MODEL-2.1.25`.
64
+ *
65
+ * Structural only: the required members are non-empty, `country` is an upper-case ISO alpha-2
66
+ * code, and no other member is admitted. Axiom validates no world postal format.
67
+ */
68
+ export interface AddressValue {
69
+ readonly line1: string;
70
+ readonly line2?: string;
71
+ readonly city: string;
72
+ readonly region?: string;
73
+ readonly postalCode: string;
74
+ readonly country: string;
75
+ }
76
+ /**
77
+ * A geographic position, `spec/semantics/model-v1.md` `MODEL-2.1.26`.
78
+ *
79
+ * Latitude and longitude are canonical decimal text so no JSON float enters a canonical hash;
80
+ * `accuracy` is the optional radius in metres. v1 offers no distance and no geocoding.
81
+ */
82
+ export interface CoordinateValue {
83
+ readonly latitude: string;
84
+ readonly longitude: string;
85
+ readonly accuracy?: string;
86
+ }
87
+ /**
88
+ * A canonical wire value. Floats, `NaN`, `Infinity`, `BigInt` and boxed primitives
89
+ * are not part of this union: a value outside it is invalid input, never coerced.
90
+ */
91
+ export type WireValue = string | boolean | number | null | MoneyValue | QuantityValue | DurationValue | AddressValue | CoordinateValue | TimeslotValue | readonly WireValue[] | WireRecord;
92
+ /**
93
+ * A dataset scalar, `spec/metaschema/dataset.v1.json` `$defs/scalar`.
94
+ *
95
+ * A table's values, key columns and every provenance key are drawn from this union, which
96
+ * is narrower than `WireValue`: no `null`, no record and no list is a member, a column value
97
+ * or a query key. The report's contract states the same union, so a key
98
+ * vector typed this way cannot produce an entry the published metaschema refuses.
99
+ */
100
+ export type ScalarWireValue = string | boolean | number | MoneyValue | QuantityValue;
101
+ declare const decimalStringBrand: unique symbol;
102
+ /**
103
+ * Canonical decimal text, as `spec/semantics/expr-v1.md` defines it:
104
+ * no exponent, no leading zeros, no trailing fractional zeros and never `-0`.
105
+ * Branding keeps a plain string from being passed where a normalised decimal is
106
+ * required; `asDecimalString` is the only constructor.
107
+ */
108
+ export type DecimalString = string & {
109
+ readonly [decimalStringBrand]: 'DecimalString';
110
+ };
111
+ /** Canonical decimal text, as `asDecimalString` accepts it. */
112
+ export declare const DECIMAL_TEXT_PATTERN: RegExp;
113
+ /**
114
+ * Canonical integer text, `spec/semantics/model-v1.md` `MODEL-2.1.5` and
115
+ * `spec/semantics/expr-v1.md` `EXPR-7.2.9`: an optional `-`, then `0` or a non-zero digit
116
+ * followed by digits. A leading `+`, a leading zero and `-0` are outside it, and `-0` is refused
117
+ * by the pattern itself rather than by a second test beside it, so one authority decides what an
118
+ * integer spelling is.
119
+ */
120
+ export declare const INTEGER_TEXT_PATTERN: RegExp;
121
+ /** A civil date, `spec/semantics/model-v1.md`. */
122
+ export declare const PLAIN_DATE_PATTERN: RegExp;
123
+ /**
124
+ * The single canonical spelling of a fixed-millisecond UTC instant.
125
+ *
126
+ * The pattern bounds the field widths and ranges that are expressible as a pattern;
127
+ * `parseInstant` also refuses an impossible civil date or clock time.
128
+ */
129
+ export declare const INSTANT_PATTERN: RegExp;
130
+ /** An ISO 4217-shaped currency code: three upper-case ASCII letters. */
131
+ export declare const CURRENCY_CODE_PATTERN: RegExp;
132
+ /** An ISO 3166-1 alpha-2 country code as the address primitive states it, `MODEL-2.1.25`. */
133
+ export declare const COUNTRY_CODE_PATTERN: RegExp;
134
+ /** A stable opaque identifier, `schema.v1.json` `identifier`. */
135
+ export declare const IDENTIFIER_PATTERN: RegExp;
136
+ /** A host-owned upper-case vocabulary code, `schema.v1.json` `code`. */
137
+ export declare const CODE_PATTERN: RegExp;
138
+ /** Lower-case hexadecimal SHA-256. */
139
+ export declare const SHA256_HEX_PATTERN: RegExp;
140
+ /** A media type, `schema.v1.json` `mediaRef.mime`. */
141
+ export declare const MIME_TYPE_PATTERN: RegExp;
142
+ /** A lower-case unit code, `schema.v1.json` `unitCode`, `MODEL-2.1.21`. */
143
+ export declare const UNIT_CODE_PATTERN: RegExp;
144
+ /** The admitted ceiling on a `rowsFrom` expected count, `MODEL-2.1.22`. */
145
+ export declare const ROW_COUNT_CEILING = 1000;
146
+ /**
147
+ * The undetermined values. They are frozen singleton objects, never strings and
148
+ * never `null`, so identity is the only test that admits them:
149
+ * `spec/semantics/expr-v1.md`.
150
+ */
151
+ export type Undetermined = {
152
+ readonly undetermined: 'UNKNOWN';
153
+ } | {
154
+ readonly undetermined: 'DEFERRED';
155
+ };
156
+ /** A required local reading is missing or unreadable. */
157
+ export declare const UNKNOWN: Undetermined;
158
+ /** The value is computed elsewhere: redacted input or a server-tier rule. */
159
+ export declare const DEFERRED: Undetermined;
160
+ /**
161
+ * One row's members a writer could not produce, with the sentinel a read of each states.
162
+ *
163
+ * The row's wire value cannot carry an undetermined member, and the sentinel differs per row —
164
+ * `UNKNOWN` for a local miss, `DEFERRED` for a value computed elsewhere. Keeping the member path
165
+ * only would collapse both to one answer, so the sideband carries the pair. It is aligned with
166
+ * the array's elements, the same way `withheldRows` names the members access removed.
167
+ */
168
+ export type UndeterminedRows = readonly (readonly (readonly [string, Undetermined])[])[];
169
+ /** Admits exactly the two frozen sentinels, so a lookalike object is never undetermined. */
170
+ export declare function isUndetermined(value: unknown): value is Undetermined;
171
+ /**
172
+ * One computed field's value in an evaluation's overlay: the writer's semantic result, or the
173
+ * sentinel that says why the writer could not produce one.
174
+ *
175
+ * `null` is a decided value — the empty value of every domain — so it is not a third state.
176
+ * The union keeps "the value is null" and "the value is undetermined" apart, which is what
177
+ * lets a reader propagate `UNKNOWN`/`DEFERRED` instead of handing a consumer a plausible
178
+ * empty value.
179
+ */
180
+ export type ComputedValue = {
181
+ readonly kind: 'decided';
182
+ readonly value: WireValue;
183
+ /** Access sideband the stripped wire value cannot carry through a later binder. */
184
+ readonly withheldMembers?: readonly string[];
185
+ readonly withheldRows?: readonly (readonly string[])[];
186
+ /** The members a writer could not produce, per row, with the sentinel each read states. */
187
+ readonly undeterminedRows?: UndeterminedRows;
188
+ } | {
189
+ readonly kind: 'undetermined';
190
+ readonly sentinel: Undetermined;
191
+ };
192
+ /** The result lattice, `spec/semantics/expr-v1.md`. */
193
+ export type Outcome = 'PASS' | 'FAIL' | 'UNKNOWN' | 'DEFERRED';
194
+ /** Rule severity, `spec/semantics/rules-v1.md`. */
195
+ export type Severity = 'block' | 'warn' | 'info';
196
+ /**
197
+ * Every rule kind, `spec/semantics/rules-v1.md`.
198
+ *
199
+ * The tuple is the vocabulary's one authority: `RuleKind` derives from it and every reader —
200
+ * `isRuleKind`, the `no_blocking` checks in the runtime and the compiler, the compiled rule
201
+ * walk — reads this list rather than spelling the eight names again. A kind added here is one
202
+ * edit, and the exhaustive switches over `RuleKind` fail typecheck until they account for it.
203
+ */
204
+ export declare const RULE_KINDS: readonly ['validate', 'visible', 'required', 'enabled', 'compute', 'defaultCompute', 'gate', 'screen'];
205
+ /** Rule kinds, `spec/semantics/rules-v1.md`. */
206
+ export type RuleKind = (typeof RULE_KINDS)[number];
207
+ /** Rule scopes, `spec/semantics/rules-v1.md`. */
208
+ export type RuleScope = 'field' | 'record' | 'array' | 'item';
209
+ /**
210
+ * The tiers a rule, an artifact and an evaluation may name, `spec/semantics/rules-v1.md`.
211
+ *
212
+ * One vocabulary: a compiled rule's `evaluateOn`, an artifact's target, an evaluation's
213
+ * environment and a publish report's environment are all a `Tier`. Every boundary that reads a
214
+ * tier from untrusted input — the request reader, the CLI's `--target`, the CSV cell and the
215
+ * scenario document — checks it against this tuple rather than restating the pair.
216
+ */
217
+ export declare const TIERS: readonly ['server', 'client'];
218
+ /** The tier a rule is evaluated on, an artifact is built for or a run judges under. */
219
+ export type Tier = (typeof TIERS)[number];
220
+ /**
221
+ * The tier the local evaluation door runs as when the caller names none.
222
+ *
223
+ * Evaluation holds no server authority, so an omitted tier is the device: a server-tier rule
224
+ * reports `DEFERRED` with `DEFERRED_SERVER_CHECK` rather than being run by a host that never
225
+ * asked to hold that authority. The diagnostic is the signal — a server host that means to
226
+ * decide those rules states `tier: 'server'` explicitly.
227
+ */
228
+ export declare const DEFAULT_EVALUATION_TIER: Tier;
229
+ /**
230
+ * The tier the evidence doors run as when the caller names none.
231
+ *
232
+ * Compilation picks the artifact's target; the vector and scenario readers, the suite runner and
233
+ * publish readiness execute the evidence the artifact declares. That evidence is server-tier
234
+ * unless the target says otherwise (`RULES-3.1.2`). This is not the local evaluation default: the two doors answer two
235
+ * questions, so the two constants have two names.
236
+ */
237
+ export declare const DEFAULT_EVIDENCE_TIER: Tier;
238
+ /** Whether an untrusted value names a tier, so a boundary can refuse one that does not. */
239
+ export declare function isTier(value: unknown): value is Tier;
240
+ /** Field access states, `spec/semantics/access-v1.md`. */
241
+ export type FieldAccess = 'read_write' | 'read_only' | 'write_only' | 'masked' | 'hidden';
242
+ /** The seventeen wire primitives, `spec/semantics/model-v1.md` section 2. */
243
+ export type Primitive = 'string' | 'boolean' | 'integer' | 'decimal' | 'money' | 'date' | 'instant' | 'time' | 'media_ref' | 'signature_ref' | 'timeslot' | 'quantity' | 'duration' | 'address' | 'coordinate' | 'record' | 'array';
244
+ /**
245
+ * The primitives one item of a scalar or attachment array may hold,
246
+ * `spec/semantics/model-v1.md`. A record or a list is declared through
247
+ * `fields`, never through `items`, and `timeslot` is one field's value rather than a list
248
+ * element: its identity is the option it names, which a bare element would not carry.
249
+ *
250
+ * The tuple is the registry: the union is its key set, and every reader, palette and guard
251
+ * derives from it, so a primitive this contract gains has one place to be added.
252
+ */
253
+ export declare const ITEM_PRIMITIVES: readonly ['string', 'integer', 'decimal', 'money', 'date', 'media_ref', 'quantity', 'duration'];
254
+ export type ItemPrimitive = (typeof ITEM_PRIMITIVES)[number];
255
+ /** Whether untrusted text names an item primitive. */
256
+ export declare function isItemPrimitive(value: unknown): value is ItemPrimitive;
257
+ /** The item declaration of a scalar or attachment array, `schema.v1.json` `itemDeclaration`. */
258
+ export interface FieldItem {
259
+ readonly primitive: ItemPrimitive;
260
+ /**
261
+ * The declared money domain of a `money` item, `spec/semantics/model-v1.md` `MODEL-2.1.15`.
262
+ * `currency` and `scale` are present together on a money item and absent on every other
263
+ * primitive, so a reader never has to guess how to parse or format the item.
264
+ */
265
+ readonly currency?: string;
266
+ readonly scale?: number;
267
+ /**
268
+ * The declared unit domain of a `quantity` item, `MODEL-2.1.21`: a non-empty, duplicate-free,
269
+ * ordered list of lower-case unit codes. Present on a quantity item and absent otherwise.
270
+ */
271
+ readonly units?: readonly string[];
272
+ /**
273
+ * The declared unit of a `duration` item, `MODEL-2.1.24`. Present on a duration item and
274
+ * absent otherwise; the value's `unit` must name it.
275
+ */
276
+ readonly unit?: DurationUnit;
277
+ }
278
+ /**
279
+ * Every control hint the language defines, `spec/semantics/model-v1.md`.
280
+ *
281
+ * A hint names a semantic affordance and never a UI component. Which hints a primitive admits
282
+ * is the compiler's single control matrix, `CONTROLS_BY_PRIMITIVE`; this union is the closed
283
+ * vocabulary the wire contract enumerates.
284
+ *
285
+ * The vocabulary is stated here rather than derived from that matrix because the dependency
286
+ * runs compiler -> runtime: the runtime may not import the compiler, so the wire contract owns
287
+ * the names and the matrix owns the pairing. `artifact-alignment.test.ts` pins the two
288
+ * together — every control the union names is paired with some primitive, and the matrix
289
+ * invents none — so a control added on either side fails the other.
290
+ */
291
+ export declare const CONTROLS: readonly ['text', 'textarea', 'email', 'phone', 'url', 'password', 'select', 'radio', 'checkbox', 'combobox', 'switch', 'integer', 'decimal', 'money', 'quantity', 'duration', 'date', 'datetime', 'time', 'slider', 'media_capture', 'signature_capture', 'multiselect', 'rank', 'tags', 'rating', 'likert', 'percentage', 'timeslot', 'address', 'map'];
292
+ export type Control = (typeof CONTROLS)[number];
293
+ /** One declared option code and its localized label, `schema.v1.json` `option`. */
294
+ export interface FieldOption {
295
+ /** A string code, or a safe integer for an ordinal scale such as a star rating. */
296
+ readonly code: string | number;
297
+ readonly labelKey: string;
298
+ readonly deprecated?: boolean;
299
+ /**
300
+ * The condition under which this option may be chosen, `RULES-7.1.1`.
301
+ *
302
+ * Present only on an option the document declares: a host-loaded domain answers availability
303
+ * itself, so no declaration exists for the compiler to evaluate. An absent member means the
304
+ * option is always available.
305
+ */
306
+ readonly availableWhen?: ExprNode;
307
+ /** The message key of the sentence an unavailable option states, `RULES-7.1.1`. */
308
+ readonly unavailableMessageKey?: string;
309
+ /** The message arguments of `unavailableMessageKey`, each evaluated against the record. */
310
+ readonly unavailableParams?: Readonly<Record<string, ExprNode>>;
311
+ /** The alternatives offered while this option's held code is unavailable, `RULES-7.1.4`. */
312
+ readonly suggests?: readonly CompiledSuggestion[];
313
+ }
314
+ /**
315
+ * A row address inside a suggestion, `schema.v1.json` `suggestedRef` and `suggestionOperation`.
316
+ *
317
+ * The reserved spelling `current` stands for the row an item-scoped rule judged, which the engine
318
+ * resolves before it looks a row up. It is not a separate type: a natural key is the record's own
319
+ * text, so a key spelled `current` is the same bytes the symbol is, and the contract states the
320
+ * reserved spelling rather than inventing a second wire form for one word. A report states the key
321
+ * the engine resolved, never the symbol (`RULES-6.1.2`).
322
+ */
323
+ export type SuggestedRowKey = string | number;
324
+ /**
325
+ * The binding one suggestion operation writes, `schema.v1.json` `suggestedRef`.
326
+ *
327
+ * `current` stands for the row an item-scoped rule judged. The engine resolves it to the row's
328
+ * key at evaluation, so the compiled artifact names the row relationally and the report states
329
+ * the key it resolved to.
330
+ */
331
+ export interface SuggestedRef {
332
+ readonly fieldId: string;
333
+ readonly rowKey?: SuggestedRowKey;
334
+ }
335
+ /**
336
+ * One write a suggestion performs, `schema.v1.json` `suggestionOperation`.
337
+ *
338
+ * A compiled operation names an expression; the evaluated form a report carries is
339
+ * `SuggestedOperation`, whose values are the wire values those expressions produced.
340
+ */
341
+ export type CompiledSuggestionOperation = {
342
+ readonly kind: 'value';
343
+ readonly ref: SuggestedRef;
344
+ readonly value: ExprNode;
345
+ } | {
346
+ readonly kind: 'null';
347
+ readonly ref: SuggestedRef;
348
+ } | {
349
+ readonly kind: 'remove';
350
+ readonly ref: SuggestedRef;
351
+ } | {
352
+ readonly kind: 'append';
353
+ readonly fieldId: string;
354
+ readonly row: Readonly<Record<string, ExprNode>>;
355
+ } | {
356
+ readonly kind: 'removeRow';
357
+ readonly fieldId: string;
358
+ readonly rowKey: SuggestedRowKey;
359
+ };
360
+ /** One alternative a rule or an option declares, `schema.v1.json` `suggestion`. */
361
+ export interface CompiledSuggestion {
362
+ readonly labelKey: string;
363
+ readonly operations: readonly CompiledSuggestionOperation[];
364
+ }
365
+ /**
366
+ * Where a field's option domain comes from when the document does not declare it,
367
+ * `schema.v1.json` `optionSource`.
368
+ *
369
+ * `host` names a loader the host resolves for `sourceId` (optionally keyed by the values of
370
+ * `dependsOn`); `field` derives the domain from another field's scalar array, which is what
371
+ * makes "enter three things, then rank them" configuration rather than code.
372
+ */
373
+ export type OptionSource = {
374
+ readonly kind: 'host';
375
+ readonly sourceId: string;
376
+ readonly dependsOn?: readonly string[];
377
+ } | {
378
+ readonly kind: 'field';
379
+ readonly fieldId: string;
380
+ };
381
+ /**
382
+ * The comparison operators: infix only and non-associative.
383
+ *
384
+ * The tuple is the single source. The union is derived from it, so a name cannot exist in
385
+ * the type without existing at runtime, and `EXPR_OPERATORS` below cannot drift from it.
386
+ */
387
+ export declare const COMPARISON_OPERATORS: readonly ['==', '!=', '<', '<=', '>', '>=', 'in'];
388
+ export type ComparisonOperator = (typeof COMPARISON_OPERATORS)[number];
389
+ /**
390
+ * The arithmetic operators written infix in source.
391
+ *
392
+ * `/` is a canonical operator rather than an alias: it has its own semantics (numeric division
393
+ * at 34 significant digits, and the money ratio) and its own refusals, so it is not parse-time
394
+ * sugar for another node.
395
+ */
396
+ export declare const ARITHMETIC_OPERATORS: readonly ['+', '-', '*', '/', '%', '//'];
397
+ export type ArithmeticOperator = (typeof ARITHMETIC_OPERATORS)[number];
398
+ /** The callable built-ins. `in` is infix-only, so it is not one. */
399
+ export declare const BUILTIN_OPERATORS: readonly ['len', 'lower', 'upper', 'trim', 'starts_with', 'ends_with', 'contains', 'between', 'ascii_match', 'is_email', 'is_phone', 'is_url', 'is_unique', 'all', 'any', 'present', 'absent', 'empty', 'is_relevant', 'sum', 'count_where', 'count_distinct', 'min', 'max', 'to_decimal', 'to_string', 'parse_integer', 'parse_decimal', 'round', 'round_up', 'round_down', 'round_even', 'pow', 'money_minor', 'money_from_minor', 'money_currency', 'money_scale', 'add_days', 'add_months', 'add_minutes', 'days_between', 'months_between', 'minutes_between', 'duration_minutes', 'duration_seconds', 'in_set', 'lookup', 'decide_keys', 'digest', 'member', 'keys', 'values', 'has_cap', 'rule_ok', 'no_blocking', 'rule_ok_in', 'no_blocking_in', 'required_in', 'abs', 'ceil', 'floor', 'avg', 'median', 'first', 'last', 'replace', 'split', 'join', 'substring', 'index_of', 'add_years', 'start_of_day', 'civil_date', 'matches', 'map', 'filter', 'mode', 'concat', 'year', 'month', 'day', 'weekday', 'parse_date', 'parse_instant', 'sort', 'slice', 'distinct', 'reverse'];
400
+ export type BuiltinOperator = (typeof BUILTIN_OPERATORS)[number];
401
+ /**
402
+ * The built-ins that name a table. Their first operand is an identifier
403
+ * rather than a read, so every consumer that walks an expression asks this one set instead
404
+ * of spelling the names again: the check that the table is declared, the typing rule, and
405
+ * the dependency graph all start their operand walk at the second argument.
406
+ */
407
+ export declare const DATASET_BUILTINS: ReadonlySet<string>;
408
+ /** Every operator name a `call` node may carry, `schema.v1.json` `callOperator`. */
409
+ export type CallOperator = ArithmeticOperator | BuiltinOperator;
410
+ /** Every operator name the closed language defines. */
411
+ export type ExprOperator = ComparisonOperator | CallOperator;
412
+ /**
413
+ * The closed operator set of `spec/semantics/expr-v1.md`, assembled from
414
+ * the three families so a name added to one cannot be missing here.
415
+ */
416
+ export declare const EXPR_OPERATORS: readonly ExprOperator[];
417
+ /**
418
+ * The static domain of a literal: the value's domain is declared by the
419
+ * compiler rather than guessed from the text, so the string `"1.5"` and the decimal
420
+ * `1.5` are two literals of different domains, and `date`/`instant`/`money` literals
421
+ * carry their domain explicitly.
422
+ */
423
+ export type LiteralDomain = Primitive | 'null';
424
+ export interface LiteralNode {
425
+ readonly kind: 'literal';
426
+ readonly domain: LiteralDomain;
427
+ readonly value: WireValue;
428
+ }
429
+ export interface PathNode {
430
+ readonly kind: 'path';
431
+ /** Dot-separated path, keeping the `$` sigil of an implicit binder. */
432
+ readonly path: string;
433
+ }
434
+ export interface ListNode {
435
+ readonly kind: 'list';
436
+ readonly items: readonly ExprNode[];
437
+ }
438
+ export interface AndNode {
439
+ readonly kind: 'and';
440
+ readonly args: readonly ExprNode[];
441
+ }
442
+ export interface OrNode {
443
+ readonly kind: 'or';
444
+ readonly args: readonly ExprNode[];
445
+ }
446
+ export interface NotNode {
447
+ readonly kind: 'not';
448
+ readonly args: readonly [ExprNode];
449
+ }
450
+ export interface CompareNode {
451
+ readonly kind: 'compare';
452
+ readonly op: ComparisonOperator;
453
+ readonly args: readonly [ExprNode, ExprNode];
454
+ }
455
+ export interface IfNode {
456
+ readonly kind: 'if';
457
+ readonly args: readonly [ExprNode, ExprNode, ExprNode];
458
+ }
459
+ export interface CoalesceNode {
460
+ readonly kind: 'coalesce';
461
+ readonly args: readonly ExprNode[];
462
+ }
463
+ export interface CallNode {
464
+ readonly kind: 'call';
465
+ readonly op: CallOperator;
466
+ readonly args: readonly ExprNode[];
467
+ }
468
+ export interface ComprehensionBinder {
469
+ readonly name: string;
470
+ }
471
+ export interface ComprehensionNode {
472
+ readonly kind: 'comprehension';
473
+ readonly binder: ComprehensionBinder;
474
+ readonly source: ExprNode;
475
+ readonly valueExpr?: ExprNode;
476
+ readonly predicate?: ExprNode;
477
+ }
478
+ /** A node of the closed compiled AST, `spec/metaschema/schema.v1.json` `exprNode`. */
479
+ export type ExprNode = LiteralNode | PathNode | ListNode | AndNode | OrNode | NotNode | CompareNode | IfNode | CoalesceNode | CallNode | ComprehensionNode;
480
+ /** A declared context root, `spec/semantics/context-v1.md`. */
481
+ export interface ContextRoot {
482
+ readonly path: string;
483
+ readonly primitive: Primitive;
484
+ readonly nullability?: 'required' | 'optional';
485
+ /**
486
+ * The declared money domain, present on a `money` root and absent otherwise. A root is the one
487
+ * channel where the artifact declares a host-supplied fact, so the same domain a field states
488
+ * travels here (`CTX-3.1.6`): a value outside it is refused at the boundary rather than read.
489
+ */
490
+ readonly currency?: string;
491
+ readonly scale?: number;
492
+ /**
493
+ * The declared unit domain of a `quantity` root, `MODEL-2.1.21`. `units` is required on a
494
+ * quantity root, exactly as it is on a quantity field, so a mixed unit cannot be read; `scale`
495
+ * is the largest number of fractional digits the value may carry.
496
+ */
497
+ readonly units?: readonly string[];
498
+ /** The declared unit of a `duration` root, `MODEL-2.1.24`; absent means `minutes`. */
499
+ readonly unit?: string;
500
+ /** A scalar or attachment array root declares its item domain, as a field does. */
501
+ readonly items?: FieldItem;
502
+ }
503
+ /**
504
+ * The context roots every schema may read without declaring them.
505
+ *
506
+ * Their values come from the evaluation environment rather than from the record: the record
507
+ * date is the host's and the schema version is the artifact's own. A schema
508
+ * that declares one of these names is refused at the document boundary, so the two channels
509
+ * cannot disagree about what `context.record_date` means.
510
+ */
511
+ export type ReservedContextRoot = 'record_date' | 'schema_version';
512
+ export declare const RESERVED_CONTEXT_ROOTS: readonly {
513
+ readonly path: ReservedContextRoot;
514
+ readonly primitive: Primitive;
515
+ }[];
516
+ /** Whether a root path (without the `context.` prefix) names a reserved root. */
517
+ export declare function isReservedContextRoot(path: string): path is ReservedContextRoot;
518
+ /**
519
+ * What a hidden field's captured value does in the submission projection,
520
+ * `spec/semantics/rules-v1.md`: `preserve` keeps it and `exclude` drops
521
+ * it. Hiding never destroys a value in a live draft either way.
522
+ */
523
+ export type OnHidePolicy = 'preserve' | 'exclude';
524
+ /** A declared field, `spec/metaschema/schema.v1.json` `field`. */
525
+ export interface CompiledField {
526
+ readonly fieldId: string;
527
+ readonly primitive: Primitive;
528
+ readonly control?: Control;
529
+ /**
530
+ * The declared money domain, `spec/semantics/model-v1.md` `MODEL-2.1.15`. Present together
531
+ * on a `money` field and absent on every other primitive. It is the parse/validate authority
532
+ * the renderer and the wire reader read, so an artifact that dropped it would force every
533
+ * host to configure a money format per field.
534
+ */
535
+ readonly currency?: string;
536
+ readonly scale?: number;
537
+ /**
538
+ * The declared unit domain of a `quantity` field, `MODEL-2.1.21`. Present on a quantity field
539
+ * and absent otherwise. `scale` states the largest number of fractional digits a captured
540
+ * `value` may carry; it defaults to `0`, the integer quantity.
541
+ */
542
+ readonly units?: readonly string[];
543
+ /**
544
+ * The declared unit of a `duration` field, `MODEL-2.1.24`. Present on a duration field and
545
+ * absent otherwise; it defaults to `minutes`, and every captured value must name it.
546
+ */
547
+ readonly unit?: DurationUnit;
548
+ readonly labelKey?: string;
549
+ /** The message key a renderer shows as the field's help text. */
550
+ readonly descriptionKey?: string;
551
+ /** The message key a renderer shows as the field's empty-input placeholder. */
552
+ readonly placeholderKey?: string;
553
+ /** The declared option domain, closed and with unique codes. */
554
+ readonly options?: readonly FieldOption[];
555
+ /** The host or cross-field domain a field without `options` takes instead. */
556
+ readonly optionSource?: OptionSource;
557
+ /** The item declaration of a scalar or attachment array. */
558
+ readonly items?: FieldItem;
559
+ readonly fields?: readonly CompiledField[];
560
+ readonly rowKey?: {
561
+ readonly mode: 'natural' | 'assigned';
562
+ readonly fieldId?: string;
563
+ };
564
+ /**
565
+ * The smallest and largest number of entries this array may hold, `MODEL-2.1.17`.
566
+ *
567
+ * They are declarations rather than rules because a count is a fact about the shape: a
568
+ * `validate` over a length is undecided when the list is absent, and an undecided rule does
569
+ * not block, so the empty form would submit. The runtime folds the count into readiness as a
570
+ * decided fact, with an absent array counting as zero entries.
571
+ */
572
+ readonly minItems?: number;
573
+ readonly maxItems?: number;
574
+ /**
575
+ * The largest number of fractional digits a `decimal` value may carry, `MODEL-2.1.27`.
576
+ *
577
+ * The bound counts the fractional digits the canonical decimal text carries, so `1.25` has
578
+ * scale 2 and `1.5` has scale 1. It is a declaration rather than a rule for the reason
579
+ * `minItems` is: a `validate` over fractional digits is undecided when the value is absent,
580
+ * and an undecided rule does not block, so the empty form would submit. The runtime folds the
581
+ * scale into readiness as a decided fact, and a value above it is a blocker naming the field,
582
+ * the bound and the value.
583
+ */
584
+ readonly maxScale?: number;
585
+ /**
586
+ * The sentence a value above `maxScale` states, `MODEL-2.1.27`. Present with `maxScale`: the
587
+ * fact is not a rule, so the artifact carries the message the blocker names rather than
588
+ * leaving the host to invent one.
589
+ */
590
+ readonly maxScaleMessageKey?: string;
591
+ /**
592
+ * The Expr v1 integer expression whose value is this array's expected row count,
593
+ * `spec/semantics/model-v1.md` `MODEL-2.1.22`. The compiled AST; `rowsFromSource` carries the
594
+ * authored text a blocker names. A difference from the array's length is a decided blocker,
595
+ * and the engine never creates or removes a row.
596
+ */
597
+ readonly rowsFrom?: ExprNode;
598
+ /** The authored `rowsFrom` text the blocker states, when the field declares one. */
599
+ readonly rowsFromSource?: string;
600
+ /**
601
+ * The media types a capture field admits, `MODEL-2.1.20`, in canonical lower-case spelling.
602
+ *
603
+ * Present on a `media_ref` field or on an array whose items are `media_ref`. A renderer
604
+ * restricts its picker with the list, and the runtime folds a captured value that matches no
605
+ * entry into readiness as a blocker. Absent means the declaration constrains no media type.
606
+ */
607
+ readonly accept?: readonly string[];
608
+ /**
609
+ * The smallest and largest `byteSize` a captured `media_ref` may carry, `MODEL-2.1.20`.
610
+ *
611
+ * They are declarations rather than rules for the reason `minItems` is: a size is a fact about
612
+ * a captured value, and a `validate` rule cannot read a media value's intrinsic members under
613
+ * this contract. A captured value outside the range is a decided blocker.
614
+ */
615
+ readonly minBytes?: number;
616
+ readonly maxBytes?: number;
617
+ /**
618
+ * The inclusive bounds a number or temporal control presents, `MODEL-2.1.16`.
619
+ *
620
+ * These are presentation hints copied from the declaration, not the enforcement: a declared
621
+ * bound still compiles to its `r_<fieldId>_minimum`/`r_<fieldId>_maximum` rule, and a renderer
622
+ * paints the range without deciding anything. A `slider` requires both, so its range input has
623
+ * a track; every other number or temporal control reads them only to set a native `min`/`max`.
624
+ * A `decimal` bound is canonical decimal text; an integer bound is a safe integer.
625
+ */
626
+ readonly minimum?: number | string;
627
+ readonly maximum?: number | string;
628
+ /**
629
+ * The increment a number control steps by, `MODEL-2.1.16`. A positive number of the field's
630
+ * own kind: a safe integer on an `integer` field, canonical positive decimal text on a
631
+ * `decimal` field. Absent means the control's own default. Presentation only, like the bounds.
632
+ */
633
+ readonly step?: number | string;
634
+ readonly annotations?: Readonly<Record<string, WireValue>>;
635
+ /** This declaration's own policy, absent when it follows the document's. */
636
+ readonly onHide?: OnHidePolicy;
637
+ /**
638
+ * The `(fieldId)` targets a `signature_capture` field's signature binds, in the order the
639
+ * signature declares them. The compiler refuses a list that names an undeclared field,
640
+ * the declaring field itself or an ancestor container, an array item member, or a
641
+ * different target list or version from the `digest(...)` that verifies the signature, so
642
+ * the artifact's declared coverage and the binding it verifies are one fact.
643
+ */
644
+ readonly covers?: readonly string[];
645
+ }
646
+ export interface GateItemDeclaration {
647
+ readonly itemId: string;
648
+ readonly expr: ExprNode;
649
+ readonly messageKey: string;
650
+ /** The message arguments this item binds; validated against its message. */
651
+ readonly params?: Readonly<Record<string, ExprNode>>;
652
+ }
653
+ /**
654
+ * What a non-hard gate does when a read-only diagnostic reaches it:
655
+ * `defer` reports the diagnostic and lets the gate pass on this device, `warn` reports it
656
+ * without blocking, and `block` fails the gate. A hard gate declares no policy because it
657
+ * has no permissive setting.
658
+ */
659
+ export type GatePolicy = 'defer' | 'warn' | 'block';
660
+ export interface RuleGate {
661
+ readonly items: readonly GateItemDeclaration[];
662
+ readonly hard: boolean;
663
+ /**
664
+ * The condition that turns the gate off, `spec/semantics/rules-v1.md` `[RULES-2.1.14]`.
665
+ * Only a definite `FAIL` deactivates: an `UNKNOWN` or `DEFERRED` condition leaves the gate in
666
+ * force, because a gate nobody could switch off is not one an author switched off.
667
+ */
668
+ readonly activeWhen?: ExprNode;
669
+ /** Absent means `block`: silence must fail closed. */
670
+ readonly onReadOnlyError?: GatePolicy;
671
+ }
672
+ /**
673
+ * One reason a screen declares, `spec/semantics/rules-v1.md` `[RULES-2.1.3]`.
674
+ *
675
+ * The screen states the reason when `when` decides true, in declaration order. Its message is
676
+ * bound by its own `params` block, so one reason's payload never borrows another's. An engine
677
+ * cause is never declared here: the engine's reasons stay derived from the diagnostics it
678
+ * recorded, so only the reasons a screen itself states are stored on the artifact.
679
+ */
680
+ export interface ScreenReasonDeclaration {
681
+ /** The stable problem code the reason states, an upper-case vocabulary code. */
682
+ readonly code: string;
683
+ readonly messageKey: string;
684
+ readonly when: ExprNode;
685
+ readonly params?: Readonly<Record<string, ExprNode>>;
686
+ }
687
+ /**
688
+ * The members every compiled rule carries, `spec/metaschema/schema.v1.json` `rule`. A
689
+ * member is optional here when only some kinds may state it; the per-kind interfaces
690
+ * below make the members a kind cannot work without required, so an illegal rule is a
691
+ * type error where a host or the compiler builds one rather than a throw at evaluation.
692
+ */
693
+ interface CompiledRuleBase {
694
+ readonly ruleId: string;
695
+ readonly scope: RuleScope;
696
+ readonly evaluateOn: Tier;
697
+ readonly expr: ExprNode;
698
+ /**
699
+ * Author-facing documentation of why the rule exists, `schema.v1.json` `rule.note`.
700
+ *
701
+ * Never rendered, never translated and never a message key. It travels into the compiled
702
+ * artifact so a shipped document stays self-describing, and it is presentation to the
703
+ * behaviour identity (`RULES-5.1.2`), so annotating a rule moves neither `behaviorHash` nor
704
+ * `reportHash`.
705
+ */
706
+ readonly note?: string;
707
+ readonly severity?: Severity;
708
+ readonly fieldId?: string;
709
+ readonly messageKey?: string;
710
+ readonly params?: Readonly<Record<string, ExprNode>>;
711
+ readonly referWhen?: ExprNode;
712
+ readonly overrideFieldId?: string;
713
+ readonly gate?: RuleGate;
714
+ readonly testCases?: readonly unknown[];
715
+ /**
716
+ * The fields a `visible` or `enabled` rule decides. Only those two kinds
717
+ * may declare it; the list is duplicate-free and the compiler emits it in code-point
718
+ * order so two documents that differ only in target order share one `ruleHash`.
719
+ */
720
+ readonly fieldIds?: readonly string[];
721
+ /**
722
+ * The member of the row an `item`-scope rule writes or constrains,
723
+ * `spec/semantics/rules-v1.md` `RULES-1.1.11`. `fieldId` names the array; this names the
724
+ * member inside one of its rows, so a per-row writer has a target the engine can address.
725
+ * Optional on `validate`, where absent means the rule speaks about the whole row.
726
+ */
727
+ readonly targetFieldId?: string;
728
+ /**
729
+ * The alternatives this rule offers when it decides `FAIL`, `RULES-6.1.1`.
730
+ *
731
+ * Admitted on `kind: validate` only. They are evaluated only on `FAIL` and produce concrete
732
+ * wire values, so the report carries data a host applies rather than source text; the engine
733
+ * never applies one itself.
734
+ */
735
+ readonly suggests?: readonly CompiledSuggestion[];
736
+ }
737
+ /**
738
+ * The fields a rule decides: the target list a `visible` or `enabled` rule
739
+ * names, or the one field every other scoped rule is about. A rule naming several fields
740
+ * declares `fieldIds` and is record-scoped, so the single-target spelling and the list never
741
+ * describe one rule twice.
742
+ */
743
+ export declare function ruleTargets(rule: CompiledRule): readonly string[];
744
+ /** A validation rule must state the message key it raises. */
745
+ export interface ValidateRule extends CompiledRuleBase {
746
+ readonly kind: 'validate';
747
+ readonly messageKey: string;
748
+ }
749
+ export interface VisibleRule extends CompiledRuleBase {
750
+ readonly kind: 'visible';
751
+ }
752
+ export interface RequiredRule extends CompiledRuleBase {
753
+ readonly kind: 'required';
754
+ }
755
+ export interface EnabledRule extends CompiledRuleBase {
756
+ readonly kind: 'enabled';
757
+ }
758
+ export interface ComputeRule extends CompiledRuleBase {
759
+ readonly kind: 'compute';
760
+ }
761
+ export interface DefaultComputeRule extends CompiledRuleBase {
762
+ readonly kind: 'defaultCompute';
763
+ }
764
+ /** A gate rule must declare the items it always reports. */
765
+ export interface GateRule extends CompiledRuleBase {
766
+ readonly kind: 'gate';
767
+ readonly gate: RuleGate;
768
+ }
769
+ export interface ScreenRule extends CompiledRuleBase {
770
+ readonly kind: 'screen';
771
+ readonly referWhen?: ExprNode;
772
+ /** The reasons this screen itself states, in the order the report lists them. */
773
+ readonly reasons?: readonly ScreenReasonDeclaration[];
774
+ }
775
+ /** A compiled rule, discriminated by its kind. */
776
+ export type CompiledRule = ValidateRule | VisibleRule | RequiredRule | EnabledRule | ComputeRule | DefaultComputeRule | GateRule | ScreenRule;
777
+ /** A compiled ICU MF1 subset node, `spec/metaschema/schema.v1.json` `messageNode`. */
778
+ export interface MessageContentNode {
779
+ readonly kind: 'content';
780
+ readonly value: string;
781
+ }
782
+ export interface MessageArgumentNode {
783
+ readonly kind: 'argument';
784
+ readonly name: string;
785
+ }
786
+ export interface MessageSelectNode {
787
+ readonly kind: 'select';
788
+ readonly name: string;
789
+ readonly cases: Readonly<Record<string, readonly MessageNode[]>>;
790
+ }
791
+ export interface MessagePluralNode {
792
+ readonly kind: 'plural';
793
+ readonly name: string;
794
+ readonly offset: number;
795
+ readonly cases: Readonly<Record<string, readonly MessageNode[]>>;
796
+ }
797
+ export interface MessagePoundNode {
798
+ readonly kind: 'pound';
799
+ }
800
+ export type MessageNode = MessageContentNode | MessageArgumentNode | MessageSelectNode | MessagePluralNode | MessagePoundNode;
801
+ /** The compiled message form: data-only nodes beside the source text. */
802
+ export interface CompiledMessage {
803
+ readonly source: string;
804
+ readonly nodes: readonly MessageNode[];
805
+ /**
806
+ * The locale this entry was compiled for, which is the catalogue key it is filed under.
807
+ *
808
+ * A renderer needs it to select the plural branches of this text, and the key it reads the
809
+ * entry from is not always passed on; carrying it removes the chance of rendering `pt` text
810
+ * through `pt-PT` rules. Absent only on an AST a host assembled itself.
811
+ */
812
+ readonly locale?: string;
813
+ }
814
+ /**
815
+ * One locale's entry in a message catalogue: the compiled AST a runtime interprets, or
816
+ * the authored source text before an AST exists. A runtime never parses the latter, so
817
+ * the two states cannot be confused at the seam.
818
+ */
819
+ export type CompiledMessageEntry = string | CompiledMessage;
820
+ /**
821
+ * A field a rule, a report or an access projection refers to. `rowKey` is the natural
822
+ * key's canonical wire value (a string or an integer) or the host-assigned id
823
+ * so an integer natural key keeps its canonical form.
824
+ */
825
+ export interface FieldRef {
826
+ readonly fieldId: string;
827
+ readonly rowKey?: string | number;
828
+ }
829
+ /** How a decimal is rounded when it must lose digits. */
830
+ export type RoundingMode = 'up' | 'down' | 'ceiling' | 'floor' | 'half_up' | 'half_even';
831
+ /**
832
+ * One field's effective access in a report.
833
+ *
834
+ * The report states the answer per declaration, never per row: a container read carries every
835
+ * row it holds, so an entry that withholds one row already answers the container as hidden and
836
+ * a row key would only restate part of that answer.
837
+ */
838
+ export interface ReportAccessEntry {
839
+ readonly fieldId: string;
840
+ readonly access: FieldAccess;
841
+ }
842
+ /**
843
+ * The declarations an expression is checked against. `fields` is the record the expression
844
+ * may read; a standalone guard compiled without a form omits it, and a record read is then
845
+ * a compile error.
846
+ */
847
+ export interface ExpressionDeclarations {
848
+ readonly fields?: readonly CompiledField[];
849
+ readonly context?: {
850
+ readonly roots: readonly ContextRoot[];
851
+ };
852
+ /** The tables the expression may name; a name absent here is refused. */
853
+ readonly datasets?: readonly DatasetDeclaration[];
854
+ /**
855
+ * The schema version the expression was compiled against, where it was compiled against
856
+ * one: `context.schema_version` reads it, and a standalone guard that names
857
+ * no version reads the root as undetermined rather than inventing one.
858
+ */
859
+ readonly schemaVersion?: number;
860
+ }
861
+ /**
862
+ * A standalone compiled expression: the closed AST plus the language
863
+ * version and the declarations it was typed against. The declarations travel with the
864
+ * artifact so a guard evaluates exactly the schema it was compiled for, with the same
865
+ * stored-value validation and operand typing a rule expression receives.
866
+ */
867
+ export interface CompiledExpression {
868
+ readonly exprVersion: 1;
869
+ readonly expr: ExprNode;
870
+ readonly declarations: ExpressionDeclarations;
871
+ }
872
+ /**
873
+ * The codes a report may carry, `spec/semantics/expr-v1.md`.
874
+ *
875
+ * The tuple is the single source: the union and the guard are derived from it, so the
876
+ * compiler's reused code list and the runtime guard cannot disagree about the vocabulary.
877
+ */
878
+ export declare const RUNTIME_DIAGNOSTIC_CODES: readonly ['UNDETERMINED', 'ENGINE_ERROR', 'STALE_DATA', 'ACCESS_DENIED', 'DEFERRED_SERVER_CHECK', 'REQUIRED_UNKNOWN', 'SIGNATURE_COVER_EXCLUDED', 'ROW_IDENTITY', 'LATE_BOUND_TYPE_MISMATCH'];
879
+ export type RuntimeDiagnosticCode = (typeof RUNTIME_DIAGNOSTIC_CODES)[number];
880
+ /** A compile problem code. */
881
+ export declare const COMPILE_DIAGNOSTIC_CODES: readonly ['EXPR_PARSE_ERROR', 'TYPE_MISMATCH', 'UNKNOWN_IDENTIFIER', 'MONEY_ARITHMETIC', 'PATTERN_UNSUPPORTED', 'COST_BUDGET_EXCEEDED', 'CYCLE_DETECTED', 'DUPLICATE_WRITER', 'TABLE_NOT_DECLARED', 'RULE_REFERENCE', 'DEPRECATED_BUILTIN', 'UNDECIDED_AGGREGATE', 'REQUIRED_ON_ARRAY', 'INVALID_CONSTANT_EXPRESSION', 'CONSTANT_COMPARISON', 'UNSATISFIABLE_CONDITION', 'REDUNDANT_CONDITION', 'REQUIRED_NEVER_VISIBLE'];
882
+ export type CompileDiagnosticCode = (typeof COMPILE_DIAGNOSTIC_CODES)[number];
883
+ /** Every diagnostic code the language defines. */
884
+ export type DiagnosticCode = RuntimeDiagnosticCode | CompileDiagnosticCode;
885
+ export declare function isRuntimeDiagnosticCode(value: DiagnosticCode): value is RuntimeDiagnosticCode;
886
+ /** A table's clock binding. */
887
+ export type TableBinding = 'behavior' | 'data';
888
+ /** A table kind. */
889
+ export type TableKind = 'set' | 'lookup' | 'decision_table';
890
+ /** The hit policy a keyed table resolves with. */
891
+ export type HitPolicy = 'UNIQUE' | 'FIRST' | 'COLLECT';
892
+ /**
893
+ * The primitives a dataset column may declare. Record and array columns
894
+ * are invalid, so a column's domain is this narrower set rather than `Primitive`.
895
+ */
896
+ export type ScalarPrimitive = 'string' | 'boolean' | 'integer' | 'decimal' | 'money' | 'quantity' | 'date' | 'instant';
897
+ /** Whether untrusted text names a dataset scalar primitive. */
898
+ export declare function isScalarPrimitive(value: unknown): value is ScalarPrimitive;
899
+ /** The dataset scalar primitives in the order a refusal lists them: the metaschema's own. */
900
+ export declare const DATASET_SCALAR_PRIMITIVES: readonly ScalarPrimitive[];
901
+ /** The same registry as a membership test, for a guard that asks once per value. */
902
+ export declare const DATASET_SCALAR_PRIMITIVE_SET: ReadonlySet<ScalarPrimitive>;
903
+ /** A declared column and its role. */
904
+ export interface DatasetColumn {
905
+ readonly columnId: string;
906
+ /** A key or output member is named by `columnId`, so it follows the identifier grammar. */
907
+ readonly primitive: ScalarPrimitive;
908
+ readonly role: 'key' | 'output';
909
+ /**
910
+ * The declared unit domain of a `quantity` column, `MODEL-2.1.21`. Present on a quantity
911
+ * column and absent otherwise; a value whose `unit` is not a member is refused rather than
912
+ * converted. A quantity column without it admits every unit code.
913
+ */
914
+ readonly units?: readonly string[];
915
+ /**
916
+ * The declared fractional scale of a `quantity` column, `MODEL-2.1.21`. Present on a
917
+ * quantity column and absent otherwise; it defaults to `0`, the integer quantity, because a
918
+ * money value carries its own scale and a quantity's is the declaration's.
919
+ */
920
+ readonly scale?: number;
921
+ }
922
+ /**
923
+ * The declared shape of one table, without its rows.
924
+ *
925
+ * A compiled expression carries these for every table it names, so `in_set`, `lookup` and
926
+ * `decide` are checked against the table's kind, key arity and output members at compile
927
+ * time. Rows are deliberately absent: an expression
928
+ * artifact has no business carrying a 30k-row catalogue.
929
+ */
930
+ export interface DatasetDeclaration {
931
+ readonly tableId: string;
932
+ readonly kind: TableKind;
933
+ readonly binding: TableBinding;
934
+ readonly hitPolicy?: HitPolicy;
935
+ readonly columns?: readonly DatasetColumn[];
936
+ }
937
+ /**
938
+ * One table row. A lookup row carries no outcome; a
939
+ * decision-table row declares one. `output` is required on a `PASS` row and may be absent
940
+ * on a row that produces no result.
941
+ */
942
+ export interface LookupRow {
943
+ readonly rowId: string;
944
+ readonly key: readonly WireValue[];
945
+ readonly outcome?: Outcome;
946
+ readonly output?: Readonly<Record<string, WireValue>>;
947
+ }
948
+ /** A dataset document as the store consumes it, `spec/metaschema/dataset.v1.json`. */
949
+ export interface LookupTableDocument {
950
+ readonly tableId: string;
951
+ readonly tableVersion: number;
952
+ readonly binding: TableBinding;
953
+ readonly kind: TableKind;
954
+ readonly values?: readonly WireValue[];
955
+ readonly columns?: readonly DatasetColumn[];
956
+ readonly rows?: readonly LookupRow[];
957
+ readonly hitPolicy?: HitPolicy;
958
+ /** The hard cap on rows a `COLLECT` hit may return. */
959
+ readonly collectLimit?: number;
960
+ readonly effectiveFrom?: string;
961
+ /** Exclusive upper bound of a data-bound table's effective range. */
962
+ readonly effectiveTo?: string;
963
+ }
964
+ /** Why a table could not answer. */
965
+ export type LookupMissReason = 'missing_table' | 'missing_as_of' | 'out_of_range'
966
+ /** The store serves a version other than the one the artifact pins. */
967
+ | 'version_mismatch';
968
+ /**
969
+ * The identity of the table version a call resolved against.
970
+ *
971
+ * Every resolution that reached a table carries it, so a hit and a miss are equally
972
+ * reproduceable seven years later. `asOfDate` is present exactly when the table was
973
+ * resolved by date. A table the store could not resolve has no identity
974
+ * and answers `STALE` with the reason instead.
975
+ */
976
+ export interface ResolvedTable {
977
+ readonly tableId: string;
978
+ readonly tableVersion: number;
979
+ /** The restricted-JCS SHA-256 of the document that was resolved. */
980
+ readonly tableSha256: string;
981
+ readonly asOfDate?: string;
982
+ }
983
+ /**
984
+ * The result of a set-membership test.
985
+ *
986
+ * `key` is the queried value as the canonical one-entry key vector, so a set test produces
987
+ * the same provenance shape a keyed lookup does.
988
+ */
989
+ export type SetResolution = {
990
+ readonly outcome: 'MEMBER' | 'ABSENT';
991
+ readonly table: ResolvedTable;
992
+ readonly key: readonly ScalarWireValue[];
993
+ } | {
994
+ readonly outcome: 'STALE';
995
+ readonly reason: LookupMissReason;
996
+ readonly tableId: string;
997
+ };
998
+ /**
999
+ * The result of resolving one key or one input record against one table.
1000
+ *
1001
+ * `HIT` carries the hit policy because the policy decides the result's shape: one row for
1002
+ * `UNIQUE` and `FIRST`, an ordered list for `COLLECT`. `MISS` carries it
1003
+ * for the same reason — an empty collection is an empty list, while a missed single hit is
1004
+ * a reading this device does not hold. `UNDETERMINED` is a query rows matched whose verdict
1005
+ * could not be decided; it carries the policy and the matched rows for the same reason `HIT`
1006
+ * does, so the report states the match it observed instead of claiming the query matched
1007
+ * nothing, and `UNKNOWN` beats `DEFERRED`.
1008
+ *
1009
+ * `hit`, `matchedRowId` and single-versus-collection are not stored: the report derives
1010
+ * them from `rows` through `toProvenance`, so one fact never has two spellings.
1011
+ */
1012
+ export type LookupResolution = {
1013
+ readonly outcome: 'HIT';
1014
+ readonly table: ResolvedTable;
1015
+ readonly key: readonly ScalarWireValue[];
1016
+ readonly hitPolicy: HitPolicy;
1017
+ readonly rows: readonly LookupRow[];
1018
+ } | {
1019
+ readonly outcome: 'MISS';
1020
+ readonly table: ResolvedTable;
1021
+ readonly key: readonly ScalarWireValue[];
1022
+ readonly hitPolicy: HitPolicy;
1023
+ } | {
1024
+ readonly outcome: 'UNDETERMINED';
1025
+ /**
1026
+ * The table that was resolved, absent when no complete query was formed. The table, key,
1027
+ * policy and matched rows are stated together: without all four there is no question to
1028
+ * reproduce, and the report records no entry.
1029
+ */
1030
+ readonly table?: ResolvedTable;
1031
+ /** The key the query was made with, absent when no complete query was formed. */
1032
+ readonly key?: readonly ScalarWireValue[];
1033
+ /** The policy whose shape the matched rows take, present with `table` and `key`. */
1034
+ readonly hitPolicy?: HitPolicy;
1035
+ /** The rows whose key matched, in source order, present with `table` and `key`. */
1036
+ readonly rows?: readonly LookupRow[];
1037
+ readonly value: 'UNKNOWN' | 'DEFERRED';
1038
+ } | {
1039
+ readonly outcome: 'STALE';
1040
+ readonly reason: LookupMissReason;
1041
+ readonly tableId: string;
1042
+ };
1043
+ /** The resolution interface a host or a larger store backs. */
1044
+ export interface LookupPort {
1045
+ /**
1046
+ * `in_set(table, v, asOf?)`. `recordDate` is the host's own record date
1047
+ * it resolves a data-bound set when the call names no `asOf` of its own,
1048
+ * and a behavior-bound set ignores it.
1049
+ */
1050
+ contains(tableId: string, value: ScalarWireValue, recordDate?: string): SetResolution;
1051
+ /** `lookup(table, keys, asOf?)`. */
1052
+ resolve(tableId: string, keys: readonly ScalarWireValue[], asOf?: string): LookupResolution;
1053
+ /** `decide(table, inputs, asOf?)`: key columns are matched by name. */
1054
+ decide(tableId: string, inputs: WireRecord, asOf?: string): LookupResolution;
1055
+ /** `decide_keys(table, keys, asOf?)`: key values in column order. */
1056
+ decideKeys(tableId: string, keys: readonly ScalarWireValue[], asOf?: string): LookupResolution;
1057
+ /**
1058
+ * The declared columns of one table this port holds, or `undefined` when it cannot answer.
1059
+ *
1060
+ * The evaluator reads an output member's primitive here, so a value a decision table returns
1061
+ * is the decimal its column declares rather than text that happens to be numeric. A port that
1062
+ * cannot answer leaves the member's domain undeclared, and an aggregate over it is undecided
1063
+ * rather than compared as text — the safe answer, never a wrong one.
1064
+ */
1065
+ columns?(tableId: string): readonly DatasetColumn[] | undefined;
1066
+ }
1067
+ /**
1068
+ * One entry in a report's `lookups`, `spec/semantics/datasets-v1.md`.
1069
+ *
1070
+ * A resolved entry states what was resolved against and whether it matched; a `STALE` entry
1071
+ * states the table that could not answer and why, because a table with no resolved document
1072
+ * has no version or digest to record.
1073
+ */
1074
+ export type LookupProvenance = ResolvedLookupProvenance | StaleLookupProvenance;
1075
+ /** One lookup or set test that reached a table and did or did not match. */
1076
+ export interface ResolvedLookupProvenance extends ResolvedTable {
1077
+ /**
1078
+ * The canonical query key, one value per key-role column in declaration order, and the
1079
+ * tested value as a one-entry vector for a set.
1080
+ */
1081
+ readonly key: readonly ScalarWireValue[];
1082
+ /**
1083
+ * Whether the query matched a row; a set test matches its value. A row whose key matched
1084
+ * matched even when its verdict was undecided, so `hit` is `true` exactly when
1085
+ * `matchedRowId` is not `null`.
1086
+ */
1087
+ readonly hit: boolean;
1088
+ /**
1089
+ * The single matched row id, the ordered row ids of a `COLLECT` hit, or `null` when the
1090
+ * query matched no row. A resolution whose verdict is undetermined states the rows that
1091
+ * matched rather than reporting the query as one that matched nothing.
1092
+ */
1093
+ readonly matchedRowId: string | readonly string[] | null;
1094
+ }
1095
+ /** One lookup that could not resolve a table at all. */
1096
+ export interface StaleLookupProvenance {
1097
+ readonly tableId: string;
1098
+ readonly reason: LookupMissReason;
1099
+ }
1100
+ /** A diagnostic in a report: a code, a severity, a key and raw params. */
1101
+ export interface Diagnostic {
1102
+ readonly code: DiagnosticCode;
1103
+ readonly severity: Severity;
1104
+ readonly messageKey: string;
1105
+ readonly params?: Readonly<Record<string, WireValue>>;
1106
+ readonly fieldId?: string;
1107
+ /** The row a row-scoped diagnostic belongs to: a string or a safe integer. */
1108
+ readonly rowKey?: string | number;
1109
+ readonly ruleId?: string;
1110
+ readonly itemId?: string;
1111
+ }
1112
+ /** One rule's result, `spec/metaschema/report.v1.json` `ruleResult`. */
1113
+ export interface RuleResult {
1114
+ readonly ruleId: string;
1115
+ readonly ruleHash: string;
1116
+ readonly kind: RuleKind;
1117
+ readonly scope: RuleScope;
1118
+ readonly severity: Severity;
1119
+ readonly evaluateOn: Tier;
1120
+ readonly status: Outcome;
1121
+ readonly messageKey?: string;
1122
+ readonly params?: Readonly<Record<string, WireValue>>;
1123
+ readonly fields?: readonly FieldRef[];
1124
+ /**
1125
+ * The row an item-scoped rule produced this result for, keyed by the
1126
+ * natural key's canonical wire value so `"1"` and `1` never name one row.
1127
+ */
1128
+ readonly rowKey?: string | number;
1129
+ readonly value?: WireValue | null;
1130
+ /**
1131
+ * The alternatives a failing `validate` rule offers, `RULES-6.1.3`.
1132
+ *
1133
+ * Present only when the rule decided `FAIL` and at least one alternative survived the access
1134
+ * filter: an alternative naming a withheld target or reading a withheld value is absent rather
1135
+ * than stubbed, because a stub is still an answer about a value the reader may not see.
1136
+ */
1137
+ readonly suggestions?: readonly EvaluatedSuggestion[];
1138
+ }
1139
+ /**
1140
+ * One evaluated alternative, `report.v1.json` `ruleSuggestion`.
1141
+ *
1142
+ * This is the evaluated stage of `CompiledSuggestion`. A rule's alternatives travel on its
1143
+ * result and an option's on the blocker that states the unavailable code, so one type covers
1144
+ * both owners; the values are already evaluated against the record, so a host applies data
1145
+ * rather than compiling the source text it was handed.
1146
+ */
1147
+ export interface EvaluatedSuggestion {
1148
+ readonly labelKey: string;
1149
+ readonly operations: readonly SuggestedOperation[];
1150
+ /**
1151
+ * Why a host must not apply this alternative though a reader may still see it.
1152
+ *
1153
+ * `read_only` is the one reason in this cut: the target is visibly read-only, and the write
1154
+ * guard stays authoritative at apply.
1155
+ */
1156
+ readonly disabledReason?: 'read_only';
1157
+ }
1158
+ /** One write an alternative performs, with the value it writes, `report.v1.json` `ruleSuggestedOperation`. */
1159
+ export type SuggestedOperation = {
1160
+ readonly kind: 'value';
1161
+ readonly ref: FieldRef;
1162
+ readonly value: WireValue;
1163
+ } | {
1164
+ readonly kind: 'null';
1165
+ readonly ref: FieldRef;
1166
+ } | {
1167
+ readonly kind: 'remove';
1168
+ readonly ref: FieldRef;
1169
+ } | {
1170
+ readonly kind: 'append';
1171
+ readonly fieldId: string;
1172
+ readonly row: Readonly<Record<string, WireValue>>;
1173
+ } | {
1174
+ readonly kind: 'removeRow';
1175
+ readonly fieldId: string;
1176
+ readonly rowKey: string | number;
1177
+ };
1178
+ /**
1179
+ * One gate item's result, `spec/semantics/rules-v1.md`. `ruleId` names the rule the item folds
1180
+ * when its expression is exactly `rule_ok(<ruleId>)`. An item that composes its own condition
1181
+ * folds no single rule and states none.
1182
+ */
1183
+ export interface GateItemResult {
1184
+ readonly itemId: string;
1185
+ readonly ruleId?: string;
1186
+ readonly status: Outcome;
1187
+ readonly messageKey: string;
1188
+ readonly params?: Readonly<Record<string, WireValue>>;
1189
+ readonly fields?: readonly FieldRef[];
1190
+ }
1191
+ /**
1192
+ * One gate's result. The gate's identity is its key in `EvaluationReport.gates` — the gate
1193
+ * rule's `ruleId` — so the body never repeats it and a report cannot carry two identities that
1194
+ * disagree.
1195
+ *
1196
+ * A gate whose `activeWhen` decided false is not in force, so it states `active: false` and no
1197
+ * item verdicts: nothing the gate would have judged was read, and every item it would have reported
1198
+ * was never decided. An active gate states its items and no `active` member, so the two states
1199
+ * cannot both be read.
1200
+ */
1201
+ export type GateReport = {
1202
+ readonly active: false;
1203
+ /** The overrides this gate was satisfied by, in the order the host supplied them. */
1204
+ readonly overrides?: readonly GateOverride[];
1205
+ } | {
1206
+ readonly items: readonly GateItemResult[];
1207
+ /** The overrides this gate was satisfied by, in the order the host supplied them. */
1208
+ readonly overrides?: readonly GateOverride[];
1209
+ };
1210
+ /** Every gate the artifact declares, keyed by the gate rule's `ruleId`, in code-point order. */
1211
+ export type GatesReport = Readonly<Record<string, GateReport>>;
1212
+ /**
1213
+ * A host's record of an approved gate override, `spec/semantics/rules-v1.md`
1214
+ * and `spec/metaschema/report.v1.json` `gateOverride`.
1215
+ *
1216
+ * Axiom never approves an override: the host does, and passes the record in. There is no
1217
+ * approval-state member, because that state is the host's own record and a constant here could
1218
+ * only be read as the engine's verdict. The three hashes are what makes an approval belong to
1219
+ * one gate decision, so `evaluateGate` refuses a record whose `inputHash`, `ruleHash` or
1220
+ * `behaviorHash` no longer matches the evaluation it would satisfy, and refuses any override of
1221
+ * a hard gate.
1222
+ */
1223
+ export interface GateOverride {
1224
+ /** The `ruleId` of the gate rule the override was approved for. */
1225
+ readonly gateId: string;
1226
+ readonly actor: string;
1227
+ readonly reasonCode: string;
1228
+ /**
1229
+ * SHA-256 of the record the gate judged: the value tree, the submission projection, the
1230
+ * context, the withheld targets, the record date and every resolved table commitment
1231
+ * A change to any of them invalidates the approval.
1232
+ */
1233
+ readonly inputHash: string;
1234
+ readonly ruleHash: string;
1235
+ readonly behaviorHash: string;
1236
+ }
1237
+ /** The five screen outcomes. */
1238
+ export type ScreenOutcome = 'SCREEN_PASS' | 'SCREEN_FAIL' | 'SCREEN_REFER' | 'UNKNOWN' | 'DEFERRED';
1239
+ /**
1240
+ * A structured screen reason: a cause the record needs attention for.
1241
+ *
1242
+ * `code` is an upper-case problem code. An engine reason carries the runtime diagnostic code
1243
+ * the evaluation recorded, so it corresponds to an entry in the report's `diagnostics` — by `code`
1244
+ * alone for a cause the engine does not attribute to a rule (`STALE_DATA`, `ACCESS_DENIED`), and by
1245
+ * `code` and `ruleId` where it does. An author reason carries the code the artifact declares for
1246
+ * it. The message is rendered from `messageKey` and `params`, never spelled here, so one reason
1247
+ * reads the same in every locale.
1248
+ */
1249
+ export interface ScreenReason {
1250
+ readonly code: string;
1251
+ readonly messageKey: string;
1252
+ readonly params?: Readonly<Record<string, WireValue>>;
1253
+ }
1254
+ /**
1255
+ * One screen's result. The screen's identity is its key in `EvaluationReport.screens` — the
1256
+ * screen rule's `ruleId` — and `outcome` keeps the five states a screen decides so a report
1257
+ * distinguishes `SCREEN_REFER` from `SCREEN_FAIL` even though both fold to `FAIL` in
1258
+ * `rules[].status`.
1259
+ */
1260
+ export interface ScreenReport {
1261
+ readonly outcome: ScreenOutcome;
1262
+ readonly reasons: readonly ScreenReason[];
1263
+ }
1264
+ /** Every screen the artifact declares, keyed by the screen rule's `ruleId`, in code-point order. */
1265
+ export type ScreensReport = Readonly<Record<string, ScreenReport>>;
1266
+ /** The canonical evaluation report, `spec/metaschema/report.v1.json`. */
1267
+ export interface EvaluationReport {
1268
+ readonly schemaId: string;
1269
+ readonly schemaVersion: number;
1270
+ readonly exprVersion: 1;
1271
+ readonly behaviorHash: string;
1272
+ readonly reportHash: string;
1273
+ /**
1274
+ * The rules fold: every block-severity rule result and diagnostic, and nothing else.
1275
+ *
1276
+ * It is deliberately not readiness. A declared `minItems`, a media constraint, a `rowsFrom`
1277
+ * count, a missing `required` value or a hidden section's blocker is not a rule result, so it
1278
+ * does not move this status; changing that would change the meaning of every sealed v1 report
1279
+ * (`EXPR-1.1.4`). Admission is `evaluateReadiness()`, or `submissionVerdict()`'s `outcome`, or
1280
+ * `evaluateSubmission().readiness`; a host decides whether to submit by one of those, never by
1281
+ * this value.
1282
+ */
1283
+ readonly status: Outcome;
1284
+ readonly accessVersion: number;
1285
+ readonly access: readonly ReportAccessEntry[];
1286
+ readonly rules: readonly RuleResult[];
1287
+ /**
1288
+ * Every declared gate, keyed by its rule's `ruleId`. Absent when the schema declares none,
1289
+ * never an empty object.
1290
+ */
1291
+ readonly gates?: GatesReport;
1292
+ /**
1293
+ * Every declared screen, keyed by its rule's `ruleId`. Absent when the schema declares none,
1294
+ * never an empty object.
1295
+ */
1296
+ readonly screens?: ScreensReport;
1297
+ /**
1298
+ * The gate a caller acts on when it names none: the designation this artifact carries, and
1299
+ * one of the gate rule ids it declares. Absent when the artifact declares no gate.
1300
+ */
1301
+ readonly primaryGateId?: string;
1302
+ /**
1303
+ * The screen a caller acts on when it names none: the designation this artifact carries, and
1304
+ * one of the screen rule ids it declares. Absent when the artifact declares no screen.
1305
+ */
1306
+ readonly primaryScreenId?: string;
1307
+ readonly diagnostics: readonly Diagnostic[];
1308
+ readonly lookups: readonly LookupProvenance[];
1309
+ /**
1310
+ * The base edition and every overlay edition the artifact was composed from, in order
1311
+ * (`[EVOL-4.1.4]`). Absent on a report produced from a single document, so an existing
1312
+ * report keeps its bytes and its `reportHash`.
1313
+ *
1314
+ * Copied from the artifact by the report assembly, and therefore covered by `reportHash`:
1315
+ * a dispute that names an artifact can read the exact configuration that produced it.
1316
+ */
1317
+ readonly composition?: CompositionReport;
1318
+ }
1319
+ /**
1320
+ * A report without its digest: every fact a derived form state carries.
1321
+ *
1322
+ * Sealing a report canonicalises it and hashes the result, which is the cost of *proving* a
1323
+ * decision, not of describing one. A per-keystroke derivation therefore carries the body and
1324
+ * leaves the digest to the entry point that returns a decision — `evaluate()`, an explicit
1325
+ * `sealReport(body)`, or `engine.report()`, which seals once per committed report body.
1326
+ */
1327
+ export type ReportFacts = Omit<EvaluationReport, 'reportHash'>;
1328
+ export {};
1329
+ //# sourceMappingURL=types.d.ts.map