@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
@@ -0,0 +1,4 @@
1
+ import type { SchemaDiagnostic } from './diagnostic.js';
2
+ /** Every refusal the screen section owns, over one authored or compiled document. */
3
+ export declare function screenDiagnostics(document: Record<string, unknown>): readonly SchemaDiagnostic[];
4
+ //# sourceMappingURL=screens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../src/schema/screens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAyBxD,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,gBAAgB,EAAE,CAMhG"}
@@ -0,0 +1,28 @@
1
+ import { compareCodePoints, isRecord } from '@azx-pbc/axiom-runtime';
2
+ import { listAt, textAt } from './document.js';
3
+ import { selectPrimary } from './primary.js';
4
+ /**
5
+ * The screen section's own document checks: which screens the document declares and which
6
+ * of them is the primary.
7
+ *
8
+ * A screen's identity is its rule's `ruleId`, so the declared set is the screen rules the
9
+ * document lists. Its reasons are checked where messages are compiled — their keys resolve
10
+ * through the message-slot table and their arguments bind like a rule's — so this module
11
+ * holds no second reason check.
12
+ */
13
+ /** The declared screen rule ids, in code-point order. */
14
+ function declaredScreenIds(document) {
15
+ return listAt(document, 'rules')
16
+ .flatMap((rule) => {
17
+ if (!isRecord(rule) || textAt(rule, 'kind') !== 'screen')
18
+ return [];
19
+ const ruleId = textAt(rule, 'ruleId');
20
+ return ruleId === undefined ? [] : [ruleId];
21
+ })
22
+ .sort(compareCodePoints);
23
+ }
24
+ /** Every refusal the screen section owns, over one authored or compiled document. */
25
+ export function screenDiagnostics(document) {
26
+ return selectPrimary({ ruleKind: 'screen', path: '$.primaryScreenId' }, declaredScreenIds(document), textAt(document, 'primaryScreenId'));
27
+ }
28
+ //# sourceMappingURL=screens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screens.js","sourceRoot":"","sources":["../../src/schema/screens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;;GAQG;AAEH,yDAAyD;AACzD,SAAS,iBAAiB,CAAC,QAAiC;IAC1D,OAAO,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC;SAC7B,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAC;QACpE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACtC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC,CAAC;SACD,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC7B,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,iBAAiB,CAAC,QAAiC;IACjE,OAAO,aAAa,CAClB,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,mBAAmB,EAAE,EACjD,iBAAiB,CAAC,QAAQ,CAAC,EAC3B,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CACpC,CAAC;AACJ,CAAC","sourcesContent":["import { compareCodePoints, isRecord } from '@azx-pbc/axiom-runtime';\nimport type { SchemaDiagnostic } from './diagnostic.js';\nimport { listAt, textAt } from './document.js';\nimport { selectPrimary } from './primary.js';\n\n/**\n * The screen section's own document checks: which screens the document declares and which\n * of them is the primary.\n *\n * A screen's identity is its rule's `ruleId`, so the declared set is the screen rules the\n * document lists. Its reasons are checked where messages are compiled — their keys resolve\n * through the message-slot table and their arguments bind like a rule's — so this module\n * holds no second reason check.\n */\n\n/** The declared screen rule ids, in code-point order. */\nfunction declaredScreenIds(document: Record<string, unknown>): readonly string[] {\n return listAt(document, 'rules')\n .flatMap((rule) => {\n if (!isRecord(rule) || textAt(rule, 'kind') !== 'screen') return [];\n const ruleId = textAt(rule, 'ruleId');\n return ruleId === undefined ? [] : [ruleId];\n })\n .sort(compareCodePoints);\n}\n\n/** Every refusal the screen section owns, over one authored or compiled document. */\nexport function screenDiagnostics(document: Record<string, unknown>): readonly SchemaDiagnostic[] {\n return selectPrimary(\n { ruleKind: 'screen', path: '$.primaryScreenId' },\n declaredScreenIds(document),\n textAt(document, 'primaryScreenId'),\n );\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import type { SchemaDiagnostic } from './diagnostic.js';
2
+ /**
3
+ * Every value an embedded test vector supplies — its `values` against the field it names
4
+ * and its `context` against the root it names. The metaschema closes the
5
+ * vector's shape but not the cross-reference from a value to its declaration, so a vector
6
+ * spelling a decimal `"1.50"`, an impossible date or an instant without its fixed
7
+ * millisecond would pass validation and only fail when the rule was eventually exercised —
8
+ * or never, if no one ran it. The runtime reads both slots through the same wire reader, so
9
+ * a vector it would refuse is refused here instead.
10
+ */
11
+ export declare function testValueDiagnostics(document: Record<string, unknown>): readonly SchemaDiagnostic[];
12
+ //# sourceMappingURL=test-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-values.d.ts","sourceRoot":"","sources":["../../src/schema/test-values.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAkBxD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,SAAS,gBAAgB,EAAE,CAkE7B"}
@@ -0,0 +1,97 @@
1
+ import { AxiomError, isRecord, parsePlainDate, toWireValue, wireDeclarationOf, } from '@azx-pbc/axiom-runtime';
2
+ import { declaredContextRoots, declaredFields, listAt } from './document.js';
3
+ /** Reads one vector value against the declaration it must satisfy, or names why not. */
4
+ function testValueDiagnostic(value, path, declaration) {
5
+ try {
6
+ toWireValue(value, path, declaration);
7
+ return undefined;
8
+ }
9
+ catch (cause) {
10
+ if (!(cause instanceof AxiomError))
11
+ throw cause;
12
+ return { code: 'INVALID_TEST_VALUE', path, detail: cause.message };
13
+ }
14
+ }
15
+ /**
16
+ * Every value an embedded test vector supplies — its `values` against the field it names
17
+ * and its `context` against the root it names. The metaschema closes the
18
+ * vector's shape but not the cross-reference from a value to its declaration, so a vector
19
+ * spelling a decimal `"1.50"`, an impossible date or an instant without its fixed
20
+ * millisecond would pass validation and only fail when the rule was eventually exercised —
21
+ * or never, if no one ran it. The runtime reads both slots through the same wire reader, so
22
+ * a vector it would refuse is refused here instead.
23
+ */
24
+ export function testValueDiagnostics(document) {
25
+ const diagnostics = [];
26
+ const fields = declaredFields(document);
27
+ const contextRoots = declaredContextRoots(document);
28
+ listAt(document, 'rules').forEach((rule, ruleIndex) => {
29
+ if (!isRecord(rule))
30
+ return;
31
+ listAt(rule, 'testCases').forEach((testCase, caseIndex) => {
32
+ if (!isRecord(testCase))
33
+ return;
34
+ const base = `$.rules[${String(ruleIndex)}].testCases[${String(caseIndex)}]`;
35
+ const values = testCase['values'];
36
+ if (isRecord(values)) {
37
+ for (const [fieldId, value] of Object.entries(values)) {
38
+ const path = `${base}.values.${fieldId}`;
39
+ const field = fields.get(fieldId);
40
+ if (field === undefined) {
41
+ diagnostics.push({
42
+ code: 'INVALID_TEST_VALUE',
43
+ path,
44
+ detail: `test vector names \`${fieldId}\`, which is not a declared top-level field; a vector keys \`values\` the way the engine reads it, so a record member is supplied inside its container `,
45
+ });
46
+ continue;
47
+ }
48
+ // `toWireValue` carries every declared member, so a nested record value is read
49
+ // down to its leaves rather than only the container it arrived in.
50
+ const declaration = wireDeclarationOf(field);
51
+ const diagnostic = testValueDiagnostic(value, path, declaration);
52
+ if (diagnostic !== undefined)
53
+ diagnostics.push(diagnostic);
54
+ }
55
+ }
56
+ const context = testCase['context'];
57
+ if (isRecord(context)) {
58
+ for (const [rootPath, value] of Object.entries(context)) {
59
+ const path = `${base}.context.${rootPath}`;
60
+ const root = contextRoots.get(rootPath);
61
+ if (root === undefined) {
62
+ diagnostics.push({
63
+ code: 'INVALID_TEST_VALUE',
64
+ path,
65
+ detail: `test vector names context \`${rootPath}\`, which is not a declared context root`,
66
+ });
67
+ continue;
68
+ }
69
+ const diagnostic = testValueDiagnostic(value, path, root);
70
+ if (diagnostic !== undefined)
71
+ diagnostics.push(diagnostic);
72
+ }
73
+ }
74
+ // The metaschema's `plainDate` pattern bounds the shape of a case's record date but
75
+ // not the calendar: an impossible date such as 2026-02-30 would pass validation and
76
+ // only raise `ENGINE_ERROR` when the vector was eventually run. The runtime's own
77
+ // parser is the check, so the vector is refused where it is authored.
78
+ const recordDate = testCase['recordDate'];
79
+ if (typeof recordDate === 'string') {
80
+ try {
81
+ parsePlainDate(recordDate, `${base}.recordDate`);
82
+ }
83
+ catch (cause) {
84
+ if (!(cause instanceof AxiomError))
85
+ throw cause;
86
+ diagnostics.push({
87
+ code: 'INVALID_TEST_VALUE',
88
+ path: `${base}.recordDate`,
89
+ detail: cause.message,
90
+ });
91
+ }
92
+ }
93
+ });
94
+ });
95
+ return diagnostics;
96
+ }
97
+ //# sourceMappingURL=test-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-values.js","sourceRoot":"","sources":["../../src/schema/test-values.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,iBAAiB,GAClB,MAAM,wBAAwB,CAA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AC;oBACD,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;oBAC1D,IAAI,UAAU,KAAK,SAAS;wBAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;YACD,oFAAoF;YACpF,oFAAoF;YACpF,kFAAkF;YAClF,sEAAsE;YACtE,MAAM,UAAU,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;YAC1C,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;gBACnC,IAAI,CAAC;oBACH,cAAc,CAAC,UAAU,EAAE,GAAG,IAAI,aAAa,CAAC,CAAC;gBACnD,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC;wBAAE,MAAM,KAAK,CAAC;oBAChD,WAAW,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,oBAAoB;wBAC1B,IAAI,EAAE,GAAG,IAAI,aAAa;wBAC1B,MAAM,EAAE,KAAK,CAAC,OAAO;qBACtB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import {\n AxiomError,\n isRecord,\n parsePlainDate,\n toWireValue,\n wireDeclarationOf,\n} from '@azx-pbc/axiom-runtime';\nimport type { WireDeclaration } from '@azx-pbc/axiom-runtime';\nimport type { SchemaDiagnostic } from './diagnostic.js';\nimport { declaredContextRoots, declaredFields, listAt } from './document.js';\n\n/** Reads one vector value against the declaration it must satisfy, or names why not. */\nfunction testValueDiagnostic(\n value: unknown,\n path: string,\n declaration: WireDeclaration,\n): SchemaDiagnostic | undefined {\n try {\n toWireValue(value, path, declaration);\n return undefined;\n } catch (cause) {\n if (!(cause instanceof AxiomError)) throw cause;\n return { code: 'INVALID_TEST_VALUE', path, detail: cause.message };\n }\n}\n\n/**\n * Every value an embedded test vector supplies — its `values` against the field it names\n * and its `context` against the root it names. The metaschema closes the\n * vector's shape but not the cross-reference from a value to its declaration, so a vector\n * spelling a decimal `\"1.50\"`, an impossible date or an instant without its fixed\n * millisecond would pass validation and only fail when the rule was eventually exercised —\n * or never, if no one ran it. The runtime reads both slots through the same wire reader, so\n * a vector it would refuse is refused here instead.\n */\nexport function testValueDiagnostics(\n document: Record<string, unknown>,\n): readonly SchemaDiagnostic[] {\n const diagnostics: SchemaDiagnostic[] = [];\n const fields = declaredFields(document);\n const contextRoots = declaredContextRoots(document);\n listAt(document, 'rules').forEach((rule, ruleIndex) => {\n if (!isRecord(rule)) return;\n listAt(rule, 'testCases').forEach((testCase, caseIndex) => {\n if (!isRecord(testCase)) return;\n const base = `$.rules[${String(ruleIndex)}].testCases[${String(caseIndex)}]`;\n const values = testCase['values'];\n if (isRecord(values)) {\n for (const [fieldId, value] of Object.entries(values)) {\n const path = `${base}.values.${fieldId}`;\n const field = fields.get(fieldId);\n if (field === undefined) {\n diagnostics.push({\n code: 'INVALID_TEST_VALUE',\n path,\n detail: `test vector names \\`${fieldId}\\`, which is not a declared top-level field; a vector keys \\`values\\` the way the engine reads it, so a record member is supplied inside its container `,\n });\n continue;\n }\n // `toWireValue` carries every declared member, so a nested record value is read\n // down to its leaves rather than only the container it arrived in.\n const declaration: WireDeclaration = wireDeclarationOf(field);\n const diagnostic = testValueDiagnostic(value, path, declaration);\n if (diagnostic !== undefined) diagnostics.push(diagnostic);\n }\n }\n const context = testCase['context'];\n if (isRecord(context)) {\n for (const [rootPath, value] of Object.entries(context)) {\n const path = `${base}.context.${rootPath}`;\n const root = contextRoots.get(rootPath);\n if (root === undefined) {\n diagnostics.push({\n code: 'INVALID_TEST_VALUE',\n path,\n detail: `test vector names context \\`${rootPath}\\`, which is not a declared context root`,\n });\n continue;\n }\n const diagnostic = testValueDiagnostic(value, path, root);\n if (diagnostic !== undefined) diagnostics.push(diagnostic);\n }\n }\n // The metaschema's `plainDate` pattern bounds the shape of a case's record date but\n // not the calendar: an impossible date such as 2026-02-30 would pass validation and\n // only raise `ENGINE_ERROR` when the vector was eventually run. The runtime's own\n // parser is the check, so the vector is refused where it is authored.\n const recordDate = testCase['recordDate'];\n if (typeof recordDate === 'string') {\n try {\n parsePlainDate(recordDate, `${base}.recordDate`);\n } catch (cause) {\n if (!(cause instanceof AxiomError)) throw cause;\n diagnostics.push({\n code: 'INVALID_TEST_VALUE',\n path: `${base}.recordDate`,\n detail: cause.message,\n });\n }\n }\n });\n });\n return diagnostics;\n}\n"]}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * A failing `anyOf`/`oneOf` and the branch reasons it carries.
3
+ *
4
+ * A validator validates every branch and then reports the union as well, so one failing union
5
+ * arrives as the union message plus the members each branch refused. Which of those is the
6
+ * fact to report depends on whether the instance could have belonged to a branch:
7
+ *
8
+ * - Exactly one branch is plausible — every other branch either failed on its own root `type`
9
+ * or requires members that are all absent from the instance. The instance has a shape, and
10
+ * the reasons inside that branch are the real faults. The branch is selected, its reasons
11
+ * survive, and the generic union wrapper is dropped.
12
+ * - No branch is plausible, or more than one is — there is no selected branch, so no branch's
13
+ * member list is a fact about the value. The union's own refusal is reported and every
14
+ * branch reason is suppressed.
15
+ *
16
+ * The suppression is by schema pointer, except for a `false` leaf: the validator writes the
17
+ * instance location as that leaf's keyword location, so it is attributed through the member
18
+ * wrapper at its parent that names it.
19
+ */
20
+ import type { Schema } from '@cfworker/json-schema';
21
+ import type { LocatedError } from './located.js';
22
+ /** One failing union and the branch the instance plausibly belongs to, if any. */
23
+ export interface UnionDecision {
24
+ readonly union: LocatedError;
25
+ /**
26
+ * The single branch every surviving reason belongs to, or `undefined` when the union itself
27
+ * is the reported fact.
28
+ */
29
+ readonly selectedBranch: number | undefined;
30
+ }
31
+ /**
32
+ * The failing unions among the located reasons and the branch each one selects.
33
+ *
34
+ * A branch that produced no reason matched the instance, so a union with a match (a `oneOf`
35
+ * with two matches, say) keeps its own refusal.
36
+ */
37
+ export declare function decideUnions(located: readonly LocatedError[], schema?: Schema): readonly UnionDecision[];
38
+ /**
39
+ * Every reason except those a union decision suppresses.
40
+ *
41
+ * A union with a selected branch drops its own wrapper and every other branch; a union
42
+ * without one drops every branch and keeps the wrapper. A `false` leaf follows the branch its
43
+ * member wrapper names, so a leaf from a rejected branch cannot outlive the branch itself.
44
+ */
45
+ export declare function applyUnionDecisions(located: readonly LocatedError[], decisions: readonly UnionDecision[]): readonly LocatedError[];
46
+ //# sourceMappingURL=unions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unions.d.ts","sourceRoot":"","sources":["../../src/schema/unions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA0EjD,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,MAAM,GAAE,MAAkB,GACzB,SAAS,aAAa,EAAE,CA2B1B;AAyBD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,SAAS,EAAE,SAAS,aAAa,EAAE,GAClC,SAAS,YAAY,EAAE,CAazB"}
@@ -0,0 +1,131 @@
1
+ import { isRecord } from '@azx-pbc/axiom-runtime';
2
+ import { isStrictDescendant, sameLocation } from './located.js';
3
+ import { metaschemaAt } from './pointer.js';
4
+ import { SCHEMA_V1 } from './schema-v1.generated.js';
5
+ /** The union keywords: their own refusal is the only one that is true of the whole value. */
6
+ const UNION_KEYWORDS = new Set(['anyOf', 'oneOf']);
7
+ /** The wrappers whose own message names the member they refused. */
8
+ const MEMBER_WRAPPER_KEYWORDS = new Set([
9
+ 'additionalProperties',
10
+ 'properties',
11
+ 'unevaluatedProperties',
12
+ ]);
13
+ /** The branch an error was walked from, as the index after the union's keyword location. */
14
+ function branchOf(union, entry) {
15
+ const prefix = `${union.unit.keywordLocation}/`;
16
+ if (!entry.unit.keywordLocation.startsWith(prefix))
17
+ return undefined;
18
+ const token = entry.unit.keywordLocation.slice(prefix.length).split('/')[0];
19
+ return token !== undefined && /^\d+$/.test(token) ? Number(token) : undefined;
20
+ }
21
+ /** How many branches the union declares, read from the metaschema the pointer names. */
22
+ function branchCount(union, schema) {
23
+ const branches = metaschemaAt(union.unit.keywordLocation, schema);
24
+ return Array.isArray(branches) ? branches.length : 0;
25
+ }
26
+ /**
27
+ * Whether a `required` error is the branch schema's own, rather than one a conditional inside
28
+ * the branch demanded. The branch's own keyword sits at `.../<index>/required`, after any
29
+ * `$ref` steps the branch took; a `required` inside `then` or `allOf` says nothing about
30
+ * whether the instance is that branch's shape.
31
+ */
32
+ function isBranchRootRequired(union, index, entry) {
33
+ const prefix = `${union.unit.keywordLocation}/${String(index)}/`;
34
+ if (!entry.unit.keywordLocation.startsWith(prefix))
35
+ return false;
36
+ const segments = entry.unit.keywordLocation.slice(prefix.length).split('/');
37
+ return (segments[segments.length - 1] === 'required' &&
38
+ segments.slice(0, -1).every((segment) => segment === '$ref'));
39
+ }
40
+ /**
41
+ * Whether a branch could not describe this instance. A root `type` failure says the shape never
42
+ * matched; a branch that declares required members and reports every one of them absent says
43
+ * the instance is not that shape either, even when the shape shares the instance's JSON type.
44
+ */
45
+ function isImpossible(union, branch) {
46
+ if (branch.reasons.some(({ unit, at }) => unit.keyword === 'type' && sameLocation(at, union.at))) {
47
+ return true;
48
+ }
49
+ const required = isRecord(branch.schema) ? branch.schema['required'] : undefined;
50
+ if (!Array.isArray(required) || required.length === 0)
51
+ return false;
52
+ const absent = branch.reasons.filter((entry) => entry.unit.keyword === 'required' &&
53
+ sameLocation(entry.at, union.at) &&
54
+ isBranchRootRequired(union, branch.index, entry)).length;
55
+ return absent >= required.length;
56
+ }
57
+ /**
58
+ * The failing unions among the located reasons and the branch each one selects.
59
+ *
60
+ * A branch that produced no reason matched the instance, so a union with a match (a `oneOf`
61
+ * with two matches, say) keeps its own refusal.
62
+ */
63
+ export function decideUnions(located, schema = SCHEMA_V1) {
64
+ const unions = located.filter(({ unit }) => UNION_KEYWORDS.has(unit.keyword));
65
+ return unions.map((union) => {
66
+ const branches = new Map();
67
+ for (const entry of located) {
68
+ const index = branchOf(union, entry);
69
+ if (index === undefined)
70
+ continue;
71
+ const reasons = branches.get(index) ?? [];
72
+ reasons.push(entry);
73
+ branches.set(index, reasons);
74
+ }
75
+ const count = branchCount(union, schema);
76
+ const matched = Array.from({ length: count }, (_, index) => index).some((index) => !branches.has(index));
77
+ if (matched)
78
+ return { union, selectedBranch: undefined };
79
+ const plausible = [...branches].filter(([index, reasons]) => !isImpossible(union, {
80
+ index,
81
+ reasons,
82
+ schema: metaschemaAt(`${union.unit.keywordLocation}/${String(index)}`, schema),
83
+ }));
84
+ const only = plausible.length === 1 ? plausible[0] : undefined;
85
+ return { union, selectedBranch: only?.[0] };
86
+ });
87
+ }
88
+ /**
89
+ * The branch indices of the member wrappers at a `false` leaf's parent whose message names
90
+ * that leaf's member. A `false` leaf's own keyword location is its instance location, so the
91
+ * wrapper that produced it is the only schema-pointer evidence of which branch it came from.
92
+ */
93
+ function falseLeafBranches(union, leaf, located) {
94
+ const parent = leaf.at.slice(0, -1);
95
+ const member = `"${leaf.at[leaf.at.length - 1] ?? ''}"`;
96
+ const branches = new Set();
97
+ for (const entry of located) {
98
+ if (!MEMBER_WRAPPER_KEYWORDS.has(entry.unit.keyword))
99
+ continue;
100
+ if (!sameLocation(entry.at, parent))
101
+ continue;
102
+ if (!entry.unit.error.includes(member))
103
+ continue;
104
+ const index = branchOf(union, entry);
105
+ if (index !== undefined)
106
+ branches.add(index);
107
+ }
108
+ return branches;
109
+ }
110
+ /**
111
+ * Every reason except those a union decision suppresses.
112
+ *
113
+ * A union with a selected branch drops its own wrapper and every other branch; a union
114
+ * without one drops every branch and keeps the wrapper. A `false` leaf follows the branch its
115
+ * member wrapper names, so a leaf from a rejected branch cannot outlive the branch itself.
116
+ */
117
+ export function applyUnionDecisions(located, decisions) {
118
+ return located.filter((entry) => decisions.every((decision) => {
119
+ if (entry === decision.union)
120
+ return decision.selectedBranch === undefined;
121
+ const index = branchOf(decision.union, entry);
122
+ if (index !== undefined)
123
+ return decision.selectedBranch === index;
124
+ if (entry.unit.keyword !== 'false' || !isStrictDescendant(decision.union.at, entry.at)) {
125
+ return true;
126
+ }
127
+ const branches = falseLeafBranches(decision.union, entry, located);
128
+ return decision.selectedBranch !== undefined && branches.has(decision.selectedBranch);
129
+ }));
130
+ }
131
+ //# sourceMappingURL=unions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unions.js","sourceRoot":"","sources":["../../src/schema/unions.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,6FAA6F;AAC7F,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAExE,oEAAoE;AACpE,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAAC;IAC3D,sBAAsB;IACtB,YAAY;IACZ,uBAAuB;CACxB,CAAC,CAAC;AAEH,4FAA4F;AAC5F,SAAS,QAAQ,CAAC,KAAmB,EAAE,KAAmB;IACxD,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC;IA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Q,EAAE,EAAE;QAC3B,IAAI,KAAK,KAAK,QAAQ,CAAC,KAAK;YAAE,OAAO,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;QAC3E,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC,cAAc,KAAK,KAAK,CAAC;QAClE,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YACvF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACnE,OAAO,QAAQ,CAAC,cAAc,KAAK,SAAS,IAAI,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACxF,CAAC,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["/**\n * A failing `anyOf`/`oneOf` and the branch reasons it carries.\n *\n * A validator validates every branch and then reports the union as well, so one failing union\n * arrives as the union message plus the members each branch refused. Which of those is the\n * fact to report depends on whether the instance could have belonged to a branch:\n *\n * - Exactly one branch is plausible — every other branch either failed on its own root `type`\n * or requires members that are all absent from the instance. The instance has a shape, and\n * the reasons inside that branch are the real faults. The branch is selected, its reasons\n * survive, and the generic union wrapper is dropped.\n * - No branch is plausible, or more than one is — there is no selected branch, so no branch's\n * member list is a fact about the value. The union's own refusal is reported and every\n * branch reason is suppressed.\n *\n * The suppression is by schema pointer, except for a `false` leaf: the validator writes the\n * instance location as that leaf's keyword location, so it is attributed through the member\n * wrapper at its parent that names it.\n */\nimport type { Schema } from '@cfworker/json-schema';\nimport { isRecord } from '@azx-pbc/axiom-runtime';\nimport type { LocatedError } from './located.js';\nimport { isStrictDescendant, sameLocation } from './located.js';\nimport { metaschemaAt } from './pointer.js';\nimport { SCHEMA_V1 } from './schema-v1.generated.js';\n\n/** The union keywords: their own refusal is the only one that is true of the whole value. */\nconst UNION_KEYWORDS: ReadonlySet<string> = new Set(['anyOf', 'oneOf']);\n\n/** The wrappers whose own message names the member they refused. */\nconst MEMBER_WRAPPER_KEYWORDS: ReadonlySet<string> = new Set([\n 'additionalProperties',\n 'properties',\n 'unevaluatedProperties',\n]);\n\n/** The branch an error was walked from, as the index after the union's keyword location. */\nfunction branchOf(union: LocatedError, entry: LocatedError): number | undefined {\n const prefix = `${union.unit.keywordLocation}/`;\n if (!entry.unit.keywordLocation.startsWith(prefix)) return undefined;\n const token = entry.unit.keywordLocation.slice(prefix.length).split('/')[0];\n return token !== undefined && /^\\d+$/.test(token) ? Number(token) : undefined;\n}\n\n/** How many branches the union declares, read from the metaschema the pointer names. */\nfunction branchCount(union: LocatedError, schema: Schema): number {\n const branches = metaschemaAt(union.unit.keywordLocation, schema);\n return Array.isArray(branches) ? branches.length : 0;\n}\n\n/** One branch's reasons and the schema that branch names. */\ninterface BranchReasons {\n readonly index: number;\n readonly reasons: readonly LocatedError[];\n readonly schema: unknown;\n}\n\n/**\n * Whether a `required` error is the branch schema's own, rather than one a conditional inside\n * the branch demanded. The branch's own keyword sits at `.../<index>/required`, after any\n * `$ref` steps the branch took; a `required` inside `then` or `allOf` says nothing about\n * whether the instance is that branch's shape.\n */\nfunction isBranchRootRequired(union: LocatedError, index: number, entry: LocatedError): boolean {\n const prefix = `${union.unit.keywordLocation}/${String(index)}/`;\n if (!entry.unit.keywordLocation.startsWith(prefix)) return false;\n const segments = entry.unit.keywordLocation.slice(prefix.length).split('/');\n return (\n segments[segments.length - 1] === 'required' &&\n segments.slice(0, -1).every((segment) => segment === '$ref')\n );\n}\n\n/**\n * Whether a branch could not describe this instance. A root `type` failure says the shape never\n * matched; a branch that declares required members and reports every one of them absent says\n * the instance is not that shape either, even when the shape shares the instance's JSON type.\n */\nfunction isImpossible(union: LocatedError, branch: BranchReasons): boolean {\n if (\n branch.reasons.some(({ unit, at }) => unit.keyword === 'type' && sameLocation(at, union.at))\n ) {\n return true;\n }\n const required = isRecord(branch.schema) ? branch.schema['required'] : undefined;\n if (!Array.isArray(required) || required.length === 0) return false;\n const absent = branch.reasons.filter(\n (entry) =>\n entry.unit.keyword === 'required' &&\n sameLocation(entry.at, union.at) &&\n isBranchRootRequired(union, branch.index, entry),\n ).length;\n return absent >= required.length;\n}\n\n/** One failing union and the branch the instance plausibly belongs to, if any. */\nexport interface UnionDecision {\n readonly union: LocatedError;\n /**\n * The single branch every surviving reason belongs to, or `undefined` when the union itself\n * is the reported fact.\n */\n readonly selectedBranch: number | undefined;\n}\n\n/**\n * The failing unions among the located reasons and the branch each one selects.\n *\n * A branch that produced no reason matched the instance, so a union with a match (a `oneOf`\n * with two matches, say) keeps its own refusal.\n */\nexport function decideUnions(\n located: readonly LocatedError[],\n schema: Schema = SCHEMA_V1,\n): readonly UnionDecision[] {\n const unions = located.filter(({ unit }) => UNION_KEYWORDS.has(unit.keyword));\n return unions.map((union) => {\n const branches = new Map<number, LocatedError[]>();\n for (const entry of located) {\n const index = branchOf(union, entry);\n if (index === undefined) continue;\n const reasons = branches.get(index) ?? [];\n reasons.push(entry);\n branches.set(index, reasons);\n }\n const count = branchCount(union, schema);\n const matched = Array.from({ length: count }, (_, index) => index).some(\n (index) => !branches.has(index),\n );\n if (matched) return { union, selectedBranch: undefined };\n const plausible = [...branches].filter(\n ([index, reasons]) =>\n !isImpossible(union, {\n index,\n reasons,\n schema: metaschemaAt(`${union.unit.keywordLocation}/${String(index)}`, schema),\n }),\n );\n const only = plausible.length === 1 ? plausible[0] : undefined;\n return { union, selectedBranch: only?.[0] };\n });\n}\n\n/**\n * The branch indices of the member wrappers at a `false` leaf's parent whose message names\n * that leaf's member. A `false` leaf's own keyword location is its instance location, so the\n * wrapper that produced it is the only schema-pointer evidence of which branch it came from.\n */\nfunction falseLeafBranches(\n union: LocatedError,\n leaf: LocatedError,\n located: readonly LocatedError[],\n): ReadonlySet<number> {\n const parent = leaf.at.slice(0, -1);\n const member = `\"${leaf.at[leaf.at.length - 1] ?? ''}\"`;\n const branches = new Set<number>();\n for (const entry of located) {\n if (!MEMBER_WRAPPER_KEYWORDS.has(entry.unit.keyword)) continue;\n if (!sameLocation(entry.at, parent)) continue;\n if (!entry.unit.error.includes(member)) continue;\n const index = branchOf(union, entry);\n if (index !== undefined) branches.add(index);\n }\n return branches;\n}\n\n/**\n * Every reason except those a union decision suppresses.\n *\n * A union with a selected branch drops its own wrapper and every other branch; a union\n * without one drops every branch and keeps the wrapper. A `false` leaf follows the branch its\n * member wrapper names, so a leaf from a rejected branch cannot outlive the branch itself.\n */\nexport function applyUnionDecisions(\n located: readonly LocatedError[],\n decisions: readonly UnionDecision[],\n): readonly LocatedError[] {\n return located.filter((entry) =>\n decisions.every((decision) => {\n if (entry === decision.union) return decision.selectedBranch === undefined;\n const index = branchOf(decision.union, entry);\n if (index !== undefined) return decision.selectedBranch === index;\n if (entry.unit.keyword !== 'false' || !isStrictDescendant(decision.union.at, entry.at)) {\n return true;\n }\n const branches = falseLeafBranches(decision.union, entry, located);\n return decision.selectedBranch !== undefined && branches.has(decision.selectedBranch);\n }),\n );\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { Inspection } from './diagnostic.js';
2
+ /**
3
+ * Ingests and checks a document authored in YAML.
4
+ *
5
+ * The YAML front door resolves anchors and aliases into a plain value and refuses the syntax
6
+ * JSON cannot express (a custom tag, a merge key, a second document) before the same
7
+ * `inspectParsedDocument` walk the JSON path runs sees it. Nothing downstream knows which
8
+ * spelling the author used.
9
+ *
10
+ * This module exists so `schema/validate.ts` does not import the YAML reader: the entry that
11
+ * compiles JSON must not carry the `yaml` parser, and the parser is reachable only from here.
12
+ */
13
+ export declare function inspectYamlDocument(source: string): Inspection;
14
+ //# sourceMappingURL=validate-yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-yaml.d.ts","sourceRoot":"","sources":["../../src/schema/validate-yaml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAE9D"}
@@ -0,0 +1,17 @@
1
+ import { ingestYamlDocument } from '../ingest/yaml-document.js';
2
+ import { inspectIngested } from './validate.js';
3
+ /**
4
+ * Ingests and checks a document authored in YAML.
5
+ *
6
+ * The YAML front door resolves anchors and aliases into a plain value and refuses the syntax
7
+ * JSON cannot express (a custom tag, a merge key, a second document) before the same
8
+ * `inspectParsedDocument` walk the JSON path runs sees it. Nothing downstream knows which
9
+ * spelling the author used.
10
+ *
11
+ * This module exists so `schema/validate.ts` does not import the YAML reader: the entry that
12
+ * compiles JSON must not carry the `yaml` parser, and the parser is reachable only from here.
13
+ */
14
+ export function inspectYamlDocument(source) {
15
+ return inspectIngested(ingestYamlDocument(source));
16
+ }
17
+ //# sourceMappingURL=validate-yaml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-yaml.js","sourceRoot":"","sources":["../../src/schema/validate-yaml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO,eAAe,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { ingestYamlDocument } from '../ingest/yaml-document.js';\nimport type { Inspection } from './diagnostic.js';\nimport { inspectIngested } from './validate.js';\n\n/**\n * Ingests and checks a document authored in YAML.\n *\n * The YAML front door resolves anchors and aliases into a plain value and refuses the syntax\n * JSON cannot express (a custom tag, a merge key, a second document) before the same\n * `inspectParsedDocument` walk the JSON path runs sees it. Nothing downstream knows which\n * spelling the author used.\n *\n * This module exists so `schema/validate.ts` does not import the YAML reader: the entry that\n * compiles JSON must not carry the `yaml` parser, and the parser is reachable only from here.\n */\nexport function inspectYamlDocument(source: string): Inspection {\n return inspectIngested(ingestYamlDocument(source));\n}\n"]}
@@ -0,0 +1,46 @@
1
+ import type { IngestedDocument } from '../ingest/document.js';
2
+ import type { Inspection, SchemaDiagnostic } from './diagnostic.js';
3
+ /**
4
+ * The compiler's document checks: closed metaschema validation, plus the semantic rules
5
+ * `spec/semantics/{model,context,rules}-v1.md` require the compiler to enforce where no
6
+ * JSON Schema keyword can express them, because they relate one declaration to another.
7
+ *
8
+ * Nothing here touches Node, the filesystem or the clock, so the same code runs in a
9
+ * browser preview, in `axiom-cli check`, and in a build step that compiles an artifact.
10
+ *
11
+ * This entry runs ingestion, the metaschema walk and the semantic passes; the diagnostic
12
+ * shape is `schema/diagnostic`, the metaschema walk `schema/metaschema`, declaration
13
+ * narrowing `schema/document`, and each semantic pass its own module beside this one.
14
+ */
15
+ export type { Inspection, SchemaCheck, SchemaDiagnostic, SchemaDiagnosticCode, } from './diagnostic.js';
16
+ export { declaredFields, documentContextRoot, documentField } from './document.js';
17
+ /**
18
+ * Ingests and checks one JSON document. Ingestion runs first and refuses a duplicate member
19
+ * name before any validator sees the tree: `JSON.parse` would keep the last member and silently
20
+ * drop the conflict. YAML authors reach the same walk through `inspectYamlDocument` in
21
+ * `validate-yaml.ts`.
22
+ */
23
+ export declare function inspectSchemaDocument(source: string): Inspection;
24
+ /**
25
+ * The walk both front doors share once their reader has produced a plain value or the
26
+ * diagnostics that refused it. Keeping it here lets `validate-yaml.ts` reach the same walk
27
+ * without this module importing the YAML reader.
28
+ */
29
+ export declare function inspectIngested(ingested: IngestedDocument): Inspection;
30
+ /**
31
+ * Validates an already-assembled tree against the closed metaschema, without the semantic
32
+ * walkers `inspectSchemaDocument` runs on authored text.
33
+ *
34
+ * This covers the members the document contract owns. The compiler's emission gate is
35
+ * `validateCompiledArtifact` in `compile/artifact-members`, which runs this check over that
36
+ * projection and holds the artifact-only members to their own list, so a compiler bug cannot
37
+ * ship an artifact the runtime's contract does not admit.
38
+ */
39
+ export declare function validateCompiledDocument(document: unknown): readonly SchemaDiagnostic[];
40
+ /**
41
+ * The document-level walkers below are one stage of `compile()`, not a verdict of their own:
42
+ * `compile()` runs them and then the language, the cross-checks and the artifact emission.
43
+ * The public verdict is `checkSchema` in `schema/check.ts`, which runs that whole compile, so
44
+ * this module must not grow a second, weaker answer that an editor could mistake for it.
45
+ */
46
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/schema/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOpE;;;;;;;;;;;GAWG;AAEH,YAAY,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAUtE;AAiID;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,gBAAgB,EAAE,CAgBvF;AAED;;;;;GAKG"}