@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,521 @@
|
|
|
1
|
+
import { andAll } from '../expr/logic.js';
|
|
2
|
+
import { AxiomError } from '../model/errors.js';
|
|
3
|
+
import { isRecord, isWireArray, wireMembers } from '../model/values.js';
|
|
4
|
+
import { rowKeyToken, rowKeyValue, toFieldRef, toWireValue, wireDeclarationOf, } from '../model/wire.js';
|
|
5
|
+
import { DEFERRED, UNKNOWN } from '../model/types.js';
|
|
6
|
+
import { arrayFieldIds, fieldKey, mayRead, redactionKey, resolveProjectedAccess, stillRedacted, } from './access/projection.js';
|
|
7
|
+
import { permitsUserWrite } from './access/write.js';
|
|
8
|
+
import { rowKeyOfItem } from './addressing.js';
|
|
9
|
+
import { artifactVisibility, isHiddenBy } from './visibility.js';
|
|
10
|
+
/** Omits a value the projection does not permit, without ever reading the value. */
|
|
11
|
+
const OMITTED = Symbol('omitted');
|
|
12
|
+
/** An input target the caller did not supply, which the projection may still fill from a writer. */
|
|
13
|
+
const ABSENT_INPUT = Symbol('absent input');
|
|
14
|
+
function refFor(fieldId, rowKey) {
|
|
15
|
+
return rowKey === undefined ? { fieldId } : { fieldId, rowKey };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The computed values one report states, keyed by the field each writer owns.
|
|
19
|
+
*
|
|
20
|
+
* The report is the record of what the evaluation produced, so the projection reads its
|
|
21
|
+
* answers rather than resolving the overlay again: the computed `value` a rule result carries
|
|
22
|
+
* is the same value a read of that field returned. A result that is `PASS` is decided — `null`
|
|
23
|
+
* included, since it is the empty value of every domain — and `UNKNOWN`/`DEFERRED` are the two
|
|
24
|
+
* sentinels an undetermined write records.
|
|
25
|
+
*/
|
|
26
|
+
function computedTargets(compiled, report) {
|
|
27
|
+
const results = new Map();
|
|
28
|
+
for (const result of report.rules) {
|
|
29
|
+
const collected = results.get(result.ruleId);
|
|
30
|
+
if (collected === undefined)
|
|
31
|
+
results.set(result.ruleId, [result]);
|
|
32
|
+
else
|
|
33
|
+
collected.push(result);
|
|
34
|
+
}
|
|
35
|
+
const targets = new Map();
|
|
36
|
+
for (const rule of compiled.rules ?? []) {
|
|
37
|
+
if (rule.kind !== 'compute' && rule.kind !== 'defaultCompute')
|
|
38
|
+
continue;
|
|
39
|
+
// An item-scoped writer's values are keyed by row and projected by `rowComputedTargets`.
|
|
40
|
+
if (rule.scope === 'item' || rule.fieldId === undefined)
|
|
41
|
+
continue;
|
|
42
|
+
const produced = results.get(rule.ruleId);
|
|
43
|
+
if (produced === undefined || produced.length === 0)
|
|
44
|
+
continue;
|
|
45
|
+
const status = andAll(produced.map((result) => result.status));
|
|
46
|
+
const entry = status === 'PASS'
|
|
47
|
+
? { kind: 'decided', value: produced[0]?.value ?? null }
|
|
48
|
+
: { kind: 'undetermined', sentinel: status === 'DEFERRED' ? DEFERRED : UNKNOWN };
|
|
49
|
+
targets.set(rule.fieldId, { entry, sole: rule.kind === 'compute' });
|
|
50
|
+
}
|
|
51
|
+
return targets;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The per-row values an evaluation produced, keyed by the row member each writer owns.
|
|
55
|
+
*
|
|
56
|
+
* A row's result is decided only when that row's own status is `PASS`; `null` is a decided
|
|
57
|
+
* value. A row the writer could not produce has no entry the projection may substitute, so
|
|
58
|
+
* an absent entry is as authoritative as an undetermined one for a sole `compute`.
|
|
59
|
+
*/
|
|
60
|
+
function rowComputedTargets(compiled, report) {
|
|
61
|
+
const results = new Map();
|
|
62
|
+
for (const result of report.rules) {
|
|
63
|
+
const collected = results.get(result.ruleId);
|
|
64
|
+
if (collected === undefined)
|
|
65
|
+
results.set(result.ruleId, [result]);
|
|
66
|
+
else
|
|
67
|
+
collected.push(result);
|
|
68
|
+
}
|
|
69
|
+
const targets = new Map();
|
|
70
|
+
for (const rule of compiled.rules ?? []) {
|
|
71
|
+
if (rule.kind !== 'compute' && rule.kind !== 'defaultCompute')
|
|
72
|
+
continue;
|
|
73
|
+
if (rule.scope !== 'item' || rule.targetFieldId === undefined)
|
|
74
|
+
continue;
|
|
75
|
+
const rows = new Map();
|
|
76
|
+
for (const result of results.get(rule.ruleId) ?? []) {
|
|
77
|
+
if (result.rowKey === undefined)
|
|
78
|
+
continue;
|
|
79
|
+
const entry = result.status === 'PASS'
|
|
80
|
+
? { kind: 'decided', value: result.value ?? null }
|
|
81
|
+
: { kind: 'undetermined', sentinel: result.status === 'DEFERRED' ? DEFERRED : UNKNOWN };
|
|
82
|
+
rows.set(rowKeyToken(result.rowKey), entry);
|
|
83
|
+
}
|
|
84
|
+
targets.set(rule.targetFieldId, { rows, sole: rule.kind === 'compute' });
|
|
85
|
+
}
|
|
86
|
+
return targets;
|
|
87
|
+
}
|
|
88
|
+
/** Whether a writer owns a member of `field`, at any depth. */
|
|
89
|
+
function hasComputedWithin(field, computed) {
|
|
90
|
+
return (field.fields ?? []).some((member) => computed.has(member.fieldId) || hasComputedWithin(member, computed));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The natural row-key members of every declared array, at any depth.
|
|
94
|
+
*
|
|
95
|
+
* A row's key is its identity, not a claim about its value: a client that may not write the key
|
|
96
|
+
* member still states it in the body, because a row without its key addresses nothing. The
|
|
97
|
+
* writable projection therefore carries it with the row, and nothing else it may not write.
|
|
98
|
+
*/
|
|
99
|
+
function identityFieldsOf(fields, into) {
|
|
100
|
+
for (const field of fields) {
|
|
101
|
+
const key = field.rowKey;
|
|
102
|
+
if (key?.mode === 'natural' && key.fieldId !== undefined)
|
|
103
|
+
into.add(key.fieldId);
|
|
104
|
+
if (field.fields !== undefined)
|
|
105
|
+
identityFieldsOf(field.fields, into);
|
|
106
|
+
}
|
|
107
|
+
return into;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Whether a value is the principal's to submit: a user write the access permits, a natural
|
|
111
|
+
* row-key member (the row's identity), or a `signature_ref` (system-origin evidence the door
|
|
112
|
+
* verifies against a capture, never a user write).
|
|
113
|
+
*/
|
|
114
|
+
function isWritableValue(field, ref, policies) {
|
|
115
|
+
if (field.primitive === 'signature_ref')
|
|
116
|
+
return true;
|
|
117
|
+
if (policies.identityFields.has(field.fieldId))
|
|
118
|
+
return true;
|
|
119
|
+
return permitsUserWrite(resolveProjectedAccess(policies.snapshot.access.access, ref, policies.snapshot.access.sessionWrites));
|
|
120
|
+
}
|
|
121
|
+
/** Whether `ref` is redacted under the access window's key rule (declaration-wide or exact row). */
|
|
122
|
+
function isRedacted(ref, policies) {
|
|
123
|
+
if (policies.redacted.has(ref.fieldId))
|
|
124
|
+
return true;
|
|
125
|
+
return policies.redacted.has(redactionKey(policies.arrays, ref));
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Whether this declaration's value is withheld/.
|
|
129
|
+
*
|
|
130
|
+
* Access first: a value the device may not read is not its to submit. Then the hiding
|
|
131
|
+
* policy, which decides only what a hidden value means — a visible value travels whatever
|
|
132
|
+
* its policy says, and the policy a field declares is its own, so a member of a preserved
|
|
133
|
+
* container is still decided by the member. */
|
|
134
|
+
function isWithheld(field, ref, policies) {
|
|
135
|
+
if (isRedacted(ref, policies))
|
|
136
|
+
return true;
|
|
137
|
+
if (!mayRead(policies.snapshot.access.access, ref, policies.snapshot.access.sessionWrites)) {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
if (!policies.isHidden(field.fieldId))
|
|
141
|
+
return false;
|
|
142
|
+
return (field.onHide ?? policies.document) === 'exclude';
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Projects one value for submission: access, then the declaration, then the value.
|
|
146
|
+
*
|
|
147
|
+
* A reference the projection may not export is decided before the payload is touched, so a
|
|
148
|
+
* withheld member's shape can never abort the export or reach a diagnostic. A declared member
|
|
149
|
+
* that *is* exported is validated through the wire contract at the leaf, and a member the
|
|
150
|
+
* declaration does not name is refused by name only — silently dropping it would hide
|
|
151
|
+
* invalid input, and reading it would validate what must never leave.
|
|
152
|
+
*/
|
|
153
|
+
function projectValue(field, raw, rowKey, path, policies, state) {
|
|
154
|
+
const ref = refFor(field.fieldId, rowKey);
|
|
155
|
+
// Access and `onHide` are decided before the payload — including a computed one — is touched,
|
|
156
|
+
// so a value the device may not export never reaches the projection's output.
|
|
157
|
+
if (isWithheld(field, ref, policies)) {
|
|
158
|
+
state.withheld.set(fieldKey(ref), ref);
|
|
159
|
+
return OMITTED;
|
|
160
|
+
}
|
|
161
|
+
// A writable submission carries only the principal's answers. A non-writable value is the
|
|
162
|
+
// server's record, so it is not this body's claim: it is omitted, and *not* recorded as
|
|
163
|
+
// withheld — the server holds it, and a signature the client sends is verified against the
|
|
164
|
+
// merged record rather than refused for a value the body never had to carry.
|
|
165
|
+
if (policies.writableOnly && !isWritableValue(field, ref, policies))
|
|
166
|
+
return OMITTED;
|
|
167
|
+
// A writer's decided result is the field's value. An undetermined `compute` omits the field
|
|
168
|
+
// entirely: falling back to the submitted value is the stale write this projection exists to
|
|
169
|
+
// keep out. A `defaultCompute` keeps the stored value, which may be a user override.
|
|
170
|
+
const target = policies.computed.get(field.fieldId);
|
|
171
|
+
let source = raw;
|
|
172
|
+
if (target !== undefined) {
|
|
173
|
+
if (target.entry.kind === 'decided')
|
|
174
|
+
source = target.entry.value;
|
|
175
|
+
else if (target.sole) {
|
|
176
|
+
state.withheld.set(fieldKey(ref), ref);
|
|
177
|
+
return OMITTED;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// A row-scoped writer owns the member in the rows it wrote. Its entry is addressed by the
|
|
181
|
+
// row's natural key, so one row's answer never replaces a sibling's submitted value.
|
|
182
|
+
const rowTarget = policies.rowComputed.get(field.fieldId);
|
|
183
|
+
if (rowTarget !== undefined) {
|
|
184
|
+
const entry = rowKey === undefined ? undefined : rowTarget.rows.get(rowKeyToken(rowKey));
|
|
185
|
+
if (entry?.kind === 'decided') {
|
|
186
|
+
source = entry.value;
|
|
187
|
+
}
|
|
188
|
+
else if (rowTarget.sole) {
|
|
189
|
+
// No decided entry for this row: the sole writer produced nothing here, so the
|
|
190
|
+
// submitted member is not the field's value and must not travel.
|
|
191
|
+
state.withheld.set(fieldKey(ref), ref);
|
|
192
|
+
return OMITTED;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (source === ABSENT_INPUT) {
|
|
196
|
+
// A record absent from the submission may still hold a computed member.
|
|
197
|
+
if (field.primitive === 'record' && hasComputedWithin(field, policies.computed)) {
|
|
198
|
+
return projectMembers(field, {}, rowKey, path, policies, state);
|
|
199
|
+
}
|
|
200
|
+
return OMITTED;
|
|
201
|
+
}
|
|
202
|
+
// A cleared container is a value the form holds: the wire contract admits `null` for every
|
|
203
|
+
// declaration, so it travels as `null` rather than refusing the export a caller cannot avoid.
|
|
204
|
+
if (source === null)
|
|
205
|
+
return toWireValue(source, path, field);
|
|
206
|
+
if (field.primitive === 'record') {
|
|
207
|
+
if (!isRecord(source)) {
|
|
208
|
+
throw new AxiomError('ENGINE_ERROR', `not a record: ${path}`, path);
|
|
209
|
+
}
|
|
210
|
+
return projectMembers(field, source, rowKey, path, policies, state);
|
|
211
|
+
}
|
|
212
|
+
if (field.primitive === 'array') {
|
|
213
|
+
if (!Array.isArray(source)) {
|
|
214
|
+
throw new AxiomError('ENGINE_ERROR', `not a list: ${path}`, path);
|
|
215
|
+
}
|
|
216
|
+
if (field.items !== undefined) {
|
|
217
|
+
// A scalar or attachment array has no rows to withhold: its items are values, so
|
|
218
|
+
// access is decided for the field itself before any element is exported, and the whole
|
|
219
|
+
// list is read against its item domain in one place.
|
|
220
|
+
return toWireValue(source, path, wireDeclarationOf(field));
|
|
221
|
+
}
|
|
222
|
+
const items = [];
|
|
223
|
+
const assignedManifest = field.rowKey?.mode === 'assigned'
|
|
224
|
+
? policies.snapshot.assignedRowKeys?.(field.fieldId)
|
|
225
|
+
: undefined;
|
|
226
|
+
for (const [index, item] of source.entries()) {
|
|
227
|
+
if (!isRecord(item)) {
|
|
228
|
+
throw new AxiomError('ENGINE_ERROR', `not a record: ${path}[${String(index)}]`, path);
|
|
229
|
+
}
|
|
230
|
+
// The row's own access is decided before any of its members are projected, so a
|
|
231
|
+
// withheld row is dropped whole and its members are never even read. The key is the
|
|
232
|
+
// addressing authority's answer for this list: a natural member, or the manifest's id once
|
|
233
|
+
// it names one per row, never an id paired with a position it does not reconcile with.
|
|
234
|
+
const itemKey = rowKeyOfItem(field, source, index, assignedManifest);
|
|
235
|
+
const rowRef = refFor(field.fieldId, itemKey);
|
|
236
|
+
// A row the server redacted is not this device's to export, even when the caller still
|
|
237
|
+
// holds a stale local copy. Row-scoped array redactions already collapsed to the array
|
|
238
|
+
// declaration above; this check guards any remaining per-row read restriction and records
|
|
239
|
+
// the withheld row so a signature over it refuses to travel.
|
|
240
|
+
if (isRedacted(rowRef, policies) ||
|
|
241
|
+
!mayRead(policies.snapshot.access.access, rowRef, policies.snapshot.access.sessionWrites)) {
|
|
242
|
+
state.withheld.set(fieldKey(rowRef), rowRef);
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
// A row the principal may not write is the server's record, not this body's answer.
|
|
246
|
+
if (policies.writableOnly && !isWritableValue(field, rowRef, policies))
|
|
247
|
+
continue;
|
|
248
|
+
items.push(projectMembers(field, item, itemKey, `${path}[${String(index)}]`, policies, state));
|
|
249
|
+
}
|
|
250
|
+
return items;
|
|
251
|
+
}
|
|
252
|
+
const value = toWireValue(source, path, field);
|
|
253
|
+
if (field.primitive === 'signature_ref') {
|
|
254
|
+
const members = wireMembers(value);
|
|
255
|
+
if (members !== undefined) {
|
|
256
|
+
state.signatures.push({ fieldId: field.fieldId, value: members, path });
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return value;
|
|
260
|
+
}
|
|
261
|
+
/** Every declared, permitted member of one record, validated only once it is exported. */
|
|
262
|
+
function projectMembers(field, record, rowKey, path, policies, state) {
|
|
263
|
+
const declared = new Set((field.fields ?? []).map((member) => member.fieldId));
|
|
264
|
+
for (const name of Object.keys(record)) {
|
|
265
|
+
if (declared.has(name))
|
|
266
|
+
continue;
|
|
267
|
+
throw new AxiomError('ENGINE_ERROR', `undeclared member: ${path}.${name}`, `${path}.${name}`);
|
|
268
|
+
}
|
|
269
|
+
const projected = {};
|
|
270
|
+
for (const member of field.fields ?? []) {
|
|
271
|
+
const present = Object.hasOwn(record, member.fieldId) && record[member.fieldId] !== undefined;
|
|
272
|
+
// A member no input supplies can still be written by a computed target or hold one,
|
|
273
|
+
// including a per-row writer's member for this row.
|
|
274
|
+
const rowTarget = policies.rowComputed.get(member.fieldId);
|
|
275
|
+
if (!present &&
|
|
276
|
+
!policies.computed.has(member.fieldId) &&
|
|
277
|
+
rowTarget === undefined &&
|
|
278
|
+
!hasComputedWithin(member, policies.computed)) {
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
const child = present ? record[member.fieldId] : ABSENT_INPUT;
|
|
282
|
+
const next = projectValue(member, child, rowKey, `${path}.${member.fieldId}`, policies, state);
|
|
283
|
+
if (next !== OMITTED)
|
|
284
|
+
projected[member.fieldId] = next;
|
|
285
|
+
}
|
|
286
|
+
return projected;
|
|
287
|
+
}
|
|
288
|
+
/** Each rule's outcome in this report, folded the way its own evaluation folded it. */
|
|
289
|
+
function ruleStatuses(report) {
|
|
290
|
+
const collected = new Map();
|
|
291
|
+
for (const result of report.rules) {
|
|
292
|
+
const statuses = collected.get(result.ruleId);
|
|
293
|
+
if (statuses === undefined)
|
|
294
|
+
collected.set(result.ruleId, [result.status]);
|
|
295
|
+
else
|
|
296
|
+
statuses.push(result.status);
|
|
297
|
+
}
|
|
298
|
+
return new Map([...collected].map(([ruleId, statuses]) => [ruleId, andAll(statuses)]));
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* The covered targets one carried signature declares. The value already
|
|
302
|
+
* passed the wire reader's `signature_ref` check, so a member read here is a reference the
|
|
303
|
+
* contract admits; a hand-built value that is not one simply covers nothing.
|
|
304
|
+
*/
|
|
305
|
+
function coveredTargets(value) {
|
|
306
|
+
const targets = value['coveredTargets'];
|
|
307
|
+
if (targets === undefined || !isWireArray(targets))
|
|
308
|
+
return [];
|
|
309
|
+
const refs = [];
|
|
310
|
+
for (const raw of targets) {
|
|
311
|
+
const members = wireMembers(raw);
|
|
312
|
+
const fieldId = members?.['fieldId'];
|
|
313
|
+
if (typeof fieldId !== 'string')
|
|
314
|
+
continue;
|
|
315
|
+
const rowKey = rowKeyValue(members?.['rowKey']);
|
|
316
|
+
refs.push(rowKey === undefined ? { fieldId } : { fieldId, rowKey });
|
|
317
|
+
}
|
|
318
|
+
return refs;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Every declared field's path, for the ids this artifact declares exactly once. An id two
|
|
322
|
+
* declarations share is left out, because a reference the artifact answers two ways is not a
|
|
323
|
+
* reference.
|
|
324
|
+
*/
|
|
325
|
+
function declarationPaths(compiled) {
|
|
326
|
+
const paths = new Map();
|
|
327
|
+
const shared = new Set();
|
|
328
|
+
const visit = (members, prefix) => {
|
|
329
|
+
for (const member of members) {
|
|
330
|
+
const path = prefix === '' ? member.fieldId : `${prefix}.${member.fieldId}`;
|
|
331
|
+
if (paths.has(member.fieldId))
|
|
332
|
+
shared.add(member.fieldId);
|
|
333
|
+
paths.set(member.fieldId, path);
|
|
334
|
+
visit(member.fields ?? [], path);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
visit(compiled.fields, '');
|
|
338
|
+
for (const fieldId of shared)
|
|
339
|
+
paths.delete(fieldId);
|
|
340
|
+
return paths;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Every withheld reference this process has compared while checking a signature's coverage.
|
|
344
|
+
*
|
|
345
|
+
* A measurement hook, never an input: no decision reads it. A projection's signature check asks,
|
|
346
|
+
* for each covered target, whether some withheld value sits below it. Answering that by walking
|
|
347
|
+
* the withheld set per target is the targets times the withheld references; the index built
|
|
348
|
+
* below answers it from the declarations, so the count is the references once.
|
|
349
|
+
*/
|
|
350
|
+
let withheldComparisons = 0;
|
|
351
|
+
/** The withheld references compared since the process started. */
|
|
352
|
+
export function projectionWithheldComparisons() {
|
|
353
|
+
return withheldComparisons;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Indexes the withheld references by the declarations above them, built once per projection.
|
|
357
|
+
*
|
|
358
|
+
* A withheld reference below a target is a reference whose declared path the target's path
|
|
359
|
+
* prefixes. Walking the reference's own ancestors once turns that "any descendant?" question
|
|
360
|
+
* into a set membership test per target, so the signature check is linear in the references
|
|
361
|
+
* and the targets rather than their product.
|
|
362
|
+
*/
|
|
363
|
+
function withheldIndex(withheld, paths) {
|
|
364
|
+
const fieldWideBelow = new Set();
|
|
365
|
+
const rowsBelow = new Map();
|
|
366
|
+
const fieldsWithRows = new Set();
|
|
367
|
+
for (const ref of withheld.values()) {
|
|
368
|
+
withheldComparisons += 1;
|
|
369
|
+
if (ref.rowKey !== undefined)
|
|
370
|
+
fieldsWithRows.add(ref.fieldId);
|
|
371
|
+
const path = paths.get(ref.fieldId);
|
|
372
|
+
if (path === undefined)
|
|
373
|
+
continue;
|
|
374
|
+
const segments = path.split('.');
|
|
375
|
+
for (let index = 1; index < segments.length; index += 1) {
|
|
376
|
+
const ancestor = segments[index - 1];
|
|
377
|
+
if (ancestor === undefined)
|
|
378
|
+
continue;
|
|
379
|
+
if (ref.rowKey === undefined) {
|
|
380
|
+
fieldWideBelow.add(ancestor);
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
const rows = rowsBelow.get(ancestor);
|
|
384
|
+
if (rows === undefined)
|
|
385
|
+
rowsBelow.set(ancestor, new Set([rowKeyToken(ref.rowKey)]));
|
|
386
|
+
else
|
|
387
|
+
rows.add(rowKeyToken(ref.rowKey));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return { fieldWideBelow, rowsBelow, fieldsWithRows };
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Whether the projection withholds the value a covered target names — the target itself, a
|
|
394
|
+
* container that holds it, or part of the value it binds. A target this artifact does not
|
|
395
|
+
* resolve is not withheld: the projection drops a value only at a declaration it carries, so a
|
|
396
|
+
* target no declaration names never had one to drop.
|
|
397
|
+
*/
|
|
398
|
+
function withholds(target, withheld, paths, index) {
|
|
399
|
+
if (withholdsTarget(target, withheld, paths))
|
|
400
|
+
return true;
|
|
401
|
+
return withholdsBelow(target, index);
|
|
402
|
+
}
|
|
403
|
+
/** The target itself, or any container above it, is withheld — field-wide or for its row. */
|
|
404
|
+
function withholdsTarget(target, withheld, paths) {
|
|
405
|
+
if (withheld.has(fieldKey(target)))
|
|
406
|
+
return true;
|
|
407
|
+
const path = paths.get(target.fieldId);
|
|
408
|
+
if (path === undefined)
|
|
409
|
+
return false;
|
|
410
|
+
for (const declared of path.split('.')) {
|
|
411
|
+
if (withheld.has(fieldKey({ fieldId: declared })))
|
|
412
|
+
return true;
|
|
413
|
+
if (target.rowKey !== undefined &&
|
|
414
|
+
withheld.has(fieldKey({ fieldId: declared, rowKey: target.rowKey }))) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Part of the value the target binds is withheld.
|
|
422
|
+
*
|
|
423
|
+
* A covered target binds the value behind it, so a `record` whose member the projection drops,
|
|
424
|
+
* a list whose row it shortens and a row whose member it withholds are all values the digest
|
|
425
|
+
* was not computed over: exporting the signature would leave it describing data the submission
|
|
426
|
+
* does not carry. A target bound to a row binds that row, so only that row's members (or a
|
|
427
|
+
* field-wide withholding across every row) count.
|
|
428
|
+
*
|
|
429
|
+
* The three answers come from the index rather than a walk of the withheld set: a row of the
|
|
430
|
+
* covered list itself, a field-wide withholding below the target, and a row-specific one below
|
|
431
|
+
* it that names the target's row. Each is a set or map hit, so a signature over many targets
|
|
432
|
+
* beside many withheld references is the two counts rather than their product.
|
|
433
|
+
*/
|
|
434
|
+
function withholdsBelow(target, index) {
|
|
435
|
+
if (target.rowKey === undefined && index.fieldsWithRows.has(target.fieldId))
|
|
436
|
+
return true;
|
|
437
|
+
if (index.fieldWideBelow.has(target.fieldId))
|
|
438
|
+
return true;
|
|
439
|
+
const rows = index.rowsBelow.get(target.fieldId);
|
|
440
|
+
if (rows === undefined)
|
|
441
|
+
return false;
|
|
442
|
+
return target.rowKey === undefined ? true : rows.has(rowKeyToken(target.rowKey));
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Refuses an export that would carry a signature while withholding a value it binds,
|
|
446
|
+
* The whole projection is walked first and the refusal comes before any
|
|
447
|
+
* value is returned, so the answer cannot depend on which field the walk reached first.
|
|
448
|
+
*/
|
|
449
|
+
function assertSignaturesCarried(compiled, state) {
|
|
450
|
+
if (state.signatures.length === 0)
|
|
451
|
+
return;
|
|
452
|
+
const paths = declarationPaths(compiled);
|
|
453
|
+
const index = withheldIndex(state.withheld, paths);
|
|
454
|
+
for (const signature of state.signatures) {
|
|
455
|
+
for (const target of coveredTargets(signature.value)) {
|
|
456
|
+
if (!withholds(target, state.withheld, paths, index))
|
|
457
|
+
continue;
|
|
458
|
+
throw new AxiomError('SIGNATURE_COVER_EXCLUDED', `signature field \`${signature.fieldId}\` covers ${fieldKey(target)}, which the submission leaves out or carries only in part; a signature must not travel without the values it binds`, signature.path);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* The submission projection of one evaluated snapshot: a pure function of
|
|
464
|
+
* the artifact, the caller's values and the report that evaluation produced. It never mutates
|
|
465
|
+
* `input` and never reads a clock; the only port it can reach is the caller's `lookup`, through
|
|
466
|
+
* the evaluation it derives its snapshot from.
|
|
467
|
+
*/
|
|
468
|
+
export function projectSubmission(compiled, input, snapshot, options = {}) {
|
|
469
|
+
// An item-scoped writer that names no row member has nothing the projection can address;
|
|
470
|
+
// refusing keeps a submission from silently dropping the write. A writer that declares
|
|
471
|
+
// `targetFieldId` is projected per row below.
|
|
472
|
+
for (const rule of compiled.rules ?? []) {
|
|
473
|
+
if ((rule.kind === 'compute' || rule.kind === 'defaultCompute') &&
|
|
474
|
+
rule.scope === 'item' &&
|
|
475
|
+
rule.targetFieldId === undefined) {
|
|
476
|
+
throw new AxiomError('ENGINE_ERROR', `rule \`${rule.ruleId}\` is an item-scoped ${rule.kind} with no targetFieldId, so the submission cannot carry its value`, rule.ruleId);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
const visibility = artifactVisibility(compiled);
|
|
480
|
+
const statuses = ruleStatuses(snapshot.report);
|
|
481
|
+
const computed = computedTargets(compiled, snapshot.report);
|
|
482
|
+
const rowComputed = rowComputedTargets(compiled, snapshot.report);
|
|
483
|
+
const arrays = arrayFieldIds(compiled.fields);
|
|
484
|
+
const policies = {
|
|
485
|
+
snapshot,
|
|
486
|
+
// The record the device exports carries its own writes: a value it wrote is not the server's
|
|
487
|
+
// withheld value any more, so the projection states it rather than omitting it. Both
|
|
488
|
+
// `stillRedacted` and this index use `redactionKey`, so a row-scoped redaction on an array
|
|
489
|
+
// collapses to the whole array declaration, matching the access window.
|
|
490
|
+
redacted: new Set(stillRedacted(compiled.fields, input.redacted ?? [], input.sessionWrites).map((ref, index) => redactionKey(arrays, toFieldRef(ref, `$.redacted[${String(index)}]`)))),
|
|
491
|
+
arrays,
|
|
492
|
+
document: compiled.onHide ?? 'preserve',
|
|
493
|
+
isHidden: (fieldId) => isHiddenBy(visibility, (rule) => statuses.get(rule.ruleId), fieldId),
|
|
494
|
+
computed,
|
|
495
|
+
rowComputed,
|
|
496
|
+
writableOnly: options.writableOnly === true,
|
|
497
|
+
identityFields: identityFieldsOf(compiled.fields, new Set()),
|
|
498
|
+
};
|
|
499
|
+
const state = { withheld: new Map(), signatures: [] };
|
|
500
|
+
const values = {};
|
|
501
|
+
for (const field of compiled.fields) {
|
|
502
|
+
const raw = Object.hasOwn(input.values, field.fieldId)
|
|
503
|
+
? input.values[field.fieldId]
|
|
504
|
+
: undefined;
|
|
505
|
+
const supplied = raw !== undefined;
|
|
506
|
+
// A field no input supplies is still exported when a writer owns it or a member of it.
|
|
507
|
+
if (!supplied && !computed.has(field.fieldId) && !hasComputedWithin(field, computed)) {
|
|
508
|
+
continue;
|
|
509
|
+
}
|
|
510
|
+
const projected = projectValue(field, supplied ? raw : ABSENT_INPUT, undefined, `$.values.${field.fieldId}`, policies, state);
|
|
511
|
+
if (projected !== OMITTED)
|
|
512
|
+
values[field.fieldId] = projected;
|
|
513
|
+
}
|
|
514
|
+
// A value the projection withholds — hidden, masked, redacted, or a `write_only` this session
|
|
515
|
+
// did not write — must not be bound by a signature that travels. A value omitted only because
|
|
516
|
+
// the principal may not write it is not withheld: the server holds it, so the server can verify
|
|
517
|
+
// the signature against its own record.
|
|
518
|
+
assertSignaturesCarried(compiled, state);
|
|
519
|
+
return values;
|
|
520
|
+
}
|
|
521
|
+
//# sourceMappingURL=submission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submission.js","sourceRoot":"","sources":["../../src/eval/submission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EACL,W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logic.js';\nimport { AxiomError } from '../model/errors.js';\nimport { isRecord, isWireArray, wireMembers } from '../model/values.js';\nimport {\n rowKeyToken,\n rowKeyValue,\n toFieldRef,\n toWireValue,\n wireDeclarationOf,\n} from '../model/wire.js';\nimport type {\n CompiledField,\n CompiledRule,\n ComputedValue,\n ReportFacts,\n FieldRef,\n OnHidePolicy,\n Outcome,\n RuleResult,\n WireRecord,\n WireValue,\n} from '../model/types.js';\nimport type { EvaluationInput } from '../model/access.js';\nimport type { CompiledSchema } from '../model/schema.js';\nimport { DEFERRED, UNKNOWN } from '../model/types.js';\nimport {\n arrayFieldIds,\n fieldKey,\n mayRead,\n redactionKey,\n resolveProjectedAccess,\n stillRedacted,\n} from './access/projection.js';\nimport type { SnapshotAccess } from './access/projection.js';\nimport { permitsUserWrite } from './access/write.js';\nimport { rowKeyOfItem } from './addressing.js';\nimport { artifactVisibility, isHiddenBy } from './visibility.js';\n\n/**\n * The submission projection, `spec/semantics/canonical-v1.md` section 6.\n *\n * A projection reads one evaluated snapshot and decides, per target, whether the submission\n * carries it. Three policies meet here and none of them may be guessed:\n *\n * access: a value the device may not read is never exported, and the\n * decision runs before the payload is touched so a withheld member's shape cannot leak;\n * visibility and `onHide`: a hidden field keeps its captured value unless\n * the field's own policy — or the document's — is `exclude`;\n * signature coverage: a signature that travels must not outlive a value it\n * binds, so exclusion is preflighted over the whole projection rather than noticed in\n * field order.\n */\n\n/** The evaluated snapshot one projection reads. */\nexport interface SubmissionSnapshot {\n /** The report the projection's visibility answer comes from. */\n readonly report: ReportFacts;\n /** The access projection that report rendered, so the two cannot disagree. */\n readonly access: SnapshotAccess;\n /** The session's assigned-row manifest, when the record has identity the values do not carry. */\n readonly assignedRowKeys?: (fieldId: string) => readonly (string | number)[] | undefined;\n}\n\n/** How a caller wants the record projected. */\nexport interface SubmissionProjectionOptions {\n /**\n * Export exactly the values the principal may write: the body a client sends to the accept\n * door, where a non-writable binding is the server's stored record rather than the client's\n * claim.\n *\n * The default (`false`) is the full readable projection — the record this process would store,\n * including a `read_only` value it may read. The writable projection additionally carries a\n * natural row-key member (it is the row's identity, not a claim about its value) and a\n * `signature_ref` (system-origin evidence the door verifies against a capture), and it does not\n * withhold a covered value merely because it is not writable: the server holds that value, and\n * a signature the client sends is verified against the merged record.\n */\n readonly writableOnly?: boolean;\n}\n\n/** Omits a value the projection does not permit, without ever reading the value. */\nconst OMITTED: unique symbol = Symbol('omitted');\n\n/**\n * One projection's state: the targets it withheld, and every signature it carries.\n *\n * A withheld target is recorded whichever policy withheld it, because\n * asks whether a covered value travels, not why it did not.\n */\ninterface ProjectionState {\n /** Every reference the input held and the projection does not carry whole, by `fieldKey`. */\n readonly withheld: Map<string, FieldRef>;\n /** Every signature reference the projection carries, with the path it is projected at. */\n readonly signatures: ProjectedSignature[];\n}\n\ninterface ProjectedSignature {\n readonly fieldId: string;\n readonly value: WireRecord;\n readonly path: string;\n}\n\n/** Everything one projection resolves against, including the document's hiding policy. */\ninterface Policies {\n readonly snapshot: SubmissionSnapshot;\n readonly document: OnHidePolicy;\n readonly isHidden: (fieldId: string) => boolean;\n /** The redacted references under `redactionKey`, collapsing row-scoped array redactions to the array declaration. */\n readonly redacted: ReadonlySet<string>;\n /** Every declared array field id, shared with `redactionKey` so projection matches the access window. */\n readonly arrays: ReadonlySet<string>;\n /** The computed targets this projection carries, derived from the report it reads. */\n readonly computed: ReadonlyMap<string, ComputedTarget>;\n /** The row-scoped computed targets, keyed by the member one row owns. */\n readonly rowComputed: ReadonlyMap<string, RowComputedTarget>;\n /** Whether to carry only the values the principal may write: the body a client submits. */\n readonly writableOnly: boolean;\n /** The natural row-key members: a row's identity travels with the row it names. */\n readonly identityFields: ReadonlySet<string>;\n}\n\n/**\n * One computed target the projection carries.\n *\n * `sole` says a `compute` owns the field outright, so an undetermined entry omits the stored\n * value. A `defaultCompute` is not sole: while an override is active its stored value is the\n * field's value, and an undetermined default leaves that value in place.\n */\ninterface ComputedTarget {\n readonly entry: ComputedValue;\n readonly sole: boolean;\n}\n\n/**\n * A row-scoped computed target: one writer's entries for the rows it wrote, keyed by each\n * row's natural or assigned `rowKey` token. A row with no entry is still a target: a `compute`\n * omits the submitted member there, because the writer's answer is absent rather than the caller's.\n */\ninterface RowComputedTarget {\n readonly rows: ReadonlyMap<string, ComputedValue>;\n readonly sole: boolean;\n}\n\n/** An input target the caller did not supply, which the projection may still fill from a writer. */\nconst ABSENT_INPUT: unique symbol = Symbol('absent input');\n\nfunction refFor(fieldId: string, rowKey: string | number | undefined): FieldRef {\n return rowKey === undefined ? { fieldId } : { fieldId, rowKey };\n}\n\n/**\n * The computed values one report states, keyed by the field each writer owns.\n *\n * The report is the record of what the evaluation produced, so the projection reads its\n * answers rather than resolving the overlay again: the computed `value` a rule result carries\n * is the same value a read of that field returned. A result that is `PASS` is decided — `null`\n * included, since it is the empty value of every domain — and `UNKNOWN`/`DEFERRED` are the two\n * sentinels an undetermined write records.\n */\nfunction computedTargets(\n compiled: CompiledSchema,\n report: ReportFacts,\n): ReadonlyMap<string, ComputedTarget> {\n const results = new Map<string, RuleResult[]>();\n for (const result of report.rules) {\n const collected = results.get(result.ruleId);\n if (collected === undefined) results.set(result.ruleId, [result]);\n else collected.push(result);\n }\n const targets = new Map<string, ComputedTarget>();\n for (const rule of compiled.rules ?? []) {\n if (rule.kind !== 'compute' && rule.kind !== 'defaultCompute') continue;\n // An item-scoped writer's values are keyed by row and projected by `rowComputedTargets`.\n if (rule.scope === 'item' || rule.fieldId === undefined) continue;\n const produced = results.get(rule.ruleId);\n if (produced === undefined || produced.length === 0) continue;\n const status = andAll(produced.map((result) => result.status));\n const entry: ComputedValue =\n status === 'PASS'\n ? { kind: 'decided', value: produced[0]?.value ?? null }\n : { kind: 'undetermined', sentinel: status === 'DEFERRED' ? DEFERRED : UNKNOWN };\n targets.set(rule.fieldId, { entry, sole: rule.kind === 'compute' });\n }\n return targets;\n}\n\n/**\n * The per-row values an evaluation produced, keyed by the row member each writer owns.\n *\n * A row's result is decided only when that row's own status is `PASS`; `null` is a decided\n * value. A row the writer could not produce has no entry the projection may substitute, so\n * an absent entry is as authoritative as an undetermined one for a sole `compute`.\n */\nfunction rowComputedTargets(\n compiled: CompiledSchema,\n report: ReportFacts,\n): ReadonlyMap<string, RowComputedTarget> {\n const results = new Map<string, RuleResult[]>();\n for (const result of report.rules) {\n const collected = results.get(result.ruleId);\n if (collected === undefined) results.set(result.ruleId, [result]);\n else collected.push(result);\n }\n const targets = new Map<string, RowComputedTarget>();\n for (const rule of compiled.rules ?? []) {\n if (rule.kind !== 'compute' && rule.kind !== 'defaultCompute') continue;\n if (rule.scope !== 'item' || rule.targetFieldId === undefined) continue;\n const rows = new Map<string, ComputedValue>();\n for (const result of results.get(rule.ruleId) ?? []) {\n if (result.rowKey === undefined) continue;\n const entry: ComputedValue =\n result.status === 'PASS'\n ? { kind: 'decided', value: result.value ?? null }\n : { kind: 'undetermined', sentinel: result.status === 'DEFERRED' ? DEFERRED : UNKNOWN };\n rows.set(rowKeyToken(result.rowKey), entry);\n }\n targets.set(rule.targetFieldId, { rows, sole: rule.kind === 'compute' });\n }\n return targets;\n}\n\n/** Whether a writer owns a member of `field`, at any depth. */\nfunction hasComputedWithin(\n field: CompiledField,\n computed: ReadonlyMap<string, ComputedTarget>,\n): boolean {\n return (field.fields ?? []).some(\n (member) => computed.has(member.fieldId) || hasComputedWithin(member, computed),\n );\n}\n\n/**\n * The natural row-key members of every declared array, at any depth.\n *\n * A row's key is its identity, not a claim about its value: a client that may not write the key\n * member still states it in the body, because a row without its key addresses nothing. The\n * writable projection therefore carries it with the row, and nothing else it may not write.\n */\nfunction identityFieldsOf(fields: readonly CompiledField[], into: Set<string>): Set<string> {\n for (const field of fields) {\n const key = field.rowKey;\n if (key?.mode === 'natural' && key.fieldId !== undefined) into.add(key.fieldId);\n if (field.fields !== undefined) identityFieldsOf(field.fields, into);\n }\n return into;\n}\n\n/**\n * Whether a value is the principal's to submit: a user write the access permits, a natural\n * row-key member (the row's identity), or a `signature_ref` (system-origin evidence the door\n * verifies against a capture, never a user write).\n */\nfunction isWritableValue(field: CompiledField, ref: FieldRef, policies: Policies): boolean {\n if (field.primitive === 'signature_ref') return true;\n if (policies.identityFields.has(field.fieldId)) return true;\n return permitsUserWrite(\n resolveProjectedAccess(\n policies.snapshot.access.access,\n ref,\n policies.snapshot.access.sessionWrites,\n ),\n );\n}\n\n/** Whether `ref` is redacted under the access window's key rule (declaration-wide or exact row). */\nfunction isRedacted(ref: FieldRef, policies: Policies): boolean {\n if (policies.redacted.has(ref.fieldId)) return true;\n return policies.redacted.has(redactionKey(policies.arrays, ref));\n}\n\n/**\n * Whether this declaration's value is withheld/.\n *\n * Access first: a value the device may not read is not its to submit. Then the hiding\n * policy, which decides only what a hidden value means — a visible value travels whatever\n * its policy says, and the policy a field declares is its own, so a member of a preserved\n * container is still decided by the member. */\nfunction isWithheld(field: CompiledField, ref: FieldRef, policies: Policies): boolean {\n if (isRedacted(ref, policies)) return true;\n if (!mayRead(policies.snapshot.access.access, ref, policies.snapshot.access.sessionWrites)) {\n return true;\n }\n if (!policies.isHidden(field.fieldId)) return false;\n return (field.onHide ?? policies.document) === 'exclude';\n}\n\n/**\n * Projects one value for submission: access, then the declaration, then the value.\n *\n * A reference the projection may not export is decided before the payload is touched, so a\n * withheld member's shape can never abort the export or reach a diagnostic. A declared member\n * that *is* exported is validated through the wire contract at the leaf, and a member the\n * declaration does not name is refused by name only — silently dropping it would hide\n * invalid input, and reading it would validate what must never leave.\n */\nfunction projectValue(\n field: CompiledField,\n raw: unknown,\n rowKey: string | number | undefined,\n path: string,\n policies: Policies,\n state: ProjectionState,\n): WireValue | typeof OMITTED {\n const ref = refFor(field.fieldId, rowKey);\n // Access and `onHide` are decided before the payload — including a computed one — is touched,\n // so a value the device may not export never reaches the projection's output.\n if (isWithheld(field, ref, policies)) {\n state.withheld.set(fieldKey(ref), ref);\n return OMITTED;\n }\n // A writable submission carries only the principal's answers. A non-writable value is the\n // server's record, so it is not this body's claim: it is omitted, and *not* recorded as\n // withheld — the server holds it, and a signature the client sends is verified against the\n // merged record rather than refused for a value the body never had to carry.\n if (policies.writableOnly && !isWritableValue(field, ref, policies)) return OMITTED;\n // A writer's decided result is the field's value. An undetermined `compute` omits the field\n // entirely: falling back to the submitted value is the stale write this projection exists to\n // keep out. A `defaultCompute` keeps the stored value, which may be a user override.\n const target = policies.computed.get(field.fieldId);\n let source = raw;\n if (target !== undefined) {\n if (target.entry.kind === 'decided') source = target.entry.value;\n else if (target.sole) {\n state.withheld.set(fieldKey(ref), ref);\n return OMITTED;\n }\n }\n // A row-scoped writer owns the member in the rows it wrote. Its entry is addressed by the\n // row's natural key, so one row's answer never replaces a sibling's submitted value.\n const rowTarget = policies.rowComputed.get(field.fieldId);\n if (rowTarget !== undefined) {\n const entry = rowKey === undefined ? undefined : rowTarget.rows.get(rowKeyToken(rowKey));\n if (entry?.kind === 'decided') {\n source = entry.value;\n } else if (rowTarget.sole) {\n // No decided entry for this row: the sole writer produced nothing here, so the\n // submitted member is not the field's value and must not travel.\n state.withheld.set(fieldKey(ref), ref);\n return OMITTED;\n }\n }\n if (source === ABSENT_INPUT) {\n // A record absent from the submission may still hold a computed member.\n if (field.primitive === 'record' && hasComputedWithin(field, policies.computed)) {\n return projectMembers(field, {}, rowKey, path, policies, state);\n }\n return OMITTED;\n }\n // A cleared container is a value the form holds: the wire contract admits `null` for every\n // declaration, so it travels as `null` rather than refusing the export a caller cannot avoid.\n if (source === null) return toWireValue(source, path, field);\n if (field.primitive === 'record') {\n if (!isRecord(source)) {\n throw new AxiomError('ENGINE_ERROR', `not a record: ${path}`, path);\n }\n return projectMembers(field, source, rowKey, path, policies, state);\n }\n if (field.primitive === 'array') {\n if (!Array.isArray(source)) {\n throw new AxiomError('ENGINE_ERROR', `not a list: ${path}`, path);\n }\n if (field.items !== undefined) {\n // A scalar or attachment array has no rows to withhold: its items are values, so\n // access is decided for the field itself before any element is exported, and the whole\n // list is read against its item domain in one place.\n return toWireValue(source, path, wireDeclarationOf(field));\n }\n const items: WireValue[] = [];\n const assignedManifest =\n field.rowKey?.mode === 'assigned'\n ? policies.snapshot.assignedRowKeys?.(field.fieldId)\n : undefined;\n for (const [index, item] of source.entries()) {\n if (!isRecord(item)) {\n throw new AxiomError('ENGINE_ERROR', `not a record: ${path}[${String(index)}]`, path);\n }\n // The row's own access is decided before any of its members are projected, so a\n // withheld row is dropped whole and its members are never even read. The key is the\n // addressing authority's answer for this list: a natural member, or the manifest's id once\n // it names one per row, never an id paired with a position it does not reconcile with.\n const itemKey = rowKeyOfItem(field, source, index, assignedManifest);\n const rowRef = refFor(field.fieldId, itemKey);\n // A row the server redacted is not this device's to export, even when the caller still\n // holds a stale local copy. Row-scoped array redactions already collapsed to the array\n // declaration above; this check guards any remaining per-row read restriction and records\n // the withheld row so a signature over it refuses to travel.\n if (\n isRedacted(rowRef, policies) ||\n !mayRead(policies.snapshot.access.access, rowRef, policies.snapshot.access.sessionWrites)\n ) {\n state.withheld.set(fieldKey(rowRef), rowRef);\n continue;\n }\n // A row the principal may not write is the server's record, not this body's answer.\n if (policies.writableOnly && !isWritableValue(field, rowRef, policies)) continue;\n items.push(\n projectMembers(field, item, itemKey, `${path}[${String(index)}]`, policies, state),\n );\n }\n return items;\n }\n const value = toWireValue(source, path, field);\n if (field.primitive === 'signature_ref') {\n const members = wireMembers(value);\n if (members !== undefined) {\n state.signatures.push({ fieldId: field.fieldId, value: members, path });\n }\n }\n return value;\n}\n\n/** Every declared, permitted member of one record, validated only once it is exported. */\nfunction projectMembers(\n field: CompiledField,\n record: Record<string, unknown>,\n rowKey: string | number | undefined,\n path: string,\n policies: Policies,\n state: ProjectionState,\n): WireRecord {\n const declared = new Set((field.fields ?? []).map((member) => member.fieldId));\n for (const name of Object.keys(record)) {\n if (declared.has(name)) continue;\n throw new AxiomError('ENGINE_ERROR', `undeclared member: ${path}.${name}`, `${path}.${name}`);\n }\n const projected: Record<string, WireValue> = {};\n for (const member of field.fields ?? []) {\n const present = Object.hasOwn(record, member.fieldId) && record[member.fieldId] !== undefined;\n // A member no input supplies can still be written by a computed target or hold one,\n // including a per-row writer's member for this row.\n const rowTarget = policies.rowComputed.get(member.fieldId);\n if (\n !present &&\n !policies.computed.has(member.fieldId) &&\n rowTarget === undefined &&\n !hasComputedWithin(member, policies.computed)\n ) {\n continue;\n }\n const child = present ? record[member.fieldId] : ABSENT_INPUT;\n const next = projectValue(member, child, rowKey, `${path}.${member.fieldId}`, policies, state);\n if (next !== OMITTED) projected[member.fieldId] = next;\n }\n return projected;\n}\n\n/** Each rule's outcome in this report, folded the way its own evaluation folded it. */\nfunction ruleStatuses(report: ReportFacts): ReadonlyMap<string, Outcome> {\n const collected = new Map<string, Outcome[]>();\n for (const result of report.rules) {\n const statuses = collected.get(result.ruleId);\n if (statuses === undefined) collected.set(result.ruleId, [result.status]);\n else statuses.push(result.status);\n }\n return new Map([...collected].map(([ruleId, statuses]) => [ruleId, andAll(statuses)]));\n}\n\n/**\n * The covered targets one carried signature declares. The value already\n * passed the wire reader's `signature_ref` check, so a member read here is a reference the\n * contract admits; a hand-built value that is not one simply covers nothing.\n */\nfunction coveredTargets(value: WireRecord): readonly FieldRef[] {\n const targets = value['coveredTargets'];\n if (targets === undefined || !isWireArray(targets)) return [];\n const refs: FieldRef[] = [];\n for (const raw of targets) {\n const members = wireMembers(raw);\n const fieldId = members?.['fieldId'];\n if (typeof fieldId !== 'string') continue;\n const rowKey = rowKeyValue(members?.['rowKey']);\n refs.push(rowKey === undefined ? { fieldId } : { fieldId, rowKey });\n }\n return refs;\n}\n\n/**\n * Every declared field's path, for the ids this artifact declares exactly once. An id two\n * declarations share is left out, because a reference the artifact answers two ways is not a\n * reference.\n */\nfunction declarationPaths(compiled: CompiledSchema): ReadonlyMap<string, string> {\n const paths = new Map<string, string>();\n const shared = new Set<string>();\n const visit = (members: readonly CompiledField[], prefix: string): void => {\n for (const member of members) {\n const path = prefix === '' ? member.fieldId : `${prefix}.${member.fieldId}`;\n if (paths.has(member.fieldId)) shared.add(member.fieldId);\n paths.set(member.fieldId, path);\n visit(member.fields ?? [], path);\n }\n };\n visit(compiled.fields, '');\n for (const fieldId of shared) paths.delete(fieldId);\n return paths;\n}\n\n/**\n * Every withheld reference this process has compared while checking a signature's coverage.\n *\n * A measurement hook, never an input: no decision reads it. A projection's signature check asks,\n * for each covered target, whether some withheld value sits below it. Answering that by walking\n * the withheld set per target is the targets times the withheld references; the index built\n * below answers it from the declarations, so the count is the references once.\n */\nlet withheldComparisons = 0;\n\n/** The withheld references compared since the process started. */\nexport function projectionWithheldComparisons(): number {\n return withheldComparisons;\n}\n\n/** Where each field's declared value sits, as the ancestor ids that hold it. */\ninterface WithheldIndex {\n /** Target field ids with a field-wide withheld descendant. */\n readonly fieldWideBelow: ReadonlySet<string>;\n /** Target field id to the row keys withheld below it. */\n readonly rowsBelow: ReadonlyMap<string, ReadonlySet<string>>;\n /** Field ids that carry at least one row-specific withheld reference. */\n readonly fieldsWithRows: ReadonlySet<string>;\n}\n\n/**\n * Indexes the withheld references by the declarations above them, built once per projection.\n *\n * A withheld reference below a target is a reference whose declared path the target's path\n * prefixes. Walking the reference's own ancestors once turns that \"any descendant?\" question\n * into a set membership test per target, so the signature check is linear in the references\n * and the targets rather than their product.\n */\nfunction withheldIndex(\n withheld: ReadonlyMap<string, FieldRef>,\n paths: ReadonlyMap<string, string>,\n): WithheldIndex {\n const fieldWideBelow = new Set<string>();\n const rowsBelow = new Map<string, Set<string>>();\n const fieldsWithRows = new Set<string>();\n for (const ref of withheld.values()) {\n withheldComparisons += 1;\n if (ref.rowKey !== undefined) fieldsWithRows.add(ref.fieldId);\n const path = paths.get(ref.fieldId);\n if (path === undefined) continue;\n const segments = path.split('.');\n for (let index = 1; index < segments.length; index += 1) {\n const ancestor = segments[index - 1];\n if (ancestor === undefined) continue;\n if (ref.rowKey === undefined) {\n fieldWideBelow.add(ancestor);\n continue;\n }\n const rows = rowsBelow.get(ancestor);\n if (rows === undefined) rowsBelow.set(ancestor, new Set([rowKeyToken(ref.rowKey)]));\n else rows.add(rowKeyToken(ref.rowKey));\n }\n }\n return { fieldWideBelow, rowsBelow, fieldsWithRows };\n}\n\n/**\n * Whether the projection withholds the value a covered target names — the target itself, a\n * container that holds it, or part of the value it binds. A target this artifact does not\n * resolve is not withheld: the projection drops a value only at a declaration it carries, so a\n * target no declaration names never had one to drop.\n */\nfunction withholds(\n target: FieldRef,\n withheld: ReadonlyMap<string, FieldRef>,\n paths: ReadonlyMap<string, string>,\n index: WithheldIndex,\n): boolean {\n if (withholdsTarget(target, withheld, paths)) return true;\n return withholdsBelow(target, index);\n}\n\n/** The target itself, or any container above it, is withheld — field-wide or for its row. */\nfunction withholdsTarget(\n target: FieldRef,\n withheld: ReadonlyMap<string, FieldRef>,\n paths: ReadonlyMap<string, string>,\n): boolean {\n if (withheld.has(fieldKey(target))) return true;\n const path = paths.get(target.fieldId);\n if (path === undefined) return false;\n for (const declared of path.split('.')) {\n if (withheld.has(fieldKey({ fieldId: declared }))) return true;\n if (\n target.rowKey !== undefined &&\n withheld.has(fieldKey({ fieldId: declared, rowKey: target.rowKey }))\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Part of the value the target binds is withheld.\n *\n * A covered target binds the value behind it, so a `record` whose member the projection drops,\n * a list whose row it shortens and a row whose member it withholds are all values the digest\n * was not computed over: exporting the signature would leave it describing data the submission\n * does not carry. A target bound to a row binds that row, so only that row's members (or a\n * field-wide withholding across every row) count.\n *\n * The three answers come from the index rather than a walk of the withheld set: a row of the\n * covered list itself, a field-wide withholding below the target, and a row-specific one below\n * it that names the target's row. Each is a set or map hit, so a signature over many targets\n * beside many withheld references is the two counts rather than their product.\n */\nfunction withholdsBelow(target: FieldRef, index: WithheldIndex): boolean {\n if (target.rowKey === undefined && index.fieldsWithRows.has(target.fieldId)) return true;\n if (index.fieldWideBelow.has(target.fieldId)) return true;\n const rows = index.rowsBelow.get(target.fieldId);\n if (rows === undefined) return false;\n return target.rowKey === undefined ? true : rows.has(rowKeyToken(target.rowKey));\n}\n\n/**\n * Refuses an export that would carry a signature while withholding a value it binds,\n * The whole projection is walked first and the refusal comes before any\n * value is returned, so the answer cannot depend on which field the walk reached first.\n */\nfunction assertSignaturesCarried(compiled: CompiledSchema, state: ProjectionState): void {\n if (state.signatures.length === 0) return;\n const paths = declarationPaths(compiled);\n const index = withheldIndex(state.withheld, paths);\n for (const signature of state.signatures) {\n for (const target of coveredTargets(signature.value)) {\n if (!withholds(target, state.withheld, paths, index)) continue;\n throw new AxiomError(\n 'SIGNATURE_COVER_EXCLUDED',\n `signature field \\`${signature.fieldId}\\` covers ${fieldKey(target)}, which the submission leaves out or carries only in part; a signature must not travel without the values it binds`,\n signature.path,\n );\n }\n }\n}\n\n/**\n * The submission projection of one evaluated snapshot: a pure function of\n * the artifact, the caller's values and the report that evaluation produced. It never mutates\n * `input` and never reads a clock; the only port it can reach is the caller's `lookup`, through\n * the evaluation it derives its snapshot from.\n */\nexport function projectSubmission(\n compiled: CompiledSchema,\n input: EvaluationInput,\n snapshot: SubmissionSnapshot,\n options: SubmissionProjectionOptions = {},\n): Readonly<Record<string, unknown>> {\n // An item-scoped writer that names no row member has nothing the projection can address;\n // refusing keeps a submission from silently dropping the write. A writer that declares\n // `targetFieldId` is projected per row below.\n for (const rule of compiled.rules ?? []) {\n if (\n (rule.kind === 'compute' || rule.kind === 'defaultCompute') &&\n rule.scope === 'item' &&\n rule.targetFieldId === undefined\n ) {\n throw new AxiomError(\n 'ENGINE_ERROR',\n `rule \\`${rule.ruleId}\\` is an item-scoped ${rule.kind} with no targetFieldId, so the submission cannot carry its value`,\n rule.ruleId,\n );\n }\n }\n const visibility = artifactVisibility(compiled);\n const statuses = ruleStatuses(snapshot.report);\n const computed = computedTargets(compiled, snapshot.report);\n const rowComputed = rowComputedTargets(compiled, snapshot.report);\n const arrays = arrayFieldIds(compiled.fields);\n const policies: Policies = {\n snapshot,\n // The record the device exports carries its own writes: a value it wrote is not the server's\n // withheld value any more, so the projection states it rather than omitting it. Both\n // `stillRedacted` and this index use `redactionKey`, so a row-scoped redaction on an array\n // collapses to the whole array declaration, matching the access window.\n redacted: new Set(\n stillRedacted(compiled.fields, input.redacted ?? [], input.sessionWrites).map((ref, index) =>\n redactionKey(arrays, toFieldRef(ref, `$.redacted[${String(index)}]`)),\n ),\n ),\n arrays,\n document: compiled.onHide ?? 'preserve',\n isHidden: (fieldId) =>\n isHiddenBy(visibility, (rule: CompiledRule) => statuses.get(rule.ruleId), fieldId),\n computed,\n rowComputed,\n writableOnly: options.writableOnly === true,\n identityFields: identityFieldsOf(compiled.fields, new Set()),\n };\n const state: ProjectionState = { withheld: new Map(), signatures: [] };\n const values: Record<string, unknown> = {};\n for (const field of compiled.fields) {\n const raw = Object.hasOwn(input.values, field.fieldId)\n ? input.values[field.fieldId]\n : undefined;\n const supplied = raw !== undefined;\n // A field no input supplies is still exported when a writer owns it or a member of it.\n if (!supplied && !computed.has(field.fieldId) && !hasComputedWithin(field, computed)) {\n continue;\n }\n const projected = projectValue(\n field,\n supplied ? raw : ABSENT_INPUT,\n undefined,\n `$.values.${field.fieldId}`,\n policies,\n state,\n );\n if (projected !== OMITTED) values[field.fieldId] = projected;\n }\n // A value the projection withholds — hidden, masked, redacted, or a `write_only` this session\n // did not write — must not be bound by a signature that travels. A value omitted only because\n // the principal may not write it is not withheld: the server holds it, so the server can verify\n // the signature against its own record.\n assertSignaturesCarried(compiled, state);\n return values;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SuggestedOperation } from '../model/types.js';
|
|
2
|
+
import type { EngineOperation, WriteOrigin } from './engine/ops.js';
|
|
3
|
+
/**
|
|
4
|
+
* One reported alternative as the engine operations a host applies, `RULES-6.1.2` and
|
|
5
|
+
* `RULES-6.1.3`.
|
|
6
|
+
*
|
|
7
|
+
* A report states two operation spellings: a rule result's alternatives and an unavailable
|
|
8
|
+
* option's alternatives on its blocker. This is the one place either is projected onto the
|
|
9
|
+
* engine's operation shape, so a host that applies what a reader accepted does not hand-roll a
|
|
10
|
+
* second mapping that could disagree with the runtime's own.
|
|
11
|
+
*
|
|
12
|
+
* The projection is pure and total: it evaluates nothing, decides no access, and copies no
|
|
13
|
+
* value's identity. The engine's write guard stays authoritative at apply, and the caller states
|
|
14
|
+
* whether the press is a `user` write or a `sync` one because the origin is the record's fact,
|
|
15
|
+
* not a default this function could guess.
|
|
16
|
+
*/
|
|
17
|
+
export declare function toEngineOperations(operations: readonly SuggestedOperation[], origin: WriteOrigin): readonly EngineOperation[];
|
|
18
|
+
//# sourceMappingURL=suggestions-to-engine.d.ts.map
|