@astrale-os/kernel-core 0.9.0-beta.52 → 0.9.0-beta.53

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.
@@ -3,8 +3,12 @@ import { AuthValueError } from '../error.js';
3
3
  import { admitAuthorityExpr } from './admission/index.js';
4
4
  import { AUTHORITY_PREDICATE_VERSION } from './language/index.js';
5
5
  import { canonicalizeAdmitted } from './normalization/index.js';
6
+ import { ownsCanonical } from './ownership.optimization.js';
6
7
  /** Re-admit one persisted or crossing canonical authority predicate. */
7
8
  export function accept(input) {
9
+ // The owner retains only deeply immutable, detached canonical predicates.
10
+ if (ownsCanonical(input))
11
+ return input;
8
12
  try {
9
13
  const admitted = portable.accept(input);
10
14
  if (admitted === null || Array.isArray(admitted) || typeof admitted !== 'object') {
@@ -1,7 +1,19 @@
1
+ import * as portable from '@astrale-os/kernel-dsl/value';
1
2
  // Static construction provenance only. No evaluated authority or graph facts live here.
2
3
  const canonical = new WeakSet();
3
4
  /** Called only by the owner after detachment, admission and immutable normalization. */
4
5
  export function ownCanonical(predicate) {
6
+ // Carry immutable structural provenance through containing Plans as well as Core calls.
7
+ // The normalized envelope can exceed a portable boundary's default budget even when the
8
+ // constructor's expression fits. In that case retain Core ownership only: a later crossing
9
+ // still applies its own limits, without adding a new constructor failure here.
10
+ try {
11
+ predicate = portable.acceptImmutable(predicate);
12
+ }
13
+ catch (cause) {
14
+ if (!(cause instanceof portable.BoundaryError) || cause.code !== 'VALUE_LIMIT')
15
+ throw cause;
16
+ }
5
17
  canonical.add(predicate);
6
18
  return predicate;
7
19
  }
@@ -95,8 +95,9 @@ function walk(domain, payload) {
95
95
  [K.classes.of_domain.self.properties.member.key]: `core.${slug}`,
96
96
  })));
97
97
  }
98
- for (const declaration of domainSchema.core.edges) {
99
- addEdge(coreEdges, coreEndpoint(declaration.source, domain, persistedDomainEndpoint, coreLocations), coreEndpoint(declaration.target, domain, persistedDomainEndpoint, coreLocations), declaration.class, payload(() => declaration.properties));
98
+ // Resolved edges carry each endpoint's own identity; the source IR only names it.
99
+ for (const edge of domain.core.edges) {
100
+ addEdge(coreEdges, coreEndpoint(edge.source, domain, persistedDomainEndpoint, coreLocations), coreEndpoint(edge.target, domain, persistedDomainEndpoint, coreLocations), edge.class.ref, payload(() => edge.properties));
100
101
  }
101
102
  return Object.freeze({
102
103
  origin: domain.origin,
@@ -133,10 +134,16 @@ function projectionLocations(paths) {
133
134
  function invert(locations) {
134
135
  return new Map([...locations].map(([path, binding]) => [binding, path]));
135
136
  }
137
+ /**
138
+ * A Core Node binds inside the Core part; every other local Definition is already projected as a
139
+ * managed declaration, so it is addressed by its canonical Path exactly like the owning Domain.
140
+ */
136
141
  function coreEndpoint(value, domain, domainEndpoint, locations) {
137
- if (value.kind === 'domain')
138
- return domainEndpoint;
139
- return endpoint(PathValue.project({ origin: domain.origin, kind: 'core', name: value.name }).raw, locations);
142
+ if ('ref' in value)
143
+ return endpoint(PathValue.project(value.ref).raw, locations);
144
+ if ('owner' in value)
145
+ return endpoint(projectedMethodPath(domain, value), locations);
146
+ return domainEndpoint;
140
147
  }
141
148
  function projectDefinitionRelations(domain, definition, definitionEndpoint, locations, edges, payload) {
142
149
  if (isResolvedClass(definition)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/kernel-core",
3
- "version": "0.9.0-beta.52",
3
+ "version": "0.9.0-beta.53",
4
4
  "description": "Astrale Kernel Core - Types, Invariants, and Pure Logic",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -160,7 +160,7 @@
160
160
  "access": "public"
161
161
  },
162
162
  "dependencies": {
163
- "@astrale-os/kernel-dsl": "0.2.0-beta.37",
163
+ "@astrale-os/kernel-dsl": "0.2.0-beta.38",
164
164
  "@noble/hashes": "2.3.0",
165
165
  "@types/json-schema": "^7.0.15",
166
166
  "dequal": "2.0.3"