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

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 +1207 -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":"readiness.js","sourceRoot":"","sources":["../../../src/eval/state/readiness.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2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,\n Severity,\n WireValue,\n Outcome,\n} from '../../model/types.js';\nimport type { CompiledSchema } from '../../model/schema.js';\nimport { rowKeyToken } from '../../model/wire.js';\nimport { diagnosticDoc } from '../../expr/diagnostics.js';\nimport { fieldKey } from '../access/projection.js';\nimport { gateOutcome } from '../gate.js';\nimport type { GateVerdict } from '../gate.js';\nimport type {\n DecimalScale,\n DerivedRules,\n FormFieldState,\n MediaConstraints,\n RowAddressing,\n} from './field-state.js';\nimport type { FormSnapshot } from './snapshot.js';\nimport type { UndecidedCauses } from '../undecided.js';\nimport type { FormStateOptions } from './options.js';\nimport type { ValueState } from './value-state.js';\nimport {\n heldValuesOf,\n holdsItem,\n hostOptionCode,\n hostUnavailableItems,\n} from './unavailable-options.js';\n\n/**\n * The five verdicts a gate can present, `[ENGINE-7.1.5]`: the four the gate surface reports,\n * plus the one a gate its `activeWhen` switched off states. The status-to-verdict answer is\n * `gateOutcome`, the same table `evaluateGate` reads, so a derived state and the gate surface\n * cannot present one status as two verdicts.\n */\nexport type GateOutcome = GateVerdict | 'INACTIVE';\n\n/** One declared gate's state, with the items it folded. */\nexport interface FormGateState {\n readonly gateId: string;\n readonly hard: boolean;\n /**\n * The gate's effective severity. Only a `block` gate can refuse the submission; a `warn`\n * or `info` gate still reports its own outcome, but readiness does not turn it into a\n * blocker (`RULES-1.1.5`).\n */\n readonly severity: Severity;\n /** The gate rule's own status, before the verdict's presentation. */\n readonly status: Outcome;\n readonly outcome: GateOutcome;\n readonly items: readonly GateItemResult[];\n}\n\n/** One declared screen's state. */\nexport interface FormScreenState {\n readonly screenId: string;\n readonly severity: Severity;\n /**\n * The sentence the artifact declared for this screen, when it declared one.\n *\n * The report states only the outcome and the reasons, so this is read from the compiled rule:\n * a host that renders a blocked screen translates this key, and an artifact that declared\n * none leaves the screen's own rule id as the visible fallback. The same key is stated on the\n * `screen` arm of `FormUndeterminedCheck`, so a decided and an undecided screen are named\n * alike.\n */\n readonly messageKey?: string;\n readonly outcome: ScreenOutcome;\n readonly reasons: readonly ScreenReason[];\n}\n\n/**\n * One block-severity check this device could not decide.\n *\n * It is not a blocker: a blocker is a decided refusal, and this is the absence of a decision\n * (`RULES-2.1.1`, `RULES-2.1.9`). It still refuses the submission, under the `UNDETERMINED`\n * verdict, because a device that cannot answer \"at least one row\" must not pass the record on\n * as though it had. `kind` names the check, and the message key the artifact declared lets a\n * host say which question is open.\n */\nexport type FormUndeterminedCheck =\n | {\n readonly kind: 'rule';\n readonly ruleId: string;\n readonly fieldId?: string;\n readonly rowKey?: string | number;\n readonly messageKey?: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n }\n | {\n readonly kind: 'required';\n readonly fieldId: string;\n readonly rowKey?: string | number;\n readonly messageKey?: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n }\n | {\n readonly kind: 'screen';\n readonly screenId: string;\n readonly messageKey?: string;\n }\n | {\n /**\n * A block-severity gate, or one of its items, that did not decide.\n *\n * The gate's own *surface* verdict stays `BLOCKED` for an undecided status\n * (`gateOutcome`), because `evaluateGate` has no undecided arm by design. Readiness is the\n * place the distinction belongs: an undecided gate is not a cause the respondent got\n * wrong, so it is listed here rather than in `blockers`. `itemId` is present when one\n * item could not be decided, and absent when the gate's own expression could not.\n */\n readonly kind: 'gate';\n readonly gateId: string;\n readonly itemId?: string;\n }\n | {\n /**\n * A held option code whose availability condition decided neither way, `RULES-7.1.1`.\n *\n * It is an open question rather than a failure: the record may not submit while the device\n * cannot say whether the code it holds may be used, and `cause` says whether a server\n * handoff or an unanswered read left it undecided. A code the record does not hold is not a\n * check, and an unavailable held code is a decided blocker instead (`RULES-7.1.6`).\n */\n readonly kind: 'unavailableOption';\n readonly fieldId: string;\n readonly rowKey?: string | number;\n readonly code: string | number;\n /** The label key the declaration or the loaded page states for the code, when it states one. */\n readonly labelKey?: string;\n readonly cause: 'deferred' | 'unknown';\n };\n\n/**\n * One block-severity check the overlay skipped, `RULES-2.1.1`.\n *\n * A check whose only undecided cause is a read this device may not perform is not an open\n * question and is not a pass: no respondent action decides it, so readiness leaves it out of\n * both lists. A host that paints the report's rule results must leave it out too, which is why\n * the classification travels here rather than being re-derived from the report's `UNKNOWN`.\n */\nexport type FormSkippedCheck =\n | {\n readonly kind: 'rule';\n readonly ruleId: string;\n readonly fieldId?: string;\n readonly rowKey?: string | number;\n }\n | { readonly kind: 'screen'; readonly screenId: string }\n | { readonly kind: 'gate'; readonly gateId: string; readonly itemId?: string };\n\n/**\n * A computed value the engine could not decide.\n *\n * It is stated for the host and never refuses a submission: a writer is not a check the\n * respondent can satisfy, and `RULES-2.1.7` says an undetermined computation writes `null` and\n * reports its status rather than a substituted value. An author who needs the total to be a\n * requirement declares `required` on it, which then answers `undetermined` here.\n */\nexport interface FormUndeterminedComputation {\n readonly fieldId: string;\n readonly rowKey?: string | number;\n}\n\n/**\n * One thing that stops a submission.\n *\n * Only a decided `FAIL` is a rule blocker: a `DEFERRED` server check is a handoff, not a\n * refusal, and `ready` can be true while `hasDeferredChecks` reports one. A missing required\n * value is the exception to \"a blocker is a rule failure\": the rule's condition fired, so its\n * result is `PASS`, and the failure is the field's `missingRequired`. It carries its own kind\n * and the binding it names, so a summary can attribute the refusal to a control instead of\n * reading a second list of keys.\n */\nexport type FormBlocker =\n | {\n readonly kind: 'rule';\n readonly ruleId: string;\n readonly fieldId?: string;\n readonly rowKey?: string | number;\n readonly messageKey: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n /**\n * The alternatives the failing rule offers, `RULES-6.1.3`.\n *\n * They are the ones the report's result for this failure carries, so a host that paints a\n * blocker can offer what applying would clear it with. Absent when the artifact declares\n * none, when the rule did not fail, and when every alternative named a target or read a\n * value the access boundary withholds: a disabled stub is still an answer about a value the\n * reader may not see. The engine applies none of them; the write guard stays authoritative.\n */\n readonly suggestions?: readonly EvaluatedSuggestion[];\n }\n | {\n readonly kind: 'required';\n /**\n * The field the requirement names; a container's own requirement names the container.\n *\n * There is deliberately no `ruleId`: a requirement blocks because its condition decided\n * `PASS` and presence did not, so no rule failed to name (`RULES-2.1.5`). Several rules\n * may hold one field's requirement at once and the derivation folds them into one answer,\n * so a single id here would attribute the gap to a rule that did not decide it. The\n * binding is the identity a caller can act on.\n */\n readonly fieldId: string;\n /** The row whose member is missing, when the requirement is one row's. */\n readonly rowKey?: string | number;\n /**\n * The row's own name, when its key is one the reader can see.\n *\n * A natural or value key is authored text, so it is the name a sentence may use. A key the\n * host minted addresses the row and names nothing, and is omitted here rather than printed.\n * The decision is made once, where the declaration's addressing is known, so no renderer\n * inspects a key's spelling.\n */\n readonly rowName?: string;\n /**\n * The sentence a `required` rule declared, when it declared one. A missing required\n * value has no message by design — the host writes the sentence — so this is absent\n * unless the artifact itself supplied one.\n */\n readonly messageKey?: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n }\n | {\n readonly kind: 'gate';\n readonly gateId: string;\n readonly itemId: string;\n readonly messageKey: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n }\n | {\n /**\n * An array whose entry count is outside its declared range, `MODEL-2.1.17`.\n *\n * It is a decided blocker with no artifact message: the host writes the sentence, as it\n * does for a missing required value. The count and the limit are stated so the sentence\n * can name both without re-reading the record.\n */\n readonly kind: 'cardinality';\n readonly fieldId: string;\n readonly bound: 'minItems' | 'maxItems';\n readonly count: number;\n readonly limit: number;\n }\n | {\n /**\n * A `decimal` value whose canonical text carries more fractional digits than its\n * declared bound, `MODEL-2.1.27`.\n *\n * It is a decided blocker with the sentence the declaration required, because the fact\n * is not a rule: there is no `validate` result to name, so the artifact carries\n * `maxScaleMessageKey` and this blocker states it. `value` is the canonical decimal text,\n * `scale` the fractional digits it carries, and `limit` the declared bound.\n */\n readonly kind: 'scale';\n readonly fieldId: string;\n readonly member: 'maxScale';\n readonly limit: number;\n readonly scale: number;\n readonly value: string;\n readonly messageKey?: string;\n readonly rowKey?: string | number;\n }\n | {\n /**\n * A captured media value that violates a declared constraint, `MODEL-2.1.20`.\n *\n * Like a count, it is a decided fact with no artifact message: the host writes the\n * sentence. The limit and the offending value are stated so the sentence can name both\n * without re-reading the record: the admitted media types, or the byte bound, and the\n * captured `mime` or `byteSize`. `index` names the element of an array field, and\n * `rowKey` names the row when the capture is an array member.\n */\n readonly kind: 'media';\n readonly fieldId: string;\n readonly member: 'accept';\n readonly limit: readonly string[];\n readonly value: string;\n readonly index?: number;\n readonly rowKey?: string | number;\n }\n | {\n readonly kind: 'media';\n readonly fieldId: string;\n readonly member: 'minBytes' | 'maxBytes';\n readonly limit: number;\n readonly value: number;\n readonly index?: number;\n readonly rowKey?: string | number;\n }\n | {\n /**\n * An array whose declared `rowsFrom` expected count differs from its length, or whose\n * count expression refuses (`MODEL-2.1.22`).\n *\n * Like a count bound it is a decided fact with no artifact message: the host writes the\n * sentence. `source` is the authored expression, so a host can say \"three names, three\n * rows\"; `reason` is present when the count itself was refused rather than merely\n * different, and `ceiling` names the admitted maximum.\n */\n readonly kind: 'rowCount';\n readonly fieldId: string;\n readonly expected: number;\n readonly actual: number;\n readonly source: string;\n readonly reason?: 'integer' | 'negative' | 'ceiling';\n readonly ceiling?: number;\n }\n | {\n /**\n * A held value the field's declaration refuses, `[DATA-5.1.3]`, `[ENGINE-7.1.5]`.\n *\n * A closed option domain refuses a stale selection; a wire declaration refuses a value\n * whose shape or declared domain it does not admit (a money scale, a quantity unit). It is\n * a decided refusal with no artifact message — a stale option code after a domain change,\n * or a stored value no reader can admit — so the host writes the sentence. `value` is the\n * canonical held value when the refusing domain left one to state; a wire refusal has none,\n * because the declaration rejected it, and `path` names the member the reader refused.\n * `rowKey` names the row when the value lives in an array member.\n */\n readonly kind: 'invalidOption';\n readonly fieldId: string;\n readonly value?: WireValue;\n readonly path?: string;\n readonly rowKey?: string | number;\n }\n | {\n /**\n * A block-severity screen that decided the record needs a human, `RULES-2.1.3`.\n *\n * `SCREEN_FAIL` and `SCREEN_REFER` are both refusals; the outcome and the reasons are\n * stated so the host can name the rule and its causes without reading the screen report\n * again. A screen that merely decided `SCREEN_PASS`, or could not decide at all, is not a\n * blocker.\n */\n readonly kind: 'screen';\n readonly screenId: string;\n readonly outcome: 'SCREEN_FAIL' | 'SCREEN_REFER';\n readonly messageKey?: string;\n readonly reasons: readonly ScreenReason[];\n }\n | {\n /**\n * A held option code the domain offers and this record may not choose, `RULES-7.1.6`.\n *\n * It is a decided local failure, exactly as `invalidOption` is, so the form is `BLOCKED`\n * and never `UNDETERMINED` on this count. `code` names the held code, and `rowKey` names the\n * row when the field is a record-array member. `messageKey` and `params` carry the sentence\n * the declaration or the host page stated; a host that supplies none writes its own, as it\n * does for a missing required value. `suggestions` are the alternatives the option offers\n * for the held code (`RULES-7.1.4`), already evaluated and access-filtered; the engine\n * applies none of them. The held value itself is never cleared or replaced.\n */\n readonly kind: 'unavailableOption';\n readonly fieldId: string;\n readonly rowKey?: string | number;\n readonly code: string | number;\n readonly messageKey?: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n readonly suggestions?: readonly EvaluatedSuggestion[];\n };\n\n/**\n * The one verdict a host gates a submission on.\n *\n * `SUBMIT` means this device found nothing blocking and nothing undecided; it is still a local\n * proposal, and a `hasDeferredChecks` record is a handoff the server must settle. `BLOCKED`\n * means at least one thing this device *can* see is decided against the record, and the\n * blockers name it. `UNDETERMINED` means nothing decided is wrong, but at least one\n * block-severity check could not be decided: the form is undecided, not wrong, and\n * `undeterminedChecks` names every open question. The report's own status, a gate's `OPEN`\n * badge and local readiness are all *inputs* to this fold, never separate answers a host has\n * to combine.\n */\nexport type SubmissionVerdict = 'SUBMIT' | 'BLOCKED' | 'UNDETERMINED';\n\n/**\n * The readiness facts a host gates on, stated apart from the report's `status`.\n *\n * It is the subset of `FormState` an admission decision reads: the verdict, the decided blockers,\n * the open checks and whether a server handoff remains. `evaluate()` states it beside the sealed\n * report as `readiness`; `submissionVerdict()` states the same answer as its `outcome` and `form`.\n * `status` is the rules fold and is never this answer.\n */\nexport interface Readiness {\n readonly verdict: SubmissionVerdict;\n readonly ready: boolean;\n readonly blockers: readonly FormBlocker[];\n readonly undeterminedChecks: readonly FormUndeterminedCheck[];\n /** Every check the access answer skipped, so a host never paints one as passed or failed. */\n readonly skippedChecks: readonly FormSkippedCheck[];\n readonly hasDeferredChecks: boolean;\n}\n\n/** The readiness answer, distinct from the report's own folded status. */\ninterface FormReadiness {\n readonly gates: readonly FormGateState[];\n readonly screens: readonly FormScreenState[];\n readonly blockers: readonly FormBlocker[];\n /**\n * Whether the local readiness fold is clean. It is not `report.status`: a hidden field's\n * branch folds into nothing (`RULES-1.1.5`), and a `validate` rule that fails on a hidden\n * field folds there while leaving nothing for a caller to fix (`RULES-2.1.10`).\n *\n * It is a *fact*, not permission. A host gates on `verdict`; `ready` is the local half of\n * that verdict and is stated here so a control can explain it. It is true exactly when\n * `verdict` is `SUBMIT`, so a deferred handoff leaves it true.\n */\n readonly ready: boolean;\n /** Whether a server-tier decision remains, so `SUBMIT` is a handoff rather than a finish. */\n readonly hasDeferredChecks: boolean;\n /**\n * Every block-severity check the device could not decide, in declaration order.\n *\n * The list is the reason an `UNDETERMINED` verdict is not a `SUBMIT`: a host reads it to say\n * which question is open. It is not a second flag beside `verdict`; `hasUndeterminedChecks`\n * exists only because a form can be `BLOCKED` and undecided at once.\n */\n readonly undeterminedChecks: readonly FormUndeterminedCheck[];\n readonly hasUndeterminedChecks: boolean;\n /**\n * Every check the access answer skipped, in declaration order, `RULES-2.1.1`.\n *\n * It is neither a blocker nor an open question: the report keeps stating `UNKNOWN` for the\n * access-denied read, and this is the readiness classification a host reads to leave the check\n * out of a painted result list rather than counting it as unanswered.\n */\n readonly skippedChecks: readonly FormSkippedCheck[];\n /** Every computed value the engine could not decide. Informational, never a refusal. */\n readonly undeterminedComputations: readonly FormUndeterminedComputation[];\n /** The one verdict a host branches on: `SUBMIT` when nothing local blocks or is undecided. */\n readonly verdict: SubmissionVerdict;\n}\n\n/**\n * The block-severity diagnostics one report states, indexed by rule and canonical row-key token.\n *\n * Readiness asks whether one result carries a block diagnostic, once per result. Scanning that\n * rule's diagnostic list for each result made an item rule that emits one diagnostic per row\n * O(rows²), so the index answers the same question in a map hit. The row-less flag is the\n * diagnostic that belongs to the whole rule and reaches every result it stated; a row token keeps\n * the integer `1` and the text `\"1\"` two rows.\n */\ninterface RuleDiagnostics {\n /** A block diagnostic with no row: it belongs to the whole rule. */\n blockRowless: boolean;\n /** A row-less `ENGINE_ERROR`: the decision itself raised for the whole rule. */\n engineRowless: boolean;\n /** Rows a block diagnostic names. */\n readonly blockRows: Set<string>;\n /** Rows an `ENGINE_ERROR` diagnostic names. */\n readonly engineRows: Set<string>;\n}\n\ntype DiagnosticIndex = ReadonlyMap<string, RuleDiagnostics>;\n\nfunction indexDiagnostics(snapshot: FormSnapshot): DiagnosticIndex {\n const index = new Map<string, RuleDiagnostics>();\n for (const diagnostic of snapshot.report.diagnostics ?? []) {\n const ruleId = diagnostic.ruleId;\n if (ruleId === undefined || diagnostic.severity !== 'block') continue;\n let entry = index.get(ruleId);\n if (entry === undefined) {\n entry = {\n blockRowless: false,\n engineRowless: false,\n blockRows: new Set(),\n engineRows: new Set(),\n };\n index.set(ruleId, entry);\n }\n const engine = diagnostic.code === 'ENGINE_ERROR';\n if (diagnostic.rowKey === undefined) {\n entry.blockRowless = true;\n if (engine) entry.engineRowless = true;\n continue;\n }\n const token = rowKeyToken(diagnostic.rowKey);\n entry.blockRows.add(token);\n if (engine) entry.engineRows.add(token);\n }\n return index;\n}\n\n/**\n * Whether one result carries a block-severity diagnostic, which makes it a decided refusal.\n *\n * A row-scoped diagnostic names its row, so one row's `ENGINE_ERROR` does not turn another\n * row's undecided answer into a failure. A diagnostic with no row belongs to the whole rule and\n * reaches every result it stated.\n */\nfunction engineFailed(\n diagnostics: DiagnosticIndex,\n ruleId: string,\n rowKey: string | number | undefined,\n): boolean {\n const entry = diagnostics.get(ruleId);\n if (entry === undefined) return false;\n if (entry.blockRowless) return true;\n return rowKey !== undefined && entry.blockRows.has(rowKeyToken(rowKey));\n}\n\n/**\n * Whether the engine itself failed on `ruleId`, rather than stating a decided diagnostic such\n * as `ROW_IDENTITY`. A branch rule (`visible`, `required`, `enabled`) that raised decided\n * nothing, so the branch it guards is unknown and the record is not admissible; a branch rule\n * answered with any other block diagnostic is the open question the readiness fold states.\n */\nfunction engineErrorFailed(\n diagnostics: DiagnosticIndex,\n ruleId: string,\n rowKey: string | number | undefined,\n): boolean {\n const entry = diagnostics.get(ruleId);\n if (entry === undefined) return false;\n if (entry.engineRowless) return true;\n return rowKey !== undefined && entry.engineRows.has(rowKeyToken(rowKey));\n}\n\n/**\n * Every result one rule stated, in report order: one per addressed row plus a row-less answer\n * when the rule could not address its rows at all.\n *\n * A rule's report is per row, so a question about \"the rule\" has one answer per row. Reading\n * `firstResult`/`firstUndecided` for an item rule collapsed every row after the first into it: a\n * host painting one line per blocker then left the report's other diagnostics unattached.\n */\nfunction resultsOf(rules: DerivedRules, ruleId: string): readonly RuleResult[] {\n const results = [...(rules.rowResults.get(ruleId)?.values() ?? [])];\n const rowless = rules.rowlessResults.get(ruleId);\n if (rowless !== undefined) results.push(rowless);\n return results;\n}\n\n/**\n * Derives the gates, screens, blockers and the readiness predicate from one snapshot.\n *\n * `rules` is the derivation's one index of the report, so a rule's own answer is a map hit: the\n * report states one result per rule — and one per row for an item rule — and looking each rule's\n * answer up with a scan of that list, once per compiled rule, made this pass the rules squared.\n */\nexport function deriveReadiness(\n compiled: CompiledSchema,\n snapshot: FormSnapshot,\n fields: readonly FormFieldState[],\n rules: DerivedRules,\n options: FormStateOptions,\n): FormReadiness {\n const diagnostics = indexDiagnostics(snapshot);\n const fieldsById = new Map(fields.map((field) => [field.fieldId, field] as const));\n const addressing = addressingByField(compiled);\n const gates = deriveGates(compiled, snapshot, rules);\n const screens = deriveScreens(compiled, snapshot);\n // A held code's availability is one fact with two answers: an unavailable code blocks, and an\n // undetermined one is an open question. Both are read in one pass so the two lists cannot\n // disagree about what the record holds.\n const availability = heldAvailability(fields, snapshot, options);\n const blockers = deriveBlockers(\n compiled,\n fields,\n fieldsById,\n gates,\n screens,\n rules,\n diagnostics,\n addressing,\n availability.blockers,\n );\n const hasDeferredChecks =\n rules.hasDeferred ||\n hasDeferredRequirement(fields) ||\n gates.some(\n (gate) =>\n // A settled gate (switched off or approved) contributes nothing. Any `DEFERRED` item on\n // an in-force gate is a handoff, whatever the gate's own severity: a `warn` gate still\n // reports a server check the server must settle, and its items decided the fact.\n gate.outcome !== 'INACTIVE' &&\n gate.outcome !== 'OVERRIDDEN' &&\n gate.items.some((item) => item.status === 'DEFERRED'),\n ) ||\n screens.some((screen) => screen.severity === 'block' && screen.outcome === 'DEFERRED');\n const { checks: undeterminedChecks, skipped: skippedChecks } = deriveUndeterminedChecks(\n compiled,\n snapshot,\n fields,\n fieldsById,\n gates,\n rules,\n diagnostics,\n availability.checks,\n );\n const undeterminedComputations = deriveUndeterminedComputations(fields);\n // Every cause that makes the verdict `BLOCKED` names itself in `blockers`: a rule failure, a\n // missing requirement, a *decided* gate item, an array bound, a media constraint, a row-count\n // mismatch, a scale violation, a refused or unavailable option value and a failed screen. A\n // gate item that did not decide is\n // not one of those — it is an open question, stated in `undeterminedChecks` — so a host that\n // renders \"why can I not submit\" never reads an empty list beside `BLOCKED`. (`evaluateGate`\n // still answers `BLOCKED` for the same gate: its surface has no undecided arm by design.)\n const blocked = blockers.length > 0;\n const undetermined = undeterminedChecks.length > 0;\n const ready = !blocked && !undetermined;\n return {\n gates,\n screens,\n blockers,\n ready,\n hasDeferredChecks,\n undeterminedChecks,\n hasUndeterminedChecks: undetermined,\n skippedChecks,\n undeterminedComputations,\n // The one verdict, in precedence order: a decided refusal is what the respondent can act on,\n // so it outranks an open question. A gate that blocks contributes a blocker above, so a\n // record can never be `SUBMIT` with a blocking gate; a deferred check is a handoff, not a\n // block, and `hasDeferredChecks` says so.\n verdict: blocked ? 'BLOCKED' : undetermined ? 'UNDETERMINED' : 'SUBMIT',\n };\n}\n\n/**\n * Whether a visible requirement is the server's to settle rather than the respondent's.\n *\n * A field the server redacted states `deferred` at its binding, or in each row that holds the\n * value. It is not a blocker and not an open question: it is a handoff, and the answer leaves\n * local readiness clean while `hasDeferredChecks` says the server still has to settle it.\n */\nfunction hasDeferredRequirement(fields: readonly FormFieldState[]): boolean {\n return fields.some(\n (field) =>\n field.visible &&\n (field.missingRequired === 'deferred' ||\n (field.rows ?? []).some((row) => row.missingRequired === 'deferred')),\n );\n}\n\n/**\n * Every block-severity check this device could not decide, in declaration order.\n *\n * Five sources, one answer:\n *\n * - a `validate` left `UNKNOWN` with no `block` diagnostic is the silent skip `RULES-2.1.1`\n * used to describe. It emits no violation, but it is not a pass either, and a record that\n * could not answer \"at least one row\" must not submit as though it had. A result whose only\n * undecided cause is a read this device may not perform is skipped instead: no respondent\n * action decides it, so it is not an open question and the verdict stays `SUBMIT`;\n * - a `required` rule that fired whose presence could not be confirmed: the field's\n * `missingRequired` is `undetermined`, which is neither a gap nor a satisfied value (a\n * server-redacted presence is `deferred`, a handoff stated by `hasDeferredChecks`);\n * - a block-severity `screen` whose outcome is `UNKNOWN`, unless only a refused read left it so;\n * - a block-severity gate, or one of its items, that did not decide. The gate's surface verdict\n * stays `BLOCKED` for that status, but readiness states the open question rather than a\n * cause the respondent got wrong;\n * - a held option whose availability is undetermined, naming its field, row, code and cause.\n *\n * An engine error is excluded: the rule raised, so it is a decided refusal with a cause and\n * `undecidedBlockers` (or the row facts) already states it. A hidden field is excluded for the\n * same reason a blocker is: the respondent cannot correct a control that is not on screen.\n * A `DEFERRED` result is a server handoff and is reported by `hasDeferredChecks`, not here.\n */\nfunction deriveUndeterminedChecks(\n compiled: CompiledSchema,\n snapshot: FormSnapshot,\n fields: readonly FormFieldState[],\n fieldsById: ReadonlyMap<string, FormFieldState>,\n gates: readonly FormGateState[],\n rules: DerivedRules,\n diagnostics: DiagnosticIndex,\n availability: readonly FormUndeterminedCheck[],\n): {\n readonly checks: readonly FormUndeterminedCheck[];\n readonly skipped: readonly FormSkippedCheck[];\n} {\n const checks: FormUndeterminedCheck[] = [];\n const skipped: FormSkippedCheck[] = [];\n for (const rule of compiled.rules ?? []) {\n if (rule.kind === 'screen') {\n // A screen with no report section states no decision, exactly as `deriveScreens` reads it.\n const outcome = snapshot.report.screens?.[rule.ruleId]?.outcome ?? 'UNKNOWN';\n if ((rule.severity ?? 'block') !== 'block' || outcome !== 'UNKNOWN') continue;\n // A screen whose only undecided cause is a refused read is not an open question for the\n // respondent: `screenStatus` states the rule's verdict, and the cause is the client's.\n const screenResult = rules.firstResult.get(rule.ruleId);\n if (\n screenResult !== undefined &&\n rules.undecided.dispositionOf(rule.ruleId, screenResult) === 'skipped'\n ) {\n skipped.push({ kind: 'screen', screenId: rule.ruleId });\n continue;\n }\n checks.push({\n kind: 'screen',\n screenId: rule.ruleId,\n ...(rule.messageKey === undefined ? {} : { messageKey: rule.messageKey }),\n });\n continue;\n }\n if (rule.kind !== 'validate') continue;\n const fieldId = rule.targetFieldId ?? rule.fieldId;\n if (hiddenField(fieldsById, fieldId)) continue;\n if (rule.scope === 'item') {\n // One open question per row the rule could not decide. A row whose own engine error\n // already makes it a blocker is not also an undetermined check.\n for (const result of resultsOf(rules, rule.ruleId)) {\n if (result.severity !== 'block' || result.status !== 'UNKNOWN') continue;\n if (engineFailed(diagnostics, rule.ruleId, result.rowKey)) continue;\n if (rules.undecided.dispositionOf(rule.ruleId, result) === 'skipped') {\n skipped.push({\n kind: 'rule',\n ruleId: result.ruleId,\n ...(fieldId === undefined ? {} : { fieldId }),\n ...(result.rowKey === undefined ? {} : { rowKey: result.rowKey }),\n });\n continue;\n }\n checks.push({\n kind: 'rule',\n ruleId: result.ruleId,\n ...(fieldId === undefined ? {} : { fieldId }),\n ...(result.rowKey === undefined ? {} : { rowKey: result.rowKey }),\n ...requiredMessage(result.messageKey ?? rule.messageKey, result.params),\n });\n }\n continue;\n }\n const undecided = rules.firstUndecided.get(rule.ruleId);\n if (undecided === undefined) continue;\n if (engineFailed(diagnostics, rule.ruleId, undecided.rowKey)) continue;\n if (rules.undecided.dispositionOf(rule.ruleId, undecided) === 'skipped') {\n skipped.push({\n kind: 'rule',\n ruleId: undecided.ruleId,\n ...(fieldId === undefined ? {} : { fieldId }),\n ...(undecided.rowKey === undefined ? {} : { rowKey: undecided.rowKey }),\n });\n continue;\n }\n checks.push({\n kind: 'rule',\n ruleId: undecided.ruleId,\n ...(fieldId === undefined ? {} : { fieldId }),\n ...(undecided.rowKey === undefined ? {} : { rowKey: undecided.rowKey }),\n ...requiredMessage(undecided.messageKey ?? rule.messageKey, undecided.params),\n });\n }\n const requirementRules = undeterminedRequirementRules(\n compiled,\n snapshot,\n fieldsById,\n rules,\n diagnostics,\n );\n checks.push(...requirementRules.checks);\n skipped.push(...requirementRules.skipped);\n checks.push(...undeterminedRequirements(fields));\n const gateChecks = undeterminedGates(gates, rules.undecided);\n checks.push(...gateChecks.checks);\n skipped.push(...gateChecks.skipped);\n checks.push(...availability);\n return { checks, skipped };\n}\n\n/**\n * The blockers and open questions the codes this record holds state, `RULES-7.1.6` and\n * `ENGINE-7.1.7`.\n *\n * One pass over every visible binding, so the two lists cannot disagree about what is held. A\n * declared code's answer comes from the evaluation that decided it, and a host page's answer is\n * taken as given and matched by the value the page holds. An unheld unavailable code blocks\n * nothing: it is a fact of the domain, stated on the field's `unavailableOptions`, not a failure\n * of this record.\n *\n * A hidden field contributes nothing, exactly as it contributes no other blocker: the respondent\n * cannot correct a control the page does not paint.\n */\nfunction heldAvailability(\n fields: readonly FormFieldState[],\n snapshot: FormSnapshot,\n options: FormStateOptions,\n): {\n readonly blockers: readonly FormBlocker[];\n readonly checks: readonly FormUndeterminedCheck[];\n} {\n const found: HeldAvailability = { snapshot, options, blockers: [], checks: [] };\n for (const field of fields) {\n if (!field.visible) continue;\n // A row member's domain is keyed by its row, including a member whose own value is a\n // multi-select array. A top-level container's domain is keyed by the field instead, so its\n // row lookups find no entry and the field-level read below states its selection once.\n for (const row of field.rows ?? []) readHeldBinding(found, field, row.rowKey, row.value);\n readHeldBinding(found, field, undefined, field.value);\n }\n return { blockers: found.blockers, checks: found.checks };\n}\n\n/** The lists one readiness pass is filling, with the inputs a binding's answer is read from. */\ninterface HeldAvailability {\n readonly snapshot: FormSnapshot;\n readonly options: FormStateOptions;\n readonly blockers: FormBlocker[];\n readonly checks: FormUndeterminedCheck[];\n}\n\n/**\n * The name a row is shown by, when its key is one the reader can see.\n *\n * A natural key is the value of the declaration's key member and a value key is the item itself:\n * both are authored text, so both are the row's name. A key the host minted addresses the row and\n * names nothing a person recognises. This is the one place that decision is made; a sentence\n * receives the answer and never inspects the key's spelling.\n */\nfunction rowNameOf(\n rowKey: string | number,\n addressing: RowAddressing | undefined,\n): string | undefined {\n return addressing === 'natural' || addressing === 'value' ? String(rowKey) : undefined;\n}\n\n/**\n * The addressing every field inherits, walked once from the declarations.\n *\n * An array states how its own rows are named, and each member of that array is a row of it, so a\n * member inherits the array's answer. A nested array addresses nothing in v1, and so do its\n * members. Readiness turns this into a row name once, rather than making every renderer decide\n * whether a key looks generated.\n */\nfunction addressingByField(compiled: CompiledSchema): ReadonlyMap<string, RowAddressing> {\n const addressing = new Map<string, RowAddressing>();\n const visit = (\n fields: readonly CompiledField[],\n enclosing: RowAddressing | undefined,\n insideArray: boolean,\n ): void => {\n for (const field of fields) {\n const isArray = field.primitive === 'array';\n const declared: RowAddressing | undefined = isArray\n ? insideArray\n ? 'unsupported'\n : (field.rowKey?.mode ?? (field.items === undefined ? undefined : 'value'))\n : enclosing;\n if (declared !== undefined) addressing.set(field.fieldId, declared);\n if (field.fields !== undefined) {\n visit(field.fields, isArray ? declared : enclosing, insideArray || isArray);\n }\n }\n };\n visit(compiled.fields, undefined, false);\n return addressing;\n}\n\n/**\n * One binding's held codes, as the blocker or the open question each of them states.\n *\n * A declared code's answer is the one the evaluation decided. A host page's answer is taken as\n * given and matched by the value the page holds, because the engine evaluates no declaration for\n * a code it does not know (`RULES-7.1.5`).\n */\nfunction readHeldBinding(\n found: HeldAvailability,\n field: FormFieldState,\n rowKey: string | number | undefined,\n value: ValueState,\n): void {\n const key = fieldKey(\n rowKey === undefined ? { fieldId: field.fieldId } : { fieldId: field.fieldId, rowKey },\n );\n const at = rowKey === undefined ? {} : { rowKey };\n for (const answer of found.snapshot.optionAvailability.get(key)?.held ?? []) {\n if (answer.kind === 'undetermined') {\n const labelKey = field.options?.find((option) => option.code === answer.code)?.labelKey;\n found.checks.push({\n kind: 'unavailableOption',\n fieldId: field.fieldId,\n ...at,\n code: answer.code,\n ...(labelKey === undefined ? {} : { labelKey }),\n cause: answer.cause,\n });\n continue;\n }\n found.blockers.push({\n kind: 'unavailableOption',\n fieldId: field.fieldId,\n ...at,\n code: answer.code,\n ...(answer.messageKey === undefined ? {} : { messageKey: answer.messageKey }),\n ...(answer.params === undefined ? {} : { params: answer.params }),\n ...(answer.suggestions === undefined ? {} : { suggestions: answer.suggestions }),\n });\n }\n if (field.optionSource?.kind !== 'host') return;\n const held = heldValuesOf(value);\n if (held.length === 0) return;\n for (const item of hostUnavailableItems(found.options.optionDomains?.get(key))) {\n if (!holdsItem(item, held)) continue;\n const code = hostOptionCode(item);\n if (code === undefined) continue;\n found.blockers.push({\n kind: 'unavailableOption',\n fieldId: field.fieldId,\n ...at,\n code,\n ...(item.unavailableMessageKey === undefined\n ? {}\n : { messageKey: item.unavailableMessageKey }),\n ...(item.unavailableParams === undefined ? {} : { params: item.unavailableParams }),\n });\n }\n}\n\n/**\n * The gates and gate items that could not decide, `[RULES-4.1.1]`.\n *\n * An inactive gate requires nothing, a deferred one is the server's handoff and an approved one\n * was settled by its override, so none of those is an open question. An item that could not be\n * decided is the more specific question and is stated per item; a gate whose own expression did\n * not decide, with no undecided item, is stated once without an `itemId`. A gate whose status is\n * `UNKNOWN` is `BLOCKED` on its surface verdict (`gateOutcome`), which is right there and must\n * not be restated here as a failure.\n */\nfunction undeterminedGates(\n gates: readonly FormGateState[],\n causes: UndecidedCauses,\n): {\n readonly checks: readonly FormUndeterminedCheck[];\n readonly skipped: readonly FormSkippedCheck[];\n} {\n const checks: FormUndeterminedCheck[] = [];\n const skipped: FormSkippedCheck[] = [];\n for (const gate of gates) {\n if (gate.severity !== 'block') continue;\n if (gate.outcome === 'INACTIVE' || gate.outcome === 'OVERRIDDEN') continue;\n const cause = causes.causeOf(gate.gateId, undefined);\n const failed = cause?.engineError === true;\n // The read-only policy answers only the access part of a mixed outcome. A readable gap or an\n // engine error still leaves its own open question when the policy made the report DEFERRED.\n if (gate.outcome === 'DEFERRED' && !cause?.missingInput && !failed) continue;\n const items = gate.items.filter((item) => item.status === 'UNKNOWN');\n const record = (): void => {\n if (items.length > 0) {\n for (const item of items) {\n checks.push({ kind: 'gate', gateId: gate.gateId, itemId: item.itemId });\n }\n return;\n }\n if (gate.status === 'UNKNOWN') checks.push({ kind: 'gate', gateId: gate.gateId });\n };\n // A gate whose own reads were only refused already answered through its `onReadOnlyError`\n // policy (`[ACCESS-6.1.2]`): the refusal is the client's limitation, not an open question for\n // the respondent, so a `warn` gate opens without leaving a check behind it.\n if (cause?.refused === true && !cause.missingInput && !failed) {\n if (items.length > 0) {\n for (const item of items) {\n skipped.push({ kind: 'gate', gateId: gate.gateId, itemId: item.itemId });\n }\n } else if (gate.status === 'UNKNOWN') {\n skipped.push({ kind: 'gate', gateId: gate.gateId });\n }\n continue;\n }\n record();\n }\n return { checks, skipped };\n}\n\n/**\n * The requirements whose own condition never decided, at the field or in one row.\n *\n * `undeterminedRequirements` reads a requirement that *holds* and whose presence is unknown.\n * This states the other open question: a `required` rule left `UNKNOWN`, which means the device\n * cannot say whether the field is required at all (`RULES-2.1.5`). A row that could not be\n * addressed answers once against its member; a duplicate natural key answers once per offending\n * row, carrying the key the record states (`IDENT-2.1.9`). `DEFERRED` is excluded: on the client\n * it is optional, not undecided, and `hasDeferredChecks` already states it.\n */\nfunction undeterminedRequirementRules(\n compiled: CompiledSchema,\n snapshot: FormSnapshot,\n fieldsById: ReadonlyMap<string, FormFieldState>,\n rules: DerivedRules,\n diagnostics: DiagnosticIndex,\n): {\n readonly checks: readonly FormUndeterminedCheck[];\n readonly skipped: readonly FormSkippedCheck[];\n} {\n const checks: FormUndeterminedCheck[] = [];\n const skipped: FormSkippedCheck[] = [];\n for (const rule of compiled.rules ?? []) {\n if (rule.kind !== 'required') continue;\n const fieldId = rule.targetFieldId ?? rule.fieldId;\n if (fieldId === undefined) continue;\n if (hiddenField(fieldsById, fieldId)) continue;\n const stated = new Set<string>();\n const results = [...(rules.rowResults.get(rule.ruleId)?.values() ?? [])];\n const rowless = rules.rowlessResults.get(rule.ruleId);\n if (rowless !== undefined) results.push(rowless);\n for (const result of results) {\n // Only a block-severity check refuses a submission; an author who declared a requirement\n // `warn` opted out of that, exactly as `undecidedBlockers` reads a validate (`RULES-1.1.5`).\n if (result.severity !== 'block' || result.status !== 'UNKNOWN') continue;\n // A requirement whose own condition raised is a decided refusal, stated by\n // `undecidedBlockers`; it is not an open question the respondent can answer. Any other\n // block diagnostic (`ROW_IDENTITY`) is the open question this fold states.\n if (engineErrorFailed(diagnostics, rule.ruleId, result.rowKey)) continue;\n // A condition whose only undecided cause is a refused read cannot be settled by any\n // respondent action, so it holds nobody to the requirement (`RULES-2.1.1`). It is still a\n // declared check a result panel must omit, so the readiness projection names it here.\n if (rules.undecided.dispositionOf(rule.ruleId, result) === 'skipped') {\n skipped.push({\n kind: 'rule',\n ruleId: result.ruleId,\n fieldId,\n ...(result.rowKey === undefined ? {} : { rowKey: result.rowKey }),\n });\n continue;\n }\n // A row key carries its wire type: the integer `1` and the text `\"1\"` name two rows, and\n // `String` folded them into one. A row-less result keeps a token no row key can produce.\n const token = result.rowKey === undefined ? '' : rowKeyToken(result.rowKey);\n if (stated.has(token)) continue;\n stated.add(token);\n checks.push({\n kind: 'required',\n fieldId,\n ...(result.rowKey === undefined ? {} : { rowKey: result.rowKey }),\n ...requiredMessage(result.messageKey ?? rule.messageKey, result.params),\n });\n }\n }\n return { checks, skipped };\n}\n\n/**\n * The visible requirements the device could not decide, at the row or at the field.\n *\n * Only a requirement that *fired* is asked this question: a row's `required` is true when its\n * condition passed, and the field's own requirement holds likewise. A `DEFERRED` condition\n * leaves the requirement optional on this device (`RULES-2.1.5`) and is reported by\n * `hasDeferredChecks`; an `UNKNOWN` condition is the different open question stated above.\n * A requirement whose presence is `undetermined` — a record value its declaration refuses, or a\n * condition that did not decide — is the open question this states. A server-redacted value is\n * `deferred` instead: it is the server's handoff, reported by `hasDeferredChecks`.\n *\n * A row's requirement answers per row, so one undecided row is one open question at that\n * binding; a member's field-level answer is the rows' fold and is therefore not stated twice.\n */\nfunction undeterminedRequirements(\n fields: readonly FormFieldState[],\n): readonly FormUndeterminedCheck[] {\n const checks: FormUndeterminedCheck[] = [];\n for (const field of fields) {\n if (!field.visible) continue;\n let namedRow = false;\n for (const row of field.rows ?? []) {\n if (!row.required || row.missingRequired !== 'undetermined') continue;\n if (row.requiredSeverity !== 'block') continue;\n namedRow = true;\n checks.push({\n kind: 'required',\n fieldId: field.fieldId,\n rowKey: row.rowKey,\n ...requiredMessage(row.requiredMessageKey, row.requiredParams),\n });\n }\n if (namedRow || !field.required || field.missingRequired !== 'undetermined') continue;\n if (field.requiredSeverity !== 'block') continue;\n checks.push({\n kind: 'required',\n fieldId: field.fieldId,\n ...requiredMessage(field.requiredMessageKey, field.requiredParams),\n });\n }\n return checks;\n}\n\n/** Every computed value the engine could not decide, at the field or in one row. */\nfunction deriveUndeterminedComputations(\n fields: readonly FormFieldState[],\n): readonly FormUndeterminedComputation[] {\n const computations: FormUndeterminedComputation[] = [];\n for (const field of fields) {\n if (!field.visible) continue;\n if (field.computation.kind === 'undetermined' && field.computation.status === 'UNKNOWN') {\n computations.push({ fieldId: field.fieldId });\n }\n for (const row of field.rows ?? []) {\n if (row.computation.kind === 'undetermined' && row.computation.status === 'UNKNOWN') {\n computations.push({ fieldId: field.fieldId, rowKey: row.rowKey });\n }\n }\n }\n return computations;\n}\n\n/** Every declared gate, with the verdict its report section and rule status state. */\nfunction deriveGates(\n compiled: CompiledSchema,\n snapshot: FormSnapshot,\n rules: DerivedRules,\n): readonly FormGateState[] {\n const gates: FormGateState[] = [];\n for (const rule of compiled.rules ?? []) {\n if (rule.kind !== 'gate') continue;\n const report = snapshot.report.gates?.[rule.ruleId];\n const status = rules.firstResult.get(rule.ruleId)?.status;\n const active = report === undefined || !('active' in report) || report.active !== false;\n const items = active && report !== undefined && 'items' in report ? report.items : [];\n const overridden =\n report !== undefined && 'overrides' in report && (report.overrides?.length ?? 0) > 0;\n gates.push({\n gateId: rule.ruleId,\n hard: rule.gate.hard,\n severity: rule.severity ?? 'block',\n status: status ?? 'UNKNOWN',\n outcome: !active ? 'INACTIVE' : overridden ? 'OVERRIDDEN' : gateOutcome(status ?? 'UNKNOWN'),\n items,\n });\n }\n return gates;\n}\n\n/** Every declared screen, with the outcome and reasons its report section states. */\nfunction deriveScreens(\n compiled: CompiledSchema,\n snapshot: FormSnapshot,\n): readonly FormScreenState[] {\n const screens: FormScreenState[] = [];\n for (const rule of compiled.rules ?? []) {\n if (rule.kind !== 'screen') continue;\n const report = snapshot.report.screens?.[rule.ruleId];\n screens.push({\n screenId: rule.ruleId,\n severity: rule.severity ?? 'block',\n ...(rule.messageKey === undefined ? {} : { messageKey: rule.messageKey }),\n outcome: report?.outcome ?? 'UNKNOWN',\n reasons: report?.reasons ?? [],\n });\n }\n return screens;\n}\n\n/**\n * The decided block failures of visible fields and rows, the items of a blocked gate, the block\n * rules the engine could not decide, the required values no visible control holds, a held value\n * a closed option domain refuses or currently makes unavailable, a value its declaration refuses,\n * and a block screen that decided against the record.\n */\nfunction deriveBlockers(\n compiled: CompiledSchema,\n fields: readonly FormFieldState[],\n fieldsById: ReadonlyMap<string, FormFieldState>,\n gates: readonly FormGateState[],\n screens: readonly FormScreenState[],\n rules: DerivedRules,\n diagnostics: DiagnosticIndex,\n addressing: ReadonlyMap<string, RowAddressing>,\n availability: readonly FormBlocker[],\n): readonly FormBlocker[] {\n const blockers: FormBlocker[] = [\n ...undecidedBlockers(compiled, fieldsById, rules, diagnostics),\n ...availability,\n ];\n // A field-, record- or array-scope failure is read from the rule that decided it, so a\n // record-scope `validate` that names no field still blocks a submission.\n for (const rule of compiled.rules ?? []) {\n if (rule.scope === 'item') continue;\n if (rule.kind !== 'validate' && rule.kind !== 'compute' && rule.kind !== 'defaultCompute') {\n continue;\n }\n const result = rules.firstResult.get(rule.ruleId);\n if (result === undefined || result.severity !== 'block' || result.status !== 'FAIL') continue;\n const fieldId = rule.fieldId;\n if (hiddenField(fieldsById, fieldId)) continue;\n blockers.push({\n kind: 'rule',\n ruleId: result.ruleId,\n ...(fieldId === undefined ? {} : { fieldId }),\n messageKey: result.messageKey ?? rule.messageKey ?? diagnosticDoc('ENGINE_ERROR').messageKey,\n ...(result.params === undefined ? {} : { params: result.params }),\n ...suggestionsOf(result),\n });\n }\n // A row-scoped failure attaches its diagnostic to the member (a cell error) or to the array\n // (a row-wide violation), so it is read from the row facts rather than the rule result. The\n // same row walk states a decided missing requirement, so a blocker list is one pass over the\n // visible entries whether it answers a rule or the record's presence.\n for (const field of fields) {\n if (!field.visible) continue;\n let namedRow = false;\n for (const row of field.rows ?? []) {\n if (row.required && row.missingRequired === 'missing') {\n namedRow = true;\n // Only a block-severity requirement refuses the submission; a `warn`/`info` rule\n // opted out while still presenting the asterisk (`RULES-1.1.5`).\n if (row.requiredSeverity === 'block') {\n const rowName = rowNameOf(row.rowKey, addressing.get(field.fieldId));\n blockers.push({\n kind: 'required',\n fieldId: field.fieldId,\n rowKey: row.rowKey,\n ...(rowName === undefined ? {} : { rowName }),\n ...requiredMessage(row.requiredMessageKey, row.requiredParams),\n });\n }\n }\n if (row.invalidValue !== undefined) {\n blockers.push({\n kind: 'invalidOption',\n fieldId: field.fieldId,\n value: row.invalidValue,\n rowKey: row.rowKey,\n });\n }\n if (row.media !== undefined) {\n pushMediaViolations(blockers, field.fieldId, row.media, row.rowKey);\n }\n pushScaleBlocker(blockers, field.fieldId, row.decimalScale, row.rowKey);\n for (const message of row.messages) {\n addMessage(blockers, message, field.fieldId, row.rowKey, rules);\n }\n }\n // A member's field-level requirement is the rows' answer, already stated above. Everything\n // else states its requirement at its own binding.\n if (\n !namedRow &&\n field.required &&\n field.missingRequired === 'missing' &&\n field.requiredSeverity === 'block'\n ) {\n blockers.push({\n kind: 'required',\n fieldId: field.fieldId,\n ...requiredMessage(field.requiredMessageKey, field.requiredParams),\n });\n }\n if (field.invalidValue !== undefined) {\n blockers.push({\n kind: 'invalidOption',\n fieldId: field.fieldId,\n value: field.invalidValue,\n });\n }\n }\n blockers.push(...unaddressedItemFailures(compiled, fieldsById, rules));\n for (const field of fields) {\n if (!field.visible) continue;\n const cardinality = field.cardinality;\n if (cardinality?.kind === 'belowMin') {\n blockers.push({\n kind: 'cardinality',\n fieldId: field.fieldId,\n bound: 'minItems',\n count: cardinality.count,\n limit: cardinality.minItems,\n });\n } else if (cardinality?.kind === 'aboveMax') {\n blockers.push({\n kind: 'cardinality',\n fieldId: field.fieldId,\n bound: 'maxItems',\n count: cardinality.count,\n limit: cardinality.maxItems,\n });\n }\n if (field.media?.kind === 'violated') {\n pushMediaViolations(blockers, field.fieldId, field.media);\n }\n pushScaleBlocker(blockers, field.fieldId, field.decimalScale);\n const rowCount = field.rowCount;\n if (rowCount?.kind === 'mismatch' || rowCount?.kind === 'refused') {\n blockers.push({\n kind: 'rowCount',\n fieldId: field.fieldId,\n expected: rowCount.expected,\n actual: rowCount.actual,\n source: rowCount.source,\n ...(rowCount.kind === 'refused' ? { reason: rowCount.reason } : {}),\n ...(rowCount.ceiling === undefined ? {} : { ceiling: rowCount.ceiling }),\n });\n }\n }\n for (const gate of gates) {\n if (gate.severity !== 'block') continue;\n if (gate.outcome !== 'BLOCKED') continue;\n // A gate item that decided `FAIL` is a cause the respondent can act on. An `UNKNOWN` item\n // is not: it is a block-severity check that did not run, and `undeterminedGates` states it\n // as the open question. Reporting it here accused a respondent who had simply not typed a\n // number yet, and made `BLOCKED` mean \"wrong or unfilled\" (`ENGINE-7.1.5`).\n const failed = gate.items.filter((item) => item.status === 'FAIL');\n if (failed.length > 0) {\n for (const item of failed) {\n blockers.push({\n kind: 'gate',\n gateId: gate.gateId,\n itemId: item.itemId,\n messageKey: item.messageKey,\n ...(item.params === undefined ? {} : { params: item.params }),\n });\n }\n continue;\n }\n // No item failed, so the gate's own expression is the cause — and only a decided `FAIL` is\n // a cause. An `UNKNOWN` status has none and is an undetermined check instead.\n if (gate.status === 'FAIL') blockers.push(gateVerdictBlocker(rules, gate.gateId));\n }\n for (const screen of screens) {\n if (screen.severity !== 'block') continue;\n if (screen.outcome !== 'SCREEN_FAIL' && screen.outcome !== 'SCREEN_REFER') continue;\n blockers.push({\n kind: 'screen',\n screenId: screen.screenId,\n outcome: screen.outcome,\n ...(screen.messageKey === undefined ? {} : { messageKey: screen.messageKey }),\n reasons: screen.reasons,\n });\n }\n pushRefusalBlockers(blockers, fields);\n return blockers;\n}\n\n/**\n * Records the values their declaration refuses that no other blocker already names.\n *\n * A rule that reads a refused value already states the failure — the report carries its\n * `ENGINE_ERROR` and the rule blocks — so the derivation's refusal must not add a second cause for\n * one mistake. It is stated only where nothing else blocks that binding, which is the case a host\n * renders when no rule reads the value: the record holds something, the declaration refuses it,\n * and without this the form would look submittable. `path` names the member the reader refused.\n */\nfunction pushRefusalBlockers(blockers: FormBlocker[], fields: readonly FormFieldState[]): void {\n for (const field of fields) {\n if (!field.visible) continue;\n for (const row of field.rows ?? []) {\n if (row.refusal === undefined) continue;\n if (blockedBinding(blockers, field.fieldId, row.rowKey)) continue;\n blockers.push({\n kind: 'invalidOption',\n fieldId: field.fieldId,\n path: row.refusal.path,\n rowKey: row.rowKey,\n });\n }\n if (field.refusal === undefined) continue;\n if (blockedBinding(blockers, field.fieldId, undefined)) continue;\n blockers.push({ kind: 'invalidOption', fieldId: field.fieldId, path: field.refusal.path });\n }\n}\n\n/** Whether a blocker already names this binding as a decided failure. */\nfunction blockedBinding(\n blockers: readonly FormBlocker[],\n fieldId: string,\n rowKey: string | number | undefined,\n): boolean {\n return blockers.some(\n (blocker) =>\n 'fieldId' in blocker &&\n blocker.fieldId === fieldId &&\n bindingToken('rowKey' in blocker ? blocker.rowKey : undefined) === bindingToken(rowKey),\n );\n}\n\n/** A binding's row key as a wire-typed token, so the integer `1` and the text `\"1\"` differ. */\nfunction bindingToken(rowKey: string | number | undefined): string {\n return rowKey === undefined ? '' : rowKeyToken(rowKey);\n}\n\n/**\n * Item failures whose rows the derivation could not key, so no row entry could carry them.\n *\n * A duplicate natural key is data the record holds rather than a reason to lose a decision\n * (`IDENT-2.1.9`): the report answers per offending row and carries the key, while the derived\n * state addresses no row because two rows share one identity. The same gap opens for an array\n * whose identity does not reconcile (a missing natural key, an unmanifested assigned array).\n * Reading the report's decided failure here keeps the verdict's answer equal to the report's,\n * instead of admitting a record the evaluation refused. A row that *is* addressed already\n * states the message on its entry, so this adds nothing twice.\n */\nfunction unaddressedItemFailures(\n compiled: CompiledSchema,\n fieldsById: ReadonlyMap<string, FormFieldState>,\n rules: DerivedRules,\n): readonly FormBlocker[] {\n const blockers: FormBlocker[] = [];\n for (const rule of compiled.rules ?? []) {\n if (rule.kind !== 'validate' || rule.scope !== 'item') continue;\n const fieldId = rule.targetFieldId ?? rule.fieldId;\n if (fieldId === undefined) continue;\n const field = fieldsById.get(fieldId);\n if (field === undefined || !field.visible) continue;\n const carried = (field.rows ?? []).some((row) =>\n row.messages.some(\n (message) =>\n message.ruleId === rule.ruleId &&\n message.severity === 'block' &&\n message.status === 'FAIL',\n ),\n );\n if (carried) continue;\n const results = [...(rules.rowResults.get(rule.ruleId)?.values() ?? [])];\n const rowless = rules.rowlessResults.get(rule.ruleId);\n if (rowless !== undefined) results.push(rowless);\n for (const result of results) {\n if (result.severity !== 'block' || result.status !== 'FAIL') continue;\n blockers.push({\n kind: 'rule',\n ruleId: result.ruleId,\n fieldId,\n ...(result.rowKey === undefined ? {} : { rowKey: result.rowKey }),\n messageKey:\n result.messageKey ?? rule.messageKey ?? diagnosticDoc('ENGINE_ERROR').messageKey,\n ...(result.params === undefined ? {} : { params: result.params }),\n ...suggestionsOf(result),\n });\n }\n }\n return blockers;\n}\n\n/**\n * Records every declared media constraint one capture violates.\n *\n * A field's capture states the element `index`; an array member's states the row `rowKey`.\n * Both are stated so a sentence can name the capture without re-reading the record, and a\n * member's violation never repeats the field-level answer its rows already carry, because a\n * member has no field-level capture to answer.\n */\nfunction pushMediaViolations(\n blockers: FormBlocker[],\n fieldId: string,\n media: MediaConstraints,\n rowKey?: string | number,\n): void {\n if (media.kind !== 'violated') return;\n for (const violation of media.violations) {\n const at = {\n ...(violation.index === undefined ? {} : { index: violation.index }),\n ...(rowKey === undefined ? {} : { rowKey }),\n };\n if (violation.kind === 'accept') {\n blockers.push({\n kind: 'media',\n fieldId,\n member: 'accept',\n limit: violation.limit,\n value: violation.mime,\n ...at,\n });\n } else {\n blockers.push({\n kind: 'media',\n fieldId,\n member: violation.kind,\n limit: violation.limit,\n value: violation.byteSize,\n ...at,\n });\n }\n }\n}\n\n/**\n * States the blocker for a `decimal` value above its declared fractional-digit bound.\n *\n * A row member's fact lives once per row, so `rowKey` names the row; a field-level fact names\n * no row. An absent, withheld or undecided value is never a blocker, exactly as an undecided\n * requirement is not.\n */\nfunction pushScaleBlocker(\n blockers: FormBlocker[],\n fieldId: string,\n scale: DecimalScale | undefined,\n rowKey?: string | number,\n): void {\n if (scale?.kind !== 'aboveMax') return;\n blockers.push({\n kind: 'scale',\n fieldId,\n member: 'maxScale',\n limit: scale.maxScale,\n scale: scale.scale,\n value: scale.value,\n ...(scale.messageKey === undefined ? {} : { messageKey: scale.messageKey }),\n ...(rowKey === undefined ? {} : { rowKey }),\n });\n}\n\n/** The sentence a `required` rule declared, when the artifact supplied one. */\nfunction requiredMessage(\n messageKey: string | undefined,\n params: Readonly<Record<string, WireValue>> | undefined,\n): { readonly messageKey?: string; readonly params?: Readonly<Record<string, WireValue>> } {\n return {\n ...(messageKey === undefined ? {} : { messageKey }),\n ...(params === undefined ? {} : { params }),\n };\n}\n\n/**\n * The blocker a gate's own verdict states when no item does.\n *\n * A gate blocks on its own expression failing, on that expression raising, or on a read-only\n * refusal its policy turns into a failure, and none of those is an item verdict. Reporting an\n * empty blocker list for a gate the engine refuses would let readiness call the record\n * submittable, so the gate's own result answers here.\n */\nfunction gateVerdictBlocker(rules: DerivedRules, gateId: string): FormBlocker {\n const rule = rules.ruleById.get(gateId);\n const result = rules.firstResult.get(gateId);\n return {\n kind: 'rule',\n ruleId: gateId,\n messageKey: result?.messageKey ?? rule?.messageKey ?? diagnosticDoc('ENGINE_ERROR').messageKey,\n ...(result?.params === undefined ? {} : { params: result.params }),\n };\n}\n\n/**\n * The blockers a block rule the engine could not decide states, `[RULES-2.1.9]`.\n *\n * A block rule whose expression raises reports `UNKNOWN` and carries a block diagnostic, and\n * that blocks exactly as a `FAIL` does. A block-severity diagnostic is what separates it from\n * an answer the rules spec assigns to a device that could not see a value, which is warn or\n * info (`ACCESS_DENIED`, `REQUIRED_UNKNOWN`, `DEFERRED_SERVER_CHECK`). A `validate` left\n * `UNKNOWN` with no such diagnostic is not a decided failure either; `deriveUndeterminedChecks`\n * states it, and the form is undecided rather than submittable.\n *\n * A gate states its own undecided verdict through its outcome, and a screen through the\n * undetermined-check list, so both are excluded here rather than counted twice.\n */\nfunction undecidedBlockers(\n compiled: CompiledSchema,\n fieldsById: ReadonlyMap<string, FormFieldState>,\n rules: DerivedRules,\n diagnostics: DiagnosticIndex,\n): readonly FormBlocker[] {\n const blockers: FormBlocker[] = [];\n for (const rule of compiled.rules ?? []) {\n // A block-severity rule the engine could not decide refuses the submission whatever its\n // kind: a `visible`, `required` or `enabled` rule that raised decided nothing, so the\n // branch it guards is unknown and the record is not admissible (`RULES-2.1.9`).\n if (\n rule.kind !== 'validate' &&\n rule.kind !== 'compute' &&\n rule.kind !== 'defaultCompute' &&\n rule.kind !== 'visible' &&\n rule.kind !== 'required' &&\n rule.kind !== 'enabled'\n ) {\n continue;\n }\n const fieldId = rule.targetFieldId ?? rule.fieldId;\n if (hiddenField(fieldsById, fieldId)) continue;\n // `validate`, `compute` and `defaultCompute` block on any block diagnostic; the branch\n // kinds block only when the engine raised, because every other diagnostic is an open\n // question rather than a refusal.\n const failed =\n rule.kind === 'visible' || rule.kind === 'required' || rule.kind === 'enabled'\n ? engineErrorFailed\n : engineFailed;\n if (rule.scope === 'item') {\n // Every row the engine could not decide is its own blocker, as every row the report\n // states is its own diagnostic. Reading one result per rule attached row `a` and left\n // row `b`'s failure stated only in the report.\n for (const result of resultsOf(rules, rule.ruleId)) {\n if (result.severity !== 'block' || result.status !== 'UNKNOWN') continue;\n if (!failed(diagnostics, rule.ruleId, result.rowKey)) continue;\n blockers.push({\n kind: 'rule',\n ruleId: result.ruleId,\n ...(fieldId === undefined ? {} : { fieldId }),\n ...(result.rowKey === undefined ? {} : { rowKey: result.rowKey }),\n messageKey:\n result.messageKey ?? rule.messageKey ?? diagnosticDoc('ENGINE_ERROR').messageKey,\n ...(result.params === undefined ? {} : { params: result.params }),\n });\n }\n continue;\n }\n const undecided = rules.firstUndecided.get(rule.ruleId);\n if (undecided === undefined) continue;\n if (!failed(diagnostics, rule.ruleId, undecided.rowKey)) continue;\n blockers.push({\n kind: 'rule',\n ruleId: undecided.ruleId,\n ...(fieldId === undefined ? {} : { fieldId }),\n ...(undecided.rowKey === undefined ? {} : { rowKey: undecided.rowKey }),\n messageKey:\n undecided.messageKey ?? rule.messageKey ?? diagnosticDoc('ENGINE_ERROR').messageKey,\n ...(undecided.params === undefined ? {} : { params: undecided.params }),\n });\n }\n return blockers;\n}\n\n/**\n * Whether the artifact hides a field, so a failure on it is nothing the caller can fix. A\n * failure that names no field is about the record and always visible.\n */\nfunction hiddenField(\n fieldsById: ReadonlyMap<string, FormFieldState>,\n fieldId: string | undefined,\n): boolean {\n return fieldId !== undefined && fieldsById.get(fieldId)?.visible === false;\n}\n\n/** Records a block-severity validation failure as a blocker. */\nfunction addMessage(\n blockers: FormBlocker[],\n message: {\n readonly ruleId: string;\n readonly severity: Severity;\n readonly status: Outcome;\n readonly messageKey: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n },\n fieldId: string,\n rowKey: string | number | undefined,\n rules: DerivedRules,\n): void {\n if (message.severity !== 'block' || message.status !== 'FAIL') return;\n blockers.push({\n kind: 'rule',\n ruleId: message.ruleId,\n fieldId,\n ...(rowKey === undefined ? {} : { rowKey }),\n messageKey: message.messageKey,\n ...(message.params === undefined ? {} : { params: message.params }),\n ...suggestionsOfRow(rules, message.ruleId, rowKey),\n });\n}\n\n/**\n * The alternatives a rule result states, for the blocker that result becomes.\n *\n * A failing `validate` rule offers alternatives that clear it, and the blocker is where a host\n * reads them: the report's result and the readiness blocker name the same failure, so they state\n * the same alternatives. An absent member stays absent, which is what an artifact that declares\n * none and one whose alternatives the access filter removed look like (`RULES-6.1.3`).\n */\nfunction suggestionsOf(result: RuleResult): {\n readonly suggestions?: readonly EvaluatedSuggestion[];\n} {\n return result.suggestions === undefined ? {} : { suggestions: result.suggestions };\n}\n\n/**\n * The alternatives one row's own result states, so a row-scoped blocker offers what its rule did.\n *\n * An item-scoped rule answers once per row, so the alternatives that belong to this blocker are\n * the ones that row's result carries: the failing row's `current` reference was resolved there.\n */\nfunction suggestionsOfRow(\n rules: DerivedRules,\n ruleId: string,\n rowKey: string | number | undefined,\n): { readonly suggestions?: readonly EvaluatedSuggestion[] } {\n if (rowKey === undefined) return {};\n const result = rules.rowResults.get(ruleId)?.get(rowKeyToken(rowKey));\n return result === undefined ? {} : suggestionsOf(result);\n}\n"]}
@@ -0,0 +1,130 @@
1
+ import type { EvaluationEnv, EvaluationInput } from '../../model/access.js';
2
+ import type { ReportFacts, EvaluatedSuggestion, WireValue } from '../../model/types.js';
3
+ import type { CompiledSchema } from '../../model/schema.js';
4
+ import type { AccessWindow } from '../access/window.js';
5
+ import type { ComputedValues } from '../reader.js';
6
+ import type { UndecidedBinding } from '../undecided.js';
7
+ import type { FormStateOptions } from './options.js';
8
+ /**
9
+ * One form evaluation: the canonical report, the access answer it resolved and the record it
10
+ * read.
11
+ *
12
+ * The snapshot is what `deriveFormState` consumes. It is obtained from one `Evaluation`, so
13
+ * the report and the access answer cannot come from two different overlays, and the raw
14
+ * record stays inside the derivation: a derived state never carries a withheld value.
15
+ */
16
+ export interface FormSnapshot {
17
+ readonly report: ReportFacts;
18
+ readonly access: AccessWindow;
19
+ /** The writer entries that own values after evaluation; an absent default has no entry. */
20
+ readonly computed: ComputedValues;
21
+ readonly input: EvaluationInput;
22
+ /**
23
+ * The expected row count each `rowsFrom` array declares, `MODEL-2.1.22`.
24
+ *
25
+ * The expression is evaluated once per record, on the same reader the rules used, after the
26
+ * writers have produced their values. A field absent from this map declares no `rowsFrom`.
27
+ */
28
+ readonly rowCounts: ReadonlyMap<string, RowCountEvaluation>;
29
+ /**
30
+ * Each declared option's availability, keyed by the binding's runtime key (`fieldKey`).
31
+ *
32
+ * It is evaluated once per record, on the same reader the rules use, after the writers have
33
+ * produced their values, `RULES-7.1.2`. A binding whose field declares no availability states
34
+ * no entry, and a binding entry states only the options whose condition did not decide
35
+ * `available`. Derivation reads this answer; it never evaluates a condition again.
36
+ */
37
+ readonly optionAvailability: ReadonlyMap<string, OptionAvailabilityBinding>;
38
+ /**
39
+ * The declared fields a layout `section` whose `visibleWhen` decided `FAIL` places,
40
+ * `MODEL-3.1.9`.
41
+ *
42
+ * It is presentation's answer, not a data-visibility rule: the value still evaluates and its
43
+ * submission policy still applies. Readiness reads it to leave an off-screen field's blockers
44
+ * out of the verdict, exactly as it reads a hidden field's. A snapshot from an artifact with
45
+ * no conditional section states the empty set.
46
+ */
47
+ readonly layoutHidden: ReadonlySet<string>;
48
+ /**
49
+ * Why each rule binding that came back `UNKNOWN` did, keyed by rule id, `RULES-2.1.1`.
50
+ *
51
+ * The report states `UNKNOWN` and nothing more, because that is the sealed contract: an
52
+ * access-denied read stays `UNKNOWN` in it. Readiness needs the cause the report may not carry,
53
+ * so the evaluation states it beside the report: a binding whose reads were only refused is
54
+ * skipped, and one that also read an unfilled input stays an open question. A rule that decided
55
+ * every row states no entry.
56
+ */
57
+ readonly undecided: ReadonlyMap<string, readonly UndecidedBinding[]>;
58
+ }
59
+ /** The evaluated expected count of one `rowsFrom` array. */
60
+ export type RowCountEvaluation = {
61
+ readonly kind: 'expected';
62
+ readonly expected: number;
63
+ } | {
64
+ readonly kind: 'undetermined';
65
+ } | {
66
+ readonly kind: 'refused';
67
+ readonly reason: 'integer' | 'negative' | 'ceiling';
68
+ readonly value: number;
69
+ };
70
+ /**
71
+ * One declared option's availability, `RULES-7.1.1`.
72
+ *
73
+ * An option the map does not state is available: an absent `availableWhen` and a condition that
74
+ * decided true are the same answer, so neither costs an entry. An undetermined option is never
75
+ * treated as available, so the two negative answers are stated.
76
+ */
77
+ export type OptionAvailabilityAnswer = {
78
+ readonly code: string | number;
79
+ readonly kind: 'unavailable';
80
+ /** The sentence the declaration states, when it states one; the host writes it otherwise. */
81
+ readonly messageKey?: string;
82
+ readonly params?: Readonly<Record<string, WireValue>>;
83
+ /**
84
+ * The alternatives this option offers for the held code, `RULES-7.1.4`.
85
+ *
86
+ * Evaluated only when the record holds this code and the option is unavailable, so an
87
+ * answer that survives the access filter is data a host applies rather than source text.
88
+ */
89
+ readonly suggestions?: readonly EvaluatedSuggestion[];
90
+ } | {
91
+ readonly code: string | number;
92
+ readonly kind: 'undetermined';
93
+ /** Why the condition decided neither way: a server handoff, or an unanswered read. */
94
+ readonly cause: 'deferred' | 'unknown';
95
+ };
96
+ /** One binding's declared availability, in declaration order, `RULES-7.1.2`. */
97
+ export interface OptionAvailabilityBinding {
98
+ /** Every declared option whose condition did not decide `available`. */
99
+ readonly options: readonly OptionAvailabilityAnswer[];
100
+ /**
101
+ * The answers above whose code the record holds, in declaration order.
102
+ *
103
+ * Readiness reads this list and no other: a code the record does not hold blocks nothing and
104
+ * opens no question, while a held unavailable code is a decided failure and a held
105
+ * undetermined one is an open question.
106
+ *
107
+ * A row whose list read decided nothing states every conditioned code here. The code the
108
+ * binding would hold is the value the device could not read, so the one honest answer is that
109
+ * every conditioned code is held: readiness then opens a question for each instead of
110
+ * claiming the record holds a code the read never reached. A binding whose value delivery
111
+ * withholds states nothing here, because the code it holds is the value `ACCESS-1.3.4`
112
+ * refuses to name.
113
+ */
114
+ readonly held: readonly OptionAvailabilityAnswer[];
115
+ }
116
+ /**
117
+ * Evaluates one record and keeps the snapshot its derived state reads, `[ENGINE-7.1.5]`.
118
+ *
119
+ * This is the evaluation half of `describeFormState`: one `Evaluation` produces the report,
120
+ * its diagnostics and the exact access window the reader used, so a caller that later asks
121
+ * a derived question asks it of the same answer the report states.
122
+ *
123
+ * `options.identity` reaches the evaluation as well as the derivation. An assigned array's rows
124
+ * are named by the host's manifest, so an evaluation without it cannot address a row: it states
125
+ * one row-less result where the derivation — handed the manifest — states one per row. That is
126
+ * two answers to one question, and the report a caller reads would disagree with the fields
127
+ * derived from it.
128
+ */
129
+ export declare function evaluateForm(compiled: CompiledSchema, input: EvaluationInput, env?: EvaluationEnv, options?: FormStateOptions): FormSnapshot;
130
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/eval/state/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;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AE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACvD,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;CACxC,CAAC;AAEN,gFAAgF;AAChF,MAAM,WAAW,yBAAyB;IACxC,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACtD;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACpD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,eAAe,EACtB,GAAG,GAAE,aAAkB,EACvB,OAAO,GAAE,gBAAwC,GAChD,YAAY,CAsBd"}
@@ -0,0 +1,35 @@
1
+ import { Evaluation } from '../rule/runner.js';
2
+ import { assertArtifactReceipt } from '../receipt.js';
3
+ import { NO_FORM_STATE_OPTIONS } from './options.js';
4
+ /**
5
+ * Evaluates one record and keeps the snapshot its derived state reads, `[ENGINE-7.1.5]`.
6
+ *
7
+ * This is the evaluation half of `describeFormState`: one `Evaluation` produces the report,
8
+ * its diagnostics and the exact access window the reader used, so a caller that later asks
9
+ * a derived question asks it of the same answer the report states.
10
+ *
11
+ * `options.identity` reaches the evaluation as well as the derivation. An assigned array's rows
12
+ * are named by the host's manifest, so an evaluation without it cannot address a row: it states
13
+ * one row-less result where the derivation — handed the manifest — states one per row. That is
14
+ * two answers to one question, and the report a caller reads would disagree with the fields
15
+ * derived from it.
16
+ */
17
+ export function evaluateForm(compiled, input, env = {}, options = NO_FORM_STATE_OPTIONS) {
18
+ assertArtifactReceipt(compiled);
19
+ const identity = options.identity;
20
+ const evaluation = new Evaluation(compiled, input, env, identity === undefined ? {} : { assignedRowKeys: (fieldId) => identity.get(fieldId) });
21
+ const report = evaluation.runBody();
22
+ return {
23
+ report,
24
+ access: evaluation.accessWindow(),
25
+ computed: evaluation.computedValues(),
26
+ input,
27
+ rowCounts: evaluation.rowCounts(),
28
+ optionAvailability: evaluation.optionAvailability(),
29
+ undecided: evaluation.undecidedCauses(),
30
+ // Presentation is the authority for a section predicate; this evaluation owns the reader
31
+ // that answers it, so readiness and the painted page cannot disagree about the same record.
32
+ layoutHidden: evaluation.layoutHidden(),
33
+ };
34
+ }
35
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../src/eval/state/snapshot.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAmHrD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAC1B,QAAwB,EACxB,KAAsB,EACtB,GAAG,GAAkB,EAAE,EACvB,OAAO,GAAqB,qBAAqB;IAEjD,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,UAAU,CAC/B,QAAQ,EACR,KAAK,EACL,GAAG,EACH,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAC9F,CAAC;IACF,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;IACpC,OAAO;QACL,MAAM;QACN,MAAM,EAAE,UAAU,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,UAAU,CAAC,cAAc,EAAE;QACrC,KAAK;QACL,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE;QACjC,kBAAkB,EAAE,UAAU,CAAC,kBAAkB,EAAE;QACnD,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE;QACvC,yFAAyF;QACzF,4FAA4F;QAC5F,YAAY,EAAE,UAAU,CAAC,YAAY,EAAE;KACxC,CAAC;AACJ,CAAC","sourcesContent":["import type { EvaluationEnv, EvaluationInput } from '../../model/access.js';\nimport type { ReportFacts, EvaluatedSuggestion, WireValue } from '../../model/types.js';\nimport type { CompiledSchema } from '../../model/schema.js';\nimport type { AccessWindow } from '../access/window.js';\nimport type { ComputedValues } from '../reader.js';\nimport type { UndecidedBinding } from '../undecided.js';\nimport { Evaluation } from '../rule/runner.js';\nimport { assertArtifactReceipt } from '../receipt.js';\nimport { NO_FORM_STATE_OPTIONS } from './options.js';\nimport type { FormStateOptions } from './options.js';\n\n/**\n * One form evaluation: the canonical report, the access answer it resolved and the record it\n * read.\n *\n * The snapshot is what `deriveFormState` consumes. It is obtained from one `Evaluation`, so\n * the report and the access answer cannot come from two different overlays, and the raw\n * record stays inside the derivation: a derived state never carries a withheld value.\n */\nexport interface FormSnapshot {\n readonly report: ReportFacts;\n readonly access: AccessWindow;\n /** The writer entries that own values after evaluation; an absent default has no entry. */\n readonly computed: ComputedValues;\n readonly input: EvaluationInput;\n /**\n * The expected row count each `rowsFrom` array declares, `MODEL-2.1.22`.\n *\n * The expression is evaluated once per record, on the same reader the rules used, after the\n * writers have produced their values. A field absent from this map declares no `rowsFrom`.\n */\n readonly rowCounts: ReadonlyMap<string, RowCountEvaluation>;\n /**\n * Each declared option's availability, keyed by the binding's runtime key (`fieldKey`).\n *\n * It is evaluated once per record, on the same reader the rules use, after the writers have\n * produced their values, `RULES-7.1.2`. A binding whose field declares no availability states\n * no entry, and a binding entry states only the options whose condition did not decide\n * `available`. Derivation reads this answer; it never evaluates a condition again.\n */\n readonly optionAvailability: ReadonlyMap<string, OptionAvailabilityBinding>;\n /**\n * The declared fields a layout `section` whose `visibleWhen` decided `FAIL` places,\n * `MODEL-3.1.9`.\n *\n * It is presentation's answer, not a data-visibility rule: the value still evaluates and its\n * submission policy still applies. Readiness reads it to leave an off-screen field's blockers\n * out of the verdict, exactly as it reads a hidden field's. A snapshot from an artifact with\n * no conditional section states the empty set.\n */\n readonly layoutHidden: ReadonlySet<string>;\n /**\n * Why each rule binding that came back `UNKNOWN` did, keyed by rule id, `RULES-2.1.1`.\n *\n * The report states `UNKNOWN` and nothing more, because that is the sealed contract: an\n * access-denied read stays `UNKNOWN` in it. Readiness needs the cause the report may not carry,\n * so the evaluation states it beside the report: a binding whose reads were only refused is\n * skipped, and one that also read an unfilled input stays an open question. A rule that decided\n * every row states no entry.\n */\n readonly undecided: ReadonlyMap<string, readonly UndecidedBinding[]>;\n}\n\n/** The evaluated expected count of one `rowsFrom` array. */\nexport type RowCountEvaluation =\n | { readonly kind: 'expected'; readonly expected: number }\n | { readonly kind: 'undetermined' }\n | {\n readonly kind: 'refused';\n readonly reason: 'integer' | 'negative' | 'ceiling';\n readonly value: number;\n };\n\n/**\n * One declared option's availability, `RULES-7.1.1`.\n *\n * An option the map does not state is available: an absent `availableWhen` and a condition that\n * decided true are the same answer, so neither costs an entry. An undetermined option is never\n * treated as available, so the two negative answers are stated.\n */\nexport type OptionAvailabilityAnswer =\n | {\n readonly code: string | number;\n readonly kind: 'unavailable';\n /** The sentence the declaration states, when it states one; the host writes it otherwise. */\n readonly messageKey?: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n /**\n * The alternatives this option offers for the held code, `RULES-7.1.4`.\n *\n * Evaluated only when the record holds this code and the option is unavailable, so an\n * answer that survives the access filter is data a host applies rather than source text.\n */\n readonly suggestions?: readonly EvaluatedSuggestion[];\n }\n | {\n readonly code: string | number;\n readonly kind: 'undetermined';\n /** Why the condition decided neither way: a server handoff, or an unanswered read. */\n readonly cause: 'deferred' | 'unknown';\n };\n\n/** One binding's declared availability, in declaration order, `RULES-7.1.2`. */\nexport interface OptionAvailabilityBinding {\n /** Every declared option whose condition did not decide `available`. */\n readonly options: readonly OptionAvailabilityAnswer[];\n /**\n * The answers above whose code the record holds, in declaration order.\n *\n * Readiness reads this list and no other: a code the record does not hold blocks nothing and\n * opens no question, while a held unavailable code is a decided failure and a held\n * undetermined one is an open question.\n *\n * A row whose list read decided nothing states every conditioned code here. The code the\n * binding would hold is the value the device could not read, so the one honest answer is that\n * every conditioned code is held: readiness then opens a question for each instead of\n * claiming the record holds a code the read never reached. A binding whose value delivery\n * withholds states nothing here, because the code it holds is the value `ACCESS-1.3.4`\n * refuses to name.\n */\n readonly held: readonly OptionAvailabilityAnswer[];\n}\n\n/**\n * Evaluates one record and keeps the snapshot its derived state reads, `[ENGINE-7.1.5]`.\n *\n * This is the evaluation half of `describeFormState`: one `Evaluation` produces the report,\n * its diagnostics and the exact access window the reader used, so a caller that later asks\n * a derived question asks it of the same answer the report states.\n *\n * `options.identity` reaches the evaluation as well as the derivation. An assigned array's rows\n * are named by the host's manifest, so an evaluation without it cannot address a row: it states\n * one row-less result where the derivation — handed the manifest — states one per row. That is\n * two answers to one question, and the report a caller reads would disagree with the fields\n * derived from it.\n */\nexport function evaluateForm(\n compiled: CompiledSchema,\n input: EvaluationInput,\n env: EvaluationEnv = {},\n options: FormStateOptions = NO_FORM_STATE_OPTIONS,\n): FormSnapshot {\n assertArtifactReceipt(compiled);\n const identity = options.identity;\n const evaluation = new Evaluation(\n compiled,\n input,\n env,\n identity === undefined ? {} : { assignedRowKeys: (fieldId: string) => identity.get(fieldId) },\n );\n const report = evaluation.runBody();\n return {\n report,\n access: evaluation.accessWindow(),\n computed: evaluation.computedValues(),\n input,\n rowCounts: evaluation.rowCounts(),\n optionAvailability: evaluation.optionAvailability(),\n undecided: evaluation.undecidedCauses(),\n // Presentation is the authority for a section predicate; this evaluation owns the reader\n // that answers it, so readiness and the painted page cannot disagree about the same record.\n layoutHidden: evaluation.layoutHidden(),\n };\n}\n"]}
@@ -0,0 +1,54 @@
1
+ import type { WireValue } from '../../model/types.js';
2
+ import type { OptionItem } from '../options.js';
3
+ import type { OptionAvailabilityAnswer } from './snapshot.js';
4
+ import type { ValueState } from './value-state.js';
5
+ /**
6
+ * One declared or host-loaded option code the domain states it may not offer now, `ENGINE-7.1.7`.
7
+ *
8
+ * A state entry is not a refusal of the record: it says the domain offers the code and this
9
+ * record may not choose it. A code the domain does not offer at all is `invalidOption` instead,
10
+ * so a host can tell "your code is no longer in the list" from "this code is in the list and this
11
+ * record may not hold it".
12
+ */
13
+ export interface UnavailableOption {
14
+ readonly code: string | number;
15
+ readonly state: 'unavailable' | 'undetermined';
16
+ /** The sentence the declaration or the host page states, when it states one. */
17
+ readonly messageKey?: string;
18
+ readonly params?: Readonly<Record<string, WireValue>>;
19
+ /** Why an undetermined code is undetermined: a server handoff, or an unanswered read. */
20
+ readonly cause?: 'deferred' | 'unknown';
21
+ }
22
+ /** The declared availability answers as the derived state states them, in declaration order. */
23
+ export declare function declaredUnavailableOptions(answers: readonly OptionAvailabilityAnswer[] | undefined): readonly UnavailableOption[];
24
+ /**
25
+ * The host page items that state their code may not be chosen, in page order.
26
+ *
27
+ * A page answers availability for the codes it holds, so an item that states nothing is
28
+ * available: the host's silence is never read as a refusal.
29
+ */
30
+ export declare function hostUnavailableItems(items: readonly OptionItem[] | undefined): readonly OptionItem[];
31
+ /**
32
+ * The code a host page item's value is stated as, or `undefined` when no code names it.
33
+ *
34
+ * A readiness code is a string or a safe integer, which is what a `string`, `integer` or scalar
35
+ * array domain holds. A value shape the declaration does not admit is still mapped when a code
36
+ * spelling exists: a boolean's codes are the spellings `true` and `false` the declaration uses
37
+ * (`MODEL-3.1.5`), and a duration's code is its amount in the field's unit, so both map back
38
+ * through the same inverse of `optionCodeValue` rather than disappearing from readiness. A
39
+ * malformed page therefore cannot silently grant availability.
40
+ *
41
+ * A record-valued item (`money`, `media_ref`, `timeslot`) has no spelling in
42
+ * `UnavailableOption.code`, which is `string | number`, so the host's `available: false` on such
43
+ * an item is not stated. The limitation is deliberate rather than an oversight: widening the code
44
+ * contract is a separate decision, and inventing a code here would name something the host never
45
+ * offered.
46
+ */
47
+ export declare function hostOptionCode(item: OptionItem): string | number | undefined;
48
+ /** One host page item as the derived state states it, or `undefined` when no code names it. */
49
+ export declare function hostUnavailableOption(item: OptionItem): UnavailableOption | undefined;
50
+ /** The values one derived binding holds, as the wire values an option code is matched against. */
51
+ export declare function heldValuesOf(value: ValueState): readonly WireValue[];
52
+ /** Whether the record holds one host page item's value at this binding. */
53
+ export declare function holdsItem(item: OptionItem, held: readonly WireValue[]): boolean;
54
+ //# sourceMappingURL=unavailable-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unavailable-options.d.ts","sourceRoot":"","sources":["../../../src/eval/state/unavailable-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,CAAC;IAC/C,gFAAgF;IAChF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACtD,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACzC;AAED,gGAAgG;AAChG,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,wBAAwB,EAAE,GAAG,SAAS,GACvD,SAAS,iBAAiB,EAAE,CAW9B;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,GACvC,SAAS,UAAU,EAAE,CAEvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAO5E;AASD,+FAA+F;AAC/F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,GAAG,SAAS,CASrF;AAED,kGAAkG;AAClG,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,SAAS,EAAE,CAGpE;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,OAAO,CAE/E"}
@@ -0,0 +1,82 @@
1
+ import { isRecord } from '../../model/guards.js';
2
+ import { isSafeInteger } from '../../model/integer.js';
3
+ import { isDurationUnit } from '../../model/types.js';
4
+ import { isWireArray, sameWireValue } from '../../model/values.js';
5
+ /** The declared availability answers as the derived state states them, in declaration order. */
6
+ export function declaredUnavailableOptions(answers) {
7
+ return (answers ?? []).map((answer) => answer.kind === 'unavailable'
8
+ ? {
9
+ code: answer.code,
10
+ state: 'unavailable',
11
+ ...(answer.messageKey === undefined ? {} : { messageKey: answer.messageKey }),
12
+ ...(answer.params === undefined ? {} : { params: answer.params }),
13
+ }
14
+ : { code: answer.code, state: 'undetermined', cause: answer.cause });
15
+ }
16
+ /**
17
+ * The host page items that state their code may not be chosen, in page order.
18
+ *
19
+ * A page answers availability for the codes it holds, so an item that states nothing is
20
+ * available: the host's silence is never read as a refusal.
21
+ */
22
+ export function hostUnavailableItems(items) {
23
+ return (items ?? []).filter((item) => item.available === false);
24
+ }
25
+ /**
26
+ * The code a host page item's value is stated as, or `undefined` when no code names it.
27
+ *
28
+ * A readiness code is a string or a safe integer, which is what a `string`, `integer` or scalar
29
+ * array domain holds. A value shape the declaration does not admit is still mapped when a code
30
+ * spelling exists: a boolean's codes are the spellings `true` and `false` the declaration uses
31
+ * (`MODEL-3.1.5`), and a duration's code is its amount in the field's unit, so both map back
32
+ * through the same inverse of `optionCodeValue` rather than disappearing from readiness. A
33
+ * malformed page therefore cannot silently grant availability.
34
+ *
35
+ * A record-valued item (`money`, `media_ref`, `timeslot`) has no spelling in
36
+ * `UnavailableOption.code`, which is `string | number`, so the host's `available: false` on such
37
+ * an item is not stated. The limitation is deliberate rather than an oversight: widening the code
38
+ * contract is a separate decision, and inventing a code here would name something the host never
39
+ * offered.
40
+ */
41
+ export function hostOptionCode(item) {
42
+ const value = item.value;
43
+ if (typeof value === 'string')
44
+ return value;
45
+ if (typeof value === 'boolean')
46
+ return value ? 'true' : 'false';
47
+ if (typeof value === 'number')
48
+ return isSafeInteger(value) ? value : undefined;
49
+ if (isDurationAmount(value))
50
+ return value.amount;
51
+ return undefined;
52
+ }
53
+ /** Whether a wire value is the duration shape an option amount names, `MODEL-2.1.24`. */
54
+ function isDurationAmount(value) {
55
+ if (!isRecord(value))
56
+ return false;
57
+ const amount = value['amount'];
58
+ return typeof amount === 'number' && isSafeInteger(amount) && isDurationUnit(value['unit']);
59
+ }
60
+ /** One host page item as the derived state states it, or `undefined` when no code names it. */
61
+ export function hostUnavailableOption(item) {
62
+ const code = hostOptionCode(item);
63
+ if (code === undefined)
64
+ return undefined;
65
+ return {
66
+ code,
67
+ state: 'unavailable',
68
+ ...(item.unavailableMessageKey === undefined ? {} : { messageKey: item.unavailableMessageKey }),
69
+ ...(item.unavailableParams === undefined ? {} : { params: item.unavailableParams }),
70
+ };
71
+ }
72
+ /** The values one derived binding holds, as the wire values an option code is matched against. */
73
+ export function heldValuesOf(value) {
74
+ if (value.kind !== 'value' || value.value === null)
75
+ return [];
76
+ return isWireArray(value.value) ? value.value : [value.value];
77
+ }
78
+ /** Whether the record holds one host page item's value at this binding. */
79
+ export function holdsItem(item, held) {
80
+ return held.some((value) => sameWireValue(value, item.value));
81
+ }
82
+ //# sourceMappingURL=unavailable-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unavailable-options.js","sourceRoot":"","sources":["../../../src/eval/state/unavailable-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAuBnE,gGAAgG;AAChG,MAAM,UAAU,0BAA0B,CACxC,OAAwD;IAExD,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACpC,MAAM,CAAC,IAAI,KAAK,aAAa;QAC3B,CAAC,CAAC;YACE,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,aAAa;YACpB,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;YAC7E,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;SAClE;QACH,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CACtE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC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AK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC/F,GAAG,CAAC,IAAI,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;KACpF,CAAC;AACJ,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,YAAY,CAAC,KAAiB;IAC5C,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC9D,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,IAAgB,EAAE,IAA0B;IACpE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { isRecord } from '../../model/guards.js';\nimport { isSafeInteger } from '../../model/integer.js';\nimport type { DurationValue, WireValue } from '../../model/types.js';\nimport { isDurationUnit } from '../../model/types.js';\nimport { isWireArray, sameWireValue } from '../../model/values.js';\nimport type { OptionItem } from '../options.js';\nimport type { OptionAvailabilityAnswer } from './snapshot.js';\nimport type { ValueState } from './value-state.js';\n\n/**\n * One declared or host-loaded option code the domain states it may not offer now, `ENGINE-7.1.7`.\n *\n * A state entry is not a refusal of the record: it says the domain offers the code and this\n * record may not choose it. A code the domain does not offer at all is `invalidOption` instead,\n * so a host can tell \"your code is no longer in the list\" from \"this code is in the list and this\n * record may not hold it\".\n */\nexport interface UnavailableOption {\n readonly code: string | number;\n readonly state: 'unavailable' | 'undetermined';\n /** The sentence the declaration or the host page states, when it states one. */\n readonly messageKey?: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n /** Why an undetermined code is undetermined: a server handoff, or an unanswered read. */\n readonly cause?: 'deferred' | 'unknown';\n}\n\n/** The declared availability answers as the derived state states them, in declaration order. */\nexport function declaredUnavailableOptions(\n answers: readonly OptionAvailabilityAnswer[] | undefined,\n): readonly UnavailableOption[] {\n return (answers ?? []).map((answer) =>\n answer.kind === 'unavailable'\n ? {\n code: answer.code,\n state: 'unavailable',\n ...(answer.messageKey === undefined ? {} : { messageKey: answer.messageKey }),\n ...(answer.params === undefined ? {} : { params: answer.params }),\n }\n : { code: answer.code, state: 'undetermined', cause: answer.cause },\n );\n}\n\n/**\n * The host page items that state their code may not be chosen, in page order.\n *\n * A page answers availability for the codes it holds, so an item that states nothing is\n * available: the host's silence is never read as a refusal.\n */\nexport function hostUnavailableItems(\n items: readonly OptionItem[] | undefined,\n): readonly OptionItem[] {\n return (items ?? []).filter((item) => item.available === false);\n}\n\n/**\n * The code a host page item's value is stated as, or `undefined` when no code names it.\n *\n * A readiness code is a string or a safe integer, which is what a `string`, `integer` or scalar\n * array domain holds. A value shape the declaration does not admit is still mapped when a code\n * spelling exists: a boolean's codes are the spellings `true` and `false` the declaration uses\n * (`MODEL-3.1.5`), and a duration's code is its amount in the field's unit, so both map back\n * through the same inverse of `optionCodeValue` rather than disappearing from readiness. A\n * malformed page therefore cannot silently grant availability.\n *\n * A record-valued item (`money`, `media_ref`, `timeslot`) has no spelling in\n * `UnavailableOption.code`, which is `string | number`, so the host's `available: false` on such\n * an item is not stated. The limitation is deliberate rather than an oversight: widening the code\n * contract is a separate decision, and inventing a code here would name something the host never\n * offered.\n */\nexport function hostOptionCode(item: OptionItem): string | number | undefined {\n const value = item.value;\n if (typeof value === 'string') return value;\n if (typeof value === 'boolean') return value ? 'true' : 'false';\n if (typeof value === 'number') return isSafeInteger(value) ? value : undefined;\n if (isDurationAmount(value)) return value.amount;\n return undefined;\n}\n\n/** Whether a wire value is the duration shape an option amount names, `MODEL-2.1.24`. */\nfunction isDurationAmount(value: WireValue): value is DurationValue {\n if (!isRecord(value)) return false;\n const amount = value['amount'];\n return typeof amount === 'number' && isSafeInteger(amount) && isDurationUnit(value['unit']);\n}\n\n/** One host page item as the derived state states it, or `undefined` when no code names it. */\nexport function hostUnavailableOption(item: OptionItem): UnavailableOption | undefined {\n const code = hostOptionCode(item);\n if (code === undefined) return undefined;\n return {\n code,\n state: 'unavailable',\n ...(item.unavailableMessageKey === undefined ? {} : { messageKey: item.unavailableMessageKey }),\n ...(item.unavailableParams === undefined ? {} : { params: item.unavailableParams }),\n };\n}\n\n/** The values one derived binding holds, as the wire values an option code is matched against. */\nexport function heldValuesOf(value: ValueState): readonly WireValue[] {\n if (value.kind !== 'value' || value.value === null) return [];\n return isWireArray(value.value) ? value.value : [value.value];\n}\n\n/** Whether the record holds one host page item's value at this binding. */\nexport function holdsItem(item: OptionItem, held: readonly WireValue[]): boolean {\n return held.some((value) => sameWireValue(value, item.value));\n}\n"]}