@astrale-os/kernel-dsl 0.2.0-beta.8 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v1/addressing/class-key.js +5 -4
- package/dist/v1/addressing/method-key.js +3 -2
- package/dist/v1/addressing/patterns.d.ts +0 -5
- package/dist/v1/addressing/patterns.js +5 -5
- package/dist/v1/builder/callable/authoring.d.ts +87 -41
- package/dist/v1/builder/callable/authoring.js +29 -14
- package/dist/v1/builder/class/authoring.d.ts +311 -36
- package/dist/v1/builder/class/authoring.js +3 -4
- package/dist/v1/builder/class/property.d.ts +16 -8
- package/dist/v1/builder/class/property.js +21 -5
- package/dist/v1/builder/core/authoring.d.ts +28 -13
- package/dist/v1/builder/core/authoring.js +22 -2
- package/dist/v1/builder/index.d.ts +9 -8
- package/dist/v1/builder/index.js +2 -2
- package/dist/v1/builder/lowering/callable.d.ts +3 -1
- package/dist/v1/builder/lowering/callable.js +43 -51
- package/dist/v1/builder/lowering/class.d.ts +7 -0
- package/dist/v1/builder/lowering/class.js +79 -29
- package/dist/v1/builder/lowering/core.d.ts +3 -2
- package/dist/v1/builder/lowering/core.js +9 -6
- package/dist/v1/builder/lowering/policy.d.ts +8 -1
- package/dist/v1/builder/lowering/policy.js +35 -0
- package/dist/v1/builder/lowering/schema/capture.js +9 -4
- package/dist/v1/builder/lowering/schema/compile.d.ts +2 -2
- package/dist/v1/builder/lowering/schema/compile.js +15 -2
- package/dist/v1/builder/lowering/schema/context.d.ts +11 -8
- package/dist/v1/builder/lowering/schema/context.js +59 -29
- package/dist/v1/builder/lowering/schema/ownership.d.ts +3 -3
- package/dist/v1/builder/lowering/schema/ownership.js +2 -1
- package/dist/v1/builder/lowering/value/compile.js +14 -4
- package/dist/v1/builder/lowering/value/zod.d.ts +7 -6
- package/dist/v1/builder/lowering/value/zod.js +16 -7
- package/dist/v1/builder/lowering/view.d.ts +4 -3
- package/dist/v1/builder/lowering/view.js +2 -14
- package/dist/v1/builder/policy/authoring.d.ts +23 -6
- package/dist/v1/builder/policy/authoring.js +35 -8
- package/dist/v1/builder/schema/define.d.ts +8 -5
- package/dist/v1/builder/schema/diagnostic.d.ts +1 -1
- package/dist/v1/builder/schema/handle.d.ts +2 -1
- package/dist/v1/builder/schema/input.d.ts +9 -1
- package/dist/v1/builder/schema/projection/callable.d.ts +51 -0
- package/dist/v1/builder/schema/projection/callable.js +1 -0
- package/dist/v1/builder/schema/projection/class.d.ts +89 -0
- package/dist/v1/builder/schema/projection/class.js +1 -0
- package/dist/v1/builder/schema/projection/core-input.d.ts +32 -0
- package/dist/v1/builder/schema/projection/core-input.js +1 -0
- package/dist/v1/builder/schema/projection/domain.d.ts +59 -0
- package/dist/v1/builder/schema/projection/domain.js +1 -0
- package/dist/v1/builder/schema/projection/identity.d.ts +39 -0
- package/dist/v1/builder/schema/projection/identity.js +1 -0
- package/dist/v1/builder/schema/projection/model.d.ts +59 -0
- package/dist/v1/builder/schema/projection/model.js +1 -0
- package/dist/v1/builder/schema/projection/property.d.ts +32 -0
- package/dist/v1/builder/schema/projection/property.js +1 -0
- package/dist/v1/builder/schema/projection/resolved-class.d.ts +76 -0
- package/dist/v1/builder/schema/projection/resolved-class.js +1 -0
- package/dist/v1/builder/schema/projection.d.ts +4 -258
- package/dist/v1/builder/value/full-match.js +6 -3
- package/dist/v1/builder/value/path.d.ts +2 -2
- package/dist/v1/builder/value/path.js +2 -2
- package/dist/v1/builder/view/authoring.d.ts +6 -14
- package/dist/v1/builder/view/authoring.js +13 -5
- package/dist/v1/bundle/structure.d.ts +2 -1
- package/dist/v1/compiled/admission/accept.d.ts +1 -1
- package/dist/v1/compiled/admission/accept.js +11 -814
- package/dist/v1/compiled/admission/closure.d.ts +3 -0
- package/dist/v1/compiled/admission/closure.js +173 -0
- package/dist/v1/compiled/admission/diagnostic.d.ts +7 -0
- package/dist/v1/compiled/admission/diagnostic.js +13 -0
- package/dist/v1/compiled/admission/revision.js +9 -1
- package/dist/v1/compiled/admission/semantics/cardinality.d.ts +5 -0
- package/dist/v1/compiled/admission/semantics/cardinality.js +113 -0
- package/dist/v1/compiled/admission/semantics/class.d.ts +5 -0
- package/dist/v1/compiled/admission/semantics/class.js +125 -0
- package/dist/v1/compiled/admission/semantics/context.d.ts +60 -0
- package/dist/v1/compiled/admission/semantics/context.js +81 -0
- package/dist/v1/compiled/admission/semantics/core.d.ts +35 -0
- package/dist/v1/compiled/admission/semantics/core.js +123 -0
- package/dist/v1/compiled/admission/semantics/edge.d.ts +8 -0
- package/dist/v1/compiled/admission/semantics/edge.js +89 -0
- package/dist/v1/compiled/admission/semantics/policy/admit.d.ts +4 -0
- package/dist/v1/compiled/admission/semantics/policy/admit.js +63 -0
- package/dist/v1/compiled/admission/semantics/policy/callable.d.ts +5 -0
- package/dist/v1/compiled/admission/semantics/policy/callable.js +72 -0
- package/dist/v1/compiled/admission/semantics/policy/contracts.d.ts +24 -0
- package/dist/v1/compiled/admission/semantics/policy/contracts.js +45 -0
- package/dist/v1/compiled/admission/semantics/policy/equality.d.ts +8 -0
- package/dist/v1/compiled/admission/semantics/policy/equality.js +27 -0
- package/dist/v1/compiled/admission/semantics/policy/measure.d.ts +9 -0
- package/dist/v1/compiled/admission/semantics/policy/measure.js +81 -0
- package/dist/v1/compiled/admission/semantics/policy/parity.d.ts +4 -0
- package/dist/v1/compiled/admission/semantics/policy/parity.js +138 -0
- package/dist/v1/compiled/admission/semantics/policy/pattern.d.ts +8 -0
- package/dist/v1/compiled/admission/semantics/policy/pattern.js +78 -0
- package/dist/v1/compiled/admission/semantics/policy/typing.d.ts +28 -0
- package/dist/v1/compiled/admission/semantics/policy/typing.js +206 -0
- package/dist/v1/compiled/admission/semantics/policy/variants.d.ts +10 -0
- package/dist/v1/compiled/admission/semantics/policy/variants.js +65 -0
- package/dist/v1/compiled/admission/semantics.d.ts +1 -1
- package/dist/v1/compiled/admission/semantics.js +8 -1078
- package/dist/v1/compiled/admission/wire/callable.d.ts +6 -0
- package/dist/v1/compiled/admission/wire/callable.js +90 -0
- package/dist/v1/compiled/admission/wire/class.d.ts +4 -0
- package/dist/v1/compiled/admission/wire/class.js +133 -0
- package/dist/v1/compiled/admission/wire/core.d.ts +5 -0
- package/dist/v1/compiled/admission/wire/core.js +32 -0
- package/dist/v1/compiled/admission/wire/dependency.d.ts +14 -0
- package/dist/v1/compiled/admission/wire/dependency.js +43 -0
- package/dist/v1/compiled/admission/wire/entry.d.ts +5 -0
- package/dist/v1/compiled/admission/wire/entry.js +100 -0
- package/dist/v1/compiled/admission/wire/pattern.d.ts +12 -0
- package/dist/v1/compiled/admission/wire/pattern.js +111 -0
- package/dist/v1/compiled/admission/wire/policy.d.ts +10 -0
- package/dist/v1/compiled/admission/wire/policy.js +189 -0
- package/dist/v1/compiled/admission/wire/program.d.ts +4 -0
- package/dist/v1/compiled/admission/wire/program.js +52 -0
- package/dist/v1/compiled/admission/wire/property.d.ts +4 -0
- package/dist/v1/compiled/admission/wire/property.js +74 -0
- package/dist/v1/compiled/admission/wire/reference.d.ts +8 -0
- package/dist/v1/compiled/admission/wire/reference.js +33 -0
- package/dist/v1/compiled/admission/wire/value.d.ts +29 -0
- package/dist/v1/compiled/admission/wire/value.js +98 -0
- package/dist/v1/compiled/admission/wire/view.d.ts +3 -0
- package/dist/v1/compiled/admission/wire/view.js +17 -0
- package/dist/v1/compiled/compiler/compile.js +43 -11
- package/dist/v1/compiled/generated.d.ts +10 -0
- package/dist/v1/compiled/generated.js +15 -0
- package/dist/v1/compiled/loader/load.d.ts +5 -0
- package/dist/v1/compiled/loader/load.js +18 -4
- package/dist/v1/compiled/model/schema.d.ts +16 -7
- package/dist/v1/domain/create.js +18 -28
- package/dist/v1/domain/model/domain.d.ts +0 -1
- package/dist/v1/domain/model/input.d.ts +3 -0
- package/dist/v1/domain/projection/classes.js +13 -41
- package/dist/v1/domain/validation/create.d.ts +2 -0
- package/dist/v1/domain/validation/create.js +12 -0
- package/dist/v1/index.d.ts +5 -2
- package/dist/v1/index.js +3 -1
- package/dist/v1/language/callable/composition.d.ts +27 -0
- package/dist/v1/language/callable/composition.js +52 -0
- package/dist/v1/language/callable/executable.d.ts +6 -0
- package/dist/v1/language/callable/executable.js +4 -0
- package/dist/v1/language/callable/model/callable.d.ts +34 -9
- package/dist/v1/language/callable/model/callable.js +3 -1
- package/dist/v1/language/callable/resolved.d.ts +23 -8
- package/dist/v1/language/class/facets.d.ts +5 -2
- package/dist/v1/language/class/inheritance.d.ts +12 -0
- package/dist/v1/language/class/inheritance.js +25 -0
- package/dist/v1/language/class/lifetime.d.ts +17 -0
- package/dist/v1/language/class/lifetime.js +26 -0
- package/dist/v1/language/class/model/class.d.ts +8 -4
- package/dist/v1/language/class/model/property.d.ts +4 -2
- package/dist/v1/language/class/property-values.js +5 -2
- package/dist/v1/language/class/resolved.d.ts +25 -15
- package/dist/v1/language/core/model/core.d.ts +7 -1
- package/dist/v1/language/core/resolved.d.ts +6 -2
- package/dist/v1/language/definition/metadata.d.ts +8 -0
- package/dist/v1/language/definition/metadata.js +12 -0
- package/dist/v1/language/index.d.ts +9 -0
- package/dist/v1/language/index.js +6 -0
- package/dist/v1/language/policy/analysis/branches.d.ts +4 -3
- package/dist/v1/language/policy/analysis/branches.js +54 -12
- package/dist/v1/language/policy/analysis/budgets.js +1 -1
- package/dist/v1/language/policy/analysis/checks.d.ts +28 -0
- package/dist/v1/language/policy/analysis/checks.js +80 -0
- package/dist/v1/language/policy/index.d.ts +1 -0
- package/dist/v1/language/policy/index.js +1 -0
- package/dist/v1/language/policy/model/policy.d.ts +71 -5
- package/dist/v1/language/policy/model/policy.js +52 -1
- package/dist/v1/language/policy/normalization/normalize.d.ts +12 -1
- package/dist/v1/language/policy/normalization/normalize.js +178 -44
- package/dist/v1/language/state/index.d.ts +3 -0
- package/dist/v1/language/state/index.js +1 -0
- package/dist/v1/language/state/machine.d.ts +28 -0
- package/dist/v1/language/state/machine.js +40 -0
- package/dist/v1/language/state/topology.d.ts +14 -0
- package/dist/v1/language/state/topology.js +69 -0
- package/dist/v1/language/value/compile/fields.d.ts +1 -1
- package/dist/v1/language/value/compile/load.d.ts +4 -2
- package/dist/v1/language/value/compile/load.js +22 -1
- package/dist/v1/language/value/compile/model.d.ts +16 -1
- package/dist/v1/language/value/evaluate/assertions.d.ts +2 -0
- package/dist/v1/language/value/evaluate/assertions.js +13 -0
- package/dist/v1/language/value/evaluate/evaluator.js +111 -28
- package/dist/v1/language/value/evaluate/preparation.d.ts +10 -1
- package/dist/v1/language/value/evaluate/preparation.js +17 -26
- package/dist/v1/language/value/evaluate/program.js +1 -1
- package/dist/v1/language/value/evaluate/validate.d.ts +6 -2
- package/dist/v1/language/value/evaluate/validate.js +18 -11
- package/dist/v1/language/value/inclusion/includes.d.ts +9 -0
- package/dist/v1/language/value/inclusion/includes.js +777 -0
- package/dist/v1/language/value/model/blob.d.ts +31 -0
- package/dist/v1/language/value/model/blob.js +90 -0
- package/dist/v1/language/value/model/instant.d.ts +0 -2
- package/dist/v1/language/value/model/instant.js +1 -1
- package/dist/v1/language/value/model/schema.d.ts +2 -1
- package/dist/v1/language/value/model/schema.js +1 -5
- package/dist/v1/language/value/ordering.d.ts +2 -0
- package/dist/v1/language/value/ordering.js +4 -8
- package/dist/v1/language/value/profile/json.validate.js +1 -1
- package/dist/v1/language/value/profile/rules.js +48 -12
- package/dist/v1/language/value/reference/registry.d.ts +2 -1
- package/dist/v1/language/value/regexp/ast.js +3 -64
- package/dist/v1/language/value/regexp/compile.d.ts +32 -3
- package/dist/v1/language/value/regexp/compile.js +117 -21
- package/dist/v1/language/value/regexp/matcher.d.ts +6 -3
- package/dist/v1/language/value/regexp/matcher.js +185 -28
- package/dist/v1/language/value/regexp/syntax.d.ts +12 -1
- package/dist/v1/language/value/regexp/syntax.js +14 -2
- package/dist/v1/language/value/regexp/unicode.d.ts +32 -0
- package/dist/v1/language/value/regexp/unicode.js +139 -0
- package/dist/v1/language/value/syntax/full-match.js +8 -5
- package/dist/v1/language/value/syntax/node-path/validate.js +4 -6
- package/dist/v1/language/view/model/view.d.ts +2 -4
- package/dist/v1/language/view/resolved.d.ts +2 -2
- package/dist/v1/schema/analysis/class.d.ts +36 -6
- package/dist/v1/schema/analysis/class.js +31 -66
- package/dist/v1/schema/canonical/revision.d.ts +2 -1
- package/dist/v1/schema/canonical/revision.js +4 -1
- package/dist/v1/schema/compatibility/api.d.ts +3 -0
- package/dist/v1/schema/compatibility/api.js +2 -0
- package/dist/v1/schema/compatibility/comparators/callables.d.ts +39 -0
- package/dist/v1/schema/compatibility/comparators/callables.js +101 -0
- package/dist/v1/schema/compatibility/comparators/classes.d.ts +47 -0
- package/dist/v1/schema/compatibility/comparators/classes.js +160 -0
- package/dist/v1/schema/compatibility/comparators/index.d.ts +12 -0
- package/dist/v1/schema/compatibility/comparators/index.js +53 -0
- package/dist/v1/schema/compatibility/comparators/members.d.ts +4 -0
- package/dist/v1/schema/compatibility/comparators/members.js +49 -0
- package/dist/v1/schema/compatibility/comparators/values.d.ts +5 -0
- package/dist/v1/schema/compatibility/comparators/values.js +37 -0
- package/dist/v1/schema/compatibility/compare.d.ts +5 -0
- package/dist/v1/schema/compatibility/compare.js +23 -0
- package/dist/v1/schema/compatibility/context.d.ts +19 -0
- package/dist/v1/schema/compatibility/context.js +49 -0
- package/dist/v1/schema/compatibility/coordinate.d.ts +40 -0
- package/dist/v1/schema/compatibility/coordinate.js +38 -0
- package/dist/v1/schema/compatibility/diff.d.ts +12 -0
- package/dist/v1/schema/compatibility/diff.js +39 -0
- package/dist/v1/schema/compatibility/evidence.d.ts +16 -0
- package/dist/v1/schema/compatibility/evidence.js +62 -0
- package/dist/v1/schema/compatibility/fields.d.ts +194 -0
- package/dist/v1/schema/compatibility/fields.js +94 -0
- package/dist/v1/schema/compatibility/index.d.ts +6 -0
- package/dist/v1/schema/compatibility/index.js +3 -0
- package/dist/v1/schema/compatibility/meaning/footprint.d.ts +7 -0
- package/dist/v1/schema/compatibility/meaning/footprint.js +59 -0
- package/dist/v1/schema/compatibility/meaning/index.d.ts +3 -0
- package/dist/v1/schema/compatibility/meaning/index.js +16 -0
- package/dist/v1/schema/compatibility/model.d.ts +131 -0
- package/dist/v1/schema/compatibility/model.js +1 -0
- package/dist/v1/schema/compatibility/references.d.ts +38 -0
- package/dist/v1/schema/compatibility/references.js +149 -0
- package/dist/v1/schema/compatibility/report.d.ts +27 -0
- package/dist/v1/schema/compatibility/report.js +100 -0
- package/dist/v1/schema/compatibility/scope.d.ts +36 -0
- package/dist/v1/schema/compatibility/scope.js +110 -0
- package/dist/v1/schema/compatibility/structure/index.d.ts +3 -0
- package/dist/v1/schema/compatibility/structure/index.js +40 -0
- package/dist/v1/schema/compatibility/structure/inheritance.d.ts +7 -0
- package/dist/v1/schema/compatibility/structure/inheritance.js +68 -0
- package/dist/v1/schema/compatibility/structure/requirements.d.ts +7 -0
- package/dist/v1/schema/compatibility/structure/requirements.js +97 -0
- package/dist/v1/schema/compatibility/subjects.d.ts +39 -0
- package/dist/v1/schema/compatibility/subjects.js +143 -0
- package/dist/v1/schema/compatibility/versioning/index.d.ts +8 -0
- package/dist/v1/schema/compatibility/versioning/index.js +50 -0
- package/dist/v1/schema/compatibility/versioning/members.d.ts +12 -0
- package/dist/v1/schema/compatibility/versioning/members.js +47 -0
- package/dist/v1/schema/compatibility/versioning/surface.d.ts +11 -0
- package/dist/v1/schema/compatibility/versioning/surface.js +61 -0
- package/dist/v1/schema/diagnostic.d.ts +1 -1
- package/dist/v1/schema/fingerprint.d.ts +2 -0
- package/dist/v1/schema/fingerprint.js +1 -0
- package/dist/v1/schema/index.d.ts +4 -3
- package/dist/v1/schema/index.js +2 -1
- package/dist/v1/schema/model/schema.d.ts +8 -11
- package/dist/v1/schema/normalization/domain.js +57 -13
- package/dist/v1/schema/resolution/definition.index.d.ts +1 -2
- package/dist/v1/schema/resolution/definition.index.js +0 -3
- package/dist/v1/schema/resolution/domain.d.ts +4 -1
- package/dist/v1/schema/resolution/domain.js +26 -18
- package/dist/v1/schema/resolution/origins.d.ts +28 -5
- package/dist/v1/schema/resolution/origins.js +68 -31
- package/dist/v1/schema/validation/callable.d.ts +4 -0
- package/dist/v1/schema/validation/callable.js +39 -0
- package/dist/v1/schema/validation/class.d.ts +10 -0
- package/dist/v1/schema/validation/class.js +79 -60
- package/dist/v1/schema/validation/core.js +83 -55
- package/dist/v1/schema/validation/domain.d.ts +2 -1
- package/dist/v1/schema/validation/domain.js +2 -0
- package/dist/v1/schema/validation/domain.structure.d.ts +0 -2
- package/dist/v1/schema/validation/domain.structure.js +214 -171
- package/dist/v1/schema/validation/policy/budgets.js +36 -6
- package/dist/v1/schema/validation/policy/context.js +5 -16
- package/dist/v1/schema/validation/policy/objects.d.ts +4 -0
- package/dist/v1/schema/validation/policy/objects.js +71 -0
- package/dist/v1/schema/validation/policy/references.js +16 -4
- package/dist/v1/schema/validation/policy/typing.d.ts +2 -0
- package/dist/v1/schema/validation/policy/typing.js +55 -7
- package/dist/v1/schema/validation/policy/uses.js +73 -99
- package/dist/v1/schema/validation/value-api.d.ts +2 -0
- package/dist/v1/schema/validation/value-api.js +1 -0
- package/dist/v1/schema/validation/value.js +7 -1
- package/dist/v1/schema/validation/view.js +14 -9
- package/dist/value/accept.d.ts +9 -0
- package/dist/value/accept.js +106 -7
- package/dist/value/canonical.d.ts +3 -0
- package/dist/value/canonical.js +22 -6
- package/dist/value/immutable.optimization.d.ts +15 -0
- package/dist/value/immutable.optimization.js +34 -0
- package/dist/value/index.d.ts +1 -1
- package/dist/value/index.js +1 -1
- package/dist/value/json.d.ts +1 -1
- package/dist/value/json.js +1 -1
- package/dist/value/limits.d.ts +1 -1
- package/dist/value/unicode.d.ts +4 -1
- package/dist/value/unicode.js +28 -0
- package/package.json +20 -5
- package/dist/v1/schema/compatibility/meaning.d.ts +0 -29
- package/dist/v1/schema/compatibility/meaning.js +0 -605
package/dist/value/accept.js
CHANGED
|
@@ -1,15 +1,53 @@
|
|
|
1
1
|
import { BoundaryError } from './error.js';
|
|
2
|
+
import { includeSnapshot, retainImmutableSnapshot, reusableSnapshot, } from './immutable.optimization.js';
|
|
2
3
|
import { limitsFor } from './limits.js';
|
|
3
|
-
import { assertHostString } from './unicode.js';
|
|
4
|
+
import { assertHostString, canonicalPrimitiveBytes } from './unicode.js';
|
|
4
5
|
/**
|
|
5
6
|
* Admit an unknown host value and return a detached portable snapshot.
|
|
6
7
|
*
|
|
7
8
|
* Every source property is obtained from one descriptor snapshot. Accessors are never invoked.
|
|
8
9
|
*/
|
|
9
10
|
export function accept(input, options) {
|
|
10
|
-
|
|
11
|
+
return snapshot(input, options, 'copy');
|
|
12
|
+
}
|
|
13
|
+
/** Admit a canonically byte-bounded immutable snapshot; owned subtrees may be shared. */
|
|
14
|
+
export function acceptImmutable(input, options) {
|
|
15
|
+
const captured = { propertyRoots: false };
|
|
16
|
+
const value = snapshot(input, options, 'immutable', captured);
|
|
17
|
+
if (value !== null && typeof value === 'object') {
|
|
18
|
+
retainImmutableSnapshot(value, captured.summary);
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
/** Admit a read-only snapshot, sharing owned immutable subtrees without freezing new wrappers. */
|
|
23
|
+
export function acceptForRead(input, options) {
|
|
24
|
+
return snapshot(input, options, 'read');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Private PropertyValues owner seam. Retain immediate recursive values, not the enclosing
|
|
28
|
+
* dictionary: its canonical coordinates are re-admitted by the Property owner on every use.
|
|
29
|
+
*/
|
|
30
|
+
export function acceptPropertyRoot(input) {
|
|
31
|
+
return snapshot(input, undefined, 'immutable', { propertyRoots: true });
|
|
32
|
+
}
|
|
33
|
+
function snapshot(input, options, mode, captured) {
|
|
34
|
+
const state = {
|
|
35
|
+
active: new WeakSet(),
|
|
36
|
+
limits: limitsFor(options),
|
|
37
|
+
members: 0,
|
|
38
|
+
bytes: mode === 'immutable' && !captured?.propertyRoots ? 0 : undefined,
|
|
39
|
+
mode,
|
|
40
|
+
summary: mode === 'immutable' && !captured?.propertyRoots
|
|
41
|
+
? { members: 0, depth: 0, stringBytes: 0, canonicalBytes: 0 }
|
|
42
|
+
: undefined,
|
|
43
|
+
summaryDepth: 0,
|
|
44
|
+
propertyRoots: captured?.propertyRoots ?? false,
|
|
45
|
+
};
|
|
11
46
|
try {
|
|
12
|
-
|
|
47
|
+
const value = admit(input, '', 0, state);
|
|
48
|
+
if (captured !== undefined)
|
|
49
|
+
captured.summary = state.summary;
|
|
50
|
+
return value;
|
|
13
51
|
}
|
|
14
52
|
catch (error) {
|
|
15
53
|
if (error instanceof BoundaryError)
|
|
@@ -18,8 +56,10 @@ export function accept(input, options) {
|
|
|
18
56
|
}
|
|
19
57
|
}
|
|
20
58
|
function admit(input, pointer, depth, state) {
|
|
21
|
-
if (input === null || typeof input === 'boolean')
|
|
59
|
+
if (input === null || typeof input === 'boolean') {
|
|
60
|
+
addCanonicalBytes(state, input === false ? 5 : 4, pointer);
|
|
22
61
|
return input;
|
|
62
|
+
}
|
|
23
63
|
if (typeof input === 'number') {
|
|
24
64
|
if (!Number.isFinite(input)) {
|
|
25
65
|
throw new BoundaryError('VALUE_NUMBER', 'Expected a finite IEEE-754 binary64 number', pointer);
|
|
@@ -27,15 +67,26 @@ function admit(input, pointer, depth, state) {
|
|
|
27
67
|
if (Object.is(input, -0)) {
|
|
28
68
|
throw new BoundaryError('VALUE_NUMBER', 'Negative zero is outside portable JSON', pointer);
|
|
29
69
|
}
|
|
70
|
+
if (state.summary !== undefined || state.bytes !== undefined)
|
|
71
|
+
addCanonicalBytes(state, canonicalPrimitiveBytes(input), pointer);
|
|
30
72
|
return input;
|
|
31
73
|
}
|
|
32
74
|
if (typeof input === 'string') {
|
|
33
|
-
|
|
75
|
+
admitString(input, pointer, state);
|
|
34
76
|
return input;
|
|
35
77
|
}
|
|
36
78
|
if (typeof input !== 'object') {
|
|
37
79
|
throw new BoundaryError('VALUE_TYPE', 'Expected a portable value', pointer);
|
|
38
80
|
}
|
|
81
|
+
if (state.mode !== 'copy' && !(state.propertyRoots && depth === 0)) {
|
|
82
|
+
const summary = reusableSnapshot(input, state.limits, depth, state.members, state.bytes);
|
|
83
|
+
if (summary !== undefined) {
|
|
84
|
+
state.members += summary.members;
|
|
85
|
+
chargeCanonicalBytes(state, summary.canonicalBytes, pointer);
|
|
86
|
+
includeSnapshot(state.summary, summary, depth - state.summaryDepth);
|
|
87
|
+
return input;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
39
90
|
if (state.active.has(input)) {
|
|
40
91
|
throw new BoundaryError('VALUE_CYCLE', 'Cyclic object graphs are not portable values', pointer);
|
|
41
92
|
}
|
|
@@ -43,13 +94,33 @@ function admit(input, pointer, depth, state) {
|
|
|
43
94
|
throw new BoundaryError('VALUE_LIMIT', `Container depth exceeds the ${state.limits.maxDepth}-level limit`, pointer);
|
|
44
95
|
}
|
|
45
96
|
state.active.add(input);
|
|
97
|
+
const parent = state.summary;
|
|
98
|
+
const parentDepth = state.summaryDepth;
|
|
99
|
+
const propertyRoot = state.mode === 'immutable' && state.propertyRoots && depth === 1;
|
|
100
|
+
if (propertyRoot) {
|
|
101
|
+
state.summary = { members: 0, depth: 0, stringBytes: 0, canonicalBytes: 0 };
|
|
102
|
+
state.summaryDepth = depth;
|
|
103
|
+
}
|
|
104
|
+
if (state.summary !== undefined) {
|
|
105
|
+
state.summary.depth = Math.max(state.summary.depth, depth + 1 - state.summaryDepth);
|
|
106
|
+
}
|
|
46
107
|
try {
|
|
47
|
-
|
|
108
|
+
const output = reflect(() => Array.isArray(input), pointer, 'Cannot inspect the host value brand')
|
|
48
109
|
? admitArray(input, pointer, depth + 1, state)
|
|
49
110
|
: admitObject(input, pointer, depth + 1, state);
|
|
111
|
+
if (state.mode === 'immutable') {
|
|
112
|
+
Object.freeze(output);
|
|
113
|
+
if (propertyRoot) {
|
|
114
|
+
retainImmutableSnapshot(output, state.summary);
|
|
115
|
+
includeSnapshot(parent, state.summary, depth - parentDepth);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return output;
|
|
50
119
|
}
|
|
51
120
|
finally {
|
|
52
121
|
state.active.delete(input);
|
|
122
|
+
state.summary = parent;
|
|
123
|
+
state.summaryDepth = parentDepth;
|
|
53
124
|
}
|
|
54
125
|
}
|
|
55
126
|
function admitArray(input, pointer, depth, state) {
|
|
@@ -64,6 +135,9 @@ function admitArray(input, pointer, depth, state) {
|
|
|
64
135
|
if (keys.length !== size + 1 || keys.some((key) => typeof key === 'symbol')) {
|
|
65
136
|
throw new BoundaryError('VALUE_ARRAY', 'Expected a dense Array with no symbol or non-index properties', pointer);
|
|
66
137
|
}
|
|
138
|
+
// Every portable item needs at least one byte; refuse before the detached Array allocation.
|
|
139
|
+
requireCanonicalRoom(state, size === 0 ? 2 : size * 2 + 1, pointer);
|
|
140
|
+
addCanonicalBytes(state, 2 + Math.max(0, size - 1), pointer);
|
|
67
141
|
const output = Array.from({ length: size }, () => null);
|
|
68
142
|
for (let index = 0; index < size; index += 1) {
|
|
69
143
|
const name = String(index);
|
|
@@ -86,13 +160,14 @@ function admitObject(input, pointer, depth, state) {
|
|
|
86
160
|
const descriptors = reflect(() => Object.getOwnPropertyDescriptors(input), pointer, 'Cannot snapshot Object descriptors');
|
|
87
161
|
const keys = Reflect.ownKeys(descriptors);
|
|
88
162
|
addMembers(state, keys.length, pointer);
|
|
163
|
+
addCanonicalBytes(state, 2 + Math.max(0, keys.length - 1) + keys.length, pointer);
|
|
89
164
|
const output = {};
|
|
90
165
|
for (const key of keys) {
|
|
91
166
|
if (typeof key === 'symbol') {
|
|
92
167
|
throw new BoundaryError('VALUE_OBJECT', 'Portable Objects cannot have symbol members', pointer);
|
|
93
168
|
}
|
|
94
169
|
const memberPointer = child(pointer, key);
|
|
95
|
-
|
|
170
|
+
admitString(key, memberPointer, state);
|
|
96
171
|
const descriptor = ownDescriptor(descriptors, key);
|
|
97
172
|
if (descriptor === undefined || !descriptor.enumerable || !('value' in descriptor)) {
|
|
98
173
|
throw new BoundaryError('VALUE_OBJECT', 'Object members must be enumerable data properties', memberPointer);
|
|
@@ -115,10 +190,34 @@ function ownDescriptor(descriptors, name) {
|
|
|
115
190
|
}
|
|
116
191
|
function addMembers(state, count, pointer) {
|
|
117
192
|
state.members += count;
|
|
193
|
+
if (state.summary !== undefined)
|
|
194
|
+
state.summary.members += count;
|
|
118
195
|
if (state.members > state.limits.maxMembers) {
|
|
119
196
|
throw new BoundaryError('VALUE_LIMIT', `Value exceeds the ${state.limits.maxMembers}-member limit`, pointer);
|
|
120
197
|
}
|
|
121
198
|
}
|
|
199
|
+
function admitString(value, pointer, state) {
|
|
200
|
+
const bytes = assertHostString(value, pointer, state.limits.maxStringBytes);
|
|
201
|
+
if (state.summary !== undefined) {
|
|
202
|
+
state.summary.stringBytes = Math.max(state.summary.stringBytes, bytes);
|
|
203
|
+
}
|
|
204
|
+
if (state.summary !== undefined || state.bytes !== undefined)
|
|
205
|
+
addCanonicalBytes(state, canonicalPrimitiveBytes(value), pointer);
|
|
206
|
+
}
|
|
207
|
+
function requireCanonicalRoom(state, bytes, pointer) {
|
|
208
|
+
if (state.bytes !== undefined && bytes > state.limits.maxBytes - state.bytes)
|
|
209
|
+
throw new BoundaryError('VALUE_LIMIT', `Canonical JSON exceeds the ${state.limits.maxBytes}-byte limit`, pointer);
|
|
210
|
+
}
|
|
211
|
+
function chargeCanonicalBytes(state, bytes, pointer) {
|
|
212
|
+
requireCanonicalRoom(state, bytes, pointer);
|
|
213
|
+
if (state.bytes !== undefined)
|
|
214
|
+
state.bytes += bytes;
|
|
215
|
+
}
|
|
216
|
+
function addCanonicalBytes(state, bytes, pointer) {
|
|
217
|
+
chargeCanonicalBytes(state, bytes, pointer);
|
|
218
|
+
if (state.summary !== undefined)
|
|
219
|
+
state.summary.canonicalBytes += bytes;
|
|
220
|
+
}
|
|
122
221
|
function reflect(operation, pointer, message) {
|
|
123
222
|
try {
|
|
124
223
|
return operation();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { Value } from './types.js';
|
|
1
2
|
import { type Options } from './limits.js';
|
|
2
3
|
/** RFC 8785 canonical JSON for one admitted portable snapshot. */
|
|
3
4
|
export declare function serialize(input: unknown, options?: Options): string;
|
|
5
|
+
/** Serialize a trusted portable value whose default structural admission proof is still valid. */
|
|
6
|
+
export declare function serializeAdmitted(input: Value): string;
|
|
4
7
|
export declare function encode(input: unknown, options?: Options): Uint8Array;
|
package/dist/value/canonical.js
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { acceptForRead } from './accept.js';
|
|
2
2
|
import { BoundaryError } from './error.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { immutableSnapshotBytes } from './immutable.optimization.js';
|
|
4
|
+
import { defaultLimits, limitsFor } from './limits.js';
|
|
5
|
+
import { canonicalPrimitiveBytes, utf8Length } from './unicode.js';
|
|
5
6
|
const encoder = new TextEncoder();
|
|
6
7
|
/** RFC 8785 canonical JSON for one admitted portable snapshot. */
|
|
7
8
|
export function serialize(input, options) {
|
|
8
9
|
const limits = limitsFor(options);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
return serializeSnapshot(acceptForRead(input, options), limits.maxBytes);
|
|
11
|
+
}
|
|
12
|
+
/** Serialize a trusted portable value whose default structural admission proof is still valid. */
|
|
13
|
+
export function serializeAdmitted(input) {
|
|
14
|
+
return serializeSnapshot(input, defaultLimits.maxBytes);
|
|
15
|
+
}
|
|
16
|
+
function serializeSnapshot(input, maxBytes) {
|
|
17
|
+
const bytes = input !== null && typeof input === 'object'
|
|
18
|
+
? immutableSnapshotBytes(input)
|
|
19
|
+
: canonicalPrimitiveBytes(input);
|
|
20
|
+
if (bytes !== undefined && bytes > maxBytes)
|
|
21
|
+
throw new BoundaryError('VALUE_LIMIT', `Canonical JSON exceeds the ${maxBytes}-byte limit`);
|
|
22
|
+
const output = serializeValue(input);
|
|
23
|
+
// Scalar text uses at most three UTF-8 bytes per UTF-16 code unit, including JSON escapes.
|
|
24
|
+
if (bytes === undefined &&
|
|
25
|
+
output.length > maxBytes / 3 &&
|
|
26
|
+
utf8Length(output, maxBytes) > maxBytes) {
|
|
27
|
+
throw new BoundaryError('VALUE_LIMIT', `Canonical JSON exceeds the ${maxBytes}-byte limit`);
|
|
12
28
|
}
|
|
13
29
|
return output;
|
|
14
30
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Limits } from './limits.js';
|
|
2
|
+
export interface SnapshotSummary {
|
|
3
|
+
members: number;
|
|
4
|
+
depth: number;
|
|
5
|
+
stringBytes: number;
|
|
6
|
+
canonicalBytes: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function isImmutableSnapshot(value: object): boolean;
|
|
9
|
+
/** Exact complete representation size, only for roots retained by this admission owner. */
|
|
10
|
+
export declare function immutableSnapshotBytes(value: object): number | undefined;
|
|
11
|
+
/** Called only after admission has constructed and deeply frozen this container. */
|
|
12
|
+
export declare function retainImmutableSnapshot(value: object, summary: SnapshotSummary): void;
|
|
13
|
+
export declare function includeSnapshot(parent: SnapshotSummary | undefined, child: SnapshotSummary, depth: number): void;
|
|
14
|
+
/** A failed fit must use normal admission, preserving its exact error pointer. */
|
|
15
|
+
export declare function reusableSnapshot(value: object, limits: Limits, depth: number, members: number, bytes: number | undefined): SnapshotSummary | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Only admission-owned, deeply immutable snapshots enter this table. A frozen
|
|
2
|
+
// caller object is not a proof. Weak identity ownership retains no caller data.
|
|
3
|
+
const snapshots = new WeakMap();
|
|
4
|
+
export function isImmutableSnapshot(value) {
|
|
5
|
+
return snapshots.has(value);
|
|
6
|
+
}
|
|
7
|
+
/** Exact complete representation size, only for roots retained by this admission owner. */
|
|
8
|
+
export function immutableSnapshotBytes(value) {
|
|
9
|
+
return snapshots.get(value)?.canonicalBytes;
|
|
10
|
+
}
|
|
11
|
+
/** Called only after admission has constructed and deeply frozen this container. */
|
|
12
|
+
export function retainImmutableSnapshot(value, summary) {
|
|
13
|
+
if (!snapshots.has(value))
|
|
14
|
+
snapshots.set(value, summary);
|
|
15
|
+
}
|
|
16
|
+
export function includeSnapshot(parent, child, depth) {
|
|
17
|
+
if (parent === undefined)
|
|
18
|
+
return;
|
|
19
|
+
parent.members += child.members;
|
|
20
|
+
parent.depth = Math.max(parent.depth, depth + child.depth);
|
|
21
|
+
parent.stringBytes = Math.max(parent.stringBytes, child.stringBytes);
|
|
22
|
+
parent.canonicalBytes += child.canonicalBytes;
|
|
23
|
+
}
|
|
24
|
+
/** A failed fit must use normal admission, preserving its exact error pointer. */
|
|
25
|
+
export function reusableSnapshot(value, limits, depth, members, bytes) {
|
|
26
|
+
const summary = snapshots.get(value);
|
|
27
|
+
if (summary === undefined ||
|
|
28
|
+
summary.members > limits.maxMembers - members ||
|
|
29
|
+
summary.depth > limits.maxDepth - depth ||
|
|
30
|
+
summary.stringBytes > limits.maxStringBytes ||
|
|
31
|
+
(bytes !== undefined && summary.canonicalBytes > limits.maxBytes - bytes))
|
|
32
|
+
return undefined;
|
|
33
|
+
return summary;
|
|
34
|
+
}
|
package/dist/value/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Portable values shared by the DSL and kernel contracts. */
|
|
2
|
-
export { accept } from './accept.js';
|
|
2
|
+
export { accept, acceptForRead, acceptImmutable } from './accept.js';
|
|
3
3
|
export { equal } from './equal.js';
|
|
4
4
|
export { BoundaryError, DecodeError } from './error.js';
|
|
5
5
|
export type { BoundaryErrorCode, DecodeErrorCode } from './error.js';
|
package/dist/value/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Portable values shared by the DSL and kernel contracts. */
|
|
2
|
-
export { accept } from './accept.js';
|
|
2
|
+
export { accept, acceptForRead, acceptImmutable } from './accept.js';
|
|
3
3
|
export { equal } from './equal.js';
|
|
4
4
|
export { BoundaryError, DecodeError } from './error.js';
|
|
5
5
|
export { defaultLimits } from './limits.js';
|
package/dist/value/json.d.ts
CHANGED
package/dist/value/json.js
CHANGED
package/dist/value/limits.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface Limits {
|
|
2
|
-
/** Maximum UTF-8 size
|
|
2
|
+
/** Maximum wire UTF-8 size, also bounding the complete canonical immutable capture. */
|
|
3
3
|
readonly maxBytes: number;
|
|
4
4
|
/** Maximum number of nested Array/Object containers, with a root container at depth one. */
|
|
5
5
|
readonly maxDepth: number;
|
package/dist/value/unicode.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { Primitive } from './types.js';
|
|
2
|
+
/** Exact canonical scalar spelling after the same owner has established portable input. */
|
|
3
|
+
export declare function canonicalPrimitiveBytes(value: Primitive): number;
|
|
1
4
|
export declare function utf8Length(value: string, max?: number): number;
|
|
2
|
-
export declare function assertHostString(value: string, pointer: string, maxBytes: number):
|
|
5
|
+
export declare function assertHostString(value: string, pointer: string, maxBytes: number): number;
|
|
3
6
|
export declare function assertDecodedString(value: string, offset: number, maxBytes: number): void;
|
|
4
7
|
export declare function assertSourceString(value: string, maxBytes: number): void;
|
package/dist/value/unicode.js
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
import { BoundaryError, DecodeError } from './error.js';
|
|
2
|
+
/** Exact canonical scalar spelling after the same owner has established portable input. */
|
|
3
|
+
export function canonicalPrimitiveBytes(value) {
|
|
4
|
+
if (typeof value !== 'string') {
|
|
5
|
+
if (typeof value === 'number')
|
|
6
|
+
return JSON.stringify(value).length;
|
|
7
|
+
return value === false ? 5 : 4;
|
|
8
|
+
}
|
|
9
|
+
let bytes = 2;
|
|
10
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
11
|
+
const unit = value.charCodeAt(index);
|
|
12
|
+
if (unit < 0x20)
|
|
13
|
+
bytes += unit === 8 || unit === 9 || unit === 10 || unit === 12 || unit === 13 ? 2 : 6;
|
|
14
|
+
else if (unit === 0x22 || unit === 0x5c)
|
|
15
|
+
bytes += 2;
|
|
16
|
+
else if (unit <= 0x7f)
|
|
17
|
+
bytes += 1;
|
|
18
|
+
else if (unit <= 0x7ff)
|
|
19
|
+
bytes += 2;
|
|
20
|
+
else if (isHighSurrogate(unit)) {
|
|
21
|
+
bytes += 4;
|
|
22
|
+
index += 1;
|
|
23
|
+
}
|
|
24
|
+
else
|
|
25
|
+
bytes += 3;
|
|
26
|
+
}
|
|
27
|
+
return bytes;
|
|
28
|
+
}
|
|
2
29
|
export function utf8Length(value, max = Number.MAX_SAFE_INTEGER) {
|
|
3
30
|
let bytes = 0;
|
|
4
31
|
for (let index = 0; index < value.length; index += 1) {
|
|
@@ -34,6 +61,7 @@ export function assertHostString(value, pointer, maxBytes) {
|
|
|
34
61
|
if (length > maxBytes) {
|
|
35
62
|
throw new BoundaryError('VALUE_LIMIT', `String exceeds the ${maxBytes}-byte UTF-8 limit`, pointer);
|
|
36
63
|
}
|
|
64
|
+
return length;
|
|
37
65
|
}
|
|
38
66
|
export function assertDecodedString(value, offset, maxBytes) {
|
|
39
67
|
if (value.includes('\u0000')) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-dsl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"description": "Astrale Kernel DSL - Schema authoring, inference, and IR serialization",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"types": "./dist/v1/compiled/index.d.ts",
|
|
44
44
|
"import": "./dist/v1/compiled/index.js"
|
|
45
45
|
},
|
|
46
|
+
"./v1/compiled/generated": {
|
|
47
|
+
"types": "./dist/v1/compiled/generated.d.ts",
|
|
48
|
+
"import": "./dist/v1/compiled/generated.js"
|
|
49
|
+
},
|
|
46
50
|
"./v1/compiled/loader": {
|
|
47
51
|
"types": "./dist/v1/compiled/loader/index.d.ts",
|
|
48
52
|
"import": "./dist/v1/compiled/loader/index.js"
|
|
@@ -55,10 +59,22 @@
|
|
|
55
59
|
"types": "./dist/v1/language/index.d.ts",
|
|
56
60
|
"import": "./dist/v1/language/index.js"
|
|
57
61
|
},
|
|
62
|
+
"./v1/language/state": {
|
|
63
|
+
"types": "./dist/v1/language/state/index.d.ts",
|
|
64
|
+
"import": "./dist/v1/language/state/index.js"
|
|
65
|
+
},
|
|
58
66
|
"./v1/schema": {
|
|
59
67
|
"types": "./dist/v1/schema/index.d.ts",
|
|
60
68
|
"import": "./dist/v1/schema/index.js"
|
|
61
69
|
},
|
|
70
|
+
"./v1/schema/compatibility": {
|
|
71
|
+
"types": "./dist/v1/schema/compatibility/api.d.ts",
|
|
72
|
+
"import": "./dist/v1/schema/compatibility/api.js"
|
|
73
|
+
},
|
|
74
|
+
"./v1/schema/fingerprint": {
|
|
75
|
+
"types": "./dist/v1/schema/fingerprint.d.ts",
|
|
76
|
+
"import": "./dist/v1/schema/fingerprint.js"
|
|
77
|
+
},
|
|
62
78
|
"./v1/schema/revision": {
|
|
63
79
|
"types": "./dist/v1/schema/revision.d.ts",
|
|
64
80
|
"import": "./dist/v1/schema/revision.js"
|
|
@@ -87,7 +103,7 @@
|
|
|
87
103
|
"ajv": "^8.20.0",
|
|
88
104
|
"re2js": "2.8.6",
|
|
89
105
|
"typescript": "~6.0.3",
|
|
90
|
-
"vitest": "^
|
|
106
|
+
"vitest": "^5.0.1",
|
|
91
107
|
"yaml": "2.9.0"
|
|
92
108
|
},
|
|
93
109
|
"scripts": {
|
|
@@ -97,11 +113,10 @@
|
|
|
97
113
|
"generate:value-schema-validator": "node scripts/generate-value-schema-meta-validator.mjs",
|
|
98
114
|
"layout:check": "node scripts/check-layout.mjs",
|
|
99
115
|
"spec:typecheck": "tsgo --noEmit -p tsconfig.spec.json",
|
|
100
|
-
"typecheck": "tsgo --noEmit && tsgo --noEmit -p tsconfig.types.json",
|
|
116
|
+
"typecheck": "tsgo --noEmit && tsgo --noEmit -p tsconfig.types.json && tsgo -p tsconfig.workers.json",
|
|
101
117
|
"test": "pnpm run conformance && pnpm run layout:check && vitest run",
|
|
102
118
|
"test:file": "vitest run",
|
|
103
119
|
"test:semantic-lock": "pnpm run conformance && pnpm run layout:check && vitest run",
|
|
104
|
-
"test:watch": "vitest"
|
|
105
|
-
"preinstall": "node -e \"try{require('./.check-workspace.cjs')}catch{}\""
|
|
120
|
+
"test:watch": "vitest"
|
|
106
121
|
}
|
|
107
122
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Key as SemanticKey } from '../../addressing/index.js';
|
|
2
|
-
import type { Revision } from '../../addressing/index.js';
|
|
3
|
-
import type { DomainSchema } from '../model/schema.js';
|
|
4
|
-
import { Key } from '../../addressing/index.js';
|
|
5
|
-
export type DependencyMeaningChangeKind = 'missing' | 'changed';
|
|
6
|
-
export type MeaningFingerprint = `sha256:${string}`;
|
|
7
|
-
export interface DependencyMeaningChange {
|
|
8
|
-
readonly key: SemanticKey;
|
|
9
|
-
readonly kind: DependencyMeaningChangeKind;
|
|
10
|
-
readonly sourceFingerprint: MeaningFingerprint;
|
|
11
|
-
readonly targetFingerprint?: MeaningFingerprint;
|
|
12
|
-
}
|
|
13
|
-
export interface DependencyMeaningComparison {
|
|
14
|
-
readonly version: 1;
|
|
15
|
-
readonly dependency: Key.Origin;
|
|
16
|
-
readonly source: Revision;
|
|
17
|
-
readonly target: Revision;
|
|
18
|
-
readonly footprint: readonly SemanticKey[];
|
|
19
|
-
readonly changes: readonly DependencyMeaningChange[];
|
|
20
|
-
readonly fingerprint: MeaningFingerprint;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Compare the exact V1 meaning one accepted Domain used from a retained dependency with a
|
|
24
|
-
* candidate revision of that same dependency origin. This operation is pure and makes no
|
|
25
|
-
* lifecycle-compatibility decision.
|
|
26
|
-
*/
|
|
27
|
-
export declare function compareDependencyMeaning(dependent: DomainSchema, target: DomainSchema): DependencyMeaningComparison;
|
|
28
|
-
/** Compare one explicit non-empty source member surface and its reachable V1 meaning. */
|
|
29
|
-
export declare function compareMemberMeaning(source: DomainSchema, target: DomainSchema, roots: readonly [SemanticKey, ...SemanticKey[]]): DependencyMeaningComparison;
|