@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 @@
1
+ {"version":3,"file":"option-availability.js","sourceRoot":"","sources":["../../src/eval/option-availability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAo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D,OAAO,GAAG,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { AxiomError } from '../model/errors.js';\nimport { isRecord } from '../model/guards.js';\nimport type {\n CompiledField,\n ExprNode,\n FieldOption,\n FieldRef,\n Outcome,\n Undetermined,\n UndeterminedRows,\n WireValue,\n} from '../model/types.js';\nimport { isUndetermined, UNKNOWN } from '../model/types.js';\nimport { isWireArray, sameWireValue, wireMembers } from '../model/values.js';\nimport { toWireValue, wireDeclarationOf } from '../model/wire.js';\nimport { fieldKey } from './access/projection.js';\nimport { addressingOfItems } from './addressing.js';\nimport type { Evaluated, EvaluatedValue } from './expr/value.js';\nimport { valueOf } from './expr/value.js';\nimport { optionCodeValue } from './options.js';\nimport { withoutUnreadableMembers } from './reader/member-access.js';\nimport { deliveryWithheld, paramsOf, withScopedDelivery } from './rule/result.js';\nimport type { EvaluationState } from './rule/state.js';\nimport { noteAvailabilityCondition } from './state/measurement.js';\nimport { evaluateSuggestions } from './suggestions.js';\nimport type { OptionAvailabilityAnswer, OptionAvailabilityBinding } from './state/snapshot.js';\n\n/**\n * Every declared option's availability, evaluated on the access-safe reader the rules use, after\n * the writers have produced their values, `RULES-7.1.2`.\n *\n * A session states the declarations its change set could move and carries the others over, so the\n * function takes the set of field ids this pass may have moved. An absent set evaluates every\n * declaration: an open, a hydrate and an access or environment change state no narrower scope.\n *\n * The answer is keyed by the binding's runtime key, `fieldKey`, so a member of an array states\n * one answer per row of the array that holds it. A condition is an Expr v1 boolean in the scope\n * of the field that declares the option, so a row member's condition reads its own row through\n * `$it` exactly as an item-scoped rule does.\n *\n * Three states, never two: a condition that decides neither way leaves the option undetermined,\n * which is not available and is never silently blocked as an invalid code (`RULES-7.1.1`). A\n * condition that raises, answers a non-boolean, or reads a value the report may not state is\n * undetermined for the same reason the presentation channel answers `UNKNOWN` there: an answer\n * derived from a withheld value would disclose it.\n *\n * The alternatives an unavailable option offers are evaluated only for the code the record holds\n * (`RULES-7.1.4`), so the snapshot carries no alternative a host could offer by mistake.\n */\nexport function evaluateOptionAvailability(\n state: EvaluationState,\n scope?: ReadonlySet<string>,\n): ReadonlyMap<string, OptionAvailabilityBinding> {\n const bindings = new Map<string, OptionAvailabilityBinding>();\n const rows = new RowScopes(state);\n visit(state, state.compiled.fields, undefined, bindings, rows, scope);\n return bindings;\n}\n\n/** The array whose rows hold a declaration, and the path from a row root to it. */\ninterface RowContext {\n readonly array: CompiledField;\n /** The declaration path inside one row element; empty for a direct member of the array. */\n readonly path: readonly string[];\n}\n\n/** One declaration list, with the row context its members live in. */\nfunction visit(\n state: EvaluationState,\n members: readonly CompiledField[],\n row: RowContext | undefined,\n answers: Map<string, OptionAvailabilityBinding>,\n rows: RowScopes,\n scope: ReadonlySet<string> | undefined,\n): void {\n for (const field of members) {\n const here =\n row === undefined ? undefined : { array: row.array, path: [...row.path, field.fieldId] };\n // A pass states the declarations its change set could move and carries the rest over, so a\n // write to an unrelated field does not re-evaluate every conditioned option on the record.\n // A declaration outside the scope still has its children visited: a container's own\n // availability and its members' are separate questions.\n const inScope = scope === undefined || scope.has(field.fieldId);\n if (inScope && field.options !== undefined && declaresAvailability(field.options)) {\n if (here === undefined) {\n const ref: FieldRef = { fieldId: field.fieldId };\n const binding = evaluateBinding(state, field, ref, undefined);\n if (binding !== undefined) answers.set(fieldKey(ref), binding);\n } else {\n const scopes = rows.of(here.array);\n if (scopes.length === 0) {\n const cause = rows.rowlessCause(here.array);\n if (cause !== undefined) {\n const ref: FieldRef = { fieldId: field.fieldId };\n const binding = rowlessBinding(state, field, ref, cause);\n if (binding !== undefined) answers.set(fieldKey(ref), binding);\n }\n }\n for (const rowScope of scopes) {\n const ref: FieldRef = { fieldId: field.fieldId, rowKey: rowScope.rowKey };\n const binding = evaluateBinding(state, field, ref, { scope: rowScope, path: here.path });\n if (binding !== undefined) answers.set(fieldKey(ref), binding);\n }\n }\n }\n if (field.fields === undefined || field.fields.length === 0) continue;\n visit(\n state,\n field.fields,\n // An array's children are its own rows; a record's children stay in the row that holds it.\n field.primitive === 'array' ? { array: field, path: [] } : here,\n answers,\n rows,\n scope,\n );\n }\n}\n\n/** Whether any declared option states a condition, so the binding has an answer to state. */\nfunction declaresAvailability(options: readonly FieldOption[]): boolean {\n return options.some((option) => option.availableWhen !== undefined);\n}\n\n/**\n * Every conditioned option as undetermined with one cause.\n *\n * The answer is used where the record does not let this device decide a condition at all: the\n * list read was `DEFERRED` or `UNKNOWN`, or no row could be keyed. Every conditioned option is\n * listed because none can be read as available, and each is in `held` because the row that\n * would say which code the record holds is the row the device could not read. Readiness turns\n * each entry into an open question rather than a decided failure, so the verdict is\n * `UNDETERMINED` and no blocker claims a code the device never saw.\n */\nfunction conditionedBinding(\n field: CompiledField,\n cause: 'deferred' | 'unknown',\n): OptionAvailabilityBinding | undefined {\n const answers: OptionAvailabilityAnswer[] = (field.options ?? []).flatMap((option) =>\n option.availableWhen === undefined\n ? []\n : [{ code: option.code, kind: 'undetermined' as const, cause }],\n );\n if (answers.length === 0) return undefined;\n return { options: answers, held: answers };\n}\n\n/** One row-less open question at a member whose array addresses no row. */\nfunction rowlessBinding(\n state: EvaluationState,\n field: CompiledField,\n ref: FieldRef,\n cause: 'deferred' | 'unknown',\n): OptionAvailabilityBinding | undefined {\n // The answer names conditioned codes and reads no value, so a masked or write-only member\n // still states it. Only a declaration that is not delivered at all states nothing.\n const reason = withheldReason(state, ref);\n if (reason === 'hidden' || reason === 'redacted') return undefined;\n return conditionedBinding(field, cause);\n}\n\n/** One row's item scope, built once per array and shared by every member of it. */\ninterface RowScope {\n readonly arrayFieldId: string;\n readonly rowKey: string | number;\n readonly index: number;\n readonly elements: readonly EvaluatedValue[];\n readonly withheld: readonly (readonly string[])[] | undefined;\n readonly undetermined: UndeterminedRows | undefined;\n /**\n * Why the whole list read decided nothing, when it did.\n *\n * A list the reader answers `DEFERRED` or `UNKNOWN` is one this device did not receive, so no\n * member of it may be read as a value a condition decided on: every conditioned option on the\n * row is undetermined with this cause instead of being evaluated against the raw row.\n */\n readonly undecided?: 'deferred' | 'unknown';\n}\n\n/** The rows one array addresses, with the item scope each of them reads under. */\nclass RowScopes {\n private readonly byArray = new Map<string, readonly RowScope[]>();\n /**\n * Why one array states no row at all, when the reason is a declared condition's to report.\n *\n * An array whose rows cannot be keyed because its declaration does not reconcile them still\n * has conditioned options that no device can call available. A row-less answer carries that\n * open question to readiness, without inventing a row key the record never supplied. A\n * withheld natural key and a writer-owned identity are absent here: those are deliberately no\n * answer rather than an undecided one.\n */\n private readonly rowless = new Map<string, 'deferred' | 'unknown'>();\n private readonly state: EvaluationState;\n\n constructor(state: EvaluationState) {\n this.state = state;\n }\n\n /** The addressed rows of one array, or none when the device cannot name them. */\n of(array: CompiledField): readonly RowScope[] {\n const cached = this.byArray.get(array.fieldId);\n if (cached !== undefined) return cached;\n const scopes = this.build(array);\n this.byArray.set(array.fieldId, scopes);\n return scopes;\n }\n\n /** Why one array states no row, when a declared condition exists but no row can be keyed. */\n rowlessCause(array: CompiledField): 'deferred' | 'unknown' | undefined {\n // Reading the answer first is what builds it; a cached empty list carries its cause with it.\n this.of(array);\n return this.rowless.get(array.fieldId);\n }\n\n /**\n * One array's rows, by the invariants `evaluateItemRule` states: an absent, `null` or\n * undetermined list has no row, a list whose identity does not reconcile addresses none, and\n * the row's withheld and unproduced members travel with the elements so a binder answers\n * `UNKNOWN` rather than reading their removal as an absence.\n */\n private build(array: CompiledField): readonly RowScope[] {\n const state = this.state;\n // `addressRows` states no mode when a writer owns the natural identity: the report and the\n // submitted record must not supply two different row keys. Availability reads the same\n // effective rows, so it states no binding rather than inventing an address of its own.\n const identity = array.rowKey?.mode === 'natural' ? array.rowKey.fieldId : undefined;\n if (identity !== undefined && state.computed.writers.has(identity)) return [];\n const arrayPath = state.reader.declarationPathOf(array.fieldId);\n let read: Evaluated;\n try {\n read = state.reader.read(arrayPath);\n } catch (error) {\n // One list is validated in one call, so a cell its declaration refuses raises before any\n // row exists and would take the rows beside it with it — losing an availability answer the\n // record still supports. The refused cell is the derived field's own refusal to state (as\n // `invalidOption`), never an availability fact, so the rows are read beside it. Only a\n // refusal of this list or a cell inside it is that: any other engine error stays loud.\n if (!(error instanceof AxiomError)) throw error;\n if (!error.path.startsWith(arrayPath)) throw error;\n const beside = rowsBesideRefusal(state, array, arrayPath);\n // The refused cell is the derived field's refusal, and the rows beside it are read. When\n // the list's keys do not address either, no row carries a conditioned answer, so the\n // member keeps its row-less open question rather than silently stating nothing.\n if (beside.unaddressable) this.rowless.set(array.fieldId, 'unknown');\n return beside.scopes;\n }\n if (read.kind === 'absent') return [];\n if (isUndetermined(read.value)) {\n // The list itself is a value this device did not receive. Its rows may still be named from\n // the raw record, so an item-scoped condition is answered for the row it would read, but\n // no condition is evaluated: the row it would read is incomplete, and treating that as a\n // decided `false` would block a code the record may legitimately hold.\n const cause = read.value.undetermined === 'DEFERRED' ? 'deferred' : 'unknown';\n const beside = rowsBesideRefusal(state, array, arrayPath, cause);\n if (beside.scopes.length === 0) this.rowless.set(array.fieldId, cause);\n return beside.scopes;\n }\n if (read.value === null || !isWireArray(read.value)) return [];\n // The walk materialises one evaluated element per row, so it is bounded by the same source\n // cap an item rule and a comprehension answer before binding their first element. A refusal\n // is the evaluator's (`EXPR-17.1.1`), not an option answer: it stops the pass.\n state.evaluator.refuseElements(read.value.length);\n const addressing = addressingOfItems(\n array,\n read.value,\n state.reader.index.assignedRowKeys?.(array.fieldId),\n );\n if (addressing.outcome !== 'addressed') {\n // No row can be keyed, so a declared condition can name neither the code it judges nor the\n // row it lives in. It still cannot be read as available: one row-less open question stands\n // at the member and the verdict is undetermined (`RULES-7.1.1`).\n this.rowless.set(array.fieldId, 'unknown');\n return [];\n }\n const rowKeys = addressing.rows.map((row) => row.rowKey);\n const rowMembers = array.fields?.map((member) => member.fieldId) ?? [];\n const elements = read.value.map((item) => {\n const evaluated = valueOf(item);\n return rowMembers.length === 0 ? evaluated : { ...evaluated, closedMembers: rowMembers };\n });\n const withheld =\n read.withheldRows ?? rowKeys.map((rowKey) => state.reader.withheldAt(arrayPath, rowKey));\n // A natural key delivery withholds must not name a row: keying the binding by it would put\n // the key in the snapshot and a readiness blocker. The row keeps its position so the other\n // rows, and a condition reading a neighbour, still address the record it states.\n const addressed = addressing.rows.flatMap((row, index) =>\n identity !== undefined && deliveryWithheld(state, { fieldId: identity, rowKey: row.rowKey })\n ? []\n : [{ row, index }],\n );\n return addressed.map(({ row, index }) => ({\n arrayFieldId: array.fieldId,\n rowKey: row.rowKey,\n index,\n elements,\n withheld,\n undetermined: read.undeterminedRows,\n }));\n }\n}\n\n/** The rows one array read beside a refused cell, and whether its keys named none of them. */\ninterface BesideRefusal {\n readonly scopes: readonly RowScope[];\n /**\n * Whether the record holds the list but no row can be keyed: duplicate natural keys, a value\n * mode that does not reconcile, or an assigned identity the host did not supply. It is the\n * conjunction the row-less cause exists for, and it is distinct from a row list emptied\n * because a delivered natural key was withheld, which is deliberately no answer at all.\n */\n readonly unaddressable: boolean;\n}\n\n/**\n * The rows of an array whose whole-list read a refused cell raised on.\n *\n * `RecordReader.read` validates a list in one call, so a single cell its declaration refuses\n * raises before any row exists and the rows beside it lose their answers with it. The refusal\n * itself is the derived field's to state as `invalidOption`; availability's question is only what\n * the record can still support. Every declared member is therefore read through the same wire\n * boundary on its own, and one the declaration refuses is removed from its row and named on that\n * row's undetermined sideband with `UNKNOWN` — the shape a writer's unproduced member already has\n * — so a condition reading it answers `UNKNOWN` and its removal never passes for an absence.\n *\n * A member this device may not read is withheld exactly as the ordinary read withholds it, and a\n * member whose own restriction has no per-row spelling here is stated undetermined rather than\n * delivered. A row the addressing cannot name states no row at all, and an array whose rows the\n * record no longer holds states none.\n */\nfunction rowsBesideRefusal(\n state: EvaluationState,\n array: CompiledField,\n arrayPath: string,\n undecided?: 'deferred' | 'unknown',\n): BesideRefusal {\n const held = rawListAt(state.reader.input.values, arrayPath);\n if (held === undefined) return { scopes: [], unaddressable: false };\n const addressing = addressingOfItems(\n array,\n held,\n state.reader.index.assignedRowKeys?.(array.fieldId),\n );\n if (addressing.outcome !== 'addressed') return { scopes: [], unaddressable: true };\n // This path builds a row beside the list read that refused one cell, so it is the same walk\n // and carries the same source cap. A refusal stops the pass rather than leaving rows to\n // answer `UNKNOWN` one at a time.\n state.evaluator.refuseElements(addressing.rows.length);\n const members = array.fields ?? [];\n const memberIds = members.map((member) => member.fieldId);\n const withheld: (readonly string[])[] = [];\n const undetermined: (readonly (readonly [string, Undetermined])[])[] = [];\n const elements: EvaluatedValue[] = [];\n for (const [index, row] of addressing.rows.entries()) {\n const rowKey = row.rowKey;\n const item = isRecord(row.item) ? row.item : undefined;\n const values: Record<string, WireValue> = {};\n const computedWithheld: string[] = [];\n const rowUndetermined: (readonly [string, Undetermined])[] = [];\n for (const member of members) {\n const id = member.fieldId;\n const computed = state.reader.computed?.getRow(id, rowKey) ?? state.reader.computed?.get(id);\n if (computed !== undefined) {\n if (computed.kind === 'undetermined') {\n rowUndetermined.push([id, computed.sentinel]);\n continue;\n }\n // A nested container's per-row sideband has no spelling on the member here, so the\n // member is undetermined rather than delivered with a value it lost. A nested member the\n // writer's value withheld is a dotted path inside the row, which the row's sideband states.\n if (computed.withheldRows !== undefined || computed.undeterminedRows !== undefined) {\n rowUndetermined.push([id, UNKNOWN]);\n continue;\n }\n for (const path of computed.withheldMembers ?? []) computedWithheld.push(`${id}.${path}`);\n values[id] = computed.value;\n continue;\n }\n if (item === undefined || !Object.hasOwn(item, id)) continue;\n try {\n values[id] = toWireValue(\n item[id],\n `${arrayPath}[${String(index)}].${id}`,\n wireDeclarationOf(member),\n );\n } catch (error) {\n if (!(error instanceof AxiomError)) throw error;\n rowUndetermined.push([id, UNKNOWN]);\n }\n const value = values[id];\n if (value === undefined) continue;\n // A writer below a record or array member owns its nested cell just as a direct writer owns\n // the member above. The ordinary merge is the authority for that recursive overlay and its\n // sidebands; reading only `computed.get(id)` would silently evaluate the submitted nested\n // value the writer replaced (or left undetermined) instead.\n const merged =\n member.primitive === 'record'\n ? state.reader.mergeRecord(member, value)\n : member.primitive === 'array'\n ? state.reader.mergeRows(member, value)\n : undefined;\n if (merged?.kind !== 'value') continue;\n if (isUndetermined(merged.value)) {\n delete values[id];\n rowUndetermined.push([id, merged.value]);\n continue;\n }\n if (merged.withheldRows !== undefined || merged.undeterminedRows !== undefined) {\n delete values[id];\n rowUndetermined.push([id, UNKNOWN]);\n continue;\n }\n for (const path of merged.withheldMembers ?? []) computedWithheld.push(`${id}.${path}`);\n values[id] = merged.value;\n }\n // Validation and access are separate questions. Reuse the ordinary reader's recursive row\n // filter after each member's own validation: it refuses an unreadable natural key, removes\n // only the members this row may not read, and keeps their dotted paths attributable.\n const readable = withoutUnreadableMembers({\n field: array,\n rows: [values],\n rowKeyOf: () => rowKey,\n isReadable: (ref) => state.reader.isReadable(ref),\n isRowReadable: (rowKey) => state.reader.isReadable({ fieldId: array.fieldId, rowKey }),\n isRedacted: (ref) => state.reader.isRedacted(ref),\n recordDenied: (fieldId, rowKey) => state.reader.recordDenied(fieldId, rowKey),\n });\n // A row whose natural key this device may not read has no identity to state: that is the\n // withheld-key answer, deliberately no row and no row-less question either.\n if (readable === undefined) return { scopes: [], unaddressable: false };\n withheld.push([...computedWithheld, ...(readable.withheld[0] ?? [])]);\n undetermined.push(rowUndetermined);\n const element = item === undefined ? valueOf(UNKNOWN) : valueOf(readable.rows[0] ?? values);\n elements.push({ ...element, closedMembers: memberIds });\n }\n const identity = array.rowKey?.mode === 'natural' ? array.rowKey.fieldId : undefined;\n const ordered = withheld.some((row) => row.length > 0) ? withheld : undefined;\n const pending = undetermined.some((row) => row.length > 0) ? undetermined : undefined;\n return {\n scopes: addressing.rows.flatMap((row, index) =>\n identity !== undefined && deliveryWithheld(state, { fieldId: identity, rowKey: row.rowKey })\n ? []\n : [\n {\n arrayFieldId: array.fieldId,\n rowKey: row.rowKey,\n index,\n elements,\n withheld: ordered,\n undetermined: pending,\n ...(undecided === undefined ? {} : { undecided }),\n },\n ],\n ),\n unaddressable: false,\n };\n}\n\n/** The list one declaration path holds in the record, as the record holds it. */\nfunction rawListAt(\n values: Readonly<Record<string, unknown>>,\n path: string,\n): readonly unknown[] | undefined {\n let current: unknown = values;\n for (const segment of path.split('.')) {\n if (!isRecord(current)) return undefined;\n current = current[segment];\n }\n return Array.isArray(current) ? current : undefined;\n}\n\n/**\n * Why delivery withholds one binding: the control is on screen and only its value is withheld,\n * or the declaration is not delivered at all.\n *\n * A `masked` or `write_only` field is still a control a reader may paint, so its declaration's\n * domain answers are stated and no held code is named. A `hidden` field and a redacted one are\n * not delivered at all, so they state no answer: the declaration's codes are not the value\n * `ACCESS-1.3.4` protects, but a control that is not on screen has no list to paint either.\n */\ntype WithholdingReason = 'masked' | 'write_only' | 'hidden' | 'redacted';\n\n/**\n * The reason delivery withholds one reference, or `undefined` when the value is delivered.\n *\n * The window states one reason per binding, strongest first, so this reads that answer rather than\n * resolving the overlay and its ancestors a second time: a declaration an ancestor hides hides the\n * value inside it whatever the member's own access states, and a `write_only` reference this\n * session has written is delivered (`[ACCESS-1.3.1]`).\n */\nfunction withheldReason(state: EvaluationState, ref: FieldRef): WithholdingReason | undefined {\n const answer = state.accessWindow.enclosingDelivery(ref);\n if (answer.deliverable) return undefined;\n switch (answer.reason) {\n case 'masked':\n case 'write_only':\n case 'hidden':\n case 'redacted':\n return answer.reason;\n case 'read_write':\n case 'read_only':\n case 'written':\n // A delivered answer, already handled above: a caller never sees one of these here.\n return undefined;\n }\n}\n\n/** One binding's declared availability, or `undefined` when every condition left `available`. */\nfunction evaluateBinding(\n state: EvaluationState,\n field: CompiledField,\n ref: FieldRef,\n row: { readonly scope: RowScope; readonly path: readonly string[] } | undefined,\n): OptionAvailabilityBinding | undefined {\n const evaluate = (): OptionAvailabilityBinding | undefined => {\n // A row whose list read decided nothing states every conditioned code undetermined. That\n // answer reads no value at all, so it is safe even when delivery withholds the row: the\n // code it could not read is exactly what the open question is about.\n if (row?.scope.undecided !== undefined) {\n return conditionedBinding(field, row.scope.undecided);\n }\n // A value delivery withholds has no held code to state: deriving one would put it in the\n // binding and in a readiness blocker, exactly the payload `ACCESS-1.3.4` refuses. The\n // declaration's domain is a separate question, and a control that is on screen still paints\n // it, so a masked or write-only binding states its answers with no held code.\n const reason = withheldReason(state, ref);\n if (reason === 'hidden' || reason === 'redacted') return undefined;\n const held = reason === undefined ? heldValuesOf(state, ref, row) : [];\n const answers: OptionAvailabilityAnswer[] = [];\n for (const [index, option] of (field.options ?? []).entries()) {\n // One condition and its reason and alternatives are one rule-like unit of work. Without\n // this boundary every option on every row shares one expression's allowance, and a legal\n // large form turns its later rows UNKNOWN after the earlier ones spend it.\n const previous = state.evaluator.beginRule();\n try {\n const answer = availabilityOf(state, field, option, index, held, row?.scope.rowKey);\n if (answer !== undefined) answers.push(answer);\n } finally {\n state.evaluator.endRule(previous);\n }\n }\n if (answers.length === 0) return undefined;\n return {\n options: answers,\n held:\n reason === undefined\n ? answers.filter((answer) => holdsOption(field, answer.code, held))\n : [],\n };\n };\n if (row === undefined) return evaluate();\n const previousRow = state.currentRowKey;\n state.currentRowKey = row.scope.rowKey;\n try {\n return state.evaluator.withItemScope(\n state.reader.declarationPathOf(row.scope.arrayFieldId),\n row.scope.elements,\n row.scope.index,\n evaluate,\n row.scope.withheld,\n row.scope.undetermined,\n );\n } finally {\n state.currentRowKey = previousRow;\n }\n}\n\n/**\n * One declared option's availability, or `undefined` when it is available.\n *\n * A condition that decides true states no answer, exactly as an option that declares none does.\n * The reason's parameters travel only with an unavailable answer, and the alternatives only for\n * the code the record holds: an alternative is never evaluated for a code nobody chose.\n */\nfunction availabilityOf(\n state: EvaluationState,\n field: CompiledField,\n option: FieldOption,\n index: number,\n held: readonly WireValue[],\n currentRowKey: string | number | undefined,\n): OptionAvailabilityAnswer | undefined {\n if (option.availableWhen === undefined) return undefined;\n noteAvailabilityCondition();\n // The condition's reads are attributed to the binding being judged rather than to a rule, so\n // the three marks are what separate a refusal from an unfilled input and a server handoff,\n // `RULES-2.1.1`.\n const denialMark = state.reader.readMark();\n const missingMark = state.reader.missingMark();\n const deferredMark = state.reader.deferredMark();\n const { status, raised } = outcomeOf(state, option.availableWhen);\n const deferred = state.reader.deferredSince(deferredMark);\n if (status === 'UNKNOWN' && !raised) {\n const refused = state.reader.deniedSince(denialMark, undefined).length > 0;\n // A condition this device may never read is not a code it may refuse: no respondent action\n // decides it, so the option is left available and states no reason or open question\n // (`RULES-7.1.1`). A condition that also read an unfilled input stays undetermined, and one\n // that read a value the server holds keeps the handoff the redacted input is.\n if (refused && !state.reader.missingSince(missingMark) && !deferred) return undefined;\n }\n if (status === 'PASS') return undefined;\n if (status !== 'FAIL') {\n return {\n code: option.code,\n kind: 'undetermined',\n cause: deferred ? 'deferred' : causeOf(status),\n };\n }\n const at = `$.fields.${field.fieldId}.options[${String(index)}]`;\n const params = paramsOf(state, option.unavailableParams, { at: `${at}.unavailableParams` });\n const alternatives = holdsOption(field, option.code, held)\n ? evaluateSuggestions(state, option.suggests ?? [], currentRowKey)\n : { suggestions: [] };\n return {\n code: option.code,\n kind: 'unavailable',\n ...(option.unavailableMessageKey === undefined\n ? {}\n : { messageKey: option.unavailableMessageKey }),\n ...(params === undefined ? {} : { params }),\n ...(alternatives.suggestions.length === 0 ? {} : { suggestions: alternatives.suggestions }),\n };\n}\n\n/** Whether the record holds one declared option's code at the binding being evaluated. */\nfunction holdsOption(\n field: CompiledField,\n code: string | number,\n held: readonly WireValue[],\n): boolean {\n const value = optionCodeValue(field, code);\n return held.some((candidate) => sameWireValue(candidate, value));\n}\n\n/** The `UNKNOWN`/`DEFERRED` cause one undecided outcome states. */\nfunction causeOf(status: Outcome): 'deferred' | 'unknown' {\n return status === 'DEFERRED' ? 'deferred' : 'unknown';\n}\n\n/** The outcome one availability condition decides, and whether an expression error caused it. */\ninterface AvailabilityOutcome {\n readonly status: Outcome;\n readonly raised: boolean;\n}\n\n/**\n * The outcome one availability condition decides, with the fail-safe answers stated here.\n *\n * A thrown expression, a non-boolean result, an absent read and a read of a value this device may\n * not state are all `UNKNOWN`: the option is not known to be available, and an undecided condition\n * is never turned into an availability the record cannot support. `raised` keeps a refusal observed\n * elsewhere in the expression from misclassifying an engine error as an access-only outcome.\n */\nfunction outcomeOf(state: EvaluationState, node: ExprNode): AvailabilityOutcome {\n return withScopedDelivery(state, () => {\n const mark = state.reader.taintMark();\n const binderMark = state.evaluator.binderTaintMark();\n try {\n const status = state.evaluator.statusOf(state.evaluator.evaluate(node));\n // A row scope outlives the reader read that built it, so a revoked member a lifted read\n // delivered is only visible to the binder's own stream. Either answer is a read this\n // device may not state, and an availability condition on it decides nothing.\n return {\n status:\n state.reader.taintedSince(mark).length > 0 ||\n state.evaluator.touchedBinderWithheld(binderMark)\n ? 'UNKNOWN'\n : status,\n raised: false,\n };\n } catch (error) {\n if (!(error instanceof AxiomError)) throw error;\n return { status: 'UNKNOWN', raised: true };\n }\n });\n}\n\n/** The wire values one binding holds, after the writers produced theirs. */\nfunction heldValuesOf(\n state: EvaluationState,\n ref: FieldRef,\n row: { readonly scope: RowScope; readonly path: readonly string[] } | undefined,\n): readonly WireValue[] {\n if (row !== undefined) {\n const value = decidedValue(row.scope.elements[row.scope.index], row.path);\n return value === undefined || value === null ? [] : isWireArray(value) ? value : [value];\n }\n try {\n const value = decidedValue(state.reader.read(state.reader.declarationPathOf(ref.fieldId)), []);\n return value === undefined || value === null ? [] : isWireArray(value) ? value : [value];\n } catch (error) {\n // The derived field states a declaration refusal as `invalidOption`. Availability must not\n // turn that tolerant read into a throw before the refusal reaches readiness.\n if (!(error instanceof AxiomError)) throw error;\n return [];\n }\n}\n\n/** The wire value one evaluated operand states, walking `path` into it; `undefined` if undecided. */\nfunction decidedValue(\n evaluated: Evaluated | undefined,\n path: readonly string[],\n): WireValue | undefined {\n if (evaluated?.kind !== 'value' || isUndetermined(evaluated.value)) return undefined;\n let current: WireValue | undefined = evaluated.value;\n for (const segment of path) {\n const members: Readonly<Record<string, WireValue>> | undefined =\n current === undefined ? undefined : wireMembers(current);\n current = members?.[segment];\n }\n return current;\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import type { Diagnostic } from '../model/types.js';
2
+ import type { CompiledField } from '../model/types.js';
3
+ import type { OptionDomains } from './options.js';
4
+ /**
5
+ * The diagnostics a host-loaded option domain earns when a value it offers contradicts the
6
+ * field's declared domain.
7
+ *
8
+ * An option domain is host input: a loader can return a number for a `string` field, or a
9
+ * record for a scalar one. The domain is not a rule operand, so the engine cannot fold the
10
+ * mismatch into a rule status; it records the same `LATE_BOUND_TYPE_MISMATCH` a context root or
11
+ * dataset column earns, and the report's diagnostic fold keeps the evaluation `UNKNOWN` rather
12
+ * than inventing a verdict. The path names the binding and the item, never the value.
13
+ */
14
+ export declare function optionDomainDiagnostics(fields: readonly CompiledField[], domains: OptionDomains | undefined): readonly Diagnostic[];
15
+ //# sourceMappingURL=options-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options-boundary.d.ts","sourceRoot":"","sources":["../../src/eval/options-boundary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,OAAO,EAAE,aAAa,GAAG,SAAS,GACjC,SAAS,UAAU,EAAE,CAoBvB"}
@@ -0,0 +1,40 @@
1
+ import { LateBoundTypeMismatch } from '../model/errors.js';
2
+ import { indexFields } from './reader/declarations.js';
3
+ import { toHostWireValue, wireDeclarationOf } from '../model/wire.js';
4
+ import { diagnosticOfEngineError } from './error-diagnostic.js';
5
+ /**
6
+ * The diagnostics a host-loaded option domain earns when a value it offers contradicts the
7
+ * field's declared domain.
8
+ *
9
+ * An option domain is host input: a loader can return a number for a `string` field, or a
10
+ * record for a scalar one. The domain is not a rule operand, so the engine cannot fold the
11
+ * mismatch into a rule status; it records the same `LATE_BOUND_TYPE_MISMATCH` a context root or
12
+ * dataset column earns, and the report's diagnostic fold keeps the evaluation `UNKNOWN` rather
13
+ * than inventing a verdict. The path names the binding and the item, never the value.
14
+ */
15
+ export function optionDomainDiagnostics(fields, domains) {
16
+ if (domains === undefined)
17
+ return [];
18
+ const byPath = indexFields(fields);
19
+ const diagnostics = [];
20
+ for (const [key, items] of domains) {
21
+ const at = key.lastIndexOf('@');
22
+ const fieldId = at === -1 ? key : key.slice(0, at);
23
+ const field = byPath.get(fieldId);
24
+ if (field === undefined)
25
+ continue;
26
+ items.forEach((item, index) => {
27
+ const path = `$.options.${key}[${String(index)}]`;
28
+ try {
29
+ toHostWireValue(item.value, path, wireDeclarationOf(field));
30
+ }
31
+ catch (error) {
32
+ if (!(error instanceof LateBoundTypeMismatch))
33
+ throw error;
34
+ diagnostics.push(diagnosticOfEngineError(error, { operation: 'options' }));
35
+ }
36
+ });
37
+ }
38
+ return diagnostics;
39
+ }
40
+ //# sourceMappingURL=options-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options-boundary.js","sourceRoot":"","sources":["../../src/eval/options-boundary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAgC,EAChC,OAAkC;IAElC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,OAAO,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC5B,MAAM,IAAI,GAAG,aAAa,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;YAClD,IAAI,CAAC;gBACH,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,CAAC,KAAK,YAAY,qBAAqB,CAAC;oBAAE,MAAM,KAAK,CAAC;gBAC3D,WAAW,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;YAC7E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { LateBoundTypeMismatch } from '../model/errors.js';\nimport type { Diagnostic } from '../model/types.js';\nimport { indexFields } from './reader/declarations.js';\nimport { toHostWireValue, wireDeclarationOf } from '../model/wire.js';\nimport type { CompiledField } from '../model/types.js';\nimport type { OptionDomains } from './options.js';\nimport { diagnosticOfEngineError } from './error-diagnostic.js';\n\n/**\n * The diagnostics a host-loaded option domain earns when a value it offers contradicts the\n * field's declared domain.\n *\n * An option domain is host input: a loader can return a number for a `string` field, or a\n * record for a scalar one. The domain is not a rule operand, so the engine cannot fold the\n * mismatch into a rule status; it records the same `LATE_BOUND_TYPE_MISMATCH` a context root or\n * dataset column earns, and the report's diagnostic fold keeps the evaluation `UNKNOWN` rather\n * than inventing a verdict. The path names the binding and the item, never the value.\n */\nexport function optionDomainDiagnostics(\n fields: readonly CompiledField[],\n domains: OptionDomains | undefined,\n): readonly Diagnostic[] {\n if (domains === undefined) return [];\n const byPath = indexFields(fields);\n const diagnostics: Diagnostic[] = [];\n for (const [key, items] of domains) {\n const at = key.lastIndexOf('@');\n const fieldId = at === -1 ? key : key.slice(0, at);\n const field = byPath.get(fieldId);\n if (field === undefined) continue;\n items.forEach((item, index) => {\n const path = `$.options.${key}[${String(index)}]`;\n try {\n toHostWireValue(item.value, path, wireDeclarationOf(field));\n } catch (error) {\n if (!(error instanceof LateBoundTypeMismatch)) throw error;\n diagnostics.push(diagnosticOfEngineError(error, { operation: 'options' }));\n }\n });\n }\n return diagnostics;\n}\n"]}
@@ -0,0 +1,99 @@
1
+ import type { CompiledField, WireValue } from '../model/types.js';
2
+ /**
3
+ * One value a domain offers, and nothing else.
4
+ *
5
+ * Eligibility compares values, so a derivation that reads a `field` source's recorded array
6
+ * needs only this much of an option: the array holds values, and the labels live on the field
7
+ * that declared the items. A page's `OptionItem` is one of these with its label key.
8
+ */
9
+ export interface OptionValue<V extends WireValue = WireValue> {
10
+ readonly value: V;
11
+ }
12
+ /**
13
+ * The wire value one declared option code names on its field, `[MODEL-3.1.5]`.
14
+ *
15
+ * A boolean field's option codes are the strings `true` and `false`, "which its control maps to the
16
+ * boolean values": the record holds the boolean, not its spelling. A duration field's codes are
17
+ * amounts in the field's declared unit, so the record holds the duration value. A scalar array's
18
+ * item declaration supplies the primitive and, for durations, the unit. Every other primitive's
19
+ * codes are its values.
20
+ *
21
+ * The domain a field offers and the code a record holds are the same answer asked twice, so one
22
+ * mapping answers both: a code a control paints and a code readiness blocks can never disagree
23
+ * about which option the record selected.
24
+ */
25
+ export declare function optionCodeValue(field: CompiledField, code: string | number): WireValue;
26
+ /**
27
+ * A field's option domain when the document does not declare it, `[MODEL-3.1.8]`.
28
+ *
29
+ * One `OptionItem` is one selectable value and the key that names its label. The value is a
30
+ * wire value rather than a code, so a scalar option, a money amount and a `timeslot` compare by
31
+ * the wire contract's own equality instead of by an `===` that a record-shaped value can never
32
+ * satisfy.
33
+ */
34
+ export interface OptionItem<V extends WireValue = WireValue> extends OptionValue<V> {
35
+ /** The message key naming this option's label, resolved through the artifact's catalogue. */
36
+ readonly labelKey: string;
37
+ /** Whether the domain still offers the option but no new selection may choose it. */
38
+ readonly deprecated?: boolean;
39
+ /**
40
+ * Whether the host's own answer says this option may be chosen, `RULES-7.1.5`.
41
+ *
42
+ * A host-loaded page answers for the codes it holds, because their availability lives in the
43
+ * host's data rather than in the document. Absent means available; `false` is taken as given
44
+ * and never re-decided, so the engine states the host's answer rather than a second opinion.
45
+ */
46
+ readonly available?: boolean;
47
+ /** The message key of the sentence an item the host marks unavailable states. */
48
+ readonly unavailableMessageKey?: string;
49
+ /** The message arguments of `unavailableMessageKey`, as the host states them. */
50
+ readonly unavailableParams?: Readonly<Record<string, WireValue>>;
51
+ }
52
+ /**
53
+ * One bounded page of a host-provided domain, `[DATA-5.1.2]`.
54
+ *
55
+ * `nextCursor` is the request that asks for the following page and is `null` on the last one.
56
+ * It is opaque to the caller: a host may use an offset, a primary key or an encoded tuple.
57
+ */
58
+ export interface OptionPage<V extends WireValue = WireValue> {
59
+ readonly items: readonly OptionItem<V>[];
60
+ readonly nextCursor: string | null;
61
+ }
62
+ /**
63
+ * The option value a selection, or one member of a multi-select selection, no longer matches.
64
+ *
65
+ * A selection is eligible when the domain offers a value the wire contract calls equal. That
66
+ * is `sameWireValue` rather than `===`, so `1` and `"1"` stay distinct while a `timeslot` or a
67
+ * money amount compares by its members. An authored `null` — the empty value of every domain —
68
+ * is always eligible. A multi-select reports the first member the domain refuses, mirroring
69
+ * `invalidValue` on a field. A domain that has not answered yet is the caller's to omit; this
70
+ * function judges only the values it is given.
71
+ */
72
+ export declare function ineligibleOptionValue(selected: WireValue | undefined, items: readonly OptionValue[]): WireValue | undefined;
73
+ /**
74
+ * The same comparison over raw values: the domain a `field` source reads from a recorded array.
75
+ *
76
+ * It is the one comparison body rather than a second rule, and it exists so a derivation over a
77
+ * source array that may hold thousands of values does not allocate a wrapper per value on every
78
+ * pass.
79
+ */
80
+ export declare function ineligibleWireValue(selected: WireValue | undefined, values: readonly WireValue[]): WireValue | undefined;
81
+ /** Whether a domain offers every value a selection names, by the wire contract's equality. */
82
+ export declare function optionEligibility(selected: WireValue | undefined, items: readonly OptionValue[]): boolean;
83
+ /**
84
+ * The refusal code a selection an option domain no longer offers is reported under,
85
+ * `[DATA-5.1.3]`.
86
+ *
87
+ * The runtime states it as the field's `invalidValue`, never as a diagnostic code: the
88
+ * metaschema and the report vocabulary stay closed, and the selected value is not wiped.
89
+ */
90
+ export declare const OPTION_NO_LONGER_ELIGIBLE = "OPTION_NO_LONGER_ELIGIBLE";
91
+ /**
92
+ * The loaded domain of each binding, keyed by the runtime's own `fieldKey`.
93
+ *
94
+ * A host that loads a page hands the derivation this map, so eligibility is decided once
95
+ * inside `deriveFormState` and no caller recomputes it. The engine stores no option state of
96
+ * its own: this is a derivation input, like the record and the access answer.
97
+ */
98
+ export type OptionDomains = ReadonlyMap<string, readonly OptionItem[]>;
99
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/eval/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGhF;;;;;;GAMG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC1D,QAAQ,CAAC,KAAK,EAAE,CAAC,C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SAAS,WAAW,EAAE,GAC5B,OAAO,CAET;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { sameWireValue } from '../model/values.js';
2
+ /**
3
+ * The wire value one declared option code names on its field, `[MODEL-3.1.5]`.
4
+ *
5
+ * A boolean field's option codes are the strings `true` and `false`, "which its control maps to the
6
+ * boolean values": the record holds the boolean, not its spelling. A duration field's codes are
7
+ * amounts in the field's declared unit, so the record holds the duration value. A scalar array's
8
+ * item declaration supplies the primitive and, for durations, the unit. Every other primitive's
9
+ * codes are its values.
10
+ *
11
+ * The domain a field offers and the code a record holds are the same answer asked twice, so one
12
+ * mapping answers both: a code a control paints and a code readiness blocks can never disagree
13
+ * about which option the record selected.
14
+ */
15
+ export function optionCodeValue(field, code) {
16
+ const item = field.primitive === 'array' ? field.items : undefined;
17
+ const primitive = item?.primitive ?? field.primitive;
18
+ if (primitive === 'boolean')
19
+ return booleanCodeValue(code);
20
+ if (primitive === 'duration') {
21
+ return durationCodeValue(code, item === undefined ? field.unit : item.unit);
22
+ }
23
+ return code;
24
+ }
25
+ /**
26
+ * The duration an amount code names in the field's unit, or the code where it is not an amount.
27
+ *
28
+ * The compiler admits only safe-integer amounts on a duration option, so an artifact that states
29
+ * text cannot describe a value any record holds: keeping the code refuses every selection rather
30
+ * than guessing one, exactly as the boolean fallback below does.
31
+ */
32
+ function durationCodeValue(code, unit) {
33
+ return typeof code === 'number' ? { amount: code, unit: unit ?? 'minutes' } : code;
34
+ }
35
+ /**
36
+ * The boolean a code spells, or the code itself where an artifact states neither spelling.
37
+ *
38
+ * The compiler admits only the two spellings on a boolean field, so a third is an artifact no
39
+ * value can satisfy: keeping it refuses every selection rather than guessing one.
40
+ */
41
+ function booleanCodeValue(code) {
42
+ if (code === 'true')
43
+ return true;
44
+ if (code === 'false')
45
+ return false;
46
+ return code;
47
+ }
48
+ /**
49
+ * The option value a selection, or one member of a multi-select selection, no longer matches.
50
+ *
51
+ * A selection is eligible when the domain offers a value the wire contract calls equal. That
52
+ * is `sameWireValue` rather than `===`, so `1` and `"1"` stay distinct while a `timeslot` or a
53
+ * money amount compares by its members. An authored `null` — the empty value of every domain —
54
+ * is always eligible. A multi-select reports the first member the domain refuses, mirroring
55
+ * `invalidValue` on a field. A domain that has not answered yet is the caller's to omit; this
56
+ * function judges only the values it is given.
57
+ */
58
+ export function ineligibleOptionValue(selected, items) {
59
+ return ineligibleAmong(selected, items, (item) => item.value);
60
+ }
61
+ /**
62
+ * The same comparison over raw values: the domain a `field` source reads from a recorded array.
63
+ *
64
+ * It is the one comparison body rather than a second rule, and it exists so a derivation over a
65
+ * source array that may hold thousands of values does not allocate a wrapper per value on every
66
+ * pass.
67
+ */
68
+ export function ineligibleWireValue(selected, values) {
69
+ return ineligibleAmong(selected, values, (value) => value);
70
+ }
71
+ function ineligibleAmong(selected, items, valueOf) {
72
+ if (selected === undefined || selected === null)
73
+ return undefined;
74
+ if (Array.isArray(selected)) {
75
+ // The array arm is the multi-select selection: every member must be offered.
76
+ for (const member of selected) {
77
+ if (ineligibleAmong(member, items, valueOf) !== undefined)
78
+ return member;
79
+ }
80
+ return undefined;
81
+ }
82
+ return items.some((item) => sameWireValue(valueOf(item), selected)) ? undefined : selected;
83
+ }
84
+ /** Whether a domain offers every value a selection names, by the wire contract's equality. */
85
+ export function optionEligibility(selected, items) {
86
+ return ineligibleOptionValue(selected, items) === undefined;
87
+ }
88
+ /**
89
+ * The refusal code a selection an option domain no longer offers is reported under,
90
+ * `[DATA-5.1.3]`.
91
+ *
92
+ * The runtime states it as the field's `invalidValue`, never as a diagnostic code: the
93
+ * metaschema and the report vocabulary stay closed, and the selected value is not wiped.
94
+ */
95
+ export const OPTION_NO_LONGER_ELIGIBLE = 'OPTION_NO_LONGER_ELIGIBLE';
96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OAAO,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAA+B,EAC/B,MAA4B;IAE5B,OAAO,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,eAAe,CACtB,QAA+B,EAC/B,KAAmB,EACnB,OAA+B;IAE/B,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,6EAA6E;QAC7E,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;YAC9B,IAAI,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,SAAS;gBAAE,OAAO,MAAM,CAAC;QAC3E,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7F,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,iBAAiB,CAC/B,QAA+B,EAC/B,KAA6B;IAE7B,OAAO,qBAAqB,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC;AAC9D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC","sourcesContent":["import type { CompiledField, DurationUnit, WireValue } from '../model/types.js';\nimport { sameWireValue } from '../model/values.js';\n\n/**\n * One value a domain offers, and nothing else.\n *\n * Eligibility compares values, so a derivation that reads a `field` source's recorded array\n * needs only this much of an option: the array holds values, and the labels live on the field\n * that declared the items. A page's `OptionItem` is one of these with its label key.\n */\nexport interface OptionValue<V extends WireValue = WireValue> {\n readonly value: V;\n}\n\n/**\n * The wire value one declared option code names on its field, `[MODEL-3.1.5]`.\n *\n * A boolean field's option codes are the strings `true` and `false`, \"which its control maps to the\n * boolean values\": the record holds the boolean, not its spelling. A duration field's codes are\n * amounts in the field's declared unit, so the record holds the duration value. A scalar array's\n * item declaration supplies the primitive and, for durations, the unit. Every other primitive's\n * codes are its values.\n *\n * The domain a field offers and the code a record holds are the same answer asked twice, so one\n * mapping answers both: a code a control paints and a code readiness blocks can never disagree\n * about which option the record selected.\n */\nexport function optionCodeValue(field: CompiledField, code: string | number): WireValue {\n const item = field.primitive === 'array' ? field.items : undefined;\n const primitive = item?.primitive ?? field.primitive;\n if (primitive === 'boolean') return booleanCodeValue(code);\n if (primitive === 'duration') {\n return durationCodeValue(code, item === undefined ? field.unit : item.unit);\n }\n return code;\n}\n\n/**\n * The duration an amount code names in the field's unit, or the code where it is not an amount.\n *\n * The compiler admits only safe-integer amounts on a duration option, so an artifact that states\n * text cannot describe a value any record holds: keeping the code refuses every selection rather\n * than guessing one, exactly as the boolean fallback below does.\n */\nfunction durationCodeValue(code: string | number, unit: DurationUnit | undefined): WireValue {\n return typeof code === 'number' ? { amount: code, unit: unit ?? 'minutes' } : code;\n}\n\n/**\n * The boolean a code spells, or the code itself where an artifact states neither spelling.\n *\n * The compiler admits only the two spellings on a boolean field, so a third is an artifact no\n * value can satisfy: keeping it refuses every selection rather than guessing one.\n */\nfunction booleanCodeValue(code: string | number): WireValue {\n if (code === 'true') return true;\n if (code === 'false') return false;\n return code;\n}\n\n/**\n * A field's option domain when the document does not declare it, `[MODEL-3.1.8]`.\n *\n * One `OptionItem` is one selectable value and the key that names its label. The value is a\n * wire value rather than a code, so a scalar option, a money amount and a `timeslot` compare by\n * the wire contract's own equality instead of by an `===` that a record-shaped value can never\n * satisfy.\n */\nexport interface OptionItem<V extends WireValue = WireValue> extends OptionValue<V> {\n /** The message key naming this option's label, resolved through the artifact's catalogue. */\n readonly labelKey: string;\n /** Whether the domain still offers the option but no new selection may choose it. */\n readonly deprecated?: boolean;\n /**\n * Whether the host's own answer says this option may be chosen, `RULES-7.1.5`.\n *\n * A host-loaded page answers for the codes it holds, because their availability lives in the\n * host's data rather than in the document. Absent means available; `false` is taken as given\n * and never re-decided, so the engine states the host's answer rather than a second opinion.\n */\n readonly available?: boolean;\n /** The message key of the sentence an item the host marks unavailable states. */\n readonly unavailableMessageKey?: string;\n /** The message arguments of `unavailableMessageKey`, as the host states them. */\n readonly unavailableParams?: Readonly<Record<string, WireValue>>;\n}\n\n/**\n * One bounded page of a host-provided domain, `[DATA-5.1.2]`.\n *\n * `nextCursor` is the request that asks for the following page and is `null` on the last one.\n * It is opaque to the caller: a host may use an offset, a primary key or an encoded tuple.\n */\nexport interface OptionPage<V extends WireValue = WireValue> {\n readonly items: readonly OptionItem<V>[];\n readonly nextCursor: string | null;\n}\n\n/**\n * The option value a selection, or one member of a multi-select selection, no longer matches.\n *\n * A selection is eligible when the domain offers a value the wire contract calls equal. That\n * is `sameWireValue` rather than `===`, so `1` and `\"1\"` stay distinct while a `timeslot` or a\n * money amount compares by its members. An authored `null` — the empty value of every domain —\n * is always eligible. A multi-select reports the first member the domain refuses, mirroring\n * `invalidValue` on a field. A domain that has not answered yet is the caller's to omit; this\n * function judges only the values it is given.\n */\nexport function ineligibleOptionValue(\n selected: WireValue | undefined,\n items: readonly OptionValue[],\n): WireValue | undefined {\n return ineligibleAmong(selected, items, (item) => item.value);\n}\n\n/**\n * The same comparison over raw values: the domain a `field` source reads from a recorded array.\n *\n * It is the one comparison body rather than a second rule, and it exists so a derivation over a\n * source array that may hold thousands of values does not allocate a wrapper per value on every\n * pass.\n */\nexport function ineligibleWireValue(\n selected: WireValue | undefined,\n values: readonly WireValue[],\n): WireValue | undefined {\n return ineligibleAmong(selected, values, (value) => value);\n}\n\nfunction ineligibleAmong<T>(\n selected: WireValue | undefined,\n items: readonly T[],\n valueOf: (item: T) => WireValue,\n): WireValue | undefined {\n if (selected === undefined || selected === null) return undefined;\n if (Array.isArray(selected)) {\n // The array arm is the multi-select selection: every member must be offered.\n for (const member of selected) {\n if (ineligibleAmong(member, items, valueOf) !== undefined) return member;\n }\n return undefined;\n }\n return items.some((item) => sameWireValue(valueOf(item), selected)) ? undefined : selected;\n}\n\n/** Whether a domain offers every value a selection names, by the wire contract's equality. */\nexport function optionEligibility(\n selected: WireValue | undefined,\n items: readonly OptionValue[],\n): boolean {\n return ineligibleOptionValue(selected, items) === undefined;\n}\n\n/**\n * The refusal code a selection an option domain no longer offers is reported under,\n * `[DATA-5.1.3]`.\n *\n * The runtime states it as the field's `invalidValue`, never as a diagnostic code: the\n * metaschema and the report vocabulary stay closed, and the selected value is not wiped.\n */\nexport const OPTION_NO_LONGER_ELIGIBLE = 'OPTION_NO_LONGER_ELIGIBLE';\n\n/**\n * The loaded domain of each binding, keyed by the runtime's own `fieldKey`.\n *\n * A host that loads a page hands the derivation this map, so eligibility is decided once\n * inside `deriveFormState` and no caller recomputes it. The engine stores no option state of\n * its own: this is a derivation input, like the record and the access answer.\n */\nexport type OptionDomains = ReadonlyMap<string, readonly OptionItem[]>;\n"]}
@@ -0,0 +1,116 @@
1
+ import type { EvaluationReport, GateOverride, RuleResult } from '../model/types.js';
2
+ /**
3
+ * Gate overrides at the stateless boundary: reading what a host approved, and what an
4
+ * approval waives.
5
+ *
6
+ * Axiom never approves an override — the host does — so the record arrives untrusted. It is
7
+ * read into the closed `gateOverride` shape here, and an accepted one is the reader's own
8
+ * frozen record rather than the caller's object, so a host that keeps writing to its copy
9
+ * cannot rewrite a decision the report already binds.
10
+ */
11
+ /** Why a gate call would not accept one override. */
12
+ export type GateOverrideRefusal = 'malformed' | 'hard_gate' | 'inactive_gate' | 'stale' | 'unknown_gate' | 'no_gate' | 'unreadable_input';
13
+ /**
14
+ * One override the call would not accept, with the reason it was refused.
15
+ *
16
+ * `override` is the caller's value as supplied: a malformed record has no `GateOverride`
17
+ * shape to report, and stating what arrived is what lets a host find the record it stored
18
+ * wrong. A refusal that only says "malformed" names neither the member nor the rule, which is
19
+ * the least an operator repairing the record that a credit decision was recorded against needs,
20
+ * so the malformed arm carries the same `path` and `detail` the wire door states for a bad value.
21
+ */
22
+ export interface GateRefusal {
23
+ readonly override: unknown;
24
+ readonly reason: GateOverrideRefusal;
25
+ /**
26
+ * The member a malformed record broke, in the request's own path spelling: a lower-case
27
+ * `reasonCode` is refused at `$.overrides[i].reasonCode`, a missing one at `$.overrides[i]`.
28
+ * Absent when the refusal is about the gate rather than a record's shape.
29
+ */
30
+ readonly path?: string;
31
+ /** Why a malformed record was refused, without the path; absent for a well-formed record. */
32
+ readonly detail?: string;
33
+ }
34
+ /** What a gate call accepted and refused. */
35
+ export interface GateOverrideOutcome {
36
+ readonly accepted: readonly GateOverride[];
37
+ readonly refused: readonly GateRefusal[];
38
+ }
39
+ /** The overrides that crossed the boundary, before any of them is weighed against the gate. */
40
+ export interface ReadOverrides {
41
+ readonly wellFormed: readonly GateOverride[];
42
+ readonly refused: readonly GateRefusal[];
43
+ }
44
+ /**
45
+ * Reads every host-supplied override through the boundary.
46
+ *
47
+ * A malformed record is refused with its cause rather than thrown: an approval step that
48
+ * stored a broken record is a fact about that record, not a failure of the gate call, and
49
+ * the well-formed overrides beside it still stand.
50
+ *
51
+ * The record states no approval state of its own (`RULES-4.1.1`): that state is the host's
52
+ * record, and a member here could only invite a reader to treat it as the engine's verdict. What
53
+ * approves an override is its presence in the set the host hands `evaluateGate`, and the three
54
+ * hashes then bind that approval to the one gate decision it was recorded against. A client that
55
+ * computes a matching hash can therefore
56
+ * satisfy its own client verdict — which is why that verdict is a proposal the server re-derives
57
+ * (`[ACCESS-7.1.4]`) — and `evaluateSubmission` admits no `overrides` member at all, so a
58
+ * forwarded body cannot nominate an approval set for itself.
59
+ */
60
+ export declare function readGateOverrides(overrides: readonly unknown[]): ReadOverrides;
61
+ /**
62
+ * The report with every approved gate marked `PASS` and every approval recorded.
63
+ *
64
+ * The waiver sets are unioned before the status is computed. Rewriting one gate at a time would
65
+ * make the next gate fold the retained diagnostic stream afresh and resurrect the previous gate's
66
+ * waiver. Every diagnostic stays as evidence; only its contribution to the status is waived.
67
+ *
68
+ * This is the trusted applier: every entry must already have been weighed against the report and
69
+ * the gate it names. `decideGate` does that weighing, and `applyApprovedOverrides` now does it too
70
+ * rather than leaving it to its caller, so neither public door forwards an unweighed record here.
71
+ * It rewrites the gate id it is handed without re-reading the approval.
72
+ */
73
+ export declare function applyApprovedOverrideBatch(report: EvaluationReport, approvals: readonly {
74
+ readonly gateRuleId: string;
75
+ readonly accepted: readonly GateOverride[];
76
+ readonly deniedFields: readonly string[];
77
+ }[]): EvaluationReport;
78
+ /**
79
+ * Whether one accepted record approves this gate of this report.
80
+ *
81
+ * The report alone states three of the four facts an approval is bound to: the record names the
82
+ * gate, the gate result's `ruleHash` is the one the record was minted against, and the report's
83
+ * `behaviorHash` is the artifact's. The fourth, `inputHash`, is the record's own values, which
84
+ * the report deliberately does not carry, so only `evaluateGate` — which holds the record and the
85
+ * environment — can weigh it.
86
+ *
87
+ * `gateResult` is the named gate's entry in `report.rules`, so a caller that already found it
88
+ * does not re-scan the report once per record. Sharing this predicate is what keeps the trusted
89
+ * applier and the untrusted door from disagreeing about which records belong to a gate.
90
+ */
91
+ export declare function approvalMatchesReport(report: EvaluationReport, gateResult: RuleResult, override: GateOverride): boolean;
92
+ /**
93
+ * The report with one gate's accepted overrides applied, or a refusal that changes nothing.
94
+ *
95
+ * This is a replay for a host that has already decided an approval, not the door for an untrusted
96
+ * record. It weighs the three facts a report can state about the records it is handed — each
97
+ * names the gate, the gate's `ruleHash` and the artifact's `behaviorHash` still match — and it
98
+ * applies only those records. When none survives, it refuses the whole call with a typed
99
+ * `AxiomError` at `$.accepted`; the report the caller passed is unchanged, because nothing is
100
+ * built until a record has proved it belongs to this gate.
101
+ *
102
+ * It cannot weigh `inputHash` (the report does not carry the record it was decided from) or a
103
+ * gate's `hard` declaration (the report does not carry the artifact), so a host holding an
104
+ * unvetted record calls `evaluateGate`, which weighs all three hashes and the declaration and
105
+ * reports each refusal as data. This helper's throw is the same boundary one level up:
106
+ * `readGateOverrides` reports a malformed *record* as data because the record crossed from an
107
+ * untrusted store, while a call that proves nothing about the gate it names violates this
108
+ * helper's precondition — and returning the report unchanged would make "nothing was approved"
109
+ * indistinguishable from "this gate was approved".
110
+ *
111
+ * An accepted record can no more approve itself here than at `evaluateGate`: a record minted for
112
+ * another gate, another artifact or another version of the gate rule is not applied, and the
113
+ * gate keeps the verdict the evaluation decided.
114
+ */
115
+ export declare function applyApprovedOverrides(report: EvaluationReport, gateRuleId: string, accepted: readonly GateOverride[], deniedFields: readonly string[]): EvaluationReport;
116
+ //# sourceMappingURL=overrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../src/eval/overrides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,gBAAgB,EAChB,YAAY,EAEZ,UAAU,EACX,MAAM,mBAAmB,CAAC;AAK3B;;;;;;;;GAQG;AAEH,qDAAqD;AACrD,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,WAAW,GACX,eAAe,GACf,OAAO,GACP,cAAc,GACd,SAAS,GACT,kBAAkB,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,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