@astrale-os/kernel-dsl 1.0.0-beta.31 → 1.0.0-beta.32

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.
Files changed (69) hide show
  1. package/dist/v1/builder/callable/authoring.d.ts +2 -2
  2. package/dist/v1/builder/class/authoring.js +0 -1
  3. package/dist/v1/builder/class/input.d.ts +3 -5
  4. package/dist/v1/builder/index.d.ts +1 -1
  5. package/dist/v1/builder/lowering/class.js +0 -5
  6. package/dist/v1/builder/lowering/policy.js +24 -6
  7. package/dist/v1/builder/policy/authoring.d.ts +33 -7
  8. package/dist/v1/builder/policy/authoring.js +5 -2
  9. package/dist/v1/builder/policy/legacy/inputs.d.ts +8 -0
  10. package/dist/v1/builder/policy/legacy/inputs.js +1 -0
  11. package/dist/v1/compiled/admission/semantics/class.js +0 -15
  12. package/dist/v1/compiled/admission/semantics/context.d.ts +1 -2
  13. package/dist/v1/compiled/admission/semantics/policy/callable.js +2 -2
  14. package/dist/v1/compiled/admission/semantics/policy/parity.js +26 -3
  15. package/dist/v1/compiled/admission/semantics/policy/typing.js +2 -0
  16. package/dist/v1/compiled/admission/wire/class.js +1 -10
  17. package/dist/v1/compiled/admission/wire/policy.js +21 -1
  18. package/dist/v1/compiled/rule.js +0 -1
  19. package/dist/v1/domain/projection/classes.js +0 -8
  20. package/dist/v1/index.d.ts +1 -1
  21. package/dist/v1/language/callable/admission.js +5 -3
  22. package/dist/v1/language/class/model/class.d.ts +1 -2
  23. package/dist/v1/language/class/resolved.d.ts +0 -7
  24. package/dist/v1/language/index.d.ts +1 -2
  25. package/dist/v1/language/index.js +1 -1
  26. package/dist/v1/language/limits.d.ts +2 -0
  27. package/dist/v1/language/limits.js +2 -0
  28. package/dist/v1/language/policy/analysis/branches.d.ts +1 -1
  29. package/dist/v1/language/policy/analysis/branches.js +6 -0
  30. package/dist/v1/language/policy/analysis/budgets.d.ts +4 -2
  31. package/dist/v1/language/policy/analysis/budgets.js +18 -3
  32. package/dist/v1/language/policy/analysis/checks.d.ts +5 -2
  33. package/dist/v1/language/policy/analysis/checks.js +12 -11
  34. package/dist/v1/language/policy/analysis/typing.d.ts +15 -2
  35. package/dist/v1/language/policy/analysis/typing.js +106 -4
  36. package/dist/v1/language/policy/model/policy.d.ts +13 -0
  37. package/dist/v1/language/policy/model/policy.js +4 -0
  38. package/dist/v1/language/policy/normalization/normalize.js +9 -2
  39. package/dist/v1/schema/.spec/schemas/domain-schema.schema.json +106 -16
  40. package/dist/v1/schema/analysis/class.d.ts +0 -8
  41. package/dist/v1/schema/analysis/class.js +0 -28
  42. package/dist/v1/schema/compatibility/comparators/classes.d.ts +1 -1
  43. package/dist/v1/schema/compatibility/comparators/classes.js +1 -11
  44. package/dist/v1/schema/compatibility/evidence.js +12 -2
  45. package/dist/v1/schema/compatibility/fields.d.ts +2 -2
  46. package/dist/v1/schema/compatibility/fields.js +1 -1
  47. package/dist/v1/schema/diagnostic.d.ts +1 -1
  48. package/dist/v1/schema/enforcement/changes.d.ts +0 -6
  49. package/dist/v1/schema/enforcement/changes.js +0 -6
  50. package/dist/v1/schema/enforcement/derived.d.ts +0 -6
  51. package/dist/v1/schema/enforcement/derived.js +0 -6
  52. package/dist/v1/schema/enforcement/fields.d.ts +0 -1
  53. package/dist/v1/schema/enforcement/fields.js +0 -1
  54. package/dist/v1/schema/enforcement/write.d.ts +0 -7
  55. package/dist/v1/schema/enforcement/write.js +0 -7
  56. package/dist/v1/schema/normalization/domain.js +1 -1
  57. package/dist/v1/schema/resolution/origins.js +7 -2
  58. package/dist/v1/schema/rule.js +3 -7
  59. package/dist/v1/schema/validation/domain.structure.d.ts +5 -3
  60. package/dist/v1/schema/validation/domain.structure.js +3 -5
  61. package/dist/v1/schema/validation/policy/budgets.js +2 -1
  62. package/dist/v1/schema/validation/policy/context.d.ts +1 -0
  63. package/dist/v1/schema/validation/policy/context.js +3 -0
  64. package/dist/v1/schema/validation/policy/references.js +4 -1
  65. package/dist/v1/schema/validation/policy/typing.js +6 -0
  66. package/dist/v1/schema/validation/policy/uses.js +24 -2
  67. package/package.json +1 -1
  68. package/dist/v1/language/class/model/data.d.ts +0 -11
  69. package/dist/v1/language/class/model/data.js +0 -2
@@ -401,6 +401,28 @@
401
401
  ],
402
402
  "additionalProperties": false
403
403
  },
404
+ {
405
+ "type": "object",
406
+ "properties": {
407
+ "check": {
408
+ "$ref": "#/$defs/policy-ref"
409
+ },
410
+ "input": {
411
+ "type": "object",
412
+ "propertyNames": {
413
+ "$ref": "#/$defs/name"
414
+ },
415
+ "additionalProperties": {
416
+ "$ref": "#/$defs/class-rule-object"
417
+ }
418
+ }
419
+ },
420
+ "required": [
421
+ "check",
422
+ "input"
423
+ ],
424
+ "additionalProperties": false
425
+ },
404
426
  {
405
427
  "type": "object",
406
428
  "properties": {
@@ -686,6 +708,42 @@
686
708
  ],
687
709
  "additionalProperties": false
688
710
  },
711
+ {
712
+ "type": "object",
713
+ "properties": {
714
+ "check": {
715
+ "$ref": "#/$defs/policy-ref"
716
+ },
717
+ "input": {
718
+ "type": "object",
719
+ "propertyNames": {
720
+ "$ref": "#/$defs/name"
721
+ },
722
+ "additionalProperties": {
723
+ "type": "object",
724
+ "properties": {
725
+ "kind": {
726
+ "type": "string",
727
+ "const": "ref"
728
+ },
729
+ "ref": {
730
+ "$ref": "#/$defs/projected-member-ref"
731
+ }
732
+ },
733
+ "required": [
734
+ "kind",
735
+ "ref"
736
+ ],
737
+ "additionalProperties": false
738
+ }
739
+ }
740
+ },
741
+ "required": [
742
+ "check",
743
+ "input"
744
+ ],
745
+ "additionalProperties": false
746
+ },
689
747
  {
690
748
  "type": "object",
691
749
  "properties": {
@@ -1297,10 +1355,6 @@
1297
1355
  }
1298
1356
  ]
1299
1357
  },
1300
- "media-type": {
1301
- "type": "string",
1302
- "pattern": "^[a-z0-9][a-z0-9!#$&^_.+-]{0,126}\\/[a-z0-9][a-z0-9!#$&^_.+-]{0,126}$"
1303
- },
1304
1358
  "method-address": {
1305
1359
  "type": "object",
1306
1360
  "properties": {
@@ -1434,18 +1488,6 @@
1434
1488
  "methods": {
1435
1489
  "$ref": "#/$defs/method-record"
1436
1490
  },
1437
- "data": {
1438
- "type": "object",
1439
- "properties": {
1440
- "mediaType": {
1441
- "$ref": "#/$defs/media-type"
1442
- }
1443
- },
1444
- "required": [
1445
- "mediaType"
1446
- ],
1447
- "additionalProperties": false
1448
- },
1449
1491
  "icon": {
1450
1492
  "$ref": "#/$defs/icon"
1451
1493
  },
@@ -1661,6 +1703,28 @@
1661
1703
  ],
1662
1704
  "additionalProperties": false
1663
1705
  },
1706
+ {
1707
+ "type": "object",
1708
+ "properties": {
1709
+ "check": {
1710
+ "$ref": "#/$defs/policy-ref"
1711
+ },
1712
+ "input": {
1713
+ "type": "object",
1714
+ "propertyNames": {
1715
+ "$ref": "#/$defs/name"
1716
+ },
1717
+ "additionalProperties": {
1718
+ "$ref": "#/$defs/policy-check-object"
1719
+ }
1720
+ }
1721
+ },
1722
+ "required": [
1723
+ "check",
1724
+ "input"
1725
+ ],
1726
+ "additionalProperties": false
1727
+ },
1664
1728
  {
1665
1729
  "type": "object",
1666
1730
  "properties": {
@@ -1800,6 +1864,15 @@
1800
1864
  }
1801
1865
  ]
1802
1866
  },
1867
+ "input": {
1868
+ "type": "object",
1869
+ "propertyNames": {
1870
+ "$ref": "#/$defs/name"
1871
+ },
1872
+ "additionalProperties": {
1873
+ "$ref": "#/$defs/class-ref"
1874
+ }
1875
+ },
1803
1876
  "description": {
1804
1877
  "$ref": "#/$defs/description"
1805
1878
  }
@@ -1939,6 +2012,23 @@
1939
2012
  ],
1940
2013
  "additionalProperties": false
1941
2014
  },
2015
+ {
2016
+ "type": "object",
2017
+ "properties": {
2018
+ "kind": {
2019
+ "type": "string",
2020
+ "const": "input"
2021
+ },
2022
+ "name": {
2023
+ "$ref": "#/$defs/name"
2024
+ }
2025
+ },
2026
+ "required": [
2027
+ "kind",
2028
+ "name"
2029
+ ],
2030
+ "additionalProperties": false
2031
+ },
1942
2032
  {
1943
2033
  "type": "object",
1944
2034
  "properties": {
@@ -1,7 +1,6 @@
1
1
  import type { ClassRef } from '../../addressing/index.js';
2
2
  import type { MethodDefinition } from '../../language/callable/model/callable.js';
3
3
  import type { ClassDefinition } from '../../language/class/model/class.js';
4
- import type { DataDefinition } from '../../language/class/model/data.js';
5
4
  import type { PropertyAuto, PropertyImmutability } from '../../language/class/model/property.js';
6
5
  import type { StateTopology } from '../../language/state/index.js';
7
6
  import type { JsonSchema } from '../../language/value/model/schema.js';
@@ -25,16 +24,10 @@ export interface EffectiveMethod {
25
24
  readonly name: string;
26
25
  readonly declaration: MethodDefinition;
27
26
  }
28
- interface EffectiveData {
29
- readonly identity: string;
30
- readonly owner: ClassRef;
31
- readonly declaration: DataDefinition;
32
- }
33
27
  export interface DefinitionAnalysis extends MethodComposition<EffectiveMethod> {
34
28
  readonly ref: ClassRef;
35
29
  readonly declaration: ClassDefinition;
36
30
  readonly properties: ReadonlyMap<PropertyKey, EffectiveField>;
37
- readonly data?: EffectiveData;
38
31
  }
39
32
  export interface DefinitionAnalysisResult {
40
33
  readonly definitions: ReadonlyMap<string, DefinitionAnalysis>;
@@ -72,4 +65,3 @@ export declare function methodSignature(value: MethodDefinition): {
72
65
  durable: boolean;
73
66
  } | undefined;
74
67
  };
75
- export {};
@@ -65,13 +65,11 @@ export function analyzeDefinitions(environment) {
65
65
  return analysis === undefined ? [] : [analysis];
66
66
  });
67
67
  const properties = mergeFields(parentAnalyses.map((parent) => parent.properties), ownFields(ref, declaration));
68
- const data = mergeData(ref, declaration, parentAnalyses, report);
69
68
  const methods = mergeMethods(ref, declaration, parentAnalyses, report);
70
69
  const analysis = {
71
70
  ref,
72
71
  declaration,
73
72
  properties,
74
- ...(data === undefined ? {} : { data }),
75
73
  ...methods,
76
74
  };
77
75
  result.set(key, analysis);
@@ -113,32 +111,6 @@ function mergeFields(inherited, own) {
113
111
  }
114
112
  return result;
115
113
  }
116
- function mergeData(owner, declaration, parents, report) {
117
- let effective;
118
- for (const parent of parents) {
119
- if (parent.data === undefined)
120
- continue;
121
- if (effective === undefined) {
122
- effective = parent.data;
123
- continue;
124
- }
125
- if (effective.identity !== parent.data.identity) {
126
- const index = declaration.extends.findIndex((ref) => definitionRefIndex(ref) === definitionRefIndex(parent.ref));
127
- report('DV_DATA_COMPOSITION', `/extends/${index}`, `Data has distinct declaring owners ${formatDefinitionRef(effective.owner)} and ${formatDefinitionRef(parent.data.owner)}.`);
128
- }
129
- }
130
- const own = 'data' in declaration ? declaration.data : undefined;
131
- if (own === undefined)
132
- return effective;
133
- if (effective !== undefined) {
134
- report('DV_DATA_COMPOSITION', '/data', `Data redeclares the inherited contract from ${formatDefinitionRef(effective.owner)}.`);
135
- }
136
- return {
137
- identity: `${definitionRefIndex(owner)}\u0000data`,
138
- owner,
139
- declaration: own,
140
- };
141
- }
142
114
  function mergeMethods(owner, declaration, parents, report) {
143
115
  const own = new Map(Object.entries('methods' in declaration ? declaration.methods : {}).map(([name, method]) => [
144
116
  name,
@@ -14,7 +14,7 @@ interface ClassRequirement {
14
14
  * A reference needs the Class to exist with its kind, abstractness and orientation, and, for an
15
15
  * Edge, the uniqueness tuples that cover it, its ancestors' included: a dependent may name one of
16
16
  * its Edges by any of them. Inheritance additionally takes on the source ancestors, class
17
- * policies, data contract and, for an Edge, the endpoint and constraint contracts. A target
17
+ * policies and, for an Edge, the endpoint and constraint contracts. A target
18
18
  * projected onto a source requirement keeps only the ancestors the source named, so a superset
19
19
  * satisfies it while a removal changes it.
20
20
  */
@@ -12,7 +12,7 @@ import { semanticValueSchema } from './values.js';
12
12
  * A reference needs the Class to exist with its kind, abstractness and orientation, and, for an
13
13
  * Edge, the uniqueness tuples that cover it, its ancestors' included: a dependent may name one of
14
14
  * its Edges by any of them. Inheritance additionally takes on the source ancestors, class
15
- * policies, data contract and, for an Edge, the endpoint and constraint contracts. A target
15
+ * policies and, for an Edge, the endpoint and constraint contracts. A target
16
16
  * projected onto a source requirement keeps only the ancestors the source named, so a superset
17
17
  * satisfies it while a removal changes it.
18
18
  */
@@ -36,16 +36,6 @@ export function classMeaning(context, coordinate, level, onto) {
36
36
  policies: Object.fromEntries(Object.entries(declaration.policies)
37
37
  .filter(([, policy]) => policy !== undefined)
38
38
  .map(([role, policy]) => [role, classPolicyMeaning(policy)])),
39
- ...(declaration.kind === 'node'
40
- ? {
41
- data: analysis.data === undefined
42
- ? null
43
- : {
44
- owner: keyForDefinitionRef(analysis.data.owner),
45
- declaration: analysis.data.declaration,
46
- },
47
- }
48
- : {}),
49
39
  ...(covering.length === 0 ? {} : { unique: covering }),
50
40
  };
51
41
  const meaning = {
@@ -24,8 +24,8 @@ export function evidenceOf({ kind, version, scope, entries, assessments, }) {
24
24
  .map((observation) => [
25
25
  entry.subject.key,
26
26
  evidenceFacet(observation.facet),
27
- observation.before === undefined ? null : fingerprintMeaning(observation.before),
28
- observation.after === undefined ? null : fingerprintMeaning(observation.after),
27
+ evidenceMeaning(observation.facet, observation.before),
28
+ evidenceMeaning(observation.facet, observation.after),
29
29
  ])),
30
30
  assessments: [...assessments]
31
31
  .sort((a, b) => compareUnicode(`${a.subject.key}#${evidenceFacet(a.observation.facet)}`, `${b.subject.key}#${evidenceFacet(b.observation.facet)}`) ||
@@ -47,6 +47,16 @@ export function evidenceOf({ kind, version, scope, entries, assessments, }) {
47
47
  export function losesProperties({ entries }) {
48
48
  return entries.some(({ observations }) => observations.some(({ facet }) => facet === 'class.properties'));
49
49
  }
50
+ /**
51
+ * The inherited meaning of a Node Class kept a data facet, which no schema declares any more: it is
52
+ * always `null`, and evidence keeps it so the same inputs keep their fingerprint.
53
+ */
54
+ function evidenceMeaning(facet, meaning) {
55
+ if (meaning === undefined)
56
+ return null;
57
+ const node = facet === 'class.inherit' && meaning.kind === 'node';
58
+ return fingerprintMeaning(node ? { ...meaning, data: null } : meaning);
59
+ }
50
60
  /** Version-1 evidence keeps its original tags independently of public facet names. */
51
61
  function evidenceFacet(facet) {
52
62
  switch (facet) {
@@ -30,7 +30,6 @@ export declare const CLASS_FIELDS: Readonly<{
30
30
  orientation: "always";
31
31
  extends: "inherit";
32
32
  policies: "inherit";
33
- data: "inherit";
34
33
  endpoints: "inherit";
35
34
  constraints: "inherit";
36
35
  unique: "always";
@@ -87,6 +86,7 @@ export declare const POLICY_FIELDS: Readonly<{
87
86
  excluded: 'identity';
88
87
  }>;
89
88
  expression: "always";
89
+ input: "always";
90
90
  description: Readonly<{
91
91
  excluded: 'annotation';
92
92
  }>;
@@ -129,7 +129,6 @@ export declare const FIELD_ROLES: Readonly<{
129
129
  orientation: "always";
130
130
  extends: "inherit";
131
131
  policies: "inherit";
132
- data: "inherit";
133
132
  endpoints: "inherit";
134
133
  constraints: "inherit";
135
134
  unique: "always";
@@ -179,6 +178,7 @@ export declare const FIELD_ROLES: Readonly<{
179
178
  excluded: 'identity';
180
179
  }>;
181
180
  expression: "always";
181
+ input: "always";
182
182
  description: Readonly<{
183
183
  excluded: 'annotation';
184
184
  }>;
@@ -13,7 +13,6 @@ export const CLASS_FIELDS = Object.freeze({
13
13
  orientation: 'always',
14
14
  extends: 'inherit',
15
15
  policies: 'inherit',
16
- data: 'inherit',
17
16
  endpoints: 'inherit',
18
17
  constraints: 'inherit',
19
18
  // A uniqueness tuple bounds every write of the Classes it covers and what a step through them
@@ -55,6 +54,7 @@ export const CALLABLE_FIELDS = Object.freeze({
55
54
  export const POLICY_FIELDS = Object.freeze({
56
55
  ref: IDENTITY,
57
56
  expression: 'always',
57
+ input: 'always',
58
58
  description: ANNOTATION,
59
59
  });
60
60
  export const VIEW_FIELDS = Object.freeze({
@@ -2,7 +2,7 @@ import type { DiagnosticCode as LanguageDiagnosticCode } from '../language/valid
2
2
  import type { Diagnostic as LanguageDiagnostic } from '../language/validation/diagnostic.js';
3
3
  import type { DiagnosticCode as CompatibilityDiagnosticCode } from './compatibility/model.js';
4
4
  /** The codes a Schema document is refused with, one per rule of `RULES`. */
5
- export type SchemaDiagnosticCode = 'DV_ACCEPTANCE_CONTEXT' | 'DV_CALLABLE_ADMISSION' | 'DV_CALLABLE_AUTH' | 'DV_CALLABLE_IO' | 'DV_CLASS_ABSTRACT' | 'DV_CLASS_ACYCLIC' | 'DV_CLASS_INHERITANCE' | 'DV_CLASS_KIND' | 'DV_CORE_EDGE_CLASS' | 'DV_CORE_EDGE_CONSTRAINTS' | 'DV_CORE_EDGE_KEY' | 'DV_CORE_EDGE_PROPERTIES' | 'DV_CORE_EDGE_UNIQUE' | 'DV_CORE_NODE_CLASS' | 'DV_CORE_NODE_PROPERTIES' | 'DV_CORE_NODE_UNIQUE' | 'DV_CORE_REF' | 'DV_DATA_COMPOSITION' | 'DV_DEPENDENCY_ACYCLIC' | 'DV_DEPENDENCY_DIRECT' | 'DV_DEPENDENCY_EXACT' | 'DV_DEPENDENCY_LIMITS' | 'DV_DEPENDENCY_REVISION_COHERENCE' | 'DV_DEPENDENCY_UNIQUE' | 'DV_DOMAIN_ICON' | 'DV_EDGE_ACCEPTS' | 'DV_EDGE_CLASS_COMPOSITION' | 'DV_EDGE_FOREIGN_MINIMUM' | 'DV_EDGE_LIFETIME' | 'DV_EDGE_ROLE' | 'DV_EDGE_UNIQUE' | 'DV_ENTRYPOINT' | 'DV_INHERITANCE_LIMITS' | 'DV_JSON_VALUE' | 'DV_METHOD_ABSTRACT' | 'DV_METHOD_COMPOSITION' | 'DV_NODE_UNIQUE' | 'DV_PROPERTY_AUTO' | 'DV_PROPERTY_IMMUTABLE' | 'DV_PROPERTY_STATE' | 'DV_REF_RESOLVES' | 'DV_VALUE_SCHEMA' | 'PL_BUDGET' | 'PL_COMPOSITION' | 'PL_CONNECTIVITY' | 'PL_REF' | 'PL_REPEAT' | 'PL_TARGET' | 'PL_TYPING' | 'PL_USE' | 'PL_VARIABLE_SCOPE' | 'STRUCTURE_BINARY_INPUT' | 'STRUCTURE_CALLABLE_POLICY_AUTH' | 'STRUCTURE_DEPENDENCY_ALIAS' | 'STRUCTURE_DOMAIN_NAME' | 'STRUCTURE_DUPLICATE_ITEM' | 'STRUCTURE_EDGE_BLOB' | 'STRUCTURE_EDGE_ORIENTATION' | 'STRUCTURE_FORMAT' | 'STRUCTURE_KEY' | 'STRUCTURE_MAXIMUM' | 'STRUCTURE_MINIMUM' | 'STRUCTURE_PROPERTY_KEY' | 'STRUCTURE_PROTO_KEY' | 'STRUCTURE_REQUIRED' | 'STRUCTURE_STATE_TRANSITIONS' | 'STRUCTURE_TYPE' | 'STRUCTURE_UNION' | 'STRUCTURE_UNKNOWN_FIELD' | 'STRUCTURE_VALUE' | 'UNSUPPORTED_DOCUMENT_FORMAT' | 'UNSUPPORTED_DSL_VERSION';
5
+ export type SchemaDiagnosticCode = 'DV_ACCEPTANCE_CONTEXT' | 'DV_CALLABLE_ADMISSION' | 'DV_CALLABLE_AUTH' | 'DV_CALLABLE_IO' | 'DV_CLASS_ABSTRACT' | 'DV_CLASS_ACYCLIC' | 'DV_CLASS_INHERITANCE' | 'DV_CLASS_KIND' | 'DV_CORE_EDGE_CLASS' | 'DV_CORE_EDGE_CONSTRAINTS' | 'DV_CORE_EDGE_KEY' | 'DV_CORE_EDGE_PROPERTIES' | 'DV_CORE_EDGE_UNIQUE' | 'DV_CORE_NODE_CLASS' | 'DV_CORE_NODE_PROPERTIES' | 'DV_CORE_NODE_UNIQUE' | 'DV_CORE_REF' | 'DV_DEPENDENCY_ACYCLIC' | 'DV_DEPENDENCY_DIRECT' | 'DV_DEPENDENCY_EXACT' | 'DV_DEPENDENCY_LIMITS' | 'DV_DEPENDENCY_REVISION_COHERENCE' | 'DV_DEPENDENCY_UNIQUE' | 'DV_DOMAIN_ICON' | 'DV_EDGE_ACCEPTS' | 'DV_EDGE_CLASS_COMPOSITION' | 'DV_EDGE_FOREIGN_MINIMUM' | 'DV_EDGE_LIFETIME' | 'DV_EDGE_ROLE' | 'DV_EDGE_UNIQUE' | 'DV_ENTRYPOINT' | 'DV_INHERITANCE_LIMITS' | 'DV_JSON_VALUE' | 'DV_METHOD_ABSTRACT' | 'DV_METHOD_COMPOSITION' | 'DV_NODE_UNIQUE' | 'DV_PROPERTY_AUTO' | 'DV_PROPERTY_IMMUTABLE' | 'DV_PROPERTY_STATE' | 'DV_REF_RESOLVES' | 'DV_VALUE_SCHEMA' | 'PL_BUDGET' | 'PL_COMPOSITION' | 'PL_CONNECTIVITY' | 'PL_REF' | 'PL_REPEAT' | 'PL_TARGET' | 'PL_TYPING' | 'PL_USE' | 'PL_VARIABLE_SCOPE' | 'STRUCTURE_BINARY_INPUT' | 'STRUCTURE_CALLABLE_POLICY_AUTH' | 'STRUCTURE_DEPENDENCY_ALIAS' | 'STRUCTURE_DOMAIN_NAME' | 'STRUCTURE_DUPLICATE_ITEM' | 'STRUCTURE_EDGE_BLOB' | 'STRUCTURE_EDGE_ORIENTATION' | 'STRUCTURE_FORMAT' | 'STRUCTURE_KEY' | 'STRUCTURE_MAXIMUM' | 'STRUCTURE_MINIMUM' | 'STRUCTURE_PROPERTY_KEY' | 'STRUCTURE_PROTO_KEY' | 'STRUCTURE_REQUIRED' | 'STRUCTURE_STATE_TRANSITIONS' | 'STRUCTURE_TYPE' | 'STRUCTURE_UNION' | 'STRUCTURE_UNKNOWN_FIELD' | 'STRUCTURE_VALUE' | 'UNSUPPORTED_DOCUMENT_FORMAT' | 'UNSUPPORTED_DSL_VERSION';
6
6
  /**
7
7
  * A Schema refuses a document with its own codes, and a comparison request with the
8
8
  * compatibility codes. `pointer` names the position the refused rule applies to, in the document
@@ -203,12 +203,6 @@ export declare const CHANGES: Readonly<{
203
203
  readonly owes: readonly [];
204
204
  readonly refused: readonly ["IDENTITY_CLASS_REMOVED"];
205
205
  };
206
- readonly CLASS_DATA_CHANGED: {
207
- readonly subjects: readonly ["class.data"];
208
- readonly statement: 'A changed data facet owes nothing: neither the Runtime nor a store reads it.';
209
- readonly bump: 'major';
210
- readonly owes: readonly [];
211
- };
212
206
  readonly CLASS_INHERITANCE_CHANGED: {
213
207
  readonly subjects: readonly ["class.inheritance"];
214
208
  readonly statement: 'A Class moved between internal and final owes nothing: no other Domain could extend it, and only acceptance reads the rule.';
@@ -180,12 +180,6 @@ export const CHANGES = deepFreeze({
180
180
  owes: [],
181
181
  refused: ['IDENTITY_CLASS_REMOVED'],
182
182
  },
183
- CLASS_DATA_CHANGED: {
184
- subjects: ['class.data'],
185
- statement: 'A changed data facet owes nothing: neither the Runtime nor a store reads it.',
186
- bump: 'major',
187
- owes: [],
188
- },
189
183
  CLASS_INHERITANCE_CHANGED: {
190
184
  subjects: ['class.inheritance'],
191
185
  statement: 'A Class moved between internal and final owes nothing: no other Domain could extend it, and only acceptance reads the rule.',
@@ -29,11 +29,6 @@ declare const rows: {
29
29
  statement: string;
30
30
  laws: [string];
31
31
  };
32
- DATA_ONE_OWNER: {
33
- subjects: ["class.data", "class.extends"];
34
- statement: string;
35
- laws: [string];
36
- };
37
32
  ENDPOINT_LIFETIME: {
38
33
  subjects: ["endpoint.onDelete", "endpoint.accepts", "endpoint.outgoing", "endpoint.incoming", "endpoint.incident", "class.inheritance"];
39
34
  statement: string;
@@ -218,7 +213,6 @@ export declare const RESOLVED_MEMBERS: Readonly<{
218
213
  'class.definition': "declared";
219
214
  'class.extends': "declared";
220
215
  'class.policies': "declared";
221
- 'class.data': "DATA_ONE_OWNER";
222
216
  'class.properties': "PROPERTIES_EFFECTIVE";
223
217
  'class.methods': "calls";
224
218
  'class.static': "calls";
@@ -15,11 +15,6 @@ const rows = {
15
15
  statement: 'The Properties of a Class are its own and those of its ancestors, one per full key: a Property reached by two paths counts once, and two Properties of one name with different owners both stay. A short name reads a Property only when one Property holds it.',
16
16
  laws: ['LANGUAGE-PROPERTY-ADDITIVE'],
17
17
  },
18
- DATA_ONE_OWNER: {
19
- subjects: ['class.data', 'class.extends'],
20
- statement: 'A Node Class has the Data one Node Class declares: its own, or the one its ancestors inherit from one owner, however many paths reach it.',
21
- laws: ['DV-DATA-COMPOSITION'],
22
- },
23
18
  ENDPOINT_LIFETIME: {
24
19
  subjects: [
25
20
  'endpoint.onDelete',
@@ -226,7 +221,6 @@ export const RESOLVED_MEMBERS = deepFreeze({
226
221
  'class.definition': 'declared',
227
222
  'class.extends': 'declared',
228
223
  'class.policies': 'declared',
229
- 'class.data': 'DATA_ONE_OWNER',
230
224
  'class.properties': 'PROPERTIES_EFFECTIVE',
231
225
  'class.methods': 'calls',
232
226
  'class.static': 'calls',
@@ -26,7 +26,6 @@ export declare const FIELDS: Readonly<{
26
26
  readonly 'class.policies': {
27
27
  readonly outside: 'authority';
28
28
  };
29
- readonly 'class.data': 'rows';
30
29
  readonly 'class.endpoints': {
31
30
  readonly through: 'endpoint';
32
31
  };
@@ -11,7 +11,6 @@ export const FIELDS = deepFreeze({
11
11
  'class.orientation': 'rows',
12
12
  'class.extends': 'rows',
13
13
  'class.policies': { outside: 'authority' },
14
- 'class.data': 'rows',
15
14
  'class.endpoints': { through: 'endpoint' },
16
15
  'class.constraints': { through: 'constraint' },
17
16
  'class.unique': 'rows',
@@ -1094,13 +1094,6 @@ export declare const WRITE: Readonly<{
1094
1094
  readonly does: 'abstain';
1095
1095
  readonly statement: 'The annotations of a value program, `format` among them, refuse no value.';
1096
1096
  };
1097
- readonly CLASS_DATA_UNENFORCED: {
1098
- readonly phase: 'write';
1099
- readonly layer: 'structure';
1100
- readonly subjects: readonly ["class.data"];
1101
- readonly does: 'abstain';
1102
- readonly statement: 'The payload media type a Node Class declares refuses no write: the Kernel holds no payload of it.';
1103
- };
1104
1097
  readonly GUARD_BEYOND_CALLER_VIEW_UNENFORCED: {
1105
1098
  readonly phase: 'write';
1106
1099
  readonly layer: 'identity';
@@ -847,13 +847,6 @@ export const WRITE = deepFreeze({
847
847
  does: 'abstain',
848
848
  statement: 'The annotations of a value program, `format` among them, refuse no value.',
849
849
  },
850
- CLASS_DATA_UNENFORCED: {
851
- phase: 'write',
852
- layer: 'structure',
853
- subjects: ['class.data'],
854
- does: 'abstain',
855
- statement: 'The payload media type a Node Class declares refuses no write: the Kernel holds no payload of it.',
856
- },
857
850
  GUARD_BEYOND_CALLER_VIEW_UNENFORCED: {
858
851
  phase: 'write',
859
852
  layer: 'identity',
@@ -59,6 +59,7 @@ function canonicalizePolicy(value) {
59
59
  return {
60
60
  ref: value.ref,
61
61
  ...withDescription(value),
62
+ ...(value.input === undefined ? {} : { input: value.input }),
62
63
  expression: normalizePolicyExpression(value.expression),
63
64
  };
64
65
  }
@@ -83,7 +84,6 @@ function canonicalizeClass(value) {
83
84
  return {
84
85
  ...base,
85
86
  methods: mapRecord(value.methods, canonicalizeMethod),
86
- ...(value.data === undefined ? {} : { data: { mediaType: value.data.mediaType } }),
87
87
  ...(value.icon === undefined ? {} : { icon: value.icon }),
88
88
  policies: canonicalizeClassPolicies(value.policies),
89
89
  ...(value.unique === undefined ? {} : { unique: canonicalizeNodeUnique(value.unique) }),
@@ -1,5 +1,6 @@
1
1
  import { compareDefinitionRefs, definitionRefIndex } from '../../addressing/ordering.js';
2
2
  import { isBinaryInput } from '../../language/callable/model/callable.js';
3
+ import { checkBindings } from '../../language/policy/model/policy.js';
3
4
  import { CLASS_OPERATIONS, isClassRuleChecks, PolicyComposition, policyVariableClass, } from '../../language/policy/model/policy.js';
4
5
  import { isValueObject as isJsonObject } from '../../language/value/model/object.js';
5
6
  import { walkSchema } from '../../language/value/syntax/walk.js';
@@ -88,6 +89,8 @@ export function collectCallableContractRefs(declaration, add) {
88
89
  collectValueDefinitionRefs(declaration.output.item, add);
89
90
  }
90
91
  export function collectPolicyDefinitionRefs(declaration, add) {
92
+ for (const ref of Object.values(declaration.input ?? {}))
93
+ add(ref, 'policy');
91
94
  collectPolicyExpressionRefs(declaration.expression, add);
92
95
  }
93
96
  function collectPolicyExpressionRefs(expression, add) {
@@ -131,8 +134,10 @@ function collectPolicyCheckRefs(expression, add) {
131
134
  }
132
135
  if ('check' in expression) {
133
136
  add(expression.check, 'policy');
134
- if (expression.object.kind === 'ref')
135
- add(expression.object.ref, 'policy');
137
+ for (const operand of Object.values(checkBindings(expression))) {
138
+ if (operand.kind === 'ref')
139
+ add(operand.ref, 'policy');
140
+ }
136
141
  return;
137
142
  }
138
143
  PolicyComposition.of(expression).operands.forEach((child) => collectPolicyCheckRefs(child, add));
@@ -110,11 +110,6 @@ const DECLARED = {
110
110
  positions: ['/core/edges/{index}/source', '/core/edges/{index}/target'],
111
111
  statement: 'A Core Edge endpoint names its Domain or a Definition its Domain declares and projects: a Class, Function, executable Method, Policy, View or Core Node.',
112
112
  },
113
- DV_DATA_COMPOSITION: {
114
- stage: 'context',
115
- positions: ['/classes/{class}/extends/{index}', '/classes/{class}/data'],
116
- statement: 'A Node Class has at most one data declaration, its own or inherited from one declaring Class, and declares none of its own when it inherits one.',
117
- },
118
113
  DV_DEPENDENCY_ACYCLIC: {
119
114
  stage: 'context',
120
115
  positions: [...DEPENDENCIES],
@@ -261,8 +256,9 @@ const DECLARED = {
261
256
  PL_BUDGET: {
262
257
  stage: 'rule',
263
258
  positions: ['/policies/{policy}', ...CHECKS],
264
- statement: `A Policy stays within its budgets once expanded: pattern depth ${policy.patternDepth}, ${policy.normalizedBranches} normalized branches, ${policy.edgePredicates} Edge predicates a branch and ${policy.referencedDomains} referenced Domains; and checks within depth ${policy.checkDepth}, ${policy.checkBranches} branches and ${policy.checkLeaves} leaves.`,
259
+ statement: `A Policy declares at most ${policy.inputs} Node inputs and stays within its budgets once expanded: pattern depth ${policy.patternDepth}, ${policy.normalizedBranches} normalized branches, ${policy.edgePredicates} Edge predicates a branch and ${policy.referencedDomains} referenced Domains; and checks within depth ${policy.checkDepth}, ${policy.checkBranches} branches and ${policy.checkLeaves} leaves.`,
265
260
  limits: [
261
+ 'policy.inputs',
266
262
  'policy.patternDepth',
267
263
  'policy.normalizedBranches',
268
264
  'policy.edgePredicates',
@@ -366,7 +362,7 @@ const DECLARED = {
366
362
  STRUCTURE_FORMAT: {
367
363
  stage: 'structure',
368
364
  positions: ANY,
369
- statement: 'A string matches the pattern of its position: an origin, a member name, a revision, a media type, a dependency alias or a Core slug.',
365
+ statement: 'A string matches the pattern of its position: an origin, a member name, a revision, a dependency alias or a Core slug.',
370
366
  },
371
367
  STRUCTURE_KEY: {
372
368
  stage: 'structure',
@@ -393,9 +393,6 @@ export declare const domainSchemaStructure: import("zod").ZodObject<{
393
393
  static: boolean;
394
394
  abstract: boolean;
395
395
  }>>>;
396
- data: import("zod").ZodOptional<import("zod").ZodObject<{
397
- mediaType: import("zod").ZodString;
398
- }, zodCore.$strict>>;
399
396
  icon: import("zod").ZodOptional<import("zod").ZodString>;
400
397
  policies: import("zod").ZodObject<{
401
398
  read: import("zod").ZodOptional<import("zod").ZodXor<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
@@ -7694,6 +7691,11 @@ export declare const domainSchemaStructure: import("zod").ZodObject<{
7694
7691
  name: string;
7695
7692
  }[]]>>;
7696
7693
  }, zodCore.$strict>]>;
7694
+ input: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
7695
+ origin: import("zod").ZodString;
7696
+ kind: import("zod").ZodLiteral<"class">;
7697
+ name: import("zod").ZodString;
7698
+ }, zodCore.$strict>>>;
7697
7699
  description: import("zod").ZodOptional<import("zod").ZodString>;
7698
7700
  }, zodCore.$strict>>;
7699
7701
  views: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -1,7 +1,6 @@
1
1
  import { array, boolean, custom, discriminatedUnion, enum as enumeration, lazy, literal, null as nullSchema, number, record, registry, strictObject, string, tuple, xor, } from 'zod';
2
2
  import { PropertyKey as SemanticPropertyKey } from '../../addressing/index.js';
3
3
  import { CORE_SLUG_PATTERN, DEPENDENCY_ALIAS_PATTERN, DOMAIN_ORIGIN_PATTERN, DOMAIN_REVISION_PATTERN, MEMBER_NAME_PATTERN, PROPERTY_KEY_PATTERN, } from '../../addressing/patterns.js';
4
- import { MEDIA_TYPE_PATTERN } from '../../language/class/model/data.js';
5
4
  import * as metadata from '../../language/definition/metadata.js';
6
5
  import { limits } from '../../language/limits.js';
7
6
  import { BLOB_VALUE_KIND, isBlobValueSchema } from '../../language/value/model/blob.js';
@@ -111,9 +110,6 @@ const jsonSchemaSchema = variants([boolean(), jsonObjectSchema], {
111
110
  id: 'value-schema',
112
111
  description: 'A value schema of the dialect https://schemas.astrale.ai/dsl/v1/value-schema. The structure admits any boolean or object; the language admits its keywords.',
113
112
  });
114
- const dataDeclarationSchema = strictObject({
115
- mediaType: string().regex(MEDIA_TYPE_PATTERN).register(documentJsonSchema, { id: 'media-type' }),
116
- });
117
113
  const stateNameSchema = boundedString(1);
118
114
  // A custom check reads the relation in place: a record would copy it and drop a `__proto__` state.
119
115
  const stateTransitionsSchema = custom(isStateTransitions, {
@@ -246,6 +242,7 @@ const policyPatternVariableSchema = strictObject({
246
242
  }).register(documentJsonSchema, { id: 'policy-pattern-variable' });
247
243
  const policyPatternNodeSchema = discriminatedUnion('kind', [
248
244
  policyPatternSubjectSchema,
245
+ strictObject({ kind: literal('input'), name: memberNameSchema }),
249
246
  policyPatternObjectSchema,
250
247
  policyPatternSourceSchema,
251
248
  policyPatternTargetSchema,
@@ -303,6 +300,7 @@ function policyChecksSchema(objectSchema, id) {
303
300
  const checks = lazy(() => variants([
304
301
  strictObject({ sameNode: strictObject({ left: objectSchema, right: objectSchema }) }),
305
302
  strictObject({ check: policyRefSchema, object: objectSchema }),
303
+ strictObject({ check: policyRefSchema, input: record(memberNameSchema, objectSchema) }),
306
304
  strictObject({ allOf: nonEmpty(array(checks)) }),
307
305
  strictObject({ anyOf: nonEmpty(array(checks)) }),
308
306
  ])).register(documentJsonSchema, { id });
@@ -406,7 +404,6 @@ const nodeClassSchema = strictObject({
406
404
  extends: uniqueArray(classRefSchema),
407
405
  properties: nodePropertyRecordSchema,
408
406
  methods: methodRecordSchema,
409
- data: dataDeclarationSchema.optional(),
410
407
  icon: iconSchema.optional(),
411
408
  policies: nodeClassPoliciesSchema,
412
409
  unique: nodeUniqueSchema.optional(),
@@ -480,6 +477,7 @@ const policyExpressionSchema = variants([
480
477
  const policyDefinitionSchema = strictObject({
481
478
  ref: policyRefSchema,
482
479
  expression: policyExpressionSchema,
480
+ input: record(memberNameSchema, classRefSchema).optional(),
483
481
  description: descriptionSchema.optional(),
484
482
  }).register(documentJsonSchema, { id: 'policy-definition' });
485
483
  const viewTargetSchema = strictObject({ kind: literal('domain') }).register(documentJsonSchema, {