@azx-pbc/axiom-compiler 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 (655) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +415 -2
  3. package/dist/article.d.ts +12 -0
  4. package/dist/article.d.ts.map +1 -0
  5. package/dist/article.js +16 -0
  6. package/dist/article.js.map +1 -0
  7. package/dist/cli/args.d.ts +101 -0
  8. package/dist/cli/args.d.ts.map +1 -0
  9. package/dist/cli/args.js +158 -0
  10. package/dist/cli/args.js.map +1 -0
  11. package/dist/cli/check.d.ts +2 -0
  12. package/dist/cli/check.d.ts.map +1 -0
  13. package/dist/cli/check.js +33 -0
  14. package/dist/cli/check.js.map +1 -0
  15. package/dist/cli/compile.d.ts +2 -0
  16. package/dist/cli/compile.d.ts.map +1 -0
  17. package/dist/cli/compile.js +43 -0
  18. package/dist/cli/compile.js.map +1 -0
  19. package/dist/cli/count.d.ts +15 -0
  20. package/dist/cli/count.d.ts.map +1 -0
  21. package/dist/cli/count.js +21 -0
  22. package/dist/cli/count.js.map +1 -0
  23. package/dist/cli/dataset.d.ts +28 -0
  24. package/dist/cli/dataset.d.ts.map +1 -0
  25. package/dist/cli/dataset.js +115 -0
  26. package/dist/cli/dataset.js.map +1 -0
  27. package/dist/cli/diff.d.ts +2 -0
  28. package/dist/cli/diff.d.ts.map +1 -0
  29. package/dist/cli/diff.js +297 -0
  30. package/dist/cli/diff.js.map +1 -0
  31. package/dist/cli/explain.d.ts +2 -0
  32. package/dist/cli/explain.d.ts.map +1 -0
  33. package/dist/cli/explain.js +95 -0
  34. package/dist/cli/explain.js.map +1 -0
  35. package/dist/cli/fields.d.ts +11 -0
  36. package/dist/cli/fields.d.ts.map +1 -0
  37. package/dist/cli/fields.js +13 -0
  38. package/dist/cli/fields.js.map +1 -0
  39. package/dist/cli/main.d.ts +2 -0
  40. package/dist/cli/main.d.ts.map +1 -0
  41. package/dist/cli/main.js +40 -0
  42. package/dist/cli/main.js.map +1 -0
  43. package/dist/cli/read.d.ts +56 -0
  44. package/dist/cli/read.d.ts.map +1 -0
  45. package/dist/cli/read.js +179 -0
  46. package/dist/cli/read.js.map +1 -0
  47. package/dist/cli/render.d.ts +58 -0
  48. package/dist/cli/render.d.ts.map +1 -0
  49. package/dist/cli/render.js +422 -0
  50. package/dist/cli/render.js.map +1 -0
  51. package/dist/cli/schema.d.ts +28 -0
  52. package/dist/cli/schema.d.ts.map +1 -0
  53. package/dist/cli/schema.js +46 -0
  54. package/dist/cli/schema.js.map +1 -0
  55. package/dist/cli/suite-report.d.ts +18 -0
  56. package/dist/cli/suite-report.d.ts.map +1 -0
  57. package/dist/cli/suite-report.js +58 -0
  58. package/dist/cli/suite-report.js.map +1 -0
  59. package/dist/cli/suites.d.ts +25 -0
  60. package/dist/cli/suites.d.ts.map +1 -0
  61. package/dist/cli/suites.js +67 -0
  62. package/dist/cli/suites.js.map +1 -0
  63. package/dist/cli/terminal.d.ts +45 -0
  64. package/dist/cli/terminal.d.ts.map +1 -0
  65. package/dist/cli/terminal.js +119 -0
  66. package/dist/cli/terminal.js.map +1 -0
  67. package/dist/cli/test.d.ts +12 -0
  68. package/dist/cli/test.d.ts.map +1 -0
  69. package/dist/cli/test.js +199 -0
  70. package/dist/cli/test.js.map +1 -0
  71. package/dist/cli/usage.d.ts +15 -0
  72. package/dist/cli/usage.d.ts.map +1 -0
  73. package/dist/cli/usage.js +95 -0
  74. package/dist/cli/usage.js.map +1 -0
  75. package/dist/cli.d.ts +3 -0
  76. package/dist/cli.d.ts.map +1 -0
  77. package/dist/cli.js +51 -0
  78. package/dist/cli.js.map +1 -0
  79. package/dist/compile/artifact-members.d.ts +57 -0
  80. package/dist/compile/artifact-members.d.ts.map +1 -0
  81. package/dist/compile/artifact-members.js +130 -0
  82. package/dist/compile/artifact-members.js.map +1 -0
  83. package/dist/compile/artifact.d.ts +20 -0
  84. package/dist/compile/artifact.d.ts.map +1 -0
  85. package/dist/compile/artifact.js +87 -0
  86. package/dist/compile/artifact.js.map +1 -0
  87. package/dist/compile/compilation.d.ts +46 -0
  88. package/dist/compile/compilation.d.ts.map +1 -0
  89. package/dist/compile/compilation.js +4 -0
  90. package/dist/compile/compilation.js.map +1 -0
  91. package/dist/compile/computed.d.ts +22 -0
  92. package/dist/compile/computed.d.ts.map +1 -0
  93. package/dist/compile/computed.js +245 -0
  94. package/dist/compile/computed.js.map +1 -0
  95. package/dist/compile/condition-warnings.d.ts +12 -0
  96. package/dist/compile/condition-warnings.d.ts.map +1 -0
  97. package/dist/compile/condition-warnings.js +26 -0
  98. package/dist/compile/condition-warnings.js.map +1 -0
  99. package/dist/compile/conditions.d.ts +18 -0
  100. package/dist/compile/conditions.d.ts.map +1 -0
  101. package/dist/compile/conditions.js +22 -0
  102. package/dist/compile/conditions.js.map +1 -0
  103. package/dist/compile/cross-checks.d.ts +67 -0
  104. package/dist/compile/cross-checks.d.ts.map +1 -0
  105. package/dist/compile/cross-checks.js +238 -0
  106. package/dist/compile/cross-checks.js.map +1 -0
  107. package/dist/compile/datasets.d.ts +52 -0
  108. package/dist/compile/datasets.d.ts.map +1 -0
  109. package/dist/compile/datasets.js +183 -0
  110. package/dist/compile/datasets.js.map +1 -0
  111. package/dist/compile/dead-weight.d.ts +26 -0
  112. package/dist/compile/dead-weight.d.ts.map +1 -0
  113. package/dist/compile/dead-weight.js +244 -0
  114. package/dist/compile/dead-weight.js.map +1 -0
  115. package/dist/compile/declaration-rules.d.ts +54 -0
  116. package/dist/compile/declaration-rules.d.ts.map +1 -0
  117. package/dist/compile/declaration-rules.js +510 -0
  118. package/dist/compile/declaration-rules.js.map +1 -0
  119. package/dist/compile/declarations.d.ts +44 -0
  120. package/dist/compile/declarations.d.ts.map +1 -0
  121. package/dist/compile/declarations.js +160 -0
  122. package/dist/compile/declarations.js.map +1 -0
  123. package/dist/compile/document.d.ts +4 -0
  124. package/dist/compile/document.d.ts.map +1 -0
  125. package/dist/compile/document.js +13 -0
  126. package/dist/compile/document.js.map +1 -0
  127. package/dist/compile/expression.d.ts +38 -0
  128. package/dist/compile/expression.d.ts.map +1 -0
  129. package/dist/compile/expression.js +288 -0
  130. package/dist/compile/expression.js.map +1 -0
  131. package/dist/compile/hashes.d.ts +26 -0
  132. package/dist/compile/hashes.d.ts.map +1 -0
  133. package/dist/compile/hashes.js +96 -0
  134. package/dist/compile/hashes.js.map +1 -0
  135. package/dist/compile/item-targets.d.ts +12 -0
  136. package/dist/compile/item-targets.d.ts.map +1 -0
  137. package/dist/compile/item-targets.js +287 -0
  138. package/dist/compile/item-targets.js.map +1 -0
  139. package/dist/compile/messages.d.ts +8 -0
  140. package/dist/compile/messages.d.ts.map +1 -0
  141. package/dist/compile/messages.js +62 -0
  142. package/dist/compile/messages.js.map +1 -0
  143. package/dist/compile/option-availability.d.ts +51 -0
  144. package/dist/compile/option-availability.d.ts.map +1 -0
  145. package/dist/compile/option-availability.js +171 -0
  146. package/dist/compile/option-availability.js.map +1 -0
  147. package/dist/compile/option-codes.d.ts +27 -0
  148. package/dist/compile/option-codes.d.ts.map +1 -0
  149. package/dist/compile/option-codes.js +212 -0
  150. package/dist/compile/option-codes.js.map +1 -0
  151. package/dist/compile/references.d.ts +14 -0
  152. package/dist/compile/references.d.ts.map +1 -0
  153. package/dist/compile/references.js +126 -0
  154. package/dist/compile/references.js.map +1 -0
  155. package/dist/compile/rows-from.d.ts +27 -0
  156. package/dist/compile/rows-from.d.ts.map +1 -0
  157. package/dist/compile/rows-from.js +164 -0
  158. package/dist/compile/rows-from.js.map +1 -0
  159. package/dist/compile/rules.d.ts +58 -0
  160. package/dist/compile/rules.d.ts.map +1 -0
  161. package/dist/compile/rules.js +327 -0
  162. package/dist/compile/rules.js.map +1 -0
  163. package/dist/compile/suggestions.d.ts +52 -0
  164. package/dist/compile/suggestions.d.ts.map +1 -0
  165. package/dist/compile/suggestions.js +633 -0
  166. package/dist/compile/suggestions.js.map +1 -0
  167. package/dist/compile/targets.d.ts +22 -0
  168. package/dist/compile/targets.d.ts.map +1 -0
  169. package/dist/compile/targets.js +125 -0
  170. package/dist/compile/targets.js.map +1 -0
  171. package/dist/compile/types.d.ts +84 -0
  172. package/dist/compile/types.d.ts.map +1 -0
  173. package/dist/compile/types.js +2 -0
  174. package/dist/compile/types.js.map +1 -0
  175. package/dist/compile/warning.d.ts +45 -0
  176. package/dist/compile/warning.d.ts.map +1 -0
  177. package/dist/compile/warning.js +2 -0
  178. package/dist/compile/warning.js.map +1 -0
  179. package/dist/compile-yaml.d.ts +23 -0
  180. package/dist/compile-yaml.d.ts.map +1 -0
  181. package/dist/compile-yaml.js +30 -0
  182. package/dist/compile-yaml.js.map +1 -0
  183. package/dist/compile.d.ts +78 -0
  184. package/dist/compile.d.ts.map +1 -0
  185. package/dist/compile.js +372 -0
  186. package/dist/compile.js.map +1 -0
  187. package/dist/csv/limits.d.ts +43 -0
  188. package/dist/csv/limits.d.ts.map +1 -0
  189. package/dist/csv/limits.js +51 -0
  190. package/dist/csv/limits.js.map +1 -0
  191. package/dist/csv/scalar.d.ts +33 -0
  192. package/dist/csv/scalar.d.ts.map +1 -0
  193. package/dist/csv/scalar.js +77 -0
  194. package/dist/csv/scalar.js.map +1 -0
  195. package/dist/datasets/csv.d.ts +46 -0
  196. package/dist/datasets/csv.d.ts.map +1 -0
  197. package/dist/datasets/csv.js +293 -0
  198. package/dist/datasets/csv.js.map +1 -0
  199. package/dist/datasets/declaration.d.ts +16 -0
  200. package/dist/datasets/declaration.d.ts.map +1 -0
  201. package/dist/datasets/declaration.js +104 -0
  202. package/dist/datasets/declaration.js.map +1 -0
  203. package/dist/datasets/diagnostics.d.ts +65 -0
  204. package/dist/datasets/diagnostics.d.ts.map +1 -0
  205. package/dist/datasets/diagnostics.js +2 -0
  206. package/dist/datasets/diagnostics.js.map +1 -0
  207. package/dist/datasets/diff.d.ts +46 -0
  208. package/dist/datasets/diff.d.ts.map +1 -0
  209. package/dist/datasets/diff.js +84 -0
  210. package/dist/datasets/diff.js.map +1 -0
  211. package/dist/datasets/document.d.ts +12 -0
  212. package/dist/datasets/document.d.ts.map +1 -0
  213. package/dist/datasets/document.js +382 -0
  214. package/dist/datasets/document.js.map +1 -0
  215. package/dist/datasets/index.d.ts +43 -0
  216. package/dist/datasets/index.d.ts.map +1 -0
  217. package/dist/datasets/index.js +68 -0
  218. package/dist/datasets/index.js.map +1 -0
  219. package/dist/datasets/repair.d.ts +26 -0
  220. package/dist/datasets/repair.d.ts.map +1 -0
  221. package/dist/datasets/repair.js +60 -0
  222. package/dist/datasets/repair.js.map +1 -0
  223. package/dist/document-path.d.ts +62 -0
  224. package/dist/document-path.d.ts.map +1 -0
  225. package/dist/document-path.js +200 -0
  226. package/dist/document-path.js.map +1 -0
  227. package/dist/expr/boundary.d.ts +8 -0
  228. package/dist/expr/boundary.d.ts.map +1 -0
  229. package/dist/expr/boundary.js +243 -0
  230. package/dist/expr/boundary.js.map +1 -0
  231. package/dist/expr/compile-expr.d.ts +35 -0
  232. package/dist/expr/compile-expr.d.ts.map +1 -0
  233. package/dist/expr/compile-expr.js +66 -0
  234. package/dist/expr/compile-expr.js.map +1 -0
  235. package/dist/expr/deprecation.d.ts +23 -0
  236. package/dist/expr/deprecation.d.ts.map +1 -0
  237. package/dist/expr/deprecation.js +28 -0
  238. package/dist/expr/deprecation.js.map +1 -0
  239. package/dist/expr/diagnostics.d.ts +31 -0
  240. package/dist/expr/diagnostics.d.ts.map +1 -0
  241. package/dist/expr/diagnostics.js +34 -0
  242. package/dist/expr/diagnostics.js.map +1 -0
  243. package/dist/expr/lexer.d.ts +49 -0
  244. package/dist/expr/lexer.d.ts.map +1 -0
  245. package/dist/expr/lexer.js +277 -0
  246. package/dist/expr/lexer.js.map +1 -0
  247. package/dist/expr/lint-warnings.d.ts +11 -0
  248. package/dist/expr/lint-warnings.d.ts.map +1 -0
  249. package/dist/expr/lint-warnings.js +20 -0
  250. package/dist/expr/lint-warnings.js.map +1 -0
  251. package/dist/expr/lint.d.ts +41 -0
  252. package/dist/expr/lint.d.ts.map +1 -0
  253. package/dist/expr/lint.js +1034 -0
  254. package/dist/expr/lint.js.map +1 -0
  255. package/dist/expr/parse/aggregates.d.ts +13 -0
  256. package/dist/expr/parse/aggregates.d.ts.map +1 -0
  257. package/dist/expr/parse/aggregates.js +48 -0
  258. package/dist/expr/parse/aggregates.js.map +1 -0
  259. package/dist/expr/parse/budget.d.ts +11 -0
  260. package/dist/expr/parse/budget.d.ts.map +1 -0
  261. package/dist/expr/parse/budget.js +57 -0
  262. package/dist/expr/parse/budget.js.map +1 -0
  263. package/dist/expr/parse/grammar.d.ts +9 -0
  264. package/dist/expr/parse/grammar.d.ts.map +1 -0
  265. package/dist/expr/parse/grammar.js +699 -0
  266. package/dist/expr/parse/grammar.js.map +1 -0
  267. package/dist/expr/parse/literals.d.ts +20 -0
  268. package/dist/expr/parse/literals.d.ts.map +1 -0
  269. package/dist/expr/parse/literals.js +132 -0
  270. package/dist/expr/parse/literals.js.map +1 -0
  271. package/dist/expr/parse/stream.d.ts +60 -0
  272. package/dist/expr/parse/stream.d.ts.map +1 -0
  273. package/dist/expr/parse/stream.js +151 -0
  274. package/dist/expr/parse/stream.js.map +1 -0
  275. package/dist/expr/parser.d.ts +45 -0
  276. package/dist/expr/parser.d.ts.map +1 -0
  277. package/dist/expr/parser.js +110 -0
  278. package/dist/expr/parser.js.map +1 -0
  279. package/dist/expr/print/spell.d.ts +78 -0
  280. package/dist/expr/print/spell.d.ts.map +1 -0
  281. package/dist/expr/print/spell.js +592 -0
  282. package/dist/expr/print/spell.js.map +1 -0
  283. package/dist/expr/print.d.ts +20 -0
  284. package/dist/expr/print.d.ts.map +1 -0
  285. package/dist/expr/print.js +102 -0
  286. package/dist/expr/print.js.map +1 -0
  287. package/dist/expr/suggest.d.ts +26 -0
  288. package/dist/expr/suggest.d.ts.map +1 -0
  289. package/dist/expr/suggest.js +77 -0
  290. package/dist/expr/suggest.js.map +1 -0
  291. package/dist/expr/typecheck/aggregates.d.ts +8 -0
  292. package/dist/expr/typecheck/aggregates.d.ts.map +1 -0
  293. package/dist/expr/typecheck/aggregates.js +334 -0
  294. package/dist/expr/typecheck/aggregates.js.map +1 -0
  295. package/dist/expr/typecheck/arithmetic.d.ts +6 -0
  296. package/dist/expr/typecheck/arithmetic.d.ts.map +1 -0
  297. package/dist/expr/typecheck/arithmetic.js +258 -0
  298. package/dist/expr/typecheck/arithmetic.js.map +1 -0
  299. package/dist/expr/typecheck/arity.d.ts +38 -0
  300. package/dist/expr/typecheck/arity.d.ts.map +1 -0
  301. package/dist/expr/typecheck/arity.js +173 -0
  302. package/dist/expr/typecheck/arity.js.map +1 -0
  303. package/dist/expr/typecheck/calls.d.ts +6 -0
  304. package/dist/expr/typecheck/calls.d.ts.map +1 -0
  305. package/dist/expr/typecheck/calls.js +137 -0
  306. package/dist/expr/typecheck/calls.js.map +1 -0
  307. package/dist/expr/typecheck/comparison.d.ts +13 -0
  308. package/dist/expr/typecheck/comparison.d.ts.map +1 -0
  309. package/dist/expr/typecheck/comparison.js +200 -0
  310. package/dist/expr/typecheck/comparison.js.map +1 -0
  311. package/dist/expr/typecheck/compound.d.ts +24 -0
  312. package/dist/expr/typecheck/compound.d.ts.map +1 -0
  313. package/dist/expr/typecheck/compound.js +175 -0
  314. package/dist/expr/typecheck/compound.js.map +1 -0
  315. package/dist/expr/typecheck/context.d.ts +44 -0
  316. package/dist/expr/typecheck/context.d.ts.map +1 -0
  317. package/dist/expr/typecheck/context.js +2 -0
  318. package/dist/expr/typecheck/context.js.map +1 -0
  319. package/dist/expr/typecheck/datasets.d.ts +17 -0
  320. package/dist/expr/typecheck/datasets.d.ts.map +1 -0
  321. package/dist/expr/typecheck/datasets.js +136 -0
  322. package/dist/expr/typecheck/datasets.js.map +1 -0
  323. package/dist/expr/typecheck/digest.d.ts +7 -0
  324. package/dist/expr/typecheck/digest.d.ts.map +1 -0
  325. package/dist/expr/typecheck/digest.js +44 -0
  326. package/dist/expr/typecheck/digest.js.map +1 -0
  327. package/dist/expr/typecheck/fold.d.ts +41 -0
  328. package/dist/expr/typecheck/fold.d.ts.map +1 -0
  329. package/dist/expr/typecheck/fold.js +71 -0
  330. package/dist/expr/typecheck/fold.js.map +1 -0
  331. package/dist/expr/typecheck/gate-folds.d.ts +22 -0
  332. package/dist/expr/typecheck/gate-folds.d.ts.map +1 -0
  333. package/dist/expr/typecheck/gate-folds.js +40 -0
  334. package/dist/expr/typecheck/gate-folds.js.map +1 -0
  335. package/dist/expr/typecheck/guards.d.ts +6 -0
  336. package/dist/expr/typecheck/guards.d.ts.map +1 -0
  337. package/dist/expr/typecheck/guards.js +38 -0
  338. package/dist/expr/typecheck/guards.js.map +1 -0
  339. package/dist/expr/typecheck/member.d.ts +17 -0
  340. package/dist/expr/typecheck/member.d.ts.map +1 -0
  341. package/dist/expr/typecheck/member.js +46 -0
  342. package/dist/expr/typecheck/member.js.map +1 -0
  343. package/dist/expr/typecheck/money.d.ts +8 -0
  344. package/dist/expr/typecheck/money.d.ts.map +1 -0
  345. package/dist/expr/typecheck/money.js +49 -0
  346. package/dist/expr/typecheck/money.js.map +1 -0
  347. package/dist/expr/typecheck/numeric.d.ts +8 -0
  348. package/dist/expr/typecheck/numeric.d.ts.map +1 -0
  349. package/dist/expr/typecheck/numeric.js +84 -0
  350. package/dist/expr/typecheck/numeric.js.map +1 -0
  351. package/dist/expr/typecheck/operands.d.ts +27 -0
  352. package/dist/expr/typecheck/operands.d.ts.map +1 -0
  353. package/dist/expr/typecheck/operands.js +106 -0
  354. package/dist/expr/typecheck/operands.js.map +1 -0
  355. package/dist/expr/typecheck/paths.d.ts +21 -0
  356. package/dist/expr/typecheck/paths.d.ts.map +1 -0
  357. package/dist/expr/typecheck/paths.js +321 -0
  358. package/dist/expr/typecheck/paths.js.map +1 -0
  359. package/dist/expr/typecheck/records.d.ts +24 -0
  360. package/dist/expr/typecheck/records.d.ts.map +1 -0
  361. package/dist/expr/typecheck/records.js +53 -0
  362. package/dist/expr/typecheck/records.js.map +1 -0
  363. package/dist/expr/typecheck/sequences.d.ts +15 -0
  364. package/dist/expr/typecheck/sequences.d.ts.map +1 -0
  365. package/dist/expr/typecheck/sequences.js +55 -0
  366. package/dist/expr/typecheck/sequences.js.map +1 -0
  367. package/dist/expr/typecheck/strings.d.ts +8 -0
  368. package/dist/expr/typecheck/strings.d.ts.map +1 -0
  369. package/dist/expr/typecheck/strings.js +188 -0
  370. package/dist/expr/typecheck/strings.js.map +1 -0
  371. package/dist/expr/typecheck/temporal.d.ts +7 -0
  372. package/dist/expr/typecheck/temporal.d.ts.map +1 -0
  373. package/dist/expr/typecheck/temporal.js +80 -0
  374. package/dist/expr/typecheck/temporal.js.map +1 -0
  375. package/dist/expr/typecheck/types.d.ts +163 -0
  376. package/dist/expr/typecheck/types.d.ts.map +1 -0
  377. package/dist/expr/typecheck/types.js +404 -0
  378. package/dist/expr/typecheck/types.js.map +1 -0
  379. package/dist/expr/typecheck.d.ts +75 -0
  380. package/dist/expr/typecheck.d.ts.map +1 -0
  381. package/dist/expr/typecheck.js +242 -0
  382. package/dist/expr/typecheck.js.map +1 -0
  383. package/dist/expr/undecided.d.ts +13 -0
  384. package/dist/expr/undecided.d.ts.map +1 -0
  385. package/dist/expr/undecided.js +58 -0
  386. package/dist/expr/undecided.js.map +1 -0
  387. package/dist/expr/values/code-points.d.ts +13 -0
  388. package/dist/expr/values/code-points.d.ts.map +1 -0
  389. package/dist/expr/values/code-points.js +25 -0
  390. package/dist/expr/values/code-points.js.map +1 -0
  391. package/dist/expr/values/inline.d.ts +77 -0
  392. package/dist/expr/values/inline.d.ts.map +1 -0
  393. package/dist/expr/values/inline.js +404 -0
  394. package/dist/expr/values/inline.js.map +1 -0
  395. package/dist/expr/values/interval.d.ts +19 -0
  396. package/dist/expr/values/interval.d.ts.map +1 -0
  397. package/dist/expr/values/interval.js +1180 -0
  398. package/dist/expr/values/interval.js.map +1 -0
  399. package/dist/index.d.ts +163 -0
  400. package/dist/index.d.ts.map +1 -0
  401. package/dist/index.js +128 -0
  402. package/dist/index.js.map +1 -0
  403. package/dist/ingest/document.d.ts +58 -0
  404. package/dist/ingest/document.d.ts.map +1 -0
  405. package/dist/ingest/document.js +83 -0
  406. package/dist/ingest/document.js.map +1 -0
  407. package/dist/ingest/yaml-document.d.ts +15 -0
  408. package/dist/ingest/yaml-document.d.ts.map +1 -0
  409. package/dist/ingest/yaml-document.js +42 -0
  410. package/dist/ingest/yaml-document.js.map +1 -0
  411. package/dist/ingest/yaml.d.ts +51 -0
  412. package/dist/ingest/yaml.d.ts.map +1 -0
  413. package/dist/ingest/yaml.js +340 -0
  414. package/dist/ingest/yaml.js.map +1 -0
  415. package/dist/layout/compile.d.ts +6 -0
  416. package/dist/layout/compile.d.ts.map +1 -0
  417. package/dist/layout/compile.js +224 -0
  418. package/dist/layout/compile.js.map +1 -0
  419. package/dist/layout/context.d.ts +12 -0
  420. package/dist/layout/context.d.ts.map +1 -0
  421. package/dist/layout/context.js +26 -0
  422. package/dist/layout/context.js.map +1 -0
  423. package/dist/layout/grammar.d.ts +34 -0
  424. package/dist/layout/grammar.d.ts.map +1 -0
  425. package/dist/layout/grammar.js +171 -0
  426. package/dist/layout/grammar.js.map +1 -0
  427. package/dist/layout/read.d.ts +54 -0
  428. package/dist/layout/read.d.ts.map +1 -0
  429. package/dist/layout/read.js +101 -0
  430. package/dist/layout/read.js.map +1 -0
  431. package/dist/layout/shape.d.ts +34 -0
  432. package/dist/layout/shape.d.ts.map +1 -0
  433. package/dist/layout/shape.js +149 -0
  434. package/dist/layout/shape.js.map +1 -0
  435. package/dist/messages/compile.d.ts +47 -0
  436. package/dist/messages/compile.d.ts.map +1 -0
  437. package/dist/messages/compile.js +202 -0
  438. package/dist/messages/compile.js.map +1 -0
  439. package/dist/messages/locale.d.ts +18 -0
  440. package/dist/messages/locale.d.ts.map +1 -0
  441. package/dist/messages/locale.js +33 -0
  442. package/dist/messages/locale.js.map +1 -0
  443. package/dist/messages/slots.d.ts +54 -0
  444. package/dist/messages/slots.d.ts.map +1 -0
  445. package/dist/messages/slots.js +137 -0
  446. package/dist/messages/slots.js.map +1 -0
  447. package/dist/overlay/compile-overlay.d.ts +29 -0
  448. package/dist/overlay/compile-overlay.d.ts.map +1 -0
  449. package/dist/overlay/compile-overlay.js +120 -0
  450. package/dist/overlay/compile-overlay.js.map +1 -0
  451. package/dist/overlay/compose.d.ts +26 -0
  452. package/dist/overlay/compose.d.ts.map +1 -0
  453. package/dist/overlay/compose.js +674 -0
  454. package/dist/overlay/compose.js.map +1 -0
  455. package/dist/overlay/types.d.ts +41 -0
  456. package/dist/overlay/types.d.ts.map +1 -0
  457. package/dist/overlay/types.js +2 -0
  458. package/dist/overlay/types.js.map +1 -0
  459. package/dist/publish/classify.d.ts +50 -0
  460. package/dist/publish/classify.d.ts.map +1 -0
  461. package/dist/publish/classify.js +85 -0
  462. package/dist/publish/classify.js.map +1 -0
  463. package/dist/publish/environment.d.ts +15 -0
  464. package/dist/publish/environment.d.ts.map +1 -0
  465. package/dist/publish/environment.js +2 -0
  466. package/dist/publish/environment.js.map +1 -0
  467. package/dist/publish/migrations.d.ts +108 -0
  468. package/dist/publish/migrations.d.ts.map +1 -0
  469. package/dist/publish/migrations.js +166 -0
  470. package/dist/publish/migrations.js.map +1 -0
  471. package/dist/publish/observation.d.ts +29 -0
  472. package/dist/publish/observation.d.ts.map +1 -0
  473. package/dist/publish/observation.js +43 -0
  474. package/dist/publish/observation.js.map +1 -0
  475. package/dist/publish/readiness.d.ts +197 -0
  476. package/dist/publish/readiness.d.ts.map +1 -0
  477. package/dist/publish/readiness.js +239 -0
  478. package/dist/publish/readiness.js.map +1 -0
  479. package/dist/publish/vectors.d.ts +50 -0
  480. package/dist/publish/vectors.d.ts.map +1 -0
  481. package/dist/publish/vectors.js +306 -0
  482. package/dist/publish/vectors.js.map +1 -0
  483. package/dist/publish/verify.d.ts +146 -0
  484. package/dist/publish/verify.d.ts.map +1 -0
  485. package/dist/publish/verify.js +548 -0
  486. package/dist/publish/verify.js.map +1 -0
  487. package/dist/scenarios/branch.d.ts +36 -0
  488. package/dist/scenarios/branch.d.ts.map +1 -0
  489. package/dist/scenarios/branch.js +30 -0
  490. package/dist/scenarios/branch.js.map +1 -0
  491. package/dist/scenarios/capture.d.ts +89 -0
  492. package/dist/scenarios/capture.d.ts.map +1 -0
  493. package/dist/scenarios/capture.js +443 -0
  494. package/dist/scenarios/capture.js.map +1 -0
  495. package/dist/scenarios/classifier.d.ts +20 -0
  496. package/dist/scenarios/classifier.d.ts.map +1 -0
  497. package/dist/scenarios/classifier.js +88 -0
  498. package/dist/scenarios/classifier.js.map +1 -0
  499. package/dist/scenarios/credit.d.ts +33 -0
  500. package/dist/scenarios/credit.d.ts.map +1 -0
  501. package/dist/scenarios/credit.js +330 -0
  502. package/dist/scenarios/credit.js.map +1 -0
  503. package/dist/scenarios/csv.d.ts +34 -0
  504. package/dist/scenarios/csv.d.ts.map +1 -0
  505. package/dist/scenarios/csv.js +1047 -0
  506. package/dist/scenarios/csv.js.map +1 -0
  507. package/dist/scenarios/data-identity.d.ts +39 -0
  508. package/dist/scenarios/data-identity.d.ts.map +1 -0
  509. package/dist/scenarios/data-identity.js +28 -0
  510. package/dist/scenarios/data-identity.js.map +1 -0
  511. package/dist/scenarios/document.d.ts +148 -0
  512. package/dist/scenarios/document.d.ts.map +1 -0
  513. package/dist/scenarios/document.js +513 -0
  514. package/dist/scenarios/document.js.map +1 -0
  515. package/dist/scenarios/environment.d.ts +64 -0
  516. package/dist/scenarios/environment.d.ts.map +1 -0
  517. package/dist/scenarios/environment.js +106 -0
  518. package/dist/scenarios/environment.js.map +1 -0
  519. package/dist/scenarios/evidence.d.ts +128 -0
  520. package/dist/scenarios/evidence.d.ts.map +1 -0
  521. package/dist/scenarios/evidence.js +179 -0
  522. package/dist/scenarios/evidence.js.map +1 -0
  523. package/dist/scenarios/expectations.d.ts +63 -0
  524. package/dist/scenarios/expectations.d.ts.map +1 -0
  525. package/dist/scenarios/expectations.js +490 -0
  526. package/dist/scenarios/expectations.js.map +1 -0
  527. package/dist/scenarios/references.d.ts +15 -0
  528. package/dist/scenarios/references.d.ts.map +1 -0
  529. package/dist/scenarios/references.js +239 -0
  530. package/dist/scenarios/references.js.map +1 -0
  531. package/dist/scenarios/report.d.ts +216 -0
  532. package/dist/scenarios/report.d.ts.map +1 -0
  533. package/dist/scenarios/report.js +54 -0
  534. package/dist/scenarios/report.js.map +1 -0
  535. package/dist/scenarios/runner.d.ts +55 -0
  536. package/dist/scenarios/runner.d.ts.map +1 -0
  537. package/dist/scenarios/runner.js +205 -0
  538. package/dist/scenarios/runner.js.map +1 -0
  539. package/dist/scenarios/vocabulary.d.ts +19 -0
  540. package/dist/scenarios/vocabulary.d.ts.map +1 -0
  541. package/dist/scenarios/vocabulary.js +56 -0
  542. package/dist/scenarios/vocabulary.js.map +1 -0
  543. package/dist/schema/catalogue.d.ts +54 -0
  544. package/dist/schema/catalogue.d.ts.map +1 -0
  545. package/dist/schema/catalogue.js +221 -0
  546. package/dist/schema/catalogue.js.map +1 -0
  547. package/dist/schema/check.d.ts +22 -0
  548. package/dist/schema/check.d.ts.map +1 -0
  549. package/dist/schema/check.js +30 -0
  550. package/dist/schema/check.js.map +1 -0
  551. package/dist/schema/closed.d.ts +19 -0
  552. package/dist/schema/closed.d.ts.map +1 -0
  553. package/dist/schema/closed.js +33 -0
  554. package/dist/schema/closed.js.map +1 -0
  555. package/dist/schema/collapse.d.ts +27 -0
  556. package/dist/schema/collapse.d.ts.map +1 -0
  557. package/dist/schema/collapse.js +143 -0
  558. package/dist/schema/collapse.js.map +1 -0
  559. package/dist/schema/controls.d.ts +46 -0
  560. package/dist/schema/controls.d.ts.map +1 -0
  561. package/dist/schema/controls.js +75 -0
  562. package/dist/schema/controls.js.map +1 -0
  563. package/dist/schema/dataset-declaration.d.ts +11 -0
  564. package/dist/schema/dataset-declaration.d.ts.map +1 -0
  565. package/dist/schema/dataset-declaration.js +11 -0
  566. package/dist/schema/dataset-declaration.js.map +1 -0
  567. package/dist/schema/declaration-warnings.d.ts +14 -0
  568. package/dist/schema/declaration-warnings.d.ts.map +1 -0
  569. package/dist/schema/declaration-warnings.js +77 -0
  570. package/dist/schema/declaration-warnings.js.map +1 -0
  571. package/dist/schema/declarations.d.ts +41 -0
  572. package/dist/schema/declarations.d.ts.map +1 -0
  573. package/dist/schema/declarations.js +1299 -0
  574. package/dist/schema/declarations.js.map +1 -0
  575. package/dist/schema/diagnostic.d.ts +118 -0
  576. package/dist/schema/diagnostic.d.ts.map +1 -0
  577. package/dist/schema/diagnostic.js +39 -0
  578. package/dist/schema/diagnostic.js.map +1 -0
  579. package/dist/schema/document.d.ts +93 -0
  580. package/dist/schema/document.d.ts.map +1 -0
  581. package/dist/schema/document.js +507 -0
  582. package/dist/schema/document.js.map +1 -0
  583. package/dist/schema/fields.d.ts +11 -0
  584. package/dist/schema/fields.d.ts.map +1 -0
  585. package/dist/schema/fields.js +265 -0
  586. package/dist/schema/fields.js.map +1 -0
  587. package/dist/schema/gates.d.ts +4 -0
  588. package/dist/schema/gates.d.ts.map +1 -0
  589. package/dist/schema/gates.js +68 -0
  590. package/dist/schema/gates.js.map +1 -0
  591. package/dist/schema/located.d.ts +27 -0
  592. package/dist/schema/located.d.ts.map +1 -0
  593. package/dist/schema/located.js +56 -0
  594. package/dist/schema/located.js.map +1 -0
  595. package/dist/schema/measurement.d.ts +9 -0
  596. package/dist/schema/measurement.d.ts.map +1 -0
  597. package/dist/schema/measurement.js +38 -0
  598. package/dist/schema/measurement.js.map +1 -0
  599. package/dist/schema/member-wording.d.ts +35 -0
  600. package/dist/schema/member-wording.d.ts.map +1 -0
  601. package/dist/schema/member-wording.js +286 -0
  602. package/dist/schema/member-wording.js.map +1 -0
  603. package/dist/schema/metaschema.d.ts +20 -0
  604. package/dist/schema/metaschema.d.ts.map +1 -0
  605. package/dist/schema/metaschema.js +476 -0
  606. package/dist/schema/metaschema.js.map +1 -0
  607. package/dist/schema/pointer.d.ts +31 -0
  608. package/dist/schema/pointer.d.ts.map +1 -0
  609. package/dist/schema/pointer.js +73 -0
  610. package/dist/schema/pointer.js.map +1 -0
  611. package/dist/schema/primary.d.ts +29 -0
  612. package/dist/schema/primary.d.ts.map +1 -0
  613. package/dist/schema/primary.js +48 -0
  614. package/dist/schema/primary.js.map +1 -0
  615. package/dist/schema/publish-vector.d.ts +17 -0
  616. package/dist/schema/publish-vector.d.ts.map +1 -0
  617. package/dist/schema/publish-vector.js +34 -0
  618. package/dist/schema/publish-vector.js.map +1 -0
  619. package/dist/schema/repair.d.ts +34 -0
  620. package/dist/schema/repair.d.ts.map +1 -0
  621. package/dist/schema/repair.js +163 -0
  622. package/dist/schema/repair.js.map +1 -0
  623. package/dist/schema/schema-v1.generated.d.ts +14 -0
  624. package/dist/schema/schema-v1.generated.d.ts.map +1 -0
  625. package/dist/schema/schema-v1.generated.js +7089 -0
  626. package/dist/schema/schema-v1.generated.js.map +1 -0
  627. package/dist/schema/screens.d.ts +4 -0
  628. package/dist/schema/screens.d.ts.map +1 -0
  629. package/dist/schema/screens.js +28 -0
  630. package/dist/schema/screens.js.map +1 -0
  631. package/dist/schema/test-values.d.ts +12 -0
  632. package/dist/schema/test-values.d.ts.map +1 -0
  633. package/dist/schema/test-values.js +97 -0
  634. package/dist/schema/test-values.js.map +1 -0
  635. package/dist/schema/unions.d.ts +46 -0
  636. package/dist/schema/unions.d.ts.map +1 -0
  637. package/dist/schema/unions.js +131 -0
  638. package/dist/schema/unions.js.map +1 -0
  639. package/dist/schema/validate-yaml.d.ts +14 -0
  640. package/dist/schema/validate-yaml.d.ts.map +1 -0
  641. package/dist/schema/validate-yaml.js +17 -0
  642. package/dist/schema/validate-yaml.js.map +1 -0
  643. package/dist/schema/validate.d.ts +46 -0
  644. package/dist/schema/validate.d.ts.map +1 -0
  645. package/dist/schema/validate.js +186 -0
  646. package/dist/schema/validate.js.map +1 -0
  647. package/dist/testing.d.ts +21 -0
  648. package/dist/testing.d.ts.map +1 -0
  649. package/dist/testing.js +28 -0
  650. package/dist/testing.js.map +1 -0
  651. package/dist/vocabulary.d.ts +6 -0
  652. package/dist/vocabulary.d.ts.map +1 -0
  653. package/dist/vocabulary.js +26 -0
  654. package/dist/vocabulary.js.map +1 -0
  655. package/package.json +66 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AZX, PBC. Open Source
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,416 @@
1
- # Temporary Holding Version
1
+ # @azx-pbc/axiom-compiler
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Compiles an Axiom schema document into the artifact `@azx-pbc/axiom-runtime` evaluates. It owns
4
+ closed-metaschema validation (a JSON Schema metaschema that refuses unknown members), the Expr v1
5
+ parser and static type checker, the International Components for Unicode (ICU) MessageFormat 1
6
+ (MF1) message compiler, dataset compilation from JSON or CSV, and the `axiom-cli` command line.
7
+ Compilation is not evaluation: `compile()` never runs a rule. The explicit scenario APIs replay
8
+ records through the runtime, and no library path touches the filesystem, the clock or the host's
9
+ locale data — reading a document from disk belongs to the CLI. The package depends on
10
+ `@azx-pbc/axiom-runtime`; the runtime and the React bindings do not depend on it, so a client ships
11
+ the compiled artifact and never this package.
12
+
13
+ ## Install
14
+
15
+ ```sh
16
+ pnpm add @azx-pbc/axiom-compiler
17
+ # or: npm install @azx-pbc/axiom-compiler
18
+ ```
19
+
20
+ The manifest states Node `>=24`. The library entry is browser-safe; only the `axiom-cli` bin reads
21
+ files. The CSV reader it depends on publishes a Node build and a browser build and declares
22
+ `"browser": "papaparse.min.js"`, so a resolver that honours the `browser` field — Vite, esbuild,
23
+ webpack, or Rollup's node-resolve with `browser: true` — loads the browser build and the graph
24
+ reaches no Node built-in. Rollup's node-resolve defaults to `browser: false`; such a config
25
+ resolves the Node build, whose Node-only streamer carries a guarded `require('stream')` that no
26
+ string parse reaches. Set `browser: true` there, or map `stream` to an empty module.
27
+ `packages/compiler/src/__tests__/browser-pack.test.ts` builds the three entries with the project's
28
+ own bundler and fails if one reaches a built-in.
29
+
30
+ ## Quickstart
31
+
32
+ `compile()` takes the schema document as **restricted JSON text**, not a parsed object;
33
+ `compileYaml()` takes the same document written as YAML, and both reach one artifact. The artifact
34
+ is JSON either way, and the format is the caller's choice of spelling, not a second contract.
35
+
36
+ ```ts
37
+ import { compile } from '@azx-pbc/axiom-compiler';
38
+
39
+ const result = compile(`{
40
+ "schemaId": "example_note",
41
+ "schemaVersion": 1,
42
+ "exprVersion": 1,
43
+ "fields": [{ "fieldId": "f_note", "primitive": "string", "control": "text" }]
44
+ }`);
45
+
46
+ if (result.ok) {
47
+ console.log(result.schema.schemaId, result.declaredEvidence.gaps.length);
48
+ } else {
49
+ for (const diagnostic of result.diagnostics) {
50
+ console.error(diagnostic.code, diagnostic.path, diagnostic.detail);
51
+ }
52
+ }
53
+ ```
54
+
55
+ A refusal returns every reason found, not the first. One diagnostic names its code — for example
56
+ `UNKNOWN_IDENTIFIER` at path `$.rules[0].expr`, with the detail `f_notes is not a declared field or
57
+ context root; did you mean f_note?` and the suggestion `f_note`.
58
+
59
+ `checkSchema(text)` answers validity alone (`{ ok: true, schemaId, schemaVersion }` or the
60
+ diagnostics); `compile()` also builds the artifact, its dependency graph (`deps`) and the evidence
61
+ its embedded vectors declare (`declaredEvidence`).
62
+
63
+ ## Public surface
64
+
65
+ One host entry point. The `axiom-cli` bin is the only other published path and is not importable;
66
+ `@azx-pbc/axiom-compiler/testing` is this repository's own door, not a host API.
67
+
68
+ | Purpose | Exports |
69
+ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
70
+ | Compile and check | `compile`, `compileYaml`, `compileDocument`, `documentFormatOf`, `compileInspected`, `inspectSchemaDocument`, `inspectYamlDocument`, `checkSchema`, `closedShapeErrors`, `compileExpr`, `parseExpr`, `printExpr`, `canonicalLocale`, `isLocaleTag`, `LOCALE_TAG_PATTERN`, `parseDocumentPath`, `compileOverlay` |
71
+ | Publish evidence | `verifyPublishReadiness`, `publishReport`, `classifyArtifactDiff` |
72
+ | Datasets | `compileDataset`, `compileDatasetInstallation`, `diffDatasets`, `narrowCsvDatasetDeclaration` |
73
+ | Scenario suites | `parseScenarioSuite`, `runScenarioSuite`, `captureScenario` |
74
+ | Scenario matrices | `parseScenarioCsv`, `exportScenarioCsv` |
75
+ | Reference tables | `CONTROLS_BY_PRIMITIVE`, `OPTION_BOUND_CONTROLS`, `controlsFor`, `requiresControl`, `LAYOUT_KINDS`, `LAYOUT_MEMBERS`, `LAYOUT_TONES` |
76
+ | Locale completeness | `missingTranslations` |
77
+ | Layout structure | `layoutShapeErrors`, `layoutShapeContext`, `readLayout` |
78
+ | Types: compile result | `CompileResult`, `CompileSuccess`, `CompileFailure`, `CompileOptions`, `Inspection`, `Tier`, `DeclaredEvidence`, `PublishReadiness`, `PublishGap`, `PublishGapKind`, `DocumentFormat`, `IngestedDocument`, `OverlaySource`, `CompileOverlayOptions`, `OverlayCompileResult`, `OverlayCompileSuccess` |
79
+ | Types: publish | `PublishVerification`, `PublishVerificationOptions`, `PublishReport`, `PublishEnvironment`, `CommittedEnvironment`, `RuleCoverage`, `ObservedOnly`, `EmbeddedVector`, `VectorVerdict`, `BranchRefusal`, `DeclaredGap`, `DeclaredGapKind`, `ArtifactDiff` |
80
+ | Types: diagnostics | `SchemaCheck`, `SchemaDiagnostic`, `SchemaDiagnosticCode`, `LayoutShapeReason`, `TranslationGap`, `LayoutShapeContext`, `ExprDiagnostic`, `ExprDiagnosticCode` |
81
+ | Types: expressions | `CompileExprResult`, `ParseExprResult`, `PrintResult`, `PrintRefusal`, `DocumentPathParse` |
82
+ | Types: datasets | `DatasetSource`, `CsvDatasetDeclaration`, `CompiledDataset`, `CompiledDatasetDeclaration`, `DatasetCompileResult`, `DatasetDiagnostic`, `DatasetDiagnosticCode`, `DatasetInstallationResult`, `DatasetDiff`, `DatasetDiffResult`, `DeclarationNarrowing` |
83
+ | Types: scenario suites | `ScenarioSuiteDocument`, `ScenarioSuiteParse`, `Scenario`, `ScenarioAssertion`, `ScenarioEnvironment`, `DeclaredEnvironment`, `ScenarioSuiteReport`, `ScenarioResult`, `ResolvedAssertion`, `AssertionTarget`, `AssertionCredit`, `CoverageSubject`, `CreditRefusal`, `UnassertedObservation`, `ScenarioDiagnostic`, `ScenarioDiagnosticCode`, `RowFact`, `ScenarioSuiteOptions`, `CaptureOptions`, `CaptureResult`, `CaptureTarget`, `CapturedObservation`, `ScenarioCsvExport` |
84
+ | Types: layout | `RawLayoutNode`, `RawLayoutReadout` |
85
+
86
+ Revision classification also exports `revisionRequirements` and `mergeRevisionMigrations`, with the
87
+ `RevisionMigration` and `RevisionRequirements` types beside `ArtifactDiff`.
88
+
89
+ `CONTROLS_BY_PRIMITIVE` states which control hints each primitive admits; `LAYOUT_KINDS` is the
90
+ closed ten-kind layout grammar, `LAYOUT_MEMBERS` is every member a layout node may carry, and
91
+ `LAYOUT_TONES` is the callout emphasis vocabulary.
92
+
93
+ ## Testing surface (not a host API)
94
+
95
+ `@azx-pbc/axiom-compiler/testing` is the compiler's own door, consumed by this repository's drift
96
+ gates and counted budget tests. It carries the message-slot walk (`MESSAGE_SLOTS`, `MessageSlot`)
97
+ and the process-lifetime counter `metaschemaValidations`. It carries **no compatibility guarantee**,
98
+ and nothing on it is exported from `.`.
99
+
100
+ ```ts
101
+ import { MESSAGE_SLOTS } from '@azx-pbc/axiom-compiler/testing';
102
+ ```
103
+
104
+ `MESSAGE_SLOTS` is the compiler's own walk of the members that name a message, compared against the
105
+ metaschema by a drift gate; it is not a renderer's API, because a renderer reads the compiled
106
+ catalogue and a host reads the published model contract. `metaschemaValidations` states how many
107
+ times a dispatch validated an authored document, so a counted budget can assert one validation per
108
+ stage rather than assert a duration.
109
+
110
+ ## Layout structure
111
+
112
+ `readLayout` turns a validated document's `layout` into the raw wire tree, and
113
+ `layoutShapeErrors` is the one structural verdict over it: the ten-kind containment, C11's
114
+ `visibleWhen` placement, interactive-field uniqueness, `colSpan` fit, wizard placement, gate and
115
+ section-anchor resolution. It returns `LAYOUT_STRUCTURE` diagnostics — never a throw — at the
116
+ node's `$.layout...` path, and it is exported so an authoring store gives an editor the same
117
+ verdict a compile does. `layoutShapeContext(document)` reads the field ids, section anchors and gate
118
+ ids that walk answers against, and each diagnostic states its rule as a `LayoutShapeReason`, so an
119
+ editor branches on the refusal instead of reading the prose.
120
+
121
+ `closedShapeErrors(document)` is the closed metaschema's verdict on its own — the stage a compile
122
+ starts with, before any expression is read — and `missingTranslations(document)` is the
123
+ `(locales, messages)` completeness walk that the `MESSAGE_LOCALE` refusal is rendered from. Both are
124
+ exported so an authoring store refuses and lists exactly what a compile does instead of restating
125
+ the contract. `parseDocumentPath(path)` reads one rendered diagnostic `path` (`$.rules[0].expr`)
126
+ back into the steps it names — `$`, then `.name`, `[n]` and `["name"]` — and refuses a path that is
127
+ not one the renderer produced, at the offset it stopped at, rather than returning a prefix of it.
128
+ `inspectSchemaDocument(source)` (or `inspectYamlDocument(source)` for the YAML spelling) is that
129
+ same first stage on its own — ingestion, the curated member
130
+ checks and the closed metaschema, with the semantic walkers when the shape is admitted — and
131
+ `compileInspected(inspection)` finishes a compile from an accepted one without parsing or
132
+ validating the authored document again. The accepted arm is sealed and its parsed tree is frozen,
133
+ so continuation cannot compile a caller-forged inspection or a tree edited after its checks. Its
134
+ failing arm states the compile's diagnostics and, beside them, the closed-shape walk's own reasons
135
+ before a curated member check replaced one, so a caller that decides that stage ahead of the compile
136
+ reads the same walk instead of repeating it. An authoring store reads the inspection, runs the
137
+ layout walk between the two calls, and hands the result back, so one candidate validates its
138
+ document once.
139
+
140
+ `CompileOptions` accepts
141
+ `target` (`'server'` default, or `'client'`, which replaces every server-tier rule with a
142
+ `DEFERRED` stub) and `datasets` (the compiled declarations of the tables the document names).
143
+
144
+ `compileOverlay(base, overlays, options?)` composes one base document with an ordered list of
145
+ host-named overlays and compiles the result once (`[EVOL-4.1.1]`). Each overlay is
146
+ `{ overlayId, source }`: `source` is restricted JSON carrying the composable members of a schema
147
+ document, and `overlayId` names the layer in a refusal and in the version report. The order is
148
+ base, then `overlays[0]`, then `overlays[1]`, and so on; a later layer sees every declaration an
149
+ earlier one added because the composed document is compiled once.
150
+
151
+ A member composes or is refused rather than silently replacing the base. A new `fieldId` is
152
+ appended and an existing one is composed member by member: domain and identity members
153
+ (`primitive`, `currency`, `scale`, `items`, `rowKey`, `optionSource`, `covers`) must agree, an
154
+ option list may only add codes, and a safety bound may only tighten. A rule or table id may not be
155
+ redeclared. Messages, context roots and datasets merge by key and refuse a conflicting value;
156
+ layout is appended in order; `schemaId` must match and the overlay's own `schemaVersion` is
157
+ recorded, never merged. `removeFields` and `renameFields` are refused for any field an earlier
158
+ layer publishes — the compiler cannot see a host's retained signatures, so every published
159
+ `fieldId` is protected and a refusal names the signature that covers it when the document declares
160
+ one (`[EVOL-4.1.2]`, `[EVOL-3.1.2]`). An overlay may still hide a field with a `visible` rule.
161
+
162
+ A non-empty composition adds `composition: { baseVersion, overlays }` to the artifact, where
163
+ `overlays` is `{ overlayId, schemaVersion }` in application order. The runtime copies that member
164
+ into `EvaluationReport.composition`, so `behaviorHash` and `reportHash` cover the exact
165
+ configuration that produced a decision (`[EVOL-4.1.4]`). An empty overlay list returns exactly the
166
+ base artifact: no `composition` member is added, so its bytes and hashes are unchanged.
167
+
168
+ `classifyArtifactDiff(published, draft, behaviours?)` is the one revision classifier: it names
169
+ the rules and field declarations that were added, removed or changed by `ruleId` and `fieldId`,
170
+ and states `behaviorChanged` from `artifactBehaviour`. Supplied identities must be the exact
171
+ immutable values `artifactBehaviour` derived for those two artifacts; a mismatched or edited
172
+ identity throws rather than classifying against a false binding. Presentation — `layout`, message
173
+ text, a rule's
174
+ `testCases` — never reads as a behaviour change, and `axiom-cli diff` prints from this answer rather
175
+ than deriving a classification of its own. A nested member is named by its `fieldId`, because that
176
+ identity outlives the path a layout change moves it to (`EVOL-2.1.1`).
177
+
178
+ `revisionRequirements(before, after, transforms?)` states what one hop still asks of recorded values.
179
+ The optional hop-local transform map discharges `requires-upcaster` and `requires-mapping` for each
180
+ field it names; identity, archived-context and measurement requirements remain outstanding. The CLI
181
+ passes no transforms because a pair of documents carries no host migration catalogue.
182
+
183
+ ### Scenario suites
184
+
185
+ A scenario suite is a closed document (`spec/metaschema/scenarios.v1.json`) that states whole-form
186
+ cases: the record, the environment it is judged in, and the assertions its evaluation must satisfy.
187
+ `parseScenarioSuite(text)` reads one and returns `{ ok: true, suite }` or
188
+ `{ ok: false, diagnostics }` with a code, a path and a detail per refusal; it never evaluates
189
+ anything, so a malformed document fails before a rule runs.
190
+
191
+ `runScenarioSuite(compiled, suite, options?)` replays a suite against a compiled artifact. Each
192
+ scenario's assertions read one `evaluateForm` answer: the report, the access answer and the writer
193
+ overlay, and the derived form state and the submission projection read that same answer. A failed
194
+ scenario adds a separate `explain()` pass over the same record. The report binds every assertion to
195
+ the artifact's behaviour hash and the table versions the run resolved, and it carries no second copy
196
+ of the report it judged. `options.behaviour` may supply the exact immutable identity
197
+ `artifactBehaviour(compiled)` already derived; another artifact's identity throws before any case
198
+ runs. A
199
+ suite that names a rule, field, gate item or table the artifact does not declare is refused before
200
+ anything runs with `status: 'invalid'`; a failing assertion adds `explain()`'s trace to that
201
+ scenario.
202
+
203
+ Coverage credit (`coverageEligible`) goes only to a passing assertion the device evaluated and the
204
+ runner attributed to one rule: an explicit rule or gate-item observation, a computed value, or an
205
+ unambiguous field or row consequence. Every other pass — a firing nothing asserted, a rule that raised
206
+ `ENGINE_ERROR`, a `defaultCompute` whose value the record overrode, a field hidden by access rather
207
+ than by a rule, an item rule over no rows, a server rule the device deferred, or an ergonomic
208
+ expectation no one rule owns — names the reason it counts for nothing, so a publisher reads evidence
209
+ rather than a green run.
210
+
211
+ `captureScenario(compiled, input, env, { scenarioId, description?, targets })` writes a
212
+ one-scenario suite from a record that was actually evaluated. It takes no report argument: the
213
+ report is derived from the same triple the suite replays, so evidence minted here cannot belong to
214
+ an evaluation that did not happen. The targets are explicit. A capture is a recording, not a publish
215
+ claim: a target whose observation holds but earns no coverage credit is written down with the value
216
+ the run produced and reported in `observedOnly` with its `CreditRefusal` (a deferred rule, a
217
+ version-mismatched lookup, an overridden default), so the replay keeps the same decision and report
218
+ hash while the assertion counts for no branch. Only a target the artifact does not declare, one that
219
+ produced no result, or a suite that asserts nothing at all is refused.
220
+
221
+ #### Scenario matrices
222
+
223
+ `parseScenarioCsv(text, compiled)` reads the same cases from a flat spreadsheet matrix and returns
224
+ `{ ok: true, suite }` or `{ ok: false, diagnostics }` with a code, a path that names the CSV row and
225
+ column, and a detail. The artifact is an argument because a cell's primitive is the field's
226
+ declaration. The header families are locked: `caseId`, `tier`, `recordDate`, `value.<fieldId>`,
227
+ `context.<rootPath>`, `expect.rule.<ruleId>`, `expect.gate.<ruleId>.<itemId>`,
228
+ `expect.computed.<fieldId>` and `expect.hidden.<fieldId>`. An unknown, duplicate or
229
+ case-insensitively duplicate header, and a row that does not match the header width, are refused.
230
+
231
+ The cell grammar never coerces: an empty `value.`/`context.` cell is _absent_, an empty `expect.`
232
+ cell states no assertion, and an empty structural `caseId`, `tier` or `recordDate` cell is refused.
233
+ The exact text `null` is the wire null. A text value is a JSON string
234
+ literal, so `""`, `"null"` and `"001"` are three different strings; a boolean is `true` or `false`;
235
+ an integer, decimal, date and instant are their one canonical spelling (`1.50`, `01`, `-0`, `1e3`
236
+ and `+1` are refused). An expectation is tagged: `outcome:PASS|FAIL|UNKNOWN|DEFERRED`,
237
+ `screen:SCREEN_PASS|SCREEN_FAIL|SCREEN_REFER`, or `value:<typed cell>`; a gate item states an
238
+ outcome and a computed field a value, and `expect.hidden.<fieldId>` takes `true` to assert the field
239
+ hidden and `false` to assert it visible. A `value:` cell is a record writer's value: an item rule
240
+ writes one value per row, and a matrix states no rows, so that assertion is JSON-only. Every row states a unique `caseId` and at least one
241
+ assertion.
242
+
243
+ A matrix is bounded: 8 MiB of UTF-8 input, 1,000 data rows, 256 columns and 64 KiB per decoded
244
+ cell, each refused with `CSV_BOUNDS`. The dataset CSV reader applies the same four bounds — they are
245
+ the shared constants in `packages/compiler/src/csv/limits.ts`, not a second policy — and refuses a
246
+ table file that passes one with `CSV_BOUNDS`, naming the row, column or byte offset. The shapes a
247
+ grid cannot carry — a nested record, an array,
248
+ `money`, `media_ref`, `signature_ref`, `timeslot`, a redaction, a capability, an access overlay, a
249
+ table exposure, a row-key assertion and the expectation kinds with no column — are refused with the
250
+ JSON suite named as the alternative.
251
+
252
+ `exportScenarioCsv(suite, compiled)` writes the deterministic inverse: CRLF line endings, one fixed
253
+ family order, and a leading `'` on any raw cell a spreadsheet would read as a formula. When one row
254
+ states a client tier, the export states `server` explicitly on every other row; a record date only
255
+ some scenarios state has no lossless column and is refused. `parseScenarioCsv`
256
+ removes exactly that prefix from a raw numeric cell, so `-5` round-trips; a text value is a JSON
257
+ string literal, which a spreadsheet already reads as text, so its contents are never rewritten and
258
+ `=1+1` re-imports as the string `=1+1`. A suite carrying a fact the grid has no column for is
259
+ refused rather than written lossily, so `exportScenarioCsv` returns `{ ok: true, text }` or
260
+ `{ ok: false, diagnostics }`.
261
+
262
+ ## Errors and limits
263
+
264
+ A compile never throws for a bad document; it returns `{ ok: false, diagnostics }`. Each
265
+ `SchemaDiagnostic` carries `code`, `path` (for example `$.rules[0].expr`; `$` is the whole
266
+ document) and `detail`, plus, where they apply, `keyword`, `schemaPath`, `instancePath`, `offset`,
267
+ `suggestions`, `expected`, `messageKey` and `locale`. `parseExpr()` returns `{ ok: false,
268
+ diagnostics }` instead of throwing; `compileExpr()` likewise. `printExpr()` is the inverse of
269
+ `parseExpr()`: it returns the canonical source of a tree after re-parsing that source and comparing
270
+ the two structurally, so a successful print always reads back as the same AST, and a tree with no
271
+ source form returns `{ ok: false, reason, detail }` with `reason` drawn from the closed
272
+ `PrintRefusal` union rather than a lossy spelling. When the canonical spelling would overrun the
273
+ 4000-token source budget, the printer retries with the shortest spelling of each literal that reads
274
+ back as the same value (an untyped `1.5` for `decimal "1.5"`), and refuses as
275
+ `printed_budget_exceeded` only when no faithful spelling fits.
276
+
277
+ Schema codes: `JSON_INGEST_ERROR`, `YAML_INGEST_ERROR`, `SCHEMA_INVALID`, `DUPLICATE_IDENTIFIER`, `DUPLICATE_WRITER`,
278
+ `CYCLE_DETECTED`, `INVALID_ROW_KEY`, `INVALID_CONTROL`, `INVALID_RULE_SCOPE`, `SIGNATURE_COVERAGE`,
279
+ `INVALID_TEST_VALUE`, `UNRESOLVED_MESSAGE_KEY`, `MESSAGE_LOCALE`, `DATASET_DECLARATION_MISSING`,
280
+ `MESSAGE_COMPILE_ERROR`, `MESSAGE_BINDING`, `RULE_REFERENCE`, `PRIMARY_SELECTION`,
281
+ `LAYOUT_STRUCTURE`, and every
282
+ expression code.
283
+
284
+ `PRIMARY_SELECTION` is the one refusal for a section's designation: a document that declares a gate
285
+ and states no `primaryGateId`, or one whose `primaryGateId` names no declared gate, is refused at
286
+ `$.primaryGateId`, and the same holds for screens at `$.primaryScreenId`.
287
+
288
+ Expression codes: `EXPR_PARSE_ERROR`, `TYPE_MISMATCH`, `UNKNOWN_IDENTIFIER`, `MONEY_ARITHMETIC`,
289
+ `PATTERN_UNSUPPORTED`, `COST_BUDGET_EXCEEDED`, `TABLE_NOT_DECLARED`.
290
+
291
+ Print refusals: the closed `PrintRefusal` union `printExpr()` answers with. Each names a tree no
292
+ Expr v1 source spells, so the repair is to the tree, not to the printer:
293
+
294
+ - `root_comprehension` — a comprehension sits somewhere other than an aggregate's argument list,
295
+ the only position the grammar gives it a production in. Wrap it in the aggregate it belongs to.
296
+ - `singleton_connective` — an `and`, `or` or `??` node carries fewer than two operands, and the
297
+ grammar has no form below two. State both operands, or replace the node with its single operand.
298
+ - `unsupported_literal_domain` — a `media_ref`, `signature_ref`, `timeslot`, `record` or `array`
299
+ literal, none of which has a literal syntax. Such a value is a field's, not a rule's.
300
+ - `reserved_path_segment` — a path segment is one of the twelve reserved words, so the text would
301
+ read back as the keyword rather than as the path. Rename the field the segment came from.
302
+ - `printed_budget_exceeded` — no spelling of the tree that reads back as the same AST fits the
303
+ 4000-token source budget. A decimal is written `decimal "1.5"` (two tokens) except when the
304
+ printer has to fall back to the one-token `1.5`; a value with no fractional part cannot take the
305
+ shorter form, because `1` would be an integer. Split the expression into named intermediate rules
306
+ so each stays inside the budget.
307
+ - `self_check_failed` — the tree is outside the expression node or nesting budget, holds a value
308
+ its domain cannot carry (a non-canonical decimal, an impossible date, a lone surrogate, a
309
+ negative zero), has a malformed shape (a hole or missing operand list, an unknown node kind, a
310
+ binder with no name), or spells text the parser reads as a different tree. The `detail` names
311
+ which.
312
+
313
+ Limits, from the shipped source: one expression may carry at most 4000 source tokens, at most
314
+ 4000 abstract syntax tree nodes and at most 32 levels of nesting. Plural branches are checked
315
+ against the vendored Common Locale Data Repository (CLDR) category lists for the 225 locales the
316
+ runtime renders.
317
+
318
+ Readiness is a verdict about the artifact, not a reason to refuse it, and there is exactly one
319
+ rule behind it (`spec/semantics/rules-v1.md` `RULES-3.1.2`): every rule needs executed evidence of
320
+ one case on each branch its expression can reach. For a `validate`, `visible`, `required` or
321
+ `enabled` rule, an expression that folds to one constant leaves only one branch — `not false` and
322
+ `true and true` relax it exactly as a literal does — and a writer whose expression is constant can
323
+ never state its `UNKNOWN` case; every other rule still needs firing and non-firing evidence.
324
+ `UNKNOWN` is a writer's non-firing case and proves nothing for any other kind. `compile()` executes
325
+ nothing, so it states `declaredEvidence` instead of a verdict: `kind: 'declared'` and the `gaps` its
326
+ embedded `testCases` leave, with the same `kind`, `path` and `detail` a verification reports. There
327
+ is no `ready` member, because a case that has not run and a suite that was not supplied prove
328
+ nothing; a rule whose vectors are omitted or cover a single reachable branch shows a gap even when a
329
+ scenario suite would cover it.
330
+
331
+ `verifyPublishReadiness(compiled, { suites?, datasets?, environment? })` is the gate that runs the
332
+ evidence, and the only entry that states `ready`. It replays the embedded vectors and every supplied
333
+ `ScenarioSuiteDocument` against the artifact, under the declared baseline environment (tier, record
334
+ date, capabilities) with each case's own members winning, counts only a passing assertion the runner
335
+ credited (`coverageEligible`), and returns
336
+ `PublishReadiness` plus what it rests on: `behaviorHash`, `environment`, `environmentHash`,
337
+ `evidenceHash`, `datasetHashes`, `coverage`, `observedOnly`, and the `vectors`/`suites` a terminal
338
+ prints. A failed vector or assertion, a refused suite, a rule with no firing or no non-firing
339
+ evidence, a lookup that could not answer at the pinned version (`stale_dataset`), a device artifact
340
+ whose server rules are stubs (`client_artifact`) or suites that declare one environment twice
341
+ (`conflicting_environment`) is a `PublishGap` with its own `kind`, `path` and `detail`;
342
+ `observedOnly` carries what the run saw that grants no credit — an unasserted firing, a deferred,
343
+ overridden or undecided rule — as a hint, never as proof. No caller-supplied summary is a parameter:
344
+ nothing is evidence unless this call executed it. `publishReport` is the stored form of that answer,
345
+ without the transcript a terminal reads, and it is a proposal: no exported entry accepts a stored
346
+ report, so a gate re-runs this one rather than comparing the file.
347
+
348
+ The report commits the environment each decision was taken in. `environment` is the normalized
349
+ baseline `{ tier, recordDate?, capabilities? }` the run declared, `environmentHash` is its canonical
350
+ digest, and every `ScenarioResult` and executed `EmbeddedVector` states its own effective
351
+ environment after the case's `given`/case members overrode that baseline. `evidenceHash` folds the
352
+ baseline and every one of those effective environments in with the artifact's behaviour hash, the
353
+ pins and each case's verdict or assertion result, so two runs that differ only in a member no rule
354
+ read — a record date no table resolved against — are two decisions taken in two environments and
355
+ state different digests. It does not cover `ready`, `gaps`, `coverage` or `observedOnly`. `tier` always
356
+ has an effective value, and the door decides which one: local evaluation defaults to
357
+ `DEFAULT_EVALUATION_TIER` (`client`) and fails closed, while compilation, the vector/scenario
358
+ readers, the suite runner and this verifier default to `DEFAULT_EVIDENCE_TIER` (`server`)
359
+ (`RULES-3.1.2`): the compile door picks the artifact's target, and the readers, runner and verifier
360
+ execute the evidence it declares. Both constants live in
361
+ `@azx-pbc/axiom-runtime`; an explicit `tier` wins on either door. A stored report hands its
362
+ `environment` back to the replay's `environment` option, and an environment edited beside a stored
363
+ digest no longer matches it.
364
+
365
+ The CLI ships `axiom-cli check`, `compile`, `compile-dataset`, `test`, `diff` and `explain-deps`.
366
+ Every command that reports schema diagnostics (`check`, `compile`, `test`, `diff` and `explain-deps`)
367
+ accepts `--max-diagnostics=N|all` (default 200); `compile-dataset` does not. It exits `0` on
368
+ success, `1` when the document is invalid, the compile failed, a case failed or the schema is not
369
+ ready to publish, and `2` on a usage error, an unreadable file, bytes that are not valid UTF-8, or
370
+ a file that cannot be written.
371
+
372
+ `axiom-cli test <schema.json|schema.yaml>` executes the schema's embedded vectors. `--suite <file>` adds a scenario
373
+ suite — a JSON suite document, or a flat scenario matrix when the path ends in `.csv` — and may be
374
+ repeated; `--dataset` and `--declaration` supply the tables both read.
375
+ `--coverage=require` (the default) exits `1` on any gap, while `--coverage=report` prints the gaps
376
+ and exits `0` unless an executed assertion or the table binding failed. `--out <file>` writes the
377
+ publish report — `ready`, `gaps`, `coverage`, `observedOnly`, `behaviorHash`, `environment`,
378
+ `environmentHash`, `evidenceHash`, `datasetHashes` — as restricted-JCS canonical JSON, so two runs
379
+ that decided the same thing write the same bytes. Failed
380
+ vectors state one gap per rule and a suite with failed claims states one gap however many failed, so
381
+ the gaps stay bounded by the artifact's rules and the suites the run named; the per-claim detail is
382
+ the capped terminal output and the `vectors`/`suites` transcript `verifyPublishReadiness` returns. `--out -` writes that
383
+ report to stdout and moves the human lines to stderr; a stream is a terminal, so the code points a
384
+ terminal acts on reach it as their JSON escapes rather than as the bytes a file holds. The stored
385
+ report is an unauthenticated proposal: nothing verifies its author, so a gate re-derives the verdict
386
+ by running the gate again over the artifact it serves instead of comparing the file. `axiom-cli test`
387
+ compiles its input for the server tier and cannot be handed a device artifact; one that reaches
388
+ `verifyPublishReadiness` is refused with `client_artifact` before any case runs.
389
+
390
+ `axiom-cli diff` labels what it compares as **declared evidence** and **declared vectors**: two compiled
391
+ documents, neither of which executed a rule. It never prints a publish verdict. It does print the
392
+ migration a revision needs of the values recorded under the one it replaces — one `requires-…` line
393
+ per kind, naming the field ids, context roots or tables — and the declarations whose row scope the
394
+ revision changes (`unpairable rows`), from the same `revisionRequirements` the builder's revision
395
+ diff reads. A summary that named only the declarations that moved would leave a publisher to
396
+ discover the transformation it must write, or the value it has to place again.
397
+
398
+ ## Environment
399
+
400
+ The library entry is safe in a browser preview and in a build step: no filesystem, clock or
401
+ `Intl`. Node built-ins appear only in the CLI (`src/cli.ts` and `src/cli/`), which requires Node `>=24`. The
402
+ package carries the same vendored CLDR registry as the runtime, so a plural branch is checked
403
+ against the categories that will actually select it.
404
+
405
+ Its runtime dependencies are `@azx-pbc/axiom-runtime`, `@cfworker/json-schema` (MIT, closed
406
+ metaschema validation), `@messageformat/parser` (MIT, ICU MF1 parsing), `yaml` (ISC, YAML authoring
407
+ front door), `papaparse` (MIT, zero transitive dependencies, RFC 4180 CSV parsing for dataset tables
408
+ and scenario matrices), and `leven` (MIT, zero transitive dependencies, bounded edit-distance
409
+ suggestions for unknown identifiers).
410
+
411
+ ## Links
412
+
413
+ - [Root README](https://github.com/AZX-PBC-OSS/axiom/blob/main/README.md)
414
+ - [Model semantics](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/model-v1.md), [expression semantics](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/expr-v1.md), [dataset semantics](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/datasets-v1.md)
415
+ - [Expression guide](https://github.com/AZX-PBC-OSS/axiom/blob/main/docs/expr/guide.md), [cookbook](https://github.com/AZX-PBC-OSS/axiom/blob/main/docs/expr/cookbook.md), [diagnostics catalogue](https://github.com/AZX-PBC-OSS/axiom/blob/main/docs/expr/diagnostics.md)
416
+ - [Node example](https://github.com/AZX-PBC-OSS/axiom/tree/main/examples/engine-node) — compile, evaluate and hash one corpus record
@@ -0,0 +1,12 @@
1
+ /**
2
+ * English indefinite-article helpers for compiler diagnostics.
3
+ *
4
+ * Primitives and static type names are interpolated into prose sentences across schema and
5
+ * expression checks; routing them through one helper keeps every refusal grammatical ("an array",
6
+ * "an integer", "an instant") instead of emitting "a array" or "a integer".
7
+ */
8
+ /** The indefinite article (`"a"` or `"an"`) for a primitive or type name. */
9
+ export declare function indefiniteArticle(noun: string | undefined): 'a' | 'an';
10
+ /** A primitive or type name prefixed with its indefinite article, e.g. `"an integer"`. */
11
+ export declare function withArticle(noun: string): string;
12
+ //# sourceMappingURL=article.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"article.d.ts","sourceRoot":"","sources":["../src/article.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,IAAI,CAEtE;AAED,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * English indefinite-article helpers for compiler diagnostics.
3
+ *
4
+ * Primitives and static type names are interpolated into prose sentences across schema and
5
+ * expression checks; routing them through one helper keeps every refusal grammatical ("an array",
6
+ * "an integer", "an instant") instead of emitting "a array" or "a integer".
7
+ */
8
+ /** The indefinite article (`"a"` or `"an"`) for a primitive or type name. */
9
+ export function indefiniteArticle(noun) {
10
+ return noun !== undefined && /^[aeiou]/iu.test(noun) ? 'an' : 'a';
11
+ }
12
+ /** A primitive or type name prefixed with its indefinite article, e.g. `"an integer"`. */
13
+ export function withArticle(noun) {
14
+ return `${indefiniteArticle(noun)} ${noun}`;
15
+ }
16
+ //# sourceMappingURL=article.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"article.js","sourceRoot":"","sources":["../src/article.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,6EAA6E;AAC7E,MAAM,UAAU,iBAAiB,CAAC,IAAwB;IACxD,OAAO,IAAI,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AACpE,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * English indefinite-article helpers for compiler diagnostics.\n *\n * Primitives and static type names are interpolated into prose sentences across schema and\n * expression checks; routing them through one helper keeps every refusal grammatical (\"an array\",\n * \"an integer\", \"an instant\") instead of emitting \"a array\" or \"a integer\".\n */\n\n/** The indefinite article (`\"a\"` or `\"an\"`) for a primitive or type name. */\nexport function indefiniteArticle(noun: string | undefined): 'a' | 'an' {\n return noun !== undefined && /^[aeiou]/iu.test(noun) ? 'an' : 'a';\n}\n\n/** A primitive or type name prefixed with its indefinite article, e.g. `\"an integer\"`. */\nexport function withArticle(noun: string): string {\n return `${indefiniteArticle(noun)} ${noun}`;\n}\n"]}
@@ -0,0 +1,101 @@
1
+ import type { Tier } from '@azx-pbc/axiom-runtime';
2
+ /** The declaration shape every option in this program shares. */
3
+ export type OptionDescriptors = {
4
+ readonly [option: string]: {
5
+ readonly type: 'string' | 'boolean';
6
+ readonly multiple?: boolean | undefined;
7
+ readonly short?: string | undefined;
8
+ };
9
+ };
10
+ /**
11
+ * The parse knobs every command shares. `tokens` is literal `true` so `parseArgs` types the
12
+ * result with its token list, which is what refuses a repeated scalar.
13
+ */
14
+ export declare const COMMAND_PARSE: {
15
+ readonly allowPositionals: true;
16
+ readonly strict: true;
17
+ readonly tokens: true;
18
+ };
19
+ /** Declared by every command, so `--help` and `-h` never reach a document read. */
20
+ export declare const HELP_OPTION: {
21
+ readonly help: {
22
+ readonly type: 'boolean';
23
+ readonly short: 'h';
24
+ };
25
+ };
26
+ /**
27
+ * The dataset options every schema command accepts, since `compile()` checks their tables.
28
+ * Both accumulate: a schema may name several tables, and each CSV source carries its own
29
+ * declaration.
30
+ */
31
+ export declare const DATASET_OPTIONS: {
32
+ readonly dataset: {
33
+ readonly type: 'string';
34
+ readonly multiple: true;
35
+ };
36
+ readonly declaration: {
37
+ readonly type: 'string';
38
+ readonly multiple: true;
39
+ };
40
+ };
41
+ /**
42
+ * How a command bounds the diagnostics it prints: a count, or every one of them.
43
+ * The cap is a display bound only — the compile it reports stays exhaustive.
44
+ */
45
+ export type DiagnosticCap = number | 'all';
46
+ /**
47
+ * The `--max-diagnostics` option, on every command that reports schema diagnostics.
48
+ */
49
+ export declare const MAX_DIAGNOSTICS_OPTION: {
50
+ readonly 'max-diagnostics': {
51
+ readonly type: 'string';
52
+ };
53
+ };
54
+ /** The part of one parsed token this program reads: an option's canonical name. */
55
+ interface OptionTokenView {
56
+ readonly kind: string;
57
+ readonly name?: string | undefined;
58
+ }
59
+ /** The part of a parse result the help and duplicate checks read. */
60
+ export interface ParsedPrelude {
61
+ readonly values: {
62
+ readonly help?: boolean | undefined;
63
+ };
64
+ readonly tokens: readonly OptionTokenView[];
65
+ }
66
+ /**
67
+ * Runs `parse`, writing the usage line and the parser's reason instead of throwing.
68
+ *
69
+ * The accepted-option list is appended to `parseArgs`'s unknown-option refusal, because the
70
+ * usage line above it is the only other place the set appears and an operator who mistyped a
71
+ * flag is reading the error line.
72
+ */
73
+ export declare function parsedOrUsage<T>(parse: () => T, usage: string, options: OptionDescriptors): T | undefined;
74
+ /** Writes one usage refusal and returns the code every usage refusal shares. */
75
+ export declare function refuseUsage(usage: string, detail?: string): number;
76
+ /**
77
+ * The two checks every command runs before it reads anything: whether the invocation asked
78
+ * for help, and whether a scalar option was repeated. Returns the exit code to stop with, or
79
+ * `undefined` to continue.
80
+ */
81
+ export declare function handleUniversalOptions(parsed: ParsedPrelude, options: OptionDescriptors, usage: string): number | undefined;
82
+ /**
83
+ * Reads the diagnostic cap the operator named, or refuses the invocation.
84
+ *
85
+ * A cap that is not a positive integer or `all` is a usage error, because silently
86
+ * falling back to the default would print a different report than the one asked for.
87
+ */
88
+ export declare function readDiagnosticCap(value: string | undefined, usage: string): DiagnosticCap | undefined;
89
+ /** The tier an authored schema is compiled for. */
90
+ export declare function readTarget(value: string | undefined, usage: string): Tier | undefined;
91
+ /**
92
+ * How `test` treats a publish gap: refuse the run, or report the gap and refuse only the claims
93
+ * the run executed and that did not hold.
94
+ */
95
+ export type CoverageMode = 'require' | 'report';
96
+ /** Reads the coverage mode the operator named, or refuses the invocation by name and value set. */
97
+ export declare function readCoverage(value: string | undefined, usage: string): CoverageMode | undefined;
98
+ /** The one document a single-document command reads, or a refusal naming what it accepts. */
99
+ export declare function singlePositional(positionals: readonly string[], usage: string): string | undefined;
100
+ export {};
101
+ //# sourceMappingURL=args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAInD,iEAAiE;AACjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG;QACzB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;QACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACrC,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa;aACxB,gBAAgB;aAChB,MAAM;aACN,MAAM;CACE,CAAC;AAEX,mFAAmF;AACnF,eAAO,MAAM,WAAW;aACtB,IAAI;iBAAI,IAAI,EAAE,SAAS;iBAAE,KAAK,EAAE,GAAG;;CAC3B,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,eAAe;aAC1B,OAAO;iBAAI,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;aACnC,WAAW;iBAAI,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;CAC/B,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,CAAC;AAI3C;;GAEG;AACH,eAAO,MAAM,sBAAsB;aACjC,iBAAiB;iBAAI,IAAI,EAAE,QAAQ;;CAC3B,CAAC;AAEX,mFAAmF;AACnF,UAAU,eAAe;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAI5B,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAC;IACzD,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;CAC7C;AASD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,MAAM,CAAC,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,GACzB,CAAC,GAAG,SAAS,CAYf;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAIlE;AAuBD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAOpB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,GACZ,aAAa,GAAG,SAAS,CAQ3B;AAED,mDAAmD;AACnD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAQrF;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhD,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAK/F;AAED,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAcpB"}