@astrale-os/kernel-dsl 1.0.0-beta.27 → 1.0.0-beta.29
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/ordering.d.ts +2 -2
- package/dist/v1/addressing/ordering.js +2 -4
- package/dist/v1/builder/index.d.ts +2 -0
- package/dist/v1/builder/index.js +1 -0
- package/dist/v1/builder/schema/projection/identity.d.ts +15 -0
- package/dist/v1/builder/schema/projection/property.d.ts +3 -3
- package/dist/v1/builder/schema/projection/resolved-class.d.ts +3 -3
- package/dist/v1/builder/schema/rule.d.ts +316 -0
- package/dist/v1/builder/schema/rule.js +192 -0
- package/dist/v1/bundle/index.d.ts +2 -0
- package/dist/v1/bundle/index.js +1 -0
- package/dist/v1/bundle/rule.d.ts +14 -0
- package/dist/v1/bundle/rule.js +41 -0
- package/dist/v1/compiled/admission/diagnostic.d.ts +14 -0
- package/dist/v1/compiled/admission/diagnostic.js +6 -0
- package/dist/v1/compiled/admission/semantics/policy/callable.js +2 -3
- package/dist/v1/compiled/admission/semantics/policy/parity.js +8 -13
- package/dist/v1/compiled/admission/semantics/policy/pattern.js +3 -5
- package/dist/v1/compiled/admission/wire/policy.js +16 -11
- package/dist/v1/compiled/index.d.ts +2 -0
- package/dist/v1/compiled/index.js +1 -0
- package/dist/v1/compiled/rule.d.ts +49 -0
- package/dist/v1/compiled/rule.js +169 -0
- package/dist/v1/domain/namespace/member-collection.js +4 -1
- package/dist/v1/language/callable/admission.js +2 -1
- package/dist/v1/language/class/resolved.d.ts +9 -4
- package/dist/v1/language/policy/analysis/branches.js +6 -7
- package/dist/v1/language/policy/analysis/budgets.js +8 -6
- package/dist/v1/language/policy/analysis/checks.js +5 -4
- package/dist/v1/language/policy/analysis/composition.js +2 -2
- package/dist/v1/language/policy/analysis/typing.js +3 -2
- package/dist/v1/language/policy/model/policy.d.ts +22 -0
- package/dist/v1/language/policy/model/policy.js +28 -4
- package/dist/v1/language/policy/normalization/normalize.js +33 -56
- package/dist/v1/language/value/evaluate/assertions.d.ts +2 -2
- package/dist/v1/language/value/evaluate/assertions.js +4 -34
- package/dist/v1/language/value/evaluate/evaluator.js +10 -15
- package/dist/v1/language/value/evaluate/validity.optimization.js +9 -14
- package/dist/v1/language/value/files.js +2 -1
- 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/ordering.js +1 -3
- package/dist/v1/language/value/profile/canonicalize.js +1 -3
- package/dist/v1/language/value/syntax/walk.d.ts +2 -0
- package/dist/v1/language/value/syntax/walk.js +4 -0
- package/dist/v1/schema/compatibility/api.d.ts +2 -0
- package/dist/v1/schema/compatibility/api.js +1 -0
- package/dist/v1/schema/compatibility/rule.d.ts +13 -0
- package/dist/v1/schema/compatibility/rule.js +23 -0
- 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 +1 -0
- package/dist/v1/schema/index.js +1 -0
- package/dist/v1/schema/resolution/origins.js +4 -7
- package/dist/v1/schema/rule.d.ts +4 -5
- package/dist/v1/schema/rule.js +19 -13
- package/dist/v1/schema/validation/policy/references.js +5 -11
- package/dist/v1/schema/validation/policy/uses.js +3 -8
- package/dist/v1/schema/validation/value-api.d.ts +1 -1
- package/dist/v1/schema/validation/value-api.js +1 -1
- package/dist/value/accept.d.ts +6 -0
- package/dist/value/accept.js +25 -1
- package/dist/value/canonical.d.ts +16 -1
- package/dist/value/canonical.js +90 -33
- package/dist/value/immutable.optimization.d.ts +2 -0
- package/dist/value/immutable.optimization.js +4 -0
- package/dist/value/index.d.ts +3 -1
- package/dist/value/index.js +2 -1
- package/dist/value/rule.d.ts +12 -0
- package/dist/value/rule.js +50 -0
- package/package.json +5 -1
|
@@ -2,6 +2,7 @@ import { json } from '@astrale-os/kernel-dsl/value';
|
|
|
2
2
|
import { compareDefinitionRefs, compareUnicode } from '../../../addressing/ordering.js';
|
|
3
3
|
import { isValueObject as isJsonObject } from '../model/object.js';
|
|
4
4
|
import { SCHEMA_ARRAY_KEYWORDS, SCHEMA_MAP_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, } from '../syntax/keywords.js';
|
|
5
|
+
import { isJsonSchema } from '../syntax/walk.js';
|
|
5
6
|
const TYPE_ORDER = ['null', 'boolean', 'integer', 'number', 'string', 'array', 'object'];
|
|
6
7
|
const TYPE_RANK = new Map(TYPE_ORDER.map((name, index) => [name, index]));
|
|
7
8
|
const encoder = new TextEncoder();
|
|
@@ -107,6 +108,3 @@ function isComparableRef(value) {
|
|
|
107
108
|
typeof value.kind === 'string' &&
|
|
108
109
|
typeof value.name === 'string');
|
|
109
110
|
}
|
|
110
|
-
function isJsonSchema(value) {
|
|
111
|
-
return typeof value === 'boolean' || isJsonObject(value);
|
|
112
|
-
}
|
|
@@ -15,3 +15,5 @@ export declare function forEachSubschema(keyword: string, value: unknown, pointe
|
|
|
15
15
|
export declare function holdsOnlySubschemas(keyword: string, value: unknown): boolean;
|
|
16
16
|
export declare function collectSchemaPointers(schema: JsonSchema): ReadonlySet<string>;
|
|
17
17
|
export declare function isJsonSchema(value: unknown): value is JsonSchema;
|
|
18
|
+
/** The subschemas an Array keyword holds, read without checking each item. */
|
|
19
|
+
export declare function schemaList(input: unknown): readonly JsonSchema[] | undefined;
|
|
@@ -64,3 +64,7 @@ export function collectSchemaPointers(schema) {
|
|
|
64
64
|
export function isJsonSchema(value) {
|
|
65
65
|
return typeof value === 'boolean' || isJsonObject(value);
|
|
66
66
|
}
|
|
67
|
+
/** The subschemas an Array keyword holds, read without checking each item. */
|
|
68
|
+
export function schemaList(input) {
|
|
69
|
+
return Array.isArray(input) ? input : undefined;
|
|
70
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { compare, compareMeaning, compareStructure } from './compare.js';
|
|
2
2
|
export { closedParents } from './extension.js';
|
|
3
|
+
export { COMPARISON_RULES as RULES } from './rule.js';
|
|
4
|
+
export type { ComparisonRule as Rule } from './rule.js';
|
|
3
5
|
export { requiredBump } from './versioning/index.js';
|
|
4
6
|
export type { Analysis, Assessment, Bump, Comparison, ComparisonEntry, ComparisonEvidence, ComparisonRequest, ComparisonScope, DiagnosticCode, Facet, Fingerprint, MeaningComparison, Observation, RequiredBump, SchemaIdentity, StructureComparison, Subject, Usage, VersionChange, } from './model.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DiagnosticCode } from './model.js';
|
|
2
|
+
/** The rule one code of a refused comparison request reports. */
|
|
3
|
+
export interface ComparisonRule {
|
|
4
|
+
/** The positions its diagnostics point at, in the request, as the positions of `schema.Rule`. */
|
|
5
|
+
readonly positions: readonly [string, ...string[]];
|
|
6
|
+
/** The rule, in one plain sentence. */
|
|
7
|
+
readonly statement: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Every code a comparison request is refused with and the rule it reports, frozen. A code added
|
|
11
|
+
* here does not compile until it is described.
|
|
12
|
+
*/
|
|
13
|
+
export declare const COMPARISON_RULES: Readonly<Record<DiagnosticCode, ComparisonRule>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { deepFreeze } from '../../language/freeze.js';
|
|
2
|
+
/**
|
|
3
|
+
* Every code a comparison request is refused with and the rule it reports, frozen. A code added
|
|
4
|
+
* here does not compile until it is described.
|
|
5
|
+
*/
|
|
6
|
+
export const COMPARISON_RULES = deepFreeze({
|
|
7
|
+
DM_MEMBER_ORIGIN_MISMATCH: {
|
|
8
|
+
positions: ['/target/origin', '/next/origin'],
|
|
9
|
+
statement: 'A member comparison and a required bump compare two versions of one origin.',
|
|
10
|
+
},
|
|
11
|
+
DM_MEMBER_ROOT_INVALID: {
|
|
12
|
+
positions: ['/roots', '/roots/{index}'],
|
|
13
|
+
statement: "The roots of a member comparison are a non-empty list without duplicates of canonical Keys of the source's origin, each of a shape V1 supports and naming a definition of the source under its exact owner.",
|
|
14
|
+
},
|
|
15
|
+
DM_CAPABILITY_INVALID: {
|
|
16
|
+
positions: ['/capabilities', '/capabilities/{index}'],
|
|
17
|
+
statement: 'The capabilities a dependency comparison declares are a list of canonical Keys, each of the target origin naming a Function, Method or Class of the retained source; a Key of another origin is ignored.',
|
|
18
|
+
},
|
|
19
|
+
DM_DEPENDENCY_NOT_RETAINED: {
|
|
20
|
+
positions: ['/target/origin', '/origin'],
|
|
21
|
+
statement: 'A dependency comparison has a target whose origin is in the closure the dependent was accepted with.',
|
|
22
|
+
},
|
|
23
|
+
});
|