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