@azx-pbc/axiom-runtime 0.0.0-stage → 0.0.5
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 +1210 -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
package/README.md
CHANGED
|
@@ -1,3 +1,715 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @azx-pbc/axiom-runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The target-neutral core of Axiom, a schema-driven expression and rule engine. It carries the
|
|
4
|
+
contracts one compiled schema is made of, exact decimal and money arithmetic, civil dates and
|
|
5
|
+
instants, restricted canonical JSON — the RFC 8785 JSON Canonicalization Scheme (JCS) narrowed to
|
|
6
|
+
integer-only, duplicate-free input — with SHA-256 hashing, and the stateless `evaluate()` that
|
|
7
|
+
turns a compiled artifact plus a record into a canonical report. It does **not** compile schemas
|
|
8
|
+
(that is `@azx-pbc/axiom-compiler`), provide React bindings, read files, or read a clock.
|
|
9
|
+
`@azx-pbc/axiom-compiler` and `@azx-pbc/axiom-react` both depend on this package, and it depends
|
|
10
|
+
on neither.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pnpm add @azx-pbc/axiom-runtime
|
|
16
|
+
# or: npm install @azx-pbc/axiom-runtime
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The manifest states Node `>=24`. The package also publishes `browser` and `react-native` export
|
|
20
|
+
conditions.
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
Compilation happens once, in a build step or on a server; the device evaluates the artifact.
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { compile } from '@azx-pbc/axiom-compiler';
|
|
28
|
+
import { evaluate } from '@azx-pbc/axiom-runtime';
|
|
29
|
+
|
|
30
|
+
const compiled = compile(
|
|
31
|
+
JSON.stringify({
|
|
32
|
+
schemaId: 'example_note',
|
|
33
|
+
schemaVersion: 1,
|
|
34
|
+
exprVersion: 1,
|
|
35
|
+
fields: [{ fieldId: 'f_note', primitive: 'string', control: 'text' }],
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
if (!compiled.ok) throw new Error(JSON.stringify(compiled.diagnostics));
|
|
39
|
+
|
|
40
|
+
const report = evaluate(compiled.schema, { values: { f_note: 'hello' } }, { tier: 'client' });
|
|
41
|
+
console.log(report.status); // 'PASS' — the rules fold
|
|
42
|
+
const readiness = evaluateReadiness(
|
|
43
|
+
compiled.schema,
|
|
44
|
+
{ values: { f_note: 'hello' } },
|
|
45
|
+
{ tier: 'client' },
|
|
46
|
+
);
|
|
47
|
+
console.log(readiness.verdict); // 'SUBMIT' — the admission answer
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`report.status` is the rules fold and is **never** readiness: a declared `minItems`, a media
|
|
51
|
+
constraint, a `rowsFrom` count, a missing `required` value or a field inside a hidden section can
|
|
52
|
+
block without failing a rule. `evaluateReadiness()` is the separate admission answer — verdict,
|
|
53
|
+
blockers, undetermined checks — and `submissionVerdict()` folds the same one. A submission envelope
|
|
54
|
+
states it beside the report: `evaluateSubmission().readiness`. Gate a submission on
|
|
55
|
+
`readiness.verdict`, not on `status`.
|
|
56
|
+
|
|
57
|
+
`report.reportHash` is `canonicalHash` of the report body without that field, and the report is
|
|
58
|
+
frozen. `canonicalizeRestricted(report)` renders the whole report as canonical JSON text, which is
|
|
59
|
+
what a peer stores or compares. That text is exact reproduction, not a rendering: a record value is
|
|
60
|
+
never HTML-escaped or spreadsheet-neutralised in it, and rewriting it would change the digest. A
|
|
61
|
+
host that paints a value escapes it for its own sink; the boundary is stated in
|
|
62
|
+
[`docs/integration/output-safety.md`](https://github.com/AZX-PBC-OSS/axiom/blob/main/docs/integration/output-safety.md). To go deeper,
|
|
63
|
+
`explain()` adds per-rule reads and lookup provenance.
|
|
64
|
+
|
|
65
|
+
A backend that evaluates a request body it did not construct — `JSON.parse(body)` is `unknown`, not an
|
|
66
|
+
`EvaluationInput` — opens the same decision through the wire boundary:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import { evaluateSubmission } from '@azx-pbc/axiom-runtime';
|
|
70
|
+
import type { AccessEntry, SubmissionAuthority, SubmissionTrust } from '@azx-pbc/axiom-runtime';
|
|
71
|
+
|
|
72
|
+
// `compiled` is the successful compile result from the quickstart above.
|
|
73
|
+
declare const authority: SubmissionAuthority;
|
|
74
|
+
declare const entries: readonly AccessEntry[];
|
|
75
|
+
// What this process trusts about the body it just parsed. A call that states nothing is refused
|
|
76
|
+
// nothing it cannot prove: a body-carried signature and a table the artifact does not declare are
|
|
77
|
+
// both refused, and the answer says `trust: 'unstated'` so the omission is visible in the log.
|
|
78
|
+
const trust: SubmissionTrust = { kind: 'access', entries };
|
|
79
|
+
const outcome = evaluateSubmission(
|
|
80
|
+
compiled.schema,
|
|
81
|
+
JSON.parse(body),
|
|
82
|
+
{ tier: 'server' },
|
|
83
|
+
authority,
|
|
84
|
+
trust,
|
|
85
|
+
);
|
|
86
|
+
const report = outcome.ok ? outcome.report : undefined; // otherwise `outcome.refusal` is `{ code, path, detail, cause? }`
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`trust` is the one statement of what a server believes about a body it did not construct:
|
|
90
|
+
`{ kind: 'access', entries }` refuses a value the principal may not write (and verifies signatures
|
|
91
|
+
when `signatures` is supplied), `{ kind: 'verified', signatures }` verifies the host's captures and
|
|
92
|
+
takes the record's access from the authority, `{ kind: 'trusted-host', reason }` states that the
|
|
93
|
+
caller already authorised the body, and `{ kind: 'unstated' }` is the default. A refusal names its
|
|
94
|
+
cause — `write`, `signature` or `dataset` — with the binding, the access and a repair, so a host can
|
|
95
|
+
log it without re-deriving why.
|
|
96
|
+
|
|
97
|
+
`evaluateSubmission()` reads the body through `toSubmissionInput` and the environment through
|
|
98
|
+
`toEvaluationEnv`. The body carries the principal's answers only: `context`, `overlay`, `access`,
|
|
99
|
+
`redacted` and `sessionWrites` in it are refused at `$.<member>`. The host passes those facts as
|
|
100
|
+
`authority: SubmissionAuthority`, which also carries the table `lookup` port and the server's
|
|
101
|
+
`heldValues` for the bindings the body may not state; its access source is `authority.overlay` or
|
|
102
|
+
`authority.access`, never both, and supplying both is refused at `authority.access`. A client must
|
|
103
|
+
not author the access answer or the server-owned context it is judged by. A malformed authority is
|
|
104
|
+
refused at `authority.<member>`; an environment `accessVersion` that disagrees with the authority's
|
|
105
|
+
overlay at `$.accessVersion`. A top-level `overrides` member is refused at `$`: the approval set is
|
|
106
|
+
`evaluateGate`'s fourth argument, never something a forwarded body can nominate for itself.
|
|
107
|
+
|
|
108
|
+
`authority.heldValues` is the server's record for the bindings the principal may not write. It is
|
|
109
|
+
validated like a body value and merged beneath the body's answers, so a rule that reads a
|
|
110
|
+
`read_only` binding reads the server's value; a body value for a binding the stated access refuses
|
|
111
|
+
is `ACCESS_DENIED` naming the binding, and a `write_only` value the session did not record is
|
|
112
|
+
`WRITE_UNRECORDED` rather than silently dropped. `exportSubmission(compiled, input, env, {
|
|
113
|
+
writableOnly: true })` is the body a client posts: exactly the values the principal may write,
|
|
114
|
+
plus a natural row-key member and a `signature_ref`.
|
|
115
|
+
|
|
116
|
+
`ok: true` from `evaluateSubmission` is the parse answer; its `readiness` field is the admission
|
|
117
|
+
answer, and only `SUBMIT` is a record to store. `report.status` is the rules fold and can be `PASS`
|
|
118
|
+
while a declared count, a media constraint or a hidden section still blocks.
|
|
119
|
+
`submissionVerdict(compiled, body, env, authority, trust, options)` is the same admission with the
|
|
120
|
+
folded `SUBMIT`/`BLOCKED`/`UNDETERMINED`/`REFUSED` answer, so a forged body that one door refuses the
|
|
121
|
+
other refuses too.
|
|
122
|
+
|
|
123
|
+
Every _body_ refusal is data, never a throw and never a partial report. An artifact the receipt
|
|
124
|
+
rejects (an unknown `exprVersion`, a missing `schemaId`, a misspelt `target`) throws `TypeError`, and
|
|
125
|
+
a client artifact evaluated at `tier: 'server'` throws `AxiomError`: those are violated invariants,
|
|
126
|
+
not faults in the caller's body. The success arm carries the parsed `input` and `env` the report was
|
|
127
|
+
decided from, so a host exports the record this report describes. Its answer is still a proposal: a
|
|
128
|
+
server re-derives what it acts on (`[ACCESS-7.1.1]`–`[ACCESS-7.1.6]`).
|
|
129
|
+
|
|
130
|
+
## Row-scoped rules
|
|
131
|
+
|
|
132
|
+
An `array` of records is a list of rows, and a row's identity is its declared natural `rowKey`.
|
|
133
|
+
A rule at `item` scope answers once per row: its `fieldId` names the array, and a writer,
|
|
134
|
+
`required` or `enabled` rule also names the direct member of the row it decides in
|
|
135
|
+
`targetFieldId`, so one row's answer never names an array position and never replaces a
|
|
136
|
+
sibling's value.
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
const compiled = compile(
|
|
140
|
+
JSON.stringify({
|
|
141
|
+
schemaId: 'example_measures',
|
|
142
|
+
schemaVersion: 1,
|
|
143
|
+
exprVersion: 1,
|
|
144
|
+
fields: [
|
|
145
|
+
{
|
|
146
|
+
fieldId: 'f_lines',
|
|
147
|
+
primitive: 'array',
|
|
148
|
+
rowKey: { mode: 'natural', fieldId: 'f_line_id' },
|
|
149
|
+
fields: [
|
|
150
|
+
{ fieldId: 'f_line_id', primitive: 'string', control: 'text' },
|
|
151
|
+
{ fieldId: 'f_qty', primitive: 'integer', control: 'integer' },
|
|
152
|
+
{ fieldId: 'f_rate', primitive: 'decimal', control: 'decimal' },
|
|
153
|
+
{ fieldId: 'f_extended', primitive: 'decimal', control: 'decimal' },
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
rules: [
|
|
158
|
+
{
|
|
159
|
+
ruleId: 'r_extended',
|
|
160
|
+
kind: 'compute',
|
|
161
|
+
scope: 'item',
|
|
162
|
+
fieldId: 'f_lines',
|
|
163
|
+
targetFieldId: 'f_extended',
|
|
164
|
+
evaluateOn: 'client',
|
|
165
|
+
expr: 'to_decimal($it.f_qty) * $it.f_rate',
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
}),
|
|
169
|
+
);
|
|
170
|
+
if (!compiled.ok) throw new Error(JSON.stringify(compiled.diagnostics));
|
|
171
|
+
|
|
172
|
+
const input = {
|
|
173
|
+
values: {
|
|
174
|
+
f_lines: [
|
|
175
|
+
{ f_line_id: 'a', f_qty: 2, f_rate: '10', f_extended: '999' },
|
|
176
|
+
{ f_line_id: 'b', f_qty: 3, f_rate: '10', f_extended: '999' },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
const report = evaluate(compiled.schema, input, {});
|
|
181
|
+
report.rules; // [{ rowKey: 'a', status: 'PASS', value: '20' }, { rowKey: 'b', status: 'PASS', value: '30' }]
|
|
182
|
+
|
|
183
|
+
// The writer is the sole authority for its target, so the stale submitted `f_extended`
|
|
184
|
+
// never travels: the export carries the decided value, and a row it could not decide is
|
|
185
|
+
// omitted rather than carried as submitted.
|
|
186
|
+
exportSubmission(compiled.schema, input).f_lines;
|
|
187
|
+
// [{ f_line_id: 'a', f_qty: 2, f_rate: '10', f_extended: '20' }, { … '30' }]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The four outcomes fold with `FAIL > UNKNOWN > DEFERRED > PASS` and zero rows are `PASS`, so the
|
|
191
|
+
rule's own outcome — what `rule_ok` reads — is the fold of its rows. A gate composes that fold with
|
|
192
|
+
`rule_ok(ruleId)`, which keeps a client-`DEFERRED` server check `DEFERRED` for the server to enforce.
|
|
193
|
+
`report.status` and `no_blocking(kind)` instead classify each row result: they answer for every
|
|
194
|
+
`UNKNOWN` and `DEFERRED`, and ignore a branch failure — a `visible`, `required` or `enabled` `FAIL`
|
|
195
|
+
states that the field is hidden, the requirement does not apply or the control is not enabled, and
|
|
196
|
+
none of those blocks a record (`RULES-1.1.5`, `RULES-1.1.9`). A branch `FAIL` beside an `UNKNOWN`
|
|
197
|
+
therefore leaves `rule_ok` at `FAIL` while the report is `UNKNOWN` and `no_blocking` is `false`.
|
|
198
|
+
A rule that reads the member it writes or constrains is refused at compile with `CYCLE_DETECTED` — a
|
|
199
|
+
`validate` is exempt, because reading the value it judges is its function — and a second writer of
|
|
200
|
+
one target, or a writer of a container beside a writer of one of its members, is
|
|
201
|
+
`DUPLICATE_WRITER`.
|
|
202
|
+
|
|
203
|
+
## Gates and screens
|
|
204
|
+
|
|
205
|
+
A schema may declare any number of gates and screens. Each reports under its own rule id, and the
|
|
206
|
+
document designates one of each at its root, so a caller that names none has an answer:
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
const compiled = compile(
|
|
210
|
+
JSON.stringify({
|
|
211
|
+
schemaId: 'example_closeout',
|
|
212
|
+
schemaVersion: 1,
|
|
213
|
+
exprVersion: 1,
|
|
214
|
+
fields: [{ fieldId: 'f_signed', primitive: 'boolean', control: 'checkbox' }],
|
|
215
|
+
messages: { 'gate.step': { en: 'Not signed yet.' }, 'gate.check': { en: 'Check failed.' } },
|
|
216
|
+
primaryGateId: 'r_step_gate',
|
|
217
|
+
rules: [
|
|
218
|
+
{
|
|
219
|
+
ruleId: 'r_step_gate',
|
|
220
|
+
kind: 'gate',
|
|
221
|
+
scope: 'record',
|
|
222
|
+
evaluateOn: 'client',
|
|
223
|
+
messageKey: 'gate.step',
|
|
224
|
+
expr: 'true',
|
|
225
|
+
gate: {
|
|
226
|
+
hard: false,
|
|
227
|
+
// The gate is not in force until the record is signed, so it reports
|
|
228
|
+
// `active: false`, judges nothing, and `rule_ok` answers PASS.
|
|
229
|
+
activeWhen: 'f_signed',
|
|
230
|
+
items: [{ itemId: 'i_signed', expr: 'f_signed', messageKey: 'gate.check' }],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
ruleId: 'r_closeout_gate',
|
|
235
|
+
kind: 'gate',
|
|
236
|
+
scope: 'record',
|
|
237
|
+
evaluateOn: 'client',
|
|
238
|
+
messageKey: 'gate.check',
|
|
239
|
+
expr: 'true',
|
|
240
|
+
gate: {
|
|
241
|
+
hard: false,
|
|
242
|
+
items: [{ itemId: 'i_step', expr: 'rule_ok("r_step_gate")', messageKey: 'gate.check' }],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
}),
|
|
247
|
+
);
|
|
248
|
+
if (!compiled.ok) throw new Error(JSON.stringify(compiled.diagnostics));
|
|
249
|
+
|
|
250
|
+
const report = evaluate(compiled.schema, { values: { f_signed: false } }, {});
|
|
251
|
+
report.primaryGateId; // 'r_step_gate'
|
|
252
|
+
report.gates?.['r_step_gate']; // { active: false } — not in force, so no item verdicts
|
|
253
|
+
report.gates?.['r_closeout_gate']; // { items: [{ itemId: 'i_step', status: 'PASS', … }] }
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
`evaluateGate(compiled, input, env, overrides)` decides the primary gate. Every override is weighed
|
|
257
|
+
against the gate its `gateId` names, so an approval of a gate that is not the primary still rewrites
|
|
258
|
+
that gate's status and is recorded under its entry; `gateInputHash(compiled, input, env, report,
|
|
259
|
+
gateId)` is the hash an approval of that gate is recorded against. Each refusal is reported beside
|
|
260
|
+
the override as `malformed`, `hard_gate`, `stale`, `unknown_gate`, `no_gate`, or `unreadable_input`.
|
|
261
|
+
|
|
262
|
+
The record cannot approve itself: `toGateOverride` declares exactly the six members and no
|
|
263
|
+
approval-state member, so a record that states one is `malformed`. `evaluateGate(compiled, input, env, overrides)` is the door that
|
|
264
|
+
weighs an approval: it refuses a record naming a hard gate, a stale hash, an unknown gate, or an
|
|
265
|
+
input it cannot read, and accepts only a record that matches the gate's `inputHash`, `ruleHash` and
|
|
266
|
+
`behaviorHash`.
|
|
267
|
+
|
|
268
|
+
`applyApprovedOverrides(report, gateRuleId, accepted, deniedFields)` is a replay for a host that has
|
|
269
|
+
already decided an approval, not the door for an untrusted record. It requires a gate entry in the
|
|
270
|
+
report and at least one accepted record whose `gateId`, `ruleHash` and `behaviorHash` match that
|
|
271
|
+
gate; otherwise it throws `AxiomError` at `$.gateRuleId` or `$.accepted` and changes nothing. It
|
|
272
|
+
cannot weigh `inputHash` (the report does not carry the record the gate was decided from) or a
|
|
273
|
+
gate's `hard` declaration (the report does not carry the artifact), so an unvetted record goes
|
|
274
|
+
through `evaluateGate`, which weighs all three hashes and the declaration and reports each refusal as
|
|
275
|
+
data.
|
|
276
|
+
|
|
277
|
+
`GateReport` is a union: an active gate carries `items`, and a gate whose `activeWhen` decided false
|
|
278
|
+
carries `active: false` and no items. `gateItemsOf(gate)` reads the items without restating that.
|
|
279
|
+
|
|
280
|
+
## Schema evolution
|
|
281
|
+
|
|
282
|
+
A record is read, verified and edited under a published version, and a version is a declaration set
|
|
283
|
+
rather than a layout. Evolution therefore moves values between `fieldId`s: a field may move between
|
|
284
|
+
record containers without an upcaster, and an upcaster never sees a path.
|
|
285
|
+
|
|
286
|
+
A host retains its published artifacts as a `SchemaCatalogue` (`ReadonlyMap<number, CompiledSchema>`)
|
|
287
|
+
and publishes its transforms as `Upcasters` (`ReadonlyMap<sourceVersion, ReadonlyMap<fieldId,
|
|
288
|
+
Upcaster>>`). A version with no map is an identity hop, so a version published for a new rule needs no
|
|
289
|
+
transform.
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
import { selectEffectiveSchema, upcastRecord, verifySignature } from '@azx-pbc/axiom-runtime';
|
|
293
|
+
|
|
294
|
+
const selection = selectEffectiveSchema(catalogue, { recordedVersion: 2, adoptInFlight: false });
|
|
295
|
+
if (selection.kind === 'selected') {
|
|
296
|
+
// `first` is always the recorded version; `second` appears only when the host adopts the
|
|
297
|
+
// newest retained version for an in-flight draft.
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
const upcast = upcastRecord({
|
|
301
|
+
values: stored,
|
|
302
|
+
from: 1,
|
|
303
|
+
to: 3,
|
|
304
|
+
catalogue,
|
|
305
|
+
upcasters,
|
|
306
|
+
// A money upcast reads the rate and as-of date the host recorded; the runtime never infers one.
|
|
307
|
+
currency: { asOf: '2026-01-15', rates: [{ from: 'AUD', to: 'USD', rate: '0.65' }] },
|
|
308
|
+
});
|
|
309
|
+
if (upcast.kind === 'upcasted') {
|
|
310
|
+
// `values` is a fresh tree at `schemaVersion`; an absent field stays absent.
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Verify the record as it was stored, before any upcaster transforms a covered value.
|
|
314
|
+
const verification = verifySignature(catalogue, { values: stored }, 'f_signature', signature);
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
`upcastRecord` is total: it returns the values and the version they satisfy, or one refusal —
|
|
318
|
+
`version_not_retained`, `no_path` (an older target), `field_unresolved` (a declaration or stored
|
|
319
|
+
member one version does not name, an unpaired row structure, or a value domain that changed without an
|
|
320
|
+
upcaster), or `value_refused` (an upcaster declined the value). Each names the `fieldId` and versions
|
|
321
|
+
where they apply; `value_refused` states the cause and never the value. What the record holds is kept
|
|
322
|
+
as it was recorded — an empty record, an empty list, the authored `null` and every row, including a
|
|
323
|
+
row the user added and never filled, keep their place — and a container the record does not hold is
|
|
324
|
+
never invented, so a version that changes no value carries the record back unchanged.
|
|
325
|
+
`selectEffectiveSchema` refuses a recorded version the catalogue does not retain with
|
|
326
|
+
`version_not_retained`.
|
|
327
|
+
|
|
328
|
+
`verifySignature(catalogue, input, signatureFieldId, signature, options?)` resolves the signature's
|
|
329
|
+
recorded version through the catalogue and recomputes the binding from the values that version's
|
|
330
|
+
declarations locate. When a covered target names an assigned row, `options.assignedRowKeys` supplies
|
|
331
|
+
the session manifest; without it that row is `unverifiable`, never matched by position. A seven-year-old signature therefore survives a layout change and an upcast that transforms a
|
|
332
|
+
covered value; an edit made after the upcast requires re-signing at the new version, and a version the
|
|
333
|
+
catalogue does not retain is `unverifiable` rather than `tampered`. An `unverifiable` diagnostic names
|
|
334
|
+
the occurrence it refused at — the unretained `schemaVersion`, the `$.signature.*` member that did not
|
|
335
|
+
parse, or the `fieldId` it could not declare or read — so a retention gap is distinguishable from a
|
|
336
|
+
corrupt blob.
|
|
337
|
+
|
|
338
|
+
### The artifact receipt
|
|
339
|
+
|
|
340
|
+
Every evaluation entry — `evaluate()`, `explain()`, `evaluateGate()`, `evaluateSubmission()`,
|
|
341
|
+
`evaluateExpr()` and `createEngine()` — first checks the artifact it was handed: that it is an
|
|
342
|
+
object, that `exprVersion` is the one this build implements (`1`), that `schemaId` is a string,
|
|
343
|
+
`schemaVersion` a safe integer, `fields` a list, and, when present, that `target` is `client` or
|
|
344
|
+
`server`. A `CompiledSchema` is closed and versioned,
|
|
345
|
+
but the type is erased at run time, so a stored artifact that went through
|
|
346
|
+
`JSON.parse(...) as CompiledSchema`, or one compiled by a later Expr version, would otherwise be
|
|
347
|
+
evaluated as v1 and report a verdict the artifact does not mean. A mismatch throws naming the
|
|
348
|
+
member, because it is a violated invariant in the host's storage rather than a fact about the
|
|
349
|
+
record. The nested declarations are not re-validated: they arrived through the compiler's closed
|
|
350
|
+
schema, or through an artifact the store pinned by digest.
|
|
351
|
+
|
|
352
|
+
## Public surface
|
|
353
|
+
|
|
354
|
+
Every door is an `exports` entry of the manifest: `.`, `./evaluate`, `./lookup`, `./cache`,
|
|
355
|
+
`./messages`, `./messages/categories`, `./docs`, `./testing`. The last is not a host API; see
|
|
356
|
+
[Measurement and parity](#measurement-and-parity-not-a-host-api).
|
|
357
|
+
|
|
358
|
+
A host that only evaluates — a React Native app on Hermes, where Metro does not tree-shake and
|
|
359
|
+
every module the root entry reaches is instantiated — takes the stateless evaluator from the
|
|
360
|
+
narrow door instead:
|
|
361
|
+
|
|
362
|
+
```ts
|
|
363
|
+
import { evaluate } from '@azx-pbc/axiom-runtime/evaluate';
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
The door is additive: every name it states is also on `.`, so a root import keeps working. It is
|
|
367
|
+
the stateless evaluator's own module graph: it reaches no module the root entry does not, and it
|
|
368
|
+
omits the root's stateful engine, schema evolution, signature verification, layout presentation
|
|
369
|
+
and form-state derivation, so a device loads less of the same package.
|
|
370
|
+
|
|
371
|
+
| Purpose | Exports | Door |
|
|
372
|
+
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
|
|
373
|
+
| Evaluation, gates and audit | `evaluate`, `evaluateSubmission`, `explain`, `evaluateExpr`, `evaluateGate`, `exportSubmission`, `artifactBehaviour`, `isArtifactBehaviourOf`, `decideGate`, `gateOutcome`, `gateStatusUnderPolicy`, `decidedGateStatus`, `gateItemCommitments`, `gateItemsOf`, `gateInputHash`, `gateInputHashOrNone`, `readGateOverrides`, `applyApprovedOverrides` | `.` |
|
|
374
|
+
| Stateless evaluation (narrow door) | `evaluate`, `explain`, `evaluateSubmission`, `evaluateGate`, `exportSubmission`, `evaluationBudget`, `artifactBehaviour`, `isArtifactBehaviourOf` | `./evaluate` |
|
|
375
|
+
| Dependency graph and access | `inspectDeps`, `ruleExpressions`, `ruleReads`, `ruleContextReads`, `gateItemReads`, `collectReadRefs`, `recordIndexFromDeclarations`, `isContextRootPath`, `ruleOkTargets`, `ruleTargets`, `createAccessResolver`, `resolveOverlay`, `accessFor`, `ruleReadFor`, `meetAccess`, `projectAccessEntries`, `createAccessWindow`, `fieldKey`, `checkWrite`, `permitsUserWrite`, `WriteRefusedError`, `firingBranch`, `isFiring`, `isRuleKind`, `RULE_KINDS`, `unreachableBranchOf`, `describeFormState`, `deriveFormState`, `evaluateForm`, `projectSubmission`, `sealReport` | `.` |
|
|
376
|
+
| Stateful sessions | `createEngine`, `SessionRefusedError`, `createCancellationPort`; types `Engine`, `EngineConfig`, `EngineOutcome`, `EngineOperation`, `EnginePatch`, `EnginePorts`, `EngineCandidate`, `CandidateOutcome`, `EngineFieldState`, `EngineFieldExplanation`, `EngineFieldDeps`, `LastPass`, `SessionRefusal`, `IdFactory`, `EvaluationObserver`, `CancellationPort`, `CancellationSignal` | `.` |
|
|
377
|
+
| Option identity and eligibility | `optionEligibility`, `ineligibleOptionValue`, `ineligibleWireValue`, `OPTION_NO_LONGER_ELIGIBLE`; types `OptionItem`, `OptionValue`, `OptionPage`, `OptionDomains` | `.` |
|
|
378
|
+
| Layout presentation | `evaluatePresentation` | `.` |
|
|
379
|
+
| Exact decimals | `asDecimalString`, `tryDecimalString`, `parseDecimal`, `canonicalDecimal`, `roundDecimal`, `compareDecimalTexts`, `sumDecimalTexts`, `negateDecimalText`, `subtractDecimalTexts`, `multiplyDecimalTexts`, `divideRoundDecimal`, `powDecimal`, `AxiomDecimal`, `DECIMAL_PRECISION`, `POW_EXPONENT_SCALE_LIMIT` | `.` |
|
|
380
|
+
| Money, logic and validation | `toMoneyValue`, `moneyMinor`, `moneyFromMinor`, `compareMoney`, `moneyAdd`, `moneySub`, `and4`, `or4`, `not4`, `andAll`, `liftOutcome`, `sumDecimals`, `isEmailAddress`, `isE164PhoneNumber`, `isHttpUrl`, `compilePattern`, `matchCompiledPattern` | `.` |
|
|
381
|
+
| Civil dates and instants | `isLeapYear`, `daysInMonth`, `daysFromCivil`, `civilFromDays`, `parsePlainDate`, `assertCivilDate`, `formatPlainDate`, `addDays`, `addMonths`, `daysBetween`, `monthsBetween`, `parseInstant`, `instantToEpochMilliseconds`, `minutesBetweenInstants` | `.` |
|
|
382
|
+
| Restricted JSON, hashing, signatures | `parseRestrictedJson`, `copyRestricted`, `canonicalizeRestricted`, `canonicalHash`, `sha256Hex`, `sha256HexOfBytes`, `compareCodePoints`, `signatureBinding`, `digestsMatch`, `verifySignature` | `.` |
|
|
383
|
+
| Schema evolution | `upcastRecord`, `selectEffectiveSchema`, `currencyRate` | `.` |
|
|
384
|
+
| Wire boundary | `wireDeclarationOf`, `memberOf`, `rowKeyValue`, `rowKeyToken`, `toWireValue`, `toFieldRef`, `toAccessEntry`, `toGateOverride`, `toLookupPort`, `toEvaluationInput`, `toSubmissionInput`, `toEvaluationEnv`, `toEvaluationRecord`, `refusalOf`, `isRecord`, `isWireValue`, `sameWireValue`, `isIntrinsicPrimitive`, `intrinsicMembers`; types `BoundaryRefusal`, `SubmissionEvaluation`, `SubmissionAuthority` | `.` |
|
|
385
|
+
| Operators, controls, patterns and budgets | `isImplementedOperator`, `applyBuiltin`, `IMPLEMENTED_OPERATORS`, `EXPR_OPERATORS`, `BUILTIN_OPERATORS`, `COMPARISON_OPERATORS`, `ARITHMETIC_OPERATORS`, `DATASET_BUILTINS`, `CONTROLS`, `TIERS`, `DEFAULT_EVALUATION_TIER`, `DEFAULT_EVIDENCE_TIER`, `isTier`, `DECIMAL_TEXT_PATTERN`, `PLAIN_DATE_PATTERN`, `INSTANT_PATTERN`, `CURRENCY_CODE_PATTERN`, `IDENTIFIER_PATTERN`, `CODE_PATTERN`, `SHA256_HEX_PATTERN`, `MIME_TYPE_PATTERN`, `evaluationBudget` | `.` |
|
|
386
|
+
| Diagnostics, sentinels, errors, locale | `DIAGNOSTICS`, `diagnosticDoc`, `RUNTIME_DIAGNOSTIC_CODES`, `COMPILE_DIAGNOSTIC_CODES`, `isRuntimeDiagnosticCode`, `UNKNOWN`, `DEFERRED`, `isUndetermined`, `isReservedContextRoot`, `RESERVED_CONTEXT_ROOTS`, `AxiomError`, `JsonIngestError`, `assertNever`, `resolveSchemaLocale`, `directionOf`, `Direction` | `.` |
|
|
387
|
+
| Types: artifact and rules | `CompiledSchema`, `CompiledField`, `CompiledRule`, `CompiledMessage`, `CompiledMessageEntry`, `CompiledExpression`, `CompiledPattern`, `LayoutNode`, `ContextRoot`, `ReservedContextRoot`, `ExpressionDeclarations`, `FieldItem`, `FieldOption`, `OptionSource`, `LiteralDomain`, `Control`, `Primitive`, `ItemPrimitive`, `ScalarPrimitive`, `Tier`, `RuleKind`, `RuleScope`, `Severity`, `RuleBehaviour`, `RuleGate`, `ComputedDependency`, `ComputedValue`, `OnHidePolicy`, `ReadRef`, `CollectedReads`, `RecordIndex`, `FieldRef`, `CoveredValue`, `UnreachableBranch` | `.` |
|
|
388
|
+
| Types: rule declarations | `ValidateRule`, `VisibleRule`, `RequiredRule`, `EnabledRule`, `ComputeRule`, `DefaultComputeRule`, `GateRule`, `GateItemDeclaration` | `.` |
|
|
389
|
+
| Types: expression tree | `ExprNode`, `ExprOperator`, `ComparisonOperator`, `ArithmeticOperator`, `CallOperator`, `BuiltinOperator`, `LiteralNode`, `PathNode`, `CompareNode`, `CallNode`, `ListNode`, `AndNode`, `OrNode`, `NotNode`, `IfNode`, `CoalesceNode`, `ComprehensionNode`, `ComprehensionBinder`, `MessageNode`, `MessageContentNode`, `MessageArgumentNode`, `MessagePluralNode`, `MessagePoundNode`, `MessageSelectNode` | `.` |
|
|
390
|
+
| Types: evaluation, access and form state | `EvaluationInput`, `EvaluationEnv`, `EvaluationReport`, `ReportFacts`, `EvaluationBudget`, `EvaluationExplanation`, `RuleResult`, `RuleExplanation`, `RuleDependency`, `Outcome`, `RuntimeValue`, `Undetermined`, `AccessEntry`, `AccessOverlay`, `AccessOverlayRule`, `AccessWindow`, `ResolvedAccess`, `FormState`, `FormStateOptions`, `FormSnapshot`, `SubmissionSnapshot`, `SubmissionProjectionOptions`, `FormFieldState`, `FormRowState`, `ArrayCardinality`, `ValueState`, `WithheldReason`, `RequiredStatus`, `RowAddressing`, `FormBlocker`, `FormGateState`, `FormScreenState`, `FormUndeterminedCheck`, `FormUndeterminedComputation`, `GateOutcome`, `SubmissionVerdict`, `FieldComputation`, `FieldMessage`, `AccessResolver`, `FieldAccess`, `FieldAccessState`, `ReportAccessEntry`, `WriteOrigin`, `WriteRefusal`, `WriteRefusalCode`, `WriteRequest`, `Diagnostic`, `DiagnosticCode`, `RuntimeDiagnosticCode`, `CompileDiagnosticCode`, `DiagnosticDoc`, `JsonIngestReason`, `ExprEvaluation` | `.` |
|
|
391
|
+
| Types: layout presentation | `LayoutNodeView`, `LayoutSectionView`, `LayoutGroupView`, `LayoutWizardView`, `LayoutStepView`, `LayoutFieldView`, `LayoutHeadingView`, `LayoutCalloutView`, `LayoutDividerView`, `LayoutSopBlockView`, `LayoutSummaryCardView`, `LayoutReadoutView` | `.` |
|
|
392
|
+
| Types: gates, screens and dependency graph | `GateDecision`, `GateEvaluation`, `GateItemResult`, `GateOverride`, `GateOverrideOutcome`, `GateOverrideRefusal`, `GatePolicy`, `GateRefusal`, `GateReport`, `GateVerdict`, `GatesReport`, `ReadOverrides`, `ScreenOutcome`, `ScreenReason`, `ScreenReasonDeclaration`, `ScreenReport`, `ScreenRule`, `ScreensReport`, `DependencyInspection`, `DependencyInspectionOptions`, `DependencyProblem`, `DependencyReport` | `.` |
|
|
393
|
+
| Types: wire values and datasets | `WireValue`, `WireRecord`, `WireDeclaration`, `ScalarWireValue`, `MoneyValue`, `TimeslotValue`, `PlainDate`, `DecimalString`, `RoundingMode`, `SignatureVerification`, `StoredSignature`, `ArtifactBehaviour`, `DatasetRef`, `DatasetDeclaration`, `DatasetColumn`, `HitPolicy`, `TableKind`, `TableBinding`, `LookupPort`, `LookupRow`, `LookupResolution`, `LookupProvenance`, `LookupMissReason`, `ResolvedTable`, `ResolvedLookupProvenance`, `StaleLookupProvenance`, `SetResolution` | `.` |
|
|
394
|
+
| Types: schema evolution | `SchemaCatalogue`, `Upcasters`, `Upcaster`, `UpcastDecision`, `UpcastContext`, `UpcastRequest`, `UpcastedRecord`, `UpcastOutcome`, `UpcastRefusal`, `VersionNotRetainedRefusal`, `NoPathRefusal`, `FieldUnresolvedRefusal`, `ValueRefusedRefusal`, `CurrencyContext`, `CurrencyRate`, `SelectEffectiveSchemaRequest`, `SchemaSelection`, `EffectiveSchema`, `SelectionRefusal` | `.` |
|
|
395
|
+
| Lookup store and resolution | `MemoryLookupStore`, `datasetInstallationProblems`, `toProvenance`, `resolveDatasetPins`; types `LookupPort`, `DigestBearingPort`, `LookupTableDocument`, `LookupResolution`, `LookupProvenance`, `ResolvedTable`, `SetResolution`, `DatasetInstallationProblem`, `DatasetDigestMismatch`, `DatasetPinMissReason`, `ResolvedDatasetPin` | `./lookup` |
|
|
396
|
+
| Offline artifact readiness and storage | `admitOfflineArtifact`, `checkReadiness`, `verifyArtifactHash`, `readSealedReport`, `MemoryOfflineStore`; types `OfflineArtifactRequest`, `OfflineAdmission`, `OfflineRefusal`, `ArtifactRequirement`, `AvailableArtifact`, `RequiredDateRange`, `ReadinessReport`, `ArtifactBytes`, `UnboundDatasetPin`, `OfflineStore`, `ArtifactPin`, `DatasetPin`, `StoredArtifact`, `StoredDataset`, `StoredDraft`, `StoredReport`, `SubmissionEnvelope`, `SubmissionStatus`, `StoredSubmission`, `ReclaimStaleRequest`, `ClaimRequest`, `SubmissionClaim`, `PublishRequest`, `PublishResult`, `PublishRefusal`, `UnpinnedDataset`, `EnqueueOutcome`, `SealedReportAdmission` | `./cache` |
|
|
397
|
+
| Message rendering and locale selection | `formatMessage`, `formatCatalogueMessage`, `cardinalCategory`; types `MessageParam`, `PluralCategory`, `LocaleCatalogue`, `SchemaLocaleMatch`, `SchemaLocaleOptions`, `SchemaLocaleRefusal`, `SchemaLocaleResolution` | `./messages` |
|
|
398
|
+
| Cardinal category lists (compiler-facing) | `cardinalCategories` | `./messages/categories` |
|
|
399
|
+
| Built-in documentation registry and examples | `WALKING_SKELETON_BUILTINS`, `parseExampleExpression`, `evaluateExample`, `containsSentinel`; types `BuiltinDoc`, `BuiltinExample`, `ExampleArithmetic`, `ExampleCall`, `ExampleCompare`, `ExampleList`, `ExampleLiteral`, `ExampleNode`, `ExampleOperator`, `ExampleSentinel` | `./docs` |
|
|
400
|
+
| Measurement and parity (not a host API) | `artifactBehaviourDerivations`, `evaluateAllNaive`, `restrictedCanonicalizations`, `sealsPerformed`, `wireValidations` | `./testing` |
|
|
401
|
+
|
|
402
|
+
The schema-evolution surface also exports `sameValueDomain`, `unpairableRows` and
|
|
403
|
+
`unresolvedUpcasters`, plus the `ValueDomainDeclaration` type, for revision classifiers that must
|
|
404
|
+
reach the upcast's own domain, row-pairing and transform-validity predicates.
|
|
405
|
+
|
|
406
|
+
## Measurement and parity (not a host API)
|
|
407
|
+
|
|
408
|
+
`@azx-pbc/axiom-runtime/testing` is this repository's own door, not a host API. It carries the
|
|
409
|
+
parity oracle (`evaluateAllNaive`) and the process-lifetime counters (`sealsPerformed`,
|
|
410
|
+
`restrictedCanonicalizations`, `wireValidations`, `artifactBehaviourDerivations`) that the benches,
|
|
411
|
+
packed-surface suites and counted budget tests read. It carries **no compatibility guarantee**: an
|
|
412
|
+
oracle's shape follows the tests that compare against it, and a counter follows the budget a
|
|
413
|
+
benchmark states.
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
import { evaluateAllNaive } from '@azx-pbc/axiom-runtime/testing';
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Nothing on this door is exported from `.` or `./evaluate`. `./evaluate` is the narrow door a Hermes
|
|
420
|
+
host takes to avoid the root graph, and a counter there would be cost on the door chosen for cost.
|
|
421
|
+
|
|
422
|
+
## Layout presentation
|
|
423
|
+
|
|
424
|
+
`evaluatePresentation(compiled, input, env?)` walks the artifact's closed ten-kind layout and
|
|
425
|
+
returns a view per node carrying the message keys a renderer resolves with `resolveSchemaLocale`
|
|
426
|
+
and `formatMessage`, the evaluated `params` and summary-card `readouts`, and the derived `visible`
|
|
427
|
+
and `empty` flags. Layout is presentation only: it never enters a report or its hash.
|
|
428
|
+
|
|
429
|
+
The view is built from its own evaluation, not the caller's, so a chrome `visibleWhen` or readout
|
|
430
|
+
read never appends to `report.access`, `report.lookups` or `report.diagnostics`. A predicate hides
|
|
431
|
+
only on a decided false — `UNKNOWN`, `DEFERRED` and an evaluation error leave the chrome visible —
|
|
432
|
+
and a stored `write_only` or a `masked` value resolves `UNKNOWN` without being read, so a readout
|
|
433
|
+
never leaks plaintext. A value hidden by a `visible` rule with `onHide: "exclude"` is withheld too.
|
|
434
|
+
`hideWhenEmpty` counts presence, not readability: a `write_only` or `masked` field
|
|
435
|
+
keeps a container non-empty, while `hidden` access or a `visible` rule that decided false collapses
|
|
436
|
+
it. The wizard cursor stays host-owned; step views carry their visibility.
|
|
437
|
+
|
|
438
|
+
## Form state
|
|
439
|
+
|
|
440
|
+
`describeFormState()` evaluates a record and describes the form it produces, and
|
|
441
|
+
`deriveFormState()` derives the same state from a snapshot `evaluateForm()` already produced. The
|
|
442
|
+
result is a pure, stateless description a backend agent loop, a headless binding or a review pass
|
|
443
|
+
reads once: `{ report, fields, gates, screens, blockers, ready, hasDeferredChecks }`.
|
|
444
|
+
|
|
445
|
+
The `report` a form state carries is the report **body** — every fact the digest is computed over,
|
|
446
|
+
frozen, without `reportHash`. Canonicalising and hashing is the cost of _proving_ a decision, not of
|
|
447
|
+
describing one, so a derivation never pays it; `sealReport(body)` states the digest when a caller needs
|
|
448
|
+
the decision (`evaluate()` already returns a sealed report, and `engine.report()` seals once per
|
|
449
|
+
committed state).
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
import { describeFormState } from '@azx-pbc/axiom-runtime';
|
|
453
|
+
|
|
454
|
+
const state = describeFormState(compiled.schema, {
|
|
455
|
+
values: { f_note: 'hello' },
|
|
456
|
+
overlay: {
|
|
457
|
+
accessVersion: 4,
|
|
458
|
+
defaultAccess: 'read_only',
|
|
459
|
+
rules: [{ kind: 'exact', match: 'f_note', access: 'read_write' }],
|
|
460
|
+
},
|
|
461
|
+
});
|
|
462
|
+
state.ready; // true when nothing visible is missing, blocked or failed
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
Each `fields[]` entry exposes the value as a `ValueState` (`value`, `absent`, or `withheld` with a
|
|
466
|
+
`masked`/`hidden`/`write_only`/`redacted` reason), plus `visible`, `enabled`, `required`,
|
|
467
|
+
`writable`, `fillable`, `systemComputed`, `missingRequired` (`missing`, `satisfied` or
|
|
468
|
+
`undetermined`), `computation`, `messages` and `invalidValue`. `fillable` follows writability, not
|
|
469
|
+
readability, so a stored `write_only` field is fillable; a computed field and a `signature_ref` are
|
|
470
|
+
not. An array also reports `rowAddressing` (`natural`, `value`, `assigned`, `unsupported`),
|
|
471
|
+
`addressableRows`, and per-row `required`/`enabled`/`missingRequired`/`messages`/`value` facts for each item
|
|
472
|
+
member.
|
|
473
|
+
|
|
474
|
+
`ready` is deliberately not `report.status`. A `validate` rule that fails on a hidden field still
|
|
475
|
+
folds into the report, while readiness asks only what a caller can fix: no visible block failure, no
|
|
476
|
+
visible missing required value, and every block-severity screen `SCREEN_PASS`. A conditional
|
|
477
|
+
`visible` rule that hides a field blocks nothing at all (`RULES-1.1.5`), so the branch the author
|
|
478
|
+
declared is not a failure to repair. A `DEFERRED` field or row is a server handoff, not a refusal:
|
|
479
|
+
`ready` may be true while `hasDeferredChecks` is true. `blockers[]` names the exact
|
|
480
|
+
`(fieldId, rowKey)`, the blocked gate items, and a blocked gate's own verdict when no item states it.
|
|
481
|
+
|
|
482
|
+
A field whose domain a host loads — `optionSource: { kind: 'host', sourceId, dependsOn? }` — has
|
|
483
|
+
no declared options for the derivation to check a selection against, so the host hands the loaded
|
|
484
|
+
domain in as a derivation input: `options.optionDomains` is a `ReadonlyMap` keyed by `fieldKey`, and
|
|
485
|
+
`invalidValue` then states the selected value the domain no longer offers, without wiping it
|
|
486
|
+
(`[MODEL-3.1.8]`, `[DATA-5.1.3]`). `ineligibleOptionValue(selected, items)` is the one comparison —
|
|
487
|
+
`sameWireValue`, so an integer code and its text spelling stay two options and a `timeslot` or money
|
|
488
|
+
amount compares by its members; `optionEligibility` is its boolean form. The engine stores no option
|
|
489
|
+
state of its own: a host that has loaded another page opens the session with the map that includes
|
|
490
|
+
it, which is what the bindings' page machine does.
|
|
491
|
+
|
|
492
|
+
The same `invalidValue` covers the domains the artifact states, with no loader involved. A declared
|
|
493
|
+
`options` domain judges the value against its codes. `optionCodeValue(field, code)` is the one
|
|
494
|
+
mapping a control and the derivation share: a boolean field's codes are the strings `true`/`false`
|
|
495
|
+
its control maps to the boolean the record holds, and a duration code becomes an amount in the
|
|
496
|
+
declared unit (`[MODEL-3.1.5]`), so the domain offers the value, never its source spelling. A `field` source judges against the delivered
|
|
497
|
+
recorded array it names — a declarer on a row reads its same-row sibling, any other declarer the
|
|
498
|
+
source field's own value — and a cleared array is an empty domain that refuses every non-empty
|
|
499
|
+
selection. A source the access answer withholds (`masked`, `write_only`, `hidden` or redacted)
|
|
500
|
+
decides nothing rather than being read from the record, so eligibility can never probe a value this
|
|
501
|
+
device may not read.
|
|
502
|
+
|
|
503
|
+
Access resolves from a host-supplied overlay: `{ accessVersion, defaultAccess, allowMaskedRead?,
|
|
504
|
+
rules[] }`, where a rule is `{ kind, match, access }` at `exact`, `template`, `container` or
|
|
505
|
+
`section` specificity. An `exact` row match spells the row key with its wire type —
|
|
506
|
+
`f_rows@number:7` for the integer and `f_rows@string:7` for the text — so a rule and a session write
|
|
507
|
+
name one row. The most specific matching level wins, two rules at one level meet on the 5×5 table
|
|
508
|
+
(`meetAccess`), and an absent overlay grants `read_only`. `allowMaskedRead` lifts `masked` and
|
|
509
|
+
`hidden` for expression reads only: a listed field's own value still resolves `withheld` for
|
|
510
|
+
delivery, and message parameters, lookup keys and presentation readouts that quote the lifted read
|
|
511
|
+
are dropped. It never lifts a stored `write_only` value. A `compute` or `defaultCompute` is the
|
|
512
|
+
exception a host must plan for: the expression may read the lifted field, the derived value is the
|
|
513
|
+
writer's own output, and it is delivered on its target where that target's access permits delivery
|
|
514
|
+
(the rule result and the derived form state carry it). Listing a secret in `allowMaskedRead` is
|
|
515
|
+
therefore a decision to let a writer derive and deliver that secret; a target that must not carry
|
|
516
|
+
it must itself resolve `masked`, `hidden` or `write_only`. The report derives `accessVersion` from
|
|
517
|
+
the overlay; a call that also supplies an `env.accessVersion`
|
|
518
|
+
disagreeing with it is refused with `ENGINE_ERROR`, as is a call that supplies both the overlay and
|
|
519
|
+
a flattened `access` projection. The projection is a first-class alternative for a host that has
|
|
520
|
+
already resolved access per reference; neither input shape is deprecated.
|
|
521
|
+
|
|
522
|
+
## Stateful sessions
|
|
523
|
+
|
|
524
|
+
`createEngine(compiled, { input, env, identity, ports })` opens one mutable session over a compiled
|
|
525
|
+
artifact: the record, the declared context, the overlay, the environment and the row identity. Every commit is
|
|
526
|
+
a four-phase pass — rebuild the computed values, recalculate the rules the change reaches,
|
|
527
|
+
revalidate the diagnosed facts, refresh the derived view — and it evaluates only the rules in the
|
|
528
|
+
change's dependency closure, so editing one field does not re-evaluate an independent subtree.
|
|
529
|
+
`report()` is the sealed report of committed state and equals, byte for byte, the report a stateless
|
|
530
|
+
`evaluate()` of the same inputs produces.
|
|
531
|
+
|
|
532
|
+
```ts
|
|
533
|
+
import { createEngine } from '@azx-pbc/axiom-runtime';
|
|
534
|
+
|
|
535
|
+
const engine = createEngine(compiled.schema, {
|
|
536
|
+
input: {
|
|
537
|
+
values: { f_note: 'hello' },
|
|
538
|
+
overlay: { accessVersion: 1, defaultAccess: 'read_write', rules: [] },
|
|
539
|
+
},
|
|
540
|
+
ports: { idFactory: () => crypto.randomUUID() },
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
engine.setValue({ fieldId: 'f_note' }, 'hello there', 'user');
|
|
544
|
+
engine.getField('f_note').value; // { kind: 'value', value: 'hello there' }
|
|
545
|
+
engine.lastPass().ruleEvaluations; // { r_note: 1 } — only the closure ran
|
|
546
|
+
engine.report().reportHash; // the same hash a stateless evaluation states
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
**Operations.** `setValue`, `setNull`, `removeValue`, `setContext`, `setEnv`, `setAccess`, `batch`,
|
|
550
|
+
`append`, `insert`, `remove`, `move` and `moveRow`. A value write carries its origin (`user`,
|
|
551
|
+
`system`, `hydrate` or `sync`) and passes the same `checkWrite` predicate a control does: a user
|
|
552
|
+
write to a `signature_ref`, to a value a writer owns, to a disabled field or to a withheld reference
|
|
553
|
+
is refused with the structured code, and nothing is assigned on the refusal path. `batch` stages
|
|
554
|
+
every operation in issue order and commits once; one refusal commits none of them. `setNull` writes
|
|
555
|
+
an explicit `null` and `removeValue` makes the field absent. `setAccess` advances `accessVersion` by
|
|
556
|
+
exactly one, evicts the subscriptions the new overlay revokes before the next emission, and drops a
|
|
557
|
+
queued write that is no longer permitted, reporting it in `lastPass().dropped`.
|
|
558
|
+
|
|
559
|
+
**Identity.** A record array declares its identity in `rowKey`: `natural` names a string or integer
|
|
560
|
+
member of the item declaration, and `assigned` takes an id only the host's `idFactory` mints. A
|
|
561
|
+
scalar or attachment array with a value domain (`options` or `optionSource`) declares **no**
|
|
562
|
+
`rowKey`; its identity is the canonical item value, which is what `rowAddressing: 'value'` reports.
|
|
563
|
+
A freeform scalar or attachment array declares `assigned`. There is no declarable `value` mode: a
|
|
564
|
+
`rowKey` whose mode is neither `natural` nor `assigned` is refused by the metaschema. Only an
|
|
565
|
+
assigned array keeps an ordered manifest, and every structural operation moves the values and the
|
|
566
|
+
manifest in one commit, so `values[i]` and `manifest.rowIds[i]` cannot disagree. A duplicate
|
|
567
|
+
natural, value or assigned key — including duplicate ids returned by the host factory — is refused
|
|
568
|
+
at open and at `hydrate`; an assigned array without a factory is refused at open; an assigned
|
|
569
|
+
payload hydrated without a manifest stays `rowAddressing: 'unsupported'` and refuses a row-addressed
|
|
570
|
+
write rather than guessing identity from position. A host resuming a record that already has an
|
|
571
|
+
identity manifest passes it as `identity` at open: the rows are reconciled against those ids by
|
|
572
|
+
the same walk `hydrate` uses, so the draft keeps its row keys and its `reportHash`, and the
|
|
573
|
+
`sessionWrites` supplied beside it still unlock their `write_only` values. `engine.rowManifest()`
|
|
574
|
+
returns a defensive copy of that host-owned bookkeeping to persist beside `engine.values()`,
|
|
575
|
+
independently of whether the current access answer delivers the rows to controls. Arrays declared
|
|
576
|
+
inside other arrays have no
|
|
577
|
+
composite `FieldRef` row key in v1, so their derived state also reports `rowAddressing: 'unsupported'`
|
|
578
|
+
and addresses no row of its own — never the enclosing array's keys — and a row-addressed operation on
|
|
579
|
+
one refuses with `IDENTITY_UNSUPPORTED` rather than writing a top-level namesake. Such an array is
|
|
580
|
+
still a member of each enclosing row, so the value it holds there is that row's cell. Arrays inside
|
|
581
|
+
record containers retain their record path. A value write that would break a row-identified array —
|
|
582
|
+
clearing a natural key member, giving two rows one key, or nulling the item value that _is_ a row's
|
|
583
|
+
identity — is refused with `ROW_KEY_DUPLICATE` or `IDENTITY_UNSUPPORTED` and assigns nothing.
|
|
584
|
+
|
|
585
|
+
**Observation.** `getField(fieldId, rowKey?)` returns the frozen derived state of one binding — the
|
|
586
|
+
same object while its facts hold — and is the session's only per-binding snapshot.
|
|
587
|
+
`getFormState()` derives the whole form, `lastPass()` states the counted facts of the last commit
|
|
588
|
+
(rule evaluations, considered record and context reads, patches, notified bindings and dropped
|
|
589
|
+
writes), `explainField()` reports the rules and provenance behind one binding, and
|
|
590
|
+
`inspectFieldDeps()` reports the closure a change to a field reaches. `sessionWrites()` returns the
|
|
591
|
+
frozen, value-free reference list a host can carry into a later session; the engine re-keys or
|
|
592
|
+
retires those refs with row identity. Reading any of them changes nothing: no write, version bump or
|
|
593
|
+
notification. A pass assembles the report body; `report()` seals it once per committed state, so a
|
|
594
|
+
host that never reads the report never pays for the digest.
|
|
595
|
+
|
|
596
|
+
**Preview.** `preview(operations)` derives the view the operations would produce without assigning
|
|
597
|
+
anything. `propose(operations)` returns that view with a `CandidateDelta` describing the blockers,
|
|
598
|
+
computations, checks, values, rows and host option domains the change set moves. The associated
|
|
599
|
+
types are `ProposedCandidate`, `CandidateDelta`, `ChangedComputation`, `PendingCheck` and
|
|
600
|
+
`StructuralWrite`. `commit(candidate)`
|
|
601
|
+
installs the derived state the candidate displayed, so an assigned append asks `idFactory` once and
|
|
602
|
+
keeps the previewed row key. A candidate whose basis is no longer committed state, or whose `session`
|
|
603
|
+
is not the engine that produced it, is refused. A candidate and the
|
|
604
|
+
operation tree it copied are frozen; an environment's `lookup` port is the one member the engine
|
|
605
|
+
borrows rather than copies, so a preview seals the environment around it and leaves the host's
|
|
606
|
+
own store as the host made it. `exportSubmission()` projects committed state through the
|
|
607
|
+
`onHide: "exclude"` policy; it accepts no caller-supplied report, so a stale or forged snapshot
|
|
608
|
+
is not expressible.
|
|
609
|
+
Exact redacted references are withheld too, and a signature whose covered value is withheld fails
|
|
610
|
+
closed rather than travelling without the value it binds.
|
|
611
|
+
|
|
612
|
+
**Ports.** `idFactory` is the only source of assigned ids and is required when the artifact declares
|
|
613
|
+
an assigned array. `observer` sees each rule evaluation, which is what makes an evaluation count a
|
|
614
|
+
caller's fact; `onListenerError` reports a listener that threw while being notified — the commit is
|
|
615
|
+
not rolled back.
|
|
616
|
+
|
|
617
|
+
**Refusals.** A session refusal is a tagged outcome carrying the code and the field or row it names:
|
|
618
|
+
`ACCESS_DENIED`, `DISABLED`, `ROW_UNADDRESSABLE`, `INVALID_VALUE`, `ROW_KEY_DUPLICATE`,
|
|
619
|
+
`ROW_KEY_NOT_FOUND`, `IDENTITY_UNSUPPORTED`, `ID_FACTORY_REQUIRED`, `ROW_INDEX_OUT_OF_RANGE`,
|
|
620
|
+
`UNKNOWN_CONTEXT_ROOT` and `STALE_BASIS`. An identity the artifact cannot support at open raises
|
|
621
|
+
`SessionRefusedError` carrying the same structured refusal, so no report is ever produced for it.
|
|
622
|
+
|
|
623
|
+
**Parity.** `evaluateAllNaive()` on `@azx-pbc/axiom-runtime/testing` is a deliberately separate
|
|
624
|
+
assembler: it evaluates every rule once in declaration order with a fresh reader and reuses no
|
|
625
|
+
contribution. It shares the rule executor and the reader, so comparing reports proves the session's
|
|
626
|
+
cache and closure are complete — not that the stateless semantics are independently correct. The
|
|
627
|
+
independent oracle for the language is the Python corpus. Its fourth argument is the manifest
|
|
628
|
+
supplier a session comparison uses, so an item rule over an assigned array names the same rows in
|
|
629
|
+
both assemblies.
|
|
630
|
+
|
|
631
|
+
**Listener failures.** `onListenerError` receives every listener that threw; without it the other
|
|
632
|
+
listeners are still delivered to and the first failure is thrown after them. Neither rolls back the
|
|
633
|
+
commit, and an emission that failed abandons the writes it had queued rather than letting a later
|
|
634
|
+
call adopt them.
|
|
635
|
+
|
|
636
|
+
### Access is not authorisation
|
|
637
|
+
|
|
638
|
+
The overlay decides what this device _presents_ and what it lets the user _appear_ to change. It is
|
|
639
|
+
not a security boundary, because a principal can read everything the device holds and submit
|
|
640
|
+
anything it chooses. Two obligations belong to the host API, and no engine answer substitutes for
|
|
641
|
+
them: **redact or omit on read**, before the record reaches the device, and **validate and authorise
|
|
642
|
+
on write**, rejecting a submission the server does not accept. The engine's handling of `hidden`,
|
|
643
|
+
`masked`, stored `write_only` and server-`redacted` values is consistency plus non-amplification: it
|
|
644
|
+
never spells a field's own value where the resolved access withholds it, and it drops a payload that
|
|
645
|
+
would quote such a read. The one value derived from a withheld read that it does emit is a writer's
|
|
646
|
+
own output: a `compute` or `defaultCompute` that reads a field `allowMaskedRead` lifted is delivered
|
|
647
|
+
on its target where that target is deliverable. The engine cannot detect a host that sent too much. A `report`, its
|
|
648
|
+
`reportHash`, its `accessVersion`, its gate verdict and its
|
|
649
|
+
projection are a client's answer, not evidence: an enforcing server re-derives all of them from its
|
|
650
|
+
own overlay, environment, record date and tier (`[ACCESS-7.1.1]`–`[ACCESS-7.1.6]`).
|
|
651
|
+
|
|
652
|
+
## Errors and limits
|
|
653
|
+
|
|
654
|
+
A rule that fails, cannot be decided, or raises a typed refusal is reported, not thrown: the
|
|
655
|
+
report's `diagnostics` carry `{ code, severity, messageKey, params, fieldId, rowKey, ruleId }`.
|
|
656
|
+
`evaluate()` throws only when an invariant is violated (a program error, not a record). Boundary
|
|
657
|
+
helpers (`toWireValue`, `parsePlainDate`, `parseRestrictedJson`) throw typed errors carrying `code`
|
|
658
|
+
and `path`: `AxiomError`, and `JsonIngestError` with `offset`, `path` and a `reason` such as
|
|
659
|
+
`duplicate_member`.
|
|
660
|
+
|
|
661
|
+
Main runtime codes: `UNDETERMINED`, `ENGINE_ERROR`, `STALE_DATA`, `ACCESS_DENIED`,
|
|
662
|
+
`DEFERRED_SERVER_CHECK`, `REQUIRED_UNKNOWN`, `SIGNATURE_COVER_EXCLUDED`, and
|
|
663
|
+
`COST_BUDGET_EXCEEDED` (whose `params` name the limit and the budget dimension).
|
|
664
|
+
|
|
665
|
+
A write is refused by one predicate, `checkWrite`, which returns a `WriteRefusal`; the React store
|
|
666
|
+
throws `WriteRefusedError` carrying it. The four codes say why: `ACCESS_DENIED` (the access
|
|
667
|
+
projection does not permit a user write, or the target is a `signature_ref`); `DISABLED` (an
|
|
668
|
+
`enabled` rule does not pass); `ROW_UNADDRESSABLE` (an array item without a row key); and
|
|
669
|
+
`INVALID_VALUE` (a value outside its declaration, or a `hydrate`/`sync` write that would change one
|
|
670
|
+
it may only confirm).
|
|
671
|
+
|
|
672
|
+
Limits taken from the shipped source:
|
|
673
|
+
|
|
674
|
+
- **Decimals** — 34 significant digits (`DECIMAL_PRECISION`); canonical text has no exponent form,
|
|
675
|
+
so a value whose magnitude needs an exponent beyond 4096 is refused; `pow` accepts a non-integer
|
|
676
|
+
exponent with at most 6 fraction digits.
|
|
677
|
+
- **Dates and instants** — four-digit years only, `0000-01-01` through `9999-12-31`; instants
|
|
678
|
+
carry exactly three fractional digits and a `Z` offset.
|
|
679
|
+
- **Evaluation cost** — one million nodes per rule, growing by 128 nodes per declared row; a
|
|
680
|
+
whole pass is capped at 128,000,000 nodes; a comprehension may iterate up to 1,000,000
|
|
681
|
+
elements (10,000 with no backing declaration).
|
|
682
|
+
- **Lookup tables** — a `COLLECT` table declares a `collectLimit` between 1 and 1000.
|
|
683
|
+
- **Restricted JSON** — at most 128 levels of container nesting; integers only, within
|
|
684
|
+
`±(2^53 - 1)`; duplicate member names, `-0`, cycles, an accessor, an own symbol key and a
|
|
685
|
+
callable `toJSON` are refused by `copyRestricted` and `canonicalizeRestricted` rather than
|
|
686
|
+
repaired, because each would make the canonical bytes depend on code or on a member the
|
|
687
|
+
text drops. A data member merely _named_ `toJSON` is an ordinary string key and hashes as one
|
|
688
|
+
(`CANON-1.1.2`).
|
|
689
|
+
- **Messages** — cardinal plural rules for 225 locales from a vendored Common Locale Data
|
|
690
|
+
Repository (CLDR) registry; a branch a locale can never select is refused at compile time.
|
|
691
|
+
|
|
692
|
+
## Environment
|
|
693
|
+
|
|
694
|
+
Runs in Node, browsers and React Native's Hermes engine. The package deliberately does not use
|
|
695
|
+
`Intl` (plural selection reads the vendored CLDR registry, not the host's data), `Date`,
|
|
696
|
+
`Math.random`, `eval`, the Document Object Model (DOM), or any Node built-in. Locale and plural
|
|
697
|
+
selection are pure, so two hosts on different releases of International Components for Unicode
|
|
698
|
+
(ICU) render the same text. Lint enforces those bans on this package's source.
|
|
699
|
+
|
|
700
|
+
An evaluation that states no `env.tier` runs as `client` (`DEFAULT_EVALUATION_TIER`): a local
|
|
701
|
+
evaluation holds no server authority, so a server-tier rule reports `DEFERRED` rather than running
|
|
702
|
+
on a host that never claimed it. A backend that means to decide those rules states `tier: 'server'`
|
|
703
|
+
explicitly and evaluates the server artifact: the artifact states its target, and a client
|
|
704
|
+
artifact — whose server-tier rules are the compiler's deferred stubs — throws `AxiomError` at the
|
|
705
|
+
server tier rather than being credited with verdicts its stubs never decided. The evidence doors — compile, the
|
|
706
|
+
vector and scenario readers, the suite runner and
|
|
707
|
+
publish readiness — default the other way (`DEFAULT_EVIDENCE_TIER`, `server`): compile picks the
|
|
708
|
+
artifact's target, and the readers, runner and verifier execute the evidence it declares.
|
|
709
|
+
|
|
710
|
+
## Links
|
|
711
|
+
|
|
712
|
+
- [Root README](https://github.com/AZX-PBC-OSS/axiom/blob/main/README.md)
|
|
713
|
+
- [Model semantics](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/model-v1.md), [expression semantics](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/expr-v1.md), [rules](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/rules-v1.md), [canonical form](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/canonical-v1.md), [session engine](https://github.com/AZX-PBC-OSS/axiom/blob/main/spec/semantics/engine-v1.md)
|
|
714
|
+
- [Web example](https://github.com/AZX-PBC-OSS/axiom/tree/main/examples/web) and [Node example](https://github.com/AZX-PBC-OSS/axiom/tree/main/examples/engine-node)
|
|
715
|
+
- [Expression guide](https://github.com/AZX-PBC-OSS/axiom/blob/main/docs/expr/guide.md) and [diagnostics catalogue](https://github.com/AZX-PBC-OSS/axiom/blob/main/docs/expr/diagnostics.md)
|