@azx-pbc/axiom-compiler 0.0.0-stage → 0.0.6

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
@@ -0,0 +1,186 @@
1
+ import { isRecord } from '@azx-pbc/axiom-runtime';
2
+ import { ingestJsonDocument } from '../ingest/document.js';
3
+ import { localeDiagnostics, unresolvedMessageKeys } from './catalogue.js';
4
+ import { closedShapeErrors } from './closed.js';
5
+ import { declarationDiagnostics, memberAdmissibilityDiagnostics } from './declarations.js';
6
+ import { acceptInspection, distinctDiagnostics } from './diagnostic.js';
7
+ import { fieldDiagnostics } from './fields.js';
8
+ import { gateDiagnostics } from './gates.js';
9
+ import { metaschemaErrors, validatorDiagnostic } from './metaschema.js';
10
+ import { screenDiagnostics } from './screens.js';
11
+ import { testValueDiagnostics } from './test-values.js';
12
+ export { declaredFields, documentContextRoot, documentField } from './document.js';
13
+ /**
14
+ * Ingests and checks one JSON document. Ingestion runs first and refuses a duplicate member
15
+ * name before any validator sees the tree: `JSON.parse` would keep the last member and silently
16
+ * drop the conflict. YAML authors reach the same walk through `inspectYamlDocument` in
17
+ * `validate-yaml.ts`.
18
+ */
19
+ export function inspectSchemaDocument(source) {
20
+ return inspectIngested(ingestJsonDocument(source));
21
+ }
22
+ /**
23
+ * The walk both front doors share once their reader has produced a plain value or the
24
+ * diagnostics that refused it. Keeping it here lets `validate-yaml.ts` reach the same walk
25
+ * without this module importing the YAML reader.
26
+ */
27
+ export function inspectIngested(ingested) {
28
+ if (!ingested.ok) {
29
+ return {
30
+ ok: false,
31
+ diagnostics: ingested.diagnostics,
32
+ // Ingestion stopped before the walk, so it answers for no closed-shape reason.
33
+ closedShape: [],
34
+ };
35
+ }
36
+ return inspectParsedDocument(ingested.value);
37
+ }
38
+ /**
39
+ * Runs the document checks over a tree that has already passed an ingestion boundary.
40
+ *
41
+ * This is the stage both front doors share: the curated member checks run before the metaschema
42
+ * so the author gets the cause and the repair rather than the `allOf`/`not` clause that restates
43
+ * it, and every semantic walker then relates one declaration to another. A caller that presents
44
+ * a tree directly is responsible for the profile; the compiler's own callers hand it the value
45
+ * `ingestDocument` produced.
46
+ */
47
+ function inspectParsedDocument(document) {
48
+ // The curated member checks run before the metaschema so the author gets the cause and the
49
+ // repair rather than the `allOf`/`not` clause that restates it; the clause stays as the
50
+ // backstop for anything this pass does not cover.
51
+ const curated = memberAdmissibilityDiagnostics(document);
52
+ // The closed-shape stage is `closed.ts`'s one rendering of the walk, not a copy of it here:
53
+ // a caller that needs that stage alone (a host-loaded draft) and the compile read one answer.
54
+ const closedShape = closedShapeErrors(document);
55
+ if (closedShape.length > 0) {
56
+ return {
57
+ ok: false,
58
+ diagnostics: distinctDiagnostics([
59
+ ...curated.map((entry) => entry.diagnostic),
60
+ ...closedShape.filter((diagnostic) => !supersededByCurated(diagnostic, curated)),
61
+ ]),
62
+ closedShape,
63
+ };
64
+ }
65
+ // The metaschema guarantees an object with `schemaId`, `schemaVersion` and `fields`, so
66
+ // the semantic walkers may read it structurally from here on.
67
+ if (!isRecord(document)) {
68
+ throw new Error('the metaschema accepted a document that is not an object');
69
+ }
70
+ const record = document;
71
+ const diagnostics = distinctDiagnostics([
72
+ ...curated.map((entry) => entry.diagnostic),
73
+ ...declarationDiagnostics(record),
74
+ ...fieldDiagnostics(record),
75
+ ...localeDiagnostics(record),
76
+ ...gateDiagnostics(record),
77
+ ...screenDiagnostics(record),
78
+ ...unresolvedMessageKeys(record),
79
+ ...testValueDiagnostics(record),
80
+ ]);
81
+ if (diagnostics.length > 0)
82
+ return { ok: false, diagnostics, closedShape: [] };
83
+ // Continuation trusts this exact tree to be the one every first-stage check read. Freezing it
84
+ // keeps a caller from editing a declaration after the check and compiling the edit unvalidated.
85
+ freezeInspectedDocument(document);
86
+ return acceptInspection(document);
87
+ }
88
+ /**
89
+ * The `allOf` clause index one metaschema refusal belongs to, when it names one. The numeric
90
+ * step is read as text by the pointer walk, so it is narrowed back to a number here.
91
+ */
92
+ function clauseOf(schemaPath) {
93
+ if (schemaPath === undefined)
94
+ return undefined;
95
+ const at = schemaPath.indexOf('allOf');
96
+ if (at < 0)
97
+ return undefined;
98
+ const clause = schemaPath[at + 1];
99
+ if (typeof clause === 'number')
100
+ return clause;
101
+ return typeof clause === 'string' && /^\d+$/.test(clause) ? Number(clause) : undefined;
102
+ }
103
+ /** Whether two instance paths name the same location. */
104
+ function samePath(left, right) {
105
+ return (left !== undefined &&
106
+ right !== undefined &&
107
+ left.length === right.length &&
108
+ left.every((step, index) => right[index] === step));
109
+ }
110
+ /** Whether `prefix` is the same location as, or an ancestor of, `at`. */
111
+ function pathPrefix(prefix, at) {
112
+ return prefix.length <= at.length && prefix.every((step, index) => step === at[index]);
113
+ }
114
+ /**
115
+ * Whether a generic metaschema refusal is the `allOf`/`not` clause a curated member refusal
116
+ * already states with its cause and repair. Only that cause is replaced: every other reason
117
+ * the document has, including another mistake on the same declaration, is still reported.
118
+ *
119
+ * A curated refusal also supersedes a metaschema reason at the same instance path, whether or
120
+ * not the clause names them both. That second test is what keeps one member mistake from being
121
+ * reported twice: the curated pass names the member, and the metaschema clause that restates it
122
+ * — a `properties` member set to `false` reports no `allOf` index at all — would otherwise add a
123
+ * second line about the same member.
124
+ */
125
+ function supersededByCurated(diagnostic, curated) {
126
+ const clause = clauseOf(diagnostic.schemaPath);
127
+ const instancePath = diagnostic.instancePath;
128
+ if (instancePath === undefined)
129
+ return false;
130
+ return curated.some((entry) => (clause !== undefined &&
131
+ entry.supersededClauses.includes(clause) &&
132
+ pathPrefix(entry.owner, instancePath)) ||
133
+ // Some curated refusals replace an `allOf`/`else: { properties: { member: false } }`
134
+ // clause, whose generic diagnostic names the member without an `allOf` index. The
135
+ // curated refusal already states that exact member with its cause and repair, so the
136
+ // generic line would only repeat it.
137
+ samePath(entry.diagnostic.instancePath, instancePath));
138
+ }
139
+ /** Freezes the plain JSON tree whose validation an accepted inspection proves. */
140
+ function freezeInspectedDocument(document) {
141
+ if (Array.isArray(document)) {
142
+ for (const item of document)
143
+ freezeInspectedDocument(item);
144
+ Object.freeze(document);
145
+ return;
146
+ }
147
+ if (!isRecord(document))
148
+ return;
149
+ for (const member of Object.values(document))
150
+ freezeInspectedDocument(member);
151
+ Object.freeze(document);
152
+ }
153
+ /**
154
+ * Validates an already-assembled tree against the closed metaschema, without the semantic
155
+ * walkers `inspectSchemaDocument` runs on authored text.
156
+ *
157
+ * This covers the members the document contract owns. The compiler's emission gate is
158
+ * `validateCompiledArtifact` in `compile/artifact-members`, which runs this check over that
159
+ * projection and holds the artifact-only members to their own list, so a compiler bug cannot
160
+ * ship an artifact the runtime's contract does not admit.
161
+ */
162
+ export function validateCompiledDocument(document) {
163
+ const errors = metaschemaErrors(document);
164
+ if (errors.length > 0) {
165
+ return distinctDiagnostics(errors.map((error) => validatorDiagnostic(error, document)));
166
+ }
167
+ // The metaschema cannot express `defaultLocale ∈ locales` or a per-message equality over a
168
+ // catalogue, so the emission is held to the same walker the authored document is: a compiler
169
+ // bug must not ship an artifact whose locale set and catalogue disagree. The primary
170
+ // designation is checked the same way, so an emitted artifact never names a gate or a screen
171
+ // it does not declare.
172
+ if (!isRecord(document))
173
+ return [];
174
+ return [
175
+ ...localeDiagnostics(document),
176
+ ...gateDiagnostics(document),
177
+ ...screenDiagnostics(document),
178
+ ];
179
+ }
180
+ /**
181
+ * The document-level walkers below are one stage of `compile()`, not a verdict of their own:
182
+ * `compile()` runs them and then the language, the cross-checks and the artifact emission.
183
+ * The public verdict is `checkSchema` in `schema/check.ts`, which runs that whole compile, so
184
+ * this module must not grow a second, weaker answer that an editor could mistake for it.
185
+ */
186
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/schema/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO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G,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1F,CAAC;IACD,2FAA2F;IAC3F,6FAA6F;IAC7F,qFAAqF;IACrF,6FAA6F;IAC7F,uBAAuB;IACvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO;QACL,GAAG,iBAAiB,CAAC,QAAQ,CAAC;QAC9B,GAAG,eAAe,CAAC,QAAQ,CAAC;QAC5B,GAAG,iBAAiB,CAAC,QAAQ,CAAC;KAC/B,CAAC;AACJ,CAAC;AAED;;;;;GAKG","sourcesContent":["import { isRecord } from '@azx-pbc/axiom-runtime';\nimport { ingestJsonDocument } from '../ingest/document.js';\nimport type { IngestedDocument } from '../ingest/document.js';\nimport { localeDiagnostics, unresolvedMessageKeys } from './catalogue.js';\nimport { closedShapeErrors } from './closed.js';\nimport { declarationDiagnostics, memberAdmissibilityDiagnostics } from './declarations.js';\nimport type { MemberAdmissibilityDiagnostic } from './declarations.js';\nimport { acceptInspection, distinctDiagnostics } from './diagnostic.js';\nimport type { Inspection, SchemaDiagnostic } from './diagnostic.js';\nimport { fieldDiagnostics } from './fields.js';\nimport { gateDiagnostics } from './gates.js';\nimport { metaschemaErrors, validatorDiagnostic } from './metaschema.js';\nimport { screenDiagnostics } from './screens.js';\nimport { testValueDiagnostics } from './test-values.js';\n\n/**\n * The compiler's document checks: closed metaschema validation, plus the semantic rules\n * `spec/semantics/{model,context,rules}-v1.md` require the compiler to enforce where no\n * JSON Schema keyword can express them, because they relate one declaration to another.\n *\n * Nothing here touches Node, the filesystem or the clock, so the same code runs in a\n * browser preview, in `axiom-cli check`, and in a build step that compiles an artifact.\n *\n * This entry runs ingestion, the metaschema walk and the semantic passes; the diagnostic\n * shape is `schema/diagnostic`, the metaschema walk `schema/metaschema`, declaration\n * narrowing `schema/document`, and each semantic pass its own module beside this one.\n */\n\nexport type {\n Inspection,\n SchemaCheck,\n SchemaDiagnostic,\n SchemaDiagnosticCode,\n} from './diagnostic.js';\nexport { declaredFields, documentContextRoot, documentField } from './document.js';\n\n/**\n * Ingests and checks one JSON document. Ingestion runs first and refuses a duplicate member\n * name before any validator sees the tree: `JSON.parse` would keep the last member and silently\n * drop the conflict. YAML authors reach the same walk through `inspectYamlDocument` in\n * `validate-yaml.ts`.\n */\nexport function inspectSchemaDocument(source: string): Inspection {\n return inspectIngested(ingestJsonDocument(source));\n}\n\n/**\n * The walk both front doors share once their reader has produced a plain value or the\n * diagnostics that refused it. Keeping it here lets `validate-yaml.ts` reach the same walk\n * without this module importing the YAML reader.\n */\nexport function inspectIngested(ingested: IngestedDocument): Inspection {\n if (!ingested.ok) {\n return {\n ok: false,\n diagnostics: ingested.diagnostics,\n // Ingestion stopped before the walk, so it answers for no closed-shape reason.\n closedShape: [],\n };\n }\n return inspectParsedDocument(ingested.value);\n}\n\n/**\n * Runs the document checks over a tree that has already passed an ingestion boundary.\n *\n * This is the stage both front doors share: the curated member checks run before the metaschema\n * so the author gets the cause and the repair rather than the `allOf`/`not` clause that restates\n * it, and every semantic walker then relates one declaration to another. A caller that presents\n * a tree directly is responsible for the profile; the compiler's own callers hand it the value\n * `ingestDocument` produced.\n */\nfunction inspectParsedDocument(document: unknown): Inspection {\n // The curated member checks run before the metaschema so the author gets the cause and the\n // repair rather than the `allOf`/`not` clause that restates it; the clause stays as the\n // backstop for anything this pass does not cover.\n const curated = memberAdmissibilityDiagnostics(document);\n // The closed-shape stage is `closed.ts`'s one rendering of the walk, not a copy of it here:\n // a caller that needs that stage alone (a host-loaded draft) and the compile read one answer.\n const closedShape = closedShapeErrors(document);\n if (closedShape.length > 0) {\n return {\n ok: false,\n diagnostics: distinctDiagnostics([\n ...curated.map((entry) => entry.diagnostic),\n ...closedShape.filter((diagnostic) => !supersededByCurated(diagnostic, curated)),\n ]),\n closedShape,\n };\n }\n // The metaschema guarantees an object with `schemaId`, `schemaVersion` and `fields`, so\n // the semantic walkers may read it structurally from here on.\n if (!isRecord(document)) {\n throw new Error('the metaschema accepted a document that is not an object');\n }\n const record = document;\n const diagnostics = distinctDiagnostics([\n ...curated.map((entry) => entry.diagnostic),\n ...declarationDiagnostics(record),\n ...fieldDiagnostics(record),\n ...localeDiagnostics(record),\n ...gateDiagnostics(record),\n ...screenDiagnostics(record),\n ...unresolvedMessageKeys(record),\n ...testValueDiagnostics(record),\n ]);\n if (diagnostics.length > 0) return { ok: false, diagnostics, closedShape: [] };\n // Continuation trusts this exact tree to be the one every first-stage check read. Freezing it\n // keeps a caller from editing a declaration after the check and compiling the edit unvalidated.\n freezeInspectedDocument(document);\n return acceptInspection(document);\n}\n\n/**\n * The `allOf` clause index one metaschema refusal belongs to, when it names one. The numeric\n * step is read as text by the pointer walk, so it is narrowed back to a number here.\n */\nfunction clauseOf(schemaPath: readonly (string | number)[] | undefined): number | undefined {\n if (schemaPath === undefined) return undefined;\n const at = schemaPath.indexOf('allOf');\n if (at < 0) return undefined;\n const clause = schemaPath[at + 1];\n if (typeof clause === 'number') return clause;\n return typeof clause === 'string' && /^\\d+$/.test(clause) ? Number(clause) : undefined;\n}\n\n/** Whether two instance paths name the same location. */\nfunction samePath(\n left: readonly (string | number)[] | undefined,\n right: readonly (string | number)[] | undefined,\n): boolean {\n return (\n left !== undefined &&\n right !== undefined &&\n left.length === right.length &&\n left.every((step, index) => right[index] === step)\n );\n}\n\n/** Whether `prefix` is the same location as, or an ancestor of, `at`. */\nfunction pathPrefix(\n prefix: readonly (string | number)[],\n at: readonly (string | number)[],\n): boolean {\n return prefix.length <= at.length && prefix.every((step, index) => step === at[index]);\n}\n\n/**\n * Whether a generic metaschema refusal is the `allOf`/`not` clause a curated member refusal\n * already states with its cause and repair. Only that cause is replaced: every other reason\n * the document has, including another mistake on the same declaration, is still reported.\n *\n * A curated refusal also supersedes a metaschema reason at the same instance path, whether or\n * not the clause names them both. That second test is what keeps one member mistake from being\n * reported twice: the curated pass names the member, and the metaschema clause that restates it\n * — a `properties` member set to `false` reports no `allOf` index at all — would otherwise add a\n * second line about the same member.\n */\nfunction supersededByCurated(\n diagnostic: SchemaDiagnostic,\n curated: readonly MemberAdmissibilityDiagnostic[],\n): boolean {\n const clause = clauseOf(diagnostic.schemaPath);\n const instancePath = diagnostic.instancePath;\n if (instancePath === undefined) return false;\n return curated.some(\n (entry) =>\n (clause !== undefined &&\n entry.supersededClauses.includes(clause) &&\n pathPrefix(entry.owner, instancePath)) ||\n // Some curated refusals replace an `allOf`/`else: { properties: { member: false } }`\n // clause, whose generic diagnostic names the member without an `allOf` index. The\n // curated refusal already states that exact member with its cause and repair, so the\n // generic line would only repeat it.\n samePath(entry.diagnostic.instancePath, instancePath),\n );\n}\n\n/** Freezes the plain JSON tree whose validation an accepted inspection proves. */\nfunction freezeInspectedDocument(document: unknown): void {\n if (Array.isArray(document)) {\n for (const item of document) freezeInspectedDocument(item);\n Object.freeze(document);\n return;\n }\n if (!isRecord(document)) return;\n for (const member of Object.values(document)) freezeInspectedDocument(member);\n Object.freeze(document);\n}\n\n/**\n * Validates an already-assembled tree against the closed metaschema, without the semantic\n * walkers `inspectSchemaDocument` runs on authored text.\n *\n * This covers the members the document contract owns. The compiler's emission gate is\n * `validateCompiledArtifact` in `compile/artifact-members`, which runs this check over that\n * projection and holds the artifact-only members to their own list, so a compiler bug cannot\n * ship an artifact the runtime's contract does not admit.\n */\nexport function validateCompiledDocument(document: unknown): readonly SchemaDiagnostic[] {\n const errors = metaschemaErrors(document);\n if (errors.length > 0) {\n return distinctDiagnostics(errors.map((error) => validatorDiagnostic(error, document)));\n }\n // The metaschema cannot express `defaultLocale ∈ locales` or a per-message equality over a\n // catalogue, so the emission is held to the same walker the authored document is: a compiler\n // bug must not ship an artifact whose locale set and catalogue disagree. The primary\n // designation is checked the same way, so an emitted artifact never names a gate or a screen\n // it does not declare.\n if (!isRecord(document)) return [];\n return [\n ...localeDiagnostics(document),\n ...gateDiagnostics(document),\n ...screenDiagnostics(document),\n ];\n}\n\n/**\n * The document-level walkers below are one stage of `compile()`, not a verdict of their own:\n * `compile()` runs them and then the language, the cross-checks and the artifact emission.\n * The public verdict is `checkSchema` in `schema/check.ts`, which runs that whole compile, so\n * this module must not grow a second, weaker answer that an editor could mistake for it.\n */\n"]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `@azx-pbc/axiom-compiler/testing` — the repository's own walk and measurement surface.
3
+ *
4
+ * **Not a host API.** Nothing here carries a compatibility guarantee: `MESSAGE_SLOTS` is the
5
+ * compiler's own walk of the document members that name a message, compared against the
6
+ * metaschema by a drift gate; `declarationDiagnostics` is the declaration walk a counted budget
7
+ * calls; and `metaschemaValidations` and `writerComparisons` are process-lifetime counters those
8
+ * budgets read. All are consumed by this repository's gates and benches, and none is exported from
9
+ * `.`: a published name here would be a semver obligation with no consumer.
10
+ *
11
+ * The names are pinned by `test/package-entry-surface.test.ts`, so a name added or removed here
12
+ * fails that test until the list is updated.
13
+ */
14
+ export { MESSAGE_SLOTS } from './messages/slots.js';
15
+ export type { MessageSlot } from './messages/slots.js';
16
+ export { metaschemaValidations } from './schema/measurement.js';
17
+ export { writerComparisons } from './schema/measurement.js';
18
+ export { declarationDiagnostics } from './schema/declarations.js';
19
+ export { builtinArity } from './expr/typecheck/arity.js';
20
+ export type { Arity } from './expr/typecheck/arity.js';
21
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `@azx-pbc/axiom-compiler/testing` — the repository's own walk and measurement surface.
3
+ *
4
+ * **Not a host API.** Nothing here carries a compatibility guarantee: `MESSAGE_SLOTS` is the
5
+ * compiler's own walk of the document members that name a message, compared against the
6
+ * metaschema by a drift gate; `declarationDiagnostics` is the declaration walk a counted budget
7
+ * calls; and `metaschemaValidations` and `writerComparisons` are process-lifetime counters those
8
+ * budgets read. All are consumed by this repository's gates and benches, and none is exported from
9
+ * `.`: a published name here would be a semver obligation with no consumer.
10
+ *
11
+ * The names are pinned by `test/package-entry-surface.test.ts`, so a name added or removed here
12
+ * fails that test until the list is updated.
13
+ */
14
+ export { MESSAGE_SLOTS } from './messages/slots.js';
15
+ // The metaschema validations this process performed, so a counted budget can state that a
16
+ // dispatch validates its authored document once rather than once per stage.
17
+ export { metaschemaValidations } from './schema/measurement.js';
18
+ // The writer visits the duplicate-writer check made, so a counted budget can state the check is
19
+ // linear in the writers rather than the writers squared.
20
+ export { writerComparisons } from './schema/measurement.js';
21
+ // The declaration walk itself, so a counted budget calls the same built module the counter lives
22
+ // in. Importing the walk from `src` beside a `dist` counter reads two module instances and the
23
+ // count stays zero.
24
+ export { declarationDiagnostics } from './schema/declarations.js';
25
+ // The built-in arity table, so the frozen-grammar gate compares a published production with the
26
+ // same bounds the typechecker enforces rather than restating them in a test.
27
+ export { builtinArity } from './expr/typecheck/arity.js';
28
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,0FAA0F;AAC1F,4EAA4E;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,gGAAgG;AAChG,yDAAyD;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,iGAAiG;AACjG,+FAA+F;AAC/F,oBAAoB;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,gGAAgG;AAChG,6EAA6E;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["/**\n * `@azx-pbc/axiom-compiler/testing` — the repository's own walk and measurement surface.\n *\n * **Not a host API.** Nothing here carries a compatibility guarantee: `MESSAGE_SLOTS` is the\n * compiler's own walk of the document members that name a message, compared against the\n * metaschema by a drift gate; `declarationDiagnostics` is the declaration walk a counted budget\n * calls; and `metaschemaValidations` and `writerComparisons` are process-lifetime counters those\n * budgets read. All are consumed by this repository's gates and benches, and none is exported from\n * `.`: a published name here would be a semver obligation with no consumer.\n *\n * The names are pinned by `test/package-entry-surface.test.ts`, so a name added or removed here\n * fails that test until the list is updated.\n */\nexport { MESSAGE_SLOTS } from './messages/slots.js';\nexport type { MessageSlot } from './messages/slots.js';\n// The metaschema validations this process performed, so a counted budget can state that a\n// dispatch validates its authored document once rather than once per stage.\nexport { metaschemaValidations } from './schema/measurement.js';\n// The writer visits the duplicate-writer check made, so a counted budget can state the check is\n// linear in the writers rather than the writers squared.\nexport { writerComparisons } from './schema/measurement.js';\n// The declaration walk itself, so a counted budget calls the same built module the counter lives\n// in. Importing the walk from `src` beside a `dist` counter reads two module instances and the\n// count stays zero.\nexport { declarationDiagnostics } from './schema/declarations.js';\n// The built-in arity table, so the frozen-grammar gate compares a published production with the\n// same bounds the typechecker enforces rather than restating them in a test.\nexport { builtinArity } from './expr/typecheck/arity.js';\nexport type { Arity } from './expr/typecheck/arity.js';\n"]}
@@ -0,0 +1,6 @@
1
+ import type { Outcome } from '@azx-pbc/axiom-runtime';
2
+ /** Whether a text names one of the four rule outcomes. */
3
+ export declare function isOutcome(text: string): text is Outcome;
4
+ /** The four outcome names, in the order the vocabulary declares them. */
5
+ export declare const OUTCOME_NAMES: readonly Outcome[];
6
+ //# sourceMappingURL=vocabulary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAuBtD,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,OAAO,CAEvD;AAED,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAAgC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The closed vocabularies both the dataset compiler and the evidence readers test text against.
3
+ *
4
+ * These predicates live above both directories because a CSV cell's outcome and a scenario
5
+ * assertion's outcome are one vocabulary (`spec/semantics/rules-v1.md`): a second list in the CSV
6
+ * front-end could gain or lose a member without the other noticing. The rest of
7
+ * `scenarios/vocabulary.ts` stays scenario-specific and re-exports the outcome predicate from
8
+ * here, so its callers read one import either way.
9
+ */
10
+ /**
11
+ * The four rule outcomes, stated as a totality gate: `satisfies Record<Outcome, Outcome>` stops
12
+ * compiling when the runtime union gains a variant this table does not name.
13
+ */
14
+ const OUTCOME_TEXT = {
15
+ PASS: 'PASS',
16
+ FAIL: 'FAIL',
17
+ UNKNOWN: 'UNKNOWN',
18
+ DEFERRED: 'DEFERRED',
19
+ };
20
+ /** Whether a text names one of the four rule outcomes. */
21
+ export function isOutcome(text) {
22
+ return Object.hasOwn(OUTCOME_TEXT, text);
23
+ }
24
+ /** The four outcome names, in the order the vocabulary declares them. */
25
+ export const OUTCOME_NAMES = Object.values(OUTCOME_TEXT);
26
+ //# sourceMappingURL=vocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACuB,CAAC;AAE9C,0DAA0D;AAC1D,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAuB,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import type { Outcome } from '@azx-pbc/axiom-runtime';\n\n/**\n * The closed vocabularies both the dataset compiler and the evidence readers test text against.\n *\n * These predicates live above both directories because a CSV cell's outcome and a scenario\n * assertion's outcome are one vocabulary (`spec/semantics/rules-v1.md`): a second list in the CSV\n * front-end could gain or lose a member without the other noticing. The rest of\n * `scenarios/vocabulary.ts` stays scenario-specific and re-exports the outcome predicate from\n * here, so its callers read one import either way.\n */\n\n/**\n * The four rule outcomes, stated as a totality gate: `satisfies Record<Outcome, Outcome>` stops\n * compiling when the runtime union gains a variant this table does not name.\n */\nconst OUTCOME_TEXT = {\n PASS: 'PASS',\n FAIL: 'FAIL',\n UNKNOWN: 'UNKNOWN',\n DEFERRED: 'DEFERRED',\n} as const satisfies Record<Outcome, Outcome>;\n\n/** Whether a text names one of the four rule outcomes. */\nexport function isOutcome(text: string): text is Outcome {\n return Object.hasOwn(OUTCOME_TEXT, text);\n}\n\n/** The four outcome names, in the order the vocabulary declares them. */\nexport const OUTCOME_NAMES: readonly Outcome[] = Object.values(OUTCOME_TEXT);\n"]}
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "@azx-pbc/axiom-compiler",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.6",
4
+ "description": "A browser-safe schema compiler: closed metaschema validation, compiled-artifact emission and the axiom-cli command.",
5
+ "license": "MIT",
6
+ "author": "AZX, PBC",
7
+ "homepage": "https://github.com/AZX-PBC-OSS/axiom",
8
+ "bugs": {
9
+ "url": "https://github.com/AZX-PBC-OSS/axiom/issues"
10
+ },
11
+ "keywords": [
12
+ "axiom",
13
+ "schema",
14
+ "compiler",
15
+ "json-schema",
16
+ "expression-language",
17
+ "cli"
18
+ ],
19
+ "engines": {
20
+ "node": ">=24"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AZX-PBC-OSS/axiom.git",
25
+ "directory": "packages/compiler"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "provenance": true
30
+ },
31
+ "sideEffects": false,
32
+ "type": "module",
33
+ "bin": {
34
+ "axiom-cli": "./dist/cli.js"
35
+ },
36
+ "exports": {
37
+ ".": {
38
+ "types": "./dist/index.d.ts",
39
+ "default": "./dist/index.js"
40
+ },
41
+ "./testing": {
42
+ "types": "./dist/testing.d.ts",
43
+ "default": "./dist/testing.js"
44
+ },
45
+ "./package.json": "./package.json"
46
+ },
47
+ "files": [
48
+ "dist",
49
+ "LICENSE"
50
+ ],
51
+ "dependencies": {
52
+ "@azx-pbc/axiom-runtime": "0.0.6",
53
+ "@cfworker/json-schema": "^4.1.6",
54
+ "@messageformat/parser": "^5.2.0",
55
+ "leven": "^4.1.0",
56
+ "papaparse": "^5.7.1",
57
+ "yaml": "^2.9.1"
58
+ },
59
+ "devDependencies": {
60
+ "@types/node": "26.6.11",
61
+ "@types/papaparse": "5.5.2",
62
+ "jsdom": "31.0.1",
63
+ "vitest": "5.1.2",
64
+ "decimal.js": "^10.6.0"
65
+ },
66
+ "scripts": {
67
+ "check:publish": "publint && attw --pack . --profile esm-only"
68
+ }
6
69
  }