@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,874 @@
1
+ export { containsSentinel, evaluateExample, parseExampleExpression } from './example-expression.js';
2
+ /**
3
+ * The documented built-ins the generated reference pages render. The entries are keyed by
4
+ * `ImplementedOperator`, and the package test compares the documented set with
5
+ * `IMPLEMENTED_OPERATORS`, so an operator the evaluator answers cannot ship without a
6
+ * reference page.
7
+ *
8
+ * Every entry declares a signature, a doc line, the diagnostic it can raise and at least
9
+ * two examples, one of which exercises an undetermined input. The clauses each entry
10
+ * implements and each example demonstrates are attribution data in
11
+ * `spec/corpus/expr/clause-attribution.json`.
12
+ */
13
+ export const WALKING_SKELETON_BUILTINS = [
14
+ {
15
+ name: 'between',
16
+ signature: 'between(x: T, low: T, high: T) -> boolean',
17
+ summary: 'Inclusive range test: `low <= x <= high`. It is the same ordering `<` accepts, written once so the operand is not repeated and an off-by-one is not hidden in it.',
18
+ resultOnUndetermined: 'An undecided operand makes the range undecided, never false.',
19
+ errors: ['ENGINE_ERROR'],
20
+ examples: [
21
+ { expr: 'between(2, 1, 3)', expected: 'true' },
22
+ { expr: 'between(1, 2, 3)', expected: 'false' },
23
+ { expr: 'between(UNKNOWN, 1, 3)', expected: 'UNKNOWN' },
24
+ ],
25
+ },
26
+ {
27
+ name: 'rule_ok_in',
28
+ signature: 'rule_ok_in(stepId: string) -> boolean',
29
+ summary: 'Every rule a declared layout step places passes, folded as a gate would fold them. The step id is a literal; a step the artifact does not declare is an engine error naming it.',
30
+ resultOnUndetermined: 'A step with an undecided rule answers UNKNOWN.',
31
+ errors: ['ENGINE_ERROR'],
32
+ examples: [
33
+ { expr: 'rule_ok_in("s_details")', expected: 'UNKNOWN' },
34
+ { expr: 'rule_ok_in(UNKNOWN)', expected: 'UNKNOWN' },
35
+ ],
36
+ },
37
+ {
38
+ name: 'no_blocking_in',
39
+ signature: 'no_blocking_in(stepId: string) -> boolean',
40
+ summary: 'No `block`-severity rule a declared layout step places blocks. An undecided rule makes it false, because nothing was decided.',
41
+ resultOnUndetermined: 'A step with an undecided rule answers UNKNOWN.',
42
+ errors: ['ENGINE_ERROR'],
43
+ examples: [
44
+ { expr: 'no_blocking_in("s_details")', expected: 'UNKNOWN' },
45
+ { expr: 'no_blocking_in(UNKNOWN)', expected: 'UNKNOWN' },
46
+ ],
47
+ },
48
+ {
49
+ name: 'required_in',
50
+ signature: 'required_in(stepId: string) -> boolean',
51
+ summary: 'Every `required` rule a declared layout step places is satisfied: a fired requirement whose member holds a value. A gate can ask this once for a whole step.',
52
+ resultOnUndetermined: 'A step with an undecided requirement answers UNKNOWN.',
53
+ errors: ['ENGINE_ERROR'],
54
+ examples: [
55
+ { expr: 'required_in("s_details")', expected: 'UNKNOWN' },
56
+ { expr: 'required_in(UNKNOWN)', expected: 'UNKNOWN' },
57
+ ],
58
+ },
59
+ {
60
+ name: 'sum',
61
+ signature: 'sum(xs: list<decimal | integer | money | quantity | duration>) -> decimal | money | quantity | duration',
62
+ summary: 'Sums a list exactly. An empty list of numbers is the decimal `"0"`; an empty list of money, quantities or durations names no currency or unit to total, so it is `UNKNOWN`. A missing list or a missing element is `UNKNOWN`, never a partial sum.',
63
+ resultOnUndetermined: 'A missing list or any missing element returns UNKNOWN, never a partial sum.',
64
+ errors: ['ENGINE_ERROR'],
65
+ examples: [
66
+ { expr: 'sum([])', expected: '"0"' },
67
+ { expr: 'sum([decimal "10", decimal "15.5"])', expected: '"25.5"' },
68
+ { expr: 'sum(UNKNOWN)', expected: 'UNKNOWN' },
69
+ {
70
+ expr: 'sum([decimal "10", UNKNOWN])',
71
+ expected: 'UNKNOWN',
72
+ },
73
+ {
74
+ expr: 'sum([decimal "1.5", decimal "2.5"])',
75
+ expected: '"4"',
76
+ },
77
+ ],
78
+ },
79
+ {
80
+ name: 'money_minor',
81
+ signature: 'money_minor(m: money) -> decimal',
82
+ summary: 'The minor-unit amount of a money value, as an exact decimal. A money value an expression computed has no member access, so this is the spelling of `m.minor` for anything but a path; `money_currency` and `money_scale` read the other two members.',
83
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
84
+ errors: ['ENGINE_ERROR'],
85
+ examples: [
86
+ {
87
+ expr: 'money_minor(money { "minor": "1050", "currency": "AUD", "scale": 2 })',
88
+ expected: '"1050"',
89
+ },
90
+ { expr: 'money_minor(UNKNOWN)', expected: 'UNKNOWN' },
91
+ ],
92
+ },
93
+ {
94
+ name: 'money_from_minor',
95
+ signature: 'money_from_minor(x: decimal | integer, currency: string, scale: integer, mode: mode) -> money',
96
+ summary: 'The only conversion from a decimal back to money. The rounding mode is required, so no default rounds an amount quietly.',
97
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
98
+ errors: ['ENGINE_ERROR'],
99
+ examples: [
100
+ {
101
+ expr: 'money_from_minor(decimal "13.5", "AUD", 2, "half_up")',
102
+ expected: '{"minor": "14", "currency": "AUD", "scale": 2}',
103
+ },
104
+ {
105
+ expr: 'money_from_minor(decimal "-0.4", "AUD", 0, "half_up")',
106
+ expected: '{"minor": "0", "currency": "AUD", "scale": 0}',
107
+ },
108
+ {
109
+ expr: 'money_from_minor(DEFERRED, "AUD", 2, "half_up")',
110
+ expected: 'DEFERRED',
111
+ },
112
+ ],
113
+ },
114
+ {
115
+ name: 'money_currency',
116
+ signature: 'money_currency(m: money) -> string',
117
+ summary: 'The three-letter currency code of a money value.',
118
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
119
+ errors: ['ENGINE_ERROR'],
120
+ examples: [
121
+ {
122
+ expr: 'money_currency(money { "minor": "1050", "currency": "AUD", "scale": 2 })',
123
+ expected: '"AUD"',
124
+ },
125
+ { expr: 'money_currency(UNKNOWN)', expected: 'UNKNOWN' },
126
+ ],
127
+ },
128
+ {
129
+ name: 'money_scale',
130
+ signature: 'money_scale(m: money) -> integer',
131
+ summary: 'The fraction-digit scale of a money value, which two money values must share to be added.',
132
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
133
+ errors: ['ENGINE_ERROR'],
134
+ examples: [
135
+ {
136
+ expr: 'money_scale(money { "minor": "1050", "currency": "AUD", "scale": 2 })',
137
+ expected: '2',
138
+ },
139
+ { expr: 'money_scale(DEFERRED)', expected: 'DEFERRED' },
140
+ ],
141
+ },
142
+ {
143
+ name: 'add_days',
144
+ signature: 'add_days(d: date, n: integer) -> date',
145
+ summary: 'Shifts a civil date by whole days, correctly across month and leap-year boundaries.',
146
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
147
+ errors: ['ENGINE_ERROR'],
148
+ examples: [
149
+ {
150
+ expr: 'add_days(date "2026-01-31", 1)',
151
+ expected: '"2026-02-01"',
152
+ },
153
+ { expr: 'add_days(UNKNOWN, 1)', expected: 'UNKNOWN' },
154
+ ],
155
+ },
156
+ {
157
+ name: 'add_months',
158
+ signature: 'add_months(d: date, n: integer) -> date',
159
+ summary: 'Shifts a civil date by whole months, clamping to the last day of the target month so 2026-01-31 plus one month is 2026-02-28.',
160
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
161
+ errors: ['ENGINE_ERROR'],
162
+ examples: [
163
+ {
164
+ expr: 'add_months(date "2026-01-31", 1)',
165
+ expected: '"2026-02-28"',
166
+ },
167
+ { expr: 'add_months(DEFERRED, 1)', expected: 'DEFERRED' },
168
+ ],
169
+ },
170
+ {
171
+ name: 'add_minutes',
172
+ signature: 'add_minutes(t: instant, n: integer) -> instant',
173
+ summary: 'Shifts a UTC instant by whole minutes, exactly. A result past the four-digit year range is an engine error, the same ceiling the date shifts enforce.',
174
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
175
+ errors: ['ENGINE_ERROR'],
176
+ examples: [
177
+ {
178
+ expr: 'add_minutes(instant "2026-01-31T23:30:00.000Z", 45)',
179
+ expected: '"2026-02-01T00:15:00.000Z"',
180
+ },
181
+ { expr: 'add_minutes(UNKNOWN, 45)', expected: 'UNKNOWN' },
182
+ ],
183
+ },
184
+ {
185
+ name: 'days_between',
186
+ signature: 'days_between(a: date, b: date) -> integer',
187
+ summary: 'The signed whole number of days from the first date to the second.',
188
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
189
+ errors: ['ENGINE_ERROR'],
190
+ examples: [
191
+ {
192
+ expr: 'days_between(date "2026-01-31", date "2026-03-01")',
193
+ expected: '29',
194
+ },
195
+ {
196
+ expr: 'days_between(UNKNOWN, date "2026-03-01")',
197
+ expected: 'UNKNOWN',
198
+ },
199
+ ],
200
+ },
201
+ {
202
+ name: 'months_between',
203
+ signature: 'months_between(a: date, b: date) -> integer',
204
+ summary: 'The signed whole number of months from the first date to the second, truncated toward zero.',
205
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
206
+ errors: ['ENGINE_ERROR'],
207
+ examples: [
208
+ {
209
+ expr: 'months_between(date "2026-01-31", date "2026-04-30")',
210
+ expected: '3',
211
+ },
212
+ {
213
+ expr: 'months_between(UNKNOWN, date "2026-04-30")',
214
+ expected: 'UNKNOWN',
215
+ },
216
+ ],
217
+ },
218
+ {
219
+ name: 'trim',
220
+ signature: 'trim(s: string) -> string',
221
+ summary: 'Strips leading and trailing ASCII whitespace in one linear scan; every other code point is data, so the result never depends on a Unicode table.',
222
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
223
+ errors: ['ENGINE_ERROR'],
224
+ examples: [
225
+ { expr: 'trim(" padded ")', expected: '"padded"' },
226
+ { expr: 'trim("\\t x \\n")', expected: '"x"' },
227
+ { expr: 'trim(UNKNOWN)', expected: 'UNKNOWN' },
228
+ ],
229
+ },
230
+ {
231
+ name: 'is_email',
232
+ signature: 'is_email(s: string) -> boolean',
233
+ summary: 'Answers whether text is an ASCII email address of at most 254 characters, with a dot-atom local part and a dotted domain of at least two labels.',
234
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
235
+ errors: ['ENGINE_ERROR'],
236
+ examples: [
237
+ { expr: 'is_email("clerk@example.com")', expected: 'true' },
238
+ { expr: 'is_email("clerk@example")', expected: 'false' },
239
+ { expr: 'is_email(UNKNOWN)', expected: 'UNKNOWN' },
240
+ ],
241
+ },
242
+ {
243
+ name: 'is_phone',
244
+ signature: 'is_phone(s: string) -> boolean',
245
+ summary: 'Answers whether text is a strict E.164 number: a leading `+`, then 1 to 15 ASCII digits with a non-zero first digit and no other character.',
246
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
247
+ errors: ['ENGINE_ERROR'],
248
+ examples: [
249
+ { expr: 'is_phone("+61491570006")', expected: 'true' },
250
+ { expr: 'is_phone("0491570006")', expected: 'false' },
251
+ { expr: 'is_phone(DEFERRED)', expected: 'DEFERRED' },
252
+ ],
253
+ },
254
+ {
255
+ name: 'is_url',
256
+ signature: 'is_url(s: string) -> boolean',
257
+ summary: 'Answers whether text is an ASCII `http://` or `https://` URL of at most 2048 characters whose authority is a host name with an optional port.',
258
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
259
+ errors: ['ENGINE_ERROR'],
260
+ examples: [
261
+ { expr: 'is_url("https://example.com/a")', expected: 'true' },
262
+ { expr: 'is_url("ftp://example.com")', expected: 'false' },
263
+ { expr: 'is_url(UNKNOWN)', expected: 'UNKNOWN' },
264
+ ],
265
+ },
266
+ {
267
+ name: 'empty',
268
+ signature: 'empty(x: T) -> boolean',
269
+ summary: 'Answers whether its operand has no content: true for a genuinely absent path, an explicit `null`, empty text `""` and an empty list `[]`; false for `0`, `false` and every other value that is there. A zero and a false are values an author recorded, so `empty` does not erase them. `empty` and `len(x) == 0` agree on text and lists, while `present` answers the different question of whether a value exists. A path answers absence from presence metadata, which is the only place absence is observable; content is read from the value the path holds.',
270
+ resultOnUndetermined: 'A path this device cannot read is not confirmed empty: an unreadable or undetermined path returns UNKNOWN and a redacted one returns DEFERRED. A value operand propagates its sentinel unchanged.',
271
+ errors: [],
272
+ examples: [
273
+ { expr: 'empty(null)', expected: 'true' },
274
+ { expr: 'empty("")', expected: 'true' },
275
+ { expr: 'empty([])', expected: 'true' },
276
+ { expr: 'empty(0)', expected: 'false' },
277
+ { expr: 'empty(parse_integer("nope"))', expected: 'true' },
278
+ { expr: 'empty(UNKNOWN)', expected: 'UNKNOWN' },
279
+ ],
280
+ },
281
+ {
282
+ name: 'to_decimal',
283
+ signature: 'to_decimal(x: integer | decimal) -> decimal',
284
+ summary: 'Widens an integer or decimal operand to an exact decimal, so a count takes part in decimal arithmetic without a coercion.',
285
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
286
+ errors: ['ENGINE_ERROR'],
287
+ examples: [
288
+ { expr: 'to_decimal(4)', expected: '"4"' },
289
+ { expr: 'to_decimal(decimal "1.5")', expected: '"1.5"' },
290
+ { expr: 'to_decimal(UNKNOWN)', expected: 'UNKNOWN' },
291
+ ],
292
+ },
293
+ {
294
+ name: 'to_string',
295
+ signature: 'to_string(x: string | integer | decimal | boolean | date | instant | money) -> string',
296
+ summary: 'Renders a scalar as its canonical text. Money is its amount at its declared scale with no currency symbol or grouping — read `money_currency` when the text needs the code — and a record or a list is refused.',
297
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
298
+ errors: ['ENGINE_ERROR'],
299
+ examples: [
300
+ { expr: 'to_string(42)', expected: '"42"' },
301
+ { expr: 'to_string(true)', expected: '"true"' },
302
+ {
303
+ expr: 'to_string(money { "minor": "1050", "currency": "AUD", "scale": 2 })',
304
+ expected: '"10.50"',
305
+ },
306
+ { expr: 'to_string(UNKNOWN)', expected: 'UNKNOWN' },
307
+ ],
308
+ },
309
+ {
310
+ name: 'parse_integer',
311
+ signature: 'parse_integer(s: string) -> integer | null',
312
+ summary: 'The canonical integer a text spells, or `null` when it spells none. Leading zeros, `+`, `-0`, a fraction, surrounding space and an unsafe value are all misses, never errors.',
313
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
314
+ errors: [],
315
+ examples: [
316
+ { expr: 'parse_integer("42")', expected: '42' },
317
+ { expr: 'parse_integer("007")', expected: 'null' },
318
+ { expr: 'parse_integer(UNKNOWN)', expected: 'UNKNOWN' },
319
+ ],
320
+ },
321
+ {
322
+ name: 'parse_decimal',
323
+ signature: 'parse_decimal(s: string) -> decimal | null',
324
+ summary: 'The canonical decimal a text spells, or `null` when it spells none. A non-canonical spelling such as `1.50`, an exponent and a value beyond the numeric budget are misses, never errors.',
325
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
326
+ errors: [],
327
+ examples: [
328
+ { expr: 'parse_decimal("1.5")', expected: '"1.5"' },
329
+ { expr: 'parse_decimal("1.50")', expected: 'null' },
330
+ { expr: 'parse_decimal(UNKNOWN)', expected: 'UNKNOWN' },
331
+ ],
332
+ },
333
+ {
334
+ name: 'len',
335
+ signature: 'len(x: string | list<T>) -> integer',
336
+ summary: 'The number of Unicode code points in a string, or of elements in a list.',
337
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
338
+ errors: ['ENGINE_ERROR'],
339
+ examples: [
340
+ { expr: 'len("café")', expected: '4' },
341
+ { expr: 'len(["a", "b"])', expected: '2' },
342
+ { expr: 'len(UNKNOWN)', expected: 'UNKNOWN' },
343
+ ],
344
+ },
345
+ {
346
+ name: 'lower',
347
+ signature: 'lower(s: string) -> string',
348
+ summary: 'Maps ASCII A-Z to a-z and leaves every other code point unchanged.',
349
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
350
+ errors: ['ENGINE_ERROR'],
351
+ examples: [
352
+ { expr: 'lower("ABC")', expected: '"abc"' },
353
+ { expr: 'lower("É")', expected: '"É"' },
354
+ { expr: 'lower(UNKNOWN)', expected: 'UNKNOWN' },
355
+ ],
356
+ },
357
+ {
358
+ name: 'upper',
359
+ signature: 'upper(s: string) -> string',
360
+ summary: 'Maps ASCII a-z to A-Z and leaves every other code point unchanged.',
361
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
362
+ errors: ['ENGINE_ERROR'],
363
+ examples: [
364
+ { expr: 'upper("abc")', expected: '"ABC"' },
365
+ { expr: 'upper(UNKNOWN)', expected: 'UNKNOWN' },
366
+ ],
367
+ },
368
+ {
369
+ name: 'starts_with',
370
+ signature: 'starts_with(s: string, prefix: string) -> boolean',
371
+ summary: 'A literal, case-sensitive test for a prefix; the prefix is never a pattern.',
372
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
373
+ errors: ['ENGINE_ERROR'],
374
+ examples: [
375
+ { expr: 'starts_with("abc", "ab")', expected: 'true' },
376
+ { expr: 'starts_with(UNKNOWN, "ab")', expected: 'UNKNOWN' },
377
+ ],
378
+ },
379
+ {
380
+ name: 'ends_with',
381
+ signature: 'ends_with(s: string, suffix: string) -> boolean',
382
+ summary: 'A literal, case-sensitive test for a suffix; the suffix is never a pattern.',
383
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
384
+ errors: ['ENGINE_ERROR'],
385
+ examples: [
386
+ { expr: 'ends_with("abc", "bc")', expected: 'true' },
387
+ { expr: 'ends_with("abc", UNKNOWN)', expected: 'UNKNOWN' },
388
+ ],
389
+ },
390
+ {
391
+ name: 'contains',
392
+ signature: 'contains(s: string, part: string) -> boolean',
393
+ summary: 'A literal, case-sensitive substring test over text.',
394
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
395
+ errors: ['ENGINE_ERROR'],
396
+ examples: [
397
+ { expr: 'contains("abc", "b")', expected: 'true' },
398
+ { expr: 'contains("abc", UNKNOWN)', expected: 'UNKNOWN' },
399
+ ],
400
+ },
401
+ {
402
+ name: 'ascii_match',
403
+ signature: 'ascii_match(s: string, pattern: string) -> boolean',
404
+ summary: 'Matches an anchored regular expression over the bounded ASCII subset; unsupported syntax is refused.',
405
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
406
+ errors: ['ENGINE_ERROR'],
407
+ examples: [
408
+ {
409
+ expr: 'ascii_match("A-12", "[A-Z]-[0-9]+")',
410
+ expected: 'true',
411
+ },
412
+ { expr: 'ascii_match(UNKNOWN, "[A-Z]")', expected: 'UNKNOWN' },
413
+ ],
414
+ },
415
+ {
416
+ name: 'round',
417
+ signature: 'round(x: decimal, places: integer) -> decimal',
418
+ summary: "Rounds to `places` fraction digits, nearest with ties away from zero: Excel's ROUND.",
419
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
420
+ errors: ['ENGINE_ERROR'],
421
+ examples: [
422
+ { expr: 'round(decimal "2.5", 0)', expected: '"3"' },
423
+ { expr: 'round(decimal "1.25", 1)', expected: '"1.3"' },
424
+ { expr: 'round(UNKNOWN, 2)', expected: 'UNKNOWN' },
425
+ ],
426
+ },
427
+ {
428
+ name: 'round_up',
429
+ signature: 'round_up(x: decimal, places: integer) -> decimal',
430
+ summary: "Rounds away from zero at `places` fraction digits: Excel's ROUNDUP.",
431
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
432
+ errors: ['ENGINE_ERROR'],
433
+ examples: [
434
+ { expr: 'round_up(decimal "1.21", 1)', expected: '"1.3"' },
435
+ { expr: 'round_up(decimal "-1.21", 1)', expected: '"-1.3"' },
436
+ { expr: 'round_up(UNKNOWN, 1)', expected: 'UNKNOWN' },
437
+ ],
438
+ },
439
+ {
440
+ name: 'round_down',
441
+ signature: 'round_down(x: decimal, places: integer) -> decimal',
442
+ summary: "Rounds toward zero at `places` fraction digits: Excel's ROUNDDOWN.",
443
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
444
+ errors: ['ENGINE_ERROR'],
445
+ examples: [
446
+ { expr: 'round_down(decimal "1.29", 1)', expected: '"1.2"' },
447
+ { expr: 'round_down(decimal "-1.29", 1)', expected: '"-1.2"' },
448
+ { expr: 'round_down(UNKNOWN, 1)', expected: 'UNKNOWN' },
449
+ ],
450
+ },
451
+ {
452
+ name: 'round_even',
453
+ signature: 'round_even(x: decimal, places: integer) -> decimal',
454
+ summary: "Rounds to the nearest even last digit at `places` fraction digits: banker's rounding.",
455
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
456
+ errors: ['ENGINE_ERROR'],
457
+ examples: [
458
+ { expr: 'round_even(decimal "2.5", 0)', expected: '"2"' },
459
+ { expr: 'round_even(decimal "3.5", 0)', expected: '"4"' },
460
+ { expr: 'round_even(UNKNOWN, 0)', expected: 'UNKNOWN' },
461
+ ],
462
+ },
463
+ {
464
+ name: 'pow',
465
+ signature: 'pow(x: integer | decimal, y: number) -> integer | decimal',
466
+ summary: 'A power at the arithmetic precision: repeated multiplication under the rule `*` uses. An integer base stays an integer, and a decimal base stays exact decimal text; a negative exponent is a division, written `round(a / b, places)`.',
467
+ spellings: ['`a ** b`', '`a ^ b`'],
468
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
469
+ errors: ['ENGINE_ERROR'],
470
+ examples: [
471
+ { expr: 'pow(2, 10)', expected: '1024' },
472
+ { expr: 'pow(decimal "1.05", 3)', expected: '"1.157625"' },
473
+ { expr: 'pow(2, 0)', expected: '1' },
474
+ { expr: 'pow(UNKNOWN, 2)', expected: 'UNKNOWN' },
475
+ ],
476
+ },
477
+ {
478
+ name: 'minutes_between',
479
+ signature: 'minutes_between(a: instant, b: instant) -> integer',
480
+ summary: 'The signed whole number of minutes from the first instant to the second.',
481
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
482
+ errors: ['ENGINE_ERROR'],
483
+ examples: [
484
+ {
485
+ expr: 'minutes_between(instant "2026-01-31T00:00:00.000Z", instant "2026-01-31T01:30:00.000Z")',
486
+ expected: '90',
487
+ },
488
+ {
489
+ expr: 'minutes_between(UNKNOWN, instant "2026-01-31T01:30:00.000Z")',
490
+ expected: 'UNKNOWN',
491
+ },
492
+ ],
493
+ },
494
+ {
495
+ name: 'duration_minutes',
496
+ signature: 'duration_minutes(d: duration) -> integer',
497
+ summary: 'The whole number of minutes a duration names, converting minutes, hours and seconds explicitly. A conversion that would lose a part is an error rather than a truncation, because v1 performs no implicit unit conversion.',
498
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
499
+ errors: ['ENGINE_ERROR'],
500
+ examples: [
501
+ { expr: 'duration_minutes(UNKNOWN)', expected: 'UNKNOWN' },
502
+ { expr: 'duration_minutes(DEFERRED)', expected: 'DEFERRED' },
503
+ ],
504
+ },
505
+ {
506
+ name: 'duration_seconds',
507
+ signature: 'duration_seconds(d: duration) -> integer',
508
+ summary: 'The whole number of seconds a duration names, converting minutes, hours and seconds explicitly. A conversion that would lose a part is an error rather than a truncation, because v1 performs no implicit unit conversion.',
509
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
510
+ errors: ['ENGINE_ERROR'],
511
+ examples: [
512
+ { expr: 'duration_seconds(UNKNOWN)', expected: 'UNKNOWN' },
513
+ { expr: 'duration_seconds(DEFERRED)', expected: 'DEFERRED' },
514
+ ],
515
+ },
516
+ {
517
+ name: 'abs',
518
+ signature: 'abs(x: integer | decimal | money) -> integer | decimal | money',
519
+ summary: 'The magnitude of a number, unchanged in domain: an integer stays an integer, a decimal stays exact text, and money keeps the currency and scale it was written with. Negation is a sign flip, so no digit is rounded.',
520
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
521
+ errors: ['ENGINE_ERROR'],
522
+ examples: [
523
+ { expr: 'abs(-7)', expected: '7' },
524
+ { expr: 'abs(decimal "-2.5")', expected: '"2.5"' },
525
+ {
526
+ expr: 'abs(money { "minor": "-1050", "currency": "AUD", "scale": 2 })',
527
+ expected: '{"minor": "1050", "currency": "AUD", "scale": 2}',
528
+ },
529
+ { expr: 'abs(UNKNOWN)', expected: 'UNKNOWN' },
530
+ ],
531
+ },
532
+ {
533
+ name: 'ceil',
534
+ signature: 'ceil(x: decimal) -> integer',
535
+ summary: 'The least integer not below the decimal: toward positive infinity, so a negative fraction rounds toward zero. A result outside the canonical integer range is refused.',
536
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
537
+ errors: ['ENGINE_ERROR'],
538
+ examples: [
539
+ { expr: 'ceil(decimal "2.1")', expected: '3' },
540
+ { expr: 'ceil(decimal "-2.9")', expected: '-2' },
541
+ { expr: 'ceil(UNKNOWN)', expected: 'UNKNOWN' },
542
+ ],
543
+ },
544
+ {
545
+ name: 'floor',
546
+ signature: 'floor(x: decimal) -> integer',
547
+ summary: 'The greatest integer not above the decimal: toward negative infinity, so a negative fraction rounds away from zero. A result outside the canonical integer range is refused.',
548
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
549
+ errors: ['ENGINE_ERROR'],
550
+ examples: [
551
+ { expr: 'floor(decimal "2.9")', expected: '2' },
552
+ { expr: 'floor(decimal "-2.1")', expected: '-3' },
553
+ { expr: 'floor(UNKNOWN)', expected: 'UNKNOWN' },
554
+ ],
555
+ },
556
+ {
557
+ name: 'avg',
558
+ signature: 'avg(xs: list<integer | decimal>) -> decimal',
559
+ summary: 'The exact mean of a numeric list, as canonical decimal text. A mean with no finite decimal spelling is UNKNOWN rather than rounded; write `round(sum(xs) / count(xs), places)` when a stated precision is what you want. An empty list is UNKNOWN, and money is refused because a currency amount divided by a count need not land on a minor unit.',
560
+ resultOnUndetermined: 'A missing list or any missing element returns UNKNOWN, never a partial mean.',
561
+ errors: ['ENGINE_ERROR'],
562
+ examples: [
563
+ { expr: 'avg([decimal "1", decimal "2", decimal "3"])', expected: '"2"' },
564
+ { expr: 'avg([decimal "0", decimal "1"])', expected: '"0.5"' },
565
+ { expr: 'avg([])', expected: 'UNKNOWN' },
566
+ { expr: 'avg([decimal "1", decimal "2", decimal "2"])', expected: 'UNKNOWN' },
567
+ { expr: 'avg(UNKNOWN)', expected: 'UNKNOWN' },
568
+ ],
569
+ },
570
+ {
571
+ name: 'median',
572
+ signature: 'median(xs: list<integer | decimal>) -> decimal',
573
+ summary: 'The middle value of the canonical decimal order, or the exact midpoint of the two middle values for an even count. Ordering never passes through a binary float, and halving always terminates, so the answer is always exact. An empty list is UNKNOWN.',
574
+ resultOnUndetermined: 'A missing list or any missing element returns UNKNOWN, never the middle of the values it could read.',
575
+ errors: ['ENGINE_ERROR'],
576
+ examples: [
577
+ { expr: 'median([decimal "1", decimal "2"])', expected: '"1.5"' },
578
+ { expr: 'median([decimal "3", decimal "1", decimal "2"])', expected: '"2"' },
579
+ { expr: 'median([])', expected: 'UNKNOWN' },
580
+ { expr: 'median(UNKNOWN)', expected: 'UNKNOWN' },
581
+ ],
582
+ },
583
+ {
584
+ name: 'first',
585
+ signature: 'first(xs: list<T>) -> T | null',
586
+ summary: 'The first element of a list, or `null` for an empty list — the empty value `$prev` states at a boundary, not `UNKNOWN`. The operand must be a list of primitives, because `T | null` is a value of one domain.',
587
+ resultOnUndetermined: 'A missing list, or a first element that cannot be read, is undetermined.',
588
+ errors: ['ENGINE_ERROR'],
589
+ examples: [
590
+ { expr: 'first([decimal "1", decimal "2"])', expected: '"1"' },
591
+ { expr: 'first([])', expected: 'null' },
592
+ { expr: 'first(UNKNOWN)', expected: 'UNKNOWN' },
593
+ ],
594
+ },
595
+ {
596
+ name: 'last',
597
+ signature: 'last(xs: list<T>) -> T | null',
598
+ summary: 'The last element of a list, or `null` for an empty list. The operand must be a list of primitives, for the same reason `first` states.',
599
+ resultOnUndetermined: 'A missing list, or a last element that cannot be read, is undetermined.',
600
+ errors: ['ENGINE_ERROR'],
601
+ examples: [
602
+ { expr: 'last([decimal "1", decimal "2"])', expected: '"2"' },
603
+ { expr: 'last([])', expected: 'null' },
604
+ { expr: 'last(UNKNOWN)', expected: 'UNKNOWN' },
605
+ ],
606
+ },
607
+ {
608
+ name: 'replace',
609
+ signature: 'replace(s: string, find: string, with: string) -> string',
610
+ summary: 'Replaces every non-overlapping occurrence of the literal text `find`, left to right. The needle is never a pattern. An empty needle is refused: its only reading would insert the replacement at every character boundary.',
611
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
612
+ errors: ['ENGINE_ERROR'],
613
+ examples: [
614
+ { expr: 'replace("a-b-a", "-", "+")', expected: '"a+b+a"' },
615
+ { expr: 'replace("banana", "na", "NA")', expected: '"baNANA"' },
616
+ { expr: 'replace(UNKNOWN, "-", "+")', expected: 'UNKNOWN' },
617
+ ],
618
+ },
619
+ {
620
+ name: 'split',
621
+ signature: 'split(s: string, separator: string) -> list<string>',
622
+ summary: 'Splits text at every literal occurrence of `separator`, left to right. An empty separator is refused, and an empty subject is one empty segment rather than no segments.',
623
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
624
+ errors: ['ENGINE_ERROR'],
625
+ examples: [
626
+ { expr: 'split("a,b,c", ",")', expected: '["a", "b", "c"]' },
627
+ { expr: 'split("", ",")', expected: '[""]' },
628
+ { expr: 'split(UNKNOWN, ",")', expected: 'UNKNOWN' },
629
+ ],
630
+ },
631
+ {
632
+ name: 'join',
633
+ signature: 'join(xs: list<string>, separator: string) -> string',
634
+ summary: 'Concatenates a list of text with `separator` between entries. An empty list is the empty string, so a separator is never emitted on its own.',
635
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
636
+ errors: ['ENGINE_ERROR'],
637
+ examples: [
638
+ { expr: 'join(["a", "b"], "-")', expected: '"a-b"' },
639
+ { expr: 'join([], "-")', expected: '""' },
640
+ { expr: 'join(UNKNOWN, "-")', expected: 'UNKNOWN' },
641
+ ],
642
+ },
643
+ {
644
+ name: 'substring',
645
+ signature: 'substring(s: string, start: integer, length: integer) -> string',
646
+ summary: 'The `length` code points from `start`, clamped to the text: a start at or past the end is the empty string, and a window that runs past the end stops there. A negative start or length is refused.',
647
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
648
+ errors: ['ENGINE_ERROR'],
649
+ examples: [
650
+ { expr: 'substring("abcdef", 2, 3)', expected: '"cde"' },
651
+ { expr: 'substring("abc", 2, 5)', expected: '"c"' },
652
+ { expr: 'substring(UNKNOWN, 1, 2)', expected: 'UNKNOWN' },
653
+ ],
654
+ },
655
+ {
656
+ name: 'index_of',
657
+ signature: 'index_of(s: string, find: string) -> integer',
658
+ summary: 'The code-point index of the first literal occurrence of `find`, or `-1` when the text does not contain it. An empty `find` answers `0`, the position it starts at everywhere.',
659
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
660
+ errors: ['ENGINE_ERROR'],
661
+ examples: [
662
+ { expr: 'index_of("banana", "na")', expected: '2' },
663
+ { expr: 'index_of("abc", "z")', expected: '-1' },
664
+ { expr: 'index_of(UNKNOWN, "a")', expected: 'UNKNOWN' },
665
+ ],
666
+ },
667
+ {
668
+ name: 'add_years',
669
+ signature: 'add_years(d: date, n: integer) -> date',
670
+ summary: 'Shifts a civil date by whole years, clamping 29 February to 28 February in a target year that is not a leap year.',
671
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
672
+ errors: ['ENGINE_ERROR'],
673
+ examples: [
674
+ { expr: 'add_years(date "2024-02-29", 1)', expected: '"2025-02-28"' },
675
+ { expr: 'add_years(date "2024-02-29", 4)', expected: '"2028-02-29"' },
676
+ { expr: 'add_years(UNKNOWN, 1)', expected: 'UNKNOWN' },
677
+ ],
678
+ },
679
+ {
680
+ name: 'start_of_day',
681
+ signature: 'start_of_day(t: instant) -> instant',
682
+ summary: 'The instant at 00:00:00.000Z of the UTC date the operand falls on. An instant carries no zone, and a civil day begins at different instants in different zones, so UTC midnight is the only boundary the language can state without reading a locale database. `start_of_day(d: date)` would be the identity and is deliberately not a built-in.',
683
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
684
+ errors: ['ENGINE_ERROR'],
685
+ examples: [
686
+ {
687
+ expr: 'start_of_day(instant "2026-03-01T13:45:12.345Z")',
688
+ expected: '"2026-03-01T00:00:00.000Z"',
689
+ },
690
+ { expr: 'start_of_day(UNKNOWN)', expected: 'UNKNOWN' },
691
+ ],
692
+ },
693
+ {
694
+ name: 'civil_date',
695
+ signature: 'civil_date(t: instant) -> date',
696
+ summary: "The UTC civil date the instant falls on: the date part of its canonical spelling. An instant carries no zone, so UTC is the only calendar the language can read without a locale database. This is the explicit conversion a date window needs; `start_of_day` keeps the instant at that day's midnight.",
697
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
698
+ errors: ['ENGINE_ERROR'],
699
+ examples: [
700
+ {
701
+ expr: 'civil_date(instant "2026-03-01T13:45:12.345Z")',
702
+ expected: '"2026-03-01"',
703
+ },
704
+ { expr: 'civil_date(UNKNOWN)', expected: 'UNKNOWN' },
705
+ ],
706
+ },
707
+ {
708
+ name: 'matches',
709
+ signature: 'matches(s: string, pattern: string, flags?: string) -> boolean',
710
+ summary: 'Searches text with an ECMAScript regular expression and the `u` flag always on, so `\\p{L}`, `\\p{Script=Han}`, `\\p{Script=Arabic}` and astral characters are one expression each. The search is unanchored, like `RegExp.prototype.test`: anchor with `^` and `$` when the whole text must match. `flags` is an optional literal drawn from `i`, `m` and `s`; `g`, `y` and `d` are not available. A subject longer than 4,096 code points is refused, and a repeated group that backtracks exponentially is refused — a literal pattern at compile time, a computed one at evaluation. `ascii_match` remains the bounded ASCII subset; `matches` is the Unicode operator.',
711
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged.',
712
+ errors: ['ENGINE_ERROR'],
713
+ examples: [
714
+ { expr: 'matches("张伟", "^\\\\p{Script=Han}{2,}$")', expected: 'true' },
715
+ { expr: 'matches("مرحبا", "^\\\\p{Script=Arabic}+$")', expected: 'true' },
716
+ { expr: 'matches("José", "^[A-Za-zÀ-ÿ\' -]+$")', expected: 'true' },
717
+ { expr: 'matches("😀", "^\\\\p{Emoji}$")', expected: 'true' },
718
+ { expr: 'matches("ABC", "^abc$", "i")', expected: 'true' },
719
+ { expr: 'matches("abc", "b")', expected: 'true' },
720
+ { expr: 'matches(UNKNOWN, "a")', expected: 'UNKNOWN' },
721
+ ],
722
+ },
723
+ {
724
+ name: 'mode',
725
+ signature: 'mode(xs: list<T>) -> T | null',
726
+ summary: 'The most frequent value, with ties broken by the smallest value under the canonical order, so the answer is deterministic. An empty list is `null`. Money is refused because a currency amount has no single canonical order for the tie-break.',
727
+ resultOnUndetermined: 'A missing list or any missing element returns UNKNOWN, never the mode of what could be read.',
728
+ errors: ['ENGINE_ERROR'],
729
+ examples: [
730
+ { expr: 'mode([decimal "1", decimal "2", decimal "2"])', expected: '"2"' },
731
+ { expr: 'mode([decimal "3", decimal "2"])', expected: '"2"' },
732
+ { expr: 'mode([])', expected: 'null' },
733
+ { expr: 'mode(UNKNOWN)', expected: 'UNKNOWN' },
734
+ ],
735
+ },
736
+ {
737
+ name: 'concat',
738
+ signature: 'concat(a: string, b: string, ...rest: string) -> string',
739
+ summary: 'Joins two to 32 text operands in order. It is the direct spelling of adjacent text — `concat(first, " ", last)` — where `join` is the list form. Variadic is a property of this operator\'s signature, not a general escape hatch: every other built-in keeps its fixed arity, and the upper bound keeps one call from becoming a document of unbounded width.',
740
+ resultOnUndetermined: 'Propagates an undetermined operand unchanged, with UNKNOWN winning over DEFERRED.',
741
+ errors: ['ENGINE_ERROR'],
742
+ examples: [
743
+ { expr: 'concat("a", "b")', expected: '"ab"' },
744
+ { expr: 'concat("a", " ", "b")', expected: '"a b"' },
745
+ { expr: 'concat("a", "-", "b", "-", "c")', expected: '"a-b-c"' },
746
+ { expr: 'concat(UNKNOWN, "b")', expected: 'UNKNOWN' },
747
+ ],
748
+ },
749
+ {
750
+ name: 'year',
751
+ signature: 'year(d: date) -> integer',
752
+ summary: "The civil year of a date, `1` to `9999`, read from the date the value names rather than from the device clock. A `date` is a civil day with no zone, so the year is a fact about the value; an instant's civil date is read with `civil_date` first.",
753
+ resultOnUndetermined: 'An undetermined or empty operand answers UNKNOWN, never year zero.',
754
+ errors: ['ENGINE_ERROR'],
755
+ examples: [
756
+ { expr: 'year(date "2026-01-31")', expected: '2026' },
757
+ { expr: 'year(date "1999-12-31")', expected: '1999' },
758
+ { expr: 'year(UNKNOWN)', expected: 'UNKNOWN' },
759
+ ],
760
+ },
761
+ {
762
+ name: 'month',
763
+ signature: 'month(d: date) -> integer',
764
+ summary: 'The month of a civil date, `1` for January through `12` for December. It is total on a valid date: every date names one month, so a month bucket needs no host calendar.',
765
+ resultOnUndetermined: 'An undetermined or empty operand answers UNKNOWN.',
766
+ errors: ['ENGINE_ERROR'],
767
+ examples: [
768
+ { expr: 'month(date "2026-01-31")', expected: '1' },
769
+ { expr: 'month(date "2026-12-01")', expected: '12' },
770
+ { expr: 'month(UNKNOWN)', expected: 'UNKNOWN' },
771
+ ],
772
+ },
773
+ {
774
+ name: 'day',
775
+ signature: 'day(d: date) -> integer',
776
+ summary: 'The day of the month of a civil date, `1` to `31`, checked against the month and the leap year when the date was read. It is the day number, not a day of the week.',
777
+ resultOnUndetermined: 'An undetermined or empty operand answers UNKNOWN.',
778
+ errors: ['ENGINE_ERROR'],
779
+ examples: [
780
+ { expr: 'day(date "2026-01-31")', expected: '31' },
781
+ { expr: 'day(date "2024-02-29")', expected: '29' },
782
+ { expr: 'day(UNKNOWN)', expected: 'UNKNOWN' },
783
+ ],
784
+ },
785
+ {
786
+ name: 'weekday',
787
+ signature: 'weekday(d: date) -> integer',
788
+ summary: 'The ISO 8601 weekday of a civil date: Monday is `1` and Sunday is `7`. The numbering is fixed by the language, not by a locale, so `weekday(d) >= 6` is the weekend rule on every device.',
789
+ resultOnUndetermined: 'An undetermined or empty operand answers UNKNOWN.',
790
+ errors: ['ENGINE_ERROR'],
791
+ examples: [
792
+ { expr: 'weekday(date "2026-01-01")', expected: '4' },
793
+ { expr: 'weekday(date "2026-01-04")', expected: '7' },
794
+ { expr: 'weekday(UNKNOWN)', expected: 'UNKNOWN' },
795
+ ],
796
+ },
797
+ {
798
+ name: 'parse_date',
799
+ signature: 'parse_date(s: string) -> date | null',
800
+ summary: 'Reads text as a civil date, or answers `null` when the text is not one. A day that does not exist, such as `2026-02-30`, is a miss rather than a normalised neighbour, so a submitted date can be validated without echoing it back. It is the date analogue of `parse_integer`.',
801
+ resultOnUndetermined: 'An undetermined operand propagates; the empty value stays the empty value.',
802
+ errors: ['ENGINE_ERROR'],
803
+ examples: [
804
+ { expr: 'parse_date("2026-01-31")', expected: '"2026-01-31"' },
805
+ { expr: 'parse_date("2026-02-30")', expected: 'null' },
806
+ { expr: 'parse_date(UNKNOWN)', expected: 'UNKNOWN' },
807
+ ],
808
+ },
809
+ {
810
+ name: 'parse_instant',
811
+ signature: 'parse_instant(s: string) -> instant | null',
812
+ summary: 'Reads text as an instant — `YYYY-MM-DDTHH:mm:ss.sssZ`, one spelling and no zone — or answers `null` when the text is not one. The calendar and the clock are checked, so an impossible date part is a miss rather than a normalised instant.',
813
+ resultOnUndetermined: 'An undetermined operand propagates; the empty value stays empty.',
814
+ errors: ['ENGINE_ERROR'],
815
+ examples: [
816
+ {
817
+ expr: 'parse_instant("2026-01-31T00:00:00.000Z")',
818
+ expected: '"2026-01-31T00:00:00.000Z"',
819
+ },
820
+ { expr: 'parse_instant("2026-02-30T00:00:00.000Z")', expected: 'null' },
821
+ { expr: 'parse_instant(UNKNOWN)', expected: 'UNKNOWN' },
822
+ ],
823
+ },
824
+ {
825
+ name: 'sort',
826
+ signature: 'sort(xs: list<T>) -> list<T>',
827
+ summary: "A copy of the list in the canonical order of its element domain: decimals numerically, text by code point, dates and instants by canonical text. The sort is stable, so elements the order calls equal keep their input order, and the result states the operand's own element type.",
828
+ resultOnUndetermined: 'A missing list, or any element the device cannot read, answers UNKNOWN rather than a list with a hole.',
829
+ errors: ['ENGINE_ERROR'],
830
+ examples: [
831
+ { expr: 'sort([decimal "10", decimal "9"])', expected: '["9", "10"]' },
832
+ { expr: 'sort(["b", "a", "c"])', expected: '["a", "b", "c"]' },
833
+ { expr: 'sort([3, 1, 2])', expected: '[1, 2, 3]' },
834
+ { expr: 'sort(UNKNOWN)', expected: 'UNKNOWN' },
835
+ ],
836
+ },
837
+ {
838
+ name: 'slice',
839
+ signature: 'slice(xs: list<T>, start: integer, count: integer) -> list<T>',
840
+ summary: 'The `count` elements from `start`, clamped to the list: a start at or past the end is `[]`, and a window that runs past the end stops there. A negative start or count is refused, exactly as `substring` refuses one.',
841
+ resultOnUndetermined: 'A missing list answers UNKNOWN; the window is never guessed.',
842
+ errors: ['ENGINE_ERROR'],
843
+ examples: [
844
+ { expr: 'slice([1, 2, 3, 4], 1, 2)', expected: '[2, 3]' },
845
+ { expr: 'slice([1, 2, 3], 5, 2)', expected: '[]' },
846
+ { expr: 'slice(UNKNOWN, 0, 1)', expected: 'UNKNOWN' },
847
+ ],
848
+ },
849
+ {
850
+ name: 'distinct',
851
+ signature: 'distinct(xs: list<T>) -> list<T>',
852
+ summary: 'A copy with the first occurrence of each value kept, in input order, comparing under the equality rule: `[decimal "1", 1]` is one value, and text is never coerced to a number. The element type must be primitive.',
853
+ resultOnUndetermined: 'A missing list, or any element the device cannot read, answers UNKNOWN rather than a shorter list.',
854
+ errors: ['ENGINE_ERROR'],
855
+ examples: [
856
+ { expr: 'distinct([decimal "1", 1, decimal "2"])', expected: '["1", "2"]' },
857
+ { expr: 'distinct(["a", "b", "a"])', expected: '["a", "b"]' },
858
+ { expr: 'distinct(UNKNOWN)', expected: 'UNKNOWN' },
859
+ ],
860
+ },
861
+ {
862
+ name: 'reverse',
863
+ signature: 'reverse(xs: list<T>) -> list<T>',
864
+ summary: 'A copy of the list in reverse order. It copies rather than edits, because an expression has no identity and a list a path read must not change under a later rule.',
865
+ resultOnUndetermined: 'A missing list answers UNKNOWN.',
866
+ errors: ['ENGINE_ERROR'],
867
+ examples: [
868
+ { expr: 'reverse([1, 2, 3])', expected: '[3, 2, 1]' },
869
+ { expr: 'reverse(["a"])', expected: '["a"]' },
870
+ { expr: 'reverse(UNKNOWN)', expected: 'UNKNOWN' },
871
+ ],
872
+ },
873
+ ];
874
+ //# sourceMappingURL=builtin-docs.js.map