@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,239 @@
|
|
|
1
|
+
import { AxiomError, toWireValue, wireDeclarationOf } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import { projectionPathOf } from './evidence.js';
|
|
3
|
+
/**
|
|
4
|
+
* Every reference a suite names, checked against the artifact before anything runs.
|
|
5
|
+
*
|
|
6
|
+
* The check is static: a rule, field, gate item or table the artifact does not declare cannot
|
|
7
|
+
* become true through any record, so a suite naming one is refused rather than reported as a
|
|
8
|
+
* failed assertion. A tag that states nothing about its target — a `screen` outcome on a
|
|
9
|
+
* `validate` rule, a value or screen outcome on a gate item — is refused for the same reason, and a value the
|
|
10
|
+
* artifact's declaration refuses is refused at its own path.
|
|
11
|
+
*/
|
|
12
|
+
/** Every way one suite names something the artifact cannot answer for. */
|
|
13
|
+
export function validateReferences(compiled, suite) {
|
|
14
|
+
const diagnostics = [];
|
|
15
|
+
const fields = fieldIndex(compiled.fields);
|
|
16
|
+
const rowAddressable = rowAddressableFields(compiled.fields);
|
|
17
|
+
const rules = new Map((compiled.rules ?? []).map((rule) => [rule.ruleId, rule]));
|
|
18
|
+
const declaredTables = new Set((compiled.datasets ?? []).map((ref) => ref.tableId));
|
|
19
|
+
const contextRoots = new Map((compiled.context?.roots ?? []).map((root) => [root.path.replace(/^context\./, ''), root]));
|
|
20
|
+
for (const [index, scenario] of suite.scenarios.entries()) {
|
|
21
|
+
const path = `$.scenarios[${String(index)}]`;
|
|
22
|
+
for (const [fieldId, value] of Object.entries(scenario.input.values)) {
|
|
23
|
+
const field = fields.get(fieldId);
|
|
24
|
+
if (field === undefined) {
|
|
25
|
+
diagnostics.push({
|
|
26
|
+
code: 'SCENARIOS_INVALID',
|
|
27
|
+
path: `${path}.given.values.${fieldId}`,
|
|
28
|
+
detail: `the artifact declares no field \`${fieldId}\``,
|
|
29
|
+
});
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
toWireValue(value, `${path}.given.values.${fieldId}`, wireDeclarationOf(field));
|
|
34
|
+
}
|
|
35
|
+
catch (cause) {
|
|
36
|
+
if (!(cause instanceof AxiomError))
|
|
37
|
+
throw cause;
|
|
38
|
+
diagnostics.push({
|
|
39
|
+
code: 'SCENARIOS_INVALID',
|
|
40
|
+
path: `${path}.given.values.${fieldId}`,
|
|
41
|
+
detail: cause.message,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (const [rootPath, value] of Object.entries(scenario.input.context ?? {})) {
|
|
46
|
+
const root = contextRoots.get(rootPath);
|
|
47
|
+
const valuePath = `${path}.given.context.${rootPath}`;
|
|
48
|
+
if (root === undefined) {
|
|
49
|
+
diagnostics.push({
|
|
50
|
+
code: 'SCENARIOS_INVALID',
|
|
51
|
+
path: valuePath,
|
|
52
|
+
detail: `the artifact declares no context root \`${rootPath}\``,
|
|
53
|
+
});
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
toWireValue(value, valuePath, {
|
|
58
|
+
primitive: root.primitive,
|
|
59
|
+
...(root.items === undefined ? {} : { items: root.items }),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (cause) {
|
|
63
|
+
if (!(cause instanceof AxiomError))
|
|
64
|
+
throw cause;
|
|
65
|
+
diagnostics.push({
|
|
66
|
+
code: 'SCENARIOS_INVALID',
|
|
67
|
+
path: valuePath,
|
|
68
|
+
detail: cause.message,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
for (const ref of [
|
|
73
|
+
...(scenario.input.redacted ?? []),
|
|
74
|
+
...(scenario.input.sessionWrites ?? []),
|
|
75
|
+
]) {
|
|
76
|
+
if (fields.has(ref.fieldId))
|
|
77
|
+
continue;
|
|
78
|
+
diagnostics.push({
|
|
79
|
+
code: 'SCENARIOS_INVALID',
|
|
80
|
+
path: `${path}.given`,
|
|
81
|
+
detail: `the artifact declares no field \`${ref.fieldId}\``,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
for (const tableId of scenario.datasets) {
|
|
85
|
+
if (declaredTables.has(tableId))
|
|
86
|
+
continue;
|
|
87
|
+
diagnostics.push({
|
|
88
|
+
code: 'SCENARIOS_INVALID',
|
|
89
|
+
path: `${path}.given.datasets`,
|
|
90
|
+
detail: `the artifact declares no dataset table \`${tableId}\``,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// A table the artifact pins and no document supplies is not refused here: the evaluation
|
|
94
|
+
// reports it as stale data, which is the fact the suite exists to assert.
|
|
95
|
+
for (const assertion of scenario.assertions) {
|
|
96
|
+
diagnostics.push(...assertionDiagnostics(compiled, { fields, rowAddressable, rules }, path, assertion));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return diagnostics;
|
|
100
|
+
}
|
|
101
|
+
/** Every way one assertion names something the artifact cannot answer for. */
|
|
102
|
+
function assertionDiagnostics(compiled, index, path, assertion) {
|
|
103
|
+
const { fields, rowAddressable, rules } = index;
|
|
104
|
+
const refuse = (detail) => [
|
|
105
|
+
{ code: 'SCENARIOS_INVALID', path, detail },
|
|
106
|
+
];
|
|
107
|
+
switch (assertion.kind) {
|
|
108
|
+
case 'rule': {
|
|
109
|
+
const rule = rules.get(assertion.ruleId);
|
|
110
|
+
if (rule === undefined) {
|
|
111
|
+
return refuse(`the artifact declares no rule \`${assertion.ruleId}\``);
|
|
112
|
+
}
|
|
113
|
+
if (assertion.observation.kind === 'screen' && rule.kind !== 'screen') {
|
|
114
|
+
return refuse(`a \`${rule.kind}\` rule has no screen outcome, so the assertion states nothing about it`);
|
|
115
|
+
}
|
|
116
|
+
if (assertion.observation.kind === 'value' && !isWriterKind(rule.kind)) {
|
|
117
|
+
return refuse(`a \`${rule.kind}\` rule states an outcome, not a value`);
|
|
118
|
+
}
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
case 'gateItem': {
|
|
122
|
+
const gate = rules.get(assertion.ruleId);
|
|
123
|
+
if (gate === undefined || gate.kind !== 'gate') {
|
|
124
|
+
return refuse(`the artifact declares no gate \`${assertion.ruleId}\``);
|
|
125
|
+
}
|
|
126
|
+
if (!(gate.gate?.items ?? []).some((item) => item.itemId === assertion.itemId)) {
|
|
127
|
+
return refuse(`gate \`${assertion.ruleId}\` declares no item \`${assertion.itemId}\``);
|
|
128
|
+
}
|
|
129
|
+
if (assertion.observation.kind === 'value') {
|
|
130
|
+
return refuse(`gate item \`${assertion.itemId}\` states an outcome, not a value`);
|
|
131
|
+
}
|
|
132
|
+
if (assertion.observation.kind === 'screen') {
|
|
133
|
+
return refuse(`gate item \`${assertion.itemId}\` states an outcome, not a screen outcome`);
|
|
134
|
+
}
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
case 'gateStatus':
|
|
138
|
+
case 'gateOutcome': {
|
|
139
|
+
const gate = rules.get(assertion.ruleId);
|
|
140
|
+
return gate !== undefined && gate.kind === 'gate'
|
|
141
|
+
? []
|
|
142
|
+
: refuse(`the artifact declares no gate \`${assertion.ruleId}\``);
|
|
143
|
+
}
|
|
144
|
+
case 'gateUndeterminedItem': {
|
|
145
|
+
const gate = rules.get(assertion.ruleId);
|
|
146
|
+
if (gate === undefined || gate.kind !== 'gate') {
|
|
147
|
+
return refuse(`the artifact declares no gate \`${assertion.ruleId}\``);
|
|
148
|
+
}
|
|
149
|
+
return (gate.gate?.items ?? []).some((item) => item.itemId === assertion.itemId)
|
|
150
|
+
? []
|
|
151
|
+
: refuse(`gate \`${assertion.ruleId}\` declares no item \`${assertion.itemId}\``);
|
|
152
|
+
}
|
|
153
|
+
case 'screenOutcome':
|
|
154
|
+
case 'screenReason': {
|
|
155
|
+
const screen = rules.get(assertion.ruleId);
|
|
156
|
+
return screen !== undefined && screen.kind === 'screen'
|
|
157
|
+
? []
|
|
158
|
+
: refuse(`the artifact declares no screen \`${assertion.ruleId}\``);
|
|
159
|
+
}
|
|
160
|
+
case 'computed': {
|
|
161
|
+
const writers = (compiled.rules ?? []).filter((rule) => rule.scope !== 'item' && rule.fieldId === assertion.fieldId && isWriterKind(rule.kind));
|
|
162
|
+
if (writers.length === 1)
|
|
163
|
+
return [];
|
|
164
|
+
return refuse(writers.length === 0
|
|
165
|
+
? `no rule writes \`${assertion.fieldId}\`, so it holds no computed value`
|
|
166
|
+
: `\`${assertion.fieldId}\` is written by ${String(writers.length)} rules, so one value is not its answer`);
|
|
167
|
+
}
|
|
168
|
+
case 'rowFact':
|
|
169
|
+
return rowAddressable.has(assertion.fieldId)
|
|
170
|
+
? []
|
|
171
|
+
: refuse(`\`${assertion.fieldId}\` addresses no rows: it is neither an array nor a member of one`);
|
|
172
|
+
case 'ready':
|
|
173
|
+
return [];
|
|
174
|
+
case 'exportIncludes':
|
|
175
|
+
case 'exportExcludes':
|
|
176
|
+
case 'exportValue': {
|
|
177
|
+
// An export assertion names a value the submission carries, and the projection carries a
|
|
178
|
+
// record member inside its container. A value a list holds once per row has no member an
|
|
179
|
+
// assertion without a row key can state, so it is refused rather than reported absent —
|
|
180
|
+
// which would make `excludes` pass for every row the submission carries.
|
|
181
|
+
const projected = projectionPathOf(compiled, assertion.fieldId);
|
|
182
|
+
switch (projected.kind) {
|
|
183
|
+
case 'path':
|
|
184
|
+
return [];
|
|
185
|
+
case 'under_list':
|
|
186
|
+
return refuse(`\`${assertion.fieldId}\` is carried once per row of a list, so no export assertion addresses it`);
|
|
187
|
+
case 'undeclared':
|
|
188
|
+
return refuse(`the artifact declares no field \`${assertion.fieldId}\``);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
case 'fieldVisible':
|
|
192
|
+
case 'fieldHidden':
|
|
193
|
+
case 'fieldRequired':
|
|
194
|
+
case 'fieldMissingRequired':
|
|
195
|
+
case 'fieldDisabled':
|
|
196
|
+
return fields.has(assertion.fieldId)
|
|
197
|
+
? []
|
|
198
|
+
: refuse(`the artifact declares no field \`${assertion.fieldId}\``);
|
|
199
|
+
case 'exportRefused':
|
|
200
|
+
return [];
|
|
201
|
+
default:
|
|
202
|
+
return assertNever(assertion);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/** Every declaration that holds one value per row: an array and each of its members. */
|
|
206
|
+
function rowAddressableFields(fields) {
|
|
207
|
+
const addressable = new Set();
|
|
208
|
+
const visit = (members) => {
|
|
209
|
+
for (const field of members) {
|
|
210
|
+
if (field.primitive === 'array') {
|
|
211
|
+
addressable.add(field.fieldId);
|
|
212
|
+
for (const member of field.fields ?? [])
|
|
213
|
+
addressable.add(member.fieldId);
|
|
214
|
+
}
|
|
215
|
+
visit(field.fields ?? []);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
visit(fields);
|
|
219
|
+
return addressable;
|
|
220
|
+
}
|
|
221
|
+
/** Every declared field, by the id an assertion or a submitted value names it by. */
|
|
222
|
+
function fieldIndex(fields) {
|
|
223
|
+
const index = new Map();
|
|
224
|
+
const visit = (members) => {
|
|
225
|
+
for (const field of members) {
|
|
226
|
+
index.set(field.fieldId, field);
|
|
227
|
+
visit(field.fields ?? []);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
visit(fields);
|
|
231
|
+
return index;
|
|
232
|
+
}
|
|
233
|
+
function isWriterKind(kind) {
|
|
234
|
+
return kind === 'compute' || kind === 'defaultCompute';
|
|
235
|
+
}
|
|
236
|
+
function assertNever(value) {
|
|
237
|
+
throw new Error(`unhandled scenario assertion ${JSON.stringify(value)}`);
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../src/scenarios/references.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD;;;;;;;;GAQG;AAEH,0EAA0E;AAC1E,MAAM,UAAU,kBAAkB,CAChC,QAAwB,EACxB,KAA4B;IAE5B,MAAM,WAAW,GAAyB,EAAE,CAAC;IAC7C,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,cAAc,GAAG,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7D,MA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,KAAK,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;gBAChC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC/B,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE;oBAAE,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3E,CAAC;YACD,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;IACF,KAAK,CAAC,MAAM,CAAC,CAAC;IACd,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,qFAAqF;AACrF,SAAS,UAAU,CAAC,MAAgC;IAClD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC/C,MAAM,KAAK,GAAG,CAAC,OAAiC,EAAQ,EAAE;QACxD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;IACF,KAAK,CAAC,MAAM,CAAC,CAAC;IACd,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,YAAY,CAAC,IAAc;IAClC,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,gBAAgB,CAAC;AACzD,CAAC;AAED,SAAS,WAAW,CAAC,KAAY;IAC/B,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import { AxiomError, toWireValue, wireDeclarationOf } from '@azx-pbc/axiom-runtime';\nimport type { CompiledField, CompiledRule, CompiledSchema, RuleKind } from '@azx-pbc/axiom-runtime';\nimport type { ScenarioAssertion, ScenarioSuiteDocument } from './document.js';\nimport { projectionPathOf } from './evidence.js';\nimport type { ScenarioDiagnostic } from './report.js';\n\n/**\n * Every reference a suite names, checked against the artifact before anything runs.\n *\n * The check is static: a rule, field, gate item or table the artifact does not declare cannot\n * become true through any record, so a suite naming one is refused rather than reported as a\n * failed assertion. A tag that states nothing about its target — a `screen` outcome on a\n * `validate` rule, a value or screen outcome on a gate item — is refused for the same reason, and a value the\n * artifact's declaration refuses is refused at its own path.\n */\n\n/** Every way one suite names something the artifact cannot answer for. */\nexport function validateReferences(\n compiled: CompiledSchema,\n suite: ScenarioSuiteDocument,\n): readonly ScenarioDiagnostic[] {\n const diagnostics: ScenarioDiagnostic[] = [];\n const fields = fieldIndex(compiled.fields);\n const rowAddressable = rowAddressableFields(compiled.fields);\n const rules = new Map((compiled.rules ?? []).map((rule) => [rule.ruleId, rule] as const));\n const declaredTables = new Set((compiled.datasets ?? []).map((ref) => ref.tableId));\n const contextRoots = new Map(\n (compiled.context?.roots ?? []).map(\n (root) => [root.path.replace(/^context\\./, ''), root] as const,\n ),\n );\n for (const [index, scenario] of suite.scenarios.entries()) {\n const path = `$.scenarios[${String(index)}]`;\n for (const [fieldId, value] of Object.entries(scenario.input.values)) {\n const field = fields.get(fieldId);\n if (field === undefined) {\n diagnostics.push({\n code: 'SCENARIOS_INVALID',\n path: `${path}.given.values.${fieldId}`,\n detail: `the artifact declares no field \\`${fieldId}\\``,\n });\n continue;\n }\n try {\n toWireValue(value, `${path}.given.values.${fieldId}`, wireDeclarationOf(field));\n } catch (cause) {\n if (!(cause instanceof AxiomError)) throw cause;\n diagnostics.push({\n code: 'SCENARIOS_INVALID',\n path: `${path}.given.values.${fieldId}`,\n detail: cause.message,\n });\n }\n }\n for (const [rootPath, value] of Object.entries(scenario.input.context ?? {})) {\n const root = contextRoots.get(rootPath);\n const valuePath = `${path}.given.context.${rootPath}`;\n if (root === undefined) {\n diagnostics.push({\n code: 'SCENARIOS_INVALID',\n path: valuePath,\n detail: `the artifact declares no context root \\`${rootPath}\\``,\n });\n continue;\n }\n try {\n toWireValue(value, valuePath, {\n primitive: root.primitive,\n ...(root.items === undefined ? {} : { items: root.items }),\n });\n } catch (cause) {\n if (!(cause instanceof AxiomError)) throw cause;\n diagnostics.push({\n code: 'SCENARIOS_INVALID',\n path: valuePath,\n detail: cause.message,\n });\n }\n }\n for (const ref of [\n ...(scenario.input.redacted ?? []),\n ...(scenario.input.sessionWrites ?? []),\n ]) {\n if (fields.has(ref.fieldId)) continue;\n diagnostics.push({\n code: 'SCENARIOS_INVALID',\n path: `${path}.given`,\n detail: `the artifact declares no field \\`${ref.fieldId}\\``,\n });\n }\n for (const tableId of scenario.datasets) {\n if (declaredTables.has(tableId)) continue;\n diagnostics.push({\n code: 'SCENARIOS_INVALID',\n path: `${path}.given.datasets`,\n detail: `the artifact declares no dataset table \\`${tableId}\\``,\n });\n }\n // A table the artifact pins and no document supplies is not refused here: the evaluation\n // reports it as stale data, which is the fact the suite exists to assert.\n for (const assertion of scenario.assertions) {\n diagnostics.push(\n ...assertionDiagnostics(compiled, { fields, rowAddressable, rules }, path, assertion),\n );\n }\n }\n return diagnostics;\n}\n\n/** The declarations one assertion is checked against. */\ninterface ReferenceIndex {\n readonly fields: ReadonlyMap<string, CompiledField>;\n /** Every array and every member of one: the declarations that hold one value per row. */\n readonly rowAddressable: ReadonlySet<string>;\n readonly rules: ReadonlyMap<string, CompiledRule>;\n}\n\n/** Every way one assertion names something the artifact cannot answer for. */\nfunction assertionDiagnostics(\n compiled: CompiledSchema,\n index: ReferenceIndex,\n path: string,\n assertion: ScenarioAssertion,\n): readonly ScenarioDiagnostic[] {\n const { fields, rowAddressable, rules } = index;\n const refuse = (detail: string): readonly ScenarioDiagnostic[] => [\n { code: 'SCENARIOS_INVALID', path, detail },\n ];\n switch (assertion.kind) {\n case 'rule': {\n const rule = rules.get(assertion.ruleId);\n if (rule === undefined) {\n return refuse(`the artifact declares no rule \\`${assertion.ruleId}\\``);\n }\n if (assertion.observation.kind === 'screen' && rule.kind !== 'screen') {\n return refuse(\n `a \\`${rule.kind}\\` rule has no screen outcome, so the assertion states nothing about it`,\n );\n }\n if (assertion.observation.kind === 'value' && !isWriterKind(rule.kind)) {\n return refuse(`a \\`${rule.kind}\\` rule states an outcome, not a value`);\n }\n return [];\n }\n case 'gateItem': {\n const gate = rules.get(assertion.ruleId);\n if (gate === undefined || gate.kind !== 'gate') {\n return refuse(`the artifact declares no gate \\`${assertion.ruleId}\\``);\n }\n if (!(gate.gate?.items ?? []).some((item) => item.itemId === assertion.itemId)) {\n return refuse(`gate \\`${assertion.ruleId}\\` declares no item \\`${assertion.itemId}\\``);\n }\n if (assertion.observation.kind === 'value') {\n return refuse(`gate item \\`${assertion.itemId}\\` states an outcome, not a value`);\n }\n if (assertion.observation.kind === 'screen') {\n return refuse(`gate item \\`${assertion.itemId}\\` states an outcome, not a screen outcome`);\n }\n return [];\n }\n case 'gateStatus':\n case 'gateOutcome': {\n const gate = rules.get(assertion.ruleId);\n return gate !== undefined && gate.kind === 'gate'\n ? []\n : refuse(`the artifact declares no gate \\`${assertion.ruleId}\\``);\n }\n case 'gateUndeterminedItem': {\n const gate = rules.get(assertion.ruleId);\n if (gate === undefined || gate.kind !== 'gate') {\n return refuse(`the artifact declares no gate \\`${assertion.ruleId}\\``);\n }\n return (gate.gate?.items ?? []).some((item) => item.itemId === assertion.itemId)\n ? []\n : refuse(`gate \\`${assertion.ruleId}\\` declares no item \\`${assertion.itemId}\\``);\n }\n case 'screenOutcome':\n case 'screenReason': {\n const screen = rules.get(assertion.ruleId);\n return screen !== undefined && screen.kind === 'screen'\n ? []\n : refuse(`the artifact declares no screen \\`${assertion.ruleId}\\``);\n }\n case 'computed': {\n const writers = (compiled.rules ?? []).filter(\n (rule) =>\n rule.scope !== 'item' && rule.fieldId === assertion.fieldId && isWriterKind(rule.kind),\n );\n if (writers.length === 1) return [];\n return refuse(\n writers.length === 0\n ? `no rule writes \\`${assertion.fieldId}\\`, so it holds no computed value`\n : `\\`${assertion.fieldId}\\` is written by ${String(writers.length)} rules, so one value is not its answer`,\n );\n }\n case 'rowFact':\n return rowAddressable.has(assertion.fieldId)\n ? []\n : refuse(\n `\\`${assertion.fieldId}\\` addresses no rows: it is neither an array nor a member of one`,\n );\n case 'ready':\n return [];\n case 'exportIncludes':\n case 'exportExcludes':\n case 'exportValue': {\n // An export assertion names a value the submission carries, and the projection carries a\n // record member inside its container. A value a list holds once per row has no member an\n // assertion without a row key can state, so it is refused rather than reported absent —\n // which would make `excludes` pass for every row the submission carries.\n const projected = projectionPathOf(compiled, assertion.fieldId);\n switch (projected.kind) {\n case 'path':\n return [];\n case 'under_list':\n return refuse(\n `\\`${assertion.fieldId}\\` is carried once per row of a list, so no export assertion addresses it`,\n );\n case 'undeclared':\n return refuse(`the artifact declares no field \\`${assertion.fieldId}\\``);\n }\n }\n case 'fieldVisible':\n case 'fieldHidden':\n case 'fieldRequired':\n case 'fieldMissingRequired':\n case 'fieldDisabled':\n return fields.has(assertion.fieldId)\n ? []\n : refuse(`the artifact declares no field \\`${assertion.fieldId}\\``);\n case 'exportRefused':\n return [];\n default:\n return assertNever(assertion);\n }\n}\n\n/** Every declaration that holds one value per row: an array and each of its members. */\nfunction rowAddressableFields(fields: readonly CompiledField[]): ReadonlySet<string> {\n const addressable = new Set<string>();\n const visit = (members: readonly CompiledField[]): void => {\n for (const field of members) {\n if (field.primitive === 'array') {\n addressable.add(field.fieldId);\n for (const member of field.fields ?? []) addressable.add(member.fieldId);\n }\n visit(field.fields ?? []);\n }\n };\n visit(fields);\n return addressable;\n}\n\n/** Every declared field, by the id an assertion or a submitted value names it by. */\nfunction fieldIndex(fields: readonly CompiledField[]): ReadonlyMap<string, CompiledField> {\n const index = new Map<string, CompiledField>();\n const visit = (members: readonly CompiledField[]): void => {\n for (const field of members) {\n index.set(field.fieldId, field);\n visit(field.fields ?? []);\n }\n };\n visit(fields);\n return index;\n}\n\nfunction isWriterKind(kind: RuleKind): boolean {\n return kind === 'compute' || kind === 'defaultCompute';\n}\n\nfunction assertNever(value: never): never {\n throw new Error(`unhandled scenario assertion ${JSON.stringify(value)}`);\n}\n"]}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { EvaluationExplanation, StaleLookupProvenance } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import type { ResolvedDatasetPin } from '@azx-pbc/axiom-runtime/lookup';
|
|
3
|
+
import type { CommittedEnvironment } from './environment.js';
|
|
4
|
+
/**
|
|
5
|
+
* Why a passing assertion earns no coverage credit.
|
|
6
|
+
*
|
|
7
|
+
* Credit is evidence a publisher may act on, so every way an assertion can pass without
|
|
8
|
+
* proving what a rule did is named rather than silently discounted: nothing asserted the
|
|
9
|
+
* observation, the assertion is not about one rule, the rule could not be evaluated, a default
|
|
10
|
+
* kept a stored value, more than one cause (or a cascade) hides the witness, an item-scoped
|
|
11
|
+
* rule decided no row, the device never evaluated the rule at all, or the rule ran and decided
|
|
12
|
+
* neither branch.
|
|
13
|
+
*/
|
|
14
|
+
export type CreditRefusal = 'unasserted' | 'not_causal' | 'engine_error' | 'override' | 'ambiguous' | 'no_rows' | 'deferred' | 'undecided';
|
|
15
|
+
/** The rule a credited assertion is evidence about. */
|
|
16
|
+
export type CoverageSubject = {
|
|
17
|
+
readonly kind: 'rule';
|
|
18
|
+
readonly ruleId: string;
|
|
19
|
+
readonly rowKey?: string | number;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'gateItem';
|
|
22
|
+
readonly ruleId: string;
|
|
23
|
+
readonly itemId: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Whether one assertion is evidence, and what it is evidence about.
|
|
27
|
+
*
|
|
28
|
+
* `fired` carries the runtime firing table's answer for the observation the assertion made, so
|
|
29
|
+
* a consumer counting firing and non-firing branches reads one fact rather than re-deriving it
|
|
30
|
+
* from the observation.
|
|
31
|
+
*/
|
|
32
|
+
export type AssertionCredit = {
|
|
33
|
+
readonly coverageEligible: true;
|
|
34
|
+
readonly subject: CoverageSubject;
|
|
35
|
+
readonly fired: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
readonly coverageEligible: false;
|
|
38
|
+
readonly refusal: CreditRefusal;
|
|
39
|
+
};
|
|
40
|
+
/** The per-row facts a scenario may state about one row. */
|
|
41
|
+
export type RowFact = 'required' | 'enabled' | 'fillable' | 'missingRequired';
|
|
42
|
+
/**
|
|
43
|
+
* What one assertion names, without the value it expects.
|
|
44
|
+
*
|
|
45
|
+
* The report records identity, not a second copy of the suite: a target says which field, rule
|
|
46
|
+
* or gate item was asserted, and the expectation itself stays in the document it was read from.
|
|
47
|
+
* A row is named by the row key the evaluation addressed — the wire-typed key where the row was
|
|
48
|
+
* addressed, the authored key text where it was not.
|
|
49
|
+
*/
|
|
50
|
+
export type AssertionTarget = {
|
|
51
|
+
readonly kind: 'rule';
|
|
52
|
+
readonly ruleId: string;
|
|
53
|
+
readonly rowKey?: string | number;
|
|
54
|
+
} | {
|
|
55
|
+
readonly kind: 'gateItem';
|
|
56
|
+
readonly ruleId: string;
|
|
57
|
+
readonly itemId: string;
|
|
58
|
+
} | {
|
|
59
|
+
readonly kind: 'ready';
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'fieldVisible';
|
|
62
|
+
readonly fieldId: string;
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: 'fieldHidden';
|
|
65
|
+
readonly fieldId: string;
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: 'fieldRequired';
|
|
68
|
+
readonly fieldId: string;
|
|
69
|
+
} | {
|
|
70
|
+
readonly kind: 'fieldMissingRequired';
|
|
71
|
+
readonly fieldId: string;
|
|
72
|
+
} | {
|
|
73
|
+
readonly kind: 'fieldDisabled';
|
|
74
|
+
readonly fieldId: string;
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: 'rowFact';
|
|
77
|
+
readonly fieldId: string;
|
|
78
|
+
readonly rowKey: string | number;
|
|
79
|
+
readonly fact: RowFact;
|
|
80
|
+
} | {
|
|
81
|
+
readonly kind: 'computed';
|
|
82
|
+
readonly fieldId: string;
|
|
83
|
+
} | {
|
|
84
|
+
readonly kind: 'gateStatus';
|
|
85
|
+
readonly ruleId: string;
|
|
86
|
+
} | {
|
|
87
|
+
readonly kind: 'gateOutcome';
|
|
88
|
+
readonly ruleId: string;
|
|
89
|
+
} | {
|
|
90
|
+
readonly kind: 'gateUndeterminedItem';
|
|
91
|
+
readonly ruleId: string;
|
|
92
|
+
readonly itemId: string;
|
|
93
|
+
} | {
|
|
94
|
+
readonly kind: 'screenOutcome';
|
|
95
|
+
readonly ruleId: string;
|
|
96
|
+
} | {
|
|
97
|
+
readonly kind: 'screenReason';
|
|
98
|
+
readonly ruleId: string;
|
|
99
|
+
readonly code: string;
|
|
100
|
+
} | {
|
|
101
|
+
readonly kind: 'exportIncludes';
|
|
102
|
+
readonly fieldId: string;
|
|
103
|
+
} | {
|
|
104
|
+
readonly kind: 'exportExcludes';
|
|
105
|
+
readonly fieldId: string;
|
|
106
|
+
} | {
|
|
107
|
+
readonly kind: 'exportValue';
|
|
108
|
+
readonly fieldId: string;
|
|
109
|
+
} | {
|
|
110
|
+
readonly kind: 'exportRefused';
|
|
111
|
+
readonly code: string;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* One assertion's result.
|
|
115
|
+
*
|
|
116
|
+
* A failed assertion states what was observed instead and no credit: there is no evidence in a
|
|
117
|
+
* claim the run contradicted. A passing one states what its evidence is worth.
|
|
118
|
+
*/
|
|
119
|
+
export type ResolvedAssertion = {
|
|
120
|
+
readonly target: AssertionTarget;
|
|
121
|
+
readonly passed: true;
|
|
122
|
+
readonly credit: AssertionCredit;
|
|
123
|
+
} | {
|
|
124
|
+
readonly target: AssertionTarget;
|
|
125
|
+
readonly passed: false;
|
|
126
|
+
readonly detail: string;
|
|
127
|
+
};
|
|
128
|
+
/** An explicit target whose observation fired and that no assertion covered. */
|
|
129
|
+
export interface UnassertedObservation {
|
|
130
|
+
readonly target: AssertionTarget;
|
|
131
|
+
readonly credit: {
|
|
132
|
+
readonly coverageEligible: false;
|
|
133
|
+
readonly refusal: 'unasserted';
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/** One scenario's assertions, judged against one evaluation. */
|
|
137
|
+
export interface ScenarioResult {
|
|
138
|
+
readonly scenarioId: string;
|
|
139
|
+
/** `passed` when every assertion held; a failing assertion is why it did not. */
|
|
140
|
+
readonly status: 'passed' | 'failed';
|
|
141
|
+
/**
|
|
142
|
+
* The environment this scenario actually evaluated under, after its own `given` overrode the
|
|
143
|
+
* suite baseline. Any member a `given` declared is what the evaluation read, so a report never
|
|
144
|
+
* labels a decision with a tier, record date or capability set the run did not use.
|
|
145
|
+
*/
|
|
146
|
+
readonly environment: CommittedEnvironment;
|
|
147
|
+
/** The digest of the report the scenario produced, sealed from the same evaluation. */
|
|
148
|
+
readonly reportHash: string;
|
|
149
|
+
readonly assertions: readonly ResolvedAssertion[];
|
|
150
|
+
/**
|
|
151
|
+
* Explicit targets that fired but were not asserted, kept apart from the assertions because
|
|
152
|
+
* they are a hint about what the suite could prove, never evidence of what it did.
|
|
153
|
+
*/
|
|
154
|
+
readonly unasserted: readonly UnassertedObservation[];
|
|
155
|
+
/**
|
|
156
|
+
* The tables this scenario's evaluation reached and could not resolve at the version the
|
|
157
|
+
* artifact pins, canonically ordered. Absent when every lookup answered.
|
|
158
|
+
*
|
|
159
|
+
* A scenario judged under a stale table is a case whose data did not resolve, so its evidence
|
|
160
|
+
* is not bound to the pin the report names: a publisher reads the stale case by name rather
|
|
161
|
+
* than a branch gap that says nothing about why the branch is missing.
|
|
162
|
+
*/
|
|
163
|
+
readonly stale?: readonly StaleLookupProvenance[];
|
|
164
|
+
/** `explain()` of the same record, present only when the scenario failed. */
|
|
165
|
+
readonly explanation?: EvaluationExplanation;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* What an assertion names, in one line.
|
|
169
|
+
*
|
|
170
|
+
* One renderer for the target union, so a run's failure lines, a publish gap and a coverage hint
|
|
171
|
+
* all name the same fact the same way.
|
|
172
|
+
*/
|
|
173
|
+
export declare function describeTarget(target: AssertionTarget): string;
|
|
174
|
+
/**
|
|
175
|
+
* The refusal codes the scenario-suite layer states.
|
|
176
|
+
*
|
|
177
|
+
* `CSV_BOUNDS` is the one a JSON suite cannot produce: a flat matrix that exceeds an input
|
|
178
|
+
* cap. It travels the same diagnostic shape because the CLI prints one line per reason and
|
|
179
|
+
* a caller narrows on the code rather than on the text.
|
|
180
|
+
*
|
|
181
|
+
* A capture states no code of its own: a capture that cannot be written is refused by the
|
|
182
|
+
* same parser and reference checks a hand-written suite passes through, so one document shape
|
|
183
|
+
* has one refusal rather than a second authority in the capture.
|
|
184
|
+
*/
|
|
185
|
+
export type ScenarioDiagnosticCode = 'SCENARIOS_INVALID' | 'CSV_BOUNDS';
|
|
186
|
+
/** One refusal, with the document or artifact location that caused it. */
|
|
187
|
+
export interface ScenarioDiagnostic {
|
|
188
|
+
readonly code: ScenarioDiagnosticCode;
|
|
189
|
+
readonly path: string;
|
|
190
|
+
readonly detail: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* One suite's verdict.
|
|
194
|
+
*
|
|
195
|
+
* A suite that names a rule, field, gate item or table the artifact does not declare is
|
|
196
|
+
* refused before anything runs, so an `invalid` report carries the reasons and no results. A
|
|
197
|
+
* run binds its per-assertion results to the artifact's behaviour hash and to the table
|
|
198
|
+
* versions it resolved them against.
|
|
199
|
+
*
|
|
200
|
+
* An executed report states the baseline environment the run started from, normalized, and every
|
|
201
|
+
* `ScenarioResult` states the environment that scenario actually judged under. A `given` may
|
|
202
|
+
* override a baseline member, so the two can differ by design; neither is a claim about the
|
|
203
|
+
* other, and a reader that needs the environment of a decision reads the scenario's.
|
|
204
|
+
*/
|
|
205
|
+
export type ScenarioSuiteReport = {
|
|
206
|
+
readonly status: 'invalid';
|
|
207
|
+
readonly diagnostics: readonly ScenarioDiagnostic[];
|
|
208
|
+
} | {
|
|
209
|
+
readonly status: 'passed' | 'failed';
|
|
210
|
+
readonly behaviorHash: string;
|
|
211
|
+
readonly datasetHashes: readonly ResolvedDatasetPin[];
|
|
212
|
+
/** The baseline environment every scenario started from, normalized. */
|
|
213
|
+
readonly environment: CommittedEnvironment;
|
|
214
|
+
readonly scenarios: readonly ScenarioResult[];
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/scenarios/report.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,UAAU,GACV,WAAW,GACX,SAAS,GACT,UAAU,GACV,WAAW,CAAC;AAEhB,uDAAuD;AACvD,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACrF;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACvB;IACE,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,GACD;IAAE,QAAQ,CAA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C,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,GACnF;IACE,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACtD,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { assertNever } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* What an assertion names, in one line.
|
|
4
|
+
*
|
|
5
|
+
* One renderer for the target union, so a run's failure lines, a publish gap and a coverage hint
|
|
6
|
+
* all name the same fact the same way.
|
|
7
|
+
*/
|
|
8
|
+
export function describeTarget(target) {
|
|
9
|
+
switch (target.kind) {
|
|
10
|
+
case 'rule':
|
|
11
|
+
return target.rowKey === undefined
|
|
12
|
+
? `rule \`${target.ruleId}\``
|
|
13
|
+
: `rule \`${target.ruleId}\` at row ${String(target.rowKey)}`;
|
|
14
|
+
case 'gateItem':
|
|
15
|
+
return `gate item \`${target.ruleId}.${target.itemId}\``;
|
|
16
|
+
case 'ready':
|
|
17
|
+
return 'the form is ready';
|
|
18
|
+
case 'fieldVisible':
|
|
19
|
+
return `\`${target.fieldId}\` is visible`;
|
|
20
|
+
case 'fieldHidden':
|
|
21
|
+
return `\`${target.fieldId}\` is hidden`;
|
|
22
|
+
case 'fieldRequired':
|
|
23
|
+
return `\`${target.fieldId}\` is required`;
|
|
24
|
+
case 'fieldMissingRequired':
|
|
25
|
+
return `\`${target.fieldId}\` is missing a required value`;
|
|
26
|
+
case 'fieldDisabled':
|
|
27
|
+
return `\`${target.fieldId}\` is disabled`;
|
|
28
|
+
case 'rowFact':
|
|
29
|
+
return `row ${String(target.rowKey)} of \`${target.fieldId}\` is ${target.fact}`;
|
|
30
|
+
case 'computed':
|
|
31
|
+
return `computed \`${target.fieldId}\``;
|
|
32
|
+
case 'gateStatus':
|
|
33
|
+
return `gate \`${target.ruleId}\` status`;
|
|
34
|
+
case 'gateOutcome':
|
|
35
|
+
return `gate \`${target.ruleId}\` outcome`;
|
|
36
|
+
case 'gateUndeterminedItem':
|
|
37
|
+
return `gate item \`${target.ruleId}.${target.itemId}\` is undetermined`;
|
|
38
|
+
case 'screenOutcome':
|
|
39
|
+
return `screen \`${target.ruleId}\` outcome`;
|
|
40
|
+
case 'screenReason':
|
|
41
|
+
return `screen \`${target.ruleId}\` reason \`${target.code}\``;
|
|
42
|
+
case 'exportIncludes':
|
|
43
|
+
return `the submission includes \`${target.fieldId}\``;
|
|
44
|
+
case 'exportExcludes':
|
|
45
|
+
return `the submission excludes \`${target.fieldId}\``;
|
|
46
|
+
case 'exportValue':
|
|
47
|
+
return `submitted \`${target.fieldId}\``;
|
|
48
|
+
case 'exportRefused':
|
|
49
|
+
return `the submission is refused as \`${target.code}\``;
|
|
50
|
+
default:
|
|
51
|
+
return assertNever(target);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/scenarios/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAkIrD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,MAAuB;IACpD,QAAQ,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YACjB,OAAO,YAAY,MAAM,CAAC,MAAM,eAAe,MAAM,CAAC,IAAI,IAAI,CAAC;QACjE,KAAK,gBAAgB;YACnB,OAAO,6BAA6B,MAAM,CAAC,OAAO,IAAI,CAAC;QACzD,KAAK,gBAAgB;YACnB,OAAO,6BAA6B,MAAM,CAAC,OAAO,IAAI,CAAC;QACzD,KAAK,aAAa;YAChB,OAAO,eAAe,MAAM,CAAC,OAAO,IAAI,CAAC;QAC3C,KAAK,eAAe;YAClB,OAAO,kCAAkC,MAAM,CAAC,IAAI,IAAI,CAAC;QAC3D;YACE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC","sourcesContent":["import { assertNever } from '@azx-pbc/axiom-runtime';\nimport type { EvaluationExplanation, StaleLookupProvenance } from '@azx-pbc/axiom-runtime';\nimport type { ResolvedDatasetPin } from '@azx-pbc/axiom-runtime/lookup';\nimport type { CommittedEnvironment } from './environment.js';\n\n/**\n * Why a passing assertion earns no coverage credit.\n *\n * Credit is evidence a publisher may act on, so every way an assertion can pass without\n * proving what a rule did is named rather than silently discounted: nothing asserted the\n * observation, the assertion is not about one rule, the rule could not be evaluated, a default\n * kept a stored value, more than one cause (or a cascade) hides the witness, an item-scoped\n * rule decided no row, the device never evaluated the rule at all, or the rule ran and decided\n * neither branch.\n */\nexport type CreditRefusal =\n | 'unasserted'\n | 'not_causal'\n | 'engine_error'\n | 'override'\n | 'ambiguous'\n | 'no_rows'\n | 'deferred'\n | 'undecided';\n\n/** The rule a credited assertion is evidence about. */\nexport type CoverageSubject =\n | { readonly kind: 'rule'; readonly ruleId: string; readonly rowKey?: string | number }\n | { readonly kind: 'gateItem'; readonly ruleId: string; readonly itemId: string };\n\n/**\n * Whether one assertion is evidence, and what it is evidence about.\n *\n * `fired` carries the runtime firing table's answer for the observation the assertion made, so\n * a consumer counting firing and non-firing branches reads one fact rather than re-deriving it\n * from the observation.\n */\nexport type AssertionCredit =\n | {\n readonly coverageEligible: true;\n readonly subject: CoverageSubject;\n readonly fired: boolean;\n }\n | { readonly coverageEligible: false; readonly refusal: CreditRefusal };\n\n/** The per-row facts a scenario may state about one row. */\nexport type RowFact = 'required' | 'enabled' | 'fillable' | 'missingRequired';\n\n/**\n * What one assertion names, without the value it expects.\n *\n * The report records identity, not a second copy of the suite: a target says which field, rule\n * or gate item was asserted, and the expectation itself stays in the document it was read from.\n * A row is named by the row key the evaluation addressed — the wire-typed key where the row was\n * addressed, the authored key text where it was not.\n */\nexport type AssertionTarget =\n | { readonly kind: 'rule'; readonly ruleId: string; readonly rowKey?: string | number }\n | { readonly kind: 'gateItem'; readonly ruleId: string; readonly itemId: string }\n | { readonly kind: 'ready' }\n | { readonly kind: 'fieldVisible'; readonly fieldId: string }\n | { readonly kind: 'fieldHidden'; readonly fieldId: string }\n | { readonly kind: 'fieldRequired'; readonly fieldId: string }\n | { readonly kind: 'fieldMissingRequired'; readonly fieldId: string }\n | { readonly kind: 'fieldDisabled'; readonly fieldId: string }\n | {\n readonly kind: 'rowFact';\n readonly fieldId: string;\n readonly rowKey: string | number;\n readonly fact: RowFact;\n }\n | { readonly kind: 'computed'; readonly fieldId: string }\n | { readonly kind: 'gateStatus'; readonly ruleId: string }\n | { readonly kind: 'gateOutcome'; readonly ruleId: string }\n | { readonly kind: 'gateUndeterminedItem'; readonly ruleId: string; readonly itemId: string }\n | { readonly kind: 'screenOutcome'; readonly ruleId: string }\n | { readonly kind: 'screenReason'; readonly ruleId: string; readonly code: string }\n | { readonly kind: 'exportIncludes'; readonly fieldId: string }\n | { readonly kind: 'exportExcludes'; readonly fieldId: string }\n | { readonly kind: 'exportValue'; readonly fieldId: string }\n | { readonly kind: 'exportRefused'; readonly code: string };\n\n/**\n * One assertion's result.\n *\n * A failed assertion states what was observed instead and no credit: there is no evidence in a\n * claim the run contradicted. A passing one states what its evidence is worth.\n */\nexport type ResolvedAssertion =\n | { readonly target: AssertionTarget; readonly passed: true; readonly credit: AssertionCredit }\n | { readonly target: AssertionTarget; readonly passed: false; readonly detail: string };\n\n/** An explicit target whose observation fired and that no assertion covered. */\nexport interface UnassertedObservation {\n readonly target: AssertionTarget;\n readonly credit: { readonly coverageEligible: false; readonly refusal: 'unasserted' };\n}\n\n/** One scenario's assertions, judged against one evaluation. */\nexport interface ScenarioResult {\n readonly scenarioId: string;\n /** `passed` when every assertion held; a failing assertion is why it did not. */\n readonly status: 'passed' | 'failed';\n /**\n * The environment this scenario actually evaluated under, after its own `given` overrode the\n * suite baseline. Any member a `given` declared is what the evaluation read, so a report never\n * labels a decision with a tier, record date or capability set the run did not use.\n */\n readonly environment: CommittedEnvironment;\n /** The digest of the report the scenario produced, sealed from the same evaluation. */\n readonly reportHash: string;\n readonly assertions: readonly ResolvedAssertion[];\n /**\n * Explicit targets that fired but were not asserted, kept apart from the assertions because\n * they are a hint about what the suite could prove, never evidence of what it did.\n */\n readonly unasserted: readonly UnassertedObservation[];\n /**\n * The tables this scenario's evaluation reached and could not resolve at the version the\n * artifact pins, canonically ordered. Absent when every lookup answered.\n *\n * A scenario judged under a stale table is a case whose data did not resolve, so its evidence\n * is not bound to the pin the report names: a publisher reads the stale case by name rather\n * than a branch gap that says nothing about why the branch is missing.\n */\n readonly stale?: readonly StaleLookupProvenance[];\n /** `explain()` of the same record, present only when the scenario failed. */\n readonly explanation?: EvaluationExplanation;\n}\n\n/**\n * What an assertion names, in one line.\n *\n * One renderer for the target union, so a run's failure lines, a publish gap and a coverage hint\n * all name the same fact the same way.\n */\nexport function describeTarget(target: AssertionTarget): string {\n switch (target.kind) {\n case 'rule':\n return target.rowKey === undefined\n ? `rule \\`${target.ruleId}\\``\n : `rule \\`${target.ruleId}\\` at row ${String(target.rowKey)}`;\n case 'gateItem':\n return `gate item \\`${target.ruleId}.${target.itemId}\\``;\n case 'ready':\n return 'the form is ready';\n case 'fieldVisible':\n return `\\`${target.fieldId}\\` is visible`;\n case 'fieldHidden':\n return `\\`${target.fieldId}\\` is hidden`;\n case 'fieldRequired':\n return `\\`${target.fieldId}\\` is required`;\n case 'fieldMissingRequired':\n return `\\`${target.fieldId}\\` is missing a required value`;\n case 'fieldDisabled':\n return `\\`${target.fieldId}\\` is disabled`;\n case 'rowFact':\n return `row ${String(target.rowKey)} of \\`${target.fieldId}\\` is ${target.fact}`;\n case 'computed':\n return `computed \\`${target.fieldId}\\``;\n case 'gateStatus':\n return `gate \\`${target.ruleId}\\` status`;\n case 'gateOutcome':\n return `gate \\`${target.ruleId}\\` outcome`;\n case 'gateUndeterminedItem':\n return `gate item \\`${target.ruleId}.${target.itemId}\\` is undetermined`;\n case 'screenOutcome':\n return `screen \\`${target.ruleId}\\` outcome`;\n case 'screenReason':\n return `screen \\`${target.ruleId}\\` reason \\`${target.code}\\``;\n case 'exportIncludes':\n return `the submission includes \\`${target.fieldId}\\``;\n case 'exportExcludes':\n return `the submission excludes \\`${target.fieldId}\\``;\n case 'exportValue':\n return `submitted \\`${target.fieldId}\\``;\n case 'exportRefused':\n return `the submission is refused as \\`${target.code}\\``;\n default:\n return assertNever(target);\n }\n}\n\n/**\n * The refusal codes the scenario-suite layer states.\n *\n * `CSV_BOUNDS` is the one a JSON suite cannot produce: a flat matrix that exceeds an input\n * cap. It travels the same diagnostic shape because the CLI prints one line per reason and\n * a caller narrows on the code rather than on the text.\n *\n * A capture states no code of its own: a capture that cannot be written is refused by the\n * same parser and reference checks a hand-written suite passes through, so one document shape\n * has one refusal rather than a second authority in the capture.\n */\nexport type ScenarioDiagnosticCode = 'SCENARIOS_INVALID' | 'CSV_BOUNDS';\n\n/** One refusal, with the document or artifact location that caused it. */\nexport interface ScenarioDiagnostic {\n readonly code: ScenarioDiagnosticCode;\n readonly path: string;\n readonly detail: string;\n}\n\n/**\n * One suite's verdict.\n *\n * A suite that names a rule, field, gate item or table the artifact does not declare is\n * refused before anything runs, so an `invalid` report carries the reasons and no results. A\n * run binds its per-assertion results to the artifact's behaviour hash and to the table\n * versions it resolved them against.\n *\n * An executed report states the baseline environment the run started from, normalized, and every\n * `ScenarioResult` states the environment that scenario actually judged under. A `given` may\n * override a baseline member, so the two can differ by design; neither is a claim about the\n * other, and a reader that needs the environment of a decision reads the scenario's.\n */\nexport type ScenarioSuiteReport =\n | { readonly status: 'invalid'; readonly diagnostics: readonly ScenarioDiagnostic[] }\n | {\n readonly status: 'passed' | 'failed';\n readonly behaviorHash: string;\n readonly datasetHashes: readonly ResolvedDatasetPin[];\n /** The baseline environment every scenario started from, normalized. */\n readonly environment: CommittedEnvironment;\n readonly scenarios: readonly ScenarioResult[];\n };\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ArtifactBehaviour, CompiledSchema } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import type { LookupTableDocument } from '@azx-pbc/axiom-runtime';
|
|
3
|
+
import type { DeclaredEnvironment, ScenarioSuiteDocument } from './document.js';
|
|
4
|
+
import type { ScenarioSuiteReport } from './report.js';
|
|
5
|
+
/**
|
|
6
|
+
* Running a scenario suite over a compiled artifact.
|
|
7
|
+
*
|
|
8
|
+
* A scenario's assertions read one `evaluateForm` answer: the report, the access answer and the
|
|
9
|
+
* writer overlay; the derived form state and the submission projection read that same answer, so
|
|
10
|
+
* no two answers can disagree. A failed scenario's `explain()` trace is a separate, explicit pass.
|
|
11
|
+
* The report binds each assertion to the artifact's behaviour hash and the table versions the run
|
|
12
|
+
* resolved, and it carries no second copy of the report it judged.
|
|
13
|
+
*
|
|
14
|
+
* Nothing here touches a clock, a locale database or a Node built-in, so a browser preview and a
|
|
15
|
+
* CI build run the same suite to the same bytes.
|
|
16
|
+
*/
|
|
17
|
+
/** What a run needs that a suite cannot carry: the table documents its exposures name. */
|
|
18
|
+
export interface ScenarioSuiteOptions {
|
|
19
|
+
/**
|
|
20
|
+
* The table documents a run may install, usually every document the host holds for the
|
|
21
|
+
* artifact. A document for a table the artifact does not pin cannot change the run's data
|
|
22
|
+
* identity, so it is not installed; a catalogue for a pinned table that no installation can
|
|
23
|
+
* represent refuses the run rather than throwing.
|
|
24
|
+
*/
|
|
25
|
+
readonly datasets?: readonly LookupTableDocument[];
|
|
26
|
+
/**
|
|
27
|
+
* The environment a scenario starts from where its own document states nothing.
|
|
28
|
+
*
|
|
29
|
+
* The suite's own `given`/defaults win member by member: a scenario that names its record date
|
|
30
|
+
* judges under that date. The baseline exists so a publisher that declares the environment it
|
|
31
|
+
* is publishing against executes the suite under it rather than under an accidental absence.
|
|
32
|
+
*/
|
|
33
|
+
readonly environment?: DeclaredEnvironment;
|
|
34
|
+
/**
|
|
35
|
+
* The artifact's behaviour identity, when the caller already derived it.
|
|
36
|
+
*
|
|
37
|
+
* A publisher that verifies several suites over one artifact derives it once and states it
|
|
38
|
+
* here; a caller that runs a suite on its own lets this module derive it, which re-hashes every
|
|
39
|
+
* rule and the artifact around them. It must be the exact immutable value derived for `compiled`;
|
|
40
|
+
* an identity from another artifact, or an edited copy, throws before anything runs.
|
|
41
|
+
*/
|
|
42
|
+
readonly behaviour?: ArtifactBehaviour;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Runs every scenario in a suite.
|
|
46
|
+
*
|
|
47
|
+
* A suite that names a rule, field, gate item or table the artifact does not declare — or whose
|
|
48
|
+
* values the artifact's declarations refuse — is refused before anything runs: an `invalid`
|
|
49
|
+
* report carries every reason and no results, because a run against a reference that does not
|
|
50
|
+
* exist would compare a claim with nothing. A table set the artifact pins and no installation
|
|
51
|
+
* can represent is refused the same way: a report that cannot name the data it judged has no
|
|
52
|
+
* identity to bind its evidence to.
|
|
53
|
+
*/
|
|
54
|
+
export declare function runScenarioSuite(compiled: CompiledSchema, suite: ScenarioSuiteDocument, options?: ScenarioSuiteOptions): ScenarioSuiteReport;
|
|
55
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/scenarios/runner.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EAIf,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAc,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG9E,OAAO,KAAK,EAAE,mBAAmB,EAAY,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAK1F,OAAO,KAAK,EAAsC,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE3F;;;;;;;;;;;GAWG;AAEH,0FAA0F;AAC1F,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAC3C;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;CACxC;AAeD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,qBAAqB,EAC5B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAoDrB"}
|