@astrale-os/kernel-dsl 1.0.0-beta.3 → 1.0.0-beta.31
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/v1/addressing/class-key.js +3 -3
- package/dist/v1/addressing/definition-ref.js +21 -37
- package/dist/v1/addressing/domain-dependency.d.ts +0 -6
- package/dist/v1/addressing/domain-dependency.js +1 -6
- package/dist/v1/addressing/key.d.ts +4 -1
- package/dist/v1/addressing/key.js +23 -3
- package/dist/v1/addressing/ordering.d.ts +2 -0
- package/dist/v1/addressing/ordering.js +2 -0
- package/dist/v1/addressing/patterns.d.ts +1 -1
- package/dist/v1/addressing/patterns.js +2 -6
- package/dist/v1/builder/callable/authoring.d.ts +11 -5
- package/dist/v1/builder/callable/authoring.js +2 -0
- package/dist/v1/builder/class/authoring.d.ts +94 -224
- package/dist/v1/builder/class/authoring.js +30 -35
- package/dist/v1/builder/class/handle.d.ts +27 -0
- package/dist/v1/builder/class/handle.js +1 -0
- package/dist/v1/builder/class/input.d.ts +159 -0
- package/dist/v1/builder/class/projection.d.ts +129 -0
- package/dist/v1/builder/class/projection.js +1 -0
- package/dist/v1/builder/class/property.d.ts +3 -9
- package/dist/v1/builder/class/property.js +1 -0
- package/dist/v1/builder/core/authoring.d.ts +1 -1
- package/dist/v1/builder/index.d.ts +10 -2
- package/dist/v1/builder/index.js +2 -0
- package/dist/v1/builder/lowering/callable.js +1 -0
- package/dist/v1/builder/lowering/class.d.ts +9 -1
- package/dist/v1/builder/lowering/class.js +62 -17
- package/dist/v1/builder/lowering/policy.js +6 -24
- package/dist/v1/builder/lowering/property-keys.d.ts +27 -0
- package/dist/v1/builder/lowering/property-keys.js +108 -0
- package/dist/v1/builder/lowering/schema/compile.js +13 -6
- package/dist/v1/builder/lowering/schema/context.d.ts +9 -1
- package/dist/v1/builder/lowering/schema/context.js +36 -7
- package/dist/v1/builder/lowering/schema/lifetime.d.ts +11 -0
- package/dist/v1/builder/lowering/schema/lifetime.js +55 -0
- package/dist/v1/builder/lowering/value/compile.js +29 -22
- package/dist/v1/builder/lowering/value/file.d.ts +7 -0
- package/dist/v1/builder/lowering/value/file.js +14 -0
- package/dist/v1/builder/lowering/value/path.d.ts +1 -1
- package/dist/v1/builder/lowering/value/path.js +2 -4
- package/dist/v1/builder/lowering/value/zod.js +41 -7
- package/dist/v1/builder/policy/authoring.d.ts +80 -9
- package/dist/v1/builder/policy/authoring.js +99 -68
- package/dist/v1/builder/policy/legacy/edge.d.ts +28 -0
- package/dist/v1/builder/policy/legacy/edge.js +16 -0
- package/dist/v1/builder/schema/define.d.ts +0 -1
- package/dist/v1/builder/schema/diagnostic.d.ts +3 -2
- package/dist/v1/builder/schema/diagnostic.js +5 -10
- package/dist/v1/builder/schema/input.d.ts +4 -1
- package/dist/v1/builder/schema/projection/callable.d.ts +7 -5
- package/dist/v1/builder/schema/projection/class.d.ts +78 -16
- package/dist/v1/builder/schema/projection/core-input.d.ts +2 -1
- package/dist/v1/builder/schema/projection/domain.d.ts +13 -2
- package/dist/v1/builder/schema/projection/identity.d.ts +74 -9
- package/dist/v1/builder/schema/projection/model.d.ts +4 -2
- package/dist/v1/builder/schema/projection/property.d.ts +38 -4
- package/dist/v1/builder/schema/projection/resolved-class.d.ts +5 -4
- package/dist/v1/builder/schema/projection.d.ts +1 -1
- package/dist/v1/builder/schema/rule.d.ts +316 -0
- package/dist/v1/builder/schema/rule.js +192 -0
- package/dist/v1/builder/value/file.d.ts +34 -0
- package/dist/v1/builder/value/file.js +77 -0
- package/dist/v1/builder/value/full-match.d.ts +0 -1
- package/dist/v1/builder/value/full-match.js +0 -1
- package/dist/v1/builder/value/path-metadata.d.ts +1 -1
- package/dist/v1/builder/value/path.d.ts +1 -1
- package/dist/v1/bundle/codec.js +55 -74
- package/dist/v1/bundle/diagnostic.d.ts +3 -1
- package/dist/v1/bundle/diagnostic.js +9 -7
- package/dist/v1/bundle/index.d.ts +2 -0
- package/dist/v1/bundle/index.js +1 -0
- package/dist/v1/bundle/model.js +1 -1
- package/dist/v1/bundle/rule.d.ts +14 -0
- package/dist/v1/bundle/rule.js +41 -0
- package/dist/v1/bundle/structure.js +6 -8
- package/dist/v1/compiled/admission/accept.js +9 -15
- package/dist/v1/compiled/admission/closure.js +17 -34
- package/dist/v1/compiled/admission/diagnostic.d.ts +23 -1
- package/dist/v1/compiled/admission/diagnostic.js +40 -3
- package/dist/v1/compiled/admission/revision.d.ts +9 -1
- package/dist/v1/compiled/admission/revision.js +7 -3
- package/dist/v1/compiled/admission/semantics/class.d.ts +4 -1
- package/dist/v1/compiled/admission/semantics/class.js +48 -19
- package/dist/v1/compiled/admission/semantics/core.d.ts +1 -24
- package/dist/v1/compiled/admission/semantics/core.js +56 -24
- package/dist/v1/compiled/admission/semantics/edge.d.ts +2 -4
- package/dist/v1/compiled/admission/semantics/edge.js +6 -65
- package/dist/v1/compiled/admission/semantics/policy/admit.js +4 -19
- package/dist/v1/compiled/admission/semantics/policy/callable.js +2 -5
- package/dist/v1/compiled/admission/semantics/policy/contracts.d.ts +5 -20
- package/dist/v1/compiled/admission/semantics/policy/contracts.js +8 -21
- package/dist/v1/compiled/admission/semantics/policy/parity.js +44 -53
- package/dist/v1/compiled/admission/semantics/policy/pattern.d.ts +4 -1
- package/dist/v1/compiled/admission/semantics/policy/pattern.js +7 -21
- package/dist/v1/compiled/admission/semantics/policy/typing.d.ts +2 -24
- package/dist/v1/compiled/admission/semantics/policy/typing.js +19 -201
- package/dist/v1/compiled/admission/wire/callable.d.ts +5 -2
- package/dist/v1/compiled/admission/wire/callable.js +24 -20
- package/dist/v1/compiled/admission/wire/class.js +79 -30
- package/dist/v1/compiled/admission/wire/entry.d.ts +1 -1
- package/dist/v1/compiled/admission/wire/entry.js +36 -13
- package/dist/v1/compiled/admission/wire/policy.d.ts +4 -3
- package/dist/v1/compiled/admission/wire/policy.js +27 -20
- package/dist/v1/compiled/admission/wire/program.d.ts +13 -3
- package/dist/v1/compiled/admission/wire/program.js +39 -44
- package/dist/v1/compiled/admission/wire/property.d.ts +4 -1
- package/dist/v1/compiled/admission/wire/property.js +8 -5
- package/dist/v1/compiled/admission/wire/value.d.ts +0 -2
- package/dist/v1/compiled/admission/wire/value.js +0 -7
- package/dist/v1/compiled/codec/json.js +4 -3
- package/dist/v1/compiled/compiler/compile.js +15 -33
- package/dist/v1/compiled/diagnostic.d.ts +1 -1
- package/dist/v1/compiled/diagnostic.js +2 -3
- package/dist/v1/compiled/index.d.ts +2 -0
- package/dist/v1/compiled/index.js +1 -0
- package/dist/v1/compiled/loader/load.d.ts +3 -2
- package/dist/v1/compiled/loader/load.js +13 -52
- package/dist/v1/compiled/model/schema.d.ts +3 -0
- package/dist/v1/compiled/rule.d.ts +49 -0
- package/dist/v1/compiled/rule.js +169 -0
- package/dist/v1/domain/create.js +9 -10
- package/dist/v1/domain/model/domain.d.ts +2 -7
- package/dist/v1/domain/model/input.d.ts +19 -10
- package/dist/v1/domain/namespace/member-collection.js +8 -7
- package/dist/v1/domain/projection/classes.js +11 -8
- package/dist/v1/domain/validation/create.d.ts +7 -16
- package/dist/v1/domain/validation/create.js +35 -81
- package/dist/v1/index.d.ts +5 -3
- package/dist/v1/index.js +1 -1
- package/dist/v1/language/.spec/schemas/draft-2020-12.schema.json +462 -0
- package/dist/v1/language/.spec/schemas/value-schema.schema.json +23 -0
- package/dist/v1/language/callable/admission.d.ts +15 -0
- package/dist/v1/language/callable/admission.js +44 -0
- package/dist/v1/language/callable/model/callable.d.ts +10 -0
- package/dist/v1/language/callable/resolved.d.ts +26 -5
- package/dist/v1/language/chain.d.ts +7 -0
- package/dist/v1/language/chain.js +24 -0
- package/dist/v1/language/class/inheritance.d.ts +36 -5
- package/dist/v1/language/class/inheritance.js +85 -1
- package/dist/v1/language/class/lifetime.d.ts +50 -11
- package/dist/v1/language/class/lifetime.js +89 -20
- package/dist/v1/language/class/model/class.d.ts +45 -9
- package/dist/v1/language/class/model/edge.d.ts +31 -2
- package/dist/v1/language/class/model/property.d.ts +16 -7
- package/dist/v1/language/class/property-values.js +2 -4
- package/dist/v1/language/class/resolved.d.ts +9 -4
- package/dist/v1/language/class/unique.d.ts +143 -0
- package/dist/v1/language/class/unique.js +264 -0
- package/dist/v1/language/core/facts.d.ts +85 -0
- package/dist/v1/language/core/facts.js +116 -0
- package/dist/v1/language/cycle.d.ts +10 -0
- package/dist/v1/language/cycle.js +30 -0
- package/dist/v1/language/definition/metadata.d.ts +38 -0
- package/dist/v1/language/definition/metadata.js +51 -0
- package/dist/v1/language/freeze.d.ts +5 -0
- package/dist/v1/{schema/canonical → language}/freeze.js +4 -0
- package/dist/v1/language/index.d.ts +7 -2
- package/dist/v1/language/index.js +5 -1
- package/dist/v1/language/limits.d.ts +83 -0
- package/dist/v1/language/limits.js +77 -0
- package/dist/v1/language/policy/analysis/branches.d.ts +8 -0
- package/dist/v1/language/policy/analysis/branches.js +8 -8
- package/dist/v1/language/policy/analysis/budgets.d.ts +45 -12
- package/dist/v1/language/policy/analysis/budgets.js +140 -20
- package/dist/v1/language/policy/analysis/checks.js +8 -6
- package/dist/v1/language/policy/analysis/composition.d.ts +4 -0
- package/dist/v1/language/policy/analysis/composition.js +11 -0
- package/dist/v1/language/policy/analysis/typing.d.ts +51 -0
- package/dist/v1/language/policy/analysis/typing.js +456 -0
- package/dist/v1/language/policy/model/policy.d.ts +71 -9
- package/dist/v1/language/policy/model/policy.js +42 -4
- package/dist/v1/language/policy/normalization/normalize.d.ts +6 -6
- package/dist/v1/language/policy/normalization/normalize.js +46 -68
- package/dist/v1/language/suspended.d.ts +7 -0
- package/dist/v1/language/suspended.js +23 -0
- package/dist/v1/language/validation/diagnostic.d.ts +15 -1
- package/dist/v1/language/validation/diagnostic.js +21 -0
- package/dist/v1/language/validation/rule.d.ts +45 -0
- package/dist/v1/language/validation/rule.js +109 -0
- package/dist/v1/language/value/compile/fields.js +16 -16
- package/dist/v1/language/value/compile/load.d.ts +5 -0
- package/dist/v1/language/value/compile/load.js +13 -0
- package/dist/v1/language/value/evaluate/assertions.d.ts +5 -1
- package/dist/v1/language/value/evaluate/assertions.js +19 -8
- package/dist/v1/language/value/evaluate/evaluator.js +117 -120
- package/dist/v1/language/value/evaluate/preparation.d.ts +16 -0
- package/dist/v1/language/value/evaluate/preparation.js +100 -47
- package/dist/v1/language/value/evaluate/program.d.ts +2 -1
- package/dist/v1/language/value/evaluate/program.js +6 -6
- package/dist/v1/language/value/evaluate/validate.d.ts +3 -3
- package/dist/v1/language/value/evaluate/validate.js +15 -11
- package/dist/v1/language/value/evaluate/validity.optimization.d.ts +14 -0
- package/dist/v1/language/value/evaluate/validity.optimization.js +338 -0
- package/dist/v1/language/value/files.d.ts +44 -0
- package/dist/v1/language/value/files.js +151 -0
- package/dist/v1/language/value/inclusion/arrays.d.ts +3 -0
- package/dist/v1/language/value/inclusion/arrays.js +85 -0
- package/dist/v1/language/value/inclusion/assertions.d.ts +18 -0
- package/dist/v1/language/value/inclusion/assertions.js +28 -0
- package/dist/v1/language/value/inclusion/combinators.d.ts +3 -0
- package/dist/v1/language/value/inclusion/combinators.js +67 -0
- package/dist/v1/language/value/inclusion/equivalence.d.ts +4 -0
- package/dist/v1/language/value/inclusion/equivalence.js +76 -0
- package/dist/v1/language/value/inclusion/evidence.d.ts +34 -0
- package/dist/v1/language/value/inclusion/evidence.js +140 -0
- package/dist/v1/language/value/inclusion/includes.d.ts +29 -3
- package/dist/v1/language/value/inclusion/includes.js +58 -723
- package/dist/v1/language/value/inclusion/keywords.d.ts +5 -0
- package/dist/v1/language/value/inclusion/keywords.js +31 -0
- package/dist/v1/language/value/inclusion/kinds.d.ts +17 -0
- package/dist/v1/language/value/inclusion/kinds.js +57 -0
- package/dist/v1/language/value/inclusion/location.d.ts +24 -0
- package/dist/v1/language/value/inclusion/location.js +66 -0
- package/dist/v1/language/value/inclusion/numbers.d.ts +3 -0
- package/dist/v1/language/value/inclusion/numbers.js +41 -0
- package/dist/v1/language/value/inclusion/objects.d.ts +3 -0
- package/dist/v1/language/value/inclusion/objects.js +190 -0
- package/dist/v1/language/value/inclusion/strings.d.ts +3 -0
- package/dist/v1/language/value/inclusion/strings.js +29 -0
- package/dist/v1/language/value/inclusion/types.d.ts +3 -0
- package/dist/v1/language/value/inclusion/types.js +34 -0
- package/dist/v1/language/value/model/blob.d.ts +6 -0
- package/dist/v1/language/value/model/blob.js +8 -0
- package/dist/v1/language/value/model/file.d.ts +41 -0
- package/dist/v1/language/value/model/file.js +122 -0
- package/dist/v1/language/value/ordering.d.ts +14 -0
- package/dist/v1/language/value/ordering.js +144 -77
- package/dist/v1/language/value/profile/canonicalize.d.ts +6 -1
- package/dist/v1/language/value/profile/canonicalize.js +67 -87
- package/dist/v1/language/value/profile/json.validate.d.ts +12 -0
- package/dist/v1/language/value/profile/json.validate.js +18 -5
- package/dist/v1/language/value/profile/meta-schema.compiled.d.ts +1 -0
- package/dist/v1/language/value/profile/meta-schema.compiled.js +21 -5
- package/dist/v1/language/value/profile/rules.js +27 -44
- package/dist/v1/language/value/profile/validate.js +1 -10
- package/dist/v1/language/value/profile/vocabulary.d.ts +36 -2
- package/dist/v1/language/value/profile/vocabulary.js +58 -5
- package/dist/v1/language/value/reference/closure.js +6 -6
- package/dist/v1/language/value/reference/recursion.js +9 -48
- package/dist/v1/language/value/reference/references.d.ts +3 -1
- package/dist/v1/language/value/reference/references.js +7 -7
- package/dist/v1/language/value/reference/registry.index.d.ts +2 -0
- package/dist/v1/language/value/reference/registry.index.js +33 -16
- package/dist/v1/language/value/regexp/ast.js +6 -7
- package/dist/v1/language/value/regexp/compile.d.ts +5 -11
- package/dist/v1/language/value/regexp/compile.js +14 -12
- package/dist/v1/language/value/regexp/syntax.js +3 -2
- package/dist/v1/language/value/regexp/unicode.d.ts +1 -1
- package/dist/v1/language/value/regexp/unicode.js +1 -1
- package/dist/v1/language/value/syntax/keywords.d.ts +3 -3
- package/dist/v1/language/value/syntax/keywords.js +4 -20
- package/dist/v1/language/value/syntax/node-path/validate.js +2 -3
- package/dist/v1/language/value/syntax/pointer.d.ts +2 -0
- package/dist/v1/language/value/syntax/pointer.js +5 -2
- package/dist/v1/language/value/syntax/walk.d.ts +9 -0
- package/dist/v1/language/value/syntax/walk.js +37 -20
- package/dist/v1/schema/.spec/schemas/domain-schema.schema.json +2596 -0
- package/dist/v1/schema/admission/accept.d.ts +3 -1
- package/dist/v1/schema/admission/accept.js +6 -14
- package/dist/v1/schema/admission/callable.d.ts +21 -0
- package/dist/v1/schema/admission/callable.js +96 -0
- package/dist/v1/schema/analysis/class.d.ts +4 -0
- package/dist/v1/schema/analysis/class.js +57 -17
- package/dist/v1/schema/canonical/revision.d.ts +4 -1
- package/dist/v1/schema/canonical/revision.js +8 -5
- package/dist/v1/schema/compatibility/api.d.ts +4 -1
- package/dist/v1/schema/compatibility/api.js +2 -0
- package/dist/v1/schema/compatibility/comparators/callables.js +1 -1
- package/dist/v1/schema/compatibility/comparators/classes.d.ts +9 -4
- package/dist/v1/schema/compatibility/comparators/classes.js +50 -29
- package/dist/v1/schema/compatibility/comparators/index.d.ts +1 -1
- package/dist/v1/schema/compatibility/comparators/members.js +1 -1
- package/dist/v1/schema/compatibility/comparators/values.js +2 -2
- package/dist/v1/schema/compatibility/context.d.ts +5 -2
- package/dist/v1/schema/compatibility/context.js +8 -6
- package/dist/v1/schema/compatibility/coordinate.js +3 -3
- package/dist/v1/schema/compatibility/diff.js +2 -4
- package/dist/v1/schema/compatibility/extension.d.ts +11 -0
- package/dist/v1/schema/compatibility/extension.js +22 -0
- package/dist/v1/schema/compatibility/fields.d.ts +20 -4
- package/dist/v1/schema/compatibility/fields.js +13 -3
- package/dist/v1/schema/compatibility/meaning/footprint.js +16 -51
- package/dist/v1/schema/compatibility/model.d.ts +17 -5
- package/dist/v1/schema/compatibility/references.d.ts +0 -3
- package/dist/v1/schema/compatibility/references.js +1 -9
- package/dist/v1/schema/compatibility/report.js +1 -1
- package/dist/v1/schema/compatibility/rule.d.ts +13 -0
- package/dist/v1/schema/compatibility/rule.js +23 -0
- package/dist/v1/schema/compatibility/scope.d.ts +2 -0
- package/dist/v1/schema/compatibility/scope.js +4 -1
- package/dist/v1/schema/compatibility/structure/index.js +6 -4
- package/dist/v1/schema/compatibility/structure/requirements.js +58 -61
- package/dist/v1/schema/compatibility/versioning/index.js +1 -1
- package/dist/v1/schema/compatibility/versioning/surface.d.ts +1 -1
- package/dist/v1/schema/compatibility/versioning/surface.js +30 -2
- package/dist/v1/schema/compatibility/walk.d.ts +17 -0
- package/dist/v1/schema/compatibility/walk.js +41 -0
- package/dist/v1/schema/diagnostic.d.ts +17 -3
- package/dist/v1/schema/diagnostic.js +14 -11
- package/dist/v1/schema/enforcement/changes.d.ts +590 -0
- package/dist/v1/schema/enforcement/changes.js +566 -0
- package/dist/v1/schema/enforcement/derived.d.ts +236 -0
- package/dist/v1/schema/enforcement/derived.js +243 -0
- package/dist/v1/schema/enforcement/dispose.d.ts +308 -0
- package/dist/v1/schema/enforcement/dispose.js +275 -0
- package/dist/v1/schema/enforcement/facts.d.ts +89 -0
- package/dist/v1/schema/enforcement/facts.js +70 -0
- package/dist/v1/schema/enforcement/fields.d.ts +65 -0
- package/dist/v1/schema/enforcement/fields.js +36 -0
- package/dist/v1/schema/enforcement/index.d.ts +39 -0
- package/dist/v1/schema/enforcement/index.js +10 -0
- package/dist/v1/schema/enforcement/install.d.ts +1634 -0
- package/dist/v1/schema/enforcement/install.js +1223 -0
- package/dist/v1/schema/enforcement/lifecycle.d.ts +87 -0
- package/dist/v1/schema/enforcement/lifecycle.js +91 -0
- package/dist/v1/schema/enforcement/model.d.ts +253 -0
- package/dist/v1/schema/enforcement/model.js +1 -0
- package/dist/v1/schema/enforcement/obligations.d.ts +248 -0
- package/dist/v1/schema/enforcement/obligations.js +240 -0
- package/dist/v1/schema/enforcement/write.d.ts +1314 -0
- package/dist/v1/schema/enforcement/write.js +1017 -0
- package/dist/v1/schema/index.d.ts +11 -1
- package/dist/v1/schema/index.js +5 -0
- package/dist/v1/schema/model/schema.d.ts +23 -1
- package/dist/v1/schema/model/schema.js +1 -1
- package/dist/v1/schema/normalization/domain.d.ts +2 -0
- package/dist/v1/schema/normalization/domain.js +50 -13
- package/dist/v1/schema/resolution/closure.js +2 -1
- package/dist/v1/schema/resolution/context.js +17 -18
- package/dist/v1/schema/resolution/domain.d.ts +5 -0
- package/dist/v1/schema/resolution/domain.js +6 -12
- package/dist/v1/schema/resolution/origins.js +6 -8
- package/dist/v1/schema/rule.d.ts +25 -0
- package/dist/v1/schema/rule.js +459 -0
- package/dist/v1/schema/validation/callable.d.ts +35 -2
- package/dist/v1/schema/validation/callable.js +65 -9
- package/dist/v1/schema/validation/class.d.ts +6 -2
- package/dist/v1/schema/validation/class.js +128 -105
- package/dist/v1/schema/validation/core.js +103 -173
- package/dist/v1/schema/validation/domain.js +25 -15
- package/dist/v1/schema/validation/domain.json-schema.d.ts +15 -0
- package/dist/v1/schema/validation/domain.json-schema.js +222 -0
- package/dist/v1/schema/validation/domain.route.d.ts +6 -1
- package/dist/v1/schema/validation/domain.route.js +18 -0
- package/dist/v1/schema/validation/domain.structure.d.ts +7797 -0
- package/dist/v1/schema/validation/domain.structure.js +516 -160
- package/dist/v1/schema/validation/icon.d.ts +4 -0
- package/dist/v1/schema/validation/icon.js +29 -0
- package/dist/v1/schema/validation/json.json-schema.d.ts +40 -0
- package/dist/v1/schema/validation/json.json-schema.js +46 -0
- package/dist/v1/schema/validation/policy/budgets.d.ts +37 -2
- package/dist/v1/schema/validation/policy/budgets.js +94 -121
- package/dist/v1/schema/validation/policy/context.d.ts +6 -5
- package/dist/v1/schema/validation/policy/context.js +7 -10
- package/dist/v1/schema/validation/policy/objects.d.ts +1 -1
- package/dist/v1/schema/validation/policy/objects.js +6 -14
- package/dist/v1/schema/validation/policy/references.js +20 -62
- package/dist/v1/schema/validation/policy/typing.d.ts +3 -18
- package/dist/v1/schema/validation/policy/typing.js +22 -356
- package/dist/v1/schema/validation/policy/uses.d.ts +40 -3
- package/dist/v1/schema/validation/policy/uses.js +63 -91
- package/dist/v1/schema/validation/policy/validate.js +5 -5
- package/dist/v1/schema/validation/value-api.d.ts +27 -1
- package/dist/v1/schema/validation/value-api.js +37 -2
- package/dist/v1/schema/validation/value.d.ts +3 -0
- package/dist/v1/schema/validation/value.js +9 -17
- package/dist/v1/schema/validation/value.json-schema.d.ts +54 -0
- package/dist/v1/schema/validation/value.json-schema.js +163 -0
- package/dist/v1/schema/validation/view.js +4 -8
- package/dist/value/accept.d.ts +9 -3
- package/dist/value/accept.js +25 -1
- package/dist/value/canonical.d.ts +22 -1
- package/dist/value/canonical.js +114 -21
- package/dist/value/decode.d.ts +7 -0
- package/dist/value/decode.js +159 -9
- package/dist/value/equal.d.ts +9 -1
- package/dist/value/equal.js +37 -3
- package/dist/value/immutable.optimization.d.ts +2 -0
- package/dist/value/immutable.optimization.js +4 -0
- package/dist/value/index.d.ts +5 -3
- package/dist/value/index.js +2 -1
- package/dist/value/json.d.ts +2 -2
- package/dist/value/json.js +2 -2
- package/dist/value/limits.d.ts +11 -0
- package/dist/value/rule.d.ts +12 -0
- package/dist/value/rule.js +50 -0
- package/dist/value/types.d.ts +6 -0
- package/dist/value/unicode.d.ts +2 -1
- package/dist/value/unicode.js +2 -0
- package/package.json +15 -4
- package/dist/v1/builder/lowering/core-properties.d.ts +0 -10
- package/dist/v1/builder/lowering/core-properties.js +0 -76
- package/dist/v1/compiled/admission/semantics/cardinality.d.ts +0 -5
- package/dist/v1/compiled/admission/semantics/cardinality.js +0 -113
- package/dist/v1/compiled/admission/semantics/policy/equality.d.ts +0 -8
- package/dist/v1/compiled/admission/semantics/policy/equality.js +0 -27
- package/dist/v1/compiled/admission/semantics/policy/measure.d.ts +0 -9
- package/dist/v1/compiled/admission/semantics/policy/measure.js +0 -81
- package/dist/v1/compiled/admission/semantics/policy/variants.d.ts +0 -10
- package/dist/v1/compiled/admission/semantics/policy/variants.js +0 -65
- package/dist/v1/compiled/admission/wire/pattern.d.ts +0 -12
- package/dist/v1/compiled/admission/wire/pattern.js +0 -111
- package/dist/v1/language/class/index.d.ts +0 -8
- package/dist/v1/language/class/index.js +0 -1
- package/dist/v1/language/core/index.d.ts +0 -2
- package/dist/v1/language/value/index.d.ts +0 -11
- package/dist/v1/language/value/index.js +0 -8
- package/dist/v1/schema/canonical/domain.d.ts +0 -3
- package/dist/v1/schema/canonical/domain.digest.d.ts +0 -3
- package/dist/v1/schema/canonical/domain.digest.js +0 -5
- package/dist/v1/schema/canonical/domain.js +0 -5
- package/dist/v1/schema/canonical/freeze.d.ts +0 -1
- /package/dist/v1/{language/core/index.js → builder/class/input.js} +0 -0
|
@@ -1,48 +1,63 @@
|
|
|
1
|
+
import { equalDefinitionRefs } from '../../addressing/definition-ref.js';
|
|
1
2
|
import { Key } from '../../addressing/key.js';
|
|
2
3
|
import { definitionRefIndex } from '../../addressing/ordering.js';
|
|
3
4
|
import { isMethodExecutable } from '../../language/callable/executable.js';
|
|
4
|
-
import { classSatisfies as satisfiesClass,
|
|
5
|
+
import { classSatisfies as satisfiesClass, edgeContractRefines as refinesEdgeContract, } from '../../language/class/inheritance.js';
|
|
6
|
+
import { lifetimeBreaches, lifetimeScope } from '../../language/class/lifetime.js';
|
|
7
|
+
import { keyableProperty } from '../../language/class/unique.js';
|
|
5
8
|
import { admitStateTopology } from '../../language/state/topology.js';
|
|
6
9
|
import { isBlobValueSchema } from '../../language/value/model/blob.js';
|
|
7
10
|
import { classifyOrdering } from '../../language/value/ordering.js';
|
|
11
|
+
import { escapePointerToken } from '../../language/value/syntax/pointer.js';
|
|
8
12
|
import { diagnostic } from '../diagnostic.js';
|
|
9
|
-
import {
|
|
13
|
+
import { createDomainValueSchemaRegistry } from '../resolution/value.registry.js';
|
|
10
14
|
const formatDefinitionRef = Key.of;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Validate the semantic contracts owned by Class declarations. `registry` is the candidate's value
|
|
17
|
+
* registry; each dependency's is built at most once, so the Classes share them.
|
|
18
|
+
*/
|
|
19
|
+
export function validateDefinitions(environment, analysis, registry) {
|
|
20
|
+
const diagnostics = [];
|
|
14
21
|
const schema = environment.candidate;
|
|
22
|
+
let scope;
|
|
23
|
+
const registries = new Map([[schema.origin, registry]]);
|
|
24
|
+
const registryOf = (origin) => {
|
|
25
|
+
if (!registries.has(origin)) {
|
|
26
|
+
const dependency = environment.dependencies.get(origin);
|
|
27
|
+
registries.set(origin, dependency === undefined ? undefined : createDomainValueSchemaRegistry(dependency));
|
|
28
|
+
}
|
|
29
|
+
return registries.get(origin);
|
|
30
|
+
};
|
|
15
31
|
for (const [name, declaration] of Object.entries(schema.classes)) {
|
|
16
|
-
const ref =
|
|
17
|
-
const pointer = `/classes/${
|
|
18
|
-
if (!
|
|
32
|
+
const ref = { origin: schema.origin, kind: 'class', name };
|
|
33
|
+
const pointer = `/classes/${escapePointerToken(name)}`;
|
|
34
|
+
if (!equalDefinitionRefs(declaration.ref, ref)) {
|
|
19
35
|
diagnostics.push(diagnostic('DV_REF_RESOLVES', `${pointer}/ref`, `Class ref must be exactly ${formatDefinitionRef(ref)}.`, formatDefinitionRef(declaration.ref)));
|
|
20
36
|
}
|
|
21
|
-
if (declaration.abstract &&
|
|
22
|
-
(
|
|
23
|
-
diagnostics.push(diagnostic('DV_CLASS_ABSTRACT', `${pointer}/policies`, 'Abstract Classes cannot declare observation Policies.'));
|
|
37
|
+
if (declaration.abstract && Object.keys(declaration.policies).length > 0) {
|
|
38
|
+
diagnostics.push(diagnostic('DV_CLASS_ABSTRACT', `${pointer}/policies`, 'Abstract Classes cannot declare Class Policies.'));
|
|
24
39
|
}
|
|
25
|
-
validateFacet(
|
|
40
|
+
validateFacet(registry, declaration, pointer, diagnostics);
|
|
26
41
|
validateParents(environment, ref, declaration.kind, declaration.extends, diagnostics);
|
|
27
42
|
if (declaration.kind === 'edge') {
|
|
28
|
-
validateEdgeContract(environment, ref, declaration, diagnostics);
|
|
43
|
+
validateEdgeContract(environment, ref, declaration, pointer, diagnostics);
|
|
44
|
+
scope ??= lifetimeScope([...environment.definitions.values()].map(({ declaration }) => declaration));
|
|
45
|
+
validateEdgeLifetimes(scope, ref, declaration, pointer, diagnostics);
|
|
46
|
+
validateEdgeClassComposition(environment, ref, declaration, pointer, diagnostics);
|
|
29
47
|
}
|
|
48
|
+
validateUniqueProperties(registryOf, analysis, ref, declaration, pointer, diagnostics);
|
|
30
49
|
}
|
|
31
|
-
validateEdgeClassComposition(environment, diagnostics);
|
|
32
50
|
return Object.freeze(diagnostics);
|
|
33
51
|
}
|
|
34
|
-
function validateFacet(
|
|
35
|
-
const valueRegistry = createValueSchemaRegistry(environment);
|
|
52
|
+
function validateFacet(valueRegistry, declaration, pointer, diagnostics) {
|
|
36
53
|
for (const [name, property] of Object.entries(declaration.properties)) {
|
|
37
|
-
const propertyPointer = `${pointer}/properties/${
|
|
54
|
+
const propertyPointer = `${pointer}/properties/${escapePointerToken(name)}`;
|
|
55
|
+
// The structure refuses a blob on an Edge Property and a State Property on an Edge Class.
|
|
38
56
|
if (isBlobValueSchema(property.schema) &&
|
|
39
|
-
(
|
|
57
|
+
(property.auto !== undefined || property.state !== undefined)) {
|
|
40
58
|
diagnostics.push(diagnostic('DV_VALUE_SCHEMA', `${propertyPointer}/schema/x-astrale-value-kind`, 'Blob values are allowed only on non-automatic, non-state Node properties.'));
|
|
41
59
|
}
|
|
42
60
|
if (property.state !== undefined) {
|
|
43
|
-
if (declaration.kind !== 'node') {
|
|
44
|
-
diagnostics.push(diagnostic('DV_PROPERTY_STATE', `${propertyPointer}/state`, 'A State Property may be declared only on a Node Class.'));
|
|
45
|
-
}
|
|
46
61
|
try {
|
|
47
62
|
const topology = admitStateTopology(property.state);
|
|
48
63
|
const expected = Object.keys(topology.transitions).sort();
|
|
@@ -86,16 +101,22 @@ function validateFacet(environment, declaration, pointer, diagnostics) {
|
|
|
86
101
|
if (declaration.kind !== 'node')
|
|
87
102
|
return;
|
|
88
103
|
for (const [name, method] of Object.entries(declaration.methods)) {
|
|
89
|
-
const methodPointer = `${pointer}/methods/${
|
|
90
|
-
if (
|
|
104
|
+
const methodPointer = `${pointer}/methods/${escapePointerToken(name)}`;
|
|
105
|
+
if (isMethodExecutable(declaration, method))
|
|
106
|
+
continue;
|
|
107
|
+
if (method.policy !== undefined) {
|
|
91
108
|
diagnostics.push(diagnostic('DV_METHOD_ABSTRACT', `${methodPointer}/policy`, 'Abstract Methods cannot have a Policy.'));
|
|
92
109
|
}
|
|
110
|
+
// An admission age qualifies the admission of an executable declaration, like its Policy.
|
|
111
|
+
if (method.admission !== undefined) {
|
|
112
|
+
diagnostics.push(diagnostic('DV_METHOD_ABSTRACT', `${methodPointer}/admission`, 'Abstract Methods cannot have an admission age.'));
|
|
113
|
+
}
|
|
93
114
|
}
|
|
94
115
|
}
|
|
95
116
|
function validateParents(environment, owner, ownerKind, parents, diagnostics) {
|
|
96
117
|
for (const [index, parent] of parents.entries()) {
|
|
97
118
|
const target = environment.resolve(parent);
|
|
98
|
-
const pointer = `/classes/${
|
|
119
|
+
const pointer = `/classes/${escapePointerToken(owner.name)}/extends/${index}`;
|
|
99
120
|
if (target === undefined) {
|
|
100
121
|
diagnostics.push(diagnostic('DV_REF_RESOLVES', pointer, `Parent ${formatDefinitionRef(parent)} does not resolve exactly.`, formatDefinitionRef(parent)));
|
|
101
122
|
continue;
|
|
@@ -103,105 +124,116 @@ function validateParents(environment, owner, ownerKind, parents, diagnostics) {
|
|
|
103
124
|
if (target.ref.kind !== 'class' || target.declaration.kind !== ownerKind) {
|
|
104
125
|
diagnostics.push(diagnostic('DV_CLASS_KIND', pointer, `${formatDefinitionRef(owner)} cannot extend different-kind Class ${formatDefinitionRef(parent)}.`, formatDefinitionRef(parent)));
|
|
105
126
|
}
|
|
127
|
+
else if (target.declaration.inheritance === 'final') {
|
|
128
|
+
diagnostics.push(diagnostic('DV_CLASS_INHERITANCE', pointer, `${formatDefinitionRef(owner)} cannot extend final Class ${formatDefinitionRef(parent)}.`, formatDefinitionRef(parent)));
|
|
129
|
+
}
|
|
106
130
|
}
|
|
107
131
|
}
|
|
108
|
-
function validateEdgeContract(environment, owner, declaration, diagnostics) {
|
|
109
|
-
const
|
|
132
|
+
function validateEdgeContract(environment, owner, declaration, pointer, diagnostics) {
|
|
133
|
+
const directed = declaration.orientation === 'directed';
|
|
134
|
+
const endpoints = directed
|
|
110
135
|
? [declaration.endpoints.source, declaration.endpoints.target]
|
|
111
136
|
: declaration.endpoints;
|
|
137
|
+
const keys = directed ? ['source', 'target'] : ['0', '1'];
|
|
112
138
|
if (endpoints[0].role === endpoints[1].role) {
|
|
113
|
-
diagnostics.push(diagnostic('DV_EDGE_ROLE',
|
|
139
|
+
diagnostics.push(diagnostic('DV_EDGE_ROLE', `${pointer}/endpoints/${keys[1]}/role`, `${formatDefinitionRef(owner)} has equal endpoint roles.`));
|
|
114
140
|
}
|
|
115
|
-
const counts =
|
|
116
|
-
? [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
const counts = directed
|
|
142
|
+
? [
|
|
143
|
+
['outgoing', declaration.endpoints.source.outgoing],
|
|
144
|
+
['incoming', declaration.endpoints.target.incoming],
|
|
145
|
+
]
|
|
146
|
+
: [
|
|
147
|
+
['incident', declaration.endpoints[0].incident],
|
|
148
|
+
['incident', declaration.endpoints[1].incident],
|
|
149
|
+
];
|
|
150
|
+
validateEndpoint(environment, owner, endpoints[0], counts[0], directed ? 'source' : 'first endpoint', `${pointer}/endpoints/${keys[0]}`, diagnostics);
|
|
151
|
+
validateEndpoint(environment, owner, endpoints[1], counts[1], directed ? 'target' : 'second endpoint', `${pointer}/endpoints/${keys[1]}`, diagnostics);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Each Property a key tuple names is one of the Class's own or inherited Properties, and keyable:
|
|
155
|
+
* a single-kind scalar by its ordering facet that no automatic program writes (D-S1). Properties
|
|
156
|
+
* inherit without redefinition, so the key reads one meaning on every descendant it covers. A Node
|
|
157
|
+
* tuple names Properties only; an Edge tuple names them as `{ property }` beside its other fields.
|
|
158
|
+
*/
|
|
159
|
+
function validateUniqueProperties(registryOf, analysis, owner, declaration, pointer, diagnostics) {
|
|
160
|
+
if (declaration.kind === 'edge' && declaration.orientation !== 'directed')
|
|
161
|
+
return;
|
|
162
|
+
if (declaration.unique === undefined)
|
|
163
|
+
return;
|
|
164
|
+
const properties = analysis.definitions.get(definitionRefIndex(owner))?.properties;
|
|
165
|
+
if (properties === undefined)
|
|
166
|
+
return;
|
|
167
|
+
const code = declaration.kind === 'node' ? 'DV_NODE_UNIQUE' : 'DV_EDGE_UNIQUE';
|
|
168
|
+
const check = (key, at) => {
|
|
169
|
+
const property = properties.get(key);
|
|
170
|
+
if (property === undefined) {
|
|
171
|
+
diagnostics.push(diagnostic(code, at, `${key} is not a Property of the Class.`));
|
|
172
|
+
return;
|
|
123
173
|
}
|
|
174
|
+
const registry = registryOf(property.owner.origin);
|
|
175
|
+
const ordering = registry === undefined ? undefined : classifyOrdering(property.schema, registry);
|
|
176
|
+
if (!keyableProperty(ordering, property.auto)) {
|
|
177
|
+
diagnostics.push(diagnostic(code, at, 'A key Property is a string, number, boolean or instant that no automatic program writes.'));
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
if (declaration.kind === 'node') {
|
|
181
|
+
declaration.unique.forEach((tuple, t) => tuple.forEach((key, f) => check(key, `${pointer}/unique/${t}/${f}`)));
|
|
182
|
+
return;
|
|
124
183
|
}
|
|
184
|
+
declaration.unique.forEach((tuple, t) => tuple.forEach((field, f) => {
|
|
185
|
+
if (typeof field !== 'string')
|
|
186
|
+
check(field.property, `${pointer}/unique/${t}/${f}/property`);
|
|
187
|
+
}));
|
|
125
188
|
}
|
|
126
|
-
|
|
189
|
+
// The structure refuses a repeated accepted Class before semantics: `accepts` is a set.
|
|
190
|
+
function validateEndpoint(environment, owner, endpoint, [countField, count], side, pointer, diagnostics) {
|
|
127
191
|
// An Edge Class binds only the Nodes of its Domain and its dependents: it cannot oblige the
|
|
128
192
|
// Nodes of a Class another Domain owns to carry its Edges.
|
|
129
193
|
const foreign = endpoint.accepts.find((ref) => ref.origin !== owner.origin);
|
|
130
194
|
if (foreign !== undefined && (count === '1' || count === '1..*')) {
|
|
131
|
-
diagnostics.push(diagnostic('DV_EDGE_FOREIGN_MINIMUM',
|
|
195
|
+
diagnostics.push(diagnostic('DV_EDGE_FOREIGN_MINIMUM', `${pointer}/${countField}`, `${formatDefinitionRef(owner)} ${side} accepts ${formatDefinitionRef(foreign)} of another Domain and cannot require ${count} Edges.`));
|
|
132
196
|
}
|
|
133
|
-
const
|
|
134
|
-
for (const ref of endpoint.accepts) {
|
|
135
|
-
const key = definitionRefIndex(ref);
|
|
136
|
-
if (seen.has(key)) {
|
|
137
|
-
diagnostics.push(diagnostic('DV_EDGE_ACCEPTS', '', `${formatDefinitionRef(owner)} ${side} repeats ${formatDefinitionRef(ref)}.`));
|
|
138
|
-
}
|
|
139
|
-
seen.add(key);
|
|
197
|
+
for (const [index, ref] of endpoint.accepts.entries()) {
|
|
140
198
|
const resolved = environment.resolve(ref);
|
|
141
199
|
if (resolved === undefined ||
|
|
142
200
|
resolved.ref.kind !== 'class' ||
|
|
143
201
|
resolved.declaration.kind !== 'node') {
|
|
144
|
-
diagnostics.push(diagnostic('DV_EDGE_ACCEPTS',
|
|
202
|
+
diagnostics.push(diagnostic('DV_EDGE_ACCEPTS', `${pointer}/accepts/${index}`, `${formatDefinitionRef(owner)} ${side} ref ${formatDefinitionRef(ref)} does not resolve to a Node Class.`));
|
|
145
203
|
}
|
|
146
204
|
}
|
|
147
205
|
}
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
206
|
+
/**
|
|
207
|
+
* The lifetime laws over the lifetimes a Schema declares. What an endpoint derives where it
|
|
208
|
+
* declares nothing is never refused here: a stored Registry decoded again keeps it.
|
|
209
|
+
*/
|
|
210
|
+
function validateEdgeLifetimes(scope, owner, declaration, pointer, diagnostics) {
|
|
211
|
+
const sides = declaration.orientation === 'directed'
|
|
212
|
+
? ['source', 'target']
|
|
213
|
+
: ['first endpoint', 'second endpoint'];
|
|
214
|
+
const keys = declaration.orientation === 'directed' ? ['source', 'target'] : ['0', '1'];
|
|
215
|
+
for (const { index, reason } of lifetimeBreaches(declaration, scope)) {
|
|
216
|
+
diagnostics.push(diagnostic('DV_EDGE_LIFETIME', `${pointer}/endpoints/${keys[index]}/onDelete`, `${formatDefinitionRef(owner)} ${sides[index]} ${reason}`));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Edge inheritance is refinement, not a second interface composition mechanism. A dependency
|
|
221
|
+
* Edge Class was judged against this same exact closure when it was accepted.
|
|
222
|
+
*/
|
|
223
|
+
function validateEdgeClassComposition(environment, owner, child, pointer, diagnostics) {
|
|
224
|
+
for (const [index, parentRef] of child.extends.entries()) {
|
|
225
|
+
const parent = environment.resolveAny(parentRef);
|
|
226
|
+
if (parent === undefined || parent.ref.kind !== 'class' || parent.declaration.kind !== 'edge') {
|
|
152
227
|
continue;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (parent === undefined ||
|
|
157
|
-
parent.ref.kind !== 'class' ||
|
|
158
|
-
parent.declaration.kind !== 'edge') {
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
if (!edgeContractRefines(environment, child, parent.declaration)) {
|
|
162
|
-
diagnostics.push(diagnostic('DV_EDGE_CLASS_COMPOSITION', '', `${formatDefinitionRef(resolved.ref)} does not safely refine ${formatDefinitionRef(parentRef)}.`));
|
|
163
|
-
}
|
|
228
|
+
}
|
|
229
|
+
if (!edgeContractRefines(environment, child, parent.declaration)) {
|
|
230
|
+
diagnostics.push(diagnostic('DV_EDGE_CLASS_COMPOSITION', `${pointer}/extends/${index}`, `${formatDefinitionRef(owner)} does not safely refine ${formatDefinitionRef(parentRef)}.`));
|
|
164
231
|
}
|
|
165
232
|
}
|
|
166
233
|
}
|
|
167
234
|
/** Whether `child` safely refines its parent Edge contract `parent`. */
|
|
168
235
|
export function edgeContractRefines(environment, child, parent) {
|
|
169
|
-
|
|
170
|
-
return true;
|
|
171
|
-
if (child.orientation !== parent.orientation)
|
|
172
|
-
return false;
|
|
173
|
-
if (parent.constraints.noSelf === true && child.constraints.noSelf !== true)
|
|
174
|
-
return false;
|
|
175
|
-
if (parent.constraints.acyclic === true && child.constraints.acyclic !== true)
|
|
176
|
-
return false;
|
|
177
|
-
if (child.orientation === 'directed' && parent.orientation === 'directed') {
|
|
178
|
-
return (endpointRefines(environment, child.endpoints.source, parent.endpoints.source) &&
|
|
179
|
-
countRefines(child.endpoints.source.outgoing, parent.endpoints.source.outgoing) &&
|
|
180
|
-
endpointRefines(environment, child.endpoints.target, parent.endpoints.target) &&
|
|
181
|
-
countRefines(child.endpoints.target.incoming, parent.endpoints.target.incoming));
|
|
182
|
-
}
|
|
183
|
-
if (child.orientation !== 'undirected' || parent.orientation !== 'undirected')
|
|
184
|
-
return false;
|
|
185
|
-
const refines = (childIndex, parentIndex) => endpointRefines(environment, child.endpoints[childIndex], parent.endpoints[parentIndex]) &&
|
|
186
|
-
countRefines(child.endpoints[childIndex].incident, parent.endpoints[parentIndex].incident);
|
|
187
|
-
const direct = refines(0, 0) && refines(1, 1);
|
|
188
|
-
if (direct)
|
|
189
|
-
return true;
|
|
190
|
-
return refines(0, 1) && refines(1, 0);
|
|
191
|
-
}
|
|
192
|
-
function endpointRefines(environment, child, parent) {
|
|
193
|
-
return child.accepts.every((accepted) => classSatisfies(environment, accepted, parent.accepts));
|
|
194
|
-
}
|
|
195
|
-
function countRefines(child, parent) {
|
|
196
|
-
const bounds = {
|
|
197
|
-
'0..*': [0, Number.POSITIVE_INFINITY],
|
|
198
|
-
'1..*': [1, Number.POSITIVE_INFINITY],
|
|
199
|
-
'0..1': [0, 1],
|
|
200
|
-
'1': [1, 1],
|
|
201
|
-
};
|
|
202
|
-
const [childMinimum, childMaximum] = bounds[child];
|
|
203
|
-
const [parentMinimum, parentMaximum] = bounds[parent];
|
|
204
|
-
return childMinimum >= parentMinimum && childMaximum <= parentMaximum;
|
|
236
|
+
return refinesEdgeContract(child, parent, (candidate, accepts) => classSatisfies(environment, candidate, accepts));
|
|
205
237
|
}
|
|
206
238
|
/** Whether `candidate` is, or is a Node Class extending, one of `accepts`. */
|
|
207
239
|
export function classSatisfies(environment, candidate, accepts) {
|
|
@@ -216,12 +248,3 @@ export function classSatisfies(environment, candidate, accepts) {
|
|
|
216
248
|
return required !== undefined && satisfiesClass(actual, required, resolve);
|
|
217
249
|
});
|
|
218
250
|
}
|
|
219
|
-
function localRef(origin, name) {
|
|
220
|
-
return { origin, kind: 'class', name };
|
|
221
|
-
}
|
|
222
|
-
function sameRef(left, right) {
|
|
223
|
-
return left.origin === right.origin && left.kind === right.kind && left.name === right.name;
|
|
224
|
-
}
|
|
225
|
-
function escapePointer(value) {
|
|
226
|
-
return value.replaceAll('~', '~0').replaceAll('/', '~1');
|
|
227
|
-
}
|