@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,139 @@
1
+ import { AxiomError } from '../../model/errors.js';
2
+ import { isUndetermined } from '../../model/types.js';
3
+ import { isWireArray, wireMembers } from '../../model/values.js';
4
+ import { rowKeyToken } from '../../model/wire.js';
5
+ import { ABSENT, valueOf } from '../expr/value.js';
6
+ import { addressingOfItems } from '../addressing.js';
7
+ import { buildItemContainers } from './declarations.js';
8
+ /**
9
+ * Row identity for covered targets: the canonical keys of one array, and the read a
10
+ * `(fieldId, rowKey)` reference names. A reference inside an array item is matched on its
11
+ * identity, never on a position; a key no row carries, or one two rows share, is not a
12
+ * reference this reader can satisfy.
13
+ *
14
+ * The keys are the row-addressing authority's answer for the list this reader resolved —
15
+ * access and the computed overlay already applied — so the answer a covered target is matched
16
+ * against is the one a rule is allowed to see, and never a second derivation of its own.
17
+ */
18
+ export class CoveredTargets {
19
+ index;
20
+ read;
21
+ declarationPathOf;
22
+ /** Item member fieldId to the arrays declaring it, built when a row target is read. */
23
+ itemContainers;
24
+ /**
25
+ * Derived keys of one declared array, kept per immutable element list. One reader resolves one
26
+ * identity answer, so a list a read returned is named by the same keys for its lifetime.
27
+ * `null` records a list the authority could not address, so the refusal is not re-derived.
28
+ */
29
+ derivedKeys = new WeakMap();
30
+ /** Row positions by wire-typed key, built once per array rather than scanned per target. */
31
+ rowPositions = new Map();
32
+ constructor(index, read, declarationPathOf) {
33
+ this.index = index;
34
+ this.read = read;
35
+ this.declarationPathOf = declarationPathOf;
36
+ }
37
+ /**
38
+ * The canonical row keys of one declared array in array order. `undefined` means the rows
39
+ * cannot be identified here — no identity is declared, a row has no key member, or two rows
40
+ * share one — so a caller that needs identity fails closed instead of falling back to a
41
+ * position. An assigned array answers from the manifest its owner committed.
42
+ */
43
+ rowKeysOf(arrayPath) {
44
+ const field = this.arrayDeclaration(arrayPath);
45
+ if (field === undefined)
46
+ return undefined;
47
+ const array = this.read(arrayPath);
48
+ if (array.kind !== 'value' || !isWireArray(array.value))
49
+ return undefined;
50
+ const cached = this.derivedKeys.get(field)?.get(array.value);
51
+ if (cached !== undefined)
52
+ return cached ?? undefined;
53
+ const addressing = addressingOfItems(field, array.value, this.index.assignedRowKeys?.(field.fieldId));
54
+ const keys = addressing.outcome === 'addressed' ? addressing.rows.map((row) => row.rowKey) : null;
55
+ const byList = this.derivedKeys.get(field) ?? new WeakMap();
56
+ byList.set(array.value, keys);
57
+ this.derivedKeys.set(field, byList);
58
+ return keys ?? undefined;
59
+ }
60
+ /**
61
+ * The canonical row key of one item of a declared array, or `undefined` when the row cannot
62
+ * be identified here.
63
+ */
64
+ rowKeyOf(arrayPath, index) {
65
+ return this.rowKeysOf(arrayPath)?.[index];
66
+ }
67
+ /** Reads the value a covered target names. */
68
+ readTarget(ref) {
69
+ if (ref.rowKey === undefined)
70
+ return this.read(this.declarationPathOf(ref.fieldId));
71
+ const arrayPath = this.arrayDeclaringItemField(ref.fieldId);
72
+ if (arrayPath === undefined) {
73
+ throw new AxiomError('ENGINE_ERROR', `no declared array has one item field ${ref.fieldId}`, ref.fieldId);
74
+ }
75
+ const field = this.arrayDeclaration(arrayPath);
76
+ if (field === undefined) {
77
+ throw new AxiomError('ENGINE_ERROR', `no array is declared at ${arrayPath}`, arrayPath);
78
+ }
79
+ const array = this.read(arrayPath);
80
+ if (array.kind === 'absent')
81
+ return ABSENT;
82
+ if (isUndetermined(array.value))
83
+ return array;
84
+ if (!isWireArray(array.value)) {
85
+ throw new AxiomError('ENGINE_ERROR', `${arrayPath} is not a list`, arrayPath);
86
+ }
87
+ const token = rowKeyToken(ref.rowKey);
88
+ const keys = this.rowKeysOf(arrayPath);
89
+ if (keys === undefined || keys.length !== array.value.length) {
90
+ throw new AxiomError('ENGINE_ERROR', `the covered target names a rowKey, but ${arrayPath} has no reconcileable row identity`, arrayPath);
91
+ }
92
+ const index = this.positionsOf(arrayPath, keys).get(token);
93
+ if (index === undefined)
94
+ return ABSENT;
95
+ const item = array.value[index];
96
+ if (item === undefined)
97
+ return ABSENT;
98
+ const members = wireMembers(item);
99
+ const matched = members?.[ref.fieldId];
100
+ if (matched === undefined)
101
+ return ABSENT;
102
+ const member = field.fields?.find((candidate) => candidate.fieldId === ref.fieldId);
103
+ return valueOf(matched, member?.primitive);
104
+ }
105
+ /** Indexes one array's keys once, refusing a duplicate rather than choosing a row. */
106
+ positionsOf(arrayPath, keys) {
107
+ const cached = this.rowPositions.get(arrayPath);
108
+ if (cached !== undefined)
109
+ return cached;
110
+ const positions = new Map();
111
+ for (const [index, key] of keys.entries()) {
112
+ const token = rowKeyToken(key);
113
+ if (positions.has(token)) {
114
+ throw new AxiomError('ENGINE_ERROR', `more than one row of ${arrayPath} carries the covered rowKey`, arrayPath);
115
+ }
116
+ positions.set(token, index);
117
+ }
118
+ this.rowPositions.set(arrayPath, positions);
119
+ return positions;
120
+ }
121
+ /** The declared array at `path`, when one is declared there. */
122
+ arrayDeclaration(path) {
123
+ const field = this.index.fieldsByPath.get(path);
124
+ return field !== undefined && field.primitive === 'array' ? field : undefined;
125
+ }
126
+ /**
127
+ * The one array declaring `fieldId` as an item member. `undefined` when none does or when
128
+ * more than one does, because a reference an artifact answers two ways is not a reference.
129
+ */
130
+ arrayDeclaringItemField(fieldId) {
131
+ const containers = this.itemContainers ?? buildItemContainers(this.index.fieldsByPath);
132
+ this.itemContainers = containers;
133
+ const paths = containers.get(fieldId);
134
+ if (paths === undefined || paths.length !== 1)
135
+ return undefined;
136
+ return paths[0];
137
+ }
138
+ }
139
+ //# sourceMappingURL=covered.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"covered.js","sourceRoot":"","sources":["../../../src/eval/reader/covered.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQxD;;;;;;;;;GASG;A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G,UAAU,CAAC;QACjC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAChE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF","sourcesContent":["import { AxiomError } from '../../model/errors.js';\nimport type { CompiledField, FieldRef, WireValue } from '../../model/types.js';\nimport { isUndetermined } from '../../model/types.js';\nimport { isWireArray, wireMembers } from '../../model/values.js';\nimport { rowKeyToken } from '../../model/wire.js';\nimport { ABSENT, valueOf } from '../expr/value.js';\nimport type { Evaluated } from '../expr/value.js';\nimport { addressingOfItems } from '../addressing.js';\nimport { buildItemContainers } from './declarations.js';\nimport type { RecordIndex } from './declarations.js';\n\n/**\n * The key list one declaration's element list answers, memoised per immutable list.\n */\ntype KeyCache = WeakMap<readonly WireValue[], readonly (string | number)[] | null>;\n\n/**\n * Row identity for covered targets: the canonical keys of one array, and the read a\n * `(fieldId, rowKey)` reference names. A reference inside an array item is matched on its\n * identity, never on a position; a key no row carries, or one two rows share, is not a\n * reference this reader can satisfy.\n *\n * The keys are the row-addressing authority's answer for the list this reader resolved —\n * access and the computed overlay already applied — so the answer a covered target is matched\n * against is the one a rule is allowed to see, and never a second derivation of its own.\n */\nexport class CoveredTargets {\n private readonly index: RecordIndex;\n private readonly read: (path: string) => Evaluated;\n private readonly declarationPathOf: (fieldId: string) => string;\n /** Item member fieldId to the arrays declaring it, built when a row target is read. */\n private itemContainers: ReadonlyMap<string, readonly string[]> | undefined;\n /**\n * Derived keys of one declared array, kept per immutable element list. One reader resolves one\n * identity answer, so a list a read returned is named by the same keys for its lifetime.\n * `null` records a list the authority could not address, so the refusal is not re-derived.\n */\n private readonly derivedKeys = new WeakMap<CompiledField, KeyCache>();\n /** Row positions by wire-typed key, built once per array rather than scanned per target. */\n private readonly rowPositions = new Map<string, ReadonlyMap<string, number>>();\n\n constructor(\n index: RecordIndex,\n read: (path: string) => Evaluated,\n declarationPathOf: (fieldId: string) => string,\n ) {\n this.index = index;\n this.read = read;\n this.declarationPathOf = declarationPathOf;\n }\n\n /**\n * The canonical row keys of one declared array in array order. `undefined` means the rows\n * cannot be identified here — no identity is declared, a row has no key member, or two rows\n * share one — so a caller that needs identity fails closed instead of falling back to a\n * position. An assigned array answers from the manifest its owner committed.\n */\n rowKeysOf(arrayPath: string): readonly (string | number)[] | undefined {\n const field = this.arrayDeclaration(arrayPath);\n if (field === undefined) return undefined;\n const array = this.read(arrayPath);\n if (array.kind !== 'value' || !isWireArray(array.value)) return undefined;\n const cached = this.derivedKeys.get(field)?.get(array.value);\n if (cached !== undefined) return cached ?? undefined;\n const addressing = addressingOfItems(\n field,\n array.value,\n this.index.assignedRowKeys?.(field.fieldId),\n );\n const keys =\n addressing.outcome === 'addressed' ? addressing.rows.map((row) => row.rowKey) : null;\n const byList: KeyCache = this.derivedKeys.get(field) ?? new WeakMap();\n byList.set(array.value, keys);\n this.derivedKeys.set(field, byList);\n return keys ?? undefined;\n }\n\n /**\n * The canonical row key of one item of a declared array, or `undefined` when the row cannot\n * be identified here.\n */\n rowKeyOf(arrayPath: string, index: number): string | number | undefined {\n return this.rowKeysOf(arrayPath)?.[index];\n }\n\n /** Reads the value a covered target names. */\n readTarget(ref: FieldRef): Evaluated {\n if (ref.rowKey === undefined) return this.read(this.declarationPathOf(ref.fieldId));\n const arrayPath = this.arrayDeclaringItemField(ref.fieldId);\n if (arrayPath === undefined) {\n throw new AxiomError(\n 'ENGINE_ERROR',\n `no declared array has one item field ${ref.fieldId}`,\n ref.fieldId,\n );\n }\n const field = this.arrayDeclaration(arrayPath);\n if (field === undefined) {\n throw new AxiomError('ENGINE_ERROR', `no array is declared at ${arrayPath}`, arrayPath);\n }\n const array = this.read(arrayPath);\n if (array.kind === 'absent') return ABSENT;\n if (isUndetermined(array.value)) return array;\n if (!isWireArray(array.value)) {\n throw new AxiomError('ENGINE_ERROR', `${arrayPath} is not a list`, arrayPath);\n }\n const token = rowKeyToken(ref.rowKey);\n const keys = this.rowKeysOf(arrayPath);\n if (keys === undefined || keys.length !== array.value.length) {\n throw new AxiomError(\n 'ENGINE_ERROR',\n `the covered target names a rowKey, but ${arrayPath} has no reconcileable row identity`,\n arrayPath,\n );\n }\n const index = this.positionsOf(arrayPath, keys).get(token);\n if (index === undefined) return ABSENT;\n const item = array.value[index];\n if (item === undefined) return ABSENT;\n const members = wireMembers(item);\n const matched = members?.[ref.fieldId];\n if (matched === undefined) return ABSENT;\n const member = field.fields?.find((candidate) => candidate.fieldId === ref.fieldId);\n return valueOf(matched, member?.primitive);\n }\n\n /** Indexes one array's keys once, refusing a duplicate rather than choosing a row. */\n private positionsOf(\n arrayPath: string,\n keys: readonly (string | number)[],\n ): ReadonlyMap<string, number> {\n const cached = this.rowPositions.get(arrayPath);\n if (cached !== undefined) return cached;\n const positions = new Map<string, number>();\n for (const [index, key] of keys.entries()) {\n const token = rowKeyToken(key);\n if (positions.has(token)) {\n throw new AxiomError(\n 'ENGINE_ERROR',\n `more than one row of ${arrayPath} carries the covered rowKey`,\n arrayPath,\n );\n }\n positions.set(token, index);\n }\n this.rowPositions.set(arrayPath, positions);\n return positions;\n }\n\n /** The declared array at `path`, when one is declared there. */\n private arrayDeclaration(path: string): CompiledField | undefined {\n const field = this.index.fieldsByPath.get(path);\n return field !== undefined && field.primitive === 'array' ? field : undefined;\n }\n\n /**\n * The one array declaring `fieldId` as an item member. `undefined` when none does or when\n * more than one does, because a reference an artifact answers two ways is not a reference.\n */\n private arrayDeclaringItemField(fieldId: string): string | undefined {\n const containers = this.itemContainers ?? buildItemContainers(this.index.fieldsByPath);\n this.itemContainers = containers;\n const paths = containers.get(fieldId);\n if (paths === undefined || paths.length !== 1) return undefined;\n return paths[0];\n }\n}\n"]}
@@ -0,0 +1,182 @@
1
+ import type { CompiledField, ComputedValue, ContextRoot, DiagnosticCode, FieldItem, LiteralDomain, Primitive, Undetermined, UndeterminedRows, WireValue } from '../../model/types.js';
2
+ /** A declared context root with its nullability resolved. */
3
+ export interface ContextRootDeclaration {
4
+ readonly primitive: Primitive;
5
+ readonly nullability: 'required' | 'optional';
6
+ /** The money domain a `money` root declares; absent on every other primitive. */
7
+ readonly currency?: string;
8
+ readonly scale?: number;
9
+ /** The unit domain a `quantity` root declares; required on a quantity root. */
10
+ readonly units?: readonly string[];
11
+ /** The unit a `duration` root declares; absent means `minutes`. */
12
+ readonly unit?: string;
13
+ /** The item domain a scalar or attachment array root declares. */
14
+ readonly items?: FieldItem;
15
+ }
16
+ /** The declared shape a reader resolves paths against. */
17
+ export interface RecordIndex {
18
+ readonly fieldsByPath: ReadonlyMap<string, CompiledField>;
19
+ readonly contextRoots: ReadonlyMap<string, ContextRootDeclaration>;
20
+ /**
21
+ * The values the environment contributes to the reserved context roots.
22
+ * A reserved root with no value reads as undetermined, so a rule that needs the record
23
+ * date fails closed rather than reading an invented one.
24
+ */
25
+ readonly reservedRoots?: ReadonlyMap<string, WireValue>;
26
+ /**
27
+ * The committed ids of one host-assigned array, in array order, `[IDENT-2.1.4]`.
28
+ *
29
+ * An assigned array's identity is the manifest the session owns, not a member of the row,
30
+ * so a reader that must name a row asks the owner rather than deriving one. A natural or
31
+ * value-identified array has no entry and derives its keys from the rows themselves.
32
+ */
33
+ readonly assignedRowKeys?: (fieldId: string) => readonly (string | number)[] | undefined;
34
+ }
35
+ /**
36
+ * The fields whose value a report may not quote when a rule reads them: a field hidden by a
37
+ * `visible` rule whose policy is `exclude`.
38
+ *
39
+ * `candidates` is the static superset the caller can decide needs a question at all, so a read
40
+ * of any other field costs nothing. `isWithheld` answers the current state for one candidate.
41
+ */
42
+ export interface WithheldFields {
43
+ readonly candidates: ReadonlySet<string>;
44
+ readonly isWithheld: (fieldId: string) => boolean;
45
+ }
46
+ /**
47
+ * The computed-value overlay an evaluation reads through.
48
+ *
49
+ * The reader asks the overlay only after it has resolved access, redaction and container
50
+ * membership, so a masked or hidden computed field is refused by the same policy as any other
51
+ * value and never becomes an oracle for a value the device may not read. `writers` is the
52
+ * static set the artifact declares, so a path that crosses one skips the read cache: an entry
53
+ * appears while the overlay is being built in dependency order, and a cached base value would
54
+ * outlive the writer that replaced it.
55
+ */
56
+ export interface ComputedValues {
57
+ /** The writer's result for a declared field, or `undefined` when no entry applies. */
58
+ get(fieldId: string): ComputedValue | undefined;
59
+ /** The writer's result for one row's member, or `undefined` when that row has no entry. */
60
+ getRow(fieldId: string, rowKey: string | number): ComputedValue | undefined;
61
+ /** Every field a writer owns, whether or not it has produced a value yet. */
62
+ readonly writers: ReadonlySet<string>;
63
+ }
64
+ /**
65
+ * What one path resolved to, before absence, refusal and undetermined state are folded into
66
+ * a value.
67
+ *
68
+ * A `value` here is a canonical wire value: the record reader validates a submitted value
69
+ * against the declaration the path reaches, once for the pass, so every consumer of this
70
+ * union works with a value the wire boundary would have admitted. `UNKNOWN` and `DEFERRED`
71
+ * ride in the same member because a missing required context root is undetermined rather
72
+ * than absent, and that sentinel is not a value of any declared primitive.
73
+ */
74
+ export type Resolved = {
75
+ readonly kind: 'value';
76
+ readonly value: WireValue | Undetermined;
77
+ readonly primitive: Primitive;
78
+ /** Access sideband a computed value carries beside its stripped wire tree. */
79
+ readonly withheldMembers?: readonly string[];
80
+ readonly withheldRows?: readonly (readonly string[])[];
81
+ /** The members a writer could not produce, per row, with the sentinel each read states. */
82
+ readonly undeterminedRows?: UndeterminedRows;
83
+ } | {
84
+ readonly kind: 'absent';
85
+ readonly primitive: Primitive;
86
+ } | {
87
+ readonly kind: 'unreadable';
88
+ readonly primitive: Primitive;
89
+ } | {
90
+ readonly kind: 'redacted';
91
+ readonly primitive: Primitive;
92
+ };
93
+ /**
94
+ * The submission's answer for one path, before any computed overlay is applied.
95
+ *
96
+ * The submission cannot change while an evaluation runs, so this is the part of a read worth
97
+ * remembering: it is validated once per path, and each read that crosses a computed writer
98
+ * re-applies the overlay over it instead of copying and checking the whole tree again.
99
+ *
100
+ * `absent` and `missing` are different facts. A field holding nothing may still have a
101
+ * computed member — a writer produces the container from nothing — while a member below an
102
+ * absent parent cannot be reached by a writer at all, and must not be merged into existence.
103
+ */
104
+ export type Submitted = {
105
+ readonly kind: 'value';
106
+ readonly value: WireValue;
107
+ readonly primitive: Primitive;
108
+ } | {
109
+ readonly kind: 'absent';
110
+ readonly primitive: Primitive;
111
+ } | {
112
+ readonly kind: 'missing';
113
+ readonly primitive: Primitive;
114
+ };
115
+ /**
116
+ * The values the environment supplies to the reserved context roots.
117
+ *
118
+ * They come from the call rather than the record: the record date is the host's
119
+ * and the schema version is the artifact's own.
120
+ */
121
+ export declare function reservedContextValues(recordDate: string | undefined, schemaVersion: number | undefined): ReadonlyMap<string, WireValue>;
122
+ /** Indexes every declared field by its dotted path, containers included. */
123
+ export declare function indexFields(fields: readonly CompiledField[]): ReadonlyMap<string, CompiledField>;
124
+ /**
125
+ * Indexes the declared context roots by the path an expression reads, defaulting nullability
126
+ * to required. A document may spell a root with or without its leading `context.` segment —
127
+ * both are legal under and the compiler resolves `context.<path>` against the
128
+ * bare path — so the reader keys every root the same way and the two spellings describe one
129
+ * root rather than a declaration the runtime cannot find.
130
+ */
131
+ export declare function indexContextRoots(roots: readonly ContextRoot[] | undefined): ReadonlyMap<string, ContextRootDeclaration>;
132
+ /** The item members of every declared array, so a row target can find its container once. */
133
+ export declare function buildItemContainers(fieldsByPath: ReadonlyMap<string, CompiledField>): ReadonlyMap<string, readonly string[]>;
134
+ /**
135
+ * The declaration path of every leaf `fieldId`. A rule and a `FieldRef` name a
136
+ * field by its identifier, which is a member of a record or item declaration rather than a path;
137
+ * the document's identifiers are unique across every nesting level, so one identifier names one
138
+ * declaration. A hand-built artifact that declares two is recorded as two, so a reference it
139
+ * cannot resolve fails closed instead of taking whichever declaration the walk reached first.
140
+ */
141
+ export declare function buildDeclarationPaths(fieldsByPath: ReadonlyMap<string, CompiledField>): ReadonlyMap<string, readonly string[]>;
142
+ /** The declared natural-key member of an array, if it has one. */
143
+ export declare function naturalKeyMember(field: CompiledField): string | undefined;
144
+ /**
145
+ * One container's undetermined state from its members: `UNKNOWN` beats `DEFERRED`, because a
146
+ * missing local reading is a stronger refusal than a value computed elsewhere.
147
+ */
148
+ export declare function foldUndetermined(pending: Undetermined | undefined, next: Undetermined): Undetermined;
149
+ /**
150
+ * Whether a path reads a context root rather than a declared record field. The declared roots
151
+ * own the `context.` prefix wherever they claim a path, but `context` is not a reserved word
152
+ * and makes every declared field a read root, so a path no root
153
+ * declares reads the record field of that name instead. The compiler resolves the same way, so
154
+ * a guard that type-checks against a field called `context` is readable here; and every
155
+ * consumer that classifies a path — the reader and the derived read set alike — asks this one
156
+ * function rather than testing the prefix itself.
157
+ */
158
+ export declare function isContextRootPath(path: string, index: RecordIndex): boolean;
159
+ /** The declared array path's item domain, when the declaration states one. */
160
+ export declare function elementDomainOfField(field: CompiledField | undefined): LiteralDomain | undefined;
161
+ /**
162
+ * The declared path a leaf `fieldId` names: a rule and a `FieldRef` name a
163
+ * field by its identifier, so the path a record, item or nested declaration gives it has to be
164
+ * resolved before it can be read. No declaration, or two sharing one identifier, is refused
165
+ * rather than read as a path that happens to spell the identifier.
166
+ */
167
+ export declare function declarationPathOf(declarationPaths: ReadonlyMap<string, readonly string[]>, fieldId: string): string;
168
+ /** Where the reader reports a refused access, so the caller's report carries it. */
169
+ export type AccessDeniedSink = (code: DiagnosticCode, fieldId: string) => void;
170
+ /**
171
+ * Whether a field's `visible` rules leave it visible. The reader answers
172
+ * relevance but does not own rules, so the schema that declares them supplies the answer.
173
+ * The seam is total: every field it is asked about gets a decided visible or hidden.
174
+ */
175
+ export type FieldVisibility = (fieldId: string) => boolean;
176
+ /**
177
+ * The visibility answer for a reader that holds no rules: standalone guard evaluation and
178
+ * signature verification read an expression outside any schema's rules, so no `visible`
179
+ * rule can hide a field from them.
180
+ */
181
+ export declare const NO_VISIBLE_RULES: FieldVisibility;
182
+ //# sourceMappingURL=declarations.d.ts.map
@@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,IAAI,EAAE,YAAY,GACjB,YAAY,CAGd;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAK3E;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAEhG;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,EACxD,OAAO,EAAE,MAAM,GACd,MAAM,CAOR;AAED,oFAAoF;AACpF,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAE/E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAA4B,CAAC"}
@@ -0,0 +1,153 @@
1
+ import { AxiomError } from '../../model/errors.js';
2
+ import { isReservedContextRoot, RESERVED_CONTEXT_ROOTS } from '../../model/types.js';
3
+ /**
4
+ * The values the environment supplies to the reserved context roots.
5
+ *
6
+ * They come from the call rather than the record: the record date is the host's
7
+ * and the schema version is the artifact's own.
8
+ */
9
+ export function reservedContextValues(recordDate, schemaVersion) {
10
+ const values = new Map();
11
+ if (recordDate !== undefined)
12
+ values.set('record_date', recordDate);
13
+ if (schemaVersion !== undefined)
14
+ values.set('schema_version', schemaVersion);
15
+ return values;
16
+ }
17
+ /** Indexes every declared field by its dotted path, containers included. */
18
+ export function indexFields(fields) {
19
+ const fieldsByPath = new Map();
20
+ const visit = (members, prefix) => {
21
+ for (const field of members) {
22
+ const path = prefix === '' ? field.fieldId : `${prefix}.${field.fieldId}`;
23
+ fieldsByPath.set(path, field);
24
+ visit(field.fields ?? [], path);
25
+ }
26
+ };
27
+ visit(fields, '');
28
+ return fieldsByPath;
29
+ }
30
+ /**
31
+ * Indexes the declared context roots by the path an expression reads, defaulting nullability
32
+ * to required. A document may spell a root with or without its leading `context.` segment —
33
+ * both are legal under and the compiler resolves `context.<path>` against the
34
+ * bare path — so the reader keys every root the same way and the two spellings describe one
35
+ * root rather than a declaration the runtime cannot find.
36
+ */
37
+ export function indexContextRoots(roots) {
38
+ const declarations = new Map();
39
+ // The reserved roots are readable without declaration, and the compiler
40
+ // refuses a schema that declares one, so a declaration reaching here is an artifact the
41
+ // compiler never emitted: the reserved entry wins rather than letting it state a different
42
+ // primitive for a value the environment supplies.
43
+ for (const root of RESERVED_CONTEXT_ROOTS) {
44
+ declarations.set(root.path, { primitive: root.primitive, nullability: 'required' });
45
+ }
46
+ for (const root of roots ?? []) {
47
+ const path = root.path.replace(/^context\./, '');
48
+ if (isReservedContextRoot(path))
49
+ continue;
50
+ declarations.set(path, {
51
+ primitive: root.primitive,
52
+ nullability: root.nullability ?? 'required',
53
+ ...(root.currency === undefined ? {} : { currency: root.currency }),
54
+ ...(root.scale === undefined ? {} : { scale: root.scale }),
55
+ ...(root.units === undefined ? {} : { units: root.units }),
56
+ ...(root.unit === undefined ? {} : { unit: root.unit }),
57
+ ...(root.items === undefined ? {} : { items: root.items }),
58
+ });
59
+ }
60
+ return declarations;
61
+ }
62
+ /** The item members of every declared array, so a row target can find its container once. */
63
+ export function buildItemContainers(fieldsByPath) {
64
+ const containers = new Map();
65
+ for (const [path, field] of fieldsByPath) {
66
+ if (field.primitive !== 'array')
67
+ continue;
68
+ for (const member of field.fields ?? []) {
69
+ const paths = containers.get(member.fieldId);
70
+ if (paths === undefined)
71
+ containers.set(member.fieldId, [path]);
72
+ else
73
+ paths.push(path);
74
+ }
75
+ }
76
+ return containers;
77
+ }
78
+ /**
79
+ * The declaration path of every leaf `fieldId`. A rule and a `FieldRef` name a
80
+ * field by its identifier, which is a member of a record or item declaration rather than a path;
81
+ * the document's identifiers are unique across every nesting level, so one identifier names one
82
+ * declaration. A hand-built artifact that declares two is recorded as two, so a reference it
83
+ * cannot resolve fails closed instead of taking whichever declaration the walk reached first.
84
+ */
85
+ export function buildDeclarationPaths(fieldsByPath) {
86
+ const paths = new Map();
87
+ for (const [path, field] of fieldsByPath) {
88
+ const declared = paths.get(field.fieldId);
89
+ if (declared === undefined)
90
+ paths.set(field.fieldId, [path]);
91
+ else
92
+ declared.push(path);
93
+ }
94
+ return paths;
95
+ }
96
+ /** The declared natural-key member of an array, if it has one. */
97
+ export function naturalKeyMember(field) {
98
+ const declaration = field.rowKey;
99
+ if (declaration?.mode !== 'natural' || declaration.fieldId === undefined)
100
+ return undefined;
101
+ return declaration.fieldId;
102
+ }
103
+ /**
104
+ * One container's undetermined state from its members: `UNKNOWN` beats `DEFERRED`, because a
105
+ * missing local reading is a stronger refusal than a value computed elsewhere.
106
+ */
107
+ export function foldUndetermined(pending, next) {
108
+ if (pending === undefined)
109
+ return next;
110
+ return pending.undetermined === 'UNKNOWN' ? pending : next;
111
+ }
112
+ /**
113
+ * Whether a path reads a context root rather than a declared record field. The declared roots
114
+ * own the `context.` prefix wherever they claim a path, but `context` is not a reserved word
115
+ * and makes every declared field a read root, so a path no root
116
+ * declares reads the record field of that name instead. The compiler resolves the same way, so
117
+ * a guard that type-checks against a field called `context` is readable here; and every
118
+ * consumer that classifies a path — the reader and the derived read set alike — asks this one
119
+ * function rather than testing the prefix itself.
120
+ */
121
+ export function isContextRootPath(path, index) {
122
+ const segments = path.split('.');
123
+ if (segments[0] !== 'context')
124
+ return false;
125
+ if (index.contextRoots.has(segments.slice(1).join('.')))
126
+ return true;
127
+ return !index.fieldsByPath.has('context');
128
+ }
129
+ /** The declared array path's item domain, when the declaration states one. */
130
+ export function elementDomainOfField(field) {
131
+ return field?.primitive === 'array' ? field.items?.primitive : undefined;
132
+ }
133
+ /**
134
+ * The declared path a leaf `fieldId` names: a rule and a `FieldRef` name a
135
+ * field by its identifier, so the path a record, item or nested declaration gives it has to be
136
+ * resolved before it can be read. No declaration, or two sharing one identifier, is refused
137
+ * rather than read as a path that happens to spell the identifier.
138
+ */
139
+ export function declarationPathOf(declarationPaths, fieldId) {
140
+ const paths = declarationPaths.get(fieldId) ?? [];
141
+ const [only] = paths;
142
+ if (paths.length !== 1 || only === undefined) {
143
+ throw new AxiomError('ENGINE_ERROR', `no single declared field is named ${fieldId}`, fieldId);
144
+ }
145
+ return only;
146
+ }
147
+ /**
148
+ * The visibility answer for a reader that holds no rules: standalone guard evaluation and
149
+ * signature verification read an expression outside any schema's rules, so no `visible`
150
+ * rule can hide a field from them.
151
+ */
152
+ export const NO_VISIBLE_RULES = () => true;
153
+ //# sourceMappingURL=declarations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarations.js","sourceRoot":"","sources":["../../../src/eval/reader/declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAanD,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AA6GrF;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,UAA8B,EAC9B,aAAiC;IAEjC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC5C,IAAI,UAAU,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACpE,IAAI,aAAa,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IAC7E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,MAAgC;IAC1D,MAAM,YAAY,GAAG,IAAI,GAAG,EAAyB,CAAC;IACtD,MAAM,KAAK,GAAG,CAAC,OAAiC,EAAE,MAAc,EAAQ,EAAE;QACxE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,IAAI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AC,IAAI,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACrE,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,oBAAoB,CAAC,KAAgC;IACnE,OAAO,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,gBAAwD,EACxD,OAAe;IAEf,MAAM,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAClD,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACrB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7C,MAAM,IAAI,UAAU,CAAC,cAAc,EAAE,qCAAqC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAYD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoB,GAAG,EAAE,CAAC,IAAI,CAAC","sourcesContent":["import { AxiomError } from '../../model/errors.js';\nimport type {\n CompiledField,\n ComputedValue,\n ContextRoot,\n DiagnosticCode,\n FieldItem,\n LiteralDomain,\n Primitive,\n Undetermined,\n UndeterminedRows,\n WireValue,\n} from '../../model/types.js';\nimport { isReservedContextRoot, RESERVED_CONTEXT_ROOTS } from '../../model/types.js';\n\n/** A declared context root with its nullability resolved. */\nexport interface ContextRootDeclaration {\n readonly primitive: Primitive;\n readonly nullability: 'required' | 'optional';\n /** The money domain a `money` root declares; absent on every other primitive. */\n readonly currency?: string;\n readonly scale?: number;\n /** The unit domain a `quantity` root declares; required on a quantity root. */\n readonly units?: readonly string[];\n /** The unit a `duration` root declares; absent means `minutes`. */\n readonly unit?: string;\n /** The item domain a scalar or attachment array root declares. */\n readonly items?: FieldItem;\n}\n\n/** The declared shape a reader resolves paths against. */\nexport interface RecordIndex {\n readonly fieldsByPath: ReadonlyMap<string, CompiledField>;\n readonly contextRoots: ReadonlyMap<string, ContextRootDeclaration>;\n /**\n * The values the environment contributes to the reserved context roots.\n * A reserved root with no value reads as undetermined, so a rule that needs the record\n * date fails closed rather than reading an invented one.\n */\n readonly reservedRoots?: ReadonlyMap<string, WireValue>;\n /**\n * The committed ids of one host-assigned array, in array order, `[IDENT-2.1.4]`.\n *\n * An assigned array's identity is the manifest the session owns, not a member of the row,\n * so a reader that must name a row asks the owner rather than deriving one. A natural or\n * value-identified array has no entry and derives its keys from the rows themselves.\n */\n readonly assignedRowKeys?: (fieldId: string) => readonly (string | number)[] | undefined;\n}\n\n/**\n * The fields whose value a report may not quote when a rule reads them: a field hidden by a\n * `visible` rule whose policy is `exclude`.\n *\n * `candidates` is the static superset the caller can decide needs a question at all, so a read\n * of any other field costs nothing. `isWithheld` answers the current state for one candidate.\n */\nexport interface WithheldFields {\n readonly candidates: ReadonlySet<string>;\n readonly isWithheld: (fieldId: string) => boolean;\n}\n\n/**\n * The computed-value overlay an evaluation reads through.\n *\n * The reader asks the overlay only after it has resolved access, redaction and container\n * membership, so a masked or hidden computed field is refused by the same policy as any other\n * value and never becomes an oracle for a value the device may not read. `writers` is the\n * static set the artifact declares, so a path that crosses one skips the read cache: an entry\n * appears while the overlay is being built in dependency order, and a cached base value would\n * outlive the writer that replaced it.\n */\nexport interface ComputedValues {\n /** The writer's result for a declared field, or `undefined` when no entry applies. */\n get(fieldId: string): ComputedValue | undefined;\n /** The writer's result for one row's member, or `undefined` when that row has no entry. */\n getRow(fieldId: string, rowKey: string | number): ComputedValue | undefined;\n /** Every field a writer owns, whether or not it has produced a value yet. */\n readonly writers: ReadonlySet<string>;\n}\n\n/**\n * What one path resolved to, before absence, refusal and undetermined state are folded into\n * a value.\n *\n * A `value` here is a canonical wire value: the record reader validates a submitted value\n * against the declaration the path reaches, once for the pass, so every consumer of this\n * union works with a value the wire boundary would have admitted. `UNKNOWN` and `DEFERRED`\n * ride in the same member because a missing required context root is undetermined rather\n * than absent, and that sentinel is not a value of any declared primitive.\n */\nexport type Resolved =\n | {\n readonly kind: 'value';\n readonly value: WireValue | Undetermined;\n readonly primitive: Primitive;\n /** Access sideband a computed value carries beside its stripped wire tree. */\n readonly withheldMembers?: readonly string[];\n readonly withheldRows?: readonly (readonly string[])[];\n /** The members a writer could not produce, per row, with the sentinel each read states. */\n readonly undeterminedRows?: UndeterminedRows;\n }\n | { readonly kind: 'absent'; readonly primitive: Primitive }\n | { readonly kind: 'unreadable'; readonly primitive: Primitive }\n | { readonly kind: 'redacted'; readonly primitive: Primitive };\n\n/**\n * The submission's answer for one path, before any computed overlay is applied.\n *\n * The submission cannot change while an evaluation runs, so this is the part of a read worth\n * remembering: it is validated once per path, and each read that crosses a computed writer\n * re-applies the overlay over it instead of copying and checking the whole tree again.\n *\n * `absent` and `missing` are different facts. A field holding nothing may still have a\n * computed member — a writer produces the container from nothing — while a member below an\n * absent parent cannot be reached by a writer at all, and must not be merged into existence.\n */\nexport type Submitted =\n | { readonly kind: 'value'; readonly value: WireValue; readonly primitive: Primitive }\n | { readonly kind: 'absent'; readonly primitive: Primitive }\n | { readonly kind: 'missing'; readonly primitive: Primitive };\n\n/**\n * The values the environment supplies to the reserved context roots.\n *\n * They come from the call rather than the record: the record date is the host's\n * and the schema version is the artifact's own.\n */\nexport function reservedContextValues(\n recordDate: string | undefined,\n schemaVersion: number | undefined,\n): ReadonlyMap<string, WireValue> {\n const values = new Map<string, WireValue>();\n if (recordDate !== undefined) values.set('record_date', recordDate);\n if (schemaVersion !== undefined) values.set('schema_version', schemaVersion);\n return values;\n}\n\n/** Indexes every declared field by its dotted path, containers included. */\nexport function indexFields(fields: readonly CompiledField[]): ReadonlyMap<string, CompiledField> {\n const fieldsByPath = new Map<string, CompiledField>();\n const visit = (members: readonly CompiledField[], prefix: string): void => {\n for (const field of members) {\n const path = prefix === '' ? field.fieldId : `${prefix}.${field.fieldId}`;\n fieldsByPath.set(path, field);\n visit(field.fields ?? [], path);\n }\n };\n visit(fields, '');\n return fieldsByPath;\n}\n/**\n * Indexes the declared context roots by the path an expression reads, defaulting nullability\n * to required. A document may spell a root with or without its leading `context.` segment —\n * both are legal under and the compiler resolves `context.<path>` against the\n * bare path — so the reader keys every root the same way and the two spellings describe one\n * root rather than a declaration the runtime cannot find.\n */\nexport function indexContextRoots(\n roots: readonly ContextRoot[] | undefined,\n): ReadonlyMap<string, ContextRootDeclaration> {\n const declarations = new Map<string, ContextRootDeclaration>();\n // The reserved roots are readable without declaration, and the compiler\n // refuses a schema that declares one, so a declaration reaching here is an artifact the\n // compiler never emitted: the reserved entry wins rather than letting it state a different\n // primitive for a value the environment supplies.\n for (const root of RESERVED_CONTEXT_ROOTS) {\n declarations.set(root.path, { primitive: root.primitive, nullability: 'required' });\n }\n for (const root of roots ?? []) {\n const path = root.path.replace(/^context\\./, '');\n if (isReservedContextRoot(path)) continue;\n declarations.set(path, {\n primitive: root.primitive,\n nullability: root.nullability ?? 'required',\n ...(root.currency === undefined ? {} : { currency: root.currency }),\n ...(root.scale === undefined ? {} : { scale: root.scale }),\n ...(root.units === undefined ? {} : { units: root.units }),\n ...(root.unit === undefined ? {} : { unit: root.unit }),\n ...(root.items === undefined ? {} : { items: root.items }),\n });\n }\n return declarations;\n}\n\n/** The item members of every declared array, so a row target can find its container once. */\nexport function buildItemContainers(\n fieldsByPath: ReadonlyMap<string, CompiledField>,\n): ReadonlyMap<string, readonly string[]> {\n const containers = new Map<string, string[]>();\n for (const [path, field] of fieldsByPath) {\n if (field.primitive !== 'array') continue;\n for (const member of field.fields ?? []) {\n const paths = containers.get(member.fieldId);\n if (paths === undefined) containers.set(member.fieldId, [path]);\n else paths.push(path);\n }\n }\n return containers;\n}\n\n/**\n * The declaration path of every leaf `fieldId`. A rule and a `FieldRef` name a\n * field by its identifier, which is a member of a record or item declaration rather than a path;\n * the document's identifiers are unique across every nesting level, so one identifier names one\n * declaration. A hand-built artifact that declares two is recorded as two, so a reference it\n * cannot resolve fails closed instead of taking whichever declaration the walk reached first.\n */\nexport function buildDeclarationPaths(\n fieldsByPath: ReadonlyMap<string, CompiledField>,\n): ReadonlyMap<string, readonly string[]> {\n const paths = new Map<string, string[]>();\n for (const [path, field] of fieldsByPath) {\n const declared = paths.get(field.fieldId);\n if (declared === undefined) paths.set(field.fieldId, [path]);\n else declared.push(path);\n }\n return paths;\n}\n\n/** The declared natural-key member of an array, if it has one. */\nexport function naturalKeyMember(field: CompiledField): string | undefined {\n const declaration = field.rowKey;\n if (declaration?.mode !== 'natural' || declaration.fieldId === undefined) return undefined;\n return declaration.fieldId;\n}\n\n/**\n * One container's undetermined state from its members: `UNKNOWN` beats `DEFERRED`, because a\n * missing local reading is a stronger refusal than a value computed elsewhere.\n */\nexport function foldUndetermined(\n pending: Undetermined | undefined,\n next: Undetermined,\n): Undetermined {\n if (pending === undefined) return next;\n return pending.undetermined === 'UNKNOWN' ? pending : next;\n}\n\n/**\n * Whether a path reads a context root rather than a declared record field. The declared roots\n * own the `context.` prefix wherever they claim a path, but `context` is not a reserved word\n * and makes every declared field a read root, so a path no root\n * declares reads the record field of that name instead. The compiler resolves the same way, so\n * a guard that type-checks against a field called `context` is readable here; and every\n * consumer that classifies a path — the reader and the derived read set alike — asks this one\n * function rather than testing the prefix itself.\n */\nexport function isContextRootPath(path: string, index: RecordIndex): boolean {\n const segments = path.split('.');\n if (segments[0] !== 'context') return false;\n if (index.contextRoots.has(segments.slice(1).join('.'))) return true;\n return !index.fieldsByPath.has('context');\n}\n\n/** The declared array path's item domain, when the declaration states one. */\nexport function elementDomainOfField(field: CompiledField | undefined): LiteralDomain | undefined {\n return field?.primitive === 'array' ? field.items?.primitive : undefined;\n}\n\n/**\n * The declared path a leaf `fieldId` names: a rule and a `FieldRef` name a\n * field by its identifier, so the path a record, item or nested declaration gives it has to be\n * resolved before it can be read. No declaration, or two sharing one identifier, is refused\n * rather than read as a path that happens to spell the identifier.\n */\nexport function declarationPathOf(\n declarationPaths: ReadonlyMap<string, readonly string[]>,\n fieldId: string,\n): string {\n const paths = declarationPaths.get(fieldId) ?? [];\n const [only] = paths;\n if (paths.length !== 1 || only === undefined) {\n throw new AxiomError('ENGINE_ERROR', `no single declared field is named ${fieldId}`, fieldId);\n }\n return only;\n}\n\n/** Where the reader reports a refused access, so the caller's report carries it. */\nexport type AccessDeniedSink = (code: DiagnosticCode, fieldId: string) => void;\n\n/**\n * Whether a field's `visible` rules leave it visible. The reader answers\n * relevance but does not own rules, so the schema that declares them supplies the answer.\n * The seam is total: every field it is asked about gets a decided visible or hidden.\n */\nexport type FieldVisibility = (fieldId: string) => boolean;\n\n/**\n * The visibility answer for a reader that holds no rules: standalone guard evaluation and\n * signature verification read an expression outside any schema's rules, so no `visible`\n * rule can hide a field from them.\n */\nexport const NO_VISIBLE_RULES: FieldVisibility = () => true;\n"]}
@@ -0,0 +1,87 @@
1
+ import type { CompiledField, FieldAccess, FieldRef, WireValue } from '../../model/types.js';
2
+ /** The reader state a membership question needs: whether one reference is readable. */
3
+ export interface MemberReading {
4
+ isReadable(ref: FieldRef): boolean;
5
+ recordDenied(fieldId: string, rowKey?: string | number): void;
6
+ }
7
+ /** The reader state the redaction question adds: the fields the host withheld outright. */
8
+ export interface MemberAccess extends MemberReading {
9
+ readonly redactedFields: ReadonlySet<string>;
10
+ }
11
+ /**
12
+ * The first declared member of a value this device may not read, or `undefined` when every
13
+ * member is readable. The member is named rather than only counted so the caller can say
14
+ * which field its own read was refused.
15
+ */
16
+ export declare function denyUnreadableMember(access: MemberReading, field: CompiledField): string | undefined;
17
+ /**
18
+ * Whether every declared member of a container is readable without a per-row question.
19
+ *
20
+ * Alias-free access — `read_write` or `read_only` — is the same answer for every row a member
21
+ * belongs to, so a container read that finds this true need not walk its rows: no member can be
22
+ * withheld for one row only. A `write_only` member is not in this set even when the session
23
+ * wrote it for every row, because the unlock is keyed by the row and only the slow path can
24
+ * decide which rows it reaches.
25
+ */
26
+ export declare function membersAreFullyReadable(access: {
27
+ accessFor(ref: FieldRef): FieldAccess;
28
+ }, field: CompiledField): boolean;
29
+ /** Every explicitly redacted field and every descendant whose read that redaction also refuses. */
30
+ export declare function redactedFieldIds(fields: readonly CompiledField[], declared: Iterable<string>): ReadonlySet<string>;
31
+ /** Whether any declared member of the value is redacted for this device. */
32
+ export declare function hasRedactedMember(access: MemberAccess, field: CompiledField): boolean;
33
+ /** One record array's members, asked with the row each member belongs to. */
34
+ export interface RowMemberRead {
35
+ readonly field: CompiledField;
36
+ readonly rows: readonly WireValue[];
37
+ /** The canonical key of one row in array order, or `undefined` when the row cannot be named. */
38
+ readonly rowKeyOf: (row: WireValue, index: number) => string | number | undefined;
39
+ readonly isReadable: (ref: FieldRef) => boolean;
40
+ /**
41
+ * Whether the container row itself may be read. A row-exact restriction on the array withholds
42
+ * that row's cells, and its key still names it: the key member answers for itself
43
+ * (`[ACCESS-1.3.1]`).
44
+ */
45
+ readonly isRowReadable: (rowKey: string | number) => boolean;
46
+ /**
47
+ * Whether one reference is redacted, which the row states as `DEFERRED` rather than `UNKNOWN`:
48
+ * the value exists and is the server's (`[ACCESS-3.1.2]`).
49
+ */
50
+ readonly isRedacted: (ref: FieldRef) => boolean;
51
+ readonly recordDenied: (fieldId: string, rowKey?: string | number) => void;
52
+ }
53
+ /** One array read with the members a row's access withholds removed. */
54
+ export interface RowMembersRead {
55
+ readonly rows: readonly WireValue[];
56
+ /** The references the read refused, in declaration order, so replay keeps their rows. */
57
+ readonly denied: readonly FieldRef[];
58
+ /**
59
+ * The members redacted from each row, in array order: the value exists on another tier, so the
60
+ * binder answers `DEFERRED` for it rather than the `UNKNOWN` a strip would otherwise state.
61
+ */
62
+ readonly deferred: readonly (readonly string[])[];
63
+ /**
64
+ * The members withheld from each row, in array order and named by their dotted path inside
65
+ * the row. It is what lets a binder answer `UNKNOWN` for a member the row no longer carries:
66
+ * without it the value tree would say the member is absent, and an absence-sensitive question
67
+ * would confirm a fact access left undecided.
68
+ */
69
+ readonly withheld: readonly (readonly string[])[];
70
+ }
71
+ /**
72
+ * One record array with every member this device may not read removed, per row.
73
+ *
74
+ * A container read carries every row and every member it holds, but access is answered per
75
+ * reference: a member may be `write_only` for every row, or for one row, or readable in a
76
+ * row this session wrote. Denying the whole container for one restricted member threw away
77
+ * the rows and members the device *may* read — an item rule over an array with one `masked`
78
+ * member could not evaluate at all, and a format check on a value the user had just typed into
79
+ * a `write_only` row never ran (`ACCESS-1.3.1`). The value a rule may not read is still never
80
+ * delivered: it is removed from the row before the element reaches an expression.
81
+ *
82
+ * `undefined` means the read cannot be decided per row — a row the engine cannot name, or a
83
+ * nested array whose own members are withheld — so the caller keeps the whole-read refusal
84
+ * rather than matching a member to the nearest row.
85
+ */
86
+ export declare function withoutUnreadableMembers(read: RowMemberRead): RowMembersRead | undefined;
87
+ //# sourceMappingURL=member-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-access.d.ts","sourceRoot":"","sources":["../../../src/eval/reader/member-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAI5F,uFAAuF;AACvF,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC;IACnC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC/D;AAED,2FAA2F;AAC3F,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,K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