@astrale-os/sdk 0.6.0-beta.11 → 0.6.0-beta.13
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/README.md +8 -5
- package/dist/application/action/context.d.ts +5 -6
- package/dist/application/dependency/invoker.d.ts +2 -2
- package/dist/execution/identity/authentication.d.ts +3 -2
- package/dist/execution/identity/authentication.js +14 -6
- package/dist/execution/identity/callback.d.ts +2 -12
- package/dist/execution/identity/callback.js +3 -9
- package/dist/execution/invocation/admission/authentication.d.ts +2 -6
- package/dist/execution/invocation/admission/authentication.js +9 -22
- package/dist/execution/invocation/admission/authority.d.ts +2 -2
- package/dist/execution/invocation/dependency/bind.d.ts +1 -1
- package/dist/execution/invocation/dependency/bind.js +0 -1
- package/dist/execution/invocation/dispatch/context.js +0 -1
- package/dist/execution/invocation/result/project.js +41 -1
- package/dist/tooling/linter/implementations/source/dependencies.js +8 -6
- package/dist/tooling/linter/policy/generated.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,8 +75,9 @@ deployment's URL is its issuer, so `assemble(build, buildDigest, url)` takes the
|
|
|
75
75
|
## Handler authority and dependencies
|
|
76
76
|
|
|
77
77
|
Authenticated handlers use Domain self authority for `kernel`, `graph`, `query`, and `mutate`.
|
|
78
|
-
`dependencies.directory.invoke(d => d.functions.lookup, input)` calls a direct declared
|
|
79
|
-
|
|
78
|
+
`dependencies.directory.caller.invoke(d => d.functions.lookup, input)` calls a direct declared
|
|
79
|
+
dependency on behalf of the incoming caller Identity; `.self` calls it as the executing Domain.
|
|
80
|
+
Explicit `caller` or `self` authority is also available on `kernel` and `graph`; the former
|
|
80
81
|
handler `client` is removed. See [the API and migration guide](docs/handler-dependencies.md).
|
|
81
82
|
|
|
82
83
|
## Durable Workflows
|
|
@@ -289,7 +290,7 @@ const session = connect({
|
|
|
289
290
|
// Return { credential, expiresAt } with expiresAt in Unix milliseconds.
|
|
290
291
|
mint: (signal) => mintSourceCredential(signal),
|
|
291
292
|
}),
|
|
292
|
-
exchange: {},
|
|
293
|
+
exchange: { mode: 'auto' },
|
|
293
294
|
})
|
|
294
295
|
|
|
295
296
|
await session.call({ target: '/:orders.example:class.Order:create', input }) // Domain callable
|
|
@@ -299,8 +300,10 @@ await session.graph.get('@order-id') // Kernel callable: the source credential
|
|
|
299
300
|
- **Hold the source in a provider.** Domain credentials are cached per source credential, so a
|
|
300
301
|
`resolve` that returns a new token on every call also exchanges on every call. The provider also
|
|
301
302
|
lets the Session renew a source that is too close to expiry to feed a Domain credential.
|
|
302
|
-
- **Lifetimes.** `exchange
|
|
303
|
-
5-second settlement skew. A Domain credential never outlives its
|
|
303
|
+
- **Lifetimes.** In `exchange: { mode: 'auto', ttlSeconds }`, `ttlSeconds` (default 300) must exceed
|
|
304
|
+
the provider's `ttlSeconds` plus a 5-second settlement skew. A Domain credential never outlives its
|
|
305
|
+
source. `exchange: { mode: 'source' }` keeps the source credential for every Call and takes no
|
|
306
|
+
`ttlSeconds`; an empty `{}` or a bare `{ ttlSeconds }` is rejected.
|
|
304
307
|
- **Reading as a Domain.** To call Kernel callables as a Domain, for example to read Shell-owned
|
|
305
308
|
Classes, feed a second Session from an explicit exchange:
|
|
306
309
|
`createSessionCredentialProvider({ ttlSeconds: 60, mint: (signal) => session.exchange(shellIssuer, { signal }) })`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthenticationEvidence,
|
|
1
|
+
import type { AuthenticationEvidence, IdentityId } from '../../platform/auth/index.js';
|
|
2
2
|
import type { BoundClientSession } from '../../platform/client/session/index.js';
|
|
3
3
|
import type { NodeId } from '../../platform/graph/node/index.js';
|
|
4
4
|
import type { CallableInputOf, CallableInputModeOf, Domain, ResolvedFunction, ResolvedMethod } from '../../platform/schema/index.js';
|
|
@@ -11,11 +11,10 @@ export type ResolvedCallable = ResolvedFunction | ResolvedMethod;
|
|
|
11
11
|
/** Bearer-free caller evidence established before an Action or Workflow runs. */
|
|
12
12
|
export interface AuthenticatedCaller {
|
|
13
13
|
readonly kind: 'authenticated';
|
|
14
|
-
/**
|
|
14
|
+
/** The one Identity whose authority this invocation exercises: ownership and attribution. */
|
|
15
15
|
readonly identity: IdentityId;
|
|
16
|
-
/**
|
|
16
|
+
/** Executor whose credential directly authenticated this invocation (for example this Domain). */
|
|
17
17
|
readonly principal: IdentityId;
|
|
18
|
-
readonly authority: Grant;
|
|
19
18
|
readonly authentication: AuthenticationEvidence;
|
|
20
19
|
}
|
|
21
20
|
export interface AnonymousCaller {
|
|
@@ -48,9 +47,9 @@ export interface DomainGraphExecutor<DomainValue extends Domain = Domain> {
|
|
|
48
47
|
readonly query: QueryExecutor<DomainValue>;
|
|
49
48
|
readonly mutate: MutationExecutor<DomainValue>;
|
|
50
49
|
}
|
|
51
|
-
export type DomainGraphExecutors<DomainValue extends Domain = Domain> = Readonly<DomainGraphExecutor<DomainValue> & Record<'caller' | 'self'
|
|
50
|
+
export type DomainGraphExecutors<DomainValue extends Domain = Domain> = Readonly<DomainGraphExecutor<DomainValue> & Record<'caller' | 'self', DomainGraphExecutor<DomainValue>>>;
|
|
52
51
|
/** Self-default Kernel session with one level of explicit authority selection. */
|
|
53
|
-
export type DomainKernelSessions = Readonly<BoundClientSession & Record<'caller' | 'self'
|
|
52
|
+
export type DomainKernelSessions = Readonly<BoundClientSession & Record<'caller' | 'self', BoundClientSession>>;
|
|
54
53
|
type AuthorityOf<Callable, DomainValue extends Domain> = Callable extends {
|
|
55
54
|
readonly auth: 'anonymous';
|
|
56
55
|
} ? {
|
|
@@ -22,10 +22,10 @@ export interface DependencyInvoker<D extends Domain> {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Direct Schema aliases with explicit authority selection and no default invoke.
|
|
25
|
-
* self is the executing Domain; caller forwards the incoming
|
|
25
|
+
* self is the executing Domain; caller forwards the incoming caller Identity.
|
|
26
26
|
* The canonical Kernel is exposed through context.kernel.
|
|
27
27
|
*/
|
|
28
28
|
export type HandlerDependencies<D extends Domain> = Readonly<{
|
|
29
|
-
[Alias in keyof D['dependencies'] as D['dependencies'][Alias] extends schema.DomainOf<KernelSchema> ? never : Alias]: Readonly<Record<'caller' | 'self'
|
|
29
|
+
[Alias in keyof D['dependencies'] as D['dependencies'][Alias] extends schema.DomainOf<KernelSchema> ? never : Alias]: Readonly<Record<'caller' | 'self', DependencyInvoker<Extract<D['dependencies'][Alias], Domain>>>>;
|
|
30
30
|
}>;
|
|
31
31
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fetch } from '@astrale-os/kernel-client';
|
|
2
|
-
import type { CredentialInput,
|
|
2
|
+
import type { CredentialInput, IdentityId, IssuerId } from '../../platform/auth/index.js';
|
|
3
3
|
import type { AuthenticatedInvocation } from '../invocation/index.js';
|
|
4
4
|
import type { InvocationAdmissionInput } from '../invocation/index.js';
|
|
5
5
|
import type { IdentityNetworkPolicy, VerificationBasis, VerificationBasisResolver } from './jwks.js';
|
|
@@ -26,5 +26,6 @@ export declare function executorSession(kernel: IssuerId, execution: {
|
|
|
26
26
|
readonly deadline: number;
|
|
27
27
|
readonly signal: AbortSignal;
|
|
28
28
|
}, configuration: AuthenticationConfiguration): ClientSession;
|
|
29
|
-
|
|
29
|
+
/** Accept a Kernel delegation proof claim naming exactly one resolved caller Identity. */
|
|
30
|
+
export declare function acceptResolvedDelegation(input: unknown): IdentityId;
|
|
30
31
|
export type { VerificationBasis };
|
|
@@ -54,12 +54,10 @@ export async function authenticate(credentialInput, expectedKernel, execution, c
|
|
|
54
54
|
const sessions = Object.freeze({
|
|
55
55
|
caller: session(expressions.caller),
|
|
56
56
|
self: session(expressions.self),
|
|
57
|
-
union: session(expressions.union),
|
|
58
57
|
});
|
|
59
58
|
const graph = Object.freeze({
|
|
60
59
|
caller: bindSession(sessions.caller, execution),
|
|
61
60
|
self: bindSession(sessions.self, execution),
|
|
62
|
-
union: bindSession(sessions.union, execution),
|
|
63
61
|
});
|
|
64
62
|
let closed = false;
|
|
65
63
|
return Object.freeze({
|
|
@@ -71,7 +69,6 @@ export async function authenticate(credentialInput, expectedKernel, execution, c
|
|
|
71
69
|
closed = true;
|
|
72
70
|
sessions.caller.close();
|
|
73
71
|
sessions.self.close();
|
|
74
|
-
sessions.union.close();
|
|
75
72
|
},
|
|
76
73
|
});
|
|
77
74
|
}
|
|
@@ -122,7 +119,7 @@ async function establishCaller(input, audience, verification, execution, policy)
|
|
|
122
119
|
if (proof.verified.sub !== context.verified.sub) {
|
|
123
120
|
throw new CredentialRejected('Destination carrier and authority proof subjects differ.');
|
|
124
121
|
}
|
|
125
|
-
const
|
|
122
|
+
const identity = acceptResolvedDelegation(proof.verified.claims.delegation);
|
|
126
123
|
let principal;
|
|
127
124
|
try {
|
|
128
125
|
principal = NodeId(context.verified.sub);
|
|
@@ -136,7 +133,7 @@ async function establishCaller(input, audience, verification, execution, policy)
|
|
|
136
133
|
caller: Object.freeze({
|
|
137
134
|
kind: 'authenticated',
|
|
138
135
|
principal,
|
|
139
|
-
|
|
136
|
+
identity,
|
|
140
137
|
authentication: credential.evidence(context),
|
|
141
138
|
}),
|
|
142
139
|
});
|
|
@@ -147,6 +144,7 @@ async function establishCaller(input, audience, verification, execution, policy)
|
|
|
147
144
|
throw protocolError('BACKEND_UNAVAILABLE', 'Credential issuer is unavailable.');
|
|
148
145
|
}
|
|
149
146
|
if (cause instanceof CredentialRejected ||
|
|
147
|
+
cause instanceof AuthValueError ||
|
|
150
148
|
cause instanceof joseErrors.JOSEError ||
|
|
151
149
|
cause instanceof protocolErrors.ProtocolError) {
|
|
152
150
|
throw protocolError('AUTH_INVALID', 'Credential is invalid.');
|
|
@@ -154,6 +152,7 @@ async function establishCaller(input, audience, verification, execution, policy)
|
|
|
154
152
|
throw cause;
|
|
155
153
|
}
|
|
156
154
|
}
|
|
155
|
+
/** Accept a Kernel delegation proof claim naming exactly one resolved caller Identity. */
|
|
157
156
|
export function acceptResolvedDelegation(input) {
|
|
158
157
|
if (input === null ||
|
|
159
158
|
typeof input !== 'object' ||
|
|
@@ -164,5 +163,14 @@ export function acceptResolvedDelegation(input) {
|
|
|
164
163
|
Reflect.get(input, 'v') !== 1) {
|
|
165
164
|
throw new AuthValueError('AUTH_GRANT_INVALID', 'Expected resolved delegation.');
|
|
166
165
|
}
|
|
167
|
-
|
|
166
|
+
const raw = Reflect.get(input, 'expr');
|
|
167
|
+
// grant.accept collapses duplicate operands (union(X, X) becomes X), so the leaf is checked as sent.
|
|
168
|
+
if (raw === null || typeof raw !== 'object' || Reflect.get(raw, 'kind') !== 'identity') {
|
|
169
|
+
throw new AuthValueError('AUTH_GRANT_INVALID', 'Expected one resolved caller Identity.');
|
|
170
|
+
}
|
|
171
|
+
const { expr } = grant.accept({ expr: raw });
|
|
172
|
+
if (expr.kind !== 'identity') {
|
|
173
|
+
throw new AuthValueError('AUTH_GRANT_INVALID', 'Expected one resolved caller Identity.');
|
|
174
|
+
}
|
|
175
|
+
return expr.id;
|
|
168
176
|
}
|
|
@@ -7,13 +7,13 @@ export interface SignedCallback {
|
|
|
7
7
|
readonly expiresAt: number;
|
|
8
8
|
readonly delegateTtlSeconds: number;
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
10
|
+
export type CallbackMode = 'caller' | 'self';
|
|
11
11
|
/** The Domain's own authority, independent of any caller. */
|
|
12
12
|
export declare const selfIdentity: Readonly<{
|
|
13
13
|
kind: 'identity';
|
|
14
14
|
self: true;
|
|
15
15
|
}>;
|
|
16
|
-
/** Exact callback
|
|
16
|
+
/** Exact single-identity callback authority for each Kernel Domain graph mode. */
|
|
17
17
|
export declare function callbackIdentities(nested: string | Uint8Array): Readonly<{
|
|
18
18
|
caller: Readonly<{
|
|
19
19
|
kind: 'identity';
|
|
@@ -23,16 +23,6 @@ export declare function callbackIdentities(nested: string | Uint8Array): Readonl
|
|
|
23
23
|
kind: 'identity';
|
|
24
24
|
self: true;
|
|
25
25
|
}>;
|
|
26
|
-
union: Readonly<{
|
|
27
|
-
kind: 'union';
|
|
28
|
-
operands: readonly (Readonly<{
|
|
29
|
-
kind: 'identity';
|
|
30
|
-
self: true;
|
|
31
|
-
}> | Readonly<{
|
|
32
|
-
kind: 'identity';
|
|
33
|
-
credential: string | Uint8Array<ArrayBufferLike>;
|
|
34
|
-
}>)[];
|
|
35
|
-
}>;
|
|
36
26
|
}>;
|
|
37
27
|
export declare function signDomainCallback(signing: SigningMaterial, issuer: IssuerId, subject: string, audience: IssuerId, execution: {
|
|
38
28
|
readonly deadline: number;
|
|
@@ -6,17 +6,11 @@ export const maximumCallbackDelegationTtlSeconds = 60;
|
|
|
6
6
|
const CALLBACK_DELEGATION_SKEW_SECONDS = 5;
|
|
7
7
|
/** The Domain's own authority, independent of any caller. */
|
|
8
8
|
export const selfIdentity = Object.freeze({ kind: 'identity', self: true });
|
|
9
|
-
/** Exact callback
|
|
9
|
+
/** Exact single-identity callback authority for each Kernel Domain graph mode. */
|
|
10
10
|
export function callbackIdentities(nested) {
|
|
11
|
-
const caller = Object.freeze({ kind: 'identity', credential: nested });
|
|
12
|
-
const self = selfIdentity;
|
|
13
11
|
return Object.freeze({
|
|
14
|
-
caller,
|
|
15
|
-
self,
|
|
16
|
-
union: Object.freeze({
|
|
17
|
-
kind: 'union',
|
|
18
|
-
operands: Object.freeze([self, caller]),
|
|
19
|
-
}),
|
|
12
|
+
caller: Object.freeze({ kind: 'identity', credential: nested }),
|
|
13
|
+
self: selfIdentity,
|
|
20
14
|
});
|
|
21
15
|
}
|
|
22
16
|
export async function signDomainCallback(signing, issuer, subject, audience, execution) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HandlerRequest } from '@astrale-os/kernel-server';
|
|
2
|
-
import type { AnonymousCaller,
|
|
2
|
+
import type { AnonymousCaller, ResolvedCallable } from '../../../application/action/index.js';
|
|
3
3
|
import type { Release } from '../../../deployment/release/legacy/index.js';
|
|
4
4
|
import type { Domain } from '../../../platform/schema/index.js';
|
|
5
5
|
import type { AuthenticatedInvocation, InvocationAuthority } from './authority.js';
|
|
@@ -9,9 +9,5 @@ export interface AnonymousInvocation {
|
|
|
9
9
|
readonly graph: null;
|
|
10
10
|
close(): void;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
readonly caller: AuthenticatedCaller;
|
|
14
|
-
}
|
|
15
|
-
export type InvocationAuthentication = AnonymousInvocation | AdmittedAuthenticatedInvocation;
|
|
12
|
+
export type InvocationAuthentication = AnonymousInvocation | AuthenticatedInvocation;
|
|
16
13
|
export declare function authentication(callable: ResolvedCallable, request: HandlerRequest, release: Release, domain: Domain, authority: InvocationAuthority): Promise<InvocationAuthentication>;
|
|
17
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { issuer } from '../../../platform/auth/index.js';
|
|
2
2
|
import { bindSession } from '../../../platform/client/session/index.js';
|
|
3
3
|
import { NodeId } from '../../../platform/graph/node/index.js';
|
|
4
4
|
import { protocolError } from '../result/index.js';
|
|
@@ -40,7 +40,6 @@ export async function authentication(callable, request, release, domain, authori
|
|
|
40
40
|
const graph = Object.freeze({
|
|
41
41
|
caller: bindSession(graphInput.caller),
|
|
42
42
|
self: bindSession(graphInput.self),
|
|
43
|
-
union: bindSession(graphInput.union),
|
|
44
43
|
});
|
|
45
44
|
return Object.freeze({ caller, graph, close });
|
|
46
45
|
}
|
|
@@ -62,8 +61,7 @@ function admitGraph(input) {
|
|
|
62
61
|
Array.isArray(input) ||
|
|
63
62
|
!Object.hasOwn(input, 'caller') ||
|
|
64
63
|
!Object.hasOwn(input, 'self') ||
|
|
65
|
-
|
|
66
|
-
Reflect.ownKeys(input).some((key) => key !== 'caller' && key !== 'self' && key !== 'union')) {
|
|
64
|
+
Reflect.ownKeys(input).some((key) => key !== 'caller' && key !== 'self')) {
|
|
67
65
|
invalid();
|
|
68
66
|
}
|
|
69
67
|
return input;
|
|
@@ -79,29 +77,18 @@ function admitCaller(input) {
|
|
|
79
77
|
invalid();
|
|
80
78
|
if (!Object.hasOwn(input, 'kind') ||
|
|
81
79
|
!Object.hasOwn(input, 'principal') ||
|
|
82
|
-
!Object.hasOwn(input, '
|
|
80
|
+
!Object.hasOwn(input, 'identity') ||
|
|
83
81
|
!Object.hasOwn(input, 'authentication') ||
|
|
84
|
-
Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'principal' && key !== '
|
|
82
|
+
Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'principal' && key !== 'identity' && key !== 'authentication') ||
|
|
85
83
|
Reflect.get(input, 'kind') !== 'authenticated') {
|
|
86
84
|
invalid();
|
|
87
85
|
}
|
|
88
|
-
|
|
89
|
-
const authority = grant.accept(Reflect.get(input, 'authority'));
|
|
90
|
-
const authentication = admitEvidence(Reflect.get(input, 'authentication'));
|
|
91
|
-
const caller = {
|
|
86
|
+
return Object.freeze({
|
|
92
87
|
kind: 'authenticated',
|
|
93
|
-
get identity
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return authority.expr.id;
|
|
98
|
-
},
|
|
99
|
-
principal,
|
|
100
|
-
authority,
|
|
101
|
-
authentication,
|
|
102
|
-
};
|
|
103
|
-
Object.defineProperty(caller, 'identity', { enumerable: false });
|
|
104
|
-
return Object.freeze(caller);
|
|
88
|
+
identity: NodeId(Reflect.get(input, 'identity')),
|
|
89
|
+
principal: NodeId(Reflect.get(input, 'principal')),
|
|
90
|
+
authentication: admitEvidence(Reflect.get(input, 'authentication')),
|
|
91
|
+
});
|
|
105
92
|
}
|
|
106
93
|
function admitEvidence(input) {
|
|
107
94
|
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
@@ -21,8 +21,8 @@ export interface InvocationAuthenticationInput {
|
|
|
21
21
|
}
|
|
22
22
|
/** Authenticated capabilities before the SDK admits and derives application caller context. */
|
|
23
23
|
export interface AuthenticatedInvocation {
|
|
24
|
-
readonly caller:
|
|
25
|
-
readonly graph: Readonly<Record<'caller' | 'self'
|
|
24
|
+
readonly caller: AuthenticatedCaller;
|
|
25
|
+
readonly graph: Readonly<Record<'caller' | 'self', BoundClientSession>>;
|
|
26
26
|
close(): void;
|
|
27
27
|
}
|
|
28
28
|
export interface InvocationAuthority {
|
|
@@ -2,4 +2,4 @@ import type { HandlerDependencies } from '../../../application/dependency/index.
|
|
|
2
2
|
import type { BoundClientSession } from '../../../platform/client/session/index.js';
|
|
3
3
|
import type { Domain } from '../../../platform/schema/index.js';
|
|
4
4
|
/** Bind each explicit authority to its admitted session; metadata remains inert. */
|
|
5
|
-
export declare function bindDependencies<D extends Domain>(domain: D, sessions: Readonly<Record<'caller' | 'self'
|
|
5
|
+
export declare function bindDependencies<D extends Domain>(domain: D, sessions: Readonly<Record<'caller' | 'self', BoundClientSession>>): HandlerDependencies<D>;
|
|
@@ -12,7 +12,6 @@ export function bindDependencies(domain, sessions) {
|
|
|
12
12
|
dependencies[alias] = Object.freeze({
|
|
13
13
|
caller: bindDependency(dependency, sessions.caller),
|
|
14
14
|
self: bindDependency(dependency, sessions.self),
|
|
15
|
-
union: bindDependency(dependency, sessions.union),
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
return Object.freeze(dependencies);
|
|
@@ -2,6 +2,10 @@ import { InvocationDefect } from './errors.js';
|
|
|
2
2
|
import { validateOutput } from './validate.js';
|
|
3
3
|
const MEDIA_TYPE = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u;
|
|
4
4
|
const HEADER_NAME = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u;
|
|
5
|
+
const BUFFERED_FIELDS = new Set(['body', 'mediaType', 'status', 'headers']);
|
|
6
|
+
const STREAMING_FIELDS = new Set([...BUFFERED_FIELDS, 'length', 'delivery']);
|
|
7
|
+
/** Largest delay a host timer accepts; the Server rejects a longer delivery budget. */
|
|
8
|
+
const MAXIMUM_TIMER_MS = 2_147_483_647;
|
|
5
9
|
export function project(callable, output) {
|
|
6
10
|
switch (callable.output.mode) {
|
|
7
11
|
case 'value':
|
|
@@ -72,7 +76,8 @@ function binary(input) {
|
|
|
72
76
|
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
73
77
|
invalidBinary();
|
|
74
78
|
const value = input;
|
|
75
|
-
|
|
79
|
+
const fields = isBytes(value.body) ? BUFFERED_FIELDS : STREAMING_FIELDS;
|
|
80
|
+
if (Reflect.ownKeys(input).some((key) => typeof key !== 'string' || !fields.has(key)) ||
|
|
76
81
|
(!isBytes(value.body) && !isAsyncBytes(value.body)) ||
|
|
77
82
|
typeof value.mediaType !== 'string' ||
|
|
78
83
|
!MEDIA_TYPE.test(value.mediaType) ||
|
|
@@ -89,13 +94,48 @@ function binary(input) {
|
|
|
89
94
|
...(headers === undefined ? {} : { headers }),
|
|
90
95
|
});
|
|
91
96
|
}
|
|
97
|
+
const length = streamingLength(value.length);
|
|
98
|
+
const delivery = deliveryBudget(value.delivery);
|
|
92
99
|
return Object.freeze({
|
|
93
100
|
body: new InvocationByteStream(value.body),
|
|
94
101
|
mediaType: value.mediaType,
|
|
102
|
+
// The declared length is the only count a Client verifies a streaming delivery against.
|
|
103
|
+
...(length === undefined ? {} : { length }),
|
|
104
|
+
...(delivery === undefined ? {} : { delivery }),
|
|
95
105
|
...(value.status === undefined ? {} : { status: value.status }),
|
|
96
106
|
...(headers === undefined ? {} : { headers }),
|
|
97
107
|
});
|
|
98
108
|
}
|
|
109
|
+
function streamingLength(input) {
|
|
110
|
+
if (input === undefined)
|
|
111
|
+
return undefined;
|
|
112
|
+
if (typeof input !== 'number' || !Number.isSafeInteger(input) || input < 0)
|
|
113
|
+
invalidBinary();
|
|
114
|
+
return input;
|
|
115
|
+
}
|
|
116
|
+
function deliveryBudget(input) {
|
|
117
|
+
if (input === undefined)
|
|
118
|
+
return undefined;
|
|
119
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
120
|
+
invalidBinary();
|
|
121
|
+
const value = input;
|
|
122
|
+
if (Reflect.ownKeys(input).some((key) => key !== 'maximumDurationMs' && key !== 'idleTimeoutMs') ||
|
|
123
|
+
!isTimerDuration(value.maximumDurationMs) ||
|
|
124
|
+
!isTimerDuration(value.idleTimeoutMs) ||
|
|
125
|
+
value.idleTimeoutMs > value.maximumDurationMs) {
|
|
126
|
+
invalidBinary();
|
|
127
|
+
}
|
|
128
|
+
return Object.freeze({
|
|
129
|
+
maximumDurationMs: value.maximumDurationMs,
|
|
130
|
+
idleTimeoutMs: value.idleTimeoutMs,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function isTimerDuration(input) {
|
|
134
|
+
return (typeof input === 'number' &&
|
|
135
|
+
Number.isSafeInteger(input) &&
|
|
136
|
+
input > 0 &&
|
|
137
|
+
input <= MAXIMUM_TIMER_MS);
|
|
138
|
+
}
|
|
99
139
|
class InvocationByteStream {
|
|
100
140
|
source;
|
|
101
141
|
consumed = false;
|
|
@@ -5,7 +5,7 @@ import { ambiguity, calls, isForeignDomain, production, violation } from './shar
|
|
|
5
5
|
export const dependencyRules = [
|
|
6
6
|
{
|
|
7
7
|
id: 'FNC-XDOM-DECLARED',
|
|
8
|
-
ruleRevision: '
|
|
8
|
+
ruleRevision: '72f960f87ac682695ea495925e31d15b9bd640b25d90ac1dcc6a1329a0be51b0',
|
|
9
9
|
evaluate(project) {
|
|
10
10
|
const evidence = [];
|
|
11
11
|
for (const file of production(project, 'functions')) {
|
|
@@ -70,16 +70,18 @@ function observeInvocations(project) {
|
|
|
70
70
|
let alias;
|
|
71
71
|
let selector;
|
|
72
72
|
if (path[0] === 'dependencies') {
|
|
73
|
-
if (path.length !== 4 || !['caller', 'self'
|
|
74
|
-
evidence.push(violation(file, node, 'Dependency invocation requires one direct alias and one explicit caller
|
|
73
|
+
if (path.length !== 4 || !['caller', 'self'].includes(path[2])) {
|
|
74
|
+
evidence.push(violation(file, node, 'Dependency invocation requires one direct alias and one explicit caller or self authority.'));
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
alias = path[1];
|
|
78
78
|
selector = selectedCallable(node.arguments[0]);
|
|
79
79
|
}
|
|
80
|
-
else if (path[0] === 'kernel'
|
|
81
|
-
(path.length
|
|
82
|
-
(
|
|
80
|
+
else if (path[0] === 'kernel') {
|
|
81
|
+
if (path.length !== 2 && (path.length !== 3 || !['caller', 'self'].includes(path[1]))) {
|
|
82
|
+
evidence.push(violation(file, node, 'Kernel invocation requires the default, caller, or self authority.'));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
83
85
|
const argument = node.arguments[0];
|
|
84
86
|
if (!argument) {
|
|
85
87
|
evidence.push(violation(file, node, 'Kernel invocation requires one canonical typed reference.'));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Generated from the validated Domain knowledge catalog. Regenerate with pnpm sync:linter-policy. */
|
|
2
|
-
export const domainPolicyDigest = '
|
|
2
|
+
export const domainPolicyDigest = '696264a5f17296120501b7221e33e3c2f416d35bbddac02fbcdb0a4853c79180';
|
|
3
3
|
export const domainPolicySource = Object.freeze({
|
|
4
|
-
rules: "id\tscope\tkind\tseverity\tmessage\tverification\texample\nOWN-SEMANTIC\townership\tarchitecture\terror\tEvery semantic fact, rule, representation, transition, and failure meaning has exactly one owner\tInventory declarations by meaning and report each duplicate authority or ownerless concept\tsemantic-owner.md\nMOD-SUBMODULE\tmodules\tstructure\terror\tEvery semantic source file lives in a dedicated semantic submodule or its registered layer facade\tClassify every layer-root source file and report files outside the registered facade or public index\tsemantic-owner.md\nMOD-REQUIRED\tmodules\tstructure\terror\tEvery required layer and root file declared by the injected layout exists\tCompare admitted project entries with required layout entries and report each missing path\trequired-layout.md\nMOD-GOVERNED\tmodules\tstructure\terror\tEvery source file admitted by the Domain compilation scope belongs to a declared layer or supported root\tClassify admitted source paths after declared workspace and tooling delegation and report each unowned path\tgoverned-source.md\nROOT-FACADE\troots\tstructure\terror\tEvery registered layer facade is exposed through a curated public index\tInspect each layer index and facade and report private-owner behavior or misplaced facade declarations\tpackage-facade.md\nROOT-COMPOSE\troots\tstructure\terror\tPackage roots compose only policy-backed Schema, Runtime, frontend deployment, native Routes, Migrations, Provider-backed Integrations, and supported package journeys\tInspect declared composition and package roots and report behavior, provider protocol logic, recursive barrels, or unsupported exports\tcomposition-root.md\nROOT-PACKAGE\troots\tevidence\terror\tEvery public Schema package subpath maps one admitted source entrypoint to its deterministic published declaration and JavaScript targets\tCompare source and publish exports and reject missing duplicate non-Schema locally linked generated or Kernel-leaking package artifacts\tmulti-domain-package.md\nDEP-ALLOWLIST\tdependencies\tdependency\terror\tEvery direct cross-layer import and its runtime or type-only kind appears in the dependency allowlist and dependencies between distinct layers are acyclic\tResolve source imports, reject every absent or kind-mismatched edge, and detect cycles after excluding evidence edges\tsemantic-owner.md\nIMP-FACADE\timports\tdependency\terror\tEvery cross-submodule import uses the semantic owner's facade and every foreign Domain import uses its public package facade\tResolve imports and report private deep paths outside the importing submodule\tcross-domain.md\nIMP-SDK-BOUNDARY\timports\tdependency\terror\tDomain source imports Kernel Core and DSL authoring values only through semantic SDK subpaths\tInspect every static and literal dynamic import and report module specifiers rooted at @astrale-os/kernel-core or @astrale-os/kernel-dsl\tsdk-boundary.md\nIMP-LAYER-ALIAS\timports\tdependency\terror\tEvery local import crossing a layer or semantic-submodule boundary uses the registered # layer alias\tResolve relative imports and report each one whose target leaves the importing semantic submodule\tlayer-aliases.md\nIMP-ALIAS-CFG\timports\tdependency\terror\tPackage and TypeScript resolution exactly implement each active layer-facade and semantic-submodule alias\tCompare active and required layers with the injected alias registry and report missing, undeclared, or drifted mappings\talias-configuration.md\nIMP-STATIC\timports\tdependency\terror\tProduction dependency edges use analyzable static ESM declarations or literal import calls\tReject require calls, import-equals declarations, nonliteral import calls, and unresolved static dependency forms\tstatic-imports.md\nTYP-OWNER\ttypes\tarchitecture\terror\tEvery type and reusable expected error is colocated with the semantic concept that defines its meaning\tTrace each declaration to its semantic authority and report catch-all or remotely owned values\texpected-failure.md\nERR-EXPECTED\terrors\tdataflow\terror\tBoundaries map only declared expected failures and propagate unexpected defects\tInspect catches and result mappings and report broad fallback, swallowed defects, or mappings without a declared source failure\texpected-failure.md\nTST-NO-PROD-IMP\ttests\tdependency\terror\tProduction source imports no root or colocated Test artifact\tResolve production imports and report targets under Root Tests, __tests__, or test, spec, bench, and perf source files\ttest-import-boundary.md\nABS-EARNED\tabstractions\tarchitecture\terror\tAn invariant or real boundary earns an abstraction; reuse alone requires two independent consumers and no duplicated semantic behavior\tIdentify the invariant, boundary, or independent consumers for each abstraction and report reuse wrappers that duplicate an owner's semantics\tsemantic-owner.md\nABS-NO-REPO\tabstractions\tarchitecture\terror\tDomain source places no collection-shaped persistence facade between business code and canonical Query or Mutation definitions\tInspect persistence-facing contracts and report abstractions that replace graph identity, traversal, observation, or atomic change semantics\tsemantic-owner.md\nABS-CANON-GRAPH\tabstractions\tdeclaration\terror\tDomain source declares no alternate Query or Mutation language, AST, compiler, planner, or wire representation\tInspect graph-related declarations and report semantics not identical to canonical Kernel Query or Mutation values\tsemantic-owner.md\nTRUST-ADMIT-ONCE\ttrust\tdataflow\terror\tEvery untrusted value is admitted or translated exactly once at its owning boundary\tTrace values from each external boundary and report missing admission or repeated structural validation\texpected-failure.md\nQLT-EXHAUSTIVE\tquality\tbehavior\terror\tEvery closed alternative is handled exhaustively and no required failure becomes placeholder success\tTrace closed unions and failure paths and report permissive defaults, placeholder success, or catch-and-continue behavior\texpected-failure.md\nQLT-CANON-VALUES\tquality\tdataflow\terror\tNo unchecked cast fabricates a canonical Kernel identity, QueryAST, MutationAST, or admitted schema value\tScan casts to canonical values and require an owning constructor or decoder for each\tsemantic-owner.md\nQLT-DEF-IDS\tquality\tdeclaration\terror\tEvery top-level Query, Mutation, and Migration definition has a stable literal ID unique in its owning namespace\tExtract top-level definition IDs and report missing, dynamic, malformed, or duplicate values\tdefinition-identities.md\nQLT-TYPED-COORD\tquality\tdeclaration\terror\tQueries and Mutations derive graph coordinates from resolved DSL definitions instead of raw string or structural reconstruction\tReject raw PropertyKey calls and structural ClassPath objects; require canonical resolved Classes Properties and keys at graph boundaries\ttyped-coordinates.md\nNODE-INHERITED\tnodes\tdeclaration\terror\tNo Node Class redeclares name, description, createdAt, or updatedAt inherited from Named, Descriptable, and Timestamped\tScan Node Class Properties and report each inherited field redeclaration\tsemantic-owner.md\nDOM-PUBLIC-DEPS\tdomains\tdependency\terror\tEvery directly referenced foreign-Domain graph declaration has one exact Schema dependency\tResolve foreign Schema, Query, and Mutation graph references and report each package without one exact declared Schema dependency\tcross-domain.md\nDOM-CALL-DECLARED\tdomains\tdependency\terror\tCross-Domain calls use exact declared public Schema dependencies and typed invocation; Integrations are optional consumer-owned boundaries\tTrace remote invocations and reject undeclared targets, private imports, forged references, and missing exact Domain Function requirements\tremote-domain-call.md\nDOM-ATOMICITY\tdomains\tbehavior\terror\tA cross-Domain change claims atomicity only when it is one MutationAST on one graph; calls combined with other effects are Workflow steps\tTrace atomicity and effect claims and report multiple commits, service boundaries, or foreign calls combined in a Action\tcross-domain.md\nSCH-SUBMODULE\tschema\tstructure\terror\tEvery Schema source path belongs to the registered facade, one canonical shared declaration kind, or one business-module facade or canonical declaration kind\tClassify admitted Schema source paths including shared and module-owned errors directories and report flat files or source-bearing directories outside the canonical Schema vocabulary\tschema-facade.md\nSCH-ONE-DECL\tschema\tdeclaration\terror\tEvery Schema declaration leaf file exports exactly one locally authored declaration of its directory kind and every declaration-kind index is a curated facade\tInspect runtime exports in Classes, Functions, Policies, States, and Views; resolve canonical SDK constructor origins and report zero, several, re-exported, aggregated, wrong-kind, or index-owned values\tdeclaration-file.md\nSCH-DECL-ONLY\tschema\tdeclaration\terror\tSchema performs no handler execution, Query execution, Mutation submission, Integration call, Workflow step, or Provider call\tResolve Schema imports and call graphs and require zero excluded operations\tpublication-callables.md\nSCH-EXACT-TYPES\tschema\tdeclaration\terror\tSchema authoring values preserve their exact inferred DSL types instead of widening to generic builder contracts\tScan Schema declarations and action returns for explicit generic builder authoring annotations\tschema-facade.md\nSCH-ICON-REQUIRED\tschema\tdeclaration\terror\tEvery Node Class must explicitly declare one admitted SVG icon\tInspect each SDK nodeClass and Node-kind defineClass declaration and report statically proven missing icon values while preserving opaque configurations as indeterminate\tclass-icon.md\nSCH-ICON-NEUTRAL\tschema\tdeclaration\twarning\tEvery neutral Node Class icon should be replaced with a meaningful icon\tInspect each SDK nodeClass and Node-kind defineClass declaration and report explicit classIcon.neutral or exact neutral SVG values\tclass-icon.md\nSCH-POLICY-AUTH\tschema\tdeclaration\terror\tCallable authority and existential Node scope are declared explicitly through Policy and Action implementations add no private authorization rule\tTrace callable admission and existential Node binders; report hidden authority or an ambiguous Node extent\tpolicy.md\nSCH-STATE-SOURCE\tschema\tdeclaration\terror\tEvery persisted StateMachine vocabulary originates from an exported authority in the same Schema business module rather than a copied literal set\tResolve exact StateMachine and stateProperty origins; report same-owner copied literals and reject cross-module association\tarticle-schema.md\nSCH-STATE-RELATION\tschema\tdeclaration\terror\tEvery StateMachine is one exported static immutable finite relation without parallel vocabulary authorities\tInspect Schema module machines and exported sibling values for split or copied topology\tarticle-status.md\nSCH-STATE-PURE\tschema\tdeclaration\terror\tStateMachine topology contains no behavior, effects, guards, clocks, retry, recovery, or orchestration\tInspect files that declare StateMachine authorities for behavioral exports, boundary imports, and effectful calls\tstate-pure.md\nRUL-SYNC\trules\tbehavior\terror\tEvery Rule is synchronous and returns no Promise, continuation, generator, or asynchronous iterator\tInspect Rule signatures and result types and reject asynchronous forms\tnormalization.md\nRUL-PURE\trules\tbehavior\terror\tRules perform no I/O and depend on no graph executor or Domain execution boundary\tResolve imports and effect origins, permitting pure standard value transformations while reporting conclusive I/O and Domain execution dependencies\tpublish-eligibility.md\nRUL-EXPL-FACTS\trules\tbehavior\terror\tEvery clock value, random value, identity, limit, and environmental observation used by a Rule is an explicit input\tTrace every value source and report reads from ambient state, globals, process state, or hidden singletons\ttime-facts.md\nRUL-CLOSED-DEC\trules\tbehavior\terror\tEvery expected business alternative is represented by a closed decision value rather than thrown control flow\tInspect Rule branches and report expected alternatives represented by exceptions or open optional fields\tpublish-eligibility.md\nQRY-CANON\tqueries\tdataflow\terror\tEvery graph request produced by a Query definition is one canonical QueryAST built through Kernel Query APIs\tTrace request construction and reject every non-canonical graph document\tfiltered-query.md\nQRY-CONTRACT\tqueries\tdataflow\terror\tA Query owns its input, observation, optional business projection, pagination, and expected failures\tInspect each Query definition and report a required concern owned elsewhere or omitted\tquery-transforms.md\nQRY-SINGLE\tqueries\tdataflow\terror\tEvery authored single Query definition declares exactly one build callback and at most one project callback\tInspect definition properties and canonical roots; report opaque helper origins as ambiguity rather than assuming cardinality\tsingle-query.md\nQRY-COMPOSE-TYPED\tqueries\tdataflow\terror\tA composite Query constructs one closed QueryPlan containing only typed single-Query leaves, symbolic output references, and explicit result composition\tInspect plan construction, report unresolved call origins as ambiguity, and reject nested composites, raw sessions, graph clients, result-time callbacks, arbitrary promises, or Domain effects\tdependent-query.md\nQRY-COMPOSE-STABLE\tqueries\tdeclaration\terror\tEvery composite Query leaf has a stable semantic literal ID unique within its definition\tInspect declared Query leaves and reject dynamic, malformed, or duplicate leaf identifiers\tdependent-query.md\nQRY-COLL-FANOUT\tqueries\tdataflow\twarning\tThree or more independent same-kind complete-Class collection leaves use one explicit query.union group\tInfer collection kind from canonical definition types and print the direct named replacement plus logical and physical plan counts\tcollection-union.md\nQRY-PROJECT-PURE\tqueries\tdataflow\terror\tEvery Query project callback is synchronous and performs only pure value transformation\tInspect project callback syntax and call graphs and report asynchronous continuation, I/O, mutation, nondeterminism, hidden query execution, or effects\tprojection.md\nQRY-SNAPSHOT\tqueries\tdataflow\terror\tA composite or paginated Query makes no point-in-time graph snapshot claim beyond one Kernel invocation\tReject shared-snapshot claims across leaves unions or continuations and route stronger consistency to an explicit Kernel facility\tdependent-query.md\nMUT-PLAN-REQ\tmutations\tdependency\terror\tEvery identity operation and foreign Mutation plan declares the exact Kernel Function and foreign Class authority it uses\tInspect SDK MutationAST builders and Kernel Provision or Register calls and match every foreign Class operation and identity syscall invocation to Domain requirements\tprovision-plan.md\nMUT-LOCAL-ALIAS\tmutations\tdeclaration\terror\tEvery literal Mutation createNode alias is a canonical local binding accepted by the Kernel\tInspect statically resolved createNode as values and reject invalid local binding literals before runtime\tatomic-mutation.md\nMUT-CANON\tmutations\tdataflow\terror\tEvery Mutation definition builds one synchronous change through the canonical builder and constructs no alternate or nested graph document\tInspect every definition build callback and reject missing, asynchronous, alternate, or nested Mutation construction\tatomic-mutation.md\nMUT-CONTRACT\tmutations\tdataflow\terror\tA Mutation owns its input, preconditions, operations, optional business projection, and expected failures\tInspect each definition and report required mutation semantics owned elsewhere or omitted\tcreate-aggregate.md\nMUT-PRECONDS\tmutations\tdataflow\terror\tRules decide eligibility and every live graph condition required for safety is encoded as a precondition in the same MutationAST\tMap decisions to preconditions and report duplicated eligibility or safety enforced only by an earlier observation\tconditional-update.md\nMUT-FRAGMENTS\tmutations\tdataflow\terror\tReusable fragments receive the callback-scoped MutationBuilder and contribute only to the same MutationAST\tResolve fragment signatures and calls and reject escaped builders, opaque documents, or nested MutationAST construction\tmutation-fragments.md\nMUT-PURE\tmutations\tdataflow\terror\tMutation definitions perform no session call, external effect, retry, compensation, or second submission\tScan definition call graphs and require zero excluded operations\tedge-change.md\nMUT-MULTI-WFL\tmutations\tdataflow\terror\tA change requiring several MutationAST values is a Workflow and is never exposed as one atomic Mutation\tTrace multi-commit changes and report definitions or names claiming single-mutation atomicity\tdelete-node.md\nMUT-STATE-INITIAL\tmutations\tdataflow\terror\tEvery StateMachine-backed node is created from its machine's initial state\tResolve machine-backed Property initializers and require the canonical machine.initial value rather than a copied state literal\tstate-transition.md\nMUT-STATE-ATOMIC\tmutations\tdataflow\terror\tEvery persisted machine-state change consumes one allowed decision and commits its stale-state precondition and update in the same MutationAST\tInspect machine-backed writes and require transition with the canonical Schema module machine and one allowed decision; reject direct target writes and split precondition updates\tstate-transition.md\nFNC-ONE-IMPL\tfunctions\tbehavior\terror\tEvery registered handler binding resolves to exactly one implementation owned by one semantic Functions submodule\tResolve the handler registry and report non-Action owners or duplicate registrations; SDK typing owns callable exhaustiveness\tsynchronous-result.md\nFNC-ONE-OP\tfunctions\tbehavior\terror\tEvery Action performs one terminal semantic operation; only a native binary compatibility Action may precede its Integration call with one exact-instance Query\tTrace every path and report several terminal effects, writes before effects, non-instance prerequisite reads, or hidden orchestration\tsingle-operation.md\nFNC-OP-KINDS\tfunctions\tbehavior\terror\tA semantic asynchronous operation is one Query, Mutation, Integration call, dependency invocation, or canonical Kernel operation\tClassify every awaited effect including dependency and Kernel calls; report undeclared effect kinds and hidden multiple operations\tintegration-operation.md\nFNC-BOUNDARIES\tfunctions\tbehavior\terror\tHandlers use self-default kernel graph query and mutate capabilities, explicit-authority direct dependencies, and optional declared Integrations; explicit Kernel and graph authority modes are available\tInspect context use, authority selection, dependencies, imports and failure mapping; reject raw unbound graph executors, foreign handler imports, implicit authority changes and swallowed defects\tremote-integration.md\nFNC-BINARY-RESULT\tfunctions\tbehavior\terror\tA binary Action returns detached buffered bytes or streaming bytes with admitted media type status and application headers without collecting or value-framing a provider stream\tExercise buffered and streaming results through their native route; verify exact bytes status headers cancellation and invalid output rejection\tnative-byte-response.md\nFNC-MULTISTEP\tfunctions\tbehavior\terror\tEvery Workflow definition contains at least two distinct semantic asynchronous operation sites\tInventory operation sites in the definition and report fewer than two; early exit, rejection, and recovery paths may execute fewer\tpublication-workflow.md\nFNC-STEP-EFFECTS\tfunctions\tbehavior\terror\tEvery semantic asynchronous operation maps to one named step.run boundary\tTrace effects and report operations outside step.run\tpublication-workflow.md\nFNC-STEP-IDS\tfunctions\tbehavior\terror\tEvery step identifier is a stable non-empty kebab-case literal unique within its Workflow\tExtract step identifiers and reject dynamic, malformed, empty, or duplicate values\tpublication-workflow.md\nFNC-NO-NEST\tfunctions\tbehavior\terror\tNo step.run callback invokes another step.run directly or through a reachable helper\tInspect callback call graphs and report every nested step.run path\tpublication-workflow.md\nFNC-INT-TYPES\tfunctions\tdeclaration\terror\tWorkflow Integration requirements derive from declared Integration definitions and the SDK projects their clients\tReject Workflow-owned operation interfaces and require its definition generic to reference the declared Integration registry\tcross-domain-workflow.md\nFNC-ONE-OP-STEP\tfunctions\tbehavior\terror\tEvery step owns exactly one semantic asynchronous operation\tTrace each step and report zero or several independently failing operations\tpublication-workflow.md\nFNC-STATE-CODEC\tfunctions\tbehavior\terror\tEvery step result and inter-step value is undefined or portable JSON data\tInspect step values and report actions, clients, symbols, bigint, cycles, or class instances\tpublication-workflow.md\nFNC-RECOVERY\tfunctions\tbehavior\terror\tWhen compensation or unknown-outcome branches exist, they are explicit and rely only on declared operation semantics\tInspect existing recovery branches and report guessed outcomes or compensation without exact evidence\tpublication-workflow.md\nFNC-XDOM-DECLARED\tfunctions\tbehavior\terror\tActions and Workflows invoke direct declared Domain dependencies through explicit-authority dependency invokers or canonical typed kernel.invoke references and import no foreign handler\tResolve handler imports, direct dependency aliases, explicit caller/self/union authority, selectors, and typed references; reject foreign imports, implicit or chained authority, undeclared aliases and forged references, and report opaque bindings as indeterminate\tcross-domain-workflow.md\nFNC-XDOM-REQ\tfunctions\tbehavior\terror\tEvery selected remote callable has one exact Domain Function requirement including its defining Class and static or instance kind\tCompare each statically selected remote callable with exact Domain Function requirements; report missing requirements and mark opaque selectors or requirement lists indeterminate\tcross-domain-workflow.md\nMIG-EXACT-REVS\tmigrations\tdataflow\terror\tEvery Migration declares exactly one source revision and one target revision for the same Domain origin\tParse Migration descriptors and reject missing, equal, ambiguous, cross-origin, or dynamically selected revisions\texact-revisions.md\nMIG-APP-DATA\tmigrations\tdataflow\terror\tMigrations transform application-owned facts only and own no schema projection, physical representation, deployment, backup, or external import\tClassify every transformed value and operation and report responsibilities outside application data\trewrite-values.md\nMIG-DEDICATED-CTX\tmigrations\tdataflow\terror\tMigration execution uses only its dedicated source reader, target writer, durable step context, revision-compatible Rules, and generic Utils\tResolve imports and calls and reject ordinary Actions, Workflows, Queries, Mutations, Integrations, Providers, Views, UI, or provider access\texact-revisions.md\nMIG-RESTART-SAFE\tmigrations\tdataflow\terror\tEvery Migration page is idempotent and resumes from a stable checkpoint without reinterpreting accepted target output\tInterrupt before and after every page commit, resume repeatedly, and compare target facts and checkpoints with uninterrupted execution\trestart-safe.md\nMIG-TARGET-PROOF\tmigrations\tdataflow\terror\tA Migration completes only after bounded source coverage and target-revision validation account for every selected source fact\tInject omitted, duplicated, invalid, and over-budget facts and require completion to fail with exact evidence\tverify-target.md\nMIG-DESTRUCTIVE\tmigrations\tdataflow\terror\tEvery destructive or irreversible transform declares and accounts for its intended loss and exposes declared expected failures\tTrace removals and irreversible rewrites and report undeclared or unaccounted loss, open failures, or catch-and-continue behavior\tremove-facts.md\nINT-BOUNDARY\tintegrations\tarchitecture\terror\tEvery Integration represents required behavior across an external, remote-Domain, substitution, process, or trust boundary\tIdentify the boundary for every contract and report behavior that can remain ordinary local Domain code\tpayment-authorization.md\nINT-NEUTRAL\tintegrations\tdeclaration\terror\tEvery Integration owns provider-neutral requests, evidence, correlation, idempotency, trust, and expected failure semantics needed by consumers\tInspect consumers and contracts and report provider fields or missing stable boundary semantics\tid-allocation.md\nINT-PURE\tintegrations\tdependency\terror\tIntegrations remain provider- and execution-boundary-neutral and import no concrete client, credential, configuration, Provider, Action, or Workflow\tResolve runtime and provider imports and report every conclusive concrete or execution-boundary dependency\tdocument-signing.md\nINT-ABILITY-NAME\tintegrations\tstructure\terror\tIntegration submodules are named by required ability and never mirror Schema entities mechanically\tCompare Integration and Schema submodules and report a contract without an independent boundary ability\tobject-storage.md\nRTE-RECIPE\troutes\tdeclaration\terror\tEvery native HTTP Route targets exactly one admitted Action or Workflow recipe\tResolve every route target and report forged missing or several recipes\taction-route.md\nRTE-MAPPING\troutes\tdataflow\terror\tEvery callable input field and instance receiver is mapped exactly once from path query header method or body input\tCompile each route against its resolved callable and reject incomplete ambiguous or unknown mappings\tinstance-route.md\nRTE-CREDENTIAL\troutes\tdataflow\terror\tEvery external credential source is explicit and is never also mapped as callable input\tCompile credential and input mappings and reject duplicate reserved or implicit authority sources\tcredential-route.md\nRTE-ONE-FILE\troutes\tstructure\terror\tEvery Route declaration has one business-intent kebab-case file and Routes composition contains no inline declaration\tInventory route declarations and report generic grouped or inline ownership\tapplication-routes.md\nPRV-INT-IMPL\tproviders\tarchitecture\terror\tEvery Provider implements one or more declared Integrations across a named external or remote-Domain boundary\tIdentify the boundary and implemented contracts and report a Provider without both\tpayment-provider.md\nPRV-BOUNDARY-NAME\tproviders\tstructure\terror\tProvider submodules are named by external system, protocol, or trust boundary rather than Domain entity\tInspect every submodule name and report one justified only by Schema vocabulary\tobject-storage-provider.md\nPRV-ADMIT-RESULT\tproviders\tdataflow\terror\tEvery boundary value is admitted before Integration evidence and recognized boundary failures become stable Integration failures\tTrace input and failure paths and report missing admission, leaked boundary errors, broad mapping, or swallowed defects\twebhook-admission.md\nPRV-NO-DOMAIN\tproviders\tdependency\terror\tProviders perform no local Domain graph operation, business decision, local Action call, or Workflow orchestration\tResolve Provider imports and call graphs and require zero excluded operations\tboundary-composition.md\nPRV-XDOM-TYPED\tproviders\tdependency\terror\tRemote-Domain Providers pass SDK-derived typed callable references to the caller-bound invocation capability without never casts\tInspect Provider execution invoke calls and reject references not constructed through SDK reference, opaque or fabricated references, and never-cast arguments\tremote-domain.md\nPRV-XDOM-REQ\tproviders\tdependency\terror\tEvery statically resolved remote-Domain Provider invocation has one exact Domain Function requirement\tMatch each invocation-bound public callable reference to the same foreign facade and Function selector under Domain requirements; preserve opaque references or composition as indeterminate\tremote-domain.md\nPRV-XDOM-PUBLIC\tproviders\tdependency\terror\tA remote-Domain Provider uses the remote public facade and invokes at most one public callable per Integration operation\tResolve receiver and facade origins for each remote operation and report private access, missing Integration ownership, unrelated calls, or several public invocations\tremote-domain.md\nVIW-PROJECTION\tviews\tdeclaration\terror\tEvery View converts public Domain values or named Query observations into UI props and connects each action to a named bounded Mutation or public callable contract\tInspect View outputs and actions and report behavior without a Schema, Query, UI, Mutation, Rule, or public callable owner\tdetail-view.md\nVIW-SCHEMA-DECL\tviews\tdeclaration\terror\tSchema owns every DSL View declaration and Views declares no Domain schema construct\tScan View declarations and reject Classes, Properties, Policies, Methods, Actions, or DSL Views\tarticle-list.md\nVIW-NO-COMPOSE\tviews\tdeclaration\terror\tThe Domain definition owns frontend deployment composition and Views never calls defineFrontend\tResolve direct imported defineFrontend calls in Views and report SDK constructor calls while ignoring unrelated local functions\tfrontend-composition.md\nVIW-DEPS\tviews\tdependency\terror\tViews import only Schema and its StateMachines, pure Rules, named Queries, bounded named Mutations, UI, shell-react primitives, public callable contracts, and presentation libraries\tInspect resolved imports and report dependencies or raw graph APIs outside the allowlist\tnavigation.md\nVIW-ACTIONS\tviews\tdataflow\terror\tEvery View action executes a named caller-authorized atomic Mutation or invokes a public callable; presentation state is never authorization evidence\tTrace action and authority paths and report inline or raw graph documents, elevated or effectful Mutation use, private Action imports, direct Integration calls, or authority derived from presentation\tform-actions.md\nUI-PRES-DEPS\tui\tdependency\terror\tEvery UI import is a sibling UI module or an external library used only for presentation\tInspect resolved imports and used APIs and report Domain, I/O, persistence, authorization, routing, or provider behavior\tstatus-panel.md\nUI-NO-DOMAIN\tui\tdependency\terror\tUI imports no Domain layer or Domain package facade\tResolve the UI import graph and require zero Domain paths\tresult-list.md\nUI-PURE\tui\tbehavior\terror\tUI performs no I/O, graph access, storage, authorization, business validation, provider call, routing, or Domain result mapping\tInspect components and hooks and report the exact excluded call or branch\tconfirmation-dialog.md\nUI-CALLBACKS\tui\tdataflow\terror\tUI accepts presentation props and forwards intent through callbacks without constructing Domain commands\tInspect props and event handlers and report Domain identities, command construction, or business decisions\tform.md\nUTL-DOM-AGNOSTIC\tutils\tarchitecture\terror\tEvery Utils export is Domain-agnostic and contains no Domain declaration, identity, decision, graph definition, or Workflow step\tInspect signatures and implementations and report the exact Domain concept or business behavior\tresult.md\nUTL-REUSED\tutils\tarchitecture\terror\tEvery Utils extension serves two independent semantic consumers or one package-wide execution boundary\tList direct consumers and report an extension satisfying neither condition\tjson-codec.md\nUTL-PUBLIC-DEPS\tutils\tdependency\terror\tUtils imports only public Kernel, DSL, SDK, standard-library, and sibling Utils modules\tResolve the Utils import graph and reject Domain layers, Providers, or private package paths\tjson-codec.md\nUTL-LIGHTWEIGHT\tutils\tarchitecture\terror\tUtils is private and owns no durable engine, planner, compiler, Repository, service locator, or dependency container\tInspect package exports and declarations and report public exposure or any forbidden framework machinery\tresult.md\nSCR-OPERATOR\tscripts\tbehavior\terror\tEvery root Script implements a supported operator workflow with declared inputs, outcomes, failures, and proof\tInspect each Script contract and report disposable tasks or missing operator semantics\tbackup.md\nSCR-PUBLIC-DEPS\tscripts\tbehavior\terror\tScripts import only dependency-DAG-authorized public facades, standard libraries, and operator libraries and define no Domain behavior\tResolve imports and inspect branches and report private paths, business decisions, graph definitions, or callable behavior\tupgrade.md\nSCR-TEST-DRIVERS\tscripts\tbehavior\terror\tDisposable setup, fixtures, resets, and scenario drivers live under tests/scripts rather than root Scripts\tClassify every Script by supported operator contract and report evidence-only programs at the root\trestore.md\nTST-SYS-OWNER\ttests\tevidence\terror\tRoot Tests owns cross-layer journeys, environments, harnesses, scenarios, seeds, fixtures, and disposable scripts\tInventory evidence support code and report cross-layer artifacts outside Tests or production semantics inside Tests\tmigration-scenario.md\nTST-COLOCATED\ttests\tevidence\terror\tEvery semantic production submodule owns focused evidence in its local __tests__ directory\tJoin production submodules to focused test directories and report missing owners\tfocused-rule.md\n",
|
|
4
|
+
rules: "id\tscope\tkind\tseverity\tmessage\tverification\texample\nOWN-SEMANTIC\townership\tarchitecture\terror\tEvery semantic fact, rule, representation, transition, and failure meaning has exactly one owner\tInventory declarations by meaning and report each duplicate authority or ownerless concept\tsemantic-owner.md\nMOD-SUBMODULE\tmodules\tstructure\terror\tEvery semantic source file lives in a dedicated semantic submodule or its registered layer facade\tClassify every layer-root source file and report files outside the registered facade or public index\tsemantic-owner.md\nMOD-REQUIRED\tmodules\tstructure\terror\tEvery required layer and root file declared by the injected layout exists\tCompare admitted project entries with required layout entries and report each missing path\trequired-layout.md\nMOD-GOVERNED\tmodules\tstructure\terror\tEvery source file admitted by the Domain compilation scope belongs to a declared layer or supported root\tClassify admitted source paths after declared workspace and tooling delegation and report each unowned path\tgoverned-source.md\nROOT-FACADE\troots\tstructure\terror\tEvery registered layer facade is exposed through a curated public index\tInspect each layer index and facade and report private-owner behavior or misplaced facade declarations\tpackage-facade.md\nROOT-COMPOSE\troots\tstructure\terror\tPackage roots compose only policy-backed Schema, Runtime, frontend deployment, native Routes, Migrations, Provider-backed Integrations, and supported package journeys\tInspect declared composition and package roots and report behavior, provider protocol logic, recursive barrels, or unsupported exports\tcomposition-root.md\nROOT-PACKAGE\troots\tevidence\terror\tEvery public Schema package subpath maps one admitted source entrypoint to its deterministic published declaration and JavaScript targets\tCompare source and publish exports and reject missing duplicate non-Schema locally linked generated or Kernel-leaking package artifacts\tmulti-domain-package.md\nDEP-ALLOWLIST\tdependencies\tdependency\terror\tEvery direct cross-layer import and its runtime or type-only kind appears in the dependency allowlist and dependencies between distinct layers are acyclic\tResolve source imports, reject every absent or kind-mismatched edge, and detect cycles after excluding evidence edges\tsemantic-owner.md\nIMP-FACADE\timports\tdependency\terror\tEvery cross-submodule import uses the semantic owner's facade and every foreign Domain import uses its public package facade\tResolve imports and report private deep paths outside the importing submodule\tcross-domain.md\nIMP-SDK-BOUNDARY\timports\tdependency\terror\tDomain source imports Kernel Core and DSL authoring values only through semantic SDK subpaths\tInspect every static and literal dynamic import and report module specifiers rooted at @astrale-os/kernel-core or @astrale-os/kernel-dsl\tsdk-boundary.md\nIMP-LAYER-ALIAS\timports\tdependency\terror\tEvery local import crossing a layer or semantic-submodule boundary uses the registered # layer alias\tResolve relative imports and report each one whose target leaves the importing semantic submodule\tlayer-aliases.md\nIMP-ALIAS-CFG\timports\tdependency\terror\tPackage and TypeScript resolution exactly implement each active layer-facade and semantic-submodule alias\tCompare active and required layers with the injected alias registry and report missing, undeclared, or drifted mappings\talias-configuration.md\nIMP-STATIC\timports\tdependency\terror\tProduction dependency edges use analyzable static ESM declarations or literal import calls\tReject require calls, import-equals declarations, nonliteral import calls, and unresolved static dependency forms\tstatic-imports.md\nTYP-OWNER\ttypes\tarchitecture\terror\tEvery type and reusable expected error is colocated with the semantic concept that defines its meaning\tTrace each declaration to its semantic authority and report catch-all or remotely owned values\texpected-failure.md\nERR-EXPECTED\terrors\tdataflow\terror\tBoundaries map only declared expected failures and propagate unexpected defects\tInspect catches and result mappings and report broad fallback, swallowed defects, or mappings without a declared source failure\texpected-failure.md\nTST-NO-PROD-IMP\ttests\tdependency\terror\tProduction source imports no root or colocated Test artifact\tResolve production imports and report targets under Root Tests, __tests__, or test, spec, bench, and perf source files\ttest-import-boundary.md\nABS-EARNED\tabstractions\tarchitecture\terror\tAn invariant or real boundary earns an abstraction; reuse alone requires two independent consumers and no duplicated semantic behavior\tIdentify the invariant, boundary, or independent consumers for each abstraction and report reuse wrappers that duplicate an owner's semantics\tsemantic-owner.md\nABS-NO-REPO\tabstractions\tarchitecture\terror\tDomain source places no collection-shaped persistence facade between business code and canonical Query or Mutation definitions\tInspect persistence-facing contracts and report abstractions that replace graph identity, traversal, observation, or atomic change semantics\tsemantic-owner.md\nABS-CANON-GRAPH\tabstractions\tdeclaration\terror\tDomain source declares no alternate Query or Mutation language, AST, compiler, planner, or wire representation\tInspect graph-related declarations and report semantics not identical to canonical Kernel Query or Mutation values\tsemantic-owner.md\nTRUST-ADMIT-ONCE\ttrust\tdataflow\terror\tEvery untrusted value is admitted or translated exactly once at its owning boundary\tTrace values from each external boundary and report missing admission or repeated structural validation\texpected-failure.md\nQLT-EXHAUSTIVE\tquality\tbehavior\terror\tEvery closed alternative is handled exhaustively and no required failure becomes placeholder success\tTrace closed unions and failure paths and report permissive defaults, placeholder success, or catch-and-continue behavior\texpected-failure.md\nQLT-CANON-VALUES\tquality\tdataflow\terror\tNo unchecked cast fabricates a canonical Kernel identity, QueryAST, MutationAST, or admitted schema value\tScan casts to canonical values and require an owning constructor or decoder for each\tsemantic-owner.md\nQLT-DEF-IDS\tquality\tdeclaration\terror\tEvery top-level Query, Mutation, and Migration definition has a stable literal ID unique in its owning namespace\tExtract top-level definition IDs and report missing, dynamic, malformed, or duplicate values\tdefinition-identities.md\nQLT-TYPED-COORD\tquality\tdeclaration\terror\tQueries and Mutations derive graph coordinates from resolved DSL definitions instead of raw string or structural reconstruction\tReject raw PropertyKey calls and structural ClassPath objects; require canonical resolved Classes Properties and keys at graph boundaries\ttyped-coordinates.md\nNODE-INHERITED\tnodes\tdeclaration\terror\tNo Node Class redeclares name, description, createdAt, or updatedAt inherited from Named, Descriptable, and Timestamped\tScan Node Class Properties and report each inherited field redeclaration\tsemantic-owner.md\nDOM-PUBLIC-DEPS\tdomains\tdependency\terror\tEvery directly referenced foreign-Domain graph declaration has one exact Schema dependency\tResolve foreign Schema, Query, and Mutation graph references and report each package without one exact declared Schema dependency\tcross-domain.md\nDOM-CALL-DECLARED\tdomains\tdependency\terror\tCross-Domain calls use exact declared public Schema dependencies and typed invocation; Integrations are optional consumer-owned boundaries\tTrace remote invocations and reject undeclared targets, private imports, forged references, and missing exact Domain Function requirements\tremote-domain-call.md\nDOM-ATOMICITY\tdomains\tbehavior\terror\tA cross-Domain change claims atomicity only when it is one MutationAST on one graph; calls combined with other effects are Workflow steps\tTrace atomicity and effect claims and report multiple commits, service boundaries, or foreign calls combined in a Action\tcross-domain.md\nSCH-SUBMODULE\tschema\tstructure\terror\tEvery Schema source path belongs to the registered facade, one canonical shared declaration kind, or one business-module facade or canonical declaration kind\tClassify admitted Schema source paths including shared and module-owned errors directories and report flat files or source-bearing directories outside the canonical Schema vocabulary\tschema-facade.md\nSCH-ONE-DECL\tschema\tdeclaration\terror\tEvery Schema declaration leaf file exports exactly one locally authored declaration of its directory kind and every declaration-kind index is a curated facade\tInspect runtime exports in Classes, Functions, Policies, States, and Views; resolve canonical SDK constructor origins and report zero, several, re-exported, aggregated, wrong-kind, or index-owned values\tdeclaration-file.md\nSCH-DECL-ONLY\tschema\tdeclaration\terror\tSchema performs no handler execution, Query execution, Mutation submission, Integration call, Workflow step, or Provider call\tResolve Schema imports and call graphs and require zero excluded operations\tpublication-callables.md\nSCH-EXACT-TYPES\tschema\tdeclaration\terror\tSchema authoring values preserve their exact inferred DSL types instead of widening to generic builder contracts\tScan Schema declarations and action returns for explicit generic builder authoring annotations\tschema-facade.md\nSCH-ICON-REQUIRED\tschema\tdeclaration\terror\tEvery Node Class must explicitly declare one admitted SVG icon\tInspect each SDK nodeClass and Node-kind defineClass declaration and report statically proven missing icon values while preserving opaque configurations as indeterminate\tclass-icon.md\nSCH-ICON-NEUTRAL\tschema\tdeclaration\twarning\tEvery neutral Node Class icon should be replaced with a meaningful icon\tInspect each SDK nodeClass and Node-kind defineClass declaration and report explicit classIcon.neutral or exact neutral SVG values\tclass-icon.md\nSCH-POLICY-AUTH\tschema\tdeclaration\terror\tCallable authority and existential Node scope are declared explicitly through Policy and Action implementations add no private authorization rule\tTrace callable admission and existential Node binders; report hidden authority or an ambiguous Node extent\tpolicy.md\nSCH-STATE-SOURCE\tschema\tdeclaration\terror\tEvery persisted StateMachine vocabulary originates from an exported authority in the same Schema business module rather than a copied literal set\tResolve exact StateMachine and stateProperty origins; report same-owner copied literals and reject cross-module association\tarticle-schema.md\nSCH-STATE-RELATION\tschema\tdeclaration\terror\tEvery StateMachine is one exported static immutable finite relation without parallel vocabulary authorities\tInspect Schema module machines and exported sibling values for split or copied topology\tarticle-status.md\nSCH-STATE-PURE\tschema\tdeclaration\terror\tStateMachine topology contains no behavior, effects, guards, clocks, retry, recovery, or orchestration\tInspect files that declare StateMachine authorities for behavioral exports, boundary imports, and effectful calls\tstate-pure.md\nRUL-SYNC\trules\tbehavior\terror\tEvery Rule is synchronous and returns no Promise, continuation, generator, or asynchronous iterator\tInspect Rule signatures and result types and reject asynchronous forms\tnormalization.md\nRUL-PURE\trules\tbehavior\terror\tRules perform no I/O and depend on no graph executor or Domain execution boundary\tResolve imports and effect origins, permitting pure standard value transformations while reporting conclusive I/O and Domain execution dependencies\tpublish-eligibility.md\nRUL-EXPL-FACTS\trules\tbehavior\terror\tEvery clock value, random value, identity, limit, and environmental observation used by a Rule is an explicit input\tTrace every value source and report reads from ambient state, globals, process state, or hidden singletons\ttime-facts.md\nRUL-CLOSED-DEC\trules\tbehavior\terror\tEvery expected business alternative is represented by a closed decision value rather than thrown control flow\tInspect Rule branches and report expected alternatives represented by exceptions or open optional fields\tpublish-eligibility.md\nQRY-CANON\tqueries\tdataflow\terror\tEvery graph request produced by a Query definition is one canonical QueryAST built through Kernel Query APIs\tTrace request construction and reject every non-canonical graph document\tfiltered-query.md\nQRY-CONTRACT\tqueries\tdataflow\terror\tA Query owns its input, observation, optional business projection, pagination, and expected failures\tInspect each Query definition and report a required concern owned elsewhere or omitted\tquery-transforms.md\nQRY-SINGLE\tqueries\tdataflow\terror\tEvery authored single Query definition declares exactly one build callback and at most one project callback\tInspect definition properties and canonical roots; report opaque helper origins as ambiguity rather than assuming cardinality\tsingle-query.md\nQRY-COMPOSE-TYPED\tqueries\tdataflow\terror\tA composite Query constructs one closed QueryPlan containing only typed single-Query leaves, symbolic output references, and explicit result composition\tInspect plan construction, report unresolved call origins as ambiguity, and reject nested composites, raw sessions, graph clients, result-time callbacks, arbitrary promises, or Domain effects\tdependent-query.md\nQRY-COMPOSE-STABLE\tqueries\tdeclaration\terror\tEvery composite Query leaf has a stable semantic literal ID unique within its definition\tInspect declared Query leaves and reject dynamic, malformed, or duplicate leaf identifiers\tdependent-query.md\nQRY-COLL-FANOUT\tqueries\tdataflow\twarning\tThree or more independent same-kind complete-Class collection leaves use one explicit query.union group\tInfer collection kind from canonical definition types and print the direct named replacement plus logical and physical plan counts\tcollection-union.md\nQRY-PROJECT-PURE\tqueries\tdataflow\terror\tEvery Query project callback is synchronous and performs only pure value transformation\tInspect project callback syntax and call graphs and report asynchronous continuation, I/O, mutation, nondeterminism, hidden query execution, or effects\tprojection.md\nQRY-SNAPSHOT\tqueries\tdataflow\terror\tA composite or paginated Query makes no point-in-time graph snapshot claim beyond one Kernel invocation\tReject shared-snapshot claims across leaves unions or continuations and route stronger consistency to an explicit Kernel facility\tdependent-query.md\nMUT-PLAN-REQ\tmutations\tdependency\terror\tEvery identity operation and foreign Mutation plan declares the exact Kernel Function and foreign Class authority it uses\tInspect SDK MutationAST builders and Kernel Provision or Register calls and match every foreign Class operation and identity syscall invocation to Domain requirements\tprovision-plan.md\nMUT-LOCAL-ALIAS\tmutations\tdeclaration\terror\tEvery literal Mutation createNode alias is a canonical local binding accepted by the Kernel\tInspect statically resolved createNode as values and reject invalid local binding literals before runtime\tatomic-mutation.md\nMUT-CANON\tmutations\tdataflow\terror\tEvery Mutation definition builds one synchronous change through the canonical builder and constructs no alternate or nested graph document\tInspect every definition build callback and reject missing, asynchronous, alternate, or nested Mutation construction\tatomic-mutation.md\nMUT-CONTRACT\tmutations\tdataflow\terror\tA Mutation owns its input, preconditions, operations, optional business projection, and expected failures\tInspect each definition and report required mutation semantics owned elsewhere or omitted\tcreate-aggregate.md\nMUT-PRECONDS\tmutations\tdataflow\terror\tRules decide eligibility and every live graph condition required for safety is encoded as a precondition in the same MutationAST\tMap decisions to preconditions and report duplicated eligibility or safety enforced only by an earlier observation\tconditional-update.md\nMUT-FRAGMENTS\tmutations\tdataflow\terror\tReusable fragments receive the callback-scoped MutationBuilder and contribute only to the same MutationAST\tResolve fragment signatures and calls and reject escaped builders, opaque documents, or nested MutationAST construction\tmutation-fragments.md\nMUT-PURE\tmutations\tdataflow\terror\tMutation definitions perform no session call, external effect, retry, compensation, or second submission\tScan definition call graphs and require zero excluded operations\tedge-change.md\nMUT-MULTI-WFL\tmutations\tdataflow\terror\tA change requiring several MutationAST values is a Workflow and is never exposed as one atomic Mutation\tTrace multi-commit changes and report definitions or names claiming single-mutation atomicity\tdelete-node.md\nMUT-STATE-INITIAL\tmutations\tdataflow\terror\tEvery StateMachine-backed node is created from its machine's initial state\tResolve machine-backed Property initializers and require the canonical machine.initial value rather than a copied state literal\tstate-transition.md\nMUT-STATE-ATOMIC\tmutations\tdataflow\terror\tEvery persisted machine-state change consumes one allowed decision and commits its stale-state precondition and update in the same MutationAST\tInspect machine-backed writes and require transition with the canonical Schema module machine and one allowed decision; reject direct target writes and split precondition updates\tstate-transition.md\nFNC-ONE-IMPL\tfunctions\tbehavior\terror\tEvery registered handler binding resolves to exactly one implementation owned by one semantic Functions submodule\tResolve the handler registry and report non-Action owners or duplicate registrations; SDK typing owns callable exhaustiveness\tsynchronous-result.md\nFNC-ONE-OP\tfunctions\tbehavior\terror\tEvery Action performs one terminal semantic operation; only a native binary compatibility Action may precede its Integration call with one exact-instance Query\tTrace every path and report several terminal effects, writes before effects, non-instance prerequisite reads, or hidden orchestration\tsingle-operation.md\nFNC-OP-KINDS\tfunctions\tbehavior\terror\tA semantic asynchronous operation is one Query, Mutation, Integration call, dependency invocation, or canonical Kernel operation\tClassify every awaited effect including dependency and Kernel calls; report undeclared effect kinds and hidden multiple operations\tintegration-operation.md\nFNC-BOUNDARIES\tfunctions\tbehavior\terror\tHandlers use self-default kernel graph query and mutate capabilities, explicit-authority direct dependencies, and optional declared Integrations; explicit Kernel and graph authority modes are available\tInspect context use, authority selection, dependencies, imports and failure mapping; reject raw unbound graph executors, foreign handler imports, implicit authority changes and swallowed defects\tremote-integration.md\nFNC-BINARY-RESULT\tfunctions\tbehavior\terror\tA binary Action returns detached buffered bytes or streaming bytes with admitted media type status and application headers without collecting or value-framing a provider stream\tExercise buffered and streaming results through their native route; verify exact bytes status headers cancellation and invalid output rejection\tnative-byte-response.md\nFNC-MULTISTEP\tfunctions\tbehavior\terror\tEvery Workflow definition contains at least two distinct semantic asynchronous operation sites\tInventory operation sites in the definition and report fewer than two; early exit, rejection, and recovery paths may execute fewer\tpublication-workflow.md\nFNC-STEP-EFFECTS\tfunctions\tbehavior\terror\tEvery semantic asynchronous operation maps to one named step.run boundary\tTrace effects and report operations outside step.run\tpublication-workflow.md\nFNC-STEP-IDS\tfunctions\tbehavior\terror\tEvery step identifier is a stable non-empty kebab-case literal unique within its Workflow\tExtract step identifiers and reject dynamic, malformed, empty, or duplicate values\tpublication-workflow.md\nFNC-NO-NEST\tfunctions\tbehavior\terror\tNo step.run callback invokes another step.run directly or through a reachable helper\tInspect callback call graphs and report every nested step.run path\tpublication-workflow.md\nFNC-INT-TYPES\tfunctions\tdeclaration\terror\tWorkflow Integration requirements derive from declared Integration definitions and the SDK projects their clients\tReject Workflow-owned operation interfaces and require its definition generic to reference the declared Integration registry\tcross-domain-workflow.md\nFNC-ONE-OP-STEP\tfunctions\tbehavior\terror\tEvery step owns exactly one semantic asynchronous operation\tTrace each step and report zero or several independently failing operations\tpublication-workflow.md\nFNC-STATE-CODEC\tfunctions\tbehavior\terror\tEvery step result and inter-step value is undefined or portable JSON data\tInspect step values and report actions, clients, symbols, bigint, cycles, or class instances\tpublication-workflow.md\nFNC-RECOVERY\tfunctions\tbehavior\terror\tWhen compensation or unknown-outcome branches exist, they are explicit and rely only on declared operation semantics\tInspect existing recovery branches and report guessed outcomes or compensation without exact evidence\tpublication-workflow.md\nFNC-XDOM-DECLARED\tfunctions\tbehavior\terror\tActions and Workflows invoke direct declared Domain dependencies through explicit-authority dependency invokers or canonical typed kernel.invoke references and import no foreign handler\tResolve handler imports, direct dependency aliases, explicit caller/self authority, selectors, and typed references; reject foreign imports, implicit or chained authority, undeclared aliases and forged references, and report opaque bindings as indeterminate\tcross-domain-workflow.md\nFNC-XDOM-REQ\tfunctions\tbehavior\terror\tEvery selected remote callable has one exact Domain Function requirement including its defining Class and static or instance kind\tCompare each statically selected remote callable with exact Domain Function requirements; report missing requirements and mark opaque selectors or requirement lists indeterminate\tcross-domain-workflow.md\nMIG-EXACT-REVS\tmigrations\tdataflow\terror\tEvery Migration declares exactly one source revision and one target revision for the same Domain origin\tParse Migration descriptors and reject missing, equal, ambiguous, cross-origin, or dynamically selected revisions\texact-revisions.md\nMIG-APP-DATA\tmigrations\tdataflow\terror\tMigrations transform application-owned facts only and own no schema projection, physical representation, deployment, backup, or external import\tClassify every transformed value and operation and report responsibilities outside application data\trewrite-values.md\nMIG-DEDICATED-CTX\tmigrations\tdataflow\terror\tMigration execution uses only its dedicated source reader, target writer, durable step context, revision-compatible Rules, and generic Utils\tResolve imports and calls and reject ordinary Actions, Workflows, Queries, Mutations, Integrations, Providers, Views, UI, or provider access\texact-revisions.md\nMIG-RESTART-SAFE\tmigrations\tdataflow\terror\tEvery Migration page is idempotent and resumes from a stable checkpoint without reinterpreting accepted target output\tInterrupt before and after every page commit, resume repeatedly, and compare target facts and checkpoints with uninterrupted execution\trestart-safe.md\nMIG-TARGET-PROOF\tmigrations\tdataflow\terror\tA Migration completes only after bounded source coverage and target-revision validation account for every selected source fact\tInject omitted, duplicated, invalid, and over-budget facts and require completion to fail with exact evidence\tverify-target.md\nMIG-DESTRUCTIVE\tmigrations\tdataflow\terror\tEvery destructive or irreversible transform declares and accounts for its intended loss and exposes declared expected failures\tTrace removals and irreversible rewrites and report undeclared or unaccounted loss, open failures, or catch-and-continue behavior\tremove-facts.md\nINT-BOUNDARY\tintegrations\tarchitecture\terror\tEvery Integration represents required behavior across an external, remote-Domain, substitution, process, or trust boundary\tIdentify the boundary for every contract and report behavior that can remain ordinary local Domain code\tpayment-authorization.md\nINT-NEUTRAL\tintegrations\tdeclaration\terror\tEvery Integration owns provider-neutral requests, evidence, correlation, idempotency, trust, and expected failure semantics needed by consumers\tInspect consumers and contracts and report provider fields or missing stable boundary semantics\tid-allocation.md\nINT-PURE\tintegrations\tdependency\terror\tIntegrations remain provider- and execution-boundary-neutral and import no concrete client, credential, configuration, Provider, Action, or Workflow\tResolve runtime and provider imports and report every conclusive concrete or execution-boundary dependency\tdocument-signing.md\nINT-ABILITY-NAME\tintegrations\tstructure\terror\tIntegration submodules are named by required ability and never mirror Schema entities mechanically\tCompare Integration and Schema submodules and report a contract without an independent boundary ability\tobject-storage.md\nRTE-RECIPE\troutes\tdeclaration\terror\tEvery native HTTP Route targets exactly one admitted Action or Workflow recipe\tResolve every route target and report forged missing or several recipes\taction-route.md\nRTE-MAPPING\troutes\tdataflow\terror\tEvery callable input field and instance receiver is mapped exactly once from path query header method or body input\tCompile each route against its resolved callable and reject incomplete ambiguous or unknown mappings\tinstance-route.md\nRTE-CREDENTIAL\troutes\tdataflow\terror\tEvery external credential source is explicit and is never also mapped as callable input\tCompile credential and input mappings and reject duplicate reserved or implicit authority sources\tcredential-route.md\nRTE-ONE-FILE\troutes\tstructure\terror\tEvery Route declaration has one business-intent kebab-case file and Routes composition contains no inline declaration\tInventory route declarations and report generic grouped or inline ownership\tapplication-routes.md\nPRV-INT-IMPL\tproviders\tarchitecture\terror\tEvery Provider implements one or more declared Integrations across a named external or remote-Domain boundary\tIdentify the boundary and implemented contracts and report a Provider without both\tpayment-provider.md\nPRV-BOUNDARY-NAME\tproviders\tstructure\terror\tProvider submodules are named by external system, protocol, or trust boundary rather than Domain entity\tInspect every submodule name and report one justified only by Schema vocabulary\tobject-storage-provider.md\nPRV-ADMIT-RESULT\tproviders\tdataflow\terror\tEvery boundary value is admitted before Integration evidence and recognized boundary failures become stable Integration failures\tTrace input and failure paths and report missing admission, leaked boundary errors, broad mapping, or swallowed defects\twebhook-admission.md\nPRV-NO-DOMAIN\tproviders\tdependency\terror\tProviders perform no local Domain graph operation, business decision, local Action call, or Workflow orchestration\tResolve Provider imports and call graphs and require zero excluded operations\tboundary-composition.md\nPRV-XDOM-TYPED\tproviders\tdependency\terror\tRemote-Domain Providers pass SDK-derived typed callable references to the caller-bound invocation capability without never casts\tInspect Provider execution invoke calls and reject references not constructed through SDK reference, opaque or fabricated references, and never-cast arguments\tremote-domain.md\nPRV-XDOM-REQ\tproviders\tdependency\terror\tEvery statically resolved remote-Domain Provider invocation has one exact Domain Function requirement\tMatch each invocation-bound public callable reference to the same foreign facade and Function selector under Domain requirements; preserve opaque references or composition as indeterminate\tremote-domain.md\nPRV-XDOM-PUBLIC\tproviders\tdependency\terror\tA remote-Domain Provider uses the remote public facade and invokes at most one public callable per Integration operation\tResolve receiver and facade origins for each remote operation and report private access, missing Integration ownership, unrelated calls, or several public invocations\tremote-domain.md\nVIW-PROJECTION\tviews\tdeclaration\terror\tEvery View converts public Domain values or named Query observations into UI props and connects each action to a named bounded Mutation or public callable contract\tInspect View outputs and actions and report behavior without a Schema, Query, UI, Mutation, Rule, or public callable owner\tdetail-view.md\nVIW-SCHEMA-DECL\tviews\tdeclaration\terror\tSchema owns every DSL View declaration and Views declares no Domain schema construct\tScan View declarations and reject Classes, Properties, Policies, Methods, Actions, or DSL Views\tarticle-list.md\nVIW-NO-COMPOSE\tviews\tdeclaration\terror\tThe Domain definition owns frontend deployment composition and Views never calls defineFrontend\tResolve direct imported defineFrontend calls in Views and report SDK constructor calls while ignoring unrelated local functions\tfrontend-composition.md\nVIW-DEPS\tviews\tdependency\terror\tViews import only Schema and its StateMachines, pure Rules, named Queries, bounded named Mutations, UI, shell-react primitives, public callable contracts, and presentation libraries\tInspect resolved imports and report dependencies or raw graph APIs outside the allowlist\tnavigation.md\nVIW-ACTIONS\tviews\tdataflow\terror\tEvery View action executes a named caller-authorized atomic Mutation or invokes a public callable; presentation state is never authorization evidence\tTrace action and authority paths and report inline or raw graph documents, elevated or effectful Mutation use, private Action imports, direct Integration calls, or authority derived from presentation\tform-actions.md\nUI-PRES-DEPS\tui\tdependency\terror\tEvery UI import is a sibling UI module or an external library used only for presentation\tInspect resolved imports and used APIs and report Domain, I/O, persistence, authorization, routing, or provider behavior\tstatus-panel.md\nUI-NO-DOMAIN\tui\tdependency\terror\tUI imports no Domain layer or Domain package facade\tResolve the UI import graph and require zero Domain paths\tresult-list.md\nUI-PURE\tui\tbehavior\terror\tUI performs no I/O, graph access, storage, authorization, business validation, provider call, routing, or Domain result mapping\tInspect components and hooks and report the exact excluded call or branch\tconfirmation-dialog.md\nUI-CALLBACKS\tui\tdataflow\terror\tUI accepts presentation props and forwards intent through callbacks without constructing Domain commands\tInspect props and event handlers and report Domain identities, command construction, or business decisions\tform.md\nUTL-DOM-AGNOSTIC\tutils\tarchitecture\terror\tEvery Utils export is Domain-agnostic and contains no Domain declaration, identity, decision, graph definition, or Workflow step\tInspect signatures and implementations and report the exact Domain concept or business behavior\tresult.md\nUTL-REUSED\tutils\tarchitecture\terror\tEvery Utils extension serves two independent semantic consumers or one package-wide execution boundary\tList direct consumers and report an extension satisfying neither condition\tjson-codec.md\nUTL-PUBLIC-DEPS\tutils\tdependency\terror\tUtils imports only public Kernel, DSL, SDK, standard-library, and sibling Utils modules\tResolve the Utils import graph and reject Domain layers, Providers, or private package paths\tjson-codec.md\nUTL-LIGHTWEIGHT\tutils\tarchitecture\terror\tUtils is private and owns no durable engine, planner, compiler, Repository, service locator, or dependency container\tInspect package exports and declarations and report public exposure or any forbidden framework machinery\tresult.md\nSCR-OPERATOR\tscripts\tbehavior\terror\tEvery root Script implements a supported operator workflow with declared inputs, outcomes, failures, and proof\tInspect each Script contract and report disposable tasks or missing operator semantics\tbackup.md\nSCR-PUBLIC-DEPS\tscripts\tbehavior\terror\tScripts import only dependency-DAG-authorized public facades, standard libraries, and operator libraries and define no Domain behavior\tResolve imports and inspect branches and report private paths, business decisions, graph definitions, or callable behavior\tupgrade.md\nSCR-TEST-DRIVERS\tscripts\tbehavior\terror\tDisposable setup, fixtures, resets, and scenario drivers live under tests/scripts rather than root Scripts\tClassify every Script by supported operator contract and report evidence-only programs at the root\trestore.md\nTST-SYS-OWNER\ttests\tevidence\terror\tRoot Tests owns cross-layer journeys, environments, harnesses, scenarios, seeds, fixtures, and disposable scripts\tInventory evidence support code and report cross-layer artifacts outside Tests or production semantics inside Tests\tmigration-scenario.md\nTST-COLOCATED\ttests\tevidence\terror\tEvery semantic production submodule owns focused evidence in its local __tests__ directory\tJoin production submodules to focused test directories and report missing owners\tfocused-rule.md\n",
|
|
5
5
|
layers: frozenRows([
|
|
6
6
|
{
|
|
7
7
|
id: 'schema',
|