@astrale-os/kernel-core 0.9.0-beta.65 → 0.9.0-beta.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/authority/admission/admission.d.ts +0 -1
- package/dist/auth/authority/admission/admission.js +8 -141
- package/dist/auth/authority/admission/references.d.ts +13 -0
- package/dist/auth/authority/admission/references.js +38 -0
- package/dist/auth/authority/admission/term.d.ts +6 -0
- package/dist/auth/authority/admission/term.js +60 -0
- package/dist/auth/authority/admission/wire.d.ts +8 -0
- package/dist/auth/authority/admission/wire.js +33 -0
- package/dist/auth/authority/semantics/interpret.d.ts +6 -0
- package/dist/auth/authority/semantics/interpret.js +187 -14
- package/dist/auth/authority/semantics/snapshot.d.ts +6 -0
- package/dist/graph/graph/index.d.ts +1 -1
- package/dist/graph/graph/index.js +1 -1
- package/dist/graph/graph/model/codec.js +3 -3
- package/dist/graph/graph/model/index.d.ts +1 -1
- package/dist/graph/graph/model/index.js +1 -1
- package/dist/graph/graph/model/model.d.ts +7 -7
- package/dist/graph/graph/model/model.js +6 -6
- package/dist/graph/graph/model/wire.d.ts +0 -20
- package/dist/graph/graph/model/wire.js +2 -2
- package/dist/graph/mutate/authoring/builder.d.ts +2 -2
- package/dist/graph/mutate/authoring/builder.js +2 -2
- package/dist/graph/mutate/index.d.ts +1 -1
- package/dist/graph/mutate/language/codec.js +3 -3
- package/dist/graph/mutate/language/model.d.ts +4 -4
- package/dist/graph/mutate/language/wire.d.ts +11 -0
- package/dist/graph/mutate/result/index.d.ts +4 -3
- package/dist/graph/mutate/result/index.js +8 -6
- package/dist/graph/mutate/result/wire.d.ts +1 -0
- package/dist/graph/mutate/result/wire.js +5 -2
- package/dist/graph/node/identity/id.d.ts +0 -3
- package/dist/graph/node/identity/id.js +0 -4
- package/dist/graph/node/identity/order.js +20 -0
- package/dist/graph/query/authoring/builder.js +29 -2
- package/dist/graph/query/authoring/model.d.ts +20 -1
- package/dist/graph/query/index.d.ts +3 -3
- package/dist/graph/query/index.js +1 -1
- package/dist/graph/query/language/codec.js +18 -3
- package/dist/graph/query/language/fingerprint.js +8 -0
- package/dist/graph/query/language/model.d.ts +22 -4
- package/dist/graph/query/language/wire.d.ts +11 -0
- package/dist/graph/query/language/wire.js +8 -1
- package/dist/graph/query/order/index.d.ts +8 -1
- package/dist/graph/query/order/index.js +20 -0
- package/dist/graph/query/reference/evaluate.js +5 -3
- package/dist/graph/reconcile/condition/model.d.ts +2 -2
- package/dist/graph/reconcile/condition/references.d.ts +0 -1
- package/dist/graph/reconcile/condition/references.js +4 -4
- package/dist/graph/reconcile/correspondence.d.ts +9 -8
- package/dist/graph/reconcile/evidence.d.ts +2 -2
- package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
- package/dist/graph/reconcile/observation.d.ts +4 -3
- package/dist/graph/reconcile/planning/context.d.ts +3 -3
- package/dist/graph/reconcile/planning/model.d.ts +4 -4
- package/dist/schema/callables/{view-for.d.ts → entrypoint.d.ts} +7 -5
- package/dist/schema/callables/entrypoint.js +12 -0
- package/dist/schema/callables/function.d.ts +0 -120
- package/dist/schema/callables/index.d.ts +1 -1
- package/dist/schema/callables/index.js +1 -1
- package/dist/schema/callables/view.d.ts +2 -24
- package/dist/schema/domain/domain.d.ts +2 -121
- package/dist/schema/domain/domain.js +3 -0
- package/dist/schema/identity/identity.d.ts +0 -8
- package/dist/schema/kernel/projection/core.d.ts +7 -0
- package/dist/schema/kernel/projection/core.js +51 -0
- package/dist/schema/kernel/projection/definitions.d.ts +13 -0
- package/dist/schema/kernel/projection/definitions.js +71 -0
- package/dist/schema/kernel/projection/methods.d.ts +5 -0
- package/dist/schema/kernel/projection/methods.js +41 -0
- package/dist/schema/kernel/projection/part.d.ts +34 -0
- package/dist/schema/kernel/projection/part.js +42 -0
- package/dist/schema/kernel/projection/paths.d.ts +6 -0
- package/dist/schema/kernel/projection/{keys.js → paths.js} +11 -12
- package/dist/schema/kernel/projection/project.d.ts +1 -1
- package/dist/schema/kernel/projection/project.js +16 -290
- package/dist/schema/kernel/projection/properties.d.ts +11 -0
- package/dist/schema/kernel/projection/properties.js +36 -0
- package/dist/schema/kernel/projection/relations.d.ts +7 -0
- package/dist/schema/kernel/projection/relations.js +49 -0
- package/dist/schema/kernel/projection/types.d.ts +4 -4
- package/dist/schema/kernel/schema.d.ts +174 -409
- package/dist/schema/kernel/schema.js +3 -2
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +12 -2
- package/dist/schema/kernel/syscalls/contracts/blob.js +10 -2
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +0 -4
- package/dist/schema/kernel/syscalls/contracts/delegate.js +0 -3
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/contracts/index.js +1 -1
- package/dist/schema/kernel/syscalls/contracts/install.d.ts +3 -20
- package/dist/schema/kernel/syscalls/contracts/install.js +0 -2
- package/dist/schema/kernel/syscalls/contracts/installation.d.ts +0 -36
- package/dist/schema/kernel/syscalls/contracts/installation.js +3 -3
- package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +13 -0
- package/dist/schema/kernel/syscalls/contracts/mutate.js +2 -1
- package/dist/schema/kernel/syscalls/contracts/query.d.ts +11 -0
- package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +3 -14
- package/dist/schema/kernel/syscalls/contracts/view-resolve.js +3 -18
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +0 -4
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +5 -0
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +30 -24
- package/dist/schema/kernel/syscalls/declarations/install.d.ts +0 -8
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +13 -0
- package/dist/schema/kernel/syscalls/declarations/query.d.ts +11 -0
- package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +1 -12
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +0 -4
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +2 -13
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +4 -119
- package/dist/schema/kernel/syscalls/descriptors/view.d.ts +1 -12
- package/package.json +2 -2
- package/dist/schema/callables/view-for.js +0 -12
- package/dist/schema/kernel/projection/keys.d.ts +0 -3
- package/dist/schema/kernel/syscalls/contracts/legacy/delegate.d.ts +0 -5
- package/dist/schema/kernel/syscalls/contracts/legacy/delegate.js +0 -25
- package/dist/schema/kernel/syscalls/contracts/legacy/install.d.ts +0 -22
- package/dist/schema/kernel/syscalls/contracts/legacy/install.js +0 -31
|
@@ -56,6 +56,17 @@ export declare const queryAstSchema: import("zod").ZodObject<{
|
|
|
56
56
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
57
57
|
kind: import("zod").ZodLiteral<"property.present">;
|
|
58
58
|
property: import("zod").ZodString;
|
|
59
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
60
|
+
kind: import("zod").ZodLiteral<"property.range">;
|
|
61
|
+
property: import("zod").ZodString;
|
|
62
|
+
lower: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
63
|
+
value: import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>;
|
|
64
|
+
inclusive: import("zod").ZodBoolean;
|
|
65
|
+
}, import("zod/v4/core").$strict>>;
|
|
66
|
+
upper: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
67
|
+
value: import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>;
|
|
68
|
+
inclusive: import("zod").ZodBoolean;
|
|
69
|
+
}, import("zod/v4/core").$strict>>;
|
|
59
70
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
60
71
|
kind: import("zod").ZodLiteral<"identity.equal">;
|
|
61
72
|
identity: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { array, discriminatedUnion, enum as enumeration, literal, strictObject, string, union, unknown as unknownSchema, } from 'zod';
|
|
1
|
+
import { array, boolean, discriminatedUnion, enum as enumeration, literal, number, strictObject, string, union, unknown as unknownSchema, } from 'zod';
|
|
2
2
|
import { QUERY_AST_FORMAT, QUERY_AST_LIMITS, QUERY_AST_VERSION } from './model.js';
|
|
3
3
|
const text = string().min(1);
|
|
4
4
|
const binding = text.max(64);
|
|
@@ -24,11 +24,18 @@ const source = discriminatedUnion('kind', [
|
|
|
24
24
|
bindings: strictObject({ source: binding, edge: binding, target: binding }),
|
|
25
25
|
}),
|
|
26
26
|
]);
|
|
27
|
+
const rangeBound = strictObject({ value: union([number(), string()]), inclusive: boolean() });
|
|
27
28
|
const predicate = discriminatedUnion('kind', [
|
|
28
29
|
strictObject({ kind: literal('class.satisfies'), class: classRef }),
|
|
29
30
|
strictObject({ kind: literal('class.equal'), class: classRef }),
|
|
30
31
|
strictObject({ kind: literal('property.equal'), property: text, value: unknownSchema() }),
|
|
31
32
|
strictObject({ kind: literal('property.present'), property: text }),
|
|
33
|
+
strictObject({
|
|
34
|
+
kind: literal('property.range'),
|
|
35
|
+
property: text,
|
|
36
|
+
lower: rangeBound.optional(),
|
|
37
|
+
upper: rangeBound.optional(),
|
|
38
|
+
}),
|
|
32
39
|
strictObject({
|
|
33
40
|
kind: literal('identity.equal'),
|
|
34
41
|
identity: union([text, strictObject({ source: text, target: text, class: text })]),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { OrderingKind } from '@astrale-os/kernel-dsl/v1/language';
|
|
2
|
+
import type * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
3
|
import type { EdgeKey } from '../../edge/index.js';
|
|
3
4
|
import type { NodeId } from '../../node/index.js';
|
|
4
|
-
import type { QueryOrderDirection, QueryUnrankedPlacement } from '../language/index.js';
|
|
5
|
+
import type { QueryOrderDirection, QueryPropertyRangePredicate, QueryUnrankedPlacement } from '../language/index.js';
|
|
5
6
|
/** The identity of one selected fact: a Node's NodeId or an Edge's complete EdgeKey. */
|
|
6
7
|
export type QueryRankIdentity = NodeId | EdgeKey;
|
|
7
8
|
/** A scalar ordering value of one proven kind; an instant is its canonical text. */
|
|
@@ -42,5 +43,11 @@ export declare function compareQueryValue(left: QueryRankValue, right: QueryRank
|
|
|
42
43
|
* exactly that range.
|
|
43
44
|
*/
|
|
44
45
|
export declare function compareQueryText(left: string, right: string): number;
|
|
46
|
+
/**
|
|
47
|
+
* Whether one stored value lies in a Property range: it has the kind of the bounds, a number in
|
|
48
|
+
* numeric order or a text in code-point order, and every present bound holds. A value of any other
|
|
49
|
+
* kind, an absent value included, is never in the range; this is never an error.
|
|
50
|
+
*/
|
|
51
|
+
export declare function queryRangeContains(range: Pick<QueryPropertyRangePredicate, 'lower' | 'upper'>, value: portable.Value | undefined): boolean;
|
|
45
52
|
/** Identity order: NodeId byte order, or EdgeKey (source, target, ClassKey) tuple order. */
|
|
46
53
|
export declare function compareQueryIdentity(left: QueryRankIdentity, right: QueryRankIdentity): number;
|
|
@@ -49,6 +49,26 @@ export function compareQueryText(left, right) {
|
|
|
49
49
|
}
|
|
50
50
|
return Math.sign(left.length - right.length);
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether one stored value lies in a Property range: it has the kind of the bounds, a number in
|
|
54
|
+
* numeric order or a text in code-point order, and every present bound holds. A value of any other
|
|
55
|
+
* kind, an absent value included, is never in the range; this is never an error.
|
|
56
|
+
*/
|
|
57
|
+
export function queryRangeContains(range, value) {
|
|
58
|
+
const kind = (range.lower ?? range.upper)?.value;
|
|
59
|
+
if (typeof value !== typeof kind || (typeof value !== 'number' && typeof value !== 'string')) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const holds = (bound, sign) => {
|
|
63
|
+
if (bound === undefined)
|
|
64
|
+
return true;
|
|
65
|
+
const compared = typeof value === 'number'
|
|
66
|
+
? Math.sign(value - bound.value)
|
|
67
|
+
: compareQueryText(value, bound.value);
|
|
68
|
+
return compared === 0 ? bound.inclusive : compared === sign;
|
|
69
|
+
};
|
|
70
|
+
return holds(range.lower, 1) && holds(range.upper, -1);
|
|
71
|
+
}
|
|
52
72
|
/** Identity order: NodeId byte order, or EdgeKey (source, target, ClassKey) tuple order. */
|
|
53
73
|
export function compareQueryIdentity(left, right) {
|
|
54
74
|
if (typeof left === 'string' && typeof right === 'string')
|
|
@@ -6,7 +6,7 @@ import { GraphData } from '../../graph/index.js';
|
|
|
6
6
|
import { NodeId as admitNodeId } from '../../node/index.js';
|
|
7
7
|
import { compareNodeIds } from '../../node/index.js';
|
|
8
8
|
import { encodeQueryAST, QueryASTDecodeError } from '../language/index.js';
|
|
9
|
-
import { compareQueryRank } from '../order/index.js';
|
|
9
|
+
import { compareQueryRank, queryRangeContains } from '../order/index.js';
|
|
10
10
|
import { decodeQueryResult } from '../result/index.js';
|
|
11
11
|
import { QueryReferenceError } from './error.js';
|
|
12
12
|
/** Independent backend-neutral executable Query V6 row algebra. */
|
|
@@ -142,8 +142,10 @@ function evaluate(ast, context, options) {
|
|
|
142
142
|
if (!Object.hasOwn(value.value.props, predicate.property)) {
|
|
143
143
|
return false;
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
const stored = value.value.props[predicate.property];
|
|
146
|
+
if (predicate.kind === 'property.range')
|
|
147
|
+
return queryRangeContains(predicate, stored);
|
|
148
|
+
return predicate.kind === 'property.present' || portable.equal(stored, predicate.value);
|
|
147
149
|
});
|
|
148
150
|
}
|
|
149
151
|
stepRows.push(rows.length);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PropertyKey } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import type { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
3
|
import type { EdgeKey, EdgeSlug } from '../../edge/index.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { LocalAlias, MergeConflict as GraphMergeConflict } from '../../graph/index.js';
|
|
5
5
|
import type { NodeId } from '../../node/index.js';
|
|
6
6
|
import type { DesiredProperties } from '../../properties/index.js';
|
|
7
7
|
import type { QueryEdgeAST, QueryNodeAST } from '../../query/index.js';
|
|
8
8
|
declare const DESIRED_BRAND: unique symbol;
|
|
9
9
|
export type DesiredNodeRef = NodeId | {
|
|
10
|
-
readonly desired:
|
|
10
|
+
readonly desired: LocalAlias;
|
|
11
11
|
};
|
|
12
12
|
export interface DesiredEdgeRef {
|
|
13
13
|
readonly source: DesiredNodeRef;
|
|
@@ -2,7 +2,6 @@ import type { DesiredEdge, DesiredEdgeRef, DesiredNode, DesiredNodeRef, Expectat
|
|
|
2
2
|
import { type EdgeKey, type EdgeSlug } from '../../edge/index.js';
|
|
3
3
|
export declare function admitDesiredNode(node: DesiredNode): DesiredNode;
|
|
4
4
|
export declare function admitDesiredEdge(edge: DesiredEdge): DesiredEdge;
|
|
5
|
-
export declare function admitNodeRef(ref: DesiredNodeRef): DesiredNodeRef;
|
|
6
5
|
export declare function admitEdgeRef(ref: DesiredEdgeRef | EdgeKey): DesiredEdgeRef;
|
|
7
6
|
export declare function equalExpectation(left: Expectation<EdgeSlug>, right: Expectation<EdgeSlug>): boolean;
|
|
8
7
|
export declare function encodeDesiredNodeRef(ref: DesiredNodeRef): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
2
|
import { isEdgeSlug } from '../../edge/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { LocalAlias, isLocalAlias } from '../../graph/index.js';
|
|
4
4
|
import { isNodeId } from '../../node/index.js';
|
|
5
5
|
export function admitDesiredNode(node) {
|
|
6
6
|
const ref = admitNodeRef(node.node);
|
|
@@ -29,14 +29,14 @@ export function admitDesiredEdge(edge) {
|
|
|
29
29
|
properties: edge.properties,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
function admitNodeRef(ref) {
|
|
33
33
|
if (typeof ref === 'string') {
|
|
34
34
|
requireNodeId(ref);
|
|
35
35
|
return ref;
|
|
36
36
|
}
|
|
37
|
-
if (!
|
|
37
|
+
if (!isLocalAlias(ref.desired))
|
|
38
38
|
throw new TypeError(`Invalid desired Node binding.`);
|
|
39
|
-
return Object.freeze({ desired:
|
|
39
|
+
return Object.freeze({ desired: LocalAlias(ref.desired) });
|
|
40
40
|
}
|
|
41
41
|
export function admitEdgeRef(ref) {
|
|
42
42
|
if (!ClassKey.is(ref.class))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { NodeId } from '../node/index.js';
|
|
3
3
|
import type { QueryObservation } from './evidence.js';
|
|
4
4
|
export type CorrespondenceEntry = {
|
|
5
|
-
readonly desired:
|
|
5
|
+
readonly desired: LocalAlias;
|
|
6
6
|
readonly kind: 'present';
|
|
7
7
|
readonly node: NodeId;
|
|
8
8
|
readonly observation: Extract<QueryObservation, {
|
|
@@ -11,7 +11,7 @@ export type CorrespondenceEntry = {
|
|
|
11
11
|
};
|
|
12
12
|
}>;
|
|
13
13
|
} | {
|
|
14
|
-
readonly desired:
|
|
14
|
+
readonly desired: LocalAlias;
|
|
15
15
|
readonly kind: 'absent';
|
|
16
16
|
readonly observation: Extract<QueryObservation, {
|
|
17
17
|
readonly selection: {
|
|
@@ -24,18 +24,19 @@ export interface Correspondence {
|
|
|
24
24
|
}
|
|
25
25
|
export type CorrespondenceConflict = {
|
|
26
26
|
readonly kind: 'correspondence-duplicate';
|
|
27
|
-
readonly desired:
|
|
27
|
+
readonly desired: LocalAlias;
|
|
28
28
|
} | {
|
|
29
29
|
readonly kind: 'correspondence-noninjective';
|
|
30
30
|
readonly node: NodeId;
|
|
31
|
-
readonly desired: readonly
|
|
31
|
+
readonly desired: readonly LocalAlias[];
|
|
32
32
|
} | {
|
|
33
33
|
readonly kind: 'correspondence-observation-invalid';
|
|
34
|
-
readonly desired:
|
|
34
|
+
readonly desired: LocalAlias;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
readonly entries: ReadonlyMap<
|
|
36
|
+
interface CorrespondenceAnalysis {
|
|
37
|
+
readonly entries: ReadonlyMap<LocalAlias, CorrespondenceEntry>;
|
|
38
38
|
readonly conflicts: readonly CorrespondenceConflict[];
|
|
39
39
|
}
|
|
40
40
|
/** Canonically index correspondence and classify duplicate or non-injective mappings. */
|
|
41
41
|
export declare function analyzeCorrespondence(entries: readonly CorrespondenceEntry[]): CorrespondenceAnalysis;
|
|
42
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { NodeId } from '../node/index.js';
|
|
3
3
|
import type { QueryEdgeAST, QueryNodeAST, QuerySelection } from '../query/index.js';
|
|
4
4
|
import { type EdgeKey } from '../edge/index.js';
|
|
5
5
|
export type ObservationRequirement = {
|
|
6
6
|
readonly kind: 'correspondence';
|
|
7
|
-
readonly desired:
|
|
7
|
+
readonly desired: LocalAlias;
|
|
8
8
|
} | {
|
|
9
9
|
readonly kind: 'selection';
|
|
10
10
|
readonly query: QueryNodeAST | QueryEdgeAST;
|
|
@@ -4,7 +4,7 @@ export type QueryPremise = Extract<ReconciliationPlan['premises'][number], {
|
|
|
4
4
|
kind: 'query';
|
|
5
5
|
}>;
|
|
6
6
|
export type PointPremise = Exclude<ReconciliationPlan['premises'][number], QueryPremise>;
|
|
7
|
-
|
|
7
|
+
type MutationAssessment = {
|
|
8
8
|
readonly kind: 'supported';
|
|
9
9
|
readonly pointPremises: readonly PointPremise[];
|
|
10
10
|
readonly queryPremises: readonly QueryPremise[];
|
|
@@ -14,3 +14,4 @@ export type MutationAssessment = {
|
|
|
14
14
|
};
|
|
15
15
|
/** Classify whether one complete semantic plan fits the target's atomic Mutation profile. */
|
|
16
16
|
export declare function assess(plan: ReconciliationPlan, profile: MutationRealizationProfile): MutationAssessment;
|
|
17
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphData,
|
|
1
|
+
import type { GraphData, LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { Node, NodeId } from '../node/index.js';
|
|
3
3
|
import type { Correspondence, CorrespondenceEntry } from './correspondence.js';
|
|
4
4
|
import type { EvidenceRequirement, ObservationEvidence } from './evidence.js';
|
|
@@ -16,11 +16,12 @@ export type ObservationConflict = {
|
|
|
16
16
|
readonly kind: 'observation-evidence-contradiction';
|
|
17
17
|
readonly requirement: EvidenceRequirement;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
interface ObservationAnalysis {
|
|
20
20
|
readonly nodes: ReadonlyMap<NodeId, Node>;
|
|
21
21
|
readonly edges: ReadonlyMap<string, Edge>;
|
|
22
22
|
readonly evidence: readonly ObservationEvidence[];
|
|
23
23
|
readonly conflicts: readonly ObservationConflict[];
|
|
24
24
|
}
|
|
25
25
|
/** Index finite facts and classify contradictory or duplicate evidence. */
|
|
26
|
-
export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<
|
|
26
|
+
export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<LocalAlias, CorrespondenceEntry>): ObservationAnalysis;
|
|
27
|
+
export {};
|
|
@@ -2,15 +2,15 @@ import { type CorrespondenceEntry } from '#graph/reconcile/correspondence';
|
|
|
2
2
|
import { type ObservationEvidence, type ObservationRequirement } from '#graph/reconcile/evidence';
|
|
3
3
|
import { type Observation } from '#graph/reconcile/observation';
|
|
4
4
|
import type { Edge } from '../../edge/index.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { LocalAlias } from '../../graph/index.js';
|
|
6
6
|
import type { Node, NodeId } from '../../node/index.js';
|
|
7
7
|
import type { Effect, PlanningBlocker, PlanningConflict, Premise } from './model.js';
|
|
8
8
|
import { type DesiredProperties } from '../../properties/index.js';
|
|
9
9
|
export interface PlanningContext {
|
|
10
10
|
readonly nodes: ReadonlyMap<NodeId, Node>;
|
|
11
11
|
readonly edges: ReadonlyMap<string, Edge>;
|
|
12
|
-
readonly correspondence: ReadonlyMap<
|
|
13
|
-
readonly created: Set<
|
|
12
|
+
readonly correspondence: ReadonlyMap<LocalAlias, CorrespondenceEntry>;
|
|
13
|
+
readonly created: Set<LocalAlias>;
|
|
14
14
|
readonly evidence: readonly ObservationEvidence[];
|
|
15
15
|
readonly premises: Premise[];
|
|
16
16
|
readonly effects: Effect[];
|
|
@@ -3,12 +3,12 @@ import type { CorrespondenceConflict } from '#graph/reconcile/correspondence';
|
|
|
3
3
|
import type { ObservationRequirement, QueryObservation } from '#graph/reconcile/evidence';
|
|
4
4
|
import type { ObservationConflict } from '#graph/reconcile/observation';
|
|
5
5
|
import type { EdgeKey, EdgeSlug } from '../../edge/index.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { LocalAlias } from '../../graph/index.js';
|
|
7
7
|
import type { NodeId } from '../../node/index.js';
|
|
8
8
|
import type { Delta, DesiredProperties, Properties } from '../../properties/index.js';
|
|
9
9
|
import type { DesiredFingerprint, DesiredSelection, Expectation, ReconcileConflict } from '../condition/index.js';
|
|
10
10
|
export type ResolvedNodeRef = NodeId | {
|
|
11
|
-
readonly created:
|
|
11
|
+
readonly created: LocalAlias;
|
|
12
12
|
};
|
|
13
13
|
export interface ResolvedEdgeRef {
|
|
14
14
|
readonly source: ResolvedNodeRef;
|
|
@@ -35,7 +35,7 @@ export interface QueryPremise {
|
|
|
35
35
|
}
|
|
36
36
|
export type Effect = {
|
|
37
37
|
readonly op: 'node.create';
|
|
38
|
-
readonly as:
|
|
38
|
+
readonly as: LocalAlias;
|
|
39
39
|
readonly class: ClassKey;
|
|
40
40
|
readonly properties: Properties;
|
|
41
41
|
} | {
|
|
@@ -63,7 +63,7 @@ export type Effect = {
|
|
|
63
63
|
};
|
|
64
64
|
export type PlanningConflict = ReconcileConflict | CorrespondenceConflict | ObservationConflict | {
|
|
65
65
|
readonly kind: 'desired-binding-uncreated';
|
|
66
|
-
readonly desired:
|
|
66
|
+
readonly desired: LocalAlias;
|
|
67
67
|
} | {
|
|
68
68
|
readonly kind: 'node-class-observed';
|
|
69
69
|
readonly node: NodeId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type builder } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const Entrypoint: builder.DirectedEdgeClass<{
|
|
3
3
|
readonly depth: 1;
|
|
4
4
|
readonly abstract: false;
|
|
5
5
|
readonly extends: readonly [builder.ClassReferenceProjection<"edge", {
|
|
@@ -19,12 +19,14 @@ export declare const ViewFor: builder.DirectedEdgeClass<{
|
|
|
19
19
|
readonly properties: never;
|
|
20
20
|
readonly source: {
|
|
21
21
|
readonly as: "view";
|
|
22
|
-
readonly outgoing: "1
|
|
22
|
+
readonly outgoing: "0..1";
|
|
23
23
|
};
|
|
24
24
|
readonly target: {
|
|
25
|
-
readonly as: "
|
|
26
|
-
readonly incoming: "0
|
|
25
|
+
readonly as: "domain";
|
|
26
|
+
readonly incoming: "0..1";
|
|
27
|
+
};
|
|
28
|
+
readonly constraints: {
|
|
29
|
+
readonly noSelf: true;
|
|
27
30
|
};
|
|
28
|
-
readonly constraints: Record<never, never>;
|
|
29
31
|
readonly effectiveProperties: never;
|
|
30
32
|
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
import { Domain } from '../domain/index.js';
|
|
3
|
+
import { Edge } from '../meta/index.js';
|
|
4
|
+
import { View } from './view.js';
|
|
5
|
+
export const Entrypoint = edgeClass.directed({
|
|
6
|
+
abstract: false,
|
|
7
|
+
source: { as: 'view', accepts: [View], outgoing: '0..1' },
|
|
8
|
+
target: { as: 'domain', accepts: [Domain], incoming: '0..1' },
|
|
9
|
+
description: 'The one View a Domain opens by default; a Domain declares at most one.',
|
|
10
|
+
extends: [Edge],
|
|
11
|
+
constraints: { noSelf: true },
|
|
12
|
+
});
|