@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 @@
|
|
|
1
|
+
{"version":3,"file":"classifier.js","sourceRoot":"","sources":["../../src/scenarios/classifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AA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O,SAAS,CAAC;IAC3C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AACtF,CAAC;AAED,SAAS,WAAW,CAAC,QAA0B,EAAE,MAAc;IAC7D,OAAO,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,YAAY,CAAC,MAAc,EAAE,MAAc;IAClD,OAAO,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["import { andAll, gateItemsOf, isFiring } from '@azx-pbc/axiom-runtime';\nimport type {\n CompiledRule,\n FormScreenState,\n GateItemResult,\n Observation,\n RuleResult,\n} from '@azx-pbc/axiom-runtime';\nimport { creditOf } from './credit.js';\nimport type { ScenarioAssertion } from './document.js';\nimport { factsOf, indexResults } from './evidence.js';\nimport type { ScenarioEvidence, SubmissionProjection } from './evidence.js';\nimport { judgeAssertion } from './expectations.js';\nimport type { ResolvedAssertion, UnassertedObservation } from './report.js';\n\nexport type { ScenarioEvidence, SubmissionProjection } from './evidence.js';\n\n/**\n * One scenario's assertions, resolved against one evaluation.\n *\n * The classifier is the composition and nothing else: it judges each assertion, asks what a\n * passing one is worth, and reports the firings no assertion covered. Judgement, credit and the\n * facts they read each live in their own module, so a passing assertion cannot be credited for a\n * firing no judge compared.\n */\n\n/** One scenario's assertion results, and the firings no assertion covered. */\nexport interface ScenarioClassification {\n readonly assertions: readonly ResolvedAssertion[];\n readonly unasserted: readonly UnassertedObservation[];\n}\n\n/** Judges one scenario's assertions and reports the firings that no assertion covered. */\nexport function classifyScenario(\n evidence: ScenarioEvidence,\n assertions: readonly ScenarioAssertion[],\n projection: SubmissionProjection,\n): ScenarioClassification {\n const facts = factsOf(evidence, projection);\n const resolved: ResolvedAssertion[] = [];\n const assertedRules = new Set<string>();\n const assertedItems = new Set<string>();\n for (const assertion of assertions) {\n if (assertion.kind === 'rule') assertedRules.add(assertion.ruleId);\n if (assertion.kind === 'gateItem') {\n assertedItems.add(itemIdentity(assertion.ruleId, assertion.itemId));\n }\n const { target, verdict } = judgeAssertion(facts, assertion);\n if (!verdict.passed) {\n resolved.push({ target, passed: false, detail: verdict.detail });\n continue;\n }\n const credit = creditOf(facts, assertion);\n // A consequence assertion is an assertion about the rule that decided it: the suite stated\n // the rule's work as a field or row fact, so a hint that it \"was never asserted\" would tell a\n // publisher to write the case they already wrote.\n if (credit.coverageEligible && credit.subject.kind === 'rule') {\n assertedRules.add(credit.subject.ruleId);\n }\n resolved.push({ target, passed: true, credit });\n }\n return {\n assertions: resolved,\n unasserted: unassertedOf(evidence, assertedRules, assertedItems),\n };\n}\n\n/**\n * Explicit targets whose observation fired and that no assertion covered.\n *\n * A hint about what the suite could have proved: it never earns credit, because nothing was\n * asserted, but it tells a publisher which firings went unwitnessed. A rule the evaluation\n * produced no result for has no observation at all.\n */\nfunction unassertedOf(\n evidence: ScenarioEvidence,\n assertedRules: ReadonlySet<string>,\n assertedItems: ReadonlySet<string>,\n): readonly UnassertedObservation[] {\n const results = indexResults(evidence.snapshot.report.rules);\n const screens = new Map(\n evidence.state.screens.map((screen) => [screen.screenId, screen] as const),\n );\n const unasserted: UnassertedObservation[] = [];\n for (const rule of evidence.compiled.rules ?? []) {\n const observed = observationOfRule(rule, results.get(rule.ruleId) ?? [], screens);\n if (observed === undefined) continue;\n if (!assertedRules.has(rule.ruleId) && isFiring(rule.kind, observed)) {\n unasserted.push({\n target: { kind: 'rule', ruleId: rule.ruleId },\n credit: { coverageEligible: false, refusal: 'unasserted' },\n });\n }\n if (rule.kind !== 'gate') continue;\n for (const item of itemsOfGate(evidence, rule.ruleId)) {\n if (assertedItems.has(itemIdentity(rule.ruleId, item.itemId))) continue;\n if (isFiring('gate', { kind: 'outcome', outcome: item.status })) {\n unasserted.push({\n target: { kind: 'gateItem', ruleId: rule.ruleId, itemId: item.itemId },\n credit: { coverageEligible: false, refusal: 'unasserted' },\n });\n }\n }\n }\n return unasserted;\n}\n\n/** The observation a rule's own results state, or `undefined` when it produced none. */\nfunction observationOfRule(\n rule: CompiledRule,\n results: readonly RuleResult[],\n screens: ReadonlyMap<string, FormScreenState>,\n): Observation | undefined {\n if (rule.kind === 'screen') {\n const outcome = screens.get(rule.ruleId)?.outcome;\n return outcome === undefined ? undefined : { kind: 'screen', outcome };\n }\n if (results.length === 0) return undefined;\n return { kind: 'outcome', outcome: andAll(results.map((result) => result.status)) };\n}\n\nfunction itemsOfGate(evidence: ScenarioEvidence, gateId: string): readonly GateItemResult[] {\n return gateItemsOf(evidence.snapshot.report.gates?.[gateId]);\n}\n\nfunction itemIdentity(ruleId: string, itemId: string): string {\n return `${ruleId}/${itemId}`;\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CompiledRule, FormSnapshot, RuleResult } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import type { ScenarioAssertion } from './document.js';
|
|
3
|
+
import type { ScenarioFacts } from './evidence.js';
|
|
4
|
+
import type { AssertionCredit } from './report.js';
|
|
5
|
+
/**
|
|
6
|
+
* What a passing assertion is evidence of, and what it is worth when it proves nothing.
|
|
7
|
+
*
|
|
8
|
+
* Credit exists because a true statement about a form is not automatically evidence about a
|
|
9
|
+
* rule: a `SCREEN_REFER` asserted on a rule that never ran, a default the record overrode, a
|
|
10
|
+
* field hidden by its access state, or an item rule over no rows all read as a pass while
|
|
11
|
+
* proving nothing. Every refusal is named, so a publisher reads a reason rather than a green
|
|
12
|
+
* run, and `fired` is the runtime's own firing table rather than a second answer.
|
|
13
|
+
*
|
|
14
|
+
* An expectation about a field's derived state is evidence when exactly one rule of that kind can
|
|
15
|
+
* have produced it: a `required` assertion is the consequence a `required` rule exists to have,
|
|
16
|
+
* so it proves the branch that rule took (`RULES-3.1.2`), exactly as a hidden field proves a
|
|
17
|
+
* `visible` rule refused it. Where two rules, a cascade or the access answer could also explain
|
|
18
|
+
* the pass, the assertion is ambiguous and earns nothing.
|
|
19
|
+
*/
|
|
20
|
+
/** The credit a passing assertion earns. Never called for a failed one: a contradiction is no evidence. */
|
|
21
|
+
export declare function creditOf(facts: ScenarioFacts, assertion: ScenarioAssertion): AssertionCredit;
|
|
22
|
+
/**
|
|
23
|
+
* Whether a default writer's passing result is the stored value an active override kept.
|
|
24
|
+
*
|
|
25
|
+
* Only a decided result can be an override, and only the writer's own overlay entry proves the
|
|
26
|
+
* rule produced it. Item writers carry one entry per row, so a folded assertion loses credit when
|
|
27
|
+
* any row it folds kept the submitted value instead.
|
|
28
|
+
*
|
|
29
|
+
* The vector path reads the same answer, so a vector whose expected value equals a kept stored
|
|
30
|
+
* value earns no firing credit either.
|
|
31
|
+
*/
|
|
32
|
+
export declare function overrideKeptValue(rule: CompiledRule, results: readonly RuleResult[], computed: FormSnapshot['computed']): boolean;
|
|
33
|
+
//# sourceMappingURL=credit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credit.d.ts","sourceRoot":"","sources":["../../src/scenarios/credit.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,YAAY,EAGZ,YAAY,EAEZ,UAAU,EACX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAkC,MAAM,aAAa,CAAC;AAEnF;;;;;;;;;;;;;;GAcG;AAEH,2GAA2G;AAC3G,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,GAAG,eAAe,CAmC5F;AAsFD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,GACjC,OAAO,CAYT"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { andAll, assertNever, permitsUserWrite, rowKeyToken, ruleTargets, } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import { branchCredit } from './branch.js';
|
|
3
|
+
import { hasEngineError, itemOf, resultsOf, ruleOf, writerOf } from './evidence.js';
|
|
4
|
+
/**
|
|
5
|
+
* What a passing assertion is evidence of, and what it is worth when it proves nothing.
|
|
6
|
+
*
|
|
7
|
+
* Credit exists because a true statement about a form is not automatically evidence about a
|
|
8
|
+
* rule: a `SCREEN_REFER` asserted on a rule that never ran, a default the record overrode, a
|
|
9
|
+
* field hidden by its access state, or an item rule over no rows all read as a pass while
|
|
10
|
+
* proving nothing. Every refusal is named, so a publisher reads a reason rather than a green
|
|
11
|
+
* run, and `fired` is the runtime's own firing table rather than a second answer.
|
|
12
|
+
*
|
|
13
|
+
* An expectation about a field's derived state is evidence when exactly one rule of that kind can
|
|
14
|
+
* have produced it: a `required` assertion is the consequence a `required` rule exists to have,
|
|
15
|
+
* so it proves the branch that rule took (`RULES-3.1.2`), exactly as a hidden field proves a
|
|
16
|
+
* `visible` rule refused it. Where two rules, a cascade or the access answer could also explain
|
|
17
|
+
* the pass, the assertion is ambiguous and earns nothing.
|
|
18
|
+
*/
|
|
19
|
+
/** The credit a passing assertion earns. Never called for a failed one: a contradiction is no evidence. */
|
|
20
|
+
export function creditOf(facts, assertion) {
|
|
21
|
+
switch (assertion.kind) {
|
|
22
|
+
case 'rule':
|
|
23
|
+
return ruleCredit(facts, assertion.ruleId, assertion.rowKey, assertion.observation);
|
|
24
|
+
case 'gateItem':
|
|
25
|
+
return itemCredit(facts, assertion.ruleId, assertion.itemId);
|
|
26
|
+
case 'computed':
|
|
27
|
+
return computedCredit(facts, assertion.fieldId);
|
|
28
|
+
case 'fieldHidden':
|
|
29
|
+
return hiddenCredit(facts, assertion.fieldId);
|
|
30
|
+
case 'fieldVisible':
|
|
31
|
+
return consequenceCredit(facts, 'visible', assertion.fieldId, undefined, true);
|
|
32
|
+
case 'fieldRequired':
|
|
33
|
+
case 'fieldMissingRequired':
|
|
34
|
+
return consequenceCredit(facts, 'required', assertion.fieldId, undefined, true);
|
|
35
|
+
case 'fieldDisabled':
|
|
36
|
+
return disabledCredit(facts, assertion.fieldId);
|
|
37
|
+
case 'rowFact':
|
|
38
|
+
return rowFactCredit(facts, assertion);
|
|
39
|
+
// Expectations about the form as a whole, a gate, a screen or the submission answer a question
|
|
40
|
+
// no one rule owns, so they are never credit for one.
|
|
41
|
+
case 'ready':
|
|
42
|
+
case 'gateStatus':
|
|
43
|
+
case 'gateOutcome':
|
|
44
|
+
case 'gateUndeterminedItem':
|
|
45
|
+
case 'screenOutcome':
|
|
46
|
+
case 'screenReason':
|
|
47
|
+
case 'exportIncludes':
|
|
48
|
+
case 'exportExcludes':
|
|
49
|
+
case 'exportValue':
|
|
50
|
+
case 'exportRefused':
|
|
51
|
+
return notCausal();
|
|
52
|
+
default:
|
|
53
|
+
return assertNever(assertion);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether a passing assertion about one rule is evidence.
|
|
58
|
+
*
|
|
59
|
+
* Only a rule the device actually evaluated can prove it fired: an item-scoped rule that decided
|
|
60
|
+
* no row, a rule the device deferred, and a rule that raised `ENGINE_ERROR` all leave the claim
|
|
61
|
+
* unproven even when the expected outcome is the one they reported.
|
|
62
|
+
*/
|
|
63
|
+
function ruleCredit(facts, ruleId, rowKey, observation) {
|
|
64
|
+
const rule = ruleOf(facts, ruleId);
|
|
65
|
+
const results = resultsOf(facts, ruleId).filter((result) => rowKey === undefined || result.rowKey === rowKey);
|
|
66
|
+
const subject = {
|
|
67
|
+
kind: 'rule',
|
|
68
|
+
ruleId,
|
|
69
|
+
...(rowKey === undefined ? {} : { rowKey }),
|
|
70
|
+
};
|
|
71
|
+
if (results.length === 0)
|
|
72
|
+
return refused('no_rows');
|
|
73
|
+
// A rule the artifact does not declare cannot have been evaluated, so its observation is not
|
|
74
|
+
// evidence about a firing table. References refuse such an assertion before a run; this is a
|
|
75
|
+
// hand-assembled artifact's shape.
|
|
76
|
+
if (rule === undefined)
|
|
77
|
+
return refused('ambiguous');
|
|
78
|
+
if (hasEngineError(facts, ruleId))
|
|
79
|
+
return refused('engine_error');
|
|
80
|
+
if (overrideKeptValue(rule, results, facts.computed))
|
|
81
|
+
return refused('override');
|
|
82
|
+
const branch = branchCredit(rule.kind, observation);
|
|
83
|
+
return branch.coverageEligible
|
|
84
|
+
? { coverageEligible: true, subject, fired: branch.fired }
|
|
85
|
+
: refused(branch.refusal);
|
|
86
|
+
}
|
|
87
|
+
/** Whether a passing gate item assertion is evidence about that item. */
|
|
88
|
+
function itemCredit(facts, ruleId, itemId) {
|
|
89
|
+
// The judgement refuses an item the report does not state, so a passing assertion has one.
|
|
90
|
+
const item = itemOf(facts, ruleId, itemId);
|
|
91
|
+
if (item === undefined)
|
|
92
|
+
return refused('ambiguous');
|
|
93
|
+
if (hasEngineError(facts, ruleId) || hasEngineError(facts, item.ruleId ?? '')) {
|
|
94
|
+
return refused('engine_error');
|
|
95
|
+
}
|
|
96
|
+
const branch = branchCredit('gate', { kind: 'outcome', outcome: item.status });
|
|
97
|
+
return branch.coverageEligible
|
|
98
|
+
? {
|
|
99
|
+
coverageEligible: true,
|
|
100
|
+
subject: { kind: 'gateItem', ruleId, itemId },
|
|
101
|
+
fired: branch.fired,
|
|
102
|
+
}
|
|
103
|
+
: refused(branch.refusal);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Whether a computed value is evidence that its writer produced it.
|
|
107
|
+
*
|
|
108
|
+
* A `defaultCompute` keeps a stored value while an override is active and reports it as its own
|
|
109
|
+
* result; that value is the record's, not the rule's, so the assertion proves nothing about the
|
|
110
|
+
* rule. The writer's own overlay entry is the one fact that distinguishes the two, so it decides.
|
|
111
|
+
*
|
|
112
|
+
* The branch comes from the writer's own result rather than from the assertion: a writer that
|
|
113
|
+
* produced a value fires, and one that reported `UNKNOWN` writes `null` under the non-firing
|
|
114
|
+
* case (`RULES-2.1.7`), so asserting the `null` it wrote is evidence of that branch and not of a
|
|
115
|
+
* produced value.
|
|
116
|
+
*/
|
|
117
|
+
function computedCredit(facts, fieldId) {
|
|
118
|
+
const writer = writerOf(facts, fieldId);
|
|
119
|
+
if (writer === undefined)
|
|
120
|
+
return refused('ambiguous');
|
|
121
|
+
const results = resultsOf(facts, writer.ruleId);
|
|
122
|
+
if (overrideKeptValue(writer, results, facts.computed))
|
|
123
|
+
return refused('override');
|
|
124
|
+
if (hasEngineError(facts, writer.ruleId))
|
|
125
|
+
return refused('engine_error');
|
|
126
|
+
if (results.length === 0)
|
|
127
|
+
return refused('no_rows');
|
|
128
|
+
const branch = branchCredit(writer.kind, {
|
|
129
|
+
kind: 'outcome',
|
|
130
|
+
outcome: andAll(results.map((result) => result.status)),
|
|
131
|
+
});
|
|
132
|
+
if (!branch.coverageEligible)
|
|
133
|
+
return refused(branch.refusal);
|
|
134
|
+
return {
|
|
135
|
+
coverageEligible: true,
|
|
136
|
+
subject: { kind: 'rule', ruleId: writer.ruleId },
|
|
137
|
+
fired: branch.fired,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Whether a default writer's passing result is the stored value an active override kept.
|
|
142
|
+
*
|
|
143
|
+
* Only a decided result can be an override, and only the writer's own overlay entry proves the
|
|
144
|
+
* rule produced it. Item writers carry one entry per row, so a folded assertion loses credit when
|
|
145
|
+
* any row it folds kept the submitted value instead.
|
|
146
|
+
*
|
|
147
|
+
* The vector path reads the same answer, so a vector whose expected value equals a kept stored
|
|
148
|
+
* value earns no firing credit either.
|
|
149
|
+
*/
|
|
150
|
+
export function overrideKeptValue(rule, results, computed) {
|
|
151
|
+
if (rule.kind !== 'defaultCompute')
|
|
152
|
+
return false;
|
|
153
|
+
return results.some((result) => {
|
|
154
|
+
if (result.status !== 'PASS')
|
|
155
|
+
return false;
|
|
156
|
+
if (rule.scope === 'item') {
|
|
157
|
+
return (result.rowKey === undefined ||
|
|
158
|
+
computed.getRow(rule.targetFieldId ?? '', result.rowKey) === undefined);
|
|
159
|
+
}
|
|
160
|
+
return computed.get(rule.fieldId ?? '') === undefined;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Whether one hidden field is evidence that a `visible` rule refused it.
|
|
165
|
+
*
|
|
166
|
+
* A field can be hidden by an access state, by a container above it, or by any of several rules
|
|
167
|
+
* that name it, and a cascade is not a witness for the rule nearest the field. So the only causal
|
|
168
|
+
* hide is one direct `visible` rule that decided `FAIL` on an accessible, otherwise visible field;
|
|
169
|
+
* anything else is ambiguous and earns nothing.
|
|
170
|
+
*/
|
|
171
|
+
function hiddenCredit(facts, fieldId) {
|
|
172
|
+
const field = facts.fields.get(fieldId);
|
|
173
|
+
if (field === undefined)
|
|
174
|
+
return refused('ambiguous');
|
|
175
|
+
if (field.access === 'hidden')
|
|
176
|
+
return refused('ambiguous');
|
|
177
|
+
if (hasHiddenAncestor(facts.fields, field))
|
|
178
|
+
return refused('ambiguous');
|
|
179
|
+
const direct = (facts.compiled.rules ?? []).filter((rule) => rule.kind === 'visible' && ruleTargets(rule).includes(field.fieldId));
|
|
180
|
+
const only = direct.length === 1 ? direct[0] : undefined;
|
|
181
|
+
if (only === undefined)
|
|
182
|
+
return refused('ambiguous');
|
|
183
|
+
return consequenceCredit(facts, 'visible', field.fieldId, undefined, false);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Whether one disabled field is evidence that an `enabled` rule refused it.
|
|
187
|
+
*
|
|
188
|
+
* A field is disabled without any rule when the record permits no user write, so only a writable
|
|
189
|
+
* field's disable can be the rule's work. With that established, `consequenceCredit` still refuses
|
|
190
|
+
* the fact when the one `enabled` rule passed: it then names no rule's refusal.
|
|
191
|
+
*/
|
|
192
|
+
function disabledCredit(facts, fieldId) {
|
|
193
|
+
const field = facts.fields.get(fieldId);
|
|
194
|
+
if (field === undefined || !field.writable)
|
|
195
|
+
return refused('ambiguous');
|
|
196
|
+
return consequenceCredit(facts, 'enabled', fieldId, undefined, false);
|
|
197
|
+
}
|
|
198
|
+
function decidedBranch(facts, kind, fieldId, rowKey) {
|
|
199
|
+
const candidates = (facts.compiled.rules ?? []).filter((rule) => rule.kind === kind &&
|
|
200
|
+
(rule.scope === 'item'
|
|
201
|
+
? rowKey !== undefined && rule.targetFieldId === fieldId
|
|
202
|
+
: ruleTargets(rule).includes(fieldId)));
|
|
203
|
+
if (candidates.length !== 1)
|
|
204
|
+
return refusedBranch('ambiguous');
|
|
205
|
+
const rule = candidates[0];
|
|
206
|
+
if (rule === undefined)
|
|
207
|
+
return refusedBranch('ambiguous');
|
|
208
|
+
if (hasEngineError(facts, rule.ruleId))
|
|
209
|
+
return refusedBranch('engine_error');
|
|
210
|
+
const status = rule.scope === 'item'
|
|
211
|
+
? rowKey === undefined
|
|
212
|
+
? undefined
|
|
213
|
+
: rowStatus(facts, rule, rowKey)
|
|
214
|
+
: foldedStatus(facts, rule);
|
|
215
|
+
if (status === undefined)
|
|
216
|
+
return refusedBranch('no_rows');
|
|
217
|
+
const branch = branchCredit(kind, { kind: 'outcome', outcome: status });
|
|
218
|
+
return branch.coverageEligible
|
|
219
|
+
? { kind: 'decided', ruleId: rule.ruleId, fired: branch.fired }
|
|
220
|
+
: refusedBranch(branch.refusal);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* A non-item rule's single answer.
|
|
224
|
+
*
|
|
225
|
+
* Such a rule reports one result for its target, so the fold is that result — and an empty
|
|
226
|
+
* fold is `PASS`, which is why no result at all is `undefined` rather than a vacuous firing.
|
|
227
|
+
*/
|
|
228
|
+
function foldedStatus(facts, rule) {
|
|
229
|
+
const results = resultsOf(facts, rule.ruleId);
|
|
230
|
+
if (results.length === 0)
|
|
231
|
+
return undefined;
|
|
232
|
+
return andAll(results.map((result) => result.status));
|
|
233
|
+
}
|
|
234
|
+
/** One row's own answer, matched by the wire-typed key so `1` and `"1"` name different rows. */
|
|
235
|
+
function rowStatus(facts, rule, rowKey) {
|
|
236
|
+
const token = rowKeyToken(rowKey);
|
|
237
|
+
return resultsOf(facts, rule.ruleId).find((result) => result.rowKey !== undefined && rowKeyToken(result.rowKey) === token)?.status;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Credit for an assertion about a field state one rule's branch decides.
|
|
241
|
+
*
|
|
242
|
+
* `branch` is the branch the assertion states, or `undefined` when the fact follows from either
|
|
243
|
+
* branch. A rule that took the other branch cannot have produced the asserted consequence on its
|
|
244
|
+
* own, so the pass came from something else and earns nothing.
|
|
245
|
+
*/
|
|
246
|
+
function consequenceCredit(facts, kind, fieldId, rowKey, branch) {
|
|
247
|
+
const decision = decidedBranch(facts, kind, fieldId, rowKey);
|
|
248
|
+
if (decision.kind === 'refused')
|
|
249
|
+
return refused(decision.refusal);
|
|
250
|
+
if (branch !== undefined && decision.fired !== branch)
|
|
251
|
+
return refused('ambiguous');
|
|
252
|
+
return {
|
|
253
|
+
coverageEligible: true,
|
|
254
|
+
subject: rowKey === undefined
|
|
255
|
+
? { kind: 'rule', ruleId: decision.ruleId }
|
|
256
|
+
: { kind: 'rule', ruleId: decision.ruleId, rowKey },
|
|
257
|
+
fired: decision.fired,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Credit for one row's stated fact.
|
|
262
|
+
*
|
|
263
|
+
* `required` and `enabled` state the branch that rule took; `missingRequired: missing` states a
|
|
264
|
+
* requirement that held, while `satisfied` states only that the recorded value is present — a
|
|
265
|
+
* fact both branches admit, so the rule's own result decides which branch it proved. `fillable`
|
|
266
|
+
* follows visibility, enablement, writability and writers together, so no one rule owns it.
|
|
267
|
+
*/
|
|
268
|
+
function rowFactCredit(facts, assertion) {
|
|
269
|
+
const row = rowOf(facts, assertion.fieldId, assertion.rowKeyText);
|
|
270
|
+
if (row === undefined)
|
|
271
|
+
return refused('ambiguous');
|
|
272
|
+
switch (assertion.fact) {
|
|
273
|
+
case 'fillable':
|
|
274
|
+
return notCausal();
|
|
275
|
+
case 'required': {
|
|
276
|
+
if (typeof assertion.expected !== 'boolean')
|
|
277
|
+
return refused('ambiguous');
|
|
278
|
+
return consequenceCredit(facts, 'required', assertion.fieldId, row.rowKey, assertion.expected);
|
|
279
|
+
}
|
|
280
|
+
case 'enabled': {
|
|
281
|
+
if (typeof assertion.expected !== 'boolean')
|
|
282
|
+
return refused('ambiguous');
|
|
283
|
+
// A row this device may not write is not enabled whatever its rules say, so the fact
|
|
284
|
+
// cannot witness the rule.
|
|
285
|
+
if (!permitsUserWrite(row.access))
|
|
286
|
+
return refused('ambiguous');
|
|
287
|
+
return consequenceCredit(facts, 'enabled', assertion.fieldId, row.rowKey, assertion.expected);
|
|
288
|
+
}
|
|
289
|
+
case 'missingRequired': {
|
|
290
|
+
const { expected } = assertion;
|
|
291
|
+
if (expected === 'undetermined')
|
|
292
|
+
return refused('ambiguous');
|
|
293
|
+
return consequenceCredit(facts, 'required', assertion.fieldId, row.rowKey, expected === 'missing' ? true : undefined);
|
|
294
|
+
}
|
|
295
|
+
default:
|
|
296
|
+
return assertNever(assertion.fact);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/** The one row an assertion's authored key text names. */
|
|
300
|
+
function rowOf(facts, fieldId, rowKeyText) {
|
|
301
|
+
const matches = (facts.fields.get(fieldId)?.rows ?? []).filter((row) => String(row.rowKey) === rowKeyText);
|
|
302
|
+
return matches.length === 1 ? matches[0] : undefined;
|
|
303
|
+
}
|
|
304
|
+
function refusedBranch(refusal) {
|
|
305
|
+
return { kind: 'refused', refusal };
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Whether a container above the field is itself hidden, which hides the field with it.
|
|
309
|
+
*
|
|
310
|
+
* A record member's value path ends at its own id, so its ancestors are the path before it. An
|
|
311
|
+
* item member holds one value per row rather than one at its own path, so the path it carries is
|
|
312
|
+
* its container chain and every entry is an ancestor — including the list that holds it.
|
|
313
|
+
*/
|
|
314
|
+
function hasHiddenAncestor(fields, field) {
|
|
315
|
+
const ownValue = field.path.at(-1) === field.fieldId;
|
|
316
|
+
for (const ancestorId of ownValue ? field.path.slice(0, -1) : field.path) {
|
|
317
|
+
const ancestor = fields.get(ancestorId);
|
|
318
|
+
if (ancestor !== undefined && !ancestor.visible)
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
function refused(refusal) {
|
|
324
|
+
return { coverageEligible: false, refusal };
|
|
325
|
+
}
|
|
326
|
+
/** A passing assertion that says nothing about one rule's work. */
|
|
327
|
+
function notCausal() {
|
|
328
|
+
return refused('not_causal');
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=credit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credit.js","sourceRoot":"","sources":["../../src/scenarios/credit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAShC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIpF;;;;;;;;;;;;;;GAcG;AAEH,2GAA2G;AAC3G,MAAM,UAAU,QAAQ,CAAC,KAAoB,EAAE,SAA4B;IACzE,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;QACtF,KAAK,UAAU;YACb,OAAO,UAAU,CAAC,KAA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,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;IAC/D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,OAAsB;IACrC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC;AAED,mEAAmE;AACnE,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,YAAY,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import {\n andAll,\n assertNever,\n permitsUserWrite,\n rowKeyToken,\n ruleTargets,\n} from '@azx-pbc/axiom-runtime';\nimport type {\n CompiledRule,\n FormFieldState,\n FormRowState,\n FormSnapshot,\n Observation,\n RuleResult,\n} from '@azx-pbc/axiom-runtime';\nimport { branchCredit } from './branch.js';\nimport type { ScenarioAssertion } from './document.js';\nimport { hasEngineError, itemOf, resultsOf, ruleOf, writerOf } from './evidence.js';\nimport type { ScenarioFacts } from './evidence.js';\nimport type { AssertionCredit, CoverageSubject, CreditRefusal } from './report.js';\n\n/**\n * What a passing assertion is evidence of, and what it is worth when it proves nothing.\n *\n * Credit exists because a true statement about a form is not automatically evidence about a\n * rule: a `SCREEN_REFER` asserted on a rule that never ran, a default the record overrode, a\n * field hidden by its access state, or an item rule over no rows all read as a pass while\n * proving nothing. Every refusal is named, so a publisher reads a reason rather than a green\n * run, and `fired` is the runtime's own firing table rather than a second answer.\n *\n * An expectation about a field's derived state is evidence when exactly one rule of that kind can\n * have produced it: a `required` assertion is the consequence a `required` rule exists to have,\n * so it proves the branch that rule took (`RULES-3.1.2`), exactly as a hidden field proves a\n * `visible` rule refused it. Where two rules, a cascade or the access answer could also explain\n * the pass, the assertion is ambiguous and earns nothing.\n */\n\n/** The credit a passing assertion earns. Never called for a failed one: a contradiction is no evidence. */\nexport function creditOf(facts: ScenarioFacts, assertion: ScenarioAssertion): AssertionCredit {\n switch (assertion.kind) {\n case 'rule':\n return ruleCredit(facts, assertion.ruleId, assertion.rowKey, assertion.observation);\n case 'gateItem':\n return itemCredit(facts, assertion.ruleId, assertion.itemId);\n case 'computed':\n return computedCredit(facts, assertion.fieldId);\n case 'fieldHidden':\n return hiddenCredit(facts, assertion.fieldId);\n case 'fieldVisible':\n return consequenceCredit(facts, 'visible', assertion.fieldId, undefined, true);\n case 'fieldRequired':\n case 'fieldMissingRequired':\n return consequenceCredit(facts, 'required', assertion.fieldId, undefined, true);\n case 'fieldDisabled':\n return disabledCredit(facts, assertion.fieldId);\n case 'rowFact':\n return rowFactCredit(facts, assertion);\n // Expectations about the form as a whole, a gate, a screen or the submission answer a question\n // no one rule owns, so they are never credit for one.\n case 'ready':\n case 'gateStatus':\n case 'gateOutcome':\n case 'gateUndeterminedItem':\n case 'screenOutcome':\n case 'screenReason':\n case 'exportIncludes':\n case 'exportExcludes':\n case 'exportValue':\n case 'exportRefused':\n return notCausal();\n default:\n return assertNever(assertion);\n }\n}\n\n/**\n * Whether a passing assertion about one rule is evidence.\n *\n * Only a rule the device actually evaluated can prove it fired: an item-scoped rule that decided\n * no row, a rule the device deferred, and a rule that raised `ENGINE_ERROR` all leave the claim\n * unproven even when the expected outcome is the one they reported.\n */\nfunction ruleCredit(\n facts: ScenarioFacts,\n ruleId: string,\n rowKey: string | number | undefined,\n observation: Observation,\n): AssertionCredit {\n const rule = ruleOf(facts, ruleId);\n const results = resultsOf(facts, ruleId).filter(\n (result) => rowKey === undefined || result.rowKey === rowKey,\n );\n const subject: CoverageSubject = {\n kind: 'rule',\n ruleId,\n ...(rowKey === undefined ? {} : { rowKey }),\n };\n if (results.length === 0) return refused('no_rows');\n // A rule the artifact does not declare cannot have been evaluated, so its observation is not\n // evidence about a firing table. References refuse such an assertion before a run; this is a\n // hand-assembled artifact's shape.\n if (rule === undefined) return refused('ambiguous');\n if (hasEngineError(facts, ruleId)) return refused('engine_error');\n if (overrideKeptValue(rule, results, facts.computed)) return refused('override');\n const branch = branchCredit(rule.kind, observation);\n return branch.coverageEligible\n ? { coverageEligible: true, subject, fired: branch.fired }\n : refused(branch.refusal);\n}\n\n/** Whether a passing gate item assertion is evidence about that item. */\nfunction itemCredit(facts: ScenarioFacts, ruleId: string, itemId: string): AssertionCredit {\n // The judgement refuses an item the report does not state, so a passing assertion has one.\n const item = itemOf(facts, ruleId, itemId);\n if (item === undefined) return refused('ambiguous');\n if (hasEngineError(facts, ruleId) || hasEngineError(facts, item.ruleId ?? '')) {\n return refused('engine_error');\n }\n const branch = branchCredit('gate', { kind: 'outcome', outcome: item.status });\n return branch.coverageEligible\n ? {\n coverageEligible: true,\n subject: { kind: 'gateItem', ruleId, itemId },\n fired: branch.fired,\n }\n : refused(branch.refusal);\n}\n\n/**\n * Whether a computed value is evidence that its writer produced it.\n *\n * A `defaultCompute` keeps a stored value while an override is active and reports it as its own\n * result; that value is the record's, not the rule's, so the assertion proves nothing about the\n * rule. The writer's own overlay entry is the one fact that distinguishes the two, so it decides.\n *\n * The branch comes from the writer's own result rather than from the assertion: a writer that\n * produced a value fires, and one that reported `UNKNOWN` writes `null` under the non-firing\n * case (`RULES-2.1.7`), so asserting the `null` it wrote is evidence of that branch and not of a\n * produced value.\n */\nfunction computedCredit(facts: ScenarioFacts, fieldId: string): AssertionCredit {\n const writer = writerOf(facts, fieldId);\n if (writer === undefined) return refused('ambiguous');\n const results = resultsOf(facts, writer.ruleId);\n if (overrideKeptValue(writer, results, facts.computed)) return refused('override');\n if (hasEngineError(facts, writer.ruleId)) return refused('engine_error');\n if (results.length === 0) return refused('no_rows');\n const branch = branchCredit(writer.kind, {\n kind: 'outcome',\n outcome: andAll(results.map((result) => result.status)),\n });\n if (!branch.coverageEligible) return refused(branch.refusal);\n return {\n coverageEligible: true,\n subject: { kind: 'rule', ruleId: writer.ruleId },\n fired: branch.fired,\n };\n}\n\n/**\n * Whether a default writer's passing result is the stored value an active override kept.\n *\n * Only a decided result can be an override, and only the writer's own overlay entry proves the\n * rule produced it. Item writers carry one entry per row, so a folded assertion loses credit when\n * any row it folds kept the submitted value instead.\n *\n * The vector path reads the same answer, so a vector whose expected value equals a kept stored\n * value earns no firing credit either.\n */\nexport function overrideKeptValue(\n rule: CompiledRule,\n results: readonly RuleResult[],\n computed: FormSnapshot['computed'],\n): boolean {\n if (rule.kind !== 'defaultCompute') return false;\n return results.some((result) => {\n if (result.status !== 'PASS') return false;\n if (rule.scope === 'item') {\n return (\n result.rowKey === undefined ||\n computed.getRow(rule.targetFieldId ?? '', result.rowKey) === undefined\n );\n }\n return computed.get(rule.fieldId ?? '') === undefined;\n });\n}\n\n/**\n * Whether one hidden field is evidence that a `visible` rule refused it.\n *\n * A field can be hidden by an access state, by a container above it, or by any of several rules\n * that name it, and a cascade is not a witness for the rule nearest the field. So the only causal\n * hide is one direct `visible` rule that decided `FAIL` on an accessible, otherwise visible field;\n * anything else is ambiguous and earns nothing.\n */\nfunction hiddenCredit(facts: ScenarioFacts, fieldId: string): AssertionCredit {\n const field = facts.fields.get(fieldId);\n if (field === undefined) return refused('ambiguous');\n if (field.access === 'hidden') return refused('ambiguous');\n if (hasHiddenAncestor(facts.fields, field)) return refused('ambiguous');\n const direct = (facts.compiled.rules ?? []).filter(\n (rule) => rule.kind === 'visible' && ruleTargets(rule).includes(field.fieldId),\n );\n const only = direct.length === 1 ? direct[0] : undefined;\n if (only === undefined) return refused('ambiguous');\n return consequenceCredit(facts, 'visible', field.fieldId, undefined, false);\n}\n\n/**\n * Whether one disabled field is evidence that an `enabled` rule refused it.\n *\n * A field is disabled without any rule when the record permits no user write, so only a writable\n * field's disable can be the rule's work. With that established, `consequenceCredit` still refuses\n * the fact when the one `enabled` rule passed: it then names no rule's refusal.\n */\nfunction disabledCredit(facts: ScenarioFacts, fieldId: string): AssertionCredit {\n const field = facts.fields.get(fieldId);\n if (field === undefined || !field.writable) return refused('ambiguous');\n return consequenceCredit(facts, 'enabled', fieldId, undefined, false);\n}\n\n/**\n * What one rule's own result says about the branch it took, for a consequence it decided.\n *\n * `undefined` when no single rule can have decided the field or row: none of that kind, more\n * than one, or an item-scoped rule that addressed no row. The branch is `branchCredit`'s, so a\n * deferral or an engine error is refused here with the refusal the same fact earns for an\n * explicit rule assertion.\n *\n * A field's own entry is decided by its non-item rules: `visible` and `enabled` never read an\n * item rule, and a field-level `required` folds item rows without naming which one. So a\n * field-level fact (`rowKey` absent) is attributed to non-item rules only, while one row's fact is\n * decided by its own row — an item rule for that row, or a non-item rule that reaches every row.\n */\ntype DecidedBranch =\n | { readonly kind: 'decided'; readonly ruleId: string; readonly fired: boolean }\n | { readonly kind: 'refused'; readonly refusal: CreditRefusal };\n\nfunction decidedBranch(\n facts: ScenarioFacts,\n kind: 'visible' | 'required' | 'enabled',\n fieldId: string,\n rowKey: string | number | undefined,\n): DecidedBranch {\n const candidates = (facts.compiled.rules ?? []).filter(\n (rule) =>\n rule.kind === kind &&\n (rule.scope === 'item'\n ? rowKey !== undefined && rule.targetFieldId === fieldId\n : ruleTargets(rule).includes(fieldId)),\n );\n if (candidates.length !== 1) return refusedBranch('ambiguous');\n const rule = candidates[0];\n if (rule === undefined) return refusedBranch('ambiguous');\n if (hasEngineError(facts, rule.ruleId)) return refusedBranch('engine_error');\n const status =\n rule.scope === 'item'\n ? rowKey === undefined\n ? undefined\n : rowStatus(facts, rule, rowKey)\n : foldedStatus(facts, rule);\n if (status === undefined) return refusedBranch('no_rows');\n const branch = branchCredit(kind, { kind: 'outcome', outcome: status });\n return branch.coverageEligible\n ? { kind: 'decided', ruleId: rule.ruleId, fired: branch.fired }\n : refusedBranch(branch.refusal);\n}\n\n/**\n * A non-item rule's single answer.\n *\n * Such a rule reports one result for its target, so the fold is that result — and an empty\n * fold is `PASS`, which is why no result at all is `undefined` rather than a vacuous firing.\n */\nfunction foldedStatus(facts: ScenarioFacts, rule: CompiledRule): RuleResult['status'] | undefined {\n const results = resultsOf(facts, rule.ruleId);\n if (results.length === 0) return undefined;\n return andAll(results.map((result) => result.status));\n}\n\n/** One row's own answer, matched by the wire-typed key so `1` and `\"1\"` name different rows. */\nfunction rowStatus(\n facts: ScenarioFacts,\n rule: CompiledRule,\n rowKey: string | number,\n): RuleResult['status'] | undefined {\n const token = rowKeyToken(rowKey);\n return resultsOf(facts, rule.ruleId).find(\n (result) => result.rowKey !== undefined && rowKeyToken(result.rowKey) === token,\n )?.status;\n}\n\n/**\n * Credit for an assertion about a field state one rule's branch decides.\n *\n * `branch` is the branch the assertion states, or `undefined` when the fact follows from either\n * branch. A rule that took the other branch cannot have produced the asserted consequence on its\n * own, so the pass came from something else and earns nothing.\n */\nfunction consequenceCredit(\n facts: ScenarioFacts,\n kind: 'visible' | 'required' | 'enabled',\n fieldId: string,\n rowKey: string | number | undefined,\n branch: boolean | undefined,\n): AssertionCredit {\n const decision = decidedBranch(facts, kind, fieldId, rowKey);\n if (decision.kind === 'refused') return refused(decision.refusal);\n if (branch !== undefined && decision.fired !== branch) return refused('ambiguous');\n return {\n coverageEligible: true,\n subject:\n rowKey === undefined\n ? { kind: 'rule', ruleId: decision.ruleId }\n : { kind: 'rule', ruleId: decision.ruleId, rowKey },\n fired: decision.fired,\n };\n}\n\n/**\n * Credit for one row's stated fact.\n *\n * `required` and `enabled` state the branch that rule took; `missingRequired: missing` states a\n * requirement that held, while `satisfied` states only that the recorded value is present — a\n * fact both branches admit, so the rule's own result decides which branch it proved. `fillable`\n * follows visibility, enablement, writability and writers together, so no one rule owns it.\n */\nfunction rowFactCredit(\n facts: ScenarioFacts,\n assertion: Extract<ScenarioAssertion, { kind: 'rowFact' }>,\n): AssertionCredit {\n const row = rowOf(facts, assertion.fieldId, assertion.rowKeyText);\n if (row === undefined) return refused('ambiguous');\n switch (assertion.fact) {\n case 'fillable':\n return notCausal();\n case 'required': {\n if (typeof assertion.expected !== 'boolean') return refused('ambiguous');\n return consequenceCredit(\n facts,\n 'required',\n assertion.fieldId,\n row.rowKey,\n assertion.expected,\n );\n }\n case 'enabled': {\n if (typeof assertion.expected !== 'boolean') return refused('ambiguous');\n // A row this device may not write is not enabled whatever its rules say, so the fact\n // cannot witness the rule.\n if (!permitsUserWrite(row.access)) return refused('ambiguous');\n return consequenceCredit(facts, 'enabled', assertion.fieldId, row.rowKey, assertion.expected);\n }\n case 'missingRequired': {\n const { expected } = assertion;\n if (expected === 'undetermined') return refused('ambiguous');\n return consequenceCredit(\n facts,\n 'required',\n assertion.fieldId,\n row.rowKey,\n expected === 'missing' ? true : undefined,\n );\n }\n default:\n return assertNever(assertion.fact);\n }\n}\n\n/** The one row an assertion's authored key text names. */\nfunction rowOf(\n facts: ScenarioFacts,\n fieldId: string,\n rowKeyText: string,\n): FormRowState | undefined {\n const matches = (facts.fields.get(fieldId)?.rows ?? []).filter(\n (row) => String(row.rowKey) === rowKeyText,\n );\n return matches.length === 1 ? matches[0] : undefined;\n}\n\nfunction refusedBranch(refusal: CreditRefusal): DecidedBranch {\n return { kind: 'refused', refusal };\n}\n\n/**\n * Whether a container above the field is itself hidden, which hides the field with it.\n *\n * A record member's value path ends at its own id, so its ancestors are the path before it. An\n * item member holds one value per row rather than one at its own path, so the path it carries is\n * its container chain and every entry is an ancestor — including the list that holds it.\n */\nfunction hasHiddenAncestor(\n fields: ReadonlyMap<string, FormFieldState>,\n field: FormFieldState,\n): boolean {\n const ownValue = field.path.at(-1) === field.fieldId;\n for (const ancestorId of ownValue ? field.path.slice(0, -1) : field.path) {\n const ancestor = fields.get(ancestorId);\n if (ancestor !== undefined && !ancestor.visible) return true;\n }\n return false;\n}\n\nfunction refused(refusal: CreditRefusal): AssertionCredit {\n return { coverageEligible: false, refusal };\n}\n\n/** A passing assertion that says nothing about one rule's work. */\nfunction notCausal(): AssertionCredit {\n return refused('not_causal');\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CompiledSchema } from '@azx-pbc/axiom-runtime';
|
|
2
|
+
import type { ScenarioSuiteDocument, ScenarioSuiteParse } from './document.js';
|
|
3
|
+
import type { ScenarioDiagnostic } from './report.js';
|
|
4
|
+
/**
|
|
5
|
+
* Reads one scenario matrix against the artifact it will be judged by.
|
|
6
|
+
*
|
|
7
|
+
* The artifact is needed because a cell's primitive is the field's declaration: a `value.`
|
|
8
|
+
* cell for an integer field is an integer spelling, one for a string field is a JSON string
|
|
9
|
+
* literal. Nothing here evaluates a rule; the suite is handed to `runScenarioSuite` exactly as
|
|
10
|
+
* a JSON suite is, and every reference it names is checked by that runner's own
|
|
11
|
+
* `validateReferences` before a record runs.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseScenarioCsv(text: string, schema: CompiledSchema): ScenarioSuiteParse;
|
|
14
|
+
/** A scenario matrix's text, or the reasons the suite it names cannot be one. */
|
|
15
|
+
export type ScenarioCsvExport = {
|
|
16
|
+
readonly ok: true;
|
|
17
|
+
readonly text: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly ok: false;
|
|
20
|
+
readonly diagnostics: readonly ScenarioDiagnostic[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Writes a suite as a deterministic RFC 4180 matrix.
|
|
24
|
+
*
|
|
25
|
+
* The columns are the union of every scenario's facts in a fixed family order, each family
|
|
26
|
+
* sorted by code point; the rows are the suite's scenarios in order; the line ending is CRLF.
|
|
27
|
+
* A cell whose text begins with a character a spreadsheet reads as a formula is neutralised
|
|
28
|
+
* with one leading `'` before RFC 4180 quoting, and `parseScenarioCsv` removes exactly that
|
|
29
|
+
* prefix from a raw numeric cell, so a negative value round-trips. A text cell is a JSON
|
|
30
|
+
* string literal, which already begins with `"` — a spreadsheet reads it as text, and its
|
|
31
|
+
* contents are never rewritten, so `=1+1` exported and re-imported is still `=1+1`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function exportScenarioCsv(suite: ScenarioSuiteDocument, schema: CompiledSchema): ScenarioCsvExport;
|
|
34
|
+
//# sourceMappingURL=csv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/scenarios/csv.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAGV,cAAc,EAKf,MAAM,wBAAwB,CAAC;AAYhC,OAAO,KAAK,EAGV,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AA8rBtD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,kBAAkB,CAqKzF;AAED,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,CAAC;AA6ThF;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,cAAc,GACrB,iBAAiB,CAmDnB"}
|