@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,560 @@
1
+ import { AxiomError } from '../model/errors.js';
2
+ import { rowKeyToken } from '../model/wire.js';
3
+ import { fieldKey, fieldRefFields, permitsReadOf } from './access/projection.js';
4
+ import { createDenialLog } from './denials.js';
5
+ import { resolvePath, resolveRows, resolveSubmission } from './reader/resolve.js';
6
+ import { contextValueFor, rawPresence } from './reader/context-value.js';
7
+ import { CoveredTargets } from './reader/covered.js';
8
+ import { buildDeclarationPaths, declarationPathOf } from './reader/declarations.js';
9
+ import { denyUnreadableMember, hasRedactedMember } from './reader/member-access.js';
10
+ import { ReadMemo } from './reader/memo.js';
11
+ import { ComputedReads } from './reader/overlay.js';
12
+ import { canReadPath, isRelevantPath, presenceOf } from './reader/questions.js';
13
+ import { evaluatedOf, readValue } from './reader/value-read.js';
14
+ import { WithheldTaint } from './reader/withheld.js';
15
+ export { NO_VISIBLE_RULES, indexContextRoots, indexFields, isContextRootPath, reservedContextValues, } from './reader/declarations.js';
16
+ /**
17
+ * The declared member names of one record declaration, in declaration order.
18
+ *
19
+ * The list is a property of the declaration list, which a compiled artifact keeps immutable,
20
+ * so it is built once per declaration rather than once per read of a record field.
21
+ */
22
+ const DECLARED_MEMBERS = new WeakMap();
23
+ /**
24
+ * The member names of one declaration, computed once.
25
+ *
26
+ * `read()` attaches this list to every value it returns so `keys`/`values` answer declaration
27
+ * order; the members record is already memoised by the declaration array, so the names ride on
28
+ * the same identity instead of one `Object.keys` per path read.
29
+ */
30
+ const DECLARED_MEMBER_NAMES = new WeakMap();
31
+ function memberNames(members) {
32
+ const cached = DECLARED_MEMBER_NAMES.get(members);
33
+ if (cached !== undefined)
34
+ return cached;
35
+ const names = Object.keys(members);
36
+ DECLARED_MEMBER_NAMES.set(members, names);
37
+ return names;
38
+ }
39
+ function recordMembers(fields) {
40
+ const cached = DECLARED_MEMBERS.get(fields);
41
+ if (cached !== undefined)
42
+ return cached;
43
+ const members = {};
44
+ for (const field of fields)
45
+ members[field.fieldId] = field.primitive;
46
+ DECLARED_MEMBERS.set(fields, members);
47
+ return members;
48
+ }
49
+ /**
50
+ * Resolves the paths of one record and context, `spec/semantics/context-v1.md`.
51
+ *
52
+ * The reader owns the trust boundary between a caller's values and an expression: it
53
+ * applies the access projection, redaction, absence and the canonical wire reader, and
54
+ * it answers presence and relevance without pretending either is a value. Expressions
55
+ * read through it; no construct reaches around it.
56
+ */
57
+ export class RecordReader {
58
+ index;
59
+ input;
60
+ onAccessDenied;
61
+ /** The rule whose expression is being evaluated, so a refusal is attributed to its reader. */
62
+ ruleIdOf;
63
+ capabilities;
64
+ access;
65
+ /**
66
+ * The fields the host named as redacted, whatever row it named: a container read carries every
67
+ * row.
68
+ *
69
+ * It is the host's own statement, so it is the set a read is refused by. The derived inheritance
70
+ * (`AccessWindow.redactedFields`, which also carries every descendant of a named declaration) is
71
+ * a different question and is asked where a value's presence is stated; this one stays exact
72
+ * because a read of a declaration the host did not name is not a redacted read.
73
+ */
74
+ redactedFields;
75
+ sessionWriteKeys;
76
+ deniedReads = new Set();
77
+ consideredRefs = new Map();
78
+ /**
79
+ * The same reads attributed to the rule in force when each one happened, so one rule's
80
+ * report contribution states exactly the fields that rule considered and a replay of two
81
+ * contributions unions to the report's access projection.
82
+ */
83
+ consideredByRule = new Map();
84
+ visibility;
85
+ computed;
86
+ resolvedCache = new Map();
87
+ readCache = new Map();
88
+ /**
89
+ * The validated submission of every path a computed writer can still change.
90
+ *
91
+ * The record cannot change while an evaluation runs, so the part of a read that copies and
92
+ * checks the submitted value is derivable once per path; only the overlay over it moves.
93
+ */
94
+ submittedCache = new Map();
95
+ /** The path, domain and context-root answers memoised for this pass. */
96
+ memo;
97
+ /** Leaf `fieldId` to the declaration paths naming it. */
98
+ declarationPaths;
99
+ withheldTaint;
100
+ overlay;
101
+ covered;
102
+ constructor(index, input, access, capabilities, onAccessDenied, visibility, ruleIdOf = () => undefined, withheld, computed, currentRowKey = () => undefined) {
103
+ this.index = index;
104
+ this.input = input;
105
+ this.capabilities = capabilities;
106
+ this.onAccessDenied = onAccessDenied;
107
+ this.visibility = visibility;
108
+ this.ruleIdOf = ruleIdOf;
109
+ this.currentRowKey = currentRowKey;
110
+ this.computed = computed;
111
+ this.declarationPaths = buildDeclarationPaths(index.fieldsByPath);
112
+ this.memo = new ReadMemo(index);
113
+ this.withheldTaint = new WithheldTaint(withheld, (path) => this.walked(path),
114
+ // Delivery is the resolved access, never `mayRead`: `allowMaskedRead` lifts a mask for
115
+ // expression reads and never widens what may be stated, so the taint records a masked or
116
+ // hidden read whether or not the window unlocked it.
117
+ (fieldId) => {
118
+ const ref = { fieldId };
119
+ return !permitsReadOf(access.accessFor(ref), fieldKey(ref), access.sessionWriteKeys);
120
+ });
121
+ this.overlay = new ComputedReads(computed, this.declarationPaths, (fieldId) => this.index.assignedRowKeys?.(fieldId));
122
+ this.covered = new CoveredTargets(index, (path) => this.read(path), (fieldId) => this.declarationPathOf(fieldId));
123
+ // The window is resolved once, at the boundary, and every read asks the same answer:
124
+ // a malformed overlay has already been refused, and the reader keeps no access
125
+ // bookkeeping of its own.
126
+ this.access = access;
127
+ this.redactedFields = fieldRefFields(input.redacted, '$.redacted');
128
+ this.sessionWriteKeys = access.sessionWriteKeys;
129
+ }
130
+ /** Every field the expression has considered, in the order its report states them. */
131
+ considered() {
132
+ return [...this.consideredRefs.values()];
133
+ }
134
+ /** The fields one rule considered, in the order its evaluation first read them. */
135
+ consideredFor(ruleId) {
136
+ const refs = this.consideredByRule.get(ruleId);
137
+ return refs === undefined ? [] : [...refs.values()];
138
+ }
139
+ /** Records that the expression read this field. */
140
+ markConsidered(fieldId) {
141
+ const ref = { fieldId };
142
+ this.consideredRefs.set(fieldKey(ref), ref);
143
+ const ruleId = this.readingFor;
144
+ if (ruleId === undefined)
145
+ return;
146
+ const forRule = this.consideredByRule.get(ruleId);
147
+ if (forRule === undefined)
148
+ this.consideredByRule.set(ruleId, new Map([[fieldId, ref]]));
149
+ else
150
+ forRule.set(fieldId, ref);
151
+ }
152
+ /**
153
+ * The access projection this reader resolves against, with the session writes it applies,
154
+ * so a projection of the same evaluation reads one answer.
155
+ */
156
+ snapshotAccess() {
157
+ return this.access.snapshotAccess();
158
+ }
159
+ /** The refusals this evaluation's reads observed, with the fields each path was denied. */
160
+ denials = createDenialLog();
161
+ /** The references each unreadable path refused, recorded when the path first resolves. */
162
+ unreadableFields = new Map();
163
+ /**
164
+ * The members each array read withheld, per path and row, in array order. The path's value
165
+ * tree no longer carries them, so this is the only place the binder can learn that a member
166
+ * is withheld rather than absent.
167
+ */
168
+ withheldMembers = new Map();
169
+ /** The same rows indexed by canonical key, built once per path when a row is asked about. */
170
+ withheldByRow = new Map();
171
+ /** The members each array read redacted, per path and row, in array order. */
172
+ deferredMembers = new Map();
173
+ /** The rule whose expression is being evaluated, so a refusal belongs to the rule that made it. */
174
+ readingFor;
175
+ /** Payload owners whose reads must not become their own rule's undecided cause. */
176
+ payloadRules = [];
177
+ /** The row in force, so one row's refusal is not attributed to a readable sibling. */
178
+ currentRowKey;
179
+ /**
180
+ * States the rule the reads that follow belong to. The evaluation moves it with the rule it
181
+ * is evaluating, so a rule pulled in by `is_relevant` or `rule_ok` reads under its own
182
+ * identity rather than the one that asked.
183
+ */
184
+ enterRule(ruleId) {
185
+ this.readingFor = ruleId;
186
+ }
187
+ /** Starts message payload evaluation without changing the rule's considered-read identity. */
188
+ enterPayload() {
189
+ this.payloadRules.push(this.readingFor);
190
+ }
191
+ /** Ends the innermost message payload evaluation. */
192
+ exitPayload() {
193
+ this.payloadRules.pop();
194
+ }
195
+ /** Payload is not its owner's decision; a nested rule still owns its own decision reads. */
196
+ decisionRule() {
197
+ return this.payloadRules.includes(this.readingFor) ? undefined : this.readingFor;
198
+ }
199
+ /** Marks the current position in this evaluation's read stream. */
200
+ readMark() {
201
+ return this.denials.mark();
202
+ }
203
+ /** Marks the current position in the disclosure-taint stream. */
204
+ taintMark() {
205
+ return this.withheldTaint.mark();
206
+ }
207
+ /**
208
+ * The withheld fields a read since `mark` touched, deduplicated and in read order. An empty
209
+ * list means no value the report must withhold was read: a hidden-and-excluded field, or a
210
+ * field whose resolved access withholds delivery.
211
+ */
212
+ taintedSince(mark) {
213
+ return this.withheldTaint.since(mark);
214
+ }
215
+ /** Records the withheld fields one path's read touched, with the sideband it removed. */
216
+ noteWithheld(path, withheldRows) {
217
+ // A caller that hands only a path reads the access sideband the resolution recorded.
218
+ this.withheldTaint.note(path, withheldRows ?? this.withheldMembers.get(path));
219
+ }
220
+ /** Records one field, when it is a field whose value the report may not state. */
221
+ noteWithheldField(fieldId) {
222
+ this.withheldTaint.noteField(fieldId);
223
+ }
224
+ /**
225
+ * The fields `ruleId`'s own reads since `mark` were refused, deduplicated and in the order
226
+ * the reads reached them. An empty list means every read that rule made was permitted.
227
+ *
228
+ * `ruleId` is `undefined` for work an isolated evaluation does under no rule's identity: an
229
+ * option's availability condition, a rule's alternatives. Its refusals are that work's own and
230
+ * name no rule, so the question is asked the same way a rule's is.
231
+ */
232
+ deniedSince(mark, ruleId) {
233
+ return this.denials.since(mark, ruleId);
234
+ }
235
+ /** Records the refusals one read observed, whether its value came fresh or from the cache. */
236
+ noteReadDenials(path) {
237
+ // A permitted read is the common case and records nothing, so the row and rule questions are
238
+ // asked only for a path some resolution refused.
239
+ const denied = this.unreadableFields.get(path);
240
+ if (denied === undefined)
241
+ return false;
242
+ for (const ref of denied) {
243
+ this.denials.note(this.decisionRule(), ref.rowKey ?? this.currentRowKey(), [ref.fieldId]);
244
+ }
245
+ return true;
246
+ }
247
+ /**
248
+ * Records that the rule in force read an input that held no decided value, `RULES-2.1.1`.
249
+ *
250
+ * The reader answers this for a value read that resolved to an absent path or to an
251
+ * undetermined value no refusal explains; the evaluator answers it for a binder read of a row
252
+ * member the row does not carry. Together they are the complement of `noteReadDenials`, and
253
+ * the pair is what lets readiness skip an access-caused check without skipping a genuine gap.
254
+ */
255
+ noteMissingInput() {
256
+ this.denials.noteMissing(this.decisionRule(), this.currentRowKey());
257
+ }
258
+ /** Records a binder's withheld member against the rule instance that consumed it. */
259
+ noteRefusedInput(fieldId) {
260
+ this.denials.note(this.decisionRule(), this.currentRowKey(), [fieldId]);
261
+ }
262
+ /** Records an error evaluating the decision in force, not a message payload error. */
263
+ noteDecisionError() {
264
+ this.denials.noteDecisionError(this.decisionRule(), this.currentRowKey());
265
+ }
266
+ /**
267
+ * Records that the rule in force read a value the server holds, `[ACCESS-3.1.2]`.
268
+ *
269
+ * A redacted read answers `DEFERRED`, and a connective folds it into `UNKNOWN`, so the stream this
270
+ * writes is what a rule's own decision asks about through `deferredSince` before it states a
271
+ * handoff.
272
+ */
273
+ noteDeferredInput() {
274
+ this.denials.noteDeferred(this.decisionRule(), this.currentRowKey());
275
+ }
276
+ /**
277
+ * Records that a rule did not decide and read a value the server holds, `RULES-2.1.1`.
278
+ *
279
+ * It is stated by the rule's own evaluation rather than derived from its result: a permissive gate
280
+ * policy turns an undecided verdict into `PASS`, and readiness still has to tell the server the
281
+ * input is its to settle.
282
+ */
283
+ noteHandoff(ruleId, rowKey) {
284
+ this.denials.noteHandoff(ruleId, rowKey);
285
+ }
286
+ /** The position in the unfilled-input stream, so an isolated evaluation can scope its own. */
287
+ missingMark() {
288
+ return this.denials.missingMark();
289
+ }
290
+ /** Whether an input the rule in force read since `mark` held no decided value. */
291
+ missingSince(mark) {
292
+ return this.denials.missingSince(mark);
293
+ }
294
+ /** The position in the deferred-input stream, so an isolated evaluation can scope its own. */
295
+ deferredMark() {
296
+ return this.denials.deferredMark();
297
+ }
298
+ /** Whether a read since `mark` held a server value, optionally only for one rule. */
299
+ deferredSince(mark, ruleId) {
300
+ return this.denials.deferredSince(mark, ruleId);
301
+ }
302
+ /** Every rule binding this evaluation could not decide from, refused or unfilled. */
303
+ undecidedCauses() {
304
+ return this.denials.causes();
305
+ }
306
+ /**
307
+ * One array's rows read for a rule that answers per row, `ACCESS-1.3.1`.
308
+ *
309
+ * An item rule asks one row at a time, so a row-exact restriction is that row's answer rather
310
+ * than the list's. The path is not cached: the row walk is the answer, and a cached container
311
+ * value would be the stricter expression contract.
312
+ */
313
+ readRows(path) {
314
+ const walked = this.walked(path);
315
+ if (walked === undefined) {
316
+ throw new AxiomError('ENGINE_ERROR', `undeclared field: ${path}`, path);
317
+ }
318
+ const resolved = resolveRows(this, walked, path.split('.'));
319
+ return evaluatedOf(this, path, resolved);
320
+ }
321
+ /** Matches the `ExpressionHost` seam. */
322
+ read(path) {
323
+ const evaluated = readValue(this, path);
324
+ // A declared record's members are a property of the declaration, not of what this record
325
+ // happened to submit: attach them so `keys`/`values` can answer deterministically and an
326
+ // open record root stays distinguishable from a closed one.
327
+ if (evaluated.kind !== 'value' || evaluated.closedMembers !== undefined)
328
+ return evaluated;
329
+ const members = this.recordMembersOf(path);
330
+ if (members === undefined)
331
+ return evaluated;
332
+ const complete = { ...evaluated, closedMembers: memberNames(members) };
333
+ // The cached value is the decorated one, so a second read of the same path is a hit rather
334
+ // than a fresh keys array. A path a writer can still change is never cached.
335
+ if (!this.isComputedAffected(path))
336
+ this.rememberRead(path, complete);
337
+ return complete;
338
+ }
339
+ /** The declared members of a record path, with their domains; `undefined` when open. */
340
+ recordMembersOf(path) {
341
+ const field = this.index.fieldsByPath.get(path);
342
+ if (field === undefined || field.primitive !== 'record' || field.fields === undefined) {
343
+ return undefined;
344
+ }
345
+ return recordMembers(field.fields);
346
+ }
347
+ /** The declared members of a record array's rows, with their domains; `undefined` when open. */
348
+ recordItemMembersOf(path) {
349
+ const field = this.index.fieldsByPath.get(path);
350
+ if (field === undefined || field.primitive !== 'array' || field.fields === undefined) {
351
+ return undefined;
352
+ }
353
+ return recordMembers(field.fields);
354
+ }
355
+ /** The value a path already resolved to, when this evaluation cached it. */
356
+ cachedRead(path) {
357
+ return this.readCache.get(path);
358
+ }
359
+ /** Caches one path's value when no computed writer can still change it. */
360
+ rememberRead(path, evaluated) {
361
+ this.readCache.set(path, evaluated);
362
+ }
363
+ /** The declared element domain of a list path, memoised for this pass. */
364
+ elementDomainOf(path) {
365
+ return this.memo.elementDomainOf(path);
366
+ }
367
+ /** The declared primitive of a path, memoised for this pass. */
368
+ domainOf(path) {
369
+ return this.memo.domainOf(path);
370
+ }
371
+ canRead(path) {
372
+ return canReadPath(this, path);
373
+ }
374
+ presence(path) {
375
+ return presenceOf(this, path);
376
+ }
377
+ /**
378
+ * `is_relevant`: relevance is metadata, so it is false for a declared field the overlay
379
+ * masks or hides and for a field a `visible` rule decided `FAIL`. The value is never read.
380
+ */
381
+ isRelevant(path) {
382
+ return isRelevantPath(this, path);
383
+ }
384
+ hasCapability(name) {
385
+ return this.capabilities.has(name);
386
+ }
387
+ /**
388
+ * The declared path a leaf `fieldId` names. No declaration, or two sharing one identifier,
389
+ * is refused rather than read as a path that happens to spell the identifier.
390
+ */
391
+ declarationPathOf(fieldId) {
392
+ return declarationPathOf(this.declarationPaths, fieldId);
393
+ }
394
+ /** The canonical row key of one item of a declared array. */
395
+ rowKeyOf(arrayPath, index) {
396
+ return this.covered.rowKeyOf(arrayPath, index);
397
+ }
398
+ /** Every row key of one declared array in array order, or `undefined` when it has none. */
399
+ rowKeysOf(arrayPath) {
400
+ return this.covered.rowKeysOf(arrayPath);
401
+ }
402
+ /** Reads the value a covered target names. */
403
+ readCoveredTarget(ref) {
404
+ return this.covered.readTarget(ref);
405
+ }
406
+ /** The effective access for one reference under this projection. */
407
+ accessFor(ref) {
408
+ return this.access.accessFor(ref);
409
+ }
410
+ /** The value one context root is supplied with. */
411
+ contextValue(rootPath) {
412
+ return contextValueFor(this, rootPath);
413
+ }
414
+ /** The declaration a path reaches, walked by the one resolver every path question uses. */
415
+ walked(path) {
416
+ return this.memo.walked(path);
417
+ }
418
+ /** Whether a path reads a context root rather than a declared record field. */
419
+ isContextPath(path) {
420
+ return this.memo.isContextPath(path);
421
+ }
422
+ isReadable(ref) {
423
+ return this.access.mayRead(ref);
424
+ }
425
+ /** Whether a container's own value is readable, before a per-row entry narrows it. */
426
+ isReadableOwn(fieldId) {
427
+ return this.access.mayReadOwn(fieldId);
428
+ }
429
+ /** Whether one reference is redacted, which the row walk states as `DEFERRED`. */
430
+ isRedacted(ref) {
431
+ return this.access.isRedacted(ref);
432
+ }
433
+ /** The first declared member of a value this device may not read. */
434
+ denyUnreadableMember(field) {
435
+ return denyUnreadableMember(this, field);
436
+ }
437
+ /** Whether any declared member of the value is redacted for this device. */
438
+ hasRedactedMember(field) {
439
+ return hasRedactedMember(this, field);
440
+ }
441
+ recordDenied(fieldId, rowKey) {
442
+ // A refused read is still a read the evaluation considered: `ACCESS-5.1.1` asks the
443
+ // projection to answer for every field it considered, and the host re-checks a
444
+ // `readOnlyDiagnostics` bucket against it (`ACCESS-6.1.4`). A member refused inside a
445
+ // container read never travelled the path loop that marks the containers, so the denial
446
+ // itself records the consideration.
447
+ this.markConsidered(fieldId);
448
+ // The refusal is attributed to the reference the walk refused, so a member withheld in one
449
+ // row is not attributed to the row that holds it and not to a readable sibling.
450
+ this.denials.note(this.decisionRule(), rowKey ?? this.currentRowKey(), [fieldId]);
451
+ if (this.deniedReads.has(fieldId))
452
+ return;
453
+ this.deniedReads.add(fieldId);
454
+ this.onAccessDenied('ACCESS_DENIED', fieldId);
455
+ }
456
+ /** A resolved read, memoised for this evaluation: the input cannot change while it runs. */
457
+ resolveCached(path) {
458
+ const cached = this.resolvedCache.get(path);
459
+ if (cached !== undefined)
460
+ return cached;
461
+ const resolved = resolvePath(this, path);
462
+ // A computed target's entry appears while the overlay is built, so a path that crosses one
463
+ // is resolved afresh rather than served from a value the writer has since replaced. Its
464
+ // validated submission is cached instead (`submittedValue`), which is the part of the read
465
+ // the overlay cannot change.
466
+ if (!this.isComputedAffected(path))
467
+ this.resolvedCache.set(path, resolved);
468
+ return resolved;
469
+ }
470
+ /**
471
+ * The submission's validated answer for one path, remembered for this evaluation.
472
+ *
473
+ * The reader validates a submitted value once and re-applies the computed overlay over it
474
+ * on every read that crosses a writer. `resolvePath` asks for it only after the overlay has
475
+ * declined to answer, so a field a writer owns never validates the value it replaced.
476
+ */
477
+ submittedValue(path, walked, segments) {
478
+ const cached = this.submittedCache.get(path);
479
+ if (cached !== undefined)
480
+ return cached;
481
+ const submitted = resolveSubmission(this, path, walked, segments);
482
+ this.submittedCache.set(path, submitted);
483
+ return submitted;
484
+ }
485
+ /** Records the references one read was refused. */
486
+ noteUnreadable(path, fields) {
487
+ this.unreadableFields.set(path, fields);
488
+ }
489
+ /** Records the members one array read withheld, per row, in array order, `[ACCESS-1.3.3]`. */
490
+ noteWithheldRows(path, rows) {
491
+ this.withheldMembers.set(path, rows);
492
+ this.withheldByRow.delete(path);
493
+ }
494
+ /** Records the members one array read redacted, per row, so the binder answers `DEFERRED`. */
495
+ noteDeferredRows(path, rows) {
496
+ this.deferredMembers.set(path, rows);
497
+ }
498
+ /** The members one array read redacted from each row, or `undefined` when it redacted none. */
499
+ deferredRows(path) {
500
+ return this.deferredMembers.get(path);
501
+ }
502
+ /** The members one row of an array withheld, or an empty list when it withheld none. */
503
+ withheldAt(arrayPath, rowKey) {
504
+ return this.withheldIndex(arrayPath)?.get(rowKeyToken(rowKey)) ?? [];
505
+ }
506
+ /**
507
+ * The members each element of an array read withheld, in array order.
508
+ *
509
+ * This is `withheldAt` for every row at once, which is the shape a binder scope needs: its
510
+ * elements and the withheld lists must share one order, and a scope built from a read must
511
+ * not allocate one entry per row. `undefined` means nothing was withheld from this array, so
512
+ * every binder over it can answer from the value alone.
513
+ */
514
+ withheldRows(arrayPath) {
515
+ return this.withheldMembers.get(arrayPath);
516
+ }
517
+ /** The withheld rows of one array by canonical key, built once from the ordered answer. */
518
+ withheldIndex(arrayPath) {
519
+ const cached = this.withheldByRow.get(arrayPath);
520
+ if (cached !== undefined)
521
+ return cached;
522
+ const ordered = this.withheldMembers.get(arrayPath);
523
+ if (ordered === undefined)
524
+ return undefined;
525
+ // The row order is the array's own; a container whose rows cannot be named had nothing
526
+ // withheld per row to report.
527
+ const keys = this.rowKeysOf(arrayPath);
528
+ if (keys === undefined)
529
+ return undefined;
530
+ const index = new Map();
531
+ for (const [position, key] of keys.entries()) {
532
+ const members = ordered[position];
533
+ if (members !== undefined && members.length > 0)
534
+ index.set(rowKeyToken(key), members);
535
+ }
536
+ this.withheldByRow.set(arrayPath, index);
537
+ return index;
538
+ }
539
+ /** The value a computed writer owns at the path being read. */
540
+ overlayAt(walked, segments) {
541
+ return this.overlay.overlayAt(walked, segments);
542
+ }
543
+ /** A record value with the computed members the overlay owns merged over the submitted one. */
544
+ mergeRecord(field, raw) {
545
+ return this.overlay.mergeRecord(field, raw);
546
+ }
547
+ /** A list value with every row's computed members merged over the submitted ones. */
548
+ mergeRows(field, raw) {
549
+ return this.overlay.mergeRows(field, raw);
550
+ }
551
+ /** Whether a read of `path` can be answered differently once the overlay has grown. */
552
+ isComputedAffected(path) {
553
+ return this.overlay.isAffected(path);
554
+ }
555
+ /** The record holds a non-`null` value at `path`, before any access decision. */
556
+ rawPresence(path) {
557
+ return rawPresence(this, path);
558
+ }
559
+ }
560
+ //# sourceMappingURL=reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader.js","sourceRoot":"","sources":["../../src/eval/reader.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIjF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAUpF,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAA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AI,CAAC,CAAC;IACjC,CAAC;CACF","sourcesContent":["import type {\n CompiledField,\n FieldAccess,\n FieldRef,\n LiteralDomain,\n WireValue,\n} from '../model/types.js';\nimport type { EvaluationInput } from '../model/access.js';\nimport { AxiomError } from '../model/errors.js';\nimport { rowKeyToken } from '../model/wire.js';\nimport { fieldKey, fieldRefFields, permitsReadOf } from './access/projection.js';\nimport type { SnapshotAccess } from './access/projection.js';\nimport type { AccessWindow } from './access/window.js';\nimport type { Evaluated, Presence } from './expr/value.js';\nimport { createDenialLog } from './denials.js';\nimport type { ReadMark } from './denials.js';\nimport type { UndecidedBinding } from './undecided.js';\nimport type { DeclaredPath } from './reader-paths.js';\nimport { resolvePath, resolveRows, resolveSubmission } from './reader/resolve.js';\nimport type { PathResolution } from './reader/resolve.js';\nimport { contextValueFor, rawPresence } from './reader/context-value.js';\nimport type { ContextSources } from './reader/context-value.js';\nimport { CoveredTargets } from './reader/covered.js';\nimport { buildDeclarationPaths, declarationPathOf } from './reader/declarations.js';\nimport type {\n AccessDeniedSink,\n ComputedValues,\n FieldVisibility,\n RecordIndex,\n Resolved,\n Submitted,\n WithheldFields,\n} from './reader/declarations.js';\nimport { denyUnreadableMember, hasRedactedMember } from './reader/member-access.js';\nimport { ReadMemo } from './reader/memo.js';\nimport { ComputedReads } from './reader/overlay.js';\nimport { canReadPath, isRelevantPath, presenceOf } from './reader/questions.js';\nimport type { PathQuestions } from './reader/questions.js';\nimport { evaluatedOf, readValue } from './reader/value-read.js';\nimport type { ValueRead } from './reader/value-read.js';\nimport { WithheldTaint } from './reader/withheld.js';\n\nexport type {\n AccessDeniedSink,\n ComputedValues,\n ContextRootDeclaration,\n FieldVisibility,\n RecordIndex,\n WithheldFields,\n} from './reader/declarations.js';\nexport {\n NO_VISIBLE_RULES,\n indexContextRoots,\n indexFields,\n isContextRootPath,\n reservedContextValues,\n} from './reader/declarations.js';\n\n/**\n * The declared member names of one record declaration, in declaration order.\n *\n * The list is a property of the declaration list, which a compiled artifact keeps immutable,\n * so it is built once per declaration rather than once per read of a record field.\n */\nconst DECLARED_MEMBERS: WeakMap<\n readonly CompiledField[],\n Readonly<Record<string, LiteralDomain>>\n> = new WeakMap();\n\n/**\n * The member names of one declaration, computed once.\n *\n * `read()` attaches this list to every value it returns so `keys`/`values` answer declaration\n * order; the members record is already memoised by the declaration array, so the names ride on\n * the same identity instead of one `Object.keys` per path read.\n */\nconst DECLARED_MEMBER_NAMES = new WeakMap<object, readonly string[]>();\n\nfunction memberNames(members: Readonly<Record<string, LiteralDomain>>): readonly string[] {\n const cached = DECLARED_MEMBER_NAMES.get(members);\n if (cached !== undefined) return cached;\n const names = Object.keys(members);\n DECLARED_MEMBER_NAMES.set(members, names);\n return names;\n}\n\nfunction recordMembers(fields: readonly CompiledField[]): Readonly<Record<string, LiteralDomain>> {\n const cached = DECLARED_MEMBERS.get(fields);\n if (cached !== undefined) return cached;\n const members: Record<string, LiteralDomain> = {};\n for (const field of fields) members[field.fieldId] = field.primitive;\n DECLARED_MEMBERS.set(fields, members);\n return members;\n}\n\n/**\n * Resolves the paths of one record and context, `spec/semantics/context-v1.md`.\n *\n * The reader owns the trust boundary between a caller's values and an expression: it\n * applies the access projection, redaction, absence and the canonical wire reader, and\n * it answers presence and relevance without pretending either is a value. Expressions\n * read through it; no construct reaches around it.\n */\nexport class RecordReader implements PathResolution, PathQuestions, ContextSources, ValueRead {\n readonly index: RecordIndex;\n readonly input: EvaluationInput;\n private readonly onAccessDenied: AccessDeniedSink;\n /** The rule whose expression is being evaluated, so a refusal is attributed to its reader. */\n private readonly ruleIdOf: () => string | undefined;\n private readonly capabilities: ReadonlySet<string>;\n readonly access: AccessWindow;\n /**\n * The fields the host named as redacted, whatever row it named: a container read carries every\n * row.\n *\n * It is the host's own statement, so it is the set a read is refused by. The derived inheritance\n * (`AccessWindow.redactedFields`, which also carries every descendant of a named declaration) is\n * a different question and is asked where a value's presence is stated; this one stays exact\n * because a read of a declaration the host did not name is not a redacted read.\n */\n readonly redactedFields: ReadonlySet<string>;\n readonly sessionWriteKeys: ReadonlySet<string>;\n private readonly deniedReads = new Set<string>();\n private readonly consideredRefs = new Map<string, FieldRef>();\n /**\n * The same reads attributed to the rule in force when each one happened, so one rule's\n * report contribution states exactly the fields that rule considered and a replay of two\n * contributions unions to the report's access projection.\n */\n private readonly consideredByRule = new Map<string, Map<string, FieldRef>>();\n readonly visibility: FieldVisibility;\n readonly computed: ComputedValues | undefined;\n private readonly resolvedCache = new Map<string, Resolved>();\n private readonly readCache = new Map<string, Evaluated>();\n /**\n * The validated submission of every path a computed writer can still change.\n *\n * The record cannot change while an evaluation runs, so the part of a read that copies and\n * checks the submitted value is derivable once per path; only the overlay over it moves.\n */\n private readonly submittedCache = new Map<string, Submitted>();\n /** The path, domain and context-root answers memoised for this pass. */\n private readonly memo: ReadMemo;\n /** Leaf `fieldId` to the declaration paths naming it. */\n private readonly declarationPaths: ReadonlyMap<string, readonly string[]>;\n private readonly withheldTaint: WithheldTaint;\n private readonly overlay: ComputedReads;\n private readonly covered: CoveredTargets;\n\n constructor(\n index: RecordIndex,\n input: EvaluationInput,\n access: AccessWindow,\n capabilities: ReadonlySet<string>,\n onAccessDenied: AccessDeniedSink,\n visibility: FieldVisibility,\n ruleIdOf: () => string | undefined = () => undefined,\n withheld?: WithheldFields,\n computed?: ComputedValues,\n currentRowKey: () => string | number | undefined = () => undefined,\n ) {\n this.index = index;\n this.input = input;\n this.capabilities = capabilities;\n this.onAccessDenied = onAccessDenied;\n this.visibility = visibility;\n this.ruleIdOf = ruleIdOf;\n this.currentRowKey = currentRowKey;\n this.computed = computed;\n this.declarationPaths = buildDeclarationPaths(index.fieldsByPath);\n this.memo = new ReadMemo(index);\n this.withheldTaint = new WithheldTaint(\n withheld,\n (path) => this.walked(path),\n // Delivery is the resolved access, never `mayRead`: `allowMaskedRead` lifts a mask for\n // expression reads and never widens what may be stated, so the taint records a masked or\n // hidden read whether or not the window unlocked it.\n (fieldId) => {\n const ref: FieldRef = { fieldId };\n return !permitsReadOf(access.accessFor(ref), fieldKey(ref), access.sessionWriteKeys);\n },\n );\n this.overlay = new ComputedReads(computed, this.declarationPaths, (fieldId) =>\n this.index.assignedRowKeys?.(fieldId),\n );\n this.covered = new CoveredTargets(\n index,\n (path) => this.read(path),\n (fieldId) => this.declarationPathOf(fieldId),\n );\n // The window is resolved once, at the boundary, and every read asks the same answer:\n // a malformed overlay has already been refused, and the reader keeps no access\n // bookkeeping of its own.\n this.access = access;\n this.redactedFields = fieldRefFields(input.redacted, '$.redacted');\n this.sessionWriteKeys = access.sessionWriteKeys;\n }\n\n /** Every field the expression has considered, in the order its report states them. */\n considered(): readonly FieldRef[] {\n return [...this.consideredRefs.values()];\n }\n\n /** The fields one rule considered, in the order its evaluation first read them. */\n consideredFor(ruleId: string): readonly FieldRef[] {\n const refs = this.consideredByRule.get(ruleId);\n return refs === undefined ? [] : [...refs.values()];\n }\n\n /** Records that the expression read this field. */\n markConsidered(fieldId: string): void {\n const ref: FieldRef = { fieldId };\n this.consideredRefs.set(fieldKey(ref), ref);\n const ruleId = this.readingFor;\n if (ruleId === undefined) return;\n const forRule = this.consideredByRule.get(ruleId);\n if (forRule === undefined) this.consideredByRule.set(ruleId, new Map([[fieldId, ref]]));\n else forRule.set(fieldId, ref);\n }\n\n /**\n * The access projection this reader resolves against, with the session writes it applies,\n * so a projection of the same evaluation reads one answer.\n */\n snapshotAccess(): SnapshotAccess {\n return this.access.snapshotAccess();\n }\n\n /** The refusals this evaluation's reads observed, with the fields each path was denied. */\n private readonly denials = createDenialLog();\n\n /** The references each unreadable path refused, recorded when the path first resolves. */\n private readonly unreadableFields = new Map<string, readonly FieldRef[]>();\n /**\n * The members each array read withheld, per path and row, in array order. The path's value\n * tree no longer carries them, so this is the only place the binder can learn that a member\n * is withheld rather than absent.\n */\n private readonly withheldMembers = new Map<string, readonly (readonly string[])[]>();\n /** The same rows indexed by canonical key, built once per path when a row is asked about. */\n private readonly withheldByRow = new Map<string, ReadonlyMap<string, readonly string[]>>();\n /** The members each array read redacted, per path and row, in array order. */\n private readonly deferredMembers = new Map<string, readonly (readonly string[])[]>();\n\n /** The rule whose expression is being evaluated, so a refusal belongs to the rule that made it. */\n private readingFor: string | undefined;\n /** Payload owners whose reads must not become their own rule's undecided cause. */\n private readonly payloadRules: (string | undefined)[] = [];\n /** The row in force, so one row's refusal is not attributed to a readable sibling. */\n private readonly currentRowKey: () => string | number | undefined;\n\n /**\n * States the rule the reads that follow belong to. The evaluation moves it with the rule it\n * is evaluating, so a rule pulled in by `is_relevant` or `rule_ok` reads under its own\n * identity rather than the one that asked.\n */\n enterRule(ruleId: string | undefined): void {\n this.readingFor = ruleId;\n }\n\n /** Starts message payload evaluation without changing the rule's considered-read identity. */\n enterPayload(): void {\n this.payloadRules.push(this.readingFor);\n }\n\n /** Ends the innermost message payload evaluation. */\n exitPayload(): void {\n this.payloadRules.pop();\n }\n\n /** Payload is not its owner's decision; a nested rule still owns its own decision reads. */\n private decisionRule(): string | undefined {\n return this.payloadRules.includes(this.readingFor) ? undefined : this.readingFor;\n }\n\n /** Marks the current position in this evaluation's read stream. */\n readMark(): ReadMark {\n return this.denials.mark();\n }\n\n /** Marks the current position in the disclosure-taint stream. */\n taintMark(): number {\n return this.withheldTaint.mark();\n }\n\n /**\n * The withheld fields a read since `mark` touched, deduplicated and in read order. An empty\n * list means no value the report must withhold was read: a hidden-and-excluded field, or a\n * field whose resolved access withholds delivery.\n */\n taintedSince(mark: number): readonly string[] {\n return this.withheldTaint.since(mark);\n }\n\n /** Records the withheld fields one path's read touched, with the sideband it removed. */\n noteWithheld(path: string, withheldRows?: readonly (readonly string[])[]): void {\n // A caller that hands only a path reads the access sideband the resolution recorded.\n this.withheldTaint.note(path, withheldRows ?? this.withheldMembers.get(path));\n }\n\n /** Records one field, when it is a field whose value the report may not state. */\n noteWithheldField(fieldId: string): void {\n this.withheldTaint.noteField(fieldId);\n }\n\n /**\n * The fields `ruleId`'s own reads since `mark` were refused, deduplicated and in the order\n * the reads reached them. An empty list means every read that rule made was permitted.\n *\n * `ruleId` is `undefined` for work an isolated evaluation does under no rule's identity: an\n * option's availability condition, a rule's alternatives. Its refusals are that work's own and\n * name no rule, so the question is asked the same way a rule's is.\n */\n deniedSince(mark: ReadMark, ruleId: string | undefined): readonly string[] {\n return this.denials.since(mark, ruleId);\n }\n\n /** Records the refusals one read observed, whether its value came fresh or from the cache. */\n noteReadDenials(path: string): boolean {\n // A permitted read is the common case and records nothing, so the row and rule questions are\n // asked only for a path some resolution refused.\n const denied = this.unreadableFields.get(path);\n if (denied === undefined) return false;\n for (const ref of denied) {\n this.denials.note(this.decisionRule(), ref.rowKey ?? this.currentRowKey(), [ref.fieldId]);\n }\n return true;\n }\n\n /**\n * Records that the rule in force read an input that held no decided value, `RULES-2.1.1`.\n *\n * The reader answers this for a value read that resolved to an absent path or to an\n * undetermined value no refusal explains; the evaluator answers it for a binder read of a row\n * member the row does not carry. Together they are the complement of `noteReadDenials`, and\n * the pair is what lets readiness skip an access-caused check without skipping a genuine gap.\n */\n noteMissingInput(): void {\n this.denials.noteMissing(this.decisionRule(), this.currentRowKey());\n }\n\n /** Records a binder's withheld member against the rule instance that consumed it. */\n noteRefusedInput(fieldId: string): void {\n this.denials.note(this.decisionRule(), this.currentRowKey(), [fieldId]);\n }\n\n /** Records an error evaluating the decision in force, not a message payload error. */\n noteDecisionError(): void {\n this.denials.noteDecisionError(this.decisionRule(), this.currentRowKey());\n }\n\n /**\n * Records that the rule in force read a value the server holds, `[ACCESS-3.1.2]`.\n *\n * A redacted read answers `DEFERRED`, and a connective folds it into `UNKNOWN`, so the stream this\n * writes is what a rule's own decision asks about through `deferredSince` before it states a\n * handoff.\n */\n noteDeferredInput(): void {\n this.denials.noteDeferred(this.decisionRule(), this.currentRowKey());\n }\n\n /**\n * Records that a rule did not decide and read a value the server holds, `RULES-2.1.1`.\n *\n * It is stated by the rule's own evaluation rather than derived from its result: a permissive gate\n * policy turns an undecided verdict into `PASS`, and readiness still has to tell the server the\n * input is its to settle.\n */\n noteHandoff(ruleId: string, rowKey: string | number | undefined): void {\n this.denials.noteHandoff(ruleId, rowKey);\n }\n\n /** The position in the unfilled-input stream, so an isolated evaluation can scope its own. */\n missingMark(): number {\n return this.denials.missingMark();\n }\n\n /** Whether an input the rule in force read since `mark` held no decided value. */\n missingSince(mark: number): boolean {\n return this.denials.missingSince(mark);\n }\n\n /** The position in the deferred-input stream, so an isolated evaluation can scope its own. */\n deferredMark(): number {\n return this.denials.deferredMark();\n }\n\n /** Whether a read since `mark` held a server value, optionally only for one rule. */\n deferredSince(mark: number, ruleId?: string): boolean {\n return this.denials.deferredSince(mark, ruleId);\n }\n\n /** Every rule binding this evaluation could not decide from, refused or unfilled. */\n undecidedCauses(): ReadonlyMap<string, readonly UndecidedBinding[]> {\n return this.denials.causes();\n }\n\n /**\n * One array's rows read for a rule that answers per row, `ACCESS-1.3.1`.\n *\n * An item rule asks one row at a time, so a row-exact restriction is that row's answer rather\n * than the list's. The path is not cached: the row walk is the answer, and a cached container\n * value would be the stricter expression contract.\n */\n readRows(path: string): Evaluated {\n const walked = this.walked(path);\n if (walked === undefined) {\n throw new AxiomError('ENGINE_ERROR', `undeclared field: ${path}`, path);\n }\n const resolved = resolveRows(this, walked, path.split('.'));\n return evaluatedOf(this, path, resolved);\n }\n\n /** Matches the `ExpressionHost` seam. */\n read(path: string): Evaluated {\n const evaluated = readValue(this, path);\n // A declared record's members are a property of the declaration, not of what this record\n // happened to submit: attach them so `keys`/`values` can answer deterministically and an\n // open record root stays distinguishable from a closed one.\n if (evaluated.kind !== 'value' || evaluated.closedMembers !== undefined) return evaluated;\n const members = this.recordMembersOf(path);\n if (members === undefined) return evaluated;\n const complete = { ...evaluated, closedMembers: memberNames(members) };\n // The cached value is the decorated one, so a second read of the same path is a hit rather\n // than a fresh keys array. A path a writer can still change is never cached.\n if (!this.isComputedAffected(path)) this.rememberRead(path, complete);\n return complete;\n }\n\n /** The declared members of a record path, with their domains; `undefined` when open. */\n recordMembersOf(path: string): Readonly<Record<string, LiteralDomain>> | undefined {\n const field = this.index.fieldsByPath.get(path);\n if (field === undefined || field.primitive !== 'record' || field.fields === undefined) {\n return undefined;\n }\n return recordMembers(field.fields);\n }\n\n /** The declared members of a record array's rows, with their domains; `undefined` when open. */\n recordItemMembersOf(path: string): Readonly<Record<string, LiteralDomain>> | undefined {\n const field = this.index.fieldsByPath.get(path);\n if (field === undefined || field.primitive !== 'array' || field.fields === undefined) {\n return undefined;\n }\n return recordMembers(field.fields);\n }\n /** The value a path already resolved to, when this evaluation cached it. */\n cachedRead(path: string): Evaluated | undefined {\n return this.readCache.get(path);\n }\n /** Caches one path's value when no computed writer can still change it. */\n rememberRead(path: string, evaluated: Evaluated): void {\n this.readCache.set(path, evaluated);\n }\n\n /** The declared element domain of a list path, memoised for this pass. */\n elementDomainOf(path: string): LiteralDomain | undefined {\n return this.memo.elementDomainOf(path);\n }\n\n /** The declared primitive of a path, memoised for this pass. */\n domainOf(path: string): LiteralDomain | undefined {\n return this.memo.domainOf(path);\n }\n\n canRead(path: string): boolean {\n return canReadPath(this, path);\n }\n\n presence(path: string): Presence {\n return presenceOf(this, path);\n }\n\n /**\n * `is_relevant`: relevance is metadata, so it is false for a declared field the overlay\n * masks or hides and for a field a `visible` rule decided `FAIL`. The value is never read.\n */\n isRelevant(path: string): boolean {\n return isRelevantPath(this, path);\n }\n\n hasCapability(name: string): boolean {\n return this.capabilities.has(name);\n }\n\n /**\n * The declared path a leaf `fieldId` names. No declaration, or two sharing one identifier,\n * is refused rather than read as a path that happens to spell the identifier.\n */\n declarationPathOf(fieldId: string): string {\n return declarationPathOf(this.declarationPaths, fieldId);\n }\n\n /** The canonical row key of one item of a declared array. */\n rowKeyOf(arrayPath: string, index: number): string | number | undefined {\n return this.covered.rowKeyOf(arrayPath, index);\n }\n\n /** Every row key of one declared array in array order, or `undefined` when it has none. */\n rowKeysOf(arrayPath: string): readonly (string | number)[] | undefined {\n return this.covered.rowKeysOf(arrayPath);\n }\n\n /** Reads the value a covered target names. */\n readCoveredTarget(ref: FieldRef): Evaluated {\n return this.covered.readTarget(ref);\n }\n\n /** The effective access for one reference under this projection. */\n accessFor(ref: FieldRef): FieldAccess {\n return this.access.accessFor(ref);\n }\n\n /** The value one context root is supplied with. */\n contextValue(rootPath: string): { readonly present: boolean; readonly value: unknown } {\n return contextValueFor(this, rootPath);\n }\n\n /** The declaration a path reaches, walked by the one resolver every path question uses. */\n walked(path: string): DeclaredPath | undefined {\n return this.memo.walked(path);\n }\n\n /** Whether a path reads a context root rather than a declared record field. */\n isContextPath(path: string): boolean {\n return this.memo.isContextPath(path);\n }\n\n isReadable(ref: FieldRef): boolean {\n return this.access.mayRead(ref);\n }\n\n /** Whether a container's own value is readable, before a per-row entry narrows it. */\n isReadableOwn(fieldId: string): boolean {\n return this.access.mayReadOwn(fieldId);\n }\n\n /** Whether one reference is redacted, which the row walk states as `DEFERRED`. */\n isRedacted(ref: FieldRef): boolean {\n return this.access.isRedacted(ref);\n }\n\n /** The first declared member of a value this device may not read. */\n denyUnreadableMember(field: CompiledField): string | undefined {\n return denyUnreadableMember(this, field);\n }\n\n /** Whether any declared member of the value is redacted for this device. */\n hasRedactedMember(field: CompiledField): boolean {\n return hasRedactedMember(this, field);\n }\n\n recordDenied(fieldId: string, rowKey?: string | number): void {\n // A refused read is still a read the evaluation considered: `ACCESS-5.1.1` asks the\n // projection to answer for every field it considered, and the host re-checks a\n // `readOnlyDiagnostics` bucket against it (`ACCESS-6.1.4`). A member refused inside a\n // container read never travelled the path loop that marks the containers, so the denial\n // itself records the consideration.\n this.markConsidered(fieldId);\n // The refusal is attributed to the reference the walk refused, so a member withheld in one\n // row is not attributed to the row that holds it and not to a readable sibling.\n this.denials.note(this.decisionRule(), rowKey ?? this.currentRowKey(), [fieldId]);\n if (this.deniedReads.has(fieldId)) return;\n this.deniedReads.add(fieldId);\n this.onAccessDenied('ACCESS_DENIED', fieldId);\n }\n\n /** A resolved read, memoised for this evaluation: the input cannot change while it runs. */\n resolveCached(path: string): Resolved {\n const cached = this.resolvedCache.get(path);\n if (cached !== undefined) return cached;\n const resolved = resolvePath(this, path);\n // A computed target's entry appears while the overlay is built, so a path that crosses one\n // is resolved afresh rather than served from a value the writer has since replaced. Its\n // validated submission is cached instead (`submittedValue`), which is the part of the read\n // the overlay cannot change.\n if (!this.isComputedAffected(path)) this.resolvedCache.set(path, resolved);\n return resolved;\n }\n\n /**\n * The submission's validated answer for one path, remembered for this evaluation.\n *\n * The reader validates a submitted value once and re-applies the computed overlay over it\n * on every read that crosses a writer. `resolvePath` asks for it only after the overlay has\n * declined to answer, so a field a writer owns never validates the value it replaced.\n */\n submittedValue(path: string, walked: DeclaredPath, segments: readonly string[]): Submitted {\n const cached = this.submittedCache.get(path);\n if (cached !== undefined) return cached;\n const submitted = resolveSubmission(this, path, walked, segments);\n this.submittedCache.set(path, submitted);\n return submitted;\n }\n\n /** Records the references one read was refused. */\n noteUnreadable(path: string, fields: readonly FieldRef[]): void {\n this.unreadableFields.set(path, fields);\n }\n\n /** Records the members one array read withheld, per row, in array order, `[ACCESS-1.3.3]`. */\n noteWithheldRows(path: string, rows: readonly (readonly string[])[]): void {\n this.withheldMembers.set(path, rows);\n this.withheldByRow.delete(path);\n }\n\n /** Records the members one array read redacted, per row, so the binder answers `DEFERRED`. */\n noteDeferredRows(path: string, rows: readonly (readonly string[])[]): void {\n this.deferredMembers.set(path, rows);\n }\n\n /** The members one array read redacted from each row, or `undefined` when it redacted none. */\n deferredRows(path: string): readonly (readonly string[])[] | undefined {\n return this.deferredMembers.get(path);\n }\n\n /** The members one row of an array withheld, or an empty list when it withheld none. */\n withheldAt(arrayPath: string, rowKey: string | number): readonly string[] {\n return this.withheldIndex(arrayPath)?.get(rowKeyToken(rowKey)) ?? [];\n }\n\n /**\n * The members each element of an array read withheld, in array order.\n *\n * This is `withheldAt` for every row at once, which is the shape a binder scope needs: its\n * elements and the withheld lists must share one order, and a scope built from a read must\n * not allocate one entry per row. `undefined` means nothing was withheld from this array, so\n * every binder over it can answer from the value alone.\n */\n withheldRows(arrayPath: string): readonly (readonly string[])[] | undefined {\n return this.withheldMembers.get(arrayPath);\n }\n\n /** The withheld rows of one array by canonical key, built once from the ordered answer. */\n private withheldIndex(arrayPath: string): ReadonlyMap<string, readonly string[]> | undefined {\n const cached = this.withheldByRow.get(arrayPath);\n if (cached !== undefined) return cached;\n const ordered = this.withheldMembers.get(arrayPath);\n if (ordered === undefined) return undefined;\n // The row order is the array's own; a container whose rows cannot be named had nothing\n // withheld per row to report.\n const keys = this.rowKeysOf(arrayPath);\n if (keys === undefined) return undefined;\n const index = new Map<string, readonly string[]>();\n for (const [position, key] of keys.entries()) {\n const members = ordered[position];\n if (members !== undefined && members.length > 0) index.set(rowKeyToken(key), members);\n }\n this.withheldByRow.set(arrayPath, index);\n return index;\n }\n\n /** The value a computed writer owns at the path being read. */\n overlayAt(walked: DeclaredPath, segments: readonly string[]): Resolved | undefined {\n return this.overlay.overlayAt(walked, segments);\n }\n\n /** A record value with the computed members the overlay owns merged over the submitted one. */\n mergeRecord(field: CompiledField, raw: WireValue | undefined): Resolved | undefined {\n return this.overlay.mergeRecord(field, raw);\n }\n\n /** A list value with every row's computed members merged over the submitted ones. */\n mergeRows(field: CompiledField, raw: WireValue | undefined): Resolved | undefined {\n return this.overlay.mergeRows(field, raw);\n }\n\n /** Whether a read of `path` can be answered differently once the overlay has grown. */\n isComputedAffected(path: string): boolean {\n return this.overlay.isAffected(path);\n }\n\n /** The record holds a non-`null` value at `path`, before any access decision. */\n rawPresence(path: string): Presence {\n return rawPresence(this, path);\n }\n}\n"]}