@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
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
import { artifactBehaviour, assertNever, canonicalHash, DEFAULT_EVIDENCE_TIER, isTier, } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import { MemoryLookupStore } from '@azx-pbc/axiom-runtime/lookup';
|
|
3
|
+
import { isDeferredStub } from '../compile/rules.js';
|
|
4
|
+
import { missedPinDetail, readDataIdentity } from '../scenarios/data-identity.js';
|
|
5
|
+
import { runScenarioSuite } from '../scenarios/runner.js';
|
|
6
|
+
import { describeTarget } from '../scenarios/report.js';
|
|
7
|
+
import { writerRulesOf } from '../scenarios/evidence.js';
|
|
8
|
+
import { environmentHashOf, normalizeEnvironment } from '../scenarios/environment.js';
|
|
9
|
+
import { resolveRunEnvironment } from './environment.js';
|
|
10
|
+
import { evidencePathOf, readinessGaps } from './readiness.js';
|
|
11
|
+
import { runEmbeddedVectors } from './vectors.js';
|
|
12
|
+
/** The stored form of a verification: the report, without the run detail a terminal reads. */
|
|
13
|
+
export function publishReport(verification) {
|
|
14
|
+
const evidence = {
|
|
15
|
+
behaviorHash: verification.behaviorHash,
|
|
16
|
+
environment: verification.environment,
|
|
17
|
+
environmentHash: verification.environmentHash,
|
|
18
|
+
evidenceHash: verification.evidenceHash,
|
|
19
|
+
datasetHashes: verification.datasetHashes,
|
|
20
|
+
coverage: verification.coverage,
|
|
21
|
+
observedOnly: verification.observedOnly,
|
|
22
|
+
};
|
|
23
|
+
return verification.ready
|
|
24
|
+
? { ready: true, ...evidence }
|
|
25
|
+
: { ready: false, gaps: verification.gaps, ...evidence };
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The artifact's data identity for this run, or the one gap that stops it being stated.
|
|
29
|
+
*
|
|
30
|
+
* An uninstallable catalogue and a table no document answers with the pinned version are the same
|
|
31
|
+
* kind of fact: the artifact depends on that version whether or not a rule happened to read it, so
|
|
32
|
+
* the run has no identity to bind its evidence to. The read itself is `data-identity.ts`, which a
|
|
33
|
+
* suite run uses too, so the sentence and the miss list are stated once.
|
|
34
|
+
*/
|
|
35
|
+
function datasetPins(compiled, documents) {
|
|
36
|
+
const read = readDataIdentity(compiled, documents);
|
|
37
|
+
if (!read.ok) {
|
|
38
|
+
return {
|
|
39
|
+
ok: false,
|
|
40
|
+
pins: [],
|
|
41
|
+
gap: { kind: 'stale_dataset', path: '$.datasets', detail: read.detail },
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const { pins, misses } = read.identity;
|
|
45
|
+
if (misses.length === 0)
|
|
46
|
+
return { ok: true, pins };
|
|
47
|
+
return {
|
|
48
|
+
ok: false,
|
|
49
|
+
pins,
|
|
50
|
+
gap: { kind: 'stale_dataset', path: '$.datasets', detail: missedPinDetail(misses) },
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The rule a target names directly, for crediting a claim that failed or proved nothing.
|
|
55
|
+
*
|
|
56
|
+
* A target that names its rule can be counted as an attempt even when it earns no credit, so the
|
|
57
|
+
* verdict says "no case where it fires" rather than "no case at all". A field- or export-shaped
|
|
58
|
+
* target names no rule, and the credit it would earn already names the rule it is evidence about.
|
|
59
|
+
* A `computed` target names a field, whose one field-scope writer is the rule that produced it,
|
|
60
|
+
* so the attempt is counted against the writer exactly as the vector path counts it.
|
|
61
|
+
*/
|
|
62
|
+
function ruleIdOf(target, compiled) {
|
|
63
|
+
switch (target.kind) {
|
|
64
|
+
case 'rule':
|
|
65
|
+
case 'gateItem':
|
|
66
|
+
case 'gateStatus':
|
|
67
|
+
case 'gateOutcome':
|
|
68
|
+
case 'gateUndeterminedItem':
|
|
69
|
+
case 'screenOutcome':
|
|
70
|
+
case 'screenReason':
|
|
71
|
+
return target.ruleId;
|
|
72
|
+
case 'computed': {
|
|
73
|
+
const writers = writerRulesOf(compiled, target.fieldId);
|
|
74
|
+
return writers.length === 1 ? writers[0]?.ruleId : undefined;
|
|
75
|
+
}
|
|
76
|
+
case 'ready':
|
|
77
|
+
case 'fieldVisible':
|
|
78
|
+
case 'fieldHidden':
|
|
79
|
+
case 'fieldRequired':
|
|
80
|
+
case 'fieldMissingRequired':
|
|
81
|
+
case 'fieldDisabled':
|
|
82
|
+
case 'rowFact':
|
|
83
|
+
case 'exportIncludes':
|
|
84
|
+
case 'exportExcludes':
|
|
85
|
+
case 'exportValue':
|
|
86
|
+
case 'exportRefused':
|
|
87
|
+
return undefined;
|
|
88
|
+
default:
|
|
89
|
+
return assertNever(target);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** The vector env: every pinned table the supplied documents can install. */
|
|
93
|
+
function vectorEnv(compiled, documents, environment) {
|
|
94
|
+
const pinned = new Set((compiled.datasets ?? []).map((ref) => ref.tableId));
|
|
95
|
+
const tables = documents.filter((document) => pinned.has(document.tableId));
|
|
96
|
+
return {
|
|
97
|
+
tier: environment.tier,
|
|
98
|
+
...(environment.recordDate === undefined ? {} : { recordDate: environment.recordDate }),
|
|
99
|
+
...(environment.capabilities === undefined ? {} : { capabilities: environment.capabilities }),
|
|
100
|
+
...(tables.length === 0 ? {} : { lookup: new MemoryLookupStore(tables) }),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The rules a device artifact carries in place of server logic, which prove nothing here.
|
|
105
|
+
*
|
|
106
|
+
* A client artifact states its target and is refused before this is read; this catches the same
|
|
107
|
+
* artifact with its target stripped, and an artifact assembled by hand from one. The shape is the
|
|
108
|
+
* compiler's own `isDeferredStub`, so the producer and this reading cannot disagree about what a
|
|
109
|
+
* stub is.
|
|
110
|
+
*
|
|
111
|
+
* `target` is packaging, and packaging is whatever the holder of the bytes says it is: a caller
|
|
112
|
+
* that relabels a device artifact `server` must not turn its deferred stubs into decided checks,
|
|
113
|
+
* so the shape is read whatever the label says. A genuine server artifact is unaffected — the
|
|
114
|
+
* compiler never emits a stub for one, and an authored server rule whose expression is the
|
|
115
|
+
* deferred marker with no embedded case is the one shape the two cannot be told apart by, which
|
|
116
|
+
* is already how a server artifact's rule of that shape reads.
|
|
117
|
+
*/
|
|
118
|
+
function stubRuleIds(compiled) {
|
|
119
|
+
const stubs = new Set();
|
|
120
|
+
for (const rule of compiled.rules ?? []) {
|
|
121
|
+
if (isDeferredStub(rule))
|
|
122
|
+
stubs.add(rule.ruleId);
|
|
123
|
+
}
|
|
124
|
+
return stubs;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Verifies that an artifact's executed evidence satisfies the publishing rule.
|
|
128
|
+
*
|
|
129
|
+
* `ready` is `true` only when every rule has a passing case on each branch its expression can
|
|
130
|
+
* reach among the vectors and suites this call ran, every one of those claims held, and every table
|
|
131
|
+
* the artifact pins resolves to the version it was compiled against. Everything else is a gap
|
|
132
|
+
* naming the rule, the location and the reason.
|
|
133
|
+
*/
|
|
134
|
+
export function verifyPublishReadiness(compiled, options = {}) {
|
|
135
|
+
// One derivation per verification: the run, each suite report and the verdict all state this
|
|
136
|
+
// identity, and re-deriving it per suite would re-hash every rule of the artifact.
|
|
137
|
+
const behaviour = artifactBehaviour(compiled);
|
|
138
|
+
const behaviorHash = behaviour.behaviorHash;
|
|
139
|
+
const documents = options.datasets ?? [];
|
|
140
|
+
const suiteDocuments = options.suites ?? [];
|
|
141
|
+
const declarations = options.declarations ?? [];
|
|
142
|
+
const tallies = new Map((compiled.rules ?? []).map((rule) => [
|
|
143
|
+
rule.ruleId,
|
|
144
|
+
{ kind: rule.kind, attempts: 0, firing: false, nonFiring: false },
|
|
145
|
+
]));
|
|
146
|
+
const environment = resolveRunEnvironment(options.environment, suiteDocuments.map((suite) => ({
|
|
147
|
+
// The parser runs a scenario at the evidence default tier when its document names none, so a
|
|
148
|
+
// suite always judges at a tier; declaring the effective one keeps a caller's `client`
|
|
149
|
+
// environment from silently disagreeing with it.
|
|
150
|
+
defaults: {
|
|
151
|
+
tier: suite.defaults.tier ?? DEFAULT_EVIDENCE_TIER,
|
|
152
|
+
...(suite.defaults.recordDate === undefined
|
|
153
|
+
? {}
|
|
154
|
+
: { recordDate: suite.defaults.recordDate }),
|
|
155
|
+
...(suite.defaults.capabilities === undefined
|
|
156
|
+
? {}
|
|
157
|
+
: { capabilities: suite.defaults.capabilities }),
|
|
158
|
+
},
|
|
159
|
+
})));
|
|
160
|
+
if (!environment.ok) {
|
|
161
|
+
// One run states one environment, so declarations that contradict each other are refused
|
|
162
|
+
// rather than resolved by precedence: nothing executes, and the report states the baseline
|
|
163
|
+
// the caller asked for while the gap names the contradiction.
|
|
164
|
+
return refusedRun(behaviorHash, refusalBaseline(options.environment), [
|
|
165
|
+
{
|
|
166
|
+
kind: 'conflicting_environment',
|
|
167
|
+
path: environment.path ?? '$.environment',
|
|
168
|
+
detail: environment.detail,
|
|
169
|
+
},
|
|
170
|
+
], tallies, []);
|
|
171
|
+
}
|
|
172
|
+
const committed = environment.environment;
|
|
173
|
+
if (compiled.target === 'client') {
|
|
174
|
+
// A device artifact is not the artifact a publisher's evidence ran against: every
|
|
175
|
+
// server-tier rule is a deferred stub and the embedded cases were stripped, so executing
|
|
176
|
+
// anything here would report a stub's branch as the authored check's. The refusal comes
|
|
177
|
+
// before any run, and names the artifact that can be verified.
|
|
178
|
+
return refusedRun(behaviorHash, committed, [
|
|
179
|
+
{
|
|
180
|
+
kind: 'client_artifact',
|
|
181
|
+
path: '$',
|
|
182
|
+
detail: 'this artifact was compiled for a device: its server-tier rules are deferred stubs and its embedded cases do not travel, so no evidence can be executed against it; verify the server artifact the same document compiles to',
|
|
183
|
+
},
|
|
184
|
+
], tallies, []);
|
|
185
|
+
}
|
|
186
|
+
// A server-tier rule whose expression is the compiler's deferred marker with no embedded case
|
|
187
|
+
// is a stub whatever the artifact's `target` says, so it is observed and never credited.
|
|
188
|
+
const stubs = stubRuleIds(compiled);
|
|
189
|
+
const pins = datasetPins(compiled, documents);
|
|
190
|
+
const failures = [];
|
|
191
|
+
const observed = [];
|
|
192
|
+
if (!pins.ok) {
|
|
193
|
+
// Without a data identity nothing installed can be bound, so no claim is executed at all and
|
|
194
|
+
// the one reason is the whole verdict. Folding evidence that states nothing would add a
|
|
195
|
+
// per-rule "no embedded vector and no scenario assertion" gap for rules whose vectors this run
|
|
196
|
+
// never read, which is not a fact it established; `coverage` still names every rule as
|
|
197
|
+
// unexamined, and the verdict stays fail-closed.
|
|
198
|
+
return refusedRun(behaviorHash, committed, [pins.gap], tallies, pins.pins);
|
|
199
|
+
}
|
|
200
|
+
const vectors = runEmbeddedVectors(compiled, vectorEnv(compiled, documents, committed));
|
|
201
|
+
// A rule's failed vectors are one reason, not one reason per case: a 500-case matrix must not
|
|
202
|
+
// make the stored report as large as the failure it records. The first case names the repair.
|
|
203
|
+
const failedVectors = new Map();
|
|
204
|
+
for (const vector of vectors) {
|
|
205
|
+
const tally = tallies.get(vector.ruleId);
|
|
206
|
+
if (tally !== undefined)
|
|
207
|
+
tally.attempts += 1;
|
|
208
|
+
if (stubs.has(vector.ruleId)) {
|
|
209
|
+
// The rule is the literal stub a device artifact carries, so the case observed the stub
|
|
210
|
+
// rather than the authored check and proves no branch of it.
|
|
211
|
+
observed.push({
|
|
212
|
+
target: { kind: 'rule', ruleId: vector.ruleId },
|
|
213
|
+
refusal: 'undecided',
|
|
214
|
+
});
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (vector.verdict.ok) {
|
|
218
|
+
if (tally === undefined)
|
|
219
|
+
continue;
|
|
220
|
+
const credit = vector.verdict.credit;
|
|
221
|
+
if (!credit.coverageEligible) {
|
|
222
|
+
// Observed, never evidence: the rule deferred, or decided neither branch. The hint names
|
|
223
|
+
// the same refusal a suite assertion earns for the same fact.
|
|
224
|
+
observed.push({
|
|
225
|
+
target: { kind: 'rule', ruleId: vector.ruleId },
|
|
226
|
+
refusal: credit.refusal,
|
|
227
|
+
});
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (credit.fired)
|
|
231
|
+
tally.firing = true;
|
|
232
|
+
else
|
|
233
|
+
tally.nonFiring = true;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
// A case that ran and did not hold, or that was judged against a stale table, names its
|
|
237
|
+
// case; an unreadable expectation states the one sentence both entries give it, so a compile
|
|
238
|
+
// and a verification name that defect alike.
|
|
239
|
+
const named = vector.verdict.kind === 'failed_vector' || vector.verdict.kind === 'stale_dataset';
|
|
240
|
+
const text = named && vector.caseId !== undefined
|
|
241
|
+
? `case \`${vector.caseId}\`: ${vector.verdict.detail}`
|
|
242
|
+
: vector.verdict.detail;
|
|
243
|
+
const key = `${vector.verdict.kind}\u0000${vector.ruleId}`;
|
|
244
|
+
const group = failedVectors.get(key);
|
|
245
|
+
if (group === undefined) {
|
|
246
|
+
failedVectors.set(key, {
|
|
247
|
+
kind: vector.verdict.kind,
|
|
248
|
+
ruleId: vector.ruleId,
|
|
249
|
+
// A generated rule's case sits on the declaration that produced it, so a failed vector
|
|
250
|
+
// names that member rather than the artifact slot the author never wrote.
|
|
251
|
+
path: evidencePathOf(declarations, vector.ruleId, vector.path),
|
|
252
|
+
first: text,
|
|
253
|
+
count: 1,
|
|
254
|
+
});
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
group.count += 1;
|
|
258
|
+
}
|
|
259
|
+
for (const group of failedVectors.values()) {
|
|
260
|
+
failures.push({
|
|
261
|
+
kind: group.kind,
|
|
262
|
+
ruleId: group.ruleId,
|
|
263
|
+
path: group.path,
|
|
264
|
+
detail: group.count === 1
|
|
265
|
+
? group.first
|
|
266
|
+
: group.kind === 'stale_dataset'
|
|
267
|
+
? `${String(group.count)} cases were judged against a table that could not answer; the first is ${group.first}`
|
|
268
|
+
: `${String(group.count)} cases did not hold; the first is ${group.first}`,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
const suites = suiteDocuments.map((suite) => runScenarioSuite(compiled, suite, { datasets: documents, environment: committed, behaviour }));
|
|
272
|
+
const suiteFailures = suites.flatMap((report, suiteIndex) => judgeSuite(report, suiteIndex, tallies, observed, compiled, stubs));
|
|
273
|
+
failures.push(...suiteFailures);
|
|
274
|
+
return finish(compiled, {
|
|
275
|
+
behaviour,
|
|
276
|
+
environment: committed,
|
|
277
|
+
datasetHashes: pins.pins,
|
|
278
|
+
coverage: coverageOf(tallies),
|
|
279
|
+
observedOnly: dedupeObserved(observed),
|
|
280
|
+
vectors,
|
|
281
|
+
suites,
|
|
282
|
+
failures,
|
|
283
|
+
}, declarations);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The hint list without repeats: one entry per target and reason, however many scenarios showed
|
|
287
|
+
* it. A hint says "assert this", so a run that observed it twice still has one thing to write.
|
|
288
|
+
*/
|
|
289
|
+
function dedupeObserved(observed) {
|
|
290
|
+
const seen = new Set();
|
|
291
|
+
return observed.filter((entry) => {
|
|
292
|
+
const key = JSON.stringify([entry.refusal, entry.target]);
|
|
293
|
+
if (seen.has(key))
|
|
294
|
+
return false;
|
|
295
|
+
seen.add(key);
|
|
296
|
+
return true;
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Judges one suite against the artifact: its stale cases, its failed claims, and the credit that
|
|
301
|
+
* counts.
|
|
302
|
+
*
|
|
303
|
+
* A suite states one gap however many of its claims failed, naming the count and the first. A gap
|
|
304
|
+
* per claim would make a stored report as large as the failure it records — the thing the report's
|
|
305
|
+
* shape exists to avoid — and would print the same matrix the command already prints under
|
|
306
|
+
* `--max-diagnostics`. Every claim stays in the run's transcript and in those capped lines. The
|
|
307
|
+
* same bound holds for stale cases: one scenario's stale table is usually every scenario's, so
|
|
308
|
+
* the suite names the first case and the count.
|
|
309
|
+
*/
|
|
310
|
+
function judgeSuite(report, suiteIndex, tallies, observed, compiled, stubs) {
|
|
311
|
+
const suitePath = `$.suites[${String(suiteIndex)}]`;
|
|
312
|
+
if (report.status === 'invalid') {
|
|
313
|
+
// A refused suite ran nothing, so it contributes no coverage and its reasons are one gap; the
|
|
314
|
+
// report's own diagnostics carry every reason, and the command prints them under the cap.
|
|
315
|
+
const [first] = report.diagnostics;
|
|
316
|
+
if (first === undefined) {
|
|
317
|
+
throw new Error('the scenario runner reported an invalid suite with no diagnostic');
|
|
318
|
+
}
|
|
319
|
+
return [
|
|
320
|
+
{
|
|
321
|
+
kind: 'invalid_suite',
|
|
322
|
+
path: suitePath,
|
|
323
|
+
detail: report.diagnostics.length === 1
|
|
324
|
+
? `the suite was refused: ${first.path}: ${first.detail}`
|
|
325
|
+
: `the suite was refused for ${String(report.diagnostics.length)} reasons; the first is ${first.path}: ${first.detail}`,
|
|
326
|
+
},
|
|
327
|
+
];
|
|
328
|
+
}
|
|
329
|
+
const gaps = [];
|
|
330
|
+
const stale = report.scenarios.flatMap((scenario, scenarioIndex) => scenario.stale === undefined ? [] : [{ scenario, scenarioIndex, first: scenario.stale[0] }]);
|
|
331
|
+
const [firstStale] = stale;
|
|
332
|
+
if (firstStale !== undefined) {
|
|
333
|
+
const table = firstStale.first;
|
|
334
|
+
const text = table === undefined
|
|
335
|
+
? ''
|
|
336
|
+
: `table \`${table.tableId}\` could not answer at the pinned version (${table.reason})`;
|
|
337
|
+
gaps.push({
|
|
338
|
+
kind: 'stale_dataset',
|
|
339
|
+
path: `${suitePath}.scenarios[${String(firstStale.scenarioIndex)}]`,
|
|
340
|
+
detail: stale.length === 1
|
|
341
|
+
? `scenario \`${firstStale.scenario.scenarioId}\`: ${text}`
|
|
342
|
+
: `${String(stale.length)} scenarios were judged against a table that could not answer; the first is scenario \`${firstStale.scenario.scenarioId}\`: ${text}`,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
const failed = [];
|
|
346
|
+
for (const [scenarioIndex, scenario] of report.scenarios.entries()) {
|
|
347
|
+
for (const assertion of scenario.assertions) {
|
|
348
|
+
const named = ruleIdOf(assertion.target, compiled);
|
|
349
|
+
if (!assertion.passed) {
|
|
350
|
+
const tally = named === undefined ? undefined : tallies.get(named);
|
|
351
|
+
if (tally !== undefined)
|
|
352
|
+
tally.attempts += 1;
|
|
353
|
+
failed.push({
|
|
354
|
+
scenarioIndex,
|
|
355
|
+
ruleId: named,
|
|
356
|
+
text: `scenario \`${scenario.scenarioId}\`: ${describeTarget(assertion.target)}: ${assertion.detail}`,
|
|
357
|
+
});
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
if (!assertion.credit.coverageEligible) {
|
|
361
|
+
if (named !== undefined) {
|
|
362
|
+
const tally = tallies.get(named);
|
|
363
|
+
if (tally !== undefined)
|
|
364
|
+
tally.attempts += 1;
|
|
365
|
+
}
|
|
366
|
+
observed.push({ target: assertion.target, refusal: assertion.credit.refusal });
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
// A coverage-eligible subject names the rule its evidence is about, but only a rule's own
|
|
370
|
+
// observation proves one of its branches: a gate item's `PASS` does not imply its gate
|
|
371
|
+
// passed, so counting it as the gate's non-firing branch would let a suite satisfy a gate no
|
|
372
|
+
// case ever observed opening. The attempt still counts, so a gate covered only through its
|
|
373
|
+
// items is told the branch is missing rather than that nothing mentioned the rule.
|
|
374
|
+
const tally = tallies.get(assertion.credit.subject.ruleId);
|
|
375
|
+
if (tally === undefined)
|
|
376
|
+
continue;
|
|
377
|
+
tally.attempts += 1;
|
|
378
|
+
if (assertion.credit.subject.kind === 'gateItem')
|
|
379
|
+
continue;
|
|
380
|
+
if (stubs.has(assertion.credit.subject.ruleId)) {
|
|
381
|
+
// The rule is the literal stub a device artifact carries: the case observed the stub, not
|
|
382
|
+
// the authored check, so it proves no branch of it.
|
|
383
|
+
observed.push({ target: assertion.target, refusal: 'undecided' });
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
if (assertion.credit.fired)
|
|
387
|
+
tally.firing = true;
|
|
388
|
+
else
|
|
389
|
+
tally.nonFiring = true;
|
|
390
|
+
}
|
|
391
|
+
for (const observation of scenario.unasserted) {
|
|
392
|
+
observed.push({ target: observation.target, refusal: observation.credit.refusal });
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
const [first] = failed;
|
|
396
|
+
if (first !== undefined) {
|
|
397
|
+
gaps.push({
|
|
398
|
+
kind: 'failed_scenario',
|
|
399
|
+
...(first.ruleId === undefined ? {} : { ruleId: first.ruleId }),
|
|
400
|
+
path: `${suitePath}.scenarios[${String(first.scenarioIndex)}]`,
|
|
401
|
+
detail: failed.length === 1
|
|
402
|
+
? first.text
|
|
403
|
+
: `${String(failed.length)} assertions did not hold; the first is ${first.text}`,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
return gaps;
|
|
407
|
+
}
|
|
408
|
+
/** The tallies as the ordered coverage the report states, in artifact rule order. */
|
|
409
|
+
function coverageOf(tallies) {
|
|
410
|
+
return [...tallies].map(([ruleId, tally]) => ({
|
|
411
|
+
ruleId,
|
|
412
|
+
kind: tally.kind,
|
|
413
|
+
attempts: tally.attempts,
|
|
414
|
+
firing: tally.firing,
|
|
415
|
+
nonFiring: tally.nonFiring,
|
|
416
|
+
}));
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* The baseline a refused run states: the caller's declaration, minus a tier no run may judge at.
|
|
420
|
+
*
|
|
421
|
+
* The declaration is the one member a refusal still reports, and it must be a value the
|
|
422
|
+
* `PublishEnvironment` contract admits: an invalid tier is named by the gap instead, and the
|
|
423
|
+
* report falls back to `DEFAULT_EVIDENCE_TIER` for the member no run could have used.
|
|
424
|
+
*/
|
|
425
|
+
function refusalBaseline(declared) {
|
|
426
|
+
if (declared === undefined)
|
|
427
|
+
return normalizeEnvironment({});
|
|
428
|
+
return normalizeEnvironment({
|
|
429
|
+
...(declared.tier === undefined || !isTier(declared.tier) ? {} : { tier: declared.tier }),
|
|
430
|
+
...(declared.recordDate === undefined ? {} : { recordDate: declared.recordDate }),
|
|
431
|
+
...(declared.capabilities === undefined ? {} : { capabilities: declared.capabilities }),
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* A run that was refused before executing anything, with the environment it states.
|
|
436
|
+
*
|
|
437
|
+
* A stored report always names the environment it was asked to judge under, so the refusal paths
|
|
438
|
+
* state the same members a completed run does; nothing is credited, and the gap says why.
|
|
439
|
+
*/
|
|
440
|
+
function refusedRun(behaviorHash, environment, gaps, tallies, datasetHashes) {
|
|
441
|
+
const environmentHash = environmentHashOf(environment);
|
|
442
|
+
return {
|
|
443
|
+
ready: false,
|
|
444
|
+
gaps,
|
|
445
|
+
behaviorHash,
|
|
446
|
+
environment,
|
|
447
|
+
environmentHash,
|
|
448
|
+
evidenceHash: evidenceHashOf({
|
|
449
|
+
behaviorHash,
|
|
450
|
+
environmentHash,
|
|
451
|
+
datasetHashes,
|
|
452
|
+
vectors: [],
|
|
453
|
+
suites: [],
|
|
454
|
+
}),
|
|
455
|
+
datasetHashes,
|
|
456
|
+
coverage: coverageOf(tallies),
|
|
457
|
+
observedOnly: [],
|
|
458
|
+
vectors: [],
|
|
459
|
+
suites: [],
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
/** Derives the verdict from the run and attaches the executed evidence to it. */
|
|
463
|
+
function finish(compiled, run, declarations) {
|
|
464
|
+
const behaviorHash = run.behaviour.behaviorHash;
|
|
465
|
+
const evidence = {
|
|
466
|
+
behaviorHash,
|
|
467
|
+
coverage: run.coverage,
|
|
468
|
+
failures: run.failures,
|
|
469
|
+
};
|
|
470
|
+
const verdict = readinessGaps(compiled, evidence, run.behaviour, declarations);
|
|
471
|
+
const environmentHash = environmentHashOf(run.environment);
|
|
472
|
+
// The failures are the fold's input and are stated once, as gaps; the report carries what the
|
|
473
|
+
// run executed and what it proved, not a second copy of why it is not ready.
|
|
474
|
+
const executed = {
|
|
475
|
+
behaviorHash,
|
|
476
|
+
environment: run.environment,
|
|
477
|
+
environmentHash,
|
|
478
|
+
evidenceHash: evidenceHashOf({
|
|
479
|
+
behaviorHash,
|
|
480
|
+
environmentHash,
|
|
481
|
+
datasetHashes: run.datasetHashes,
|
|
482
|
+
vectors: run.vectors,
|
|
483
|
+
suites: run.suites,
|
|
484
|
+
}),
|
|
485
|
+
datasetHashes: run.datasetHashes,
|
|
486
|
+
coverage: run.coverage,
|
|
487
|
+
observedOnly: run.observedOnly,
|
|
488
|
+
vectors: run.vectors,
|
|
489
|
+
suites: run.suites,
|
|
490
|
+
};
|
|
491
|
+
return verdict.ready
|
|
492
|
+
? { ready: true, ...executed }
|
|
493
|
+
: { ready: false, gaps: verdict.gaps, ...executed };
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The digest of the evidence a run executed, bound to the artifact, the environment and the
|
|
497
|
+
* table versions.
|
|
498
|
+
*
|
|
499
|
+
* The run's own transcript is projected rather than hashed whole: a report's identity is which
|
|
500
|
+
* vectors and which assertions ran, what each proved, in which environment and against which
|
|
501
|
+
* pins, not the prose of a failed scenario's trace. `behaviorHash` alone cannot distinguish two
|
|
502
|
+
* suites — `testCases` are presentation to it (`RULES-5.1.2`) — and a decision is a function of
|
|
503
|
+
* its environment, so the digest covers the baseline and every vector's and scenario's own
|
|
504
|
+
* effective environment. A case that overrode the baseline with another record date, tier or
|
|
505
|
+
* capability set is a different decision even when every verdict reads the same, and a gate that
|
|
506
|
+
* stores a report names the evidence rather than only the artifact.
|
|
507
|
+
*
|
|
508
|
+
* Deliberately not folded: `ready`, `gaps`, `coverage` and `observedOnly`. Each is derived from
|
|
509
|
+
* this evidence by `readinessGaps` over the same artifact and its rules, which `behaviorHash`
|
|
510
|
+
* commits, so a run that folds to one digest cannot fold to two verdicts. The digest commits what
|
|
511
|
+
* executed, not the conclusion drawn from it.
|
|
512
|
+
*/
|
|
513
|
+
function evidenceHashOf(run) {
|
|
514
|
+
return canonicalHash({
|
|
515
|
+
behaviorHash: run.behaviorHash,
|
|
516
|
+
environmentHash: run.environmentHash,
|
|
517
|
+
datasetHashes: run.datasetHashes,
|
|
518
|
+
vectors: run.vectors.map((vector) => ({
|
|
519
|
+
ruleId: vector.ruleId,
|
|
520
|
+
path: vector.path,
|
|
521
|
+
position: vector.position,
|
|
522
|
+
caseId: vector.caseId ?? null,
|
|
523
|
+
environment: vector.environment ?? null,
|
|
524
|
+
verdict: vector.verdict.ok
|
|
525
|
+
? { ok: true, credit: vector.verdict.credit }
|
|
526
|
+
: { ok: false, kind: vector.verdict.kind, detail: vector.verdict.detail },
|
|
527
|
+
})),
|
|
528
|
+
suites: run.suites.map((suite) => suite.status === 'invalid'
|
|
529
|
+
? { status: suite.status, diagnostics: suite.diagnostics }
|
|
530
|
+
: {
|
|
531
|
+
status: suite.status,
|
|
532
|
+
behaviorHash: suite.behaviorHash,
|
|
533
|
+
datasetHashes: suite.datasetHashes,
|
|
534
|
+
environment: suite.environment,
|
|
535
|
+
scenarios: suite.scenarios.map((scenario) => ({
|
|
536
|
+
scenarioId: scenario.scenarioId,
|
|
537
|
+
status: scenario.status,
|
|
538
|
+
environment: scenario.environment,
|
|
539
|
+
reportHash: scenario.reportHash,
|
|
540
|
+
assertions: scenario.assertions.map((assertion) => assertion.passed
|
|
541
|
+
? { target: assertion.target, passed: true, credit: assertion.credit }
|
|
542
|
+
: { target: assertion.target, passed: false, detail: assertion.detail }),
|
|
543
|
+
unasserted: scenario.unasserted,
|
|
544
|
+
})),
|
|
545
|
+
}),
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
//# sourceMappingURL=verify.js.map
|