@astrale-os/kernel-core 0.9.0-beta.9 → 1.0.0-beta.2
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/dist/auth/authority/accept.js +4 -0
- package/dist/auth/authority/admission/admission.d.ts +4 -1
- package/dist/auth/authority/admission/admission.js +46 -147
- package/dist/auth/authority/admission/index.d.ts +1 -1
- package/dist/auth/authority/admission/index.js +1 -1
- package/dist/auth/authority/admission/references.d.ts +13 -0
- package/dist/auth/authority/admission/references.js +38 -0
- package/dist/auth/authority/admission/term.d.ts +6 -0
- package/dist/auth/authority/admission/term.js +60 -0
- package/dist/auth/authority/admission/wire.d.ts +8 -0
- package/dist/auth/authority/admission/wire.js +33 -0
- package/dist/auth/authority/canonical.d.ts +2 -0
- package/dist/auth/authority/canonical.js +15 -0
- package/dist/auth/authority/index.d.ts +9 -2
- package/dist/auth/authority/index.js +6 -1
- package/dist/auth/authority/language/index.d.ts +3 -1
- package/dist/auth/authority/language/index.js +1 -0
- package/dist/auth/authority/language/predicate.d.ts +31 -16
- package/dist/auth/authority/language/predicate.js +1 -1
- package/dist/auth/authority/language/program.d.ts +21 -0
- package/dist/auth/authority/language/program.js +2 -0
- package/dist/auth/authority/normalization/index.d.ts +1 -1
- package/dist/auth/authority/normalization/index.js +1 -1
- package/dist/auth/authority/normalization/normalize.d.ts +2 -0
- package/dist/auth/authority/normalization/normalize.js +38 -16
- package/dist/auth/authority/ownership.optimization.d.ts +8 -0
- package/dist/auth/authority/ownership.optimization.js +83 -0
- package/dist/auth/authority/prepare-binder-body.d.ts +4 -0
- package/dist/auth/authority/prepare-binder-body.js +31 -0
- package/dist/auth/authority/program.d.ts +28 -0
- package/dist/auth/authority/program.js +191 -0
- package/dist/auth/authority/semantics/class-authority.d.ts +8 -0
- package/dist/auth/authority/semantics/class-authority.js +26 -0
- package/dist/auth/authority/semantics/composition.d.ts +39 -0
- package/dist/auth/authority/semantics/composition.js +112 -0
- package/dist/auth/authority/semantics/failure.d.ts +21 -0
- package/dist/auth/authority/semantics/failure.js +10 -0
- package/dist/auth/authority/semantics/index.d.ts +11 -0
- package/dist/auth/authority/semantics/index.js +5 -0
- package/dist/auth/authority/semantics/interpret.d.ts +41 -0
- package/dist/auth/authority/semantics/interpret.js +388 -0
- package/dist/auth/authority/semantics/snapshot.d.ts +40 -0
- package/dist/auth/authority/semantics/terms.d.ts +20 -0
- package/dist/auth/authority/semantics/terms.js +96 -0
- package/dist/auth/authority/semantics/vocabulary.d.ts +19 -0
- package/dist/auth/context/context.d.ts +4 -3
- package/dist/auth/expression/authoring/builder.d.ts +2 -11
- package/dist/auth/expression/authoring/builder.js +1 -45
- package/dist/auth/expression/authoring/index.d.ts +1 -1
- package/dist/auth/expression/authoring/index.js +1 -1
- package/dist/auth/expression/index.d.ts +1 -2
- package/dist/auth/expression/index.js +1 -2
- package/dist/auth/expression/language/identity-expression.d.ts +2 -22
- package/dist/auth/grant/index.d.ts +1 -1
- package/dist/auth/grant/index.js +1 -1
- package/dist/auth/grant/resolved/admission.d.ts +4 -3
- package/dist/auth/grant/resolved/admission.js +23 -13
- package/dist/auth/grant/resolved/grant.d.ts +1 -1
- package/dist/auth/grant/resolved/index.d.ts +1 -1
- package/dist/auth/grant/resolved/index.js +1 -1
- package/dist/auth/grant/unresolved/admission.d.ts +4 -1
- package/dist/auth/grant/unresolved/admission.js +27 -67
- package/dist/auth/grant/unresolved/limits.d.ts +2 -4
- package/dist/auth/grant/unresolved/limits.js +1 -5
- package/dist/auth/identity/admission.js +11 -3
- package/dist/auth/identity/identity.d.ts +15 -3
- package/dist/auth/identity/index.d.ts +1 -1
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/index.js +1 -1
- package/dist/auth/jwk/index.d.ts +1 -1
- package/dist/auth/jwk/index.js +1 -1
- package/dist/auth/jwk/thumbprint.d.ts +2 -0
- package/dist/auth/jwk/thumbprint.js +12 -6
- package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
- package/dist/auth/register/fingerprint/fingerprint.js +31 -0
- package/dist/auth/register/fingerprint/index.d.ts +2 -0
- package/dist/auth/register/index.d.ts +5 -0
- package/dist/auth/register/request/admission.d.ts +3 -0
- package/dist/auth/register/request/admission.js +103 -0
- package/dist/auth/register/request/index.d.ts +3 -0
- package/dist/auth/register/request/limits.d.ts +6 -0
- package/dist/auth/register/request/limits.js +6 -0
- package/dist/auth/register/request/request.d.ts +19 -0
- package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
- package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
- package/dist/auth/register/result/index.d.ts +1 -0
- package/dist/auth/register/result/result.d.ts +10 -0
- package/dist/auth/register/result/result.js +1 -0
- package/dist/callable/contract/body.d.ts +10 -0
- package/dist/callable/contract/body.js +7 -0
- package/dist/callable/contract/index.d.ts +2 -1
- package/dist/callable/contract/index.js +1 -1
- package/dist/callable/contract/output.d.ts +18 -2
- package/dist/callable/index.d.ts +3 -2
- package/dist/callable/index.js +2 -1
- package/dist/callable/invocation/call.d.ts +16 -2
- package/dist/callable/invocation/call.js +41 -1
- package/dist/callable/invocation/index.d.ts +1 -1
- package/dist/callable/invocation/index.js +1 -1
- package/dist/callable/invocation/result.d.ts +2 -2
- package/dist/dns-label.d.ts +1 -2
- package/dist/dns-label.js +2 -3
- package/dist/graph/graph/graph.d.ts +1 -5
- package/dist/graph/graph/graph.js +3 -27
- package/dist/graph/graph/index.d.ts +2 -4
- package/dist/graph/graph/index.js +2 -3
- package/dist/graph/graph/model/codec.js +4 -4
- package/dist/graph/graph/model/index.d.ts +1 -1
- package/dist/graph/graph/model/index.js +1 -1
- package/dist/graph/graph/model/model.d.ts +7 -7
- package/dist/graph/graph/model/model.js +6 -6
- package/dist/graph/graph/model/wire.d.ts +58 -78
- package/dist/graph/graph/model/wire.js +18 -19
- package/dist/graph/mutate/authoring/builder.d.ts +2 -2
- package/dist/graph/mutate/authoring/builder.js +2 -2
- package/dist/graph/mutate/authoring/create.js +13 -5
- package/dist/graph/mutate/index.d.ts +1 -1
- package/dist/graph/mutate/language/codec.js +3 -3
- package/dist/graph/mutate/language/model.d.ts +4 -4
- package/dist/graph/mutate/language/wire.d.ts +226 -215
- package/dist/graph/mutate/language/wire.js +42 -47
- package/dist/graph/mutate/result/index.d.ts +4 -3
- package/dist/graph/mutate/result/index.js +8 -6
- package/dist/graph/mutate/result/wire.d.ts +4 -4
- package/dist/graph/mutate/result/wire.js +7 -4
- package/dist/graph/node/identity/id.d.ts +0 -4
- package/dist/graph/node/identity/id.js +0 -5
- package/dist/graph/node/identity/order.js +20 -0
- package/dist/graph/path/authoring/path.d.ts +8 -5
- package/dist/graph/path/authoring/path.js +21 -3
- package/dist/graph/path/language/model.d.ts +8 -3
- package/dist/graph/path/language/syntax.js +23 -8
- package/dist/graph/query/authoring/builder.js +37 -5
- package/dist/graph/query/authoring/model.d.ts +20 -1
- package/dist/graph/query/index.d.ts +4 -2
- package/dist/graph/query/index.js +1 -0
- package/dist/graph/query/language/codec.js +18 -3
- package/dist/graph/query/language/fingerprint.js +8 -0
- package/dist/graph/query/language/model.d.ts +22 -4
- package/dist/graph/query/language/wire.d.ts +124 -114
- package/dist/graph/query/language/wire.js +54 -47
- package/dist/graph/query/order/index.d.ts +53 -0
- package/dist/graph/query/order/index.js +79 -0
- package/dist/graph/query/reference/evaluate.d.ts +1 -0
- package/dist/graph/query/reference/evaluate.js +39 -52
- package/dist/graph/query/result/index.js +1 -1
- package/dist/graph/query/result/wire.d.ts +93 -94
- package/dist/graph/query/result/wire.js +20 -20
- package/dist/graph/reconcile/condition/model.d.ts +2 -2
- package/dist/graph/reconcile/condition/references.d.ts +0 -1
- package/dist/graph/reconcile/condition/references.js +4 -4
- package/dist/graph/reconcile/correspondence.d.ts +9 -8
- package/dist/graph/reconcile/evidence.d.ts +2 -2
- package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
- package/dist/graph/reconcile/observation.d.ts +4 -3
- package/dist/graph/reconcile/planning/canonical.d.ts +6 -0
- package/dist/graph/reconcile/planning/canonical.js +28 -0
- package/dist/graph/reconcile/planning/context.d.ts +3 -3
- package/dist/graph/reconcile/planning/model.d.ts +8 -4
- package/dist/graph/reconcile/planning/plan.js +2 -1
- package/dist/schema/authority/authority-relation.js +3 -0
- package/dist/schema/authority/claims.d.ts +24 -25
- package/dist/schema/authority/claims.js +8 -8
- package/dist/schema/authority/governed-by.d.ts +16 -91
- package/dist/schema/authority/governed-by.js +1 -1
- package/dist/schema/authority/operation-node.d.ts +27 -13
- package/dist/schema/authority/operations.d.ts +8 -168
- package/dist/schema/authority/policy.d.ts +27 -15
- package/dist/schema/authority/vocabulary.d.ts +3 -0
- package/dist/schema/authority/vocabulary.js +25 -0
- package/dist/schema/callables/entrypoint.d.ts +32 -0
- package/dist/schema/callables/entrypoint.js +12 -0
- package/dist/schema/callables/execution.d.ts +269 -0
- package/dist/schema/callables/execution.js +32 -0
- package/dist/schema/callables/function.d.ts +3400 -55
- package/dist/schema/callables/function.js +4 -3
- package/dist/schema/callables/index.d.ts +2 -1
- package/dist/schema/callables/index.js +2 -1
- package/dist/schema/callables/method-of.d.ts +18 -143
- package/dist/schema/callables/method-of.js +2 -2
- package/dist/schema/callables/view.d.ts +83 -51
- package/dist/schema/definitions/class.d.ts +45 -33
- package/dist/schema/definitions/extends.d.ts +16 -110
- package/dist/schema/definitions/instance-of.d.ts +17 -69
- package/dist/schema/domain/domain.d.ts +3343 -148
- package/dist/schema/domain/domain.js +6 -3
- package/dist/schema/domain/of-domain.d.ts +18 -192
- package/dist/schema/domain/of-domain.js +1 -1
- package/dist/schema/identity/composition.d.ts +5 -0
- package/dist/schema/identity/composition.js +5 -0
- package/dist/schema/identity/identity.d.ts +225 -122
- package/dist/schema/identity/identity.js +3 -4
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/installation/operation-id.d.ts +1 -2
- package/dist/schema/installation/operation-id.js +2 -4
- package/dist/schema/introspection/index.d.ts +1 -1
- package/dist/schema/introspection/language.d.ts +12 -28
- package/dist/schema/kernel/projection/callables.js +2 -3
- package/dist/schema/kernel/projection/core.d.ts +7 -0
- package/dist/schema/kernel/projection/core.js +51 -0
- package/dist/schema/kernel/projection/definitions.d.ts +13 -0
- package/dist/schema/kernel/projection/definitions.js +71 -0
- package/dist/schema/kernel/projection/index.d.ts +3 -3
- package/dist/schema/kernel/projection/index.js +2 -2
- package/dist/schema/kernel/projection/methods.d.ts +5 -0
- package/dist/schema/kernel/projection/methods.js +41 -0
- package/dist/schema/kernel/projection/part.d.ts +34 -0
- package/dist/schema/kernel/projection/part.js +42 -0
- package/dist/schema/kernel/projection/paths.d.ts +6 -0
- package/dist/schema/kernel/projection/{keys.js → paths.js} +12 -14
- package/dist/schema/kernel/projection/project.d.ts +4 -2
- package/dist/schema/kernel/projection/project.js +33 -258
- package/dist/schema/kernel/projection/properties.d.ts +11 -0
- package/dist/schema/kernel/projection/properties.js +36 -0
- package/dist/schema/kernel/projection/relations.d.ts +7 -0
- package/dist/schema/kernel/projection/relations.js +61 -0
- package/dist/schema/kernel/projection/types.d.ts +28 -2
- package/dist/schema/kernel/schema.d.ts +8737 -5086
- package/dist/schema/kernel/schema.js +12 -8
- package/dist/schema/kernel/syscalls/contracts/admit.d.ts +15 -12
- package/dist/schema/kernel/syscalls/contracts/admit.js +16 -9
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +31 -0
- package/dist/schema/kernel/syscalls/contracts/blob.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/can.d.ts +19 -8
- package/dist/schema/kernel/syscalls/contracts/can.js +12 -4
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
- package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
- package/dist/schema/kernel/syscalls/contracts/execution.d.ts +60 -0
- package/dist/schema/kernel/syscalls/contracts/execution.js +46 -0
- package/dist/schema/kernel/syscalls/contracts/expected.d.ts +5 -0
- package/dist/schema/kernel/syscalls/contracts/expected.js +9 -0
- package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
- package/dist/schema/kernel/syscalls/contracts/identity.js +6 -7
- package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +6 -0
- package/dist/schema/kernel/syscalls/contracts/impersonate.js +4 -0
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +6 -3
- package/dist/schema/kernel/syscalls/contracts/index.js +6 -3
- package/dist/schema/kernel/syscalls/contracts/install.d.ts +149 -217
- package/dist/schema/kernel/syscalls/contracts/install.js +22 -26
- package/dist/schema/kernel/syscalls/contracts/installation.d.ts +65 -351
- package/dist/schema/kernel/syscalls/contracts/installation.js +29 -67
- package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +11 -15
- package/dist/schema/kernel/syscalls/contracts/introspect.js +8 -15
- package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
- package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
- package/dist/schema/kernel/syscalls/contracts/mint.d.ts +5 -7
- package/dist/schema/kernel/syscalls/contracts/mint.js +4 -5
- package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +243 -224
- package/dist/schema/kernel/syscalls/contracts/mutate.js +7 -1
- package/dist/schema/kernel/syscalls/contracts/query.d.ts +232 -222
- package/dist/schema/kernel/syscalls/contracts/query.js +10 -15
- package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
- package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +54 -148
- package/dist/schema/kernel/syscalls/contracts/uninstall.js +6 -5
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.d.ts +17 -0
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.js +40 -0
- package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +27 -28
- package/dist/schema/kernel/syscalls/contracts/view-resolve.js +16 -24
- package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
- package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
- package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
- package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/admit.d.ts +18 -18
- package/dist/schema/kernel/syscalls/declarations/admit.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/can.d.ts +19 -14
- package/dist/schema/kernel/syscalls/declarations/can.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +9 -12
- package/dist/schema/kernel/syscalls/declarations/delegate.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +12 -0
- package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/execution.d.ts +105 -0
- package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +9 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.js +12 -0
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +870 -1323
- package/dist/schema/kernel/syscalls/declarations/index.js +18 -2
- package/dist/schema/kernel/syscalls/declarations/install.d.ts +29 -172
- package/dist/schema/kernel/syscalls/declarations/install.js +7 -5
- package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +8 -19
- package/dist/schema/kernel/syscalls/declarations/introspect.js +3 -4
- package/dist/schema/kernel/syscalls/declarations/journal.d.ts +29 -31
- package/dist/schema/kernel/syscalls/declarations/journal.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/mint.d.ts +8 -13
- package/dist/schema/kernel/syscalls/declarations/mint.js +5 -5
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +239 -256
- package/dist/schema/kernel/syscalls/declarations/mutate.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/query.d.ts +235 -260
- package/dist/schema/kernel/syscalls/declarations/query.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
- package/dist/schema/kernel/syscalls/declarations/register.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +49 -153
- package/dist/schema/kernel/syscalls/declarations/uninstall.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
- package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
- package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +30 -37
- package/dist/schema/kernel/syscalls/declarations/view-resolve.js +5 -3
- package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +22 -26
- package/dist/schema/kernel/syscalls/declarations/whoami.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/whois.d.ts +25 -29
- package/dist/schema/kernel/syscalls/declarations/whois.js +5 -3
- package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +153 -0
- package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
- package/dist/schema/kernel/syscalls/descriptors/function.d.ts +8 -2
- package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +3 -1
- package/dist/schema/kernel/syscalls/descriptors/functions.js +3 -1
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +47 -13
- package/dist/schema/kernel/syscalls/descriptors/identity.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +5 -2
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +8 -38
- package/dist/schema/kernel/syscalls/descriptors/view.d.ts +11 -9
- package/dist/schema/kernel/syscalls/index.d.ts +2 -2
- package/dist/schema/kernel/syscalls/index.js +2 -2
- package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
- package/dist/schema/kernel/syscalls/references/execution.js +13 -0
- package/dist/schema/kernel/syscalls/references/functions.d.ts +12 -2
- package/dist/schema/kernel/syscalls/references/functions.js +3 -1
- package/dist/schema/kernel/syscalls/references/identity.d.ts +9 -0
- package/dist/schema/kernel/syscalls/references/identity.js +1 -0
- package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/references/index.js +2 -1
- package/dist/schema/meta/created-by.d.ts +32 -0
- package/dist/schema/meta/created-by.js +17 -0
- package/dist/schema/meta/descriptable.d.ts +13 -11
- package/dist/schema/meta/edge.d.ts +5 -9
- package/dist/schema/meta/iconable.d.ts +13 -11
- package/dist/schema/meta/index.d.ts +1 -0
- package/dist/schema/meta/index.js +1 -0
- package/dist/schema/meta/named.d.ts +13 -9
- package/dist/schema/meta/node.d.ts +9 -1
- package/dist/schema/meta/remotable.d.ts +15 -22
- package/dist/schema/meta/statused.d.ts +13 -7
- package/dist/schema/meta/timestamped.d.ts +14 -12
- package/package.json +9 -7
- package/dist/auth/expression/normalization/canonicalize.d.ts +0 -7
- package/dist/auth/expression/normalization/canonicalize.js +0 -102
- package/dist/auth/expression/normalization/index.d.ts +0 -2
- package/dist/auth/expression/normalization/index.js +0 -2
- package/dist/auth/expression/normalization/raise-denials.d.ts +0 -3
- package/dist/auth/expression/normalization/raise-denials.js +0 -59
- package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
- package/dist/auth/provision/fingerprint/fingerprint.js +0 -33
- package/dist/auth/provision/fingerprint/index.d.ts +0 -2
- package/dist/auth/provision/index.d.ts +0 -5
- package/dist/auth/provision/request/admission.d.ts +0 -3
- package/dist/auth/provision/request/admission.js +0 -125
- package/dist/auth/provision/request/index.d.ts +0 -3
- package/dist/auth/provision/request/request.d.ts +0 -29
- package/dist/auth/provision/result/index.d.ts +0 -1
- package/dist/auth/provision/result/result.d.ts +0 -12
- package/dist/graph/graph/navigation/error.d.ts +0 -12
- package/dist/graph/graph/navigation/error.js +0 -20
- package/dist/graph/graph/navigation/index.d.ts +0 -2
- package/dist/graph/graph/navigation/index.js +0 -1
- package/dist/graph/graph/navigation/model.d.ts +0 -15
- package/dist/schema/callables/view-for.d.ts +0 -296
- package/dist/schema/callables/view-for.js +0 -12
- package/dist/schema/kernel/projection/keys.d.ts +0 -3
- package/dist/schema/kernel/projection/path.d.ts +0 -2
- package/dist/schema/kernel/projection/path.js +0 -140
- package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -292
- package/dist/schema/kernel/syscalls/contracts/provision.js +0 -19
- package/dist/schema/kernel/syscalls/declarations/define.d.ts +0 -5
- package/dist/schema/kernel/syscalls/declarations/define.js +0 -7
- package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -296
- package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
- /package/dist/auth/{provision/request/request.js → authority/semantics/snapshot.js} +0 -0
- /package/dist/auth/{provision/result/index.js → authority/semantics/vocabulary.js} +0 -0
- /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
- /package/dist/auth/{provision → register}/index.js +0 -0
- /package/dist/auth/{provision → register}/request/index.js +0 -0
- /package/dist/auth/{provision/result/result.js → register/request/request.js} +0 -0
- /package/dist/{graph/graph/navigation/model.js → auth/register/result/index.js} +0 -0
|
@@ -6,6 +6,7 @@ import { GraphData } from '../../graph/index.js';
|
|
|
6
6
|
import { NodeId as admitNodeId } from '../../node/index.js';
|
|
7
7
|
import { compareNodeIds } from '../../node/index.js';
|
|
8
8
|
import { encodeQueryAST, QueryASTDecodeError } from '../language/index.js';
|
|
9
|
+
import { compareQueryRank, queryRangeContains } from '../order/index.js';
|
|
9
10
|
import { decodeQueryResult } from '../result/index.js';
|
|
10
11
|
import { QueryReferenceError } from './error.js';
|
|
11
12
|
/** Independent backend-neutral executable Query V6 row algebra. */
|
|
@@ -141,8 +142,10 @@ function evaluate(ast, context, options) {
|
|
|
141
142
|
if (!Object.hasOwn(value.value.props, predicate.property)) {
|
|
142
143
|
return false;
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
const stored = value.value.props[predicate.property];
|
|
146
|
+
if (predicate.kind === 'property.range')
|
|
147
|
+
return queryRangeContains(predicate, stored);
|
|
148
|
+
return predicate.kind === 'property.present' || portable.equal(stored, predicate.value);
|
|
146
149
|
});
|
|
147
150
|
}
|
|
148
151
|
stepRows.push(rows.length);
|
|
@@ -273,9 +276,13 @@ function decodeWitness(input, path, context) {
|
|
|
273
276
|
}
|
|
274
277
|
function selectNodes(rows, select, size, after, admission, properties) {
|
|
275
278
|
const selected = new Map();
|
|
279
|
+
const ordered = orderedClasses(select.order, 'node', properties);
|
|
276
280
|
rows.forEach((row) => {
|
|
277
281
|
const node = boundNode(row, select.binding, '/select/binding');
|
|
278
|
-
|
|
282
|
+
// A value is read; an ordered reference reads a fact its order applies to before ranking it.
|
|
283
|
+
const needsRead = select.kind === 'graph' ||
|
|
284
|
+
(select.kind === 'nodes' && select.projection.kind === 'value') ||
|
|
285
|
+
ordered.has(node.class);
|
|
279
286
|
if (needsRead && !admission.readNode(node, '/select/binding'))
|
|
280
287
|
return;
|
|
281
288
|
selected.set(node.id, node);
|
|
@@ -305,6 +312,7 @@ function selectNodes(rows, select, size, after, admission, properties) {
|
|
|
305
312
|
}
|
|
306
313
|
function selectEdges(rows, select, size, after, context, admission, properties) {
|
|
307
314
|
const selected = new Map();
|
|
315
|
+
const ordered = orderedClasses(select.order, 'edge', properties);
|
|
308
316
|
rows.forEach((row) => {
|
|
309
317
|
const edge = boundEdge(row, select.binding, '/select/binding');
|
|
310
318
|
const source = requireNode(context, edge.source, '/select/binding');
|
|
@@ -319,7 +327,7 @@ function selectEdges(rows, select, size, after, context, admission, properties)
|
|
|
319
327
|
admission.readNode(source, '/select/binding') &&
|
|
320
328
|
admission.readNode(target, '/select/binding')
|
|
321
329
|
: select.kind === 'edges'
|
|
322
|
-
? (select.projection.edge === 'reference' ||
|
|
330
|
+
? ((select.projection.edge === 'reference' && !ordered.has(edge.class)) ||
|
|
323
331
|
admission.readEdge(edge, '/select/binding')) &&
|
|
324
332
|
(select.projection.source === 'reference' ||
|
|
325
333
|
admission.readNode(source, '/select/binding')) &&
|
|
@@ -362,12 +370,24 @@ function selectEdges(rows, select, size, after, context, admission, properties)
|
|
|
362
370
|
const next = last === undefined ? undefined : frontierOf(last, order, 'edge', properties);
|
|
363
371
|
return Object.freeze({ result, ...(next === undefined ? {} : { next }) });
|
|
364
372
|
}
|
|
373
|
+
/** The Classes a Property order applies to, whose facts are read before they are ranked. */
|
|
374
|
+
function orderedClasses(order, kind, properties) {
|
|
375
|
+
return order === undefined
|
|
376
|
+
? new Set()
|
|
377
|
+
: properties.close(order.property, kind, '/select/order/property');
|
|
378
|
+
}
|
|
365
379
|
function orderingComparator(order, kind, properties) {
|
|
366
|
-
|
|
380
|
+
const ordering = orderingOf(order, kind, properties);
|
|
381
|
+
return (left, right) => compareReferenceRank(rankOf(left, order, kind, properties), rankOf(right, order, kind, properties), order, ordering);
|
|
382
|
+
}
|
|
383
|
+
function orderingOf(order, kind, properties) {
|
|
384
|
+
return order === undefined
|
|
385
|
+
? undefined
|
|
386
|
+
: properties.ordering(order.property, kind, '/select/order/property');
|
|
367
387
|
}
|
|
368
388
|
function compareFrontier(frontier, fact, order, kind, properties) {
|
|
369
389
|
const admitted = decodeReferenceFrontier(frontier, order, kind, properties);
|
|
370
|
-
return compareReferenceRank(admitted, rankOf(fact, order, kind, properties), order);
|
|
390
|
+
return compareReferenceRank(admitted, rankOf(fact, order, kind, properties), order, orderingOf(order, kind, properties));
|
|
371
391
|
}
|
|
372
392
|
function frontierOf(fact, order, kind, properties) {
|
|
373
393
|
const rank = rankOf(fact, order, kind, properties);
|
|
@@ -413,36 +433,8 @@ function decodeReferenceFrontier(frontier, order, kind, properties) {
|
|
|
413
433
|
}
|
|
414
434
|
return Object.freeze({ bucket: 'ranked', value: frontier.value, identity });
|
|
415
435
|
}
|
|
416
|
-
function compareReferenceRank(left, right, order) {
|
|
417
|
-
|
|
418
|
-
return compareIdentity(left.identity, right.identity);
|
|
419
|
-
if (left.bucket !== right.bucket) {
|
|
420
|
-
return left.bucket === 'unranked'
|
|
421
|
-
? order.unranked === 'first'
|
|
422
|
-
? -1
|
|
423
|
-
: 1
|
|
424
|
-
: order.unranked === 'first'
|
|
425
|
-
? 1
|
|
426
|
-
: -1;
|
|
427
|
-
}
|
|
428
|
-
if (left.bucket === 'ranked' && right.bucket === 'ranked') {
|
|
429
|
-
const kind = typeof left.value === 'boolean'
|
|
430
|
-
? 'boolean'
|
|
431
|
-
: typeof left.value === 'number'
|
|
432
|
-
? 'number'
|
|
433
|
-
: 'string';
|
|
434
|
-
const compared = compareOrderingValue(left.value, right.value, kind);
|
|
435
|
-
if (compared !== 0)
|
|
436
|
-
return order.direction === 'asc' ? compared : -compared;
|
|
437
|
-
}
|
|
438
|
-
return compareIdentity(left.identity, right.identity);
|
|
439
|
-
}
|
|
440
|
-
function compareIdentity(left, right) {
|
|
441
|
-
if (typeof left === 'string' && typeof right === 'string')
|
|
442
|
-
return compareNodeIds(left, right);
|
|
443
|
-
if (typeof left !== 'string' && typeof right !== 'string')
|
|
444
|
-
return compareEdgeKeys(left, right);
|
|
445
|
-
invalid('/after/identity', 'Frontier identity kind disagrees with selection');
|
|
436
|
+
function compareReferenceRank(left, right, order, ordering) {
|
|
437
|
+
return compareQueryRank(left, right, order === undefined || ordering === undefined ? undefined : { ...order, kind: ordering });
|
|
446
438
|
}
|
|
447
439
|
function orderingValue(input, kind) {
|
|
448
440
|
if (kind === 'boolean')
|
|
@@ -451,22 +443,6 @@ function orderingValue(input, kind) {
|
|
|
451
443
|
return typeof input === 'number' && Number.isFinite(input);
|
|
452
444
|
return typeof input === 'string';
|
|
453
445
|
}
|
|
454
|
-
function compareOrderingValue(left, right, kind) {
|
|
455
|
-
if (kind === 'boolean')
|
|
456
|
-
return Number(left) - Number(right);
|
|
457
|
-
if (kind === 'number')
|
|
458
|
-
return left - right;
|
|
459
|
-
return compareUnicodeScalars(left, right);
|
|
460
|
-
}
|
|
461
|
-
function compareUnicodeScalars(left, right) {
|
|
462
|
-
const a = Array.from(left, (value) => value.codePointAt(0));
|
|
463
|
-
const b = Array.from(right, (value) => value.codePointAt(0));
|
|
464
|
-
for (let index = 0; index < Math.min(a.length, b.length); index += 1) {
|
|
465
|
-
if (a[index] !== b[index])
|
|
466
|
-
return a[index] - b[index];
|
|
467
|
-
}
|
|
468
|
-
return a.length - b.length;
|
|
469
|
-
}
|
|
470
446
|
function projectNode(node, shape) {
|
|
471
447
|
return shape === 'value'
|
|
472
448
|
? Object.freeze({ kind: 'value', value: node })
|
|
@@ -611,6 +587,15 @@ class Admission {
|
|
|
611
587
|
const cached = this.#edges.get(key);
|
|
612
588
|
if (cached !== undefined)
|
|
613
589
|
return cached;
|
|
590
|
+
const source = requireNode(this.context, edge.source, path);
|
|
591
|
+
const target = requireNode(this.context, edge.target, path);
|
|
592
|
+
const admitted = call(path, 'Logical Edge fact admission failed', () => this.context.admitEdge(edge, source, target));
|
|
593
|
+
if (typeof admitted !== 'boolean')
|
|
594
|
+
invalid(path, 'Logical Edge fact admission must return boolean');
|
|
595
|
+
if (!admitted) {
|
|
596
|
+
this.#edges.set(key, false);
|
|
597
|
+
return false;
|
|
598
|
+
}
|
|
614
599
|
const explicit = call(path, 'Edge traversal admission failed', () => this.context.traverseEdge(edge));
|
|
615
600
|
if (typeof explicit !== 'boolean')
|
|
616
601
|
invalid(path, 'Edge traversal admission must return boolean');
|
|
@@ -648,6 +633,7 @@ function acceptContext(input) {
|
|
|
648
633
|
'closeClass',
|
|
649
634
|
'closeProperty',
|
|
650
635
|
'orientation',
|
|
636
|
+
'admitEdge',
|
|
651
637
|
'traverseNode',
|
|
652
638
|
'traverseEdge',
|
|
653
639
|
'readNode',
|
|
@@ -671,6 +657,7 @@ function acceptContext(input) {
|
|
|
671
657
|
closeClass: input.closeClass.bind(input),
|
|
672
658
|
closeProperty: input.closeProperty.bind(input),
|
|
673
659
|
orientation: input.orientation.bind(input),
|
|
660
|
+
admitEdge: input.admitEdge.bind(input),
|
|
674
661
|
traverseNode: input.traverseNode.bind(input),
|
|
675
662
|
traverseEdge: input.traverseEdge.bind(input),
|
|
676
663
|
readNode: input.readNode.bind(input),
|
|
@@ -35,7 +35,7 @@ export function queryResultSelection(input) {
|
|
|
35
35
|
/** Decode exact QueryResult structure; Query-relative closure remains Runtime-owned. */
|
|
36
36
|
export function decodeQueryResult(input) {
|
|
37
37
|
try {
|
|
38
|
-
const value = decodeWire(queryResultSchema, portable.
|
|
38
|
+
const value = decodeWire(queryResultSchema, portable.acceptForRead(input), invalid);
|
|
39
39
|
if (value.kind === 'graph') {
|
|
40
40
|
const graph = decodeGraph(value.graph, '/graph');
|
|
41
41
|
const selection = decodeSelection(value.selection, graph);
|
|
@@ -1,95 +1,94 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
/** Exact discriminated structural result; Runtime owns Query-relative closure and order. */
|
|
3
|
-
export declare const queryResultSchema:
|
|
4
|
-
kind:
|
|
5
|
-
graph:
|
|
6
|
-
nodes:
|
|
7
|
-
id:
|
|
8
|
-
class:
|
|
9
|
-
props:
|
|
10
|
-
},
|
|
11
|
-
edges:
|
|
12
|
-
source:
|
|
13
|
-
target:
|
|
14
|
-
class:
|
|
15
|
-
slug:
|
|
16
|
-
props:
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
selection:
|
|
20
|
-
kind:
|
|
21
|
-
ids:
|
|
22
|
-
},
|
|
23
|
-
kind:
|
|
24
|
-
keys:
|
|
25
|
-
source:
|
|
26
|
-
target:
|
|
27
|
-
class:
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
kind:
|
|
32
|
-
nodes:
|
|
33
|
-
kind:
|
|
34
|
-
value:
|
|
35
|
-
id:
|
|
36
|
-
class:
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
kind:
|
|
40
|
-
value:
|
|
41
|
-
id:
|
|
42
|
-
class:
|
|
43
|
-
props:
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
kind:
|
|
48
|
-
edges:
|
|
49
|
-
edge:
|
|
50
|
-
kind:
|
|
51
|
-
value:
|
|
52
|
-
source:
|
|
53
|
-
target:
|
|
54
|
-
class:
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
kind:
|
|
58
|
-
value:
|
|
59
|
-
source:
|
|
60
|
-
target:
|
|
61
|
-
class:
|
|
62
|
-
slug:
|
|
63
|
-
props:
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
source:
|
|
67
|
-
kind:
|
|
68
|
-
value:
|
|
69
|
-
id:
|
|
70
|
-
class:
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
kind:
|
|
74
|
-
value:
|
|
75
|
-
id:
|
|
76
|
-
class:
|
|
77
|
-
props:
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
target:
|
|
81
|
-
kind:
|
|
82
|
-
value:
|
|
83
|
-
id:
|
|
84
|
-
class:
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
kind:
|
|
88
|
-
value:
|
|
89
|
-
id:
|
|
90
|
-
class:
|
|
91
|
-
props:
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
2
|
+
export declare const queryResultSchema: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
3
|
+
kind: import("zod").ZodLiteral<"graph">;
|
|
4
|
+
graph: import("zod").ZodObject<{
|
|
5
|
+
nodes: import("zod").ZodArray<import("zod").ZodObject<{
|
|
6
|
+
id: import("zod").ZodString;
|
|
7
|
+
class: import("zod").ZodString;
|
|
8
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
9
|
+
}, import("zod/v4/core").$strict>>;
|
|
10
|
+
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
11
|
+
source: import("zod").ZodString;
|
|
12
|
+
target: import("zod").ZodString;
|
|
13
|
+
class: import("zod").ZodString;
|
|
14
|
+
slug: import("zod").ZodOptional<import("zod").ZodType<import("../../edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
|
|
15
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
16
|
+
}, import("zod/v4/core").$strict>>;
|
|
17
|
+
}, import("zod/v4/core").$strict>;
|
|
18
|
+
selection: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
19
|
+
kind: import("zod").ZodLiteral<"node">;
|
|
20
|
+
ids: import("zod").ZodArray<import("zod").ZodString>;
|
|
21
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
22
|
+
kind: import("zod").ZodLiteral<"edge">;
|
|
23
|
+
keys: import("zod").ZodArray<import("zod").ZodObject<{
|
|
24
|
+
source: import("zod").ZodString;
|
|
25
|
+
target: import("zod").ZodString;
|
|
26
|
+
class: import("zod").ZodString;
|
|
27
|
+
}, import("zod/v4/core").$strict>>;
|
|
28
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
29
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
30
|
+
kind: import("zod").ZodLiteral<"nodes">;
|
|
31
|
+
nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
32
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
33
|
+
value: import("zod").ZodObject<{
|
|
34
|
+
id: import("zod").ZodString;
|
|
35
|
+
class: import("zod").ZodString;
|
|
36
|
+
}, import("zod/v4/core").$strict>;
|
|
37
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
38
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
39
|
+
value: import("zod").ZodObject<{
|
|
40
|
+
id: import("zod").ZodString;
|
|
41
|
+
class: import("zod").ZodString;
|
|
42
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
43
|
+
}, import("zod/v4/core").$strict>;
|
|
44
|
+
}, import("zod/v4/core").$strict>], "kind">>;
|
|
45
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
46
|
+
kind: import("zod").ZodLiteral<"edges">;
|
|
47
|
+
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
48
|
+
edge: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
49
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
50
|
+
value: import("zod").ZodObject<{
|
|
51
|
+
source: import("zod").ZodString;
|
|
52
|
+
target: import("zod").ZodString;
|
|
53
|
+
class: import("zod").ZodString;
|
|
54
|
+
}, import("zod/v4/core").$strict>;
|
|
55
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
56
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
57
|
+
value: import("zod").ZodObject<{
|
|
58
|
+
source: import("zod").ZodString;
|
|
59
|
+
target: import("zod").ZodString;
|
|
60
|
+
class: import("zod").ZodString;
|
|
61
|
+
slug: import("zod").ZodOptional<import("zod").ZodType<import("../../edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
|
|
62
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
63
|
+
}, import("zod/v4/core").$strict>;
|
|
64
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
65
|
+
source: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
66
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
67
|
+
value: import("zod").ZodObject<{
|
|
68
|
+
id: import("zod").ZodString;
|
|
69
|
+
class: import("zod").ZodString;
|
|
70
|
+
}, import("zod/v4/core").$strict>;
|
|
71
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
72
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
73
|
+
value: import("zod").ZodObject<{
|
|
74
|
+
id: import("zod").ZodString;
|
|
75
|
+
class: import("zod").ZodString;
|
|
76
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
77
|
+
}, import("zod/v4/core").$strict>;
|
|
78
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
79
|
+
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
80
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
81
|
+
value: import("zod").ZodObject<{
|
|
82
|
+
id: import("zod").ZodString;
|
|
83
|
+
class: import("zod").ZodString;
|
|
84
|
+
}, import("zod/v4/core").$strict>;
|
|
85
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
86
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
87
|
+
value: import("zod").ZodObject<{
|
|
88
|
+
id: import("zod").ZodString;
|
|
89
|
+
class: import("zod").ZodString;
|
|
90
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
91
|
+
}, import("zod/v4/core").$strict>;
|
|
92
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
93
|
+
}, import("zod/v4/core").$strict>>;
|
|
94
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { array, discriminatedUnion, literal, strictObject, string } from 'zod';
|
|
2
2
|
import { edgeKeySchema, graphDataSchema, graphEdgeSchema, graphNodeSchema, } from '#graph/graph/model/wire';
|
|
3
|
-
const text =
|
|
4
|
-
const nodeReference =
|
|
5
|
-
const nodeProjection =
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const text = string().min(1);
|
|
4
|
+
const nodeReference = strictObject({ id: text, class: text });
|
|
5
|
+
const nodeProjection = discriminatedUnion('kind', [
|
|
6
|
+
strictObject({ kind: literal('reference'), value: nodeReference }),
|
|
7
|
+
strictObject({ kind: literal('value'), value: graphNodeSchema }),
|
|
8
8
|
]);
|
|
9
|
-
const edgeProjection =
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const edgeProjection = discriminatedUnion('kind', [
|
|
10
|
+
strictObject({ kind: literal('reference'), value: edgeKeySchema }),
|
|
11
|
+
strictObject({ kind: literal('value'), value: graphEdgeSchema }),
|
|
12
12
|
]);
|
|
13
|
-
const edgeItem =
|
|
13
|
+
const edgeItem = strictObject({
|
|
14
14
|
edge: edgeProjection,
|
|
15
15
|
source: nodeProjection,
|
|
16
16
|
target: nodeProjection,
|
|
17
17
|
});
|
|
18
18
|
/** Exact discriminated structural result; Runtime owns Query-relative closure and order. */
|
|
19
|
-
export const queryResultSchema =
|
|
20
|
-
|
|
21
|
-
kind:
|
|
19
|
+
export const queryResultSchema = discriminatedUnion('kind', [
|
|
20
|
+
strictObject({
|
|
21
|
+
kind: literal('graph'),
|
|
22
22
|
graph: graphDataSchema,
|
|
23
|
-
selection:
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
selection: discriminatedUnion('kind', [
|
|
24
|
+
strictObject({ kind: literal('node'), ids: array(text) }),
|
|
25
|
+
strictObject({ kind: literal('edge'), keys: array(edgeKeySchema) }),
|
|
26
26
|
]),
|
|
27
27
|
}),
|
|
28
|
-
|
|
29
|
-
kind:
|
|
30
|
-
nodes:
|
|
28
|
+
strictObject({
|
|
29
|
+
kind: literal('nodes'),
|
|
30
|
+
nodes: array(nodeProjection),
|
|
31
31
|
}),
|
|
32
|
-
|
|
32
|
+
strictObject({ kind: literal('edges'), edges: array(edgeItem) }),
|
|
33
33
|
]);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PropertyKey } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import type { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
3
|
import type { EdgeKey, EdgeSlug } from '../../edge/index.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { LocalAlias, MergeConflict as GraphMergeConflict } from '../../graph/index.js';
|
|
5
5
|
import type { NodeId } from '../../node/index.js';
|
|
6
6
|
import type { DesiredProperties } from '../../properties/index.js';
|
|
7
7
|
import type { QueryEdgeAST, QueryNodeAST } from '../../query/index.js';
|
|
8
8
|
declare const DESIRED_BRAND: unique symbol;
|
|
9
9
|
export type DesiredNodeRef = NodeId | {
|
|
10
|
-
readonly desired:
|
|
10
|
+
readonly desired: LocalAlias;
|
|
11
11
|
};
|
|
12
12
|
export interface DesiredEdgeRef {
|
|
13
13
|
readonly source: DesiredNodeRef;
|
|
@@ -2,7 +2,6 @@ import type { DesiredEdge, DesiredEdgeRef, DesiredNode, DesiredNodeRef, Expectat
|
|
|
2
2
|
import { type EdgeKey, type EdgeSlug } from '../../edge/index.js';
|
|
3
3
|
export declare function admitDesiredNode(node: DesiredNode): DesiredNode;
|
|
4
4
|
export declare function admitDesiredEdge(edge: DesiredEdge): DesiredEdge;
|
|
5
|
-
export declare function admitNodeRef(ref: DesiredNodeRef): DesiredNodeRef;
|
|
6
5
|
export declare function admitEdgeRef(ref: DesiredEdgeRef | EdgeKey): DesiredEdgeRef;
|
|
7
6
|
export declare function equalExpectation(left: Expectation<EdgeSlug>, right: Expectation<EdgeSlug>): boolean;
|
|
8
7
|
export declare function encodeDesiredNodeRef(ref: DesiredNodeRef): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
2
|
import { isEdgeSlug } from '../../edge/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { LocalAlias, isLocalAlias } from '../../graph/index.js';
|
|
4
4
|
import { isNodeId } from '../../node/index.js';
|
|
5
5
|
export function admitDesiredNode(node) {
|
|
6
6
|
const ref = admitNodeRef(node.node);
|
|
@@ -29,14 +29,14 @@ export function admitDesiredEdge(edge) {
|
|
|
29
29
|
properties: edge.properties,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
function admitNodeRef(ref) {
|
|
33
33
|
if (typeof ref === 'string') {
|
|
34
34
|
requireNodeId(ref);
|
|
35
35
|
return ref;
|
|
36
36
|
}
|
|
37
|
-
if (!
|
|
37
|
+
if (!isLocalAlias(ref.desired))
|
|
38
38
|
throw new TypeError(`Invalid desired Node binding.`);
|
|
39
|
-
return Object.freeze({ desired:
|
|
39
|
+
return Object.freeze({ desired: LocalAlias(ref.desired) });
|
|
40
40
|
}
|
|
41
41
|
export function admitEdgeRef(ref) {
|
|
42
42
|
if (!ClassKey.is(ref.class))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { NodeId } from '../node/index.js';
|
|
3
3
|
import type { QueryObservation } from './evidence.js';
|
|
4
4
|
export type CorrespondenceEntry = {
|
|
5
|
-
readonly desired:
|
|
5
|
+
readonly desired: LocalAlias;
|
|
6
6
|
readonly kind: 'present';
|
|
7
7
|
readonly node: NodeId;
|
|
8
8
|
readonly observation: Extract<QueryObservation, {
|
|
@@ -11,7 +11,7 @@ export type CorrespondenceEntry = {
|
|
|
11
11
|
};
|
|
12
12
|
}>;
|
|
13
13
|
} | {
|
|
14
|
-
readonly desired:
|
|
14
|
+
readonly desired: LocalAlias;
|
|
15
15
|
readonly kind: 'absent';
|
|
16
16
|
readonly observation: Extract<QueryObservation, {
|
|
17
17
|
readonly selection: {
|
|
@@ -24,18 +24,19 @@ export interface Correspondence {
|
|
|
24
24
|
}
|
|
25
25
|
export type CorrespondenceConflict = {
|
|
26
26
|
readonly kind: 'correspondence-duplicate';
|
|
27
|
-
readonly desired:
|
|
27
|
+
readonly desired: LocalAlias;
|
|
28
28
|
} | {
|
|
29
29
|
readonly kind: 'correspondence-noninjective';
|
|
30
30
|
readonly node: NodeId;
|
|
31
|
-
readonly desired: readonly
|
|
31
|
+
readonly desired: readonly LocalAlias[];
|
|
32
32
|
} | {
|
|
33
33
|
readonly kind: 'correspondence-observation-invalid';
|
|
34
|
-
readonly desired:
|
|
34
|
+
readonly desired: LocalAlias;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
readonly entries: ReadonlyMap<
|
|
36
|
+
interface CorrespondenceAnalysis {
|
|
37
|
+
readonly entries: ReadonlyMap<LocalAlias, CorrespondenceEntry>;
|
|
38
38
|
readonly conflicts: readonly CorrespondenceConflict[];
|
|
39
39
|
}
|
|
40
40
|
/** Canonically index correspondence and classify duplicate or non-injective mappings. */
|
|
41
41
|
export declare function analyzeCorrespondence(entries: readonly CorrespondenceEntry[]): CorrespondenceAnalysis;
|
|
42
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { NodeId } from '../node/index.js';
|
|
3
3
|
import type { QueryEdgeAST, QueryNodeAST, QuerySelection } from '../query/index.js';
|
|
4
4
|
import { type EdgeKey } from '../edge/index.js';
|
|
5
5
|
export type ObservationRequirement = {
|
|
6
6
|
readonly kind: 'correspondence';
|
|
7
|
-
readonly desired:
|
|
7
|
+
readonly desired: LocalAlias;
|
|
8
8
|
} | {
|
|
9
9
|
readonly kind: 'selection';
|
|
10
10
|
readonly query: QueryNodeAST | QueryEdgeAST;
|
|
@@ -4,7 +4,7 @@ export type QueryPremise = Extract<ReconciliationPlan['premises'][number], {
|
|
|
4
4
|
kind: 'query';
|
|
5
5
|
}>;
|
|
6
6
|
export type PointPremise = Exclude<ReconciliationPlan['premises'][number], QueryPremise>;
|
|
7
|
-
|
|
7
|
+
type MutationAssessment = {
|
|
8
8
|
readonly kind: 'supported';
|
|
9
9
|
readonly pointPremises: readonly PointPremise[];
|
|
10
10
|
readonly queryPremises: readonly QueryPremise[];
|
|
@@ -14,3 +14,4 @@ export type MutationAssessment = {
|
|
|
14
14
|
};
|
|
15
15
|
/** Classify whether one complete semantic plan fits the target's atomic Mutation profile. */
|
|
16
16
|
export declare function assess(plan: ReconciliationPlan, profile: MutationRealizationProfile): MutationAssessment;
|
|
17
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphData,
|
|
1
|
+
import type { GraphData, LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { Node, NodeId } from '../node/index.js';
|
|
3
3
|
import type { Correspondence, CorrespondenceEntry } from './correspondence.js';
|
|
4
4
|
import type { EvidenceRequirement, ObservationEvidence } from './evidence.js';
|
|
@@ -16,11 +16,12 @@ export type ObservationConflict = {
|
|
|
16
16
|
readonly kind: 'observation-evidence-contradiction';
|
|
17
17
|
readonly requirement: EvidenceRequirement;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
interface ObservationAnalysis {
|
|
20
20
|
readonly nodes: ReadonlyMap<NodeId, Node>;
|
|
21
21
|
readonly edges: ReadonlyMap<string, Edge>;
|
|
22
22
|
readonly evidence: readonly ObservationEvidence[];
|
|
23
23
|
readonly conflicts: readonly ObservationConflict[];
|
|
24
24
|
}
|
|
25
25
|
/** Index finite facts and classify contradictory or duplicate evidence. */
|
|
26
|
-
export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<
|
|
26
|
+
export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<LocalAlias, CorrespondenceEntry>): ObservationAnalysis;
|
|
27
|
+
export {};
|
|
@@ -2,6 +2,12 @@ import { type ObservationRequirement } from '#graph/reconcile/evidence';
|
|
|
2
2
|
import type { Effect, PlanningBlocker, PlanningConflict, Premise, ReconciliationPlan } from './model.js';
|
|
3
3
|
export declare function canonicalRequirements(values: readonly ObservationRequirement[]): ObservationRequirement[];
|
|
4
4
|
export declare function canonicalPremises(values: readonly Premise[]): Premise[];
|
|
5
|
+
/**
|
|
6
|
+
* Distinct desired refs can name one target: an explicit NodeId and a binding whose
|
|
7
|
+
* correspondence observes that Node. Effects with one key and equal content collapse; effects with
|
|
8
|
+
* one key and different content contradict the desired state, which no transition can establish.
|
|
9
|
+
*/
|
|
10
|
+
export declare function contradictoryEffects(values: readonly Effect[]): PlanningConflict[];
|
|
5
11
|
export declare function canonicalEffects(values: readonly Effect[]): Effect[];
|
|
6
12
|
export declare function canonicalConflicts(values: readonly PlanningConflict[]): PlanningConflict[];
|
|
7
13
|
export declare function canonicalBlockers(values: readonly PlanningBlocker[]): PlanningBlocker[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
1
2
|
import { freezeRequirement, requirementKey, } from '#graph/reconcile/evidence';
|
|
2
3
|
import { encodeEdgeKey } from '../../edge/index.js';
|
|
3
4
|
export function canonicalRequirements(values) {
|
|
@@ -8,6 +9,30 @@ export function canonicalRequirements(values) {
|
|
|
8
9
|
export function canonicalPremises(values) {
|
|
9
10
|
return [...new Map(values.map((value) => [premiseKey(value), value])).values()].sort(comparePremises);
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Distinct desired refs can name one target: an explicit NodeId and a binding whose
|
|
14
|
+
* correspondence observes that Node. Effects with one key and equal content collapse; effects with
|
|
15
|
+
* one key and different content contradict the desired state, which no transition can establish.
|
|
16
|
+
*/
|
|
17
|
+
export function contradictoryEffects(values) {
|
|
18
|
+
const groups = new Map();
|
|
19
|
+
for (const value of values) {
|
|
20
|
+
const key = effectKey(value);
|
|
21
|
+
const group = groups.get(key) ?? new Map();
|
|
22
|
+
group.set(portable.json.serialize(value), value);
|
|
23
|
+
groups.set(key, group);
|
|
24
|
+
}
|
|
25
|
+
const conflicts = [];
|
|
26
|
+
for (const group of groups.values()) {
|
|
27
|
+
if (group.size < 2)
|
|
28
|
+
continue;
|
|
29
|
+
conflicts.push({
|
|
30
|
+
kind: 'desired-target-contradictory',
|
|
31
|
+
effects: [...group].sort(([left], [right]) => compare(left, right)).map(([, value]) => value),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return conflicts;
|
|
35
|
+
}
|
|
11
36
|
export function canonicalEffects(values) {
|
|
12
37
|
return [...new Map(values.map((value) => [effectKey(value), value])).values()].sort(compareEffects);
|
|
13
38
|
}
|
|
@@ -66,6 +91,9 @@ function freezeConflict(value) {
|
|
|
66
91
|
if (value.kind === 'correspondence-noninjective') {
|
|
67
92
|
return Object.freeze({ ...value, desired: Object.freeze([...value.desired]) });
|
|
68
93
|
}
|
|
94
|
+
if (value.kind === 'desired-target-contradictory') {
|
|
95
|
+
return Object.freeze({ ...value, effects: Object.freeze([...value.effects]) });
|
|
96
|
+
}
|
|
69
97
|
return Object.freeze({ ...value });
|
|
70
98
|
}
|
|
71
99
|
function compare(left, right) {
|