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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (755) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +714 -2
  3. package/dist/cache/index.d.ts +191 -0
  4. package/dist/cache/index.d.ts.map +1 -0
  5. package/dist/cache/index.js +361 -0
  6. package/dist/cache/index.js.map +1 -0
  7. package/dist/canonical/jcs.d.ts +78 -0
  8. package/dist/canonical/jcs.d.ts.map +1 -0
  9. package/dist/canonical/jcs.js +500 -0
  10. package/dist/canonical/jcs.js.map +1 -0
  11. package/dist/canonical/restricted-json.d.ts +7 -0
  12. package/dist/canonical/restricted-json.d.ts.map +1 -0
  13. package/dist/canonical/restricted-json.js +318 -0
  14. package/dist/canonical/restricted-json.js.map +1 -0
  15. package/dist/canonical/restricted-value.d.ts +59 -0
  16. package/dist/canonical/restricted-value.d.ts.map +1 -0
  17. package/dist/canonical/restricted-value.js +156 -0
  18. package/dist/canonical/restricted-value.js.map +1 -0
  19. package/dist/canonical/restricted.d.ts +85 -0
  20. package/dist/canonical/restricted.d.ts.map +1 -0
  21. package/dist/canonical/restricted.js +163 -0
  22. package/dist/canonical/restricted.js.map +1 -0
  23. package/dist/canonical/signature.d.ts +38 -0
  24. package/dist/canonical/signature.d.ts.map +1 -0
  25. package/dist/canonical/signature.js +47 -0
  26. package/dist/canonical/signature.js.map +1 -0
  27. package/dist/eval/access/delivery.d.ts +63 -0
  28. package/dist/eval/access/delivery.d.ts.map +1 -0
  29. package/dist/eval/access/delivery.js +98 -0
  30. package/dist/eval/access/delivery.js.map +1 -0
  31. package/dist/eval/access/overlay.d.ts +72 -0
  32. package/dist/eval/access/overlay.d.ts.map +1 -0
  33. package/dist/eval/access/overlay.js +402 -0
  34. package/dist/eval/access/overlay.js.map +1 -0
  35. package/dist/eval/access/projection.d.ts +159 -0
  36. package/dist/eval/access/projection.d.ts.map +1 -0
  37. package/dist/eval/access/projection.js +211 -0
  38. package/dist/eval/access/projection.js.map +1 -0
  39. package/dist/eval/access/window.d.ts +128 -0
  40. package/dist/eval/access/window.d.ts.map +1 -0
  41. package/dist/eval/access/window.js +254 -0
  42. package/dist/eval/access/window.js.map +1 -0
  43. package/dist/eval/access/write.d.ts +113 -0
  44. package/dist/eval/access/write.d.ts.map +1 -0
  45. package/dist/eval/access/write.js +119 -0
  46. package/dist/eval/access/write.js.map +1 -0
  47. package/dist/eval/addressing.d.ts +131 -0
  48. package/dist/eval/addressing.d.ts.map +1 -0
  49. package/dist/eval/addressing.js +270 -0
  50. package/dist/eval/addressing.js.map +1 -0
  51. package/dist/eval/budget.d.ts +143 -0
  52. package/dist/eval/budget.d.ts.map +1 -0
  53. package/dist/eval/budget.js +387 -0
  54. package/dist/eval/budget.js.map +1 -0
  55. package/dist/eval/computed.d.ts +46 -0
  56. package/dist/eval/computed.d.ts.map +1 -0
  57. package/dist/eval/computed.js +89 -0
  58. package/dist/eval/computed.js.map +1 -0
  59. package/dist/eval/denials.d.ts +64 -0
  60. package/dist/eval/denials.d.ts.map +1 -0
  61. package/dist/eval/denials.js +87 -0
  62. package/dist/eval/denials.js.map +1 -0
  63. package/dist/eval/engine/cancellation.d.ts +12 -0
  64. package/dist/eval/engine/cancellation.d.ts.map +1 -0
  65. package/dist/eval/engine/cancellation.js +56 -0
  66. package/dist/eval/engine/cancellation.js.map +1 -0
  67. package/dist/eval/engine/delta.d.ts +104 -0
  68. package/dist/eval/engine/delta.d.ts.map +1 -0
  69. package/dist/eval/engine/delta.js +466 -0
  70. package/dist/eval/engine/delta.js.map +1 -0
  71. package/dist/eval/engine/deps.d.ts +136 -0
  72. package/dist/eval/engine/deps.d.ts.map +1 -0
  73. package/dist/eval/engine/deps.js +345 -0
  74. package/dist/eval/engine/deps.js.map +1 -0
  75. package/dist/eval/engine/identity.d.ts +128 -0
  76. package/dist/eval/engine/identity.d.ts.map +1 -0
  77. package/dist/eval/engine/identity.js +398 -0
  78. package/dist/eval/engine/identity.js.map +1 -0
  79. package/dist/eval/engine/index.d.ts +200 -0
  80. package/dist/eval/engine/index.d.ts.map +1 -0
  81. package/dist/eval/engine/index.js +1242 -0
  82. package/dist/eval/engine/index.js.map +1 -0
  83. package/dist/eval/engine/measurement.d.ts +23 -0
  84. package/dist/eval/engine/measurement.d.ts.map +1 -0
  85. package/dist/eval/engine/measurement.js +42 -0
  86. package/dist/eval/engine/measurement.js.map +1 -0
  87. package/dist/eval/engine/naive.d.ts +19 -0
  88. package/dist/eval/engine/naive.d.ts.map +1 -0
  89. package/dist/eval/engine/naive.js +59 -0
  90. package/dist/eval/engine/naive.js.map +1 -0
  91. package/dist/eval/engine/ops.d.ts +214 -0
  92. package/dist/eval/engine/ops.d.ts.map +1 -0
  93. package/dist/eval/engine/ops.js +1422 -0
  94. package/dist/eval/engine/ops.js.map +1 -0
  95. package/dist/eval/engine/patches.d.ts +40 -0
  96. package/dist/eval/engine/patches.d.ts.map +1 -0
  97. package/dist/eval/engine/patches.js +125 -0
  98. package/dist/eval/engine/patches.js.map +1 -0
  99. package/dist/eval/engine/ports.d.ts +71 -0
  100. package/dist/eval/engine/ports.d.ts.map +1 -0
  101. package/dist/eval/engine/ports.js +2 -0
  102. package/dist/eval/engine/ports.js.map +1 -0
  103. package/dist/eval/engine/session.d.ts +116 -0
  104. package/dist/eval/engine/session.d.ts.map +1 -0
  105. package/dist/eval/engine/session.js +653 -0
  106. package/dist/eval/engine/session.js.map +1 -0
  107. package/dist/eval/engine/snapshot.d.ts +97 -0
  108. package/dist/eval/engine/snapshot.d.ts.map +1 -0
  109. package/dist/eval/engine/snapshot.js +221 -0
  110. package/dist/eval/engine/snapshot.js.map +1 -0
  111. package/dist/eval/engine/subscriptions.d.ts +47 -0
  112. package/dist/eval/engine/subscriptions.d.ts.map +1 -0
  113. package/dist/eval/engine/subscriptions.js +103 -0
  114. package/dist/eval/engine/subscriptions.js.map +1 -0
  115. package/dist/eval/engine/trace.d.ts +77 -0
  116. package/dist/eval/engine/trace.d.ts.map +1 -0
  117. package/dist/eval/engine/trace.js +140 -0
  118. package/dist/eval/engine/trace.js.map +1 -0
  119. package/dist/eval/error-diagnostic.d.ts +26 -0
  120. package/dist/eval/error-diagnostic.d.ts.map +1 -0
  121. package/dist/eval/error-diagnostic.js +63 -0
  122. package/dist/eval/error-diagnostic.js.map +1 -0
  123. package/dist/eval/evaluate-expr.d.ts +44 -0
  124. package/dist/eval/evaluate-expr.d.ts.map +1 -0
  125. package/dist/eval/evaluate-expr.js +149 -0
  126. package/dist/eval/evaluate-expr.js.map +1 -0
  127. package/dist/eval/evaluate.d.ts +282 -0
  128. package/dist/eval/evaluate.d.ts.map +1 -0
  129. package/dist/eval/evaluate.js +391 -0
  130. package/dist/eval/evaluate.js.map +1 -0
  131. package/dist/eval/evolution/relocate.d.ts +72 -0
  132. package/dist/eval/evolution/relocate.d.ts.map +1 -0
  133. package/dist/eval/evolution/relocate.js +427 -0
  134. package/dist/eval/evolution/relocate.js.map +1 -0
  135. package/dist/eval/evolution/select.d.ts +11 -0
  136. package/dist/eval/evolution/select.d.ts.map +1 -0
  137. package/dist/eval/evolution/select.js +53 -0
  138. package/dist/eval/evolution/select.js.map +1 -0
  139. package/dist/eval/evolution/upcast.d.ts +13 -0
  140. package/dist/eval/evolution/upcast.d.ts.map +1 -0
  141. package/dist/eval/evolution/upcast.js +88 -0
  142. package/dist/eval/evolution/upcast.js.map +1 -0
  143. package/dist/eval/expr/aggregates.d.ts +75 -0
  144. package/dist/eval/expr/aggregates.d.ts.map +1 -0
  145. package/dist/eval/expr/aggregates.js +991 -0
  146. package/dist/eval/expr/aggregates.js.map +1 -0
  147. package/dist/eval/expr/arithmetic.d.ts +26 -0
  148. package/dist/eval/expr/arithmetic.d.ts.map +1 -0
  149. package/dist/eval/expr/arithmetic.js +387 -0
  150. package/dist/eval/expr/arithmetic.js.map +1 -0
  151. package/dist/eval/expr/between.d.ts +17 -0
  152. package/dist/eval/expr/between.d.ts.map +1 -0
  153. package/dist/eval/expr/between.js +46 -0
  154. package/dist/eval/expr/between.js.map +1 -0
  155. package/dist/eval/expr/binder.d.ts +96 -0
  156. package/dist/eval/expr/binder.d.ts.map +1 -0
  157. package/dist/eval/expr/binder.js +253 -0
  158. package/dist/eval/expr/binder.js.map +1 -0
  159. package/dist/eval/expr/call-dispatch.d.ts +28 -0
  160. package/dist/eval/expr/call-dispatch.d.ts.map +1 -0
  161. package/dist/eval/expr/call-dispatch.js +114 -0
  162. package/dist/eval/expr/call-dispatch.js.map +1 -0
  163. package/dist/eval/expr/collections.d.ts +20 -0
  164. package/dist/eval/expr/collections.d.ts.map +1 -0
  165. package/dist/eval/expr/collections.js +66 -0
  166. package/dist/eval/expr/collections.js.map +1 -0
  167. package/dist/eval/expr/compare.d.ts +36 -0
  168. package/dist/eval/expr/compare.d.ts.map +1 -0
  169. package/dist/eval/expr/compare.js +115 -0
  170. package/dist/eval/expr/compare.js.map +1 -0
  171. package/dist/eval/expr/datasets.d.ts +28 -0
  172. package/dist/eval/expr/datasets.d.ts.map +1 -0
  173. package/dist/eval/expr/datasets.js +304 -0
  174. package/dist/eval/expr/datasets.js.map +1 -0
  175. package/dist/eval/expr/digest.d.ts +23 -0
  176. package/dist/eval/expr/digest.d.ts.map +1 -0
  177. package/dist/eval/expr/digest.js +89 -0
  178. package/dist/eval/expr/digest.js.map +1 -0
  179. package/dist/eval/expr/domains.d.ts +19 -0
  180. package/dist/eval/expr/domains.d.ts.map +1 -0
  181. package/dist/eval/expr/domains.js +18 -0
  182. package/dist/eval/expr/domains.js.map +1 -0
  183. package/dist/eval/expr/host.d.ts +152 -0
  184. package/dist/eval/expr/host.d.ts.map +1 -0
  185. package/dist/eval/expr/host.js +36 -0
  186. package/dist/eval/expr/host.js.map +1 -0
  187. package/dist/eval/expr/lists.d.ts +24 -0
  188. package/dist/eval/expr/lists.d.ts.map +1 -0
  189. package/dist/eval/expr/lists.js +155 -0
  190. package/dist/eval/expr/lists.js.map +1 -0
  191. package/dist/eval/expr/member.d.ts +15 -0
  192. package/dist/eval/expr/member.d.ts.map +1 -0
  193. package/dist/eval/expr/member.js +32 -0
  194. package/dist/eval/expr/member.js.map +1 -0
  195. package/dist/eval/expr/money-ops.d.ts +10 -0
  196. package/dist/eval/expr/money-ops.d.ts.map +1 -0
  197. package/dist/eval/expr/money-ops.js +17 -0
  198. package/dist/eval/expr/money-ops.js.map +1 -0
  199. package/dist/eval/expr/operands.d.ts +27 -0
  200. package/dist/eval/expr/operands.d.ts.map +1 -0
  201. package/dist/eval/expr/operands.js +167 -0
  202. package/dist/eval/expr/operands.js.map +1 -0
  203. package/dist/eval/expr/presence.d.ts +27 -0
  204. package/dist/eval/expr/presence.d.ts.map +1 -0
  205. package/dist/eval/expr/presence.js +140 -0
  206. package/dist/eval/expr/presence.js.map +1 -0
  207. package/dist/eval/expr/records.d.ts +22 -0
  208. package/dist/eval/expr/records.d.ts.map +1 -0
  209. package/dist/eval/expr/records.js +101 -0
  210. package/dist/eval/expr/records.js.map +1 -0
  211. package/dist/eval/expr/rule-refs.d.ts +25 -0
  212. package/dist/eval/expr/rule-refs.d.ts.map +1 -0
  213. package/dist/eval/expr/rule-refs.js +60 -0
  214. package/dist/eval/expr/rule-refs.js.map +1 -0
  215. package/dist/eval/expr/sequences.d.ts +26 -0
  216. package/dist/eval/expr/sequences.d.ts.map +1 -0
  217. package/dist/eval/expr/sequences.js +151 -0
  218. package/dist/eval/expr/sequences.js.map +1 -0
  219. package/dist/eval/expr/value.d.ts +99 -0
  220. package/dist/eval/expr/value.d.ts.map +1 -0
  221. package/dist/eval/expr/value.js +14 -0
  222. package/dist/eval/expr/value.js.map +1 -0
  223. package/dist/eval/expression.d.ts +142 -0
  224. package/dist/eval/expression.d.ts.map +1 -0
  225. package/dist/eval/expression.js +446 -0
  226. package/dist/eval/expression.js.map +1 -0
  227. package/dist/eval/firing.d.ts +68 -0
  228. package/dist/eval/firing.d.ts.map +1 -0
  229. package/dist/eval/firing.js +222 -0
  230. package/dist/eval/firing.js.map +1 -0
  231. package/dist/eval/gate.d.ts +110 -0
  232. package/dist/eval/gate.d.ts.map +1 -0
  233. package/dist/eval/gate.js +278 -0
  234. package/dist/eval/gate.js.map +1 -0
  235. package/dist/eval/layout-visibility.d.ts +18 -0
  236. package/dist/eval/layout-visibility.d.ts.map +1 -0
  237. package/dist/eval/layout-visibility.js +61 -0
  238. package/dist/eval/layout-visibility.js.map +1 -0
  239. package/dist/eval/option-availability.d.ts +26 -0
  240. package/dist/eval/option-availability.d.ts.map +1 -0
  241. package/dist/eval/option-availability.js +580 -0
  242. package/dist/eval/option-availability.js.map +1 -0
  243. package/dist/eval/options-boundary.d.ts +15 -0
  244. package/dist/eval/options-boundary.d.ts.map +1 -0
  245. package/dist/eval/options-boundary.js +40 -0
  246. package/dist/eval/options-boundary.js.map +1 -0
  247. package/dist/eval/options.d.ts +99 -0
  248. package/dist/eval/options.d.ts.map +1 -0
  249. package/dist/eval/options.js +96 -0
  250. package/dist/eval/options.js.map +1 -0
  251. package/dist/eval/overrides.d.ts +116 -0
  252. package/dist/eval/overrides.d.ts.map +1 -0
  253. package/dist/eval/overrides.js +176 -0
  254. package/dist/eval/overrides.js.map +1 -0
  255. package/dist/eval/paths.d.ts +25 -0
  256. package/dist/eval/paths.d.ts.map +1 -0
  257. package/dist/eval/paths.js +47 -0
  258. package/dist/eval/paths.js.map +1 -0
  259. package/dist/eval/presentation-reads.d.ts +20 -0
  260. package/dist/eval/presentation-reads.d.ts.map +1 -0
  261. package/dist/eval/presentation-reads.js +2 -0
  262. package/dist/eval/presentation-reads.js.map +1 -0
  263. package/dist/eval/presentation.d.ts +122 -0
  264. package/dist/eval/presentation.d.ts.map +1 -0
  265. package/dist/eval/presentation.js +255 -0
  266. package/dist/eval/presentation.js.map +1 -0
  267. package/dist/eval/reader/context-value.d.ts +41 -0
  268. package/dist/eval/reader/context-value.d.ts.map +1 -0
  269. package/dist/eval/reader/context-value.js +129 -0
  270. package/dist/eval/reader/context-value.js.map +1 -0
  271. package/dist/eval/reader/covered.d.ts +53 -0
  272. package/dist/eval/reader/covered.d.ts.map +1 -0
  273. package/dist/eval/reader/covered.js +139 -0
  274. package/dist/eval/reader/covered.js.map +1 -0
  275. package/dist/eval/reader/declarations.d.ts +182 -0
  276. package/dist/eval/reader/declarations.d.ts.map +1 -0
  277. package/dist/eval/reader/declarations.js +153 -0
  278. package/dist/eval/reader/declarations.js.map +1 -0
  279. package/dist/eval/reader/member-access.d.ts +87 -0
  280. package/dist/eval/reader/member-access.d.ts.map +1 -0
  281. package/dist/eval/reader/member-access.js +212 -0
  282. package/dist/eval/reader/member-access.js.map +1 -0
  283. package/dist/eval/reader/memo.d.ts +34 -0
  284. package/dist/eval/reader/memo.d.ts.map +1 -0
  285. package/dist/eval/reader/memo.js +67 -0
  286. package/dist/eval/reader/memo.js.map +1 -0
  287. package/dist/eval/reader/overlay.d.ts +74 -0
  288. package/dist/eval/reader/overlay.d.ts.map +1 -0
  289. package/dist/eval/reader/overlay.js +365 -0
  290. package/dist/eval/reader/overlay.js.map +1 -0
  291. package/dist/eval/reader/questions.d.ts +37 -0
  292. package/dist/eval/reader/questions.d.ts.map +1 -0
  293. package/dist/eval/reader/questions.js +78 -0
  294. package/dist/eval/reader/questions.js.map +1 -0
  295. package/dist/eval/reader/resolve.d.ts +84 -0
  296. package/dist/eval/reader/resolve.d.ts.map +1 -0
  297. package/dist/eval/reader/resolve.js +310 -0
  298. package/dist/eval/reader/resolve.js.map +1 -0
  299. package/dist/eval/reader/value-read.d.ts +50 -0
  300. package/dist/eval/reader/value-read.d.ts.map +1 -0
  301. package/dist/eval/reader/value-read.js +133 -0
  302. package/dist/eval/reader/value-read.js.map +1 -0
  303. package/dist/eval/reader/withheld.d.ts +48 -0
  304. package/dist/eval/reader/withheld.d.ts.map +1 -0
  305. package/dist/eval/reader/withheld.js +108 -0
  306. package/dist/eval/reader/withheld.js.map +1 -0
  307. package/dist/eval/reader-paths.d.ts +24 -0
  308. package/dist/eval/reader-paths.d.ts.map +1 -0
  309. package/dist/eval/reader-paths.js +23 -0
  310. package/dist/eval/reader-paths.js.map +1 -0
  311. package/dist/eval/reader.d.ts +281 -0
  312. package/dist/eval/reader.d.ts.map +1 -0
  313. package/dist/eval/reader.js +560 -0
  314. package/dist/eval/reader.js.map +1 -0
  315. package/dist/eval/receipt.d.ts +37 -0
  316. package/dist/eval/receipt.d.ts.map +1 -0
  317. package/dist/eval/receipt.js +222 -0
  318. package/dist/eval/receipt.js.map +1 -0
  319. package/dist/eval/report/assemble.d.ts +84 -0
  320. package/dist/eval/report/assemble.d.ts.map +1 -0
  321. package/dist/eval/report/assemble.js +277 -0
  322. package/dist/eval/report/assemble.js.map +1 -0
  323. package/dist/eval/report/fold.d.ts +18 -0
  324. package/dist/eval/report/fold.d.ts.map +1 -0
  325. package/dist/eval/report/fold.js +58 -0
  326. package/dist/eval/report/fold.js.map +1 -0
  327. package/dist/eval/rule/alternatives.d.ts +23 -0
  328. package/dist/eval/rule/alternatives.d.ts.map +1 -0
  329. package/dist/eval/rule/alternatives.js +46 -0
  330. package/dist/eval/rule/alternatives.js.map +1 -0
  331. package/dist/eval/rule/behaviour.d.ts +47 -0
  332. package/dist/eval/rule/behaviour.d.ts.map +1 -0
  333. package/dist/eval/rule/behaviour.js +249 -0
  334. package/dist/eval/rule/behaviour.js.map +1 -0
  335. package/dist/eval/rule/compute.d.ts +46 -0
  336. package/dist/eval/rule/compute.d.ts.map +1 -0
  337. package/dist/eval/rule/compute.js +158 -0
  338. package/dist/eval/rule/compute.js.map +1 -0
  339. package/dist/eval/rule/create-state.d.ts +42 -0
  340. package/dist/eval/rule/create-state.d.ts.map +1 -0
  341. package/dist/eval/rule/create-state.js +134 -0
  342. package/dist/eval/rule/create-state.js.map +1 -0
  343. package/dist/eval/rule/diagnostics.d.ts +24 -0
  344. package/dist/eval/rule/diagnostics.d.ts.map +1 -0
  345. package/dist/eval/rule/diagnostics.js +45 -0
  346. package/dist/eval/rule/diagnostics.js.map +1 -0
  347. package/dist/eval/rule/execution.d.ts +24 -0
  348. package/dist/eval/rule/execution.d.ts.map +1 -0
  349. package/dist/eval/rule/execution.js +495 -0
  350. package/dist/eval/rule/execution.js.map +1 -0
  351. package/dist/eval/rule/gate.d.ts +12 -0
  352. package/dist/eval/rule/gate.d.ts.map +1 -0
  353. package/dist/eval/rule/gate.js +34 -0
  354. package/dist/eval/rule/gate.js.map +1 -0
  355. package/dist/eval/rule/item.d.ts +11 -0
  356. package/dist/eval/rule/item.d.ts.map +1 -0
  357. package/dist/eval/rule/item.js +265 -0
  358. package/dist/eval/rule/item.js.map +1 -0
  359. package/dist/eval/rule/prepare.d.ts +64 -0
  360. package/dist/eval/rule/prepare.d.ts.map +1 -0
  361. package/dist/eval/rule/prepare.js +131 -0
  362. package/dist/eval/rule/prepare.js.map +1 -0
  363. package/dist/eval/rule/result.d.ts +97 -0
  364. package/dist/eval/rule/result.d.ts.map +1 -0
  365. package/dist/eval/rule/result.js +347 -0
  366. package/dist/eval/rule/result.js.map +1 -0
  367. package/dist/eval/rule/runner.d.ts +128 -0
  368. package/dist/eval/rule/runner.d.ts.map +1 -0
  369. package/dist/eval/rule/runner.js +296 -0
  370. package/dist/eval/rule/runner.js.map +1 -0
  371. package/dist/eval/rule/screen.d.ts +32 -0
  372. package/dist/eval/rule/screen.d.ts.map +1 -0
  373. package/dist/eval/rule/screen.js +73 -0
  374. package/dist/eval/rule/screen.js.map +1 -0
  375. package/dist/eval/rule/state.d.ts +137 -0
  376. package/dist/eval/rule/state.d.ts.map +1 -0
  377. package/dist/eval/rule/state.js +2 -0
  378. package/dist/eval/rule/state.js.map +1 -0
  379. package/dist/eval/rule/steps.d.ts +44 -0
  380. package/dist/eval/rule/steps.d.ts.map +1 -0
  381. package/dist/eval/rule/steps.js +367 -0
  382. package/dist/eval/rule/steps.js.map +1 -0
  383. package/dist/eval/rule/visibility.d.ts +18 -0
  384. package/dist/eval/rule/visibility.d.ts.map +1 -0
  385. package/dist/eval/rule/visibility.js +79 -0
  386. package/dist/eval/rule/visibility.js.map +1 -0
  387. package/dist/eval/seal.d.ts +74 -0
  388. package/dist/eval/seal.d.ts.map +1 -0
  389. package/dist/eval/seal.js +154 -0
  390. package/dist/eval/seal.js.map +1 -0
  391. package/dist/eval/signature-coverage.d.ts +19 -0
  392. package/dist/eval/signature-coverage.d.ts.map +1 -0
  393. package/dist/eval/signature-coverage.js +160 -0
  394. package/dist/eval/signature-coverage.js.map +1 -0
  395. package/dist/eval/state/derive.d.ts +72 -0
  396. package/dist/eval/state/derive.d.ts.map +1 -0
  397. package/dist/eval/state/derive.js +61 -0
  398. package/dist/eval/state/derive.js.map +1 -0
  399. package/dist/eval/state/describe.d.ts +18 -0
  400. package/dist/eval/state/describe.d.ts.map +1 -0
  401. package/dist/eval/state/describe.js +19 -0
  402. package/dist/eval/state/describe.js.map +1 -0
  403. package/dist/eval/state/field-state.d.ts +471 -0
  404. package/dist/eval/state/field-state.d.ts.map +1 -0
  405. package/dist/eval/state/field-state.js +1604 -0
  406. package/dist/eval/state/field-state.js.map +1 -0
  407. package/dist/eval/state/measurement.d.ts +136 -0
  408. package/dist/eval/state/measurement.d.ts.map +1 -0
  409. package/dist/eval/state/measurement.js +209 -0
  410. package/dist/eval/state/measurement.js.map +1 -0
  411. package/dist/eval/state/options.d.ts +21 -0
  412. package/dist/eval/state/options.d.ts.map +1 -0
  413. package/dist/eval/state/options.js +3 -0
  414. package/dist/eval/state/options.js.map +1 -0
  415. package/dist/eval/state/readiness.d.ts +400 -0
  416. package/dist/eval/state/readiness.d.ts.map +1 -0
  417. package/dist/eval/state/readiness.js +1067 -0
  418. package/dist/eval/state/readiness.js.map +1 -0
  419. package/dist/eval/state/snapshot.d.ts +130 -0
  420. package/dist/eval/state/snapshot.d.ts.map +1 -0
  421. package/dist/eval/state/snapshot.js +35 -0
  422. package/dist/eval/state/snapshot.js.map +1 -0
  423. package/dist/eval/state/unavailable-options.d.ts +54 -0
  424. package/dist/eval/state/unavailable-options.d.ts.map +1 -0
  425. package/dist/eval/state/unavailable-options.js +82 -0
  426. package/dist/eval/state/unavailable-options.js.map +1 -0
  427. package/dist/eval/state/value-state.d.ts +38 -0
  428. package/dist/eval/state/value-state.d.ts.map +1 -0
  429. package/dist/eval/state/value-state.js +52 -0
  430. package/dist/eval/state/value-state.js.map +1 -0
  431. package/dist/eval/submission/admission.d.ts +50 -0
  432. package/dist/eval/submission/admission.d.ts.map +1 -0
  433. package/dist/eval/submission/admission.js +174 -0
  434. package/dist/eval/submission/admission.js.map +1 -0
  435. package/dist/eval/submission/authority.d.ts +71 -0
  436. package/dist/eval/submission/authority.d.ts.map +1 -0
  437. package/dist/eval/submission/authority.js +118 -0
  438. package/dist/eval/submission/authority.js.map +1 -0
  439. package/dist/eval/submission/datasets.d.ts +28 -0
  440. package/dist/eval/submission/datasets.d.ts.map +1 -0
  441. package/dist/eval/submission/datasets.js +109 -0
  442. package/dist/eval/submission/datasets.js.map +1 -0
  443. package/dist/eval/submission/index.d.ts +15 -0
  444. package/dist/eval/submission/index.d.ts.map +1 -0
  445. package/dist/eval/submission/index.js +13 -0
  446. package/dist/eval/submission/index.js.map +1 -0
  447. package/dist/eval/submission/refusals.d.ts +103 -0
  448. package/dist/eval/submission/refusals.d.ts.map +1 -0
  449. package/dist/eval/submission/refusals.js +15 -0
  450. package/dist/eval/submission/refusals.js.map +1 -0
  451. package/dist/eval/submission/signatures.d.ts +7 -0
  452. package/dist/eval/submission/signatures.d.ts.map +1 -0
  453. package/dist/eval/submission/signatures.js +215 -0
  454. package/dist/eval/submission/signatures.js.map +1 -0
  455. package/dist/eval/submission/writes.d.ts +51 -0
  456. package/dist/eval/submission/writes.d.ts.map +1 -0
  457. package/dist/eval/submission/writes.js +203 -0
  458. package/dist/eval/submission/writes.js.map +1 -0
  459. package/dist/eval/submission.d.ts +53 -0
  460. package/dist/eval/submission.d.ts.map +1 -0
  461. package/dist/eval/submission.js +521 -0
  462. package/dist/eval/submission.js.map +1 -0
  463. package/dist/eval/suggestions-to-engine.d.ts +18 -0
  464. package/dist/eval/suggestions-to-engine.d.ts.map +1 -0
  465. package/dist/eval/suggestions-to-engine.js +40 -0
  466. package/dist/eval/suggestions-to-engine.js.map +1 -0
  467. package/dist/eval/suggestions.d.ts +17 -0
  468. package/dist/eval/suggestions.d.ts.map +1 -0
  469. package/dist/eval/suggestions.js +314 -0
  470. package/dist/eval/suggestions.js.map +1 -0
  471. package/dist/eval/undecided.d.ts +64 -0
  472. package/dist/eval/undecided.d.ts.map +1 -0
  473. package/dist/eval/undecided.js +101 -0
  474. package/dist/eval/undecided.js.map +1 -0
  475. package/dist/eval/verdict.d.ts +66 -0
  476. package/dist/eval/verdict.d.ts.map +1 -0
  477. package/dist/eval/verdict.js +106 -0
  478. package/dist/eval/verdict.js.map +1 -0
  479. package/dist/eval/verify-signature.d.ts +78 -0
  480. package/dist/eval/verify-signature.d.ts.map +1 -0
  481. package/dist/eval/verify-signature.js +185 -0
  482. package/dist/eval/verify-signature.js.map +1 -0
  483. package/dist/eval/version-dispatch.d.ts +38 -0
  484. package/dist/eval/version-dispatch.d.ts.map +1 -0
  485. package/dist/eval/version-dispatch.js +61 -0
  486. package/dist/eval/version-dispatch.js.map +1 -0
  487. package/dist/eval/visibility.d.ts +33 -0
  488. package/dist/eval/visibility.d.ts.map +1 -0
  489. package/dist/eval/visibility.js +83 -0
  490. package/dist/eval/visibility.js.map +1 -0
  491. package/dist/evaluate.d.ts +24 -0
  492. package/dist/evaluate.d.ts.map +1 -0
  493. package/dist/evaluate.js +18 -0
  494. package/dist/evaluate.js.map +1 -0
  495. package/dist/expr/builtin-docs.d.ts +51 -0
  496. package/dist/expr/builtin-docs.d.ts.map +1 -0
  497. package/dist/expr/builtin-docs.js +874 -0
  498. package/dist/expr/builtin-docs.js.map +1 -0
  499. package/dist/expr/builtins.d.ts +50 -0
  500. package/dist/expr/builtins.d.ts.map +1 -0
  501. package/dist/expr/builtins.js +966 -0
  502. package/dist/expr/builtins.js.map +1 -0
  503. package/dist/expr/decimal-precision.d.ts +39 -0
  504. package/dist/expr/decimal-precision.d.ts.map +1 -0
  505. package/dist/expr/decimal-precision.js +62 -0
  506. package/dist/expr/decimal-precision.js.map +1 -0
  507. package/dist/expr/decimal.d.ts +172 -0
  508. package/dist/expr/decimal.d.ts.map +1 -0
  509. package/dist/expr/decimal.js +782 -0
  510. package/dist/expr/decimal.js.map +1 -0
  511. package/dist/expr/deprecations.d.ts +34 -0
  512. package/dist/expr/deprecations.d.ts.map +1 -0
  513. package/dist/expr/deprecations.js +17 -0
  514. package/dist/expr/deprecations.js.map +1 -0
  515. package/dist/expr/diagnostics.d.ts +21 -0
  516. package/dist/expr/diagnostics.d.ts.map +1 -0
  517. package/dist/expr/diagnostics.js +231 -0
  518. package/dist/expr/diagnostics.js.map +1 -0
  519. package/dist/expr/direction.d.ts +30 -0
  520. package/dist/expr/direction.d.ts.map +1 -0
  521. package/dist/expr/direction.js +77 -0
  522. package/dist/expr/direction.js.map +1 -0
  523. package/dist/expr/example-expression.d.ts +62 -0
  524. package/dist/expr/example-expression.d.ts.map +1 -0
  525. package/dist/expr/example-expression.js +670 -0
  526. package/dist/expr/example-expression.js.map +1 -0
  527. package/dist/expr/instant.d.ts +49 -0
  528. package/dist/expr/instant.d.ts.map +1 -0
  529. package/dist/expr/instant.js +111 -0
  530. package/dist/expr/instant.js.map +1 -0
  531. package/dist/expr/logic.d.ts +17 -0
  532. package/dist/expr/logic.d.ts.map +1 -0
  533. package/dist/expr/logic.js +65 -0
  534. package/dist/expr/logic.js.map +1 -0
  535. package/dist/expr/messages.d.ts +45 -0
  536. package/dist/expr/messages.d.ts.map +1 -0
  537. package/dist/expr/messages.js +280 -0
  538. package/dist/expr/messages.js.map +1 -0
  539. package/dist/expr/money.d.ts +38 -0
  540. package/dist/expr/money.d.ts.map +1 -0
  541. package/dist/expr/money.js +127 -0
  542. package/dist/expr/money.js.map +1 -0
  543. package/dist/expr/ordering.d.ts +56 -0
  544. package/dist/expr/ordering.d.ts.map +1 -0
  545. package/dist/expr/ordering.js +167 -0
  546. package/dist/expr/ordering.js.map +1 -0
  547. package/dist/expr/pattern.d.ts +44 -0
  548. package/dist/expr/pattern.d.ts.map +1 -0
  549. package/dist/expr/pattern.js +458 -0
  550. package/dist/expr/pattern.js.map +1 -0
  551. package/dist/expr/plain-date.d.ts +90 -0
  552. package/dist/expr/plain-date.d.ts.map +1 -0
  553. package/dist/expr/plain-date.js +230 -0
  554. package/dist/expr/plain-date.js.map +1 -0
  555. package/dist/expr/plural-categories.d.ts +8 -0
  556. package/dist/expr/plural-categories.d.ts.map +1 -0
  557. package/dist/expr/plural-categories.js +15 -0
  558. package/dist/expr/plural-categories.js.map +1 -0
  559. package/dist/expr/plural-keys.d.ts +39 -0
  560. package/dist/expr/plural-keys.d.ts.map +1 -0
  561. package/dist/expr/plural-keys.js +46 -0
  562. package/dist/expr/plural-keys.js.map +1 -0
  563. package/dist/expr/plural.d.ts +33 -0
  564. package/dist/expr/plural.d.ts.map +1 -0
  565. package/dist/expr/plural.js +50 -0
  566. package/dist/expr/plural.js.map +1 -0
  567. package/dist/expr/quantity.d.ts +31 -0
  568. package/dist/expr/quantity.d.ts.map +1 -0
  569. package/dist/expr/quantity.js +83 -0
  570. package/dist/expr/quantity.js.map +1 -0
  571. package/dist/expr/reduce.d.ts +50 -0
  572. package/dist/expr/reduce.d.ts.map +1 -0
  573. package/dist/expr/reduce.js +236 -0
  574. package/dist/expr/reduce.js.map +1 -0
  575. package/dist/expr/regex.d.ts +108 -0
  576. package/dist/expr/regex.d.ts.map +1 -0
  577. package/dist/expr/regex.js +1210 -0
  578. package/dist/expr/regex.js.map +1 -0
  579. package/dist/expr/select-locale.d.ts +67 -0
  580. package/dist/expr/select-locale.d.ts.map +1 -0
  581. package/dist/expr/select-locale.js +219 -0
  582. package/dist/expr/select-locale.js.map +1 -0
  583. package/dist/expr/sequences.d.ts +123 -0
  584. package/dist/expr/sequences.d.ts.map +1 -0
  585. package/dist/expr/sequences.js +234 -0
  586. package/dist/expr/sequences.js.map +1 -0
  587. package/dist/expr/strings.d.ts +50 -0
  588. package/dist/expr/strings.d.ts.map +1 -0
  589. package/dist/expr/strings.js +184 -0
  590. package/dist/expr/strings.js.map +1 -0
  591. package/dist/expr/validation.d.ts +32 -0
  592. package/dist/expr/validation.d.ts.map +1 -0
  593. package/dist/expr/validation.js +182 -0
  594. package/dist/expr/validation.js.map +1 -0
  595. package/dist/graph/freeze.d.ts +4 -0
  596. package/dist/graph/freeze.d.ts.map +1 -0
  597. package/dist/graph/freeze.js +52 -0
  598. package/dist/graph/freeze.js.map +1 -0
  599. package/dist/graph/index.d.ts +15 -0
  600. package/dist/graph/index.d.ts.map +1 -0
  601. package/dist/graph/index.js +13 -0
  602. package/dist/graph/index.js.map +1 -0
  603. package/dist/graph/inspect.d.ts +76 -0
  604. package/dist/graph/inspect.d.ts.map +1 -0
  605. package/dist/graph/inspect.js +263 -0
  606. package/dist/graph/inspect.js.map +1 -0
  607. package/dist/graph/read-walk.d.ts +101 -0
  608. package/dist/graph/read-walk.d.ts.map +1 -0
  609. package/dist/graph/read-walk.js +358 -0
  610. package/dist/graph/read-walk.js.map +1 -0
  611. package/dist/graph/record-index.d.ts +24 -0
  612. package/dist/graph/record-index.d.ts.map +1 -0
  613. package/dist/graph/record-index.js +35 -0
  614. package/dist/graph/record-index.js.map +1 -0
  615. package/dist/index.d.ts +104 -0
  616. package/dist/index.d.ts.map +1 -0
  617. package/dist/index.js +139 -0
  618. package/dist/index.js.map +1 -0
  619. package/dist/lookup/digest.d.ts +51 -0
  620. package/dist/lookup/digest.d.ts.map +1 -0
  621. package/dist/lookup/digest.js +46 -0
  622. package/dist/lookup/digest.js.map +1 -0
  623. package/dist/lookup/index.d.ts +28 -0
  624. package/dist/lookup/index.d.ts.map +1 -0
  625. package/dist/lookup/index.js +27 -0
  626. package/dist/lookup/index.js.map +1 -0
  627. package/dist/lookup/install.d.ts +48 -0
  628. package/dist/lookup/install.d.ts.map +1 -0
  629. package/dist/lookup/install.js +315 -0
  630. package/dist/lookup/install.js.map +1 -0
  631. package/dist/lookup/pass.d.ts +55 -0
  632. package/dist/lookup/pass.d.ts.map +1 -0
  633. package/dist/lookup/pass.js +212 -0
  634. package/dist/lookup/pass.js.map +1 -0
  635. package/dist/lookup/pins.d.ts +34 -0
  636. package/dist/lookup/pins.d.ts.map +1 -0
  637. package/dist/lookup/pins.js +39 -0
  638. package/dist/lookup/pins.js.map +1 -0
  639. package/dist/lookup/provenance.d.ts +23 -0
  640. package/dist/lookup/provenance.d.ts.map +1 -0
  641. package/dist/lookup/provenance.js +78 -0
  642. package/dist/lookup/provenance.js.map +1 -0
  643. package/dist/lookup/readiness.d.ts +13 -0
  644. package/dist/lookup/readiness.d.ts.map +1 -0
  645. package/dist/lookup/readiness.js +57 -0
  646. package/dist/lookup/readiness.js.map +1 -0
  647. package/dist/lookup/resolve.d.ts +24 -0
  648. package/dist/lookup/resolve.d.ts.map +1 -0
  649. package/dist/lookup/resolve.js +201 -0
  650. package/dist/lookup/resolve.js.map +1 -0
  651. package/dist/lookup/store.d.ts +41 -0
  652. package/dist/lookup/store.d.ts.map +1 -0
  653. package/dist/lookup/store.js +74 -0
  654. package/dist/lookup/store.js.map +1 -0
  655. package/dist/model/access.d.ts +200 -0
  656. package/dist/model/access.d.ts.map +1 -0
  657. package/dist/model/access.js +125 -0
  658. package/dist/model/access.js.map +1 -0
  659. package/dist/model/artifact-members.d.ts +3 -0
  660. package/dist/model/artifact-members.d.ts.map +1 -0
  661. package/dist/model/artifact-members.js +38 -0
  662. package/dist/model/artifact-members.js.map +1 -0
  663. package/dist/model/composition.d.ts +47 -0
  664. package/dist/model/composition.d.ts.map +1 -0
  665. package/dist/model/composition.js +66 -0
  666. package/dist/model/composition.js.map +1 -0
  667. package/dist/model/domain.d.ts +51 -0
  668. package/dist/model/domain.d.ts.map +1 -0
  669. package/dist/model/domain.js +75 -0
  670. package/dist/model/domain.js.map +1 -0
  671. package/dist/model/duration.d.ts +31 -0
  672. package/dist/model/duration.d.ts.map +1 -0
  673. package/dist/model/duration.js +136 -0
  674. package/dist/model/duration.js.map +1 -0
  675. package/dist/model/errors.d.ts +58 -0
  676. package/dist/model/errors.d.ts.map +1 -0
  677. package/dist/model/errors.js +81 -0
  678. package/dist/model/errors.js.map +1 -0
  679. package/dist/model/evolution.d.ts +177 -0
  680. package/dist/model/evolution.d.ts.map +1 -0
  681. package/dist/model/evolution.js +5 -0
  682. package/dist/model/evolution.js.map +1 -0
  683. package/dist/model/expr-children.d.ts +15 -0
  684. package/dist/model/expr-children.d.ts.map +1 -0
  685. package/dist/model/expr-children.js +45 -0
  686. package/dist/model/expr-children.js.map +1 -0
  687. package/dist/model/guards.d.ts +9 -0
  688. package/dist/model/guards.d.ts.map +1 -0
  689. package/dist/model/guards.js +11 -0
  690. package/dist/model/guards.js.map +1 -0
  691. package/dist/model/input.d.ts +42 -0
  692. package/dist/model/input.d.ts.map +1 -0
  693. package/dist/model/input.js +26 -0
  694. package/dist/model/input.js.map +1 -0
  695. package/dist/model/integer.d.ts +14 -0
  696. package/dist/model/integer.d.ts.map +1 -0
  697. package/dist/model/integer.js +16 -0
  698. package/dist/model/integer.js.map +1 -0
  699. package/dist/model/intrinsic.d.ts +18 -0
  700. package/dist/model/intrinsic.d.ts.map +1 -0
  701. package/dist/model/intrinsic.js +21 -0
  702. package/dist/model/intrinsic.js.map +1 -0
  703. package/dist/model/layout.d.ts +129 -0
  704. package/dist/model/layout.d.ts.map +1 -0
  705. package/dist/model/layout.js +2 -0
  706. package/dist/model/layout.js.map +1 -0
  707. package/dist/model/media.d.ts +33 -0
  708. package/dist/model/media.d.ts.map +1 -0
  709. package/dist/model/media.js +86 -0
  710. package/dist/model/media.js.map +1 -0
  711. package/dist/model/members.generated.d.ts +11 -0
  712. package/dist/model/members.generated.d.ts.map +1 -0
  713. package/dist/model/members.generated.js +71 -0
  714. package/dist/model/members.generated.js.map +1 -0
  715. package/dist/model/row-address.d.ts +27 -0
  716. package/dist/model/row-address.d.ts.map +1 -0
  717. package/dist/model/row-address.js +146 -0
  718. package/dist/model/row-address.js.map +1 -0
  719. package/dist/model/schema.d.ts +108 -0
  720. package/dist/model/schema.d.ts.map +1 -0
  721. package/dist/model/schema.js +2 -0
  722. package/dist/model/schema.js.map +1 -0
  723. package/dist/model/shape.d.ts +193 -0
  724. package/dist/model/shape.d.ts.map +1 -0
  725. package/dist/model/shape.js +2 -0
  726. package/dist/model/shape.js.map +1 -0
  727. package/dist/model/time.d.ts +61 -0
  728. package/dist/model/time.d.ts.map +1 -0
  729. package/dist/model/time.js +110 -0
  730. package/dist/model/time.js.map +1 -0
  731. package/dist/model/types.d.ts +1329 -0
  732. package/dist/model/types.d.ts.map +1 -0
  733. package/dist/model/types.js +424 -0
  734. package/dist/model/types.js.map +1 -0
  735. package/dist/model/values.d.ts +91 -0
  736. package/dist/model/values.d.ts.map +1 -0
  737. package/dist/model/values.js +195 -0
  738. package/dist/model/values.js.map +1 -0
  739. package/dist/model/wire.d.ts +356 -0
  740. package/dist/model/wire.d.ts.map +1 -0
  741. package/dist/model/wire.js +1504 -0
  742. package/dist/model/wire.js.map +1 -0
  743. package/dist/offline/index.d.ts +374 -0
  744. package/dist/offline/index.d.ts.map +1 -0
  745. package/dist/offline/index.js +422 -0
  746. package/dist/offline/index.js.map +1 -0
  747. package/dist/testing.d.ts +30 -0
  748. package/dist/testing.d.ts.map +1 -0
  749. package/dist/testing.js +42 -0
  750. package/dist/testing.js.map +1 -0
  751. package/dist/version.d.ts +30 -0
  752. package/dist/version.d.ts.map +1 -0
  753. package/dist/version.js +116 -0
  754. package/dist/version.js.map +1 -0
  755. package/package.json +98 -3
@@ -0,0 +1,133 @@
1
+ import { DEFERRED, UNKNOWN } from '../../model/types.js';
2
+ import { isWireArray } from '../../model/values.js';
3
+ import { ABSENT, valueOf } from '../expr/value.js';
4
+ /** The withheld sideband one evaluated value carries, when it is a value at all. */
5
+ function withheldRowsOf(evaluated) {
6
+ return evaluated.kind === 'value' ? evaluated.withheldRows : undefined;
7
+ }
8
+ /**
9
+ * Whether one read answered no value, `RULES-2.1.1`.
10
+ *
11
+ * An absent path is the one a `??` idiom handles and a `len` or comparison folds to `UNKNOWN`,
12
+ * a held `null` is a gap the respondent may fill, and a value read carrying the `UNKNOWN` sentinel
13
+ * is one no writer or host supplied. `DEFERRED` is not one of them: a redacted value is the
14
+ * server's handoff, which `hasDeferredChecks` already states.
15
+ */
16
+ function holdsNoValue(evaluated) {
17
+ return (evaluated.kind === 'absent' ||
18
+ (evaluated.kind === 'value' && (evaluated.value === UNKNOWN || evaluated.value === null)));
19
+ }
20
+ /** Whether one read answered a value the server holds rather than a value this device has. */
21
+ function holdsServerValue(evaluated) {
22
+ return evaluated.kind === 'value' && evaluated.value === DEFERRED;
23
+ }
24
+ /**
25
+ * One path's resolved value, cached for the evaluation unless a computed writer can still
26
+ * change it. A read reports the refusals and the withheld fields it observed on every call,
27
+ * including a cache hit: those are facts about the read, not about the resolution.
28
+ *
29
+ * Resolution already validated the value — `resolvePath` is the one place a submission
30
+ * crosses the wire reader — so this function only turns it into the evaluator's value. A
31
+ * missing required context root arrives as the `UNKNOWN` sentinel, which is not a value of
32
+ * the declared primitive and is handed on as it stands.
33
+ */
34
+ export function readValue(source, path) {
35
+ const cached = source.cachedRead(path);
36
+ if (cached !== undefined) {
37
+ const refused = source.noteReadDenials(path);
38
+ source.noteWithheld(path, withheldRowsOf(cached));
39
+ if (!refused && holdsNoValue(cached))
40
+ source.noteMissingInput();
41
+ if (holdsServerValue(cached))
42
+ source.noteDeferredInput();
43
+ return cached;
44
+ }
45
+ const resolved = source.resolveCached(path);
46
+ const refused = source.noteReadDenials(path);
47
+ let evaluated;
48
+ switch (resolved.kind) {
49
+ case 'value':
50
+ evaluated = valueOf(resolved.value, resolved.primitive);
51
+ break;
52
+ case 'absent':
53
+ evaluated = ABSENT;
54
+ break;
55
+ case 'unreadable':
56
+ evaluated = valueOf(UNKNOWN, resolved.primitive);
57
+ break;
58
+ case 'redacted':
59
+ evaluated = valueOf(DEFERRED, resolved.primitive);
60
+ break;
61
+ }
62
+ // An absent or null input and a value no refusal explains are inputs this device may read that
63
+ // held no answer, `RULES-2.1.1`. A refusal already recorded its own cause, and a redacted or
64
+ // deferred value is a handoff the server still owes rather than an open question.
65
+ if (!refused && holdsNoValue(evaluated))
66
+ source.noteMissingInput();
67
+ if (holdsServerValue(evaluated))
68
+ source.noteDeferredInput();
69
+ const complete = evaluatedOf(source, path, resolved);
70
+ source.noteWithheld(path, complete.kind === 'value' ? complete.withheldRows : undefined);
71
+ if (!source.isComputedAffected(path))
72
+ source.rememberRead(path, complete);
73
+ return complete;
74
+ }
75
+ /**
76
+ * One resolved value as the evaluator sees it, with the sidebands a binder answers from.
77
+ *
78
+ * A value read carries the members the device may not read, so a binder over it can answer
79
+ * `UNKNOWN` rather than reading the removal as an absence. A member the server holds is
80
+ * `DEFERRED` through the same sideband a writer's unproduced member uses, so one row's `DEFERRED`
81
+ * member never becomes another row's absence (`EXPR-9.1.7`). A computed value brings the sideband
82
+ * its writer's expression carried; the access answer for this read adds anything it stripped.
83
+ */
84
+ export function evaluatedOf(source, path, resolved) {
85
+ const evaluated = resolved.kind === 'value'
86
+ ? valueOf(resolved.value, resolved.primitive)
87
+ : resolved.kind === 'absent'
88
+ ? ABSENT
89
+ : valueOf(resolved.kind === 'redacted' ? DEFERRED : UNKNOWN, resolved.primitive);
90
+ const computed = resolved.kind === 'value' ? resolved : undefined;
91
+ const accessRows = evaluated.kind === 'value' && isWireArray(evaluated.value)
92
+ ? source.withheldRows(path)
93
+ : undefined;
94
+ const withheldRows = mergeWithheldRows(computed?.withheldRows, accessRows);
95
+ const undeterminedRows = mergeUndeterminedRows(computed?.undeterminedRows, evaluated.kind === 'value' && isWireArray(evaluated.value)
96
+ ? source.deferredRows(path)
97
+ : undefined);
98
+ // A per-row read states the sidebands its walk recorded even when no computed writer exists.
99
+ if (evaluated.kind === 'absent' ||
100
+ (computed?.withheldMembers === undefined &&
101
+ withheldRows === undefined &&
102
+ undeterminedRows === undefined)) {
103
+ return evaluated;
104
+ }
105
+ return {
106
+ ...evaluated,
107
+ ...(computed?.withheldMembers === undefined
108
+ ? {}
109
+ : { withheldMembers: computed.withheldMembers }),
110
+ ...(withheldRows === undefined ? {} : { withheldRows }),
111
+ ...(undeterminedRows === undefined ? {} : { undeterminedRows }),
112
+ };
113
+ }
114
+ /** One array read's redacted members as the `DEFERRED` sideband a binder answers from. */
115
+ function mergeUndeterminedRows(computed, access) {
116
+ if (access === undefined)
117
+ return computed;
118
+ const rows = access.map((members) => members.map((path) => [path, DEFERRED]));
119
+ if (computed === undefined)
120
+ return rows;
121
+ // Access is decided before the writer overlay, so a host redaction outranks an unproduced
122
+ // member's `UNKNOWN`: the binder reads the first sentinel for a path.
123
+ return computed.map((entries, index) => [...(rows[index] ?? []), ...entries]);
124
+ }
125
+ /** The two access statements one computed read carries, aligned with its elements. */
126
+ function mergeWithheldRows(computed, access) {
127
+ if (computed === undefined)
128
+ return access;
129
+ if (access === undefined)
130
+ return computed;
131
+ return computed.map((members, index) => [...new Set([...members, ...(access[index] ?? [])])]);
132
+ }
133
+ //# sourceMappingURL=value-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-read.js","sourceRoot":"","sources":["../../../src/eval/reader/value-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA+BnD,oFAAoF;AACpF,SAAS,cAAc,CAAC,SAAoB;IAC1C,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AACzE,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY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AE,gBAAgB,EAAE,CAAC;KAChE,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,SAAS,qBAAqB,CAC5B,QAAsC,EACtC,MAAkD;IAElD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAU,CAAC,CAAC,CAAC;IACvF,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACxC,0FAA0F;IAC1F,sEAAsE;IACtE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,sFAAsF;AACtF,SAAS,iBAAiB,CACxB,QAAoD,EACpD,MAAkD;IAElD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAC1C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC1C,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChG,CAAC","sourcesContent":["import { DEFERRED, UNKNOWN } from '../../model/types.js';\nimport type { UndeterminedRows } from '../../model/types.js';\nimport { isWireArray } from '../../model/values.js';\nimport { ABSENT, valueOf } from '../expr/value.js';\nimport type { Evaluated } from '../expr/value.js';\nimport type { Resolved } from './declarations.js';\n\n/** The reader state one value read needs, including the cache it writes back to. */\nexport interface ValueRead {\n cachedRead(path: string): Evaluated | undefined;\n rememberRead(path: string, evaluated: Evaluated): void;\n resolveCached(path: string): Resolved;\n /** Records the read's refusals and returns whether this path was refused. */\n noteReadDenials(path: string): boolean;\n /**\n * Records that the read held no decided value for a reason no refusal explains,\n * `RULES-2.1.1`: an absent or null input, or a value no writer produced.\n */\n noteMissingInput(): void;\n /** Records that the read answered a value the server holds, `[ACCESS-3.1.2]`. */\n noteDeferredInput(): void;\n /**\n * Records the members one array read withheld, per row. It is the read's own sideband, so the\n * disclosure taint can tell a member the value no longer carries from one it does.\n */\n noteWithheld(path: string, withheldRows?: readonly (readonly string[])[]): void;\n noteWithheldField(fieldId: string): void;\n isComputedAffected(path: string): boolean;\n /** The members each element of a withheld array read this device may not read. */\n withheldRows(path: string): readonly (readonly string[])[] | undefined;\n /** The members each element of a redacted array read the server holds. */\n deferredRows(path: string): readonly (readonly string[])[] | undefined;\n}\n\n/** The withheld sideband one evaluated value carries, when it is a value at all. */\nfunction withheldRowsOf(evaluated: Evaluated): readonly (readonly string[])[] | undefined {\n return evaluated.kind === 'value' ? evaluated.withheldRows : undefined;\n}\n\n/**\n * Whether one read answered no value, `RULES-2.1.1`.\n *\n * An absent path is the one a `??` idiom handles and a `len` or comparison folds to `UNKNOWN`,\n * a held `null` is a gap the respondent may fill, and a value read carrying the `UNKNOWN` sentinel\n * is one no writer or host supplied. `DEFERRED` is not one of them: a redacted value is the\n * server's handoff, which `hasDeferredChecks` already states.\n */\nfunction holdsNoValue(evaluated: Evaluated): boolean {\n return (\n evaluated.kind === 'absent' ||\n (evaluated.kind === 'value' && (evaluated.value === UNKNOWN || evaluated.value === null))\n );\n}\n\n/** Whether one read answered a value the server holds rather than a value this device has. */\nfunction holdsServerValue(evaluated: Evaluated): boolean {\n return evaluated.kind === 'value' && evaluated.value === DEFERRED;\n}\n\n/**\n * One path's resolved value, cached for the evaluation unless a computed writer can still\n * change it. A read reports the refusals and the withheld fields it observed on every call,\n * including a cache hit: those are facts about the read, not about the resolution.\n *\n * Resolution already validated the value — `resolvePath` is the one place a submission\n * crosses the wire reader — so this function only turns it into the evaluator's value. A\n * missing required context root arrives as the `UNKNOWN` sentinel, which is not a value of\n * the declared primitive and is handed on as it stands.\n */\nexport function readValue(source: ValueRead, path: string): Evaluated {\n const cached = source.cachedRead(path);\n if (cached !== undefined) {\n const refused = source.noteReadDenials(path);\n source.noteWithheld(path, withheldRowsOf(cached));\n if (!refused && holdsNoValue(cached)) source.noteMissingInput();\n if (holdsServerValue(cached)) source.noteDeferredInput();\n return cached;\n }\n const resolved = source.resolveCached(path);\n const refused = source.noteReadDenials(path);\n let evaluated: Evaluated;\n switch (resolved.kind) {\n case 'value':\n evaluated = valueOf(resolved.value, resolved.primitive);\n break;\n case 'absent':\n evaluated = ABSENT;\n break;\n case 'unreadable':\n evaluated = valueOf(UNKNOWN, resolved.primitive);\n break;\n case 'redacted':\n evaluated = valueOf(DEFERRED, resolved.primitive);\n break;\n }\n // An absent or null input and a value no refusal explains are inputs this device may read that\n // held no answer, `RULES-2.1.1`. A refusal already recorded its own cause, and a redacted or\n // deferred value is a handoff the server still owes rather than an open question.\n if (!refused && holdsNoValue(evaluated)) source.noteMissingInput();\n if (holdsServerValue(evaluated)) source.noteDeferredInput();\n const complete = evaluatedOf(source, path, resolved);\n source.noteWithheld(path, complete.kind === 'value' ? complete.withheldRows : undefined);\n if (!source.isComputedAffected(path)) source.rememberRead(path, complete);\n return complete;\n}\n\n/**\n * One resolved value as the evaluator sees it, with the sidebands a binder answers from.\n *\n * A value read carries the members the device may not read, so a binder over it can answer\n * `UNKNOWN` rather than reading the removal as an absence. A member the server holds is\n * `DEFERRED` through the same sideband a writer's unproduced member uses, so one row's `DEFERRED`\n * member never becomes another row's absence (`EXPR-9.1.7`). A computed value brings the sideband\n * its writer's expression carried; the access answer for this read adds anything it stripped.\n */\nexport function evaluatedOf(source: ValueRead, path: string, resolved: Resolved): Evaluated {\n const evaluated: Evaluated =\n resolved.kind === 'value'\n ? valueOf(resolved.value, resolved.primitive)\n : resolved.kind === 'absent'\n ? ABSENT\n : valueOf(resolved.kind === 'redacted' ? DEFERRED : UNKNOWN, resolved.primitive);\n const computed = resolved.kind === 'value' ? resolved : undefined;\n const accessRows =\n evaluated.kind === 'value' && isWireArray(evaluated.value)\n ? source.withheldRows(path)\n : undefined;\n const withheldRows = mergeWithheldRows(computed?.withheldRows, accessRows);\n const undeterminedRows = mergeUndeterminedRows(\n computed?.undeterminedRows,\n evaluated.kind === 'value' && isWireArray(evaluated.value)\n ? source.deferredRows(path)\n : undefined,\n );\n // A per-row read states the sidebands its walk recorded even when no computed writer exists.\n if (\n evaluated.kind === 'absent' ||\n (computed?.withheldMembers === undefined &&\n withheldRows === undefined &&\n undeterminedRows === undefined)\n ) {\n return evaluated;\n }\n return {\n ...evaluated,\n ...(computed?.withheldMembers === undefined\n ? {}\n : { withheldMembers: computed.withheldMembers }),\n ...(withheldRows === undefined ? {} : { withheldRows }),\n ...(undeterminedRows === undefined ? {} : { undeterminedRows }),\n };\n}\n\n/** One array read's redacted members as the `DEFERRED` sideband a binder answers from. */\nfunction mergeUndeterminedRows(\n computed: UndeterminedRows | undefined,\n access: readonly (readonly string[])[] | undefined,\n): UndeterminedRows | undefined {\n if (access === undefined) return computed;\n const rows = access.map((members) => members.map((path) => [path, DEFERRED] as const));\n if (computed === undefined) return rows;\n // Access is decided before the writer overlay, so a host redaction outranks an unproduced\n // member's `UNKNOWN`: the binder reads the first sentinel for a path.\n return computed.map((entries, index) => [...(rows[index] ?? []), ...entries]);\n}\n\n/** The two access statements one computed read carries, aligned with its elements. */\nfunction mergeWithheldRows(\n computed: readonly (readonly string[])[] | undefined,\n access: readonly (readonly string[])[] | undefined,\n): readonly (readonly string[])[] | undefined {\n if (computed === undefined) return access;\n if (access === undefined) return computed;\n return computed.map((members, index) => [...new Set([...members, ...(access[index] ?? [])])]);\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import type { DeclaredPath } from '../reader-paths.js';
2
+ import type { WithheldFields } from './declarations.js';
3
+ /**
4
+ * The disclosure-taint stream: every read that touched a value the report must not state, in
5
+ * read order. The report must not quote such a value in a parameter, a lookup key or a
6
+ * presentation readout, so the caller marks the stream and asks what its own read observed.
7
+ *
8
+ * Two facts make a value unstateable. A `visible` rule can hide a field whose policy is
9
+ * `exclude`, which is the visibility half; and the resolved access can withhold delivery —
10
+ * `masked`, `hidden`, a stored `write_only`, or a container or host redaction above the field.
11
+ * The second half is independent of `allowMaskedRead`: that list lifts a mask for expression
12
+ * reads and never for delivery, so a read it unlocks still taints. A value derived from a
13
+ * masked read is the computation's own and may be reported; only the read's payload, not what
14
+ * an expression computes from it, is withheld.
15
+ *
16
+ * The value is still delivered to the expression: a `visible` rule never stops an expression
17
+ * reading a hidden field, and `allowMaskedRead` never stops one reading a masked field. This log
18
+ * exists to keep the value out of the report, not out of the language.
19
+ */
20
+ export declare class WithheldTaint {
21
+ private readonly log;
22
+ private readonly withheld;
23
+ private readonly walked;
24
+ private readonly deliveryWithheld;
25
+ constructor(withheld: WithheldFields | undefined, walked: (path: string) => DeclaredPath | undefined, deliveryWithheld?: (fieldId: string) => boolean);
26
+ /** The current position in the taint stream. */
27
+ mark(): number;
28
+ /** The withheld fields a read since `mark` touched, deduplicated in read order. */
29
+ since(mark: number): readonly string[];
30
+ /** Records the withheld fields one path's read touched. */
31
+ note(path: string, withheldRows?: readonly (readonly string[])[]): void;
32
+ /** Records one field, when the report may not state its value. */
33
+ noteField(fieldId: string): void;
34
+ /** Whether one field's value is hidden-and-excluded, or withheld from delivery by access. */
35
+ private withholds;
36
+ private noteMembers;
37
+ /**
38
+ * Taints the members of a delivered array that the value still carries although the access
39
+ * answer withholds them.
40
+ *
41
+ * `stripped` is the read's own statement of the member paths it removed, relative to the row
42
+ * and dotted through any record the row carries. A member outside that set was delivered to
43
+ * the expression (a mask lifted by `allowMaskedRead`, or a field hidden by a `visible` rule),
44
+ * which is exactly the payload the report and the layout must not quote.
45
+ */
46
+ private noteCarriedMembers;
47
+ }
48
+ //# sourceMappingURL=withheld.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withheld.d.ts","sourceRoot":"","sources":["../../../src/eval/reader/withheld.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6C;IACpE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA+B;IAEhE,YACE,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,EAClD,gBAAgB,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAqB,EAK7D;IAED,gDAAgD;IAChD,IAAI,IAAI,MAAM,CAEb;IAED,mFAAmF;IACnF,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAErC;IAED,2DAA2D;IAC3D,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAkBtE;IAED,kEAAkE;IAClE,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE/B;IAED,6FAA6F;IAC7F,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,WAAW;IAOnB;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;CAW3B"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * The disclosure-taint stream: every read that touched a value the report must not state, in
3
+ * read order. The report must not quote such a value in a parameter, a lookup key or a
4
+ * presentation readout, so the caller marks the stream and asks what its own read observed.
5
+ *
6
+ * Two facts make a value unstateable. A `visible` rule can hide a field whose policy is
7
+ * `exclude`, which is the visibility half; and the resolved access can withhold delivery —
8
+ * `masked`, `hidden`, a stored `write_only`, or a container or host redaction above the field.
9
+ * The second half is independent of `allowMaskedRead`: that list lifts a mask for expression
10
+ * reads and never for delivery, so a read it unlocks still taints. A value derived from a
11
+ * masked read is the computation's own and may be reported; only the read's payload, not what
12
+ * an expression computes from it, is withheld.
13
+ *
14
+ * The value is still delivered to the expression: a `visible` rule never stops an expression
15
+ * reading a hidden field, and `allowMaskedRead` never stops one reading a masked field. This log
16
+ * exists to keep the value out of the report, not out of the language.
17
+ */
18
+ export class WithheldTaint {
19
+ log = [];
20
+ withheld;
21
+ walked;
22
+ deliveryWithheld;
23
+ constructor(withheld, walked, deliveryWithheld = () => false) {
24
+ this.withheld = withheld;
25
+ this.walked = walked;
26
+ this.deliveryWithheld = deliveryWithheld;
27
+ }
28
+ /** The current position in the taint stream. */
29
+ mark() {
30
+ return this.log.length;
31
+ }
32
+ /** The withheld fields a read since `mark` touched, deduplicated in read order. */
33
+ since(mark) {
34
+ return [...new Set(this.log.slice(mark))];
35
+ }
36
+ /** Records the withheld fields one path's read touched. */
37
+ note(path, withheldRows) {
38
+ const walked = this.walked(path);
39
+ if (walked === undefined)
40
+ return;
41
+ for (const fieldId of walked.declared)
42
+ this.noteField(fieldId);
43
+ if (walked.field.primitive === 'array') {
44
+ // An array read states, per row, the members it removed (`withheldRows`). A member it
45
+ // removed never reached the expression's value, so a payload folded from what it did
46
+ // deliver is not quoting that member — and the binder over the same read answers the
47
+ // removed cell `UNKNOWN` rather than its absence. A withheld member the read still
48
+ // carries (a mask lifted for expression reads, or a visibility exclusion) is disclosed by
49
+ // any payload that quotes it, so it stays tainted. Tainting every declaration instead
50
+ // would blank a readout folded from readable cells beside a withheld sibling.
51
+ this.noteCarriedMembers(walked.field, strippedMembersOf(withheldRows), '');
52
+ return;
53
+ }
54
+ // A record travels as one payload, so a withheld member is disclosed even when the
55
+ // expression addressed the record rather than the member: the payload cannot be split.
56
+ this.noteMembers(walked.field);
57
+ }
58
+ /** Records one field, when the report may not state its value. */
59
+ noteField(fieldId) {
60
+ if (this.withholds(fieldId))
61
+ this.log.push(fieldId);
62
+ }
63
+ /** Whether one field's value is hidden-and-excluded, or withheld from delivery by access. */
64
+ withholds(fieldId) {
65
+ const withheld = this.withheld;
66
+ if (withheld !== undefined &&
67
+ withheld.candidates.has(fieldId) &&
68
+ withheld.isWithheld(fieldId)) {
69
+ return true;
70
+ }
71
+ return this.deliveryWithheld(fieldId);
72
+ }
73
+ noteMembers(field) {
74
+ for (const member of field.fields ?? []) {
75
+ this.noteField(member.fieldId);
76
+ this.noteMembers(member);
77
+ }
78
+ }
79
+ /**
80
+ * Taints the members of a delivered array that the value still carries although the access
81
+ * answer withholds them.
82
+ *
83
+ * `stripped` is the read's own statement of the member paths it removed, relative to the row
84
+ * and dotted through any record the row carries. A member outside that set was delivered to
85
+ * the expression (a mask lifted by `allowMaskedRead`, or a field hidden by a `visible` rule),
86
+ * which is exactly the payload the report and the layout must not quote.
87
+ */
88
+ noteCarriedMembers(field, stripped, prefix) {
89
+ for (const member of field.fields ?? []) {
90
+ const path = prefix === '' ? member.fieldId : `${prefix}.${member.fieldId}`;
91
+ if (!stripped.has(path))
92
+ this.noteField(member.fieldId);
93
+ this.noteCarriedMembers(member, stripped, path);
94
+ }
95
+ }
96
+ }
97
+ /** The union of the member paths one array read removed, over every row it delivered. */
98
+ function strippedMembersOf(withheldRows) {
99
+ if (withheldRows === undefined)
100
+ return EMPTY_MEMBERS;
101
+ const stripped = new Set();
102
+ for (const row of withheldRows)
103
+ for (const path of row)
104
+ stripped.add(path);
105
+ return stripped;
106
+ }
107
+ const EMPTY_MEMBERS = new Set();
108
+ //# sourceMappingURL=withheld.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withheld.js","sourceRoot":"","sources":["../../../src/eval/reader/withheld.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,QAAQ,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AAED,yFAAyF;AACzF,SAAS,iBAAiB,CACxB,YAAwD;IAExD,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IACrD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,GAAG,IAAI,YAAY;QAAE,KAAK,MAAM,IAAI,IAAI,GAAG;YAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3E,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,aAAa,GAAwB,IAAI,GAAG,EAAE,CAAC","sourcesContent":["import type { CompiledField } from '../../model/types.js';\nimport type { DeclaredPath } from '../reader-paths.js';\nimport type { WithheldFields } from './declarations.js';\n\n/**\n * The disclosure-taint stream: every read that touched a value the report must not state, in\n * read order. The report must not quote such a value in a parameter, a lookup key or a\n * presentation readout, so the caller marks the stream and asks what its own read observed.\n *\n * Two facts make a value unstateable. A `visible` rule can hide a field whose policy is\n * `exclude`, which is the visibility half; and the resolved access can withhold delivery —\n * `masked`, `hidden`, a stored `write_only`, or a container or host redaction above the field.\n * The second half is independent of `allowMaskedRead`: that list lifts a mask for expression\n * reads and never for delivery, so a read it unlocks still taints. A value derived from a\n * masked read is the computation's own and may be reported; only the read's payload, not what\n * an expression computes from it, is withheld.\n *\n * The value is still delivered to the expression: a `visible` rule never stops an expression\n * reading a hidden field, and `allowMaskedRead` never stops one reading a masked field. This log\n * exists to keep the value out of the report, not out of the language.\n */\nexport class WithheldTaint {\n private readonly log: string[] = [];\n private readonly withheld: WithheldFields | undefined;\n private readonly walked: (path: string) => DeclaredPath | undefined;\n private readonly deliveryWithheld: (fieldId: string) => boolean;\n\n constructor(\n withheld: WithheldFields | undefined,\n walked: (path: string) => DeclaredPath | undefined,\n deliveryWithheld: (fieldId: string) => boolean = () => false,\n ) {\n this.withheld = withheld;\n this.walked = walked;\n this.deliveryWithheld = deliveryWithheld;\n }\n\n /** The current position in the taint stream. */\n mark(): number {\n return this.log.length;\n }\n\n /** The withheld fields a read since `mark` touched, deduplicated in read order. */\n since(mark: number): readonly string[] {\n return [...new Set(this.log.slice(mark))];\n }\n\n /** Records the withheld fields one path's read touched. */\n note(path: string, withheldRows?: readonly (readonly string[])[]): void {\n const walked = this.walked(path);\n if (walked === undefined) return;\n for (const fieldId of walked.declared) this.noteField(fieldId);\n if (walked.field.primitive === 'array') {\n // An array read states, per row, the members it removed (`withheldRows`). A member it\n // removed never reached the expression's value, so a payload folded from what it did\n // deliver is not quoting that member — and the binder over the same read answers the\n // removed cell `UNKNOWN` rather than its absence. A withheld member the read still\n // carries (a mask lifted for expression reads, or a visibility exclusion) is disclosed by\n // any payload that quotes it, so it stays tainted. Tainting every declaration instead\n // would blank a readout folded from readable cells beside a withheld sibling.\n this.noteCarriedMembers(walked.field, strippedMembersOf(withheldRows), '');\n return;\n }\n // A record travels as one payload, so a withheld member is disclosed even when the\n // expression addressed the record rather than the member: the payload cannot be split.\n this.noteMembers(walked.field);\n }\n\n /** Records one field, when the report may not state its value. */\n noteField(fieldId: string): void {\n if (this.withholds(fieldId)) this.log.push(fieldId);\n }\n\n /** Whether one field's value is hidden-and-excluded, or withheld from delivery by access. */\n private withholds(fieldId: string): boolean {\n const withheld = this.withheld;\n if (\n withheld !== undefined &&\n withheld.candidates.has(fieldId) &&\n withheld.isWithheld(fieldId)\n ) {\n return true;\n }\n return this.deliveryWithheld(fieldId);\n }\n\n private noteMembers(field: CompiledField): void {\n for (const member of field.fields ?? []) {\n this.noteField(member.fieldId);\n this.noteMembers(member);\n }\n }\n\n /**\n * Taints the members of a delivered array that the value still carries although the access\n * answer withholds them.\n *\n * `stripped` is the read's own statement of the member paths it removed, relative to the row\n * and dotted through any record the row carries. A member outside that set was delivered to\n * the expression (a mask lifted by `allowMaskedRead`, or a field hidden by a `visible` rule),\n * which is exactly the payload the report and the layout must not quote.\n */\n private noteCarriedMembers(\n field: CompiledField,\n stripped: ReadonlySet<string>,\n prefix: string,\n ): void {\n for (const member of field.fields ?? []) {\n const path = prefix === '' ? member.fieldId : `${prefix}.${member.fieldId}`;\n if (!stripped.has(path)) this.noteField(member.fieldId);\n this.noteCarriedMembers(member, stripped, path);\n }\n }\n}\n\n/** The union of the member paths one array read removed, over every row it delivered. */\nfunction strippedMembersOf(\n withheldRows: readonly (readonly string[])[] | undefined,\n): ReadonlySet<string> {\n if (withheldRows === undefined) return EMPTY_MEMBERS;\n const stripped = new Set<string>();\n for (const row of withheldRows) for (const path of row) stripped.add(path);\n return stripped;\n}\n\nconst EMPTY_MEMBERS: ReadonlySet<string> = new Set();\n"]}
@@ -0,0 +1,24 @@
1
+ import type { CompiledField } from '../model/types.js';
2
+ /**
3
+ * Resolving a dotted path against a record's declarations.
4
+ *
5
+ * A path is not a list of field identifiers: it crosses declared fields and, on the way, the
6
+ * intrinsic members of a scalar primitive (`f_fee.currency` reads the money value's
7
+ * `currency`, not a record field of that name). Every consumer that has to answer a question
8
+ * about a path — the value read, its domain, whether it may be read, whether it is relevant —
9
+ * walks it here, so one field id that happens to spell an intrinsic member cannot decide an
10
+ * unrelated verdict.
11
+ */
12
+ /** What one declared path resolved to. */
13
+ export interface DeclaredPath {
14
+ /** The declaration the path lands on, intrinsic member included. */
15
+ readonly field: CompiledField;
16
+ /**
17
+ * The declared fields the walk crossed, in path order: the containers the read passes
18
+ * through and the field it lands on when that field is declared. An intrinsic member is not
19
+ * a record field, so `f_fee.currency` declares only `f_fee`.
20
+ */
21
+ readonly declared: readonly string[];
22
+ }
23
+ export declare function walkFieldPath(path: string, fieldsByPath: ReadonlyMap<string, CompiledField>): DeclaredPath | undefined;
24
+ //# sourceMappingURL=reader-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader-paths.d.ts","sourceRoot":"","sources":["../../src/eval/reader-paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD;;;;;;;;;GASG;AAEH,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,GAC/C,YAAY,GAAG,SAAS,CAgB1B"}
@@ -0,0 +1,23 @@
1
+ import { memberOf } from '../model/wire.js';
2
+ export function walkFieldPath(path, fieldsByPath) {
3
+ const segments = path.split('.').filter((segment) => segment !== '');
4
+ const [first, ...rest] = segments;
5
+ if (first === undefined)
6
+ return undefined;
7
+ let current = fieldsByPath.get(first);
8
+ if (current === undefined)
9
+ return undefined;
10
+ const declared = [first];
11
+ for (const segment of rest) {
12
+ const member = memberOf(current, segment);
13
+ if (member === undefined)
14
+ return undefined;
15
+ current = member;
16
+ // A nested record or array member is a declared field the overlay can name; an
17
+ // intrinsic member is not a field of the record at all.
18
+ if (fieldsByPath.has([...declared, segment].join('.')))
19
+ declared.push(segment);
20
+ }
21
+ return { field: current, declared };
22
+ }
23
+ //# sourceMappingURL=reader-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader-paths.js","sourceRoot":"","sources":["../../src/eval/reader-paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyB5C,MAAM,UAAU,aAAa,CAC3B,IAAY,EACZ,YAAgD;IAEhD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,QAAQ,GAAa,CAAC,KAAK,CAAC,CAAC;IACnC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC3C,OAAO,GAAG,MAAM,CAAC;QACjB,+EAA+E;QAC/E,wDAAwD;QACxD,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtC,CAAC","sourcesContent":["import type { CompiledField } from '../model/types.js';\nimport { memberOf } from '../model/wire.js';\n\n/**\n * Resolving a dotted path against a record's declarations.\n *\n * A path is not a list of field identifiers: it crosses declared fields and, on the way, the\n * intrinsic members of a scalar primitive (`f_fee.currency` reads the money value's\n * `currency`, not a record field of that name). Every consumer that has to answer a question\n * about a path — the value read, its domain, whether it may be read, whether it is relevant —\n * walks it here, so one field id that happens to spell an intrinsic member cannot decide an\n * unrelated verdict.\n */\n\n/** What one declared path resolved to. */\nexport interface DeclaredPath {\n /** The declaration the path lands on, intrinsic member included. */\n readonly field: CompiledField;\n /**\n * The declared fields the walk crossed, in path order: the containers the read passes\n * through and the field it lands on when that field is declared. An intrinsic member is not\n * a record field, so `f_fee.currency` declares only `f_fee`.\n */\n readonly declared: readonly string[];\n}\n\nexport function walkFieldPath(\n path: string,\n fieldsByPath: ReadonlyMap<string, CompiledField>,\n): DeclaredPath | undefined {\n const segments = path.split('.').filter((segment) => segment !== '');\n const [first, ...rest] = segments;\n if (first === undefined) return undefined;\n let current = fieldsByPath.get(first);\n if (current === undefined) return undefined;\n const declared: string[] = [first];\n for (const segment of rest) {\n const member = memberOf(current, segment);\n if (member === undefined) return undefined;\n current = member;\n // A nested record or array member is a declared field the overlay can name; an\n // intrinsic member is not a field of the record at all.\n if (fieldsByPath.has([...declared, segment].join('.'))) declared.push(segment);\n }\n return { field: current, declared };\n}\n"]}