@azx-pbc/axiom-runtime 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +714 -2
- package/dist/cache/index.d.ts +191 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +361 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/canonical/jcs.d.ts +78 -0
- package/dist/canonical/jcs.d.ts.map +1 -0
- package/dist/canonical/jcs.js +500 -0
- package/dist/canonical/jcs.js.map +1 -0
- package/dist/canonical/restricted-json.d.ts +7 -0
- package/dist/canonical/restricted-json.d.ts.map +1 -0
- package/dist/canonical/restricted-json.js +318 -0
- package/dist/canonical/restricted-json.js.map +1 -0
- package/dist/canonical/restricted-value.d.ts +59 -0
- package/dist/canonical/restricted-value.d.ts.map +1 -0
- package/dist/canonical/restricted-value.js +156 -0
- package/dist/canonical/restricted-value.js.map +1 -0
- package/dist/canonical/restricted.d.ts +85 -0
- package/dist/canonical/restricted.d.ts.map +1 -0
- package/dist/canonical/restricted.js +163 -0
- package/dist/canonical/restricted.js.map +1 -0
- package/dist/canonical/signature.d.ts +38 -0
- package/dist/canonical/signature.d.ts.map +1 -0
- package/dist/canonical/signature.js +47 -0
- package/dist/canonical/signature.js.map +1 -0
- package/dist/eval/access/delivery.d.ts +63 -0
- package/dist/eval/access/delivery.d.ts.map +1 -0
- package/dist/eval/access/delivery.js +98 -0
- package/dist/eval/access/delivery.js.map +1 -0
- package/dist/eval/access/overlay.d.ts +72 -0
- package/dist/eval/access/overlay.d.ts.map +1 -0
- package/dist/eval/access/overlay.js +402 -0
- package/dist/eval/access/overlay.js.map +1 -0
- package/dist/eval/access/projection.d.ts +159 -0
- package/dist/eval/access/projection.d.ts.map +1 -0
- package/dist/eval/access/projection.js +211 -0
- package/dist/eval/access/projection.js.map +1 -0
- package/dist/eval/access/window.d.ts +128 -0
- package/dist/eval/access/window.d.ts.map +1 -0
- package/dist/eval/access/window.js +254 -0
- package/dist/eval/access/window.js.map +1 -0
- package/dist/eval/access/write.d.ts +113 -0
- package/dist/eval/access/write.d.ts.map +1 -0
- package/dist/eval/access/write.js +119 -0
- package/dist/eval/access/write.js.map +1 -0
- package/dist/eval/addressing.d.ts +131 -0
- package/dist/eval/addressing.d.ts.map +1 -0
- package/dist/eval/addressing.js +270 -0
- package/dist/eval/addressing.js.map +1 -0
- package/dist/eval/budget.d.ts +143 -0
- package/dist/eval/budget.d.ts.map +1 -0
- package/dist/eval/budget.js +387 -0
- package/dist/eval/budget.js.map +1 -0
- package/dist/eval/computed.d.ts +46 -0
- package/dist/eval/computed.d.ts.map +1 -0
- package/dist/eval/computed.js +89 -0
- package/dist/eval/computed.js.map +1 -0
- package/dist/eval/denials.d.ts +64 -0
- package/dist/eval/denials.d.ts.map +1 -0
- package/dist/eval/denials.js +87 -0
- package/dist/eval/denials.js.map +1 -0
- package/dist/eval/engine/cancellation.d.ts +12 -0
- package/dist/eval/engine/cancellation.d.ts.map +1 -0
- package/dist/eval/engine/cancellation.js +56 -0
- package/dist/eval/engine/cancellation.js.map +1 -0
- package/dist/eval/engine/delta.d.ts +104 -0
- package/dist/eval/engine/delta.d.ts.map +1 -0
- package/dist/eval/engine/delta.js +466 -0
- package/dist/eval/engine/delta.js.map +1 -0
- package/dist/eval/engine/deps.d.ts +136 -0
- package/dist/eval/engine/deps.d.ts.map +1 -0
- package/dist/eval/engine/deps.js +345 -0
- package/dist/eval/engine/deps.js.map +1 -0
- package/dist/eval/engine/identity.d.ts +128 -0
- package/dist/eval/engine/identity.d.ts.map +1 -0
- package/dist/eval/engine/identity.js +398 -0
- package/dist/eval/engine/identity.js.map +1 -0
- package/dist/eval/engine/index.d.ts +200 -0
- package/dist/eval/engine/index.d.ts.map +1 -0
- package/dist/eval/engine/index.js +1242 -0
- package/dist/eval/engine/index.js.map +1 -0
- package/dist/eval/engine/measurement.d.ts +23 -0
- package/dist/eval/engine/measurement.d.ts.map +1 -0
- package/dist/eval/engine/measurement.js +42 -0
- package/dist/eval/engine/measurement.js.map +1 -0
- package/dist/eval/engine/naive.d.ts +19 -0
- package/dist/eval/engine/naive.d.ts.map +1 -0
- package/dist/eval/engine/naive.js +59 -0
- package/dist/eval/engine/naive.js.map +1 -0
- package/dist/eval/engine/ops.d.ts +214 -0
- package/dist/eval/engine/ops.d.ts.map +1 -0
- package/dist/eval/engine/ops.js +1422 -0
- package/dist/eval/engine/ops.js.map +1 -0
- package/dist/eval/engine/patches.d.ts +40 -0
- package/dist/eval/engine/patches.d.ts.map +1 -0
- package/dist/eval/engine/patches.js +125 -0
- package/dist/eval/engine/patches.js.map +1 -0
- package/dist/eval/engine/ports.d.ts +71 -0
- package/dist/eval/engine/ports.d.ts.map +1 -0
- package/dist/eval/engine/ports.js +2 -0
- package/dist/eval/engine/ports.js.map +1 -0
- package/dist/eval/engine/session.d.ts +116 -0
- package/dist/eval/engine/session.d.ts.map +1 -0
- package/dist/eval/engine/session.js +653 -0
- package/dist/eval/engine/session.js.map +1 -0
- package/dist/eval/engine/snapshot.d.ts +97 -0
- package/dist/eval/engine/snapshot.d.ts.map +1 -0
- package/dist/eval/engine/snapshot.js +221 -0
- package/dist/eval/engine/snapshot.js.map +1 -0
- package/dist/eval/engine/subscriptions.d.ts +47 -0
- package/dist/eval/engine/subscriptions.d.ts.map +1 -0
- package/dist/eval/engine/subscriptions.js +103 -0
- package/dist/eval/engine/subscriptions.js.map +1 -0
- package/dist/eval/engine/trace.d.ts +77 -0
- package/dist/eval/engine/trace.d.ts.map +1 -0
- package/dist/eval/engine/trace.js +140 -0
- package/dist/eval/engine/trace.js.map +1 -0
- package/dist/eval/error-diagnostic.d.ts +26 -0
- package/dist/eval/error-diagnostic.d.ts.map +1 -0
- package/dist/eval/error-diagnostic.js +63 -0
- package/dist/eval/error-diagnostic.js.map +1 -0
- package/dist/eval/evaluate-expr.d.ts +44 -0
- package/dist/eval/evaluate-expr.d.ts.map +1 -0
- package/dist/eval/evaluate-expr.js +149 -0
- package/dist/eval/evaluate-expr.js.map +1 -0
- package/dist/eval/evaluate.d.ts +282 -0
- package/dist/eval/evaluate.d.ts.map +1 -0
- package/dist/eval/evaluate.js +391 -0
- package/dist/eval/evaluate.js.map +1 -0
- package/dist/eval/evolution/relocate.d.ts +72 -0
- package/dist/eval/evolution/relocate.d.ts.map +1 -0
- package/dist/eval/evolution/relocate.js +427 -0
- package/dist/eval/evolution/relocate.js.map +1 -0
- package/dist/eval/evolution/select.d.ts +11 -0
- package/dist/eval/evolution/select.d.ts.map +1 -0
- package/dist/eval/evolution/select.js +53 -0
- package/dist/eval/evolution/select.js.map +1 -0
- package/dist/eval/evolution/upcast.d.ts +13 -0
- package/dist/eval/evolution/upcast.d.ts.map +1 -0
- package/dist/eval/evolution/upcast.js +88 -0
- package/dist/eval/evolution/upcast.js.map +1 -0
- package/dist/eval/expr/aggregates.d.ts +75 -0
- package/dist/eval/expr/aggregates.d.ts.map +1 -0
- package/dist/eval/expr/aggregates.js +991 -0
- package/dist/eval/expr/aggregates.js.map +1 -0
- package/dist/eval/expr/arithmetic.d.ts +26 -0
- package/dist/eval/expr/arithmetic.d.ts.map +1 -0
- package/dist/eval/expr/arithmetic.js +387 -0
- package/dist/eval/expr/arithmetic.js.map +1 -0
- package/dist/eval/expr/between.d.ts +17 -0
- package/dist/eval/expr/between.d.ts.map +1 -0
- package/dist/eval/expr/between.js +46 -0
- package/dist/eval/expr/between.js.map +1 -0
- package/dist/eval/expr/binder.d.ts +96 -0
- package/dist/eval/expr/binder.d.ts.map +1 -0
- package/dist/eval/expr/binder.js +253 -0
- package/dist/eval/expr/binder.js.map +1 -0
- package/dist/eval/expr/call-dispatch.d.ts +28 -0
- package/dist/eval/expr/call-dispatch.d.ts.map +1 -0
- package/dist/eval/expr/call-dispatch.js +114 -0
- package/dist/eval/expr/call-dispatch.js.map +1 -0
- package/dist/eval/expr/collections.d.ts +20 -0
- package/dist/eval/expr/collections.d.ts.map +1 -0
- package/dist/eval/expr/collections.js +66 -0
- package/dist/eval/expr/collections.js.map +1 -0
- package/dist/eval/expr/compare.d.ts +36 -0
- package/dist/eval/expr/compare.d.ts.map +1 -0
- package/dist/eval/expr/compare.js +115 -0
- package/dist/eval/expr/compare.js.map +1 -0
- package/dist/eval/expr/datasets.d.ts +28 -0
- package/dist/eval/expr/datasets.d.ts.map +1 -0
- package/dist/eval/expr/datasets.js +304 -0
- package/dist/eval/expr/datasets.js.map +1 -0
- package/dist/eval/expr/digest.d.ts +23 -0
- package/dist/eval/expr/digest.d.ts.map +1 -0
- package/dist/eval/expr/digest.js +89 -0
- package/dist/eval/expr/digest.js.map +1 -0
- package/dist/eval/expr/domains.d.ts +19 -0
- package/dist/eval/expr/domains.d.ts.map +1 -0
- package/dist/eval/expr/domains.js +18 -0
- package/dist/eval/expr/domains.js.map +1 -0
- package/dist/eval/expr/host.d.ts +152 -0
- package/dist/eval/expr/host.d.ts.map +1 -0
- package/dist/eval/expr/host.js +36 -0
- package/dist/eval/expr/host.js.map +1 -0
- package/dist/eval/expr/lists.d.ts +24 -0
- package/dist/eval/expr/lists.d.ts.map +1 -0
- package/dist/eval/expr/lists.js +155 -0
- package/dist/eval/expr/lists.js.map +1 -0
- package/dist/eval/expr/member.d.ts +15 -0
- package/dist/eval/expr/member.d.ts.map +1 -0
- package/dist/eval/expr/member.js +32 -0
- package/dist/eval/expr/member.js.map +1 -0
- package/dist/eval/expr/money-ops.d.ts +10 -0
- package/dist/eval/expr/money-ops.d.ts.map +1 -0
- package/dist/eval/expr/money-ops.js +17 -0
- package/dist/eval/expr/money-ops.js.map +1 -0
- package/dist/eval/expr/operands.d.ts +27 -0
- package/dist/eval/expr/operands.d.ts.map +1 -0
- package/dist/eval/expr/operands.js +167 -0
- package/dist/eval/expr/operands.js.map +1 -0
- package/dist/eval/expr/presence.d.ts +27 -0
- package/dist/eval/expr/presence.d.ts.map +1 -0
- package/dist/eval/expr/presence.js +140 -0
- package/dist/eval/expr/presence.js.map +1 -0
- package/dist/eval/expr/records.d.ts +22 -0
- package/dist/eval/expr/records.d.ts.map +1 -0
- package/dist/eval/expr/records.js +101 -0
- package/dist/eval/expr/records.js.map +1 -0
- package/dist/eval/expr/rule-refs.d.ts +25 -0
- package/dist/eval/expr/rule-refs.d.ts.map +1 -0
- package/dist/eval/expr/rule-refs.js +60 -0
- package/dist/eval/expr/rule-refs.js.map +1 -0
- package/dist/eval/expr/sequences.d.ts +26 -0
- package/dist/eval/expr/sequences.d.ts.map +1 -0
- package/dist/eval/expr/sequences.js +151 -0
- package/dist/eval/expr/sequences.js.map +1 -0
- package/dist/eval/expr/value.d.ts +99 -0
- package/dist/eval/expr/value.d.ts.map +1 -0
- package/dist/eval/expr/value.js +14 -0
- package/dist/eval/expr/value.js.map +1 -0
- package/dist/eval/expression.d.ts +142 -0
- package/dist/eval/expression.d.ts.map +1 -0
- package/dist/eval/expression.js +446 -0
- package/dist/eval/expression.js.map +1 -0
- package/dist/eval/firing.d.ts +68 -0
- package/dist/eval/firing.d.ts.map +1 -0
- package/dist/eval/firing.js +222 -0
- package/dist/eval/firing.js.map +1 -0
- package/dist/eval/gate.d.ts +110 -0
- package/dist/eval/gate.d.ts.map +1 -0
- package/dist/eval/gate.js +278 -0
- package/dist/eval/gate.js.map +1 -0
- package/dist/eval/layout-visibility.d.ts +18 -0
- package/dist/eval/layout-visibility.d.ts.map +1 -0
- package/dist/eval/layout-visibility.js +61 -0
- package/dist/eval/layout-visibility.js.map +1 -0
- package/dist/eval/option-availability.d.ts +26 -0
- package/dist/eval/option-availability.d.ts.map +1 -0
- package/dist/eval/option-availability.js +580 -0
- package/dist/eval/option-availability.js.map +1 -0
- package/dist/eval/options-boundary.d.ts +15 -0
- package/dist/eval/options-boundary.d.ts.map +1 -0
- package/dist/eval/options-boundary.js +40 -0
- package/dist/eval/options-boundary.js.map +1 -0
- package/dist/eval/options.d.ts +99 -0
- package/dist/eval/options.d.ts.map +1 -0
- package/dist/eval/options.js +96 -0
- package/dist/eval/options.js.map +1 -0
- package/dist/eval/overrides.d.ts +116 -0
- package/dist/eval/overrides.d.ts.map +1 -0
- package/dist/eval/overrides.js +176 -0
- package/dist/eval/overrides.js.map +1 -0
- package/dist/eval/paths.d.ts +25 -0
- package/dist/eval/paths.d.ts.map +1 -0
- package/dist/eval/paths.js +47 -0
- package/dist/eval/paths.js.map +1 -0
- package/dist/eval/presentation-reads.d.ts +20 -0
- package/dist/eval/presentation-reads.d.ts.map +1 -0
- package/dist/eval/presentation-reads.js +2 -0
- package/dist/eval/presentation-reads.js.map +1 -0
- package/dist/eval/presentation.d.ts +122 -0
- package/dist/eval/presentation.d.ts.map +1 -0
- package/dist/eval/presentation.js +255 -0
- package/dist/eval/presentation.js.map +1 -0
- package/dist/eval/reader/context-value.d.ts +41 -0
- package/dist/eval/reader/context-value.d.ts.map +1 -0
- package/dist/eval/reader/context-value.js +129 -0
- package/dist/eval/reader/context-value.js.map +1 -0
- package/dist/eval/reader/covered.d.ts +53 -0
- package/dist/eval/reader/covered.d.ts.map +1 -0
- package/dist/eval/reader/covered.js +139 -0
- package/dist/eval/reader/covered.js.map +1 -0
- package/dist/eval/reader/declarations.d.ts +182 -0
- package/dist/eval/reader/declarations.d.ts.map +1 -0
- package/dist/eval/reader/declarations.js +153 -0
- package/dist/eval/reader/declarations.js.map +1 -0
- package/dist/eval/reader/member-access.d.ts +87 -0
- package/dist/eval/reader/member-access.d.ts.map +1 -0
- package/dist/eval/reader/member-access.js +212 -0
- package/dist/eval/reader/member-access.js.map +1 -0
- package/dist/eval/reader/memo.d.ts +34 -0
- package/dist/eval/reader/memo.d.ts.map +1 -0
- package/dist/eval/reader/memo.js +67 -0
- package/dist/eval/reader/memo.js.map +1 -0
- package/dist/eval/reader/overlay.d.ts +74 -0
- package/dist/eval/reader/overlay.d.ts.map +1 -0
- package/dist/eval/reader/overlay.js +365 -0
- package/dist/eval/reader/overlay.js.map +1 -0
- package/dist/eval/reader/questions.d.ts +37 -0
- package/dist/eval/reader/questions.d.ts.map +1 -0
- package/dist/eval/reader/questions.js +78 -0
- package/dist/eval/reader/questions.js.map +1 -0
- package/dist/eval/reader/resolve.d.ts +84 -0
- package/dist/eval/reader/resolve.d.ts.map +1 -0
- package/dist/eval/reader/resolve.js +310 -0
- package/dist/eval/reader/resolve.js.map +1 -0
- package/dist/eval/reader/value-read.d.ts +50 -0
- package/dist/eval/reader/value-read.d.ts.map +1 -0
- package/dist/eval/reader/value-read.js +133 -0
- package/dist/eval/reader/value-read.js.map +1 -0
- package/dist/eval/reader/withheld.d.ts +48 -0
- package/dist/eval/reader/withheld.d.ts.map +1 -0
- package/dist/eval/reader/withheld.js +108 -0
- package/dist/eval/reader/withheld.js.map +1 -0
- package/dist/eval/reader-paths.d.ts +24 -0
- package/dist/eval/reader-paths.d.ts.map +1 -0
- package/dist/eval/reader-paths.js +23 -0
- package/dist/eval/reader-paths.js.map +1 -0
- package/dist/eval/reader.d.ts +281 -0
- package/dist/eval/reader.d.ts.map +1 -0
- package/dist/eval/reader.js +560 -0
- package/dist/eval/reader.js.map +1 -0
- package/dist/eval/receipt.d.ts +37 -0
- package/dist/eval/receipt.d.ts.map +1 -0
- package/dist/eval/receipt.js +222 -0
- package/dist/eval/receipt.js.map +1 -0
- package/dist/eval/report/assemble.d.ts +84 -0
- package/dist/eval/report/assemble.d.ts.map +1 -0
- package/dist/eval/report/assemble.js +277 -0
- package/dist/eval/report/assemble.js.map +1 -0
- package/dist/eval/report/fold.d.ts +18 -0
- package/dist/eval/report/fold.d.ts.map +1 -0
- package/dist/eval/report/fold.js +58 -0
- package/dist/eval/report/fold.js.map +1 -0
- package/dist/eval/rule/alternatives.d.ts +23 -0
- package/dist/eval/rule/alternatives.d.ts.map +1 -0
- package/dist/eval/rule/alternatives.js +46 -0
- package/dist/eval/rule/alternatives.js.map +1 -0
- package/dist/eval/rule/behaviour.d.ts +47 -0
- package/dist/eval/rule/behaviour.d.ts.map +1 -0
- package/dist/eval/rule/behaviour.js +249 -0
- package/dist/eval/rule/behaviour.js.map +1 -0
- package/dist/eval/rule/compute.d.ts +46 -0
- package/dist/eval/rule/compute.d.ts.map +1 -0
- package/dist/eval/rule/compute.js +158 -0
- package/dist/eval/rule/compute.js.map +1 -0
- package/dist/eval/rule/create-state.d.ts +42 -0
- package/dist/eval/rule/create-state.d.ts.map +1 -0
- package/dist/eval/rule/create-state.js +134 -0
- package/dist/eval/rule/create-state.js.map +1 -0
- package/dist/eval/rule/diagnostics.d.ts +24 -0
- package/dist/eval/rule/diagnostics.d.ts.map +1 -0
- package/dist/eval/rule/diagnostics.js +45 -0
- package/dist/eval/rule/diagnostics.js.map +1 -0
- package/dist/eval/rule/execution.d.ts +24 -0
- package/dist/eval/rule/execution.d.ts.map +1 -0
- package/dist/eval/rule/execution.js +495 -0
- package/dist/eval/rule/execution.js.map +1 -0
- package/dist/eval/rule/gate.d.ts +12 -0
- package/dist/eval/rule/gate.d.ts.map +1 -0
- package/dist/eval/rule/gate.js +34 -0
- package/dist/eval/rule/gate.js.map +1 -0
- package/dist/eval/rule/item.d.ts +11 -0
- package/dist/eval/rule/item.d.ts.map +1 -0
- package/dist/eval/rule/item.js +265 -0
- package/dist/eval/rule/item.js.map +1 -0
- package/dist/eval/rule/prepare.d.ts +64 -0
- package/dist/eval/rule/prepare.d.ts.map +1 -0
- package/dist/eval/rule/prepare.js +131 -0
- package/dist/eval/rule/prepare.js.map +1 -0
- package/dist/eval/rule/result.d.ts +97 -0
- package/dist/eval/rule/result.d.ts.map +1 -0
- package/dist/eval/rule/result.js +347 -0
- package/dist/eval/rule/result.js.map +1 -0
- package/dist/eval/rule/runner.d.ts +128 -0
- package/dist/eval/rule/runner.d.ts.map +1 -0
- package/dist/eval/rule/runner.js +296 -0
- package/dist/eval/rule/runner.js.map +1 -0
- package/dist/eval/rule/screen.d.ts +32 -0
- package/dist/eval/rule/screen.d.ts.map +1 -0
- package/dist/eval/rule/screen.js +73 -0
- package/dist/eval/rule/screen.js.map +1 -0
- package/dist/eval/rule/state.d.ts +137 -0
- package/dist/eval/rule/state.d.ts.map +1 -0
- package/dist/eval/rule/state.js +2 -0
- package/dist/eval/rule/state.js.map +1 -0
- package/dist/eval/rule/steps.d.ts +44 -0
- package/dist/eval/rule/steps.d.ts.map +1 -0
- package/dist/eval/rule/steps.js +367 -0
- package/dist/eval/rule/steps.js.map +1 -0
- package/dist/eval/rule/visibility.d.ts +18 -0
- package/dist/eval/rule/visibility.d.ts.map +1 -0
- package/dist/eval/rule/visibility.js +79 -0
- package/dist/eval/rule/visibility.js.map +1 -0
- package/dist/eval/seal.d.ts +74 -0
- package/dist/eval/seal.d.ts.map +1 -0
- package/dist/eval/seal.js +154 -0
- package/dist/eval/seal.js.map +1 -0
- package/dist/eval/signature-coverage.d.ts +19 -0
- package/dist/eval/signature-coverage.d.ts.map +1 -0
- package/dist/eval/signature-coverage.js +160 -0
- package/dist/eval/signature-coverage.js.map +1 -0
- package/dist/eval/state/derive.d.ts +72 -0
- package/dist/eval/state/derive.d.ts.map +1 -0
- package/dist/eval/state/derive.js +61 -0
- package/dist/eval/state/derive.js.map +1 -0
- package/dist/eval/state/describe.d.ts +18 -0
- package/dist/eval/state/describe.d.ts.map +1 -0
- package/dist/eval/state/describe.js +19 -0
- package/dist/eval/state/describe.js.map +1 -0
- package/dist/eval/state/field-state.d.ts +471 -0
- package/dist/eval/state/field-state.d.ts.map +1 -0
- package/dist/eval/state/field-state.js +1604 -0
- package/dist/eval/state/field-state.js.map +1 -0
- package/dist/eval/state/measurement.d.ts +136 -0
- package/dist/eval/state/measurement.d.ts.map +1 -0
- package/dist/eval/state/measurement.js +209 -0
- package/dist/eval/state/measurement.js.map +1 -0
- package/dist/eval/state/options.d.ts +21 -0
- package/dist/eval/state/options.d.ts.map +1 -0
- package/dist/eval/state/options.js +3 -0
- package/dist/eval/state/options.js.map +1 -0
- package/dist/eval/state/readiness.d.ts +400 -0
- package/dist/eval/state/readiness.d.ts.map +1 -0
- package/dist/eval/state/readiness.js +1067 -0
- package/dist/eval/state/readiness.js.map +1 -0
- package/dist/eval/state/snapshot.d.ts +130 -0
- package/dist/eval/state/snapshot.d.ts.map +1 -0
- package/dist/eval/state/snapshot.js +35 -0
- package/dist/eval/state/snapshot.js.map +1 -0
- package/dist/eval/state/unavailable-options.d.ts +54 -0
- package/dist/eval/state/unavailable-options.d.ts.map +1 -0
- package/dist/eval/state/unavailable-options.js +82 -0
- package/dist/eval/state/unavailable-options.js.map +1 -0
- package/dist/eval/state/value-state.d.ts +38 -0
- package/dist/eval/state/value-state.d.ts.map +1 -0
- package/dist/eval/state/value-state.js +52 -0
- package/dist/eval/state/value-state.js.map +1 -0
- package/dist/eval/submission/admission.d.ts +50 -0
- package/dist/eval/submission/admission.d.ts.map +1 -0
- package/dist/eval/submission/admission.js +174 -0
- package/dist/eval/submission/admission.js.map +1 -0
- package/dist/eval/submission/authority.d.ts +71 -0
- package/dist/eval/submission/authority.d.ts.map +1 -0
- package/dist/eval/submission/authority.js +118 -0
- package/dist/eval/submission/authority.js.map +1 -0
- package/dist/eval/submission/datasets.d.ts +28 -0
- package/dist/eval/submission/datasets.d.ts.map +1 -0
- package/dist/eval/submission/datasets.js +109 -0
- package/dist/eval/submission/datasets.js.map +1 -0
- package/dist/eval/submission/index.d.ts +15 -0
- package/dist/eval/submission/index.d.ts.map +1 -0
- package/dist/eval/submission/index.js +13 -0
- package/dist/eval/submission/index.js.map +1 -0
- package/dist/eval/submission/refusals.d.ts +103 -0
- package/dist/eval/submission/refusals.d.ts.map +1 -0
- package/dist/eval/submission/refusals.js +15 -0
- package/dist/eval/submission/refusals.js.map +1 -0
- package/dist/eval/submission/signatures.d.ts +7 -0
- package/dist/eval/submission/signatures.d.ts.map +1 -0
- package/dist/eval/submission/signatures.js +215 -0
- package/dist/eval/submission/signatures.js.map +1 -0
- package/dist/eval/submission/writes.d.ts +51 -0
- package/dist/eval/submission/writes.d.ts.map +1 -0
- package/dist/eval/submission/writes.js +203 -0
- package/dist/eval/submission/writes.js.map +1 -0
- package/dist/eval/submission.d.ts +53 -0
- package/dist/eval/submission.d.ts.map +1 -0
- package/dist/eval/submission.js +521 -0
- package/dist/eval/submission.js.map +1 -0
- package/dist/eval/suggestions-to-engine.d.ts +18 -0
- package/dist/eval/suggestions-to-engine.d.ts.map +1 -0
- package/dist/eval/suggestions-to-engine.js +40 -0
- package/dist/eval/suggestions-to-engine.js.map +1 -0
- package/dist/eval/suggestions.d.ts +17 -0
- package/dist/eval/suggestions.d.ts.map +1 -0
- package/dist/eval/suggestions.js +314 -0
- package/dist/eval/suggestions.js.map +1 -0
- package/dist/eval/undecided.d.ts +64 -0
- package/dist/eval/undecided.d.ts.map +1 -0
- package/dist/eval/undecided.js +101 -0
- package/dist/eval/undecided.js.map +1 -0
- package/dist/eval/verdict.d.ts +66 -0
- package/dist/eval/verdict.d.ts.map +1 -0
- package/dist/eval/verdict.js +106 -0
- package/dist/eval/verdict.js.map +1 -0
- package/dist/eval/verify-signature.d.ts +78 -0
- package/dist/eval/verify-signature.d.ts.map +1 -0
- package/dist/eval/verify-signature.js +185 -0
- package/dist/eval/verify-signature.js.map +1 -0
- package/dist/eval/version-dispatch.d.ts +38 -0
- package/dist/eval/version-dispatch.d.ts.map +1 -0
- package/dist/eval/version-dispatch.js +61 -0
- package/dist/eval/version-dispatch.js.map +1 -0
- package/dist/eval/visibility.d.ts +33 -0
- package/dist/eval/visibility.d.ts.map +1 -0
- package/dist/eval/visibility.js +83 -0
- package/dist/eval/visibility.js.map +1 -0
- package/dist/evaluate.d.ts +24 -0
- package/dist/evaluate.d.ts.map +1 -0
- package/dist/evaluate.js +18 -0
- package/dist/evaluate.js.map +1 -0
- package/dist/expr/builtin-docs.d.ts +51 -0
- package/dist/expr/builtin-docs.d.ts.map +1 -0
- package/dist/expr/builtin-docs.js +874 -0
- package/dist/expr/builtin-docs.js.map +1 -0
- package/dist/expr/builtins.d.ts +50 -0
- package/dist/expr/builtins.d.ts.map +1 -0
- package/dist/expr/builtins.js +966 -0
- package/dist/expr/builtins.js.map +1 -0
- package/dist/expr/decimal-precision.d.ts +39 -0
- package/dist/expr/decimal-precision.d.ts.map +1 -0
- package/dist/expr/decimal-precision.js +62 -0
- package/dist/expr/decimal-precision.js.map +1 -0
- package/dist/expr/decimal.d.ts +172 -0
- package/dist/expr/decimal.d.ts.map +1 -0
- package/dist/expr/decimal.js +782 -0
- package/dist/expr/decimal.js.map +1 -0
- package/dist/expr/deprecations.d.ts +34 -0
- package/dist/expr/deprecations.d.ts.map +1 -0
- package/dist/expr/deprecations.js +17 -0
- package/dist/expr/deprecations.js.map +1 -0
- package/dist/expr/diagnostics.d.ts +21 -0
- package/dist/expr/diagnostics.d.ts.map +1 -0
- package/dist/expr/diagnostics.js +231 -0
- package/dist/expr/diagnostics.js.map +1 -0
- package/dist/expr/direction.d.ts +30 -0
- package/dist/expr/direction.d.ts.map +1 -0
- package/dist/expr/direction.js +77 -0
- package/dist/expr/direction.js.map +1 -0
- package/dist/expr/example-expression.d.ts +62 -0
- package/dist/expr/example-expression.d.ts.map +1 -0
- package/dist/expr/example-expression.js +670 -0
- package/dist/expr/example-expression.js.map +1 -0
- package/dist/expr/instant.d.ts +49 -0
- package/dist/expr/instant.d.ts.map +1 -0
- package/dist/expr/instant.js +111 -0
- package/dist/expr/instant.js.map +1 -0
- package/dist/expr/logic.d.ts +17 -0
- package/dist/expr/logic.d.ts.map +1 -0
- package/dist/expr/logic.js +65 -0
- package/dist/expr/logic.js.map +1 -0
- package/dist/expr/messages.d.ts +45 -0
- package/dist/expr/messages.d.ts.map +1 -0
- package/dist/expr/messages.js +280 -0
- package/dist/expr/messages.js.map +1 -0
- package/dist/expr/money.d.ts +38 -0
- package/dist/expr/money.d.ts.map +1 -0
- package/dist/expr/money.js +127 -0
- package/dist/expr/money.js.map +1 -0
- package/dist/expr/ordering.d.ts +56 -0
- package/dist/expr/ordering.d.ts.map +1 -0
- package/dist/expr/ordering.js +167 -0
- package/dist/expr/ordering.js.map +1 -0
- package/dist/expr/pattern.d.ts +44 -0
- package/dist/expr/pattern.d.ts.map +1 -0
- package/dist/expr/pattern.js +458 -0
- package/dist/expr/pattern.js.map +1 -0
- package/dist/expr/plain-date.d.ts +90 -0
- package/dist/expr/plain-date.d.ts.map +1 -0
- package/dist/expr/plain-date.js +230 -0
- package/dist/expr/plain-date.js.map +1 -0
- package/dist/expr/plural-categories.d.ts +8 -0
- package/dist/expr/plural-categories.d.ts.map +1 -0
- package/dist/expr/plural-categories.js +15 -0
- package/dist/expr/plural-categories.js.map +1 -0
- package/dist/expr/plural-keys.d.ts +39 -0
- package/dist/expr/plural-keys.d.ts.map +1 -0
- package/dist/expr/plural-keys.js +46 -0
- package/dist/expr/plural-keys.js.map +1 -0
- package/dist/expr/plural.d.ts +33 -0
- package/dist/expr/plural.d.ts.map +1 -0
- package/dist/expr/plural.js +50 -0
- package/dist/expr/plural.js.map +1 -0
- package/dist/expr/quantity.d.ts +31 -0
- package/dist/expr/quantity.d.ts.map +1 -0
- package/dist/expr/quantity.js +83 -0
- package/dist/expr/quantity.js.map +1 -0
- package/dist/expr/reduce.d.ts +50 -0
- package/dist/expr/reduce.d.ts.map +1 -0
- package/dist/expr/reduce.js +236 -0
- package/dist/expr/reduce.js.map +1 -0
- package/dist/expr/regex.d.ts +108 -0
- package/dist/expr/regex.d.ts.map +1 -0
- package/dist/expr/regex.js +1207 -0
- package/dist/expr/regex.js.map +1 -0
- package/dist/expr/select-locale.d.ts +67 -0
- package/dist/expr/select-locale.d.ts.map +1 -0
- package/dist/expr/select-locale.js +219 -0
- package/dist/expr/select-locale.js.map +1 -0
- package/dist/expr/sequences.d.ts +123 -0
- package/dist/expr/sequences.d.ts.map +1 -0
- package/dist/expr/sequences.js +234 -0
- package/dist/expr/sequences.js.map +1 -0
- package/dist/expr/strings.d.ts +50 -0
- package/dist/expr/strings.d.ts.map +1 -0
- package/dist/expr/strings.js +184 -0
- package/dist/expr/strings.js.map +1 -0
- package/dist/expr/validation.d.ts +32 -0
- package/dist/expr/validation.d.ts.map +1 -0
- package/dist/expr/validation.js +182 -0
- package/dist/expr/validation.js.map +1 -0
- package/dist/graph/freeze.d.ts +4 -0
- package/dist/graph/freeze.d.ts.map +1 -0
- package/dist/graph/freeze.js +52 -0
- package/dist/graph/freeze.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/inspect.d.ts +76 -0
- package/dist/graph/inspect.d.ts.map +1 -0
- package/dist/graph/inspect.js +263 -0
- package/dist/graph/inspect.js.map +1 -0
- package/dist/graph/read-walk.d.ts +101 -0
- package/dist/graph/read-walk.d.ts.map +1 -0
- package/dist/graph/read-walk.js +358 -0
- package/dist/graph/read-walk.js.map +1 -0
- package/dist/graph/record-index.d.ts +24 -0
- package/dist/graph/record-index.d.ts.map +1 -0
- package/dist/graph/record-index.js +35 -0
- package/dist/graph/record-index.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -0
- package/dist/lookup/digest.d.ts +51 -0
- package/dist/lookup/digest.d.ts.map +1 -0
- package/dist/lookup/digest.js +46 -0
- package/dist/lookup/digest.js.map +1 -0
- package/dist/lookup/index.d.ts +28 -0
- package/dist/lookup/index.d.ts.map +1 -0
- package/dist/lookup/index.js +27 -0
- package/dist/lookup/index.js.map +1 -0
- package/dist/lookup/install.d.ts +48 -0
- package/dist/lookup/install.d.ts.map +1 -0
- package/dist/lookup/install.js +315 -0
- package/dist/lookup/install.js.map +1 -0
- package/dist/lookup/pass.d.ts +55 -0
- package/dist/lookup/pass.d.ts.map +1 -0
- package/dist/lookup/pass.js +212 -0
- package/dist/lookup/pass.js.map +1 -0
- package/dist/lookup/pins.d.ts +34 -0
- package/dist/lookup/pins.d.ts.map +1 -0
- package/dist/lookup/pins.js +39 -0
- package/dist/lookup/pins.js.map +1 -0
- package/dist/lookup/provenance.d.ts +23 -0
- package/dist/lookup/provenance.d.ts.map +1 -0
- package/dist/lookup/provenance.js +78 -0
- package/dist/lookup/provenance.js.map +1 -0
- package/dist/lookup/readiness.d.ts +13 -0
- package/dist/lookup/readiness.d.ts.map +1 -0
- package/dist/lookup/readiness.js +57 -0
- package/dist/lookup/readiness.js.map +1 -0
- package/dist/lookup/resolve.d.ts +24 -0
- package/dist/lookup/resolve.d.ts.map +1 -0
- package/dist/lookup/resolve.js +201 -0
- package/dist/lookup/resolve.js.map +1 -0
- package/dist/lookup/store.d.ts +41 -0
- package/dist/lookup/store.d.ts.map +1 -0
- package/dist/lookup/store.js +74 -0
- package/dist/lookup/store.js.map +1 -0
- package/dist/model/access.d.ts +200 -0
- package/dist/model/access.d.ts.map +1 -0
- package/dist/model/access.js +125 -0
- package/dist/model/access.js.map +1 -0
- package/dist/model/artifact-members.d.ts +3 -0
- package/dist/model/artifact-members.d.ts.map +1 -0
- package/dist/model/artifact-members.js +38 -0
- package/dist/model/artifact-members.js.map +1 -0
- package/dist/model/composition.d.ts +47 -0
- package/dist/model/composition.d.ts.map +1 -0
- package/dist/model/composition.js +66 -0
- package/dist/model/composition.js.map +1 -0
- package/dist/model/domain.d.ts +51 -0
- package/dist/model/domain.d.ts.map +1 -0
- package/dist/model/domain.js +75 -0
- package/dist/model/domain.js.map +1 -0
- package/dist/model/duration.d.ts +31 -0
- package/dist/model/duration.d.ts.map +1 -0
- package/dist/model/duration.js +136 -0
- package/dist/model/duration.js.map +1 -0
- package/dist/model/errors.d.ts +58 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +81 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/evolution.d.ts +177 -0
- package/dist/model/evolution.d.ts.map +1 -0
- package/dist/model/evolution.js +5 -0
- package/dist/model/evolution.js.map +1 -0
- package/dist/model/expr-children.d.ts +15 -0
- package/dist/model/expr-children.d.ts.map +1 -0
- package/dist/model/expr-children.js +45 -0
- package/dist/model/expr-children.js.map +1 -0
- package/dist/model/guards.d.ts +9 -0
- package/dist/model/guards.d.ts.map +1 -0
- package/dist/model/guards.js +11 -0
- package/dist/model/guards.js.map +1 -0
- package/dist/model/input.d.ts +42 -0
- package/dist/model/input.d.ts.map +1 -0
- package/dist/model/input.js +26 -0
- package/dist/model/input.js.map +1 -0
- package/dist/model/integer.d.ts +14 -0
- package/dist/model/integer.d.ts.map +1 -0
- package/dist/model/integer.js +16 -0
- package/dist/model/integer.js.map +1 -0
- package/dist/model/intrinsic.d.ts +18 -0
- package/dist/model/intrinsic.d.ts.map +1 -0
- package/dist/model/intrinsic.js +21 -0
- package/dist/model/intrinsic.js.map +1 -0
- package/dist/model/layout.d.ts +129 -0
- package/dist/model/layout.d.ts.map +1 -0
- package/dist/model/layout.js +2 -0
- package/dist/model/layout.js.map +1 -0
- package/dist/model/media.d.ts +33 -0
- package/dist/model/media.d.ts.map +1 -0
- package/dist/model/media.js +86 -0
- package/dist/model/media.js.map +1 -0
- package/dist/model/members.generated.d.ts +11 -0
- package/dist/model/members.generated.d.ts.map +1 -0
- package/dist/model/members.generated.js +71 -0
- package/dist/model/members.generated.js.map +1 -0
- package/dist/model/row-address.d.ts +27 -0
- package/dist/model/row-address.d.ts.map +1 -0
- package/dist/model/row-address.js +146 -0
- package/dist/model/row-address.js.map +1 -0
- package/dist/model/schema.d.ts +108 -0
- package/dist/model/schema.d.ts.map +1 -0
- package/dist/model/schema.js +2 -0
- package/dist/model/schema.js.map +1 -0
- package/dist/model/shape.d.ts +193 -0
- package/dist/model/shape.d.ts.map +1 -0
- package/dist/model/shape.js +2 -0
- package/dist/model/shape.js.map +1 -0
- package/dist/model/time.d.ts +61 -0
- package/dist/model/time.d.ts.map +1 -0
- package/dist/model/time.js +110 -0
- package/dist/model/time.js.map +1 -0
- package/dist/model/types.d.ts +1329 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/model/types.js +424 -0
- package/dist/model/types.js.map +1 -0
- package/dist/model/values.d.ts +91 -0
- package/dist/model/values.d.ts.map +1 -0
- package/dist/model/values.js +195 -0
- package/dist/model/values.js.map +1 -0
- package/dist/model/wire.d.ts +356 -0
- package/dist/model/wire.d.ts.map +1 -0
- package/dist/model/wire.js +1504 -0
- package/dist/model/wire.js.map +1 -0
- package/dist/offline/index.d.ts +374 -0
- package/dist/offline/index.d.ts.map +1 -0
- package/dist/offline/index.js +422 -0
- package/dist/offline/index.js.map +1 -0
- package/dist/testing.d.ts +30 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +42 -0
- package/dist/testing.js.map +1 -0
- package/dist/version.d.ts +30 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +116 -0
- package/dist/version.js.map +1 -0
- package/package.json +98 -3
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { AxiomError } from '../model/errors.js';
|
|
2
|
+
import { isRecord } from '../model/guards.js';
|
|
3
|
+
import { isUndetermined, UNKNOWN } from '../model/types.js';
|
|
4
|
+
import { isWireArray, sameWireValue, wireMembers } from '../model/values.js';
|
|
5
|
+
import { toWireValue, wireDeclarationOf } from '../model/wire.js';
|
|
6
|
+
import { fieldKey } from './access/projection.js';
|
|
7
|
+
import { addressingOfItems } from './addressing.js';
|
|
8
|
+
import { valueOf } from './expr/value.js';
|
|
9
|
+
import { optionCodeValue } from './options.js';
|
|
10
|
+
import { withoutUnreadableMembers } from './reader/member-access.js';
|
|
11
|
+
import { deliveryWithheld, paramsOf, withScopedDelivery } from './rule/result.js';
|
|
12
|
+
import { noteAvailabilityCondition } from './state/measurement.js';
|
|
13
|
+
import { evaluateSuggestions } from './suggestions.js';
|
|
14
|
+
/**
|
|
15
|
+
* Every declared option's availability, evaluated on the access-safe reader the rules use, after
|
|
16
|
+
* the writers have produced their values, `RULES-7.1.2`.
|
|
17
|
+
*
|
|
18
|
+
* A session states the declarations its change set could move and carries the others over, so the
|
|
19
|
+
* function takes the set of field ids this pass may have moved. An absent set evaluates every
|
|
20
|
+
* declaration: an open, a hydrate and an access or environment change state no narrower scope.
|
|
21
|
+
*
|
|
22
|
+
* The answer is keyed by the binding's runtime key, `fieldKey`, so a member of an array states
|
|
23
|
+
* one answer per row of the array that holds it. A condition is an Expr v1 boolean in the scope
|
|
24
|
+
* of the field that declares the option, so a row member's condition reads its own row through
|
|
25
|
+
* `$it` exactly as an item-scoped rule does.
|
|
26
|
+
*
|
|
27
|
+
* Three states, never two: a condition that decides neither way leaves the option undetermined,
|
|
28
|
+
* which is not available and is never silently blocked as an invalid code (`RULES-7.1.1`). A
|
|
29
|
+
* condition that raises, answers a non-boolean, or reads a value the report may not state is
|
|
30
|
+
* undetermined for the same reason the presentation channel answers `UNKNOWN` there: an answer
|
|
31
|
+
* derived from a withheld value would disclose it.
|
|
32
|
+
*
|
|
33
|
+
* The alternatives an unavailable option offers are evaluated only for the code the record holds
|
|
34
|
+
* (`RULES-7.1.4`), so the snapshot carries no alternative a host could offer by mistake.
|
|
35
|
+
*/
|
|
36
|
+
export function evaluateOptionAvailability(state, scope) {
|
|
37
|
+
const bindings = new Map();
|
|
38
|
+
const rows = new RowScopes(state);
|
|
39
|
+
visit(state, state.compiled.fields, undefined, bindings, rows, scope);
|
|
40
|
+
return bindings;
|
|
41
|
+
}
|
|
42
|
+
/** One declaration list, with the row context its members live in. */
|
|
43
|
+
function visit(state, members, row, answers, rows, scope) {
|
|
44
|
+
for (const field of members) {
|
|
45
|
+
const here = row === undefined ? undefined : { array: row.array, path: [...row.path, field.fieldId] };
|
|
46
|
+
// A pass states the declarations its change set could move and carries the rest over, so a
|
|
47
|
+
// write to an unrelated field does not re-evaluate every conditioned option on the record.
|
|
48
|
+
// A declaration outside the scope still has its children visited: a container's own
|
|
49
|
+
// availability and its members' are separate questions.
|
|
50
|
+
const inScope = scope === undefined || scope.has(field.fieldId);
|
|
51
|
+
if (inScope && field.options !== undefined && declaresAvailability(field.options)) {
|
|
52
|
+
if (here === undefined) {
|
|
53
|
+
const ref = { fieldId: field.fieldId };
|
|
54
|
+
const binding = evaluateBinding(state, field, ref, undefined);
|
|
55
|
+
if (binding !== undefined)
|
|
56
|
+
answers.set(fieldKey(ref), binding);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const scopes = rows.of(here.array);
|
|
60
|
+
if (scopes.length === 0) {
|
|
61
|
+
const cause = rows.rowlessCause(here.array);
|
|
62
|
+
if (cause !== undefined) {
|
|
63
|
+
const ref = { fieldId: field.fieldId };
|
|
64
|
+
const binding = rowlessBinding(state, field, ref, cause);
|
|
65
|
+
if (binding !== undefined)
|
|
66
|
+
answers.set(fieldKey(ref), binding);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
for (const rowScope of scopes) {
|
|
70
|
+
const ref = { fieldId: field.fieldId, rowKey: rowScope.rowKey };
|
|
71
|
+
const binding = evaluateBinding(state, field, ref, { scope: rowScope, path: here.path });
|
|
72
|
+
if (binding !== undefined)
|
|
73
|
+
answers.set(fieldKey(ref), binding);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (field.fields === undefined || field.fields.length === 0)
|
|
78
|
+
continue;
|
|
79
|
+
visit(state, field.fields,
|
|
80
|
+
// An array's children are its own rows; a record's children stay in the row that holds it.
|
|
81
|
+
field.primitive === 'array' ? { array: field, path: [] } : here, answers, rows, scope);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Whether any declared option states a condition, so the binding has an answer to state. */
|
|
85
|
+
function declaresAvailability(options) {
|
|
86
|
+
return options.some((option) => option.availableWhen !== undefined);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Every conditioned option as undetermined with one cause.
|
|
90
|
+
*
|
|
91
|
+
* The answer is used where the record does not let this device decide a condition at all: the
|
|
92
|
+
* list read was `DEFERRED` or `UNKNOWN`, or no row could be keyed. Every conditioned option is
|
|
93
|
+
* listed because none can be read as available, and each is in `held` because the row that
|
|
94
|
+
* would say which code the record holds is the row the device could not read. Readiness turns
|
|
95
|
+
* each entry into an open question rather than a decided failure, so the verdict is
|
|
96
|
+
* `UNDETERMINED` and no blocker claims a code the device never saw.
|
|
97
|
+
*/
|
|
98
|
+
function conditionedBinding(field, cause) {
|
|
99
|
+
const answers = (field.options ?? []).flatMap((option) => option.availableWhen === undefined
|
|
100
|
+
? []
|
|
101
|
+
: [{ code: option.code, kind: 'undetermined', cause }]);
|
|
102
|
+
if (answers.length === 0)
|
|
103
|
+
return undefined;
|
|
104
|
+
return { options: answers, held: answers };
|
|
105
|
+
}
|
|
106
|
+
/** One row-less open question at a member whose array addresses no row. */
|
|
107
|
+
function rowlessBinding(state, field, ref, cause) {
|
|
108
|
+
// The answer names conditioned codes and reads no value, so a masked or write-only member
|
|
109
|
+
// still states it. Only a declaration that is not delivered at all states nothing.
|
|
110
|
+
const reason = withheldReason(state, ref);
|
|
111
|
+
if (reason === 'hidden' || reason === 'redacted')
|
|
112
|
+
return undefined;
|
|
113
|
+
return conditionedBinding(field, cause);
|
|
114
|
+
}
|
|
115
|
+
/** The rows one array addresses, with the item scope each of them reads under. */
|
|
116
|
+
class RowScopes {
|
|
117
|
+
byArray = new Map();
|
|
118
|
+
/**
|
|
119
|
+
* Why one array states no row at all, when the reason is a declared condition's to report.
|
|
120
|
+
*
|
|
121
|
+
* An array whose rows cannot be keyed because its declaration does not reconcile them still
|
|
122
|
+
* has conditioned options that no device can call available. A row-less answer carries that
|
|
123
|
+
* open question to readiness, without inventing a row key the record never supplied. A
|
|
124
|
+
* withheld natural key and a writer-owned identity are absent here: those are deliberately no
|
|
125
|
+
* answer rather than an undecided one.
|
|
126
|
+
*/
|
|
127
|
+
rowless = new Map();
|
|
128
|
+
state;
|
|
129
|
+
constructor(state) {
|
|
130
|
+
this.state = state;
|
|
131
|
+
}
|
|
132
|
+
/** The addressed rows of one array, or none when the device cannot name them. */
|
|
133
|
+
of(array) {
|
|
134
|
+
const cached = this.byArray.get(array.fieldId);
|
|
135
|
+
if (cached !== undefined)
|
|
136
|
+
return cached;
|
|
137
|
+
const scopes = this.build(array);
|
|
138
|
+
this.byArray.set(array.fieldId, scopes);
|
|
139
|
+
return scopes;
|
|
140
|
+
}
|
|
141
|
+
/** Why one array states no row, when a declared condition exists but no row can be keyed. */
|
|
142
|
+
rowlessCause(array) {
|
|
143
|
+
// Reading the answer first is what builds it; a cached empty list carries its cause with it.
|
|
144
|
+
this.of(array);
|
|
145
|
+
return this.rowless.get(array.fieldId);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* One array's rows, by the invariants `evaluateItemRule` states: an absent, `null` or
|
|
149
|
+
* undetermined list has no row, a list whose identity does not reconcile addresses none, and
|
|
150
|
+
* the row's withheld and unproduced members travel with the elements so a binder answers
|
|
151
|
+
* `UNKNOWN` rather than reading their removal as an absence.
|
|
152
|
+
*/
|
|
153
|
+
build(array) {
|
|
154
|
+
const state = this.state;
|
|
155
|
+
// `addressRows` states no mode when a writer owns the natural identity: the report and the
|
|
156
|
+
// submitted record must not supply two different row keys. Availability reads the same
|
|
157
|
+
// effective rows, so it states no binding rather than inventing an address of its own.
|
|
158
|
+
const identity = array.rowKey?.mode === 'natural' ? array.rowKey.fieldId : undefined;
|
|
159
|
+
if (identity !== undefined && state.computed.writers.has(identity))
|
|
160
|
+
return [];
|
|
161
|
+
const arrayPath = state.reader.declarationPathOf(array.fieldId);
|
|
162
|
+
let read;
|
|
163
|
+
try {
|
|
164
|
+
read = state.reader.read(arrayPath);
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
// One list is validated in one call, so a cell its declaration refuses raises before any
|
|
168
|
+
// row exists and would take the rows beside it with it — losing an availability answer the
|
|
169
|
+
// record still supports. The refused cell is the derived field's own refusal to state (as
|
|
170
|
+
// `invalidOption`), never an availability fact, so the rows are read beside it. Only a
|
|
171
|
+
// refusal of this list or a cell inside it is that: any other engine error stays loud.
|
|
172
|
+
if (!(error instanceof AxiomError))
|
|
173
|
+
throw error;
|
|
174
|
+
if (!error.path.startsWith(arrayPath))
|
|
175
|
+
throw error;
|
|
176
|
+
const beside = rowsBesideRefusal(state, array, arrayPath);
|
|
177
|
+
// The refused cell is the derived field's refusal, and the rows beside it are read. When
|
|
178
|
+
// the list's keys do not address either, no row carries a conditioned answer, so the
|
|
179
|
+
// member keeps its row-less open question rather than silently stating nothing.
|
|
180
|
+
if (beside.unaddressable)
|
|
181
|
+
this.rowless.set(array.fieldId, 'unknown');
|
|
182
|
+
return beside.scopes;
|
|
183
|
+
}
|
|
184
|
+
if (read.kind === 'absent')
|
|
185
|
+
return [];
|
|
186
|
+
if (isUndetermined(read.value)) {
|
|
187
|
+
// The list itself is a value this device did not receive. Its rows may still be named from
|
|
188
|
+
// the raw record, so an item-scoped condition is answered for the row it would read, but
|
|
189
|
+
// no condition is evaluated: the row it would read is incomplete, and treating that as a
|
|
190
|
+
// decided `false` would block a code the record may legitimately hold.
|
|
191
|
+
const cause = read.value.undetermined === 'DEFERRED' ? 'deferred' : 'unknown';
|
|
192
|
+
const beside = rowsBesideRefusal(state, array, arrayPath, cause);
|
|
193
|
+
if (beside.scopes.length === 0)
|
|
194
|
+
this.rowless.set(array.fieldId, cause);
|
|
195
|
+
return beside.scopes;
|
|
196
|
+
}
|
|
197
|
+
if (read.value === null || !isWireArray(read.value))
|
|
198
|
+
return [];
|
|
199
|
+
// The walk materialises one evaluated element per row, so it is bounded by the same source
|
|
200
|
+
// cap an item rule and a comprehension answer before binding their first element. A refusal
|
|
201
|
+
// is the evaluator's (`EXPR-17.1.1`), not an option answer: it stops the pass.
|
|
202
|
+
state.evaluator.refuseElements(read.value.length);
|
|
203
|
+
const addressing = addressingOfItems(array, read.value, state.reader.index.assignedRowKeys?.(array.fieldId));
|
|
204
|
+
if (addressing.outcome !== 'addressed') {
|
|
205
|
+
// No row can be keyed, so a declared condition can name neither the code it judges nor the
|
|
206
|
+
// row it lives in. It still cannot be read as available: one row-less open question stands
|
|
207
|
+
// at the member and the verdict is undetermined (`RULES-7.1.1`).
|
|
208
|
+
this.rowless.set(array.fieldId, 'unknown');
|
|
209
|
+
return [];
|
|
210
|
+
}
|
|
211
|
+
const rowKeys = addressing.rows.map((row) => row.rowKey);
|
|
212
|
+
const rowMembers = array.fields?.map((member) => member.fieldId) ?? [];
|
|
213
|
+
const elements = read.value.map((item) => {
|
|
214
|
+
const evaluated = valueOf(item);
|
|
215
|
+
return rowMembers.length === 0 ? evaluated : { ...evaluated, closedMembers: rowMembers };
|
|
216
|
+
});
|
|
217
|
+
const withheld = read.withheldRows ?? rowKeys.map((rowKey) => state.reader.withheldAt(arrayPath, rowKey));
|
|
218
|
+
// A natural key delivery withholds must not name a row: keying the binding by it would put
|
|
219
|
+
// the key in the snapshot and a readiness blocker. The row keeps its position so the other
|
|
220
|
+
// rows, and a condition reading a neighbour, still address the record it states.
|
|
221
|
+
const addressed = addressing.rows.flatMap((row, index) => identity !== undefined && deliveryWithheld(state, { fieldId: identity, rowKey: row.rowKey })
|
|
222
|
+
? []
|
|
223
|
+
: [{ row, index }]);
|
|
224
|
+
return addressed.map(({ row, index }) => ({
|
|
225
|
+
arrayFieldId: array.fieldId,
|
|
226
|
+
rowKey: row.rowKey,
|
|
227
|
+
index,
|
|
228
|
+
elements,
|
|
229
|
+
withheld,
|
|
230
|
+
undetermined: read.undeterminedRows,
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* The rows of an array whose whole-list read a refused cell raised on.
|
|
236
|
+
*
|
|
237
|
+
* `RecordReader.read` validates a list in one call, so a single cell its declaration refuses
|
|
238
|
+
* raises before any row exists and the rows beside it lose their answers with it. The refusal
|
|
239
|
+
* itself is the derived field's to state as `invalidOption`; availability's question is only what
|
|
240
|
+
* the record can still support. Every declared member is therefore read through the same wire
|
|
241
|
+
* boundary on its own, and one the declaration refuses is removed from its row and named on that
|
|
242
|
+
* row's undetermined sideband with `UNKNOWN` — the shape a writer's unproduced member already has
|
|
243
|
+
* — so a condition reading it answers `UNKNOWN` and its removal never passes for an absence.
|
|
244
|
+
*
|
|
245
|
+
* A member this device may not read is withheld exactly as the ordinary read withholds it, and a
|
|
246
|
+
* member whose own restriction has no per-row spelling here is stated undetermined rather than
|
|
247
|
+
* delivered. A row the addressing cannot name states no row at all, and an array whose rows the
|
|
248
|
+
* record no longer holds states none.
|
|
249
|
+
*/
|
|
250
|
+
function rowsBesideRefusal(state, array, arrayPath, undecided) {
|
|
251
|
+
const held = rawListAt(state.reader.input.values, arrayPath);
|
|
252
|
+
if (held === undefined)
|
|
253
|
+
return { scopes: [], unaddressable: false };
|
|
254
|
+
const addressing = addressingOfItems(array, held, state.reader.index.assignedRowKeys?.(array.fieldId));
|
|
255
|
+
if (addressing.outcome !== 'addressed')
|
|
256
|
+
return { scopes: [], unaddressable: true };
|
|
257
|
+
// This path builds a row beside the list read that refused one cell, so it is the same walk
|
|
258
|
+
// and carries the same source cap. A refusal stops the pass rather than leaving rows to
|
|
259
|
+
// answer `UNKNOWN` one at a time.
|
|
260
|
+
state.evaluator.refuseElements(addressing.rows.length);
|
|
261
|
+
const members = array.fields ?? [];
|
|
262
|
+
const memberIds = members.map((member) => member.fieldId);
|
|
263
|
+
const withheld = [];
|
|
264
|
+
const undetermined = [];
|
|
265
|
+
const elements = [];
|
|
266
|
+
for (const [index, row] of addressing.rows.entries()) {
|
|
267
|
+
const rowKey = row.rowKey;
|
|
268
|
+
const item = isRecord(row.item) ? row.item : undefined;
|
|
269
|
+
const values = {};
|
|
270
|
+
const computedWithheld = [];
|
|
271
|
+
const rowUndetermined = [];
|
|
272
|
+
for (const member of members) {
|
|
273
|
+
const id = member.fieldId;
|
|
274
|
+
const computed = state.reader.computed?.getRow(id, rowKey) ?? state.reader.computed?.get(id);
|
|
275
|
+
if (computed !== undefined) {
|
|
276
|
+
if (computed.kind === 'undetermined') {
|
|
277
|
+
rowUndetermined.push([id, computed.sentinel]);
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
// A nested container's per-row sideband has no spelling on the member here, so the
|
|
281
|
+
// member is undetermined rather than delivered with a value it lost. A nested member the
|
|
282
|
+
// writer's value withheld is a dotted path inside the row, which the row's sideband states.
|
|
283
|
+
if (computed.withheldRows !== undefined || computed.undeterminedRows !== undefined) {
|
|
284
|
+
rowUndetermined.push([id, UNKNOWN]);
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
for (const path of computed.withheldMembers ?? [])
|
|
288
|
+
computedWithheld.push(`${id}.${path}`);
|
|
289
|
+
values[id] = computed.value;
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (item === undefined || !Object.hasOwn(item, id))
|
|
293
|
+
continue;
|
|
294
|
+
try {
|
|
295
|
+
values[id] = toWireValue(item[id], `${arrayPath}[${String(index)}].${id}`, wireDeclarationOf(member));
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
if (!(error instanceof AxiomError))
|
|
299
|
+
throw error;
|
|
300
|
+
rowUndetermined.push([id, UNKNOWN]);
|
|
301
|
+
}
|
|
302
|
+
const value = values[id];
|
|
303
|
+
if (value === undefined)
|
|
304
|
+
continue;
|
|
305
|
+
// A writer below a record or array member owns its nested cell just as a direct writer owns
|
|
306
|
+
// the member above. The ordinary merge is the authority for that recursive overlay and its
|
|
307
|
+
// sidebands; reading only `computed.get(id)` would silently evaluate the submitted nested
|
|
308
|
+
// value the writer replaced (or left undetermined) instead.
|
|
309
|
+
const merged = member.primitive === 'record'
|
|
310
|
+
? state.reader.mergeRecord(member, value)
|
|
311
|
+
: member.primitive === 'array'
|
|
312
|
+
? state.reader.mergeRows(member, value)
|
|
313
|
+
: undefined;
|
|
314
|
+
if (merged?.kind !== 'value')
|
|
315
|
+
continue;
|
|
316
|
+
if (isUndetermined(merged.value)) {
|
|
317
|
+
delete values[id];
|
|
318
|
+
rowUndetermined.push([id, merged.value]);
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (merged.withheldRows !== undefined || merged.undeterminedRows !== undefined) {
|
|
322
|
+
delete values[id];
|
|
323
|
+
rowUndetermined.push([id, UNKNOWN]);
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
for (const path of merged.withheldMembers ?? [])
|
|
327
|
+
computedWithheld.push(`${id}.${path}`);
|
|
328
|
+
values[id] = merged.value;
|
|
329
|
+
}
|
|
330
|
+
// Validation and access are separate questions. Reuse the ordinary reader's recursive row
|
|
331
|
+
// filter after each member's own validation: it refuses an unreadable natural key, removes
|
|
332
|
+
// only the members this row may not read, and keeps their dotted paths attributable.
|
|
333
|
+
const readable = withoutUnreadableMembers({
|
|
334
|
+
field: array,
|
|
335
|
+
rows: [values],
|
|
336
|
+
rowKeyOf: () => rowKey,
|
|
337
|
+
isReadable: (ref) => state.reader.isReadable(ref),
|
|
338
|
+
isRowReadable: (rowKey) => state.reader.isReadable({ fieldId: array.fieldId, rowKey }),
|
|
339
|
+
isRedacted: (ref) => state.reader.isRedacted(ref),
|
|
340
|
+
recordDenied: (fieldId, rowKey) => state.reader.recordDenied(fieldId, rowKey),
|
|
341
|
+
});
|
|
342
|
+
// A row whose natural key this device may not read has no identity to state: that is the
|
|
343
|
+
// withheld-key answer, deliberately no row and no row-less question either.
|
|
344
|
+
if (readable === undefined)
|
|
345
|
+
return { scopes: [], unaddressable: false };
|
|
346
|
+
withheld.push([...computedWithheld, ...(readable.withheld[0] ?? [])]);
|
|
347
|
+
undetermined.push(rowUndetermined);
|
|
348
|
+
const element = item === undefined ? valueOf(UNKNOWN) : valueOf(readable.rows[0] ?? values);
|
|
349
|
+
elements.push({ ...element, closedMembers: memberIds });
|
|
350
|
+
}
|
|
351
|
+
const identity = array.rowKey?.mode === 'natural' ? array.rowKey.fieldId : undefined;
|
|
352
|
+
const ordered = withheld.some((row) => row.length > 0) ? withheld : undefined;
|
|
353
|
+
const pending = undetermined.some((row) => row.length > 0) ? undetermined : undefined;
|
|
354
|
+
return {
|
|
355
|
+
scopes: addressing.rows.flatMap((row, index) => identity !== undefined && deliveryWithheld(state, { fieldId: identity, rowKey: row.rowKey })
|
|
356
|
+
? []
|
|
357
|
+
: [
|
|
358
|
+
{
|
|
359
|
+
arrayFieldId: array.fieldId,
|
|
360
|
+
rowKey: row.rowKey,
|
|
361
|
+
index,
|
|
362
|
+
elements,
|
|
363
|
+
withheld: ordered,
|
|
364
|
+
undetermined: pending,
|
|
365
|
+
...(undecided === undefined ? {} : { undecided }),
|
|
366
|
+
},
|
|
367
|
+
]),
|
|
368
|
+
unaddressable: false,
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
/** The list one declaration path holds in the record, as the record holds it. */
|
|
372
|
+
function rawListAt(values, path) {
|
|
373
|
+
let current = values;
|
|
374
|
+
for (const segment of path.split('.')) {
|
|
375
|
+
if (!isRecord(current))
|
|
376
|
+
return undefined;
|
|
377
|
+
current = current[segment];
|
|
378
|
+
}
|
|
379
|
+
return Array.isArray(current) ? current : undefined;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* The reason delivery withholds one reference, or `undefined` when the value is delivered.
|
|
383
|
+
*
|
|
384
|
+
* The window states one reason per binding, strongest first, so this reads that answer rather than
|
|
385
|
+
* resolving the overlay and its ancestors a second time: a declaration an ancestor hides hides the
|
|
386
|
+
* value inside it whatever the member's own access states, and a `write_only` reference this
|
|
387
|
+
* session has written is delivered (`[ACCESS-1.3.1]`).
|
|
388
|
+
*/
|
|
389
|
+
function withheldReason(state, ref) {
|
|
390
|
+
const answer = state.accessWindow.enclosingDelivery(ref);
|
|
391
|
+
if (answer.deliverable)
|
|
392
|
+
return undefined;
|
|
393
|
+
switch (answer.reason) {
|
|
394
|
+
case 'masked':
|
|
395
|
+
case 'write_only':
|
|
396
|
+
case 'hidden':
|
|
397
|
+
case 'redacted':
|
|
398
|
+
return answer.reason;
|
|
399
|
+
case 'read_write':
|
|
400
|
+
case 'read_only':
|
|
401
|
+
case 'written':
|
|
402
|
+
// A delivered answer, already handled above: a caller never sees one of these here.
|
|
403
|
+
return undefined;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/** One binding's declared availability, or `undefined` when every condition left `available`. */
|
|
407
|
+
function evaluateBinding(state, field, ref, row) {
|
|
408
|
+
const evaluate = () => {
|
|
409
|
+
// A row whose list read decided nothing states every conditioned code undetermined. That
|
|
410
|
+
// answer reads no value at all, so it is safe even when delivery withholds the row: the
|
|
411
|
+
// code it could not read is exactly what the open question is about.
|
|
412
|
+
if (row?.scope.undecided !== undefined) {
|
|
413
|
+
return conditionedBinding(field, row.scope.undecided);
|
|
414
|
+
}
|
|
415
|
+
// A value delivery withholds has no held code to state: deriving one would put it in the
|
|
416
|
+
// binding and in a readiness blocker, exactly the payload `ACCESS-1.3.4` refuses. The
|
|
417
|
+
// declaration's domain is a separate question, and a control that is on screen still paints
|
|
418
|
+
// it, so a masked or write-only binding states its answers with no held code.
|
|
419
|
+
const reason = withheldReason(state, ref);
|
|
420
|
+
if (reason === 'hidden' || reason === 'redacted')
|
|
421
|
+
return undefined;
|
|
422
|
+
const held = reason === undefined ? heldValuesOf(state, ref, row) : [];
|
|
423
|
+
const answers = [];
|
|
424
|
+
for (const [index, option] of (field.options ?? []).entries()) {
|
|
425
|
+
// One condition and its reason and alternatives are one rule-like unit of work. Without
|
|
426
|
+
// this boundary every option on every row shares one expression's allowance, and a legal
|
|
427
|
+
// large form turns its later rows UNKNOWN after the earlier ones spend it.
|
|
428
|
+
const previous = state.evaluator.beginRule();
|
|
429
|
+
try {
|
|
430
|
+
const answer = availabilityOf(state, field, option, index, held, row?.scope.rowKey);
|
|
431
|
+
if (answer !== undefined)
|
|
432
|
+
answers.push(answer);
|
|
433
|
+
}
|
|
434
|
+
finally {
|
|
435
|
+
state.evaluator.endRule(previous);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (answers.length === 0)
|
|
439
|
+
return undefined;
|
|
440
|
+
return {
|
|
441
|
+
options: answers,
|
|
442
|
+
held: reason === undefined
|
|
443
|
+
? answers.filter((answer) => holdsOption(field, answer.code, held))
|
|
444
|
+
: [],
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
if (row === undefined)
|
|
448
|
+
return evaluate();
|
|
449
|
+
const previousRow = state.currentRowKey;
|
|
450
|
+
state.currentRowKey = row.scope.rowKey;
|
|
451
|
+
try {
|
|
452
|
+
return state.evaluator.withItemScope(state.reader.declarationPathOf(row.scope.arrayFieldId), row.scope.elements, row.scope.index, evaluate, row.scope.withheld, row.scope.undetermined);
|
|
453
|
+
}
|
|
454
|
+
finally {
|
|
455
|
+
state.currentRowKey = previousRow;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* One declared option's availability, or `undefined` when it is available.
|
|
460
|
+
*
|
|
461
|
+
* A condition that decides true states no answer, exactly as an option that declares none does.
|
|
462
|
+
* The reason's parameters travel only with an unavailable answer, and the alternatives only for
|
|
463
|
+
* the code the record holds: an alternative is never evaluated for a code nobody chose.
|
|
464
|
+
*/
|
|
465
|
+
function availabilityOf(state, field, option, index, held, currentRowKey) {
|
|
466
|
+
if (option.availableWhen === undefined)
|
|
467
|
+
return undefined;
|
|
468
|
+
noteAvailabilityCondition();
|
|
469
|
+
// The condition's reads are attributed to the binding being judged rather than to a rule, so
|
|
470
|
+
// the three marks are what separate a refusal from an unfilled input and a server handoff,
|
|
471
|
+
// `RULES-2.1.1`.
|
|
472
|
+
const denialMark = state.reader.readMark();
|
|
473
|
+
const missingMark = state.reader.missingMark();
|
|
474
|
+
const deferredMark = state.reader.deferredMark();
|
|
475
|
+
const { status, raised } = outcomeOf(state, option.availableWhen);
|
|
476
|
+
const deferred = state.reader.deferredSince(deferredMark);
|
|
477
|
+
if (status === 'UNKNOWN' && !raised) {
|
|
478
|
+
const refused = state.reader.deniedSince(denialMark, undefined).length > 0;
|
|
479
|
+
// A condition this device may never read is not a code it may refuse: no respondent action
|
|
480
|
+
// decides it, so the option is left available and states no reason or open question
|
|
481
|
+
// (`RULES-7.1.1`). A condition that also read an unfilled input stays undetermined, and one
|
|
482
|
+
// that read a value the server holds keeps the handoff the redacted input is.
|
|
483
|
+
if (refused && !state.reader.missingSince(missingMark) && !deferred)
|
|
484
|
+
return undefined;
|
|
485
|
+
}
|
|
486
|
+
if (status === 'PASS')
|
|
487
|
+
return undefined;
|
|
488
|
+
if (status !== 'FAIL') {
|
|
489
|
+
return {
|
|
490
|
+
code: option.code,
|
|
491
|
+
kind: 'undetermined',
|
|
492
|
+
cause: deferred ? 'deferred' : causeOf(status),
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
const at = `$.fields.${field.fieldId}.options[${String(index)}]`;
|
|
496
|
+
const params = paramsOf(state, option.unavailableParams, { at: `${at}.unavailableParams` });
|
|
497
|
+
const alternatives = holdsOption(field, option.code, held)
|
|
498
|
+
? evaluateSuggestions(state, option.suggests ?? [], currentRowKey)
|
|
499
|
+
: { suggestions: [] };
|
|
500
|
+
return {
|
|
501
|
+
code: option.code,
|
|
502
|
+
kind: 'unavailable',
|
|
503
|
+
...(option.unavailableMessageKey === undefined
|
|
504
|
+
? {}
|
|
505
|
+
: { messageKey: option.unavailableMessageKey }),
|
|
506
|
+
...(params === undefined ? {} : { params }),
|
|
507
|
+
...(alternatives.suggestions.length === 0 ? {} : { suggestions: alternatives.suggestions }),
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
/** Whether the record holds one declared option's code at the binding being evaluated. */
|
|
511
|
+
function holdsOption(field, code, held) {
|
|
512
|
+
const value = optionCodeValue(field, code);
|
|
513
|
+
return held.some((candidate) => sameWireValue(candidate, value));
|
|
514
|
+
}
|
|
515
|
+
/** The `UNKNOWN`/`DEFERRED` cause one undecided outcome states. */
|
|
516
|
+
function causeOf(status) {
|
|
517
|
+
return status === 'DEFERRED' ? 'deferred' : 'unknown';
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* The outcome one availability condition decides, with the fail-safe answers stated here.
|
|
521
|
+
*
|
|
522
|
+
* A thrown expression, a non-boolean result, an absent read and a read of a value this device may
|
|
523
|
+
* not state are all `UNKNOWN`: the option is not known to be available, and an undecided condition
|
|
524
|
+
* is never turned into an availability the record cannot support. `raised` keeps a refusal observed
|
|
525
|
+
* elsewhere in the expression from misclassifying an engine error as an access-only outcome.
|
|
526
|
+
*/
|
|
527
|
+
function outcomeOf(state, node) {
|
|
528
|
+
return withScopedDelivery(state, () => {
|
|
529
|
+
const mark = state.reader.taintMark();
|
|
530
|
+
const binderMark = state.evaluator.binderTaintMark();
|
|
531
|
+
try {
|
|
532
|
+
const status = state.evaluator.statusOf(state.evaluator.evaluate(node));
|
|
533
|
+
// A row scope outlives the reader read that built it, so a revoked member a lifted read
|
|
534
|
+
// delivered is only visible to the binder's own stream. Either answer is a read this
|
|
535
|
+
// device may not state, and an availability condition on it decides nothing.
|
|
536
|
+
return {
|
|
537
|
+
status: state.reader.taintedSince(mark).length > 0 ||
|
|
538
|
+
state.evaluator.touchedBinderWithheld(binderMark)
|
|
539
|
+
? 'UNKNOWN'
|
|
540
|
+
: status,
|
|
541
|
+
raised: false,
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
catch (error) {
|
|
545
|
+
if (!(error instanceof AxiomError))
|
|
546
|
+
throw error;
|
|
547
|
+
return { status: 'UNKNOWN', raised: true };
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
/** The wire values one binding holds, after the writers produced theirs. */
|
|
552
|
+
function heldValuesOf(state, ref, row) {
|
|
553
|
+
if (row !== undefined) {
|
|
554
|
+
const value = decidedValue(row.scope.elements[row.scope.index], row.path);
|
|
555
|
+
return value === undefined || value === null ? [] : isWireArray(value) ? value : [value];
|
|
556
|
+
}
|
|
557
|
+
try {
|
|
558
|
+
const value = decidedValue(state.reader.read(state.reader.declarationPathOf(ref.fieldId)), []);
|
|
559
|
+
return value === undefined || value === null ? [] : isWireArray(value) ? value : [value];
|
|
560
|
+
}
|
|
561
|
+
catch (error) {
|
|
562
|
+
// The derived field states a declaration refusal as `invalidOption`. Availability must not
|
|
563
|
+
// turn that tolerant read into a throw before the refusal reaches readiness.
|
|
564
|
+
if (!(error instanceof AxiomError))
|
|
565
|
+
throw error;
|
|
566
|
+
return [];
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
/** The wire value one evaluated operand states, walking `path` into it; `undefined` if undecided. */
|
|
570
|
+
function decidedValue(evaluated, path) {
|
|
571
|
+
if (evaluated?.kind !== 'value' || isUndetermined(evaluated.value))
|
|
572
|
+
return undefined;
|
|
573
|
+
let current = evaluated.value;
|
|
574
|
+
for (const segment of path) {
|
|
575
|
+
const members = current === undefined ? undefined : wireMembers(current);
|
|
576
|
+
current = members?.[segment];
|
|
577
|
+
}
|
|
578
|
+
return current;
|
|
579
|
+
}
|
|
580
|
+
//# sourceMappingURL=option-availability.js.map
|