@astrale-os/sdk 0.5.0-beta.81 → 0.5.0-beta.82
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/CHANGELOG.md +7 -0
- package/dist/tooling/linter/implementations/source/mutations.js +1 -1
- package/dist/tooling/linter/implementations/source/schema.js +15 -8
- package/dist/tooling/linter/implementations/source/states.js +19 -26
- package/dist/tooling/linter/policy/generated.js +2 -69
- package/dist/tooling/linter/requirements/registry.js +2 -2
- package/dist/tooling/packaging/compile.d.ts +0 -5
- package/dist/tooling/packaging/compile.js +9 -64
- package/dist/tooling/packaging/packaging.js +2 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0-beta.82](https://github.com/astrale-os/sdk/compare/sdk-v0.5.0-beta.81...sdk-v0.5.0-beta.82) (2026-08-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **release:** align managed publication projection ([#342](https://github.com/astrale-os/sdk/issues/342)) ([269fab1](https://github.com/astrale-os/sdk/commit/269fab13d028d41a27ff50d778c73fd994cf6f22))
|
|
9
|
+
|
|
3
10
|
## [0.5.0-beta.81](https://github.com/astrale-os/sdk/compare/sdk-v0.5.0-beta.80...sdk-v0.5.0-beta.81) (2026-08-29)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -80,7 +80,7 @@ export const mutationRules = [
|
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
id: 'MUT-STATE-ATOMIC',
|
|
83
|
-
ruleRevision: '
|
|
83
|
+
ruleRevision: 'c734069c35bab09f47b4fcd6b3f207fccceb69a9da4f1fb1c50d9fd2711bf6dd',
|
|
84
84
|
evaluate(project) {
|
|
85
85
|
const evidence = [];
|
|
86
86
|
const machineProperties = machinePropertiesByClass(project);
|
|
@@ -24,7 +24,7 @@ const EXECUTION_NAMES = new Set([
|
|
|
24
24
|
export const schemaRules = [
|
|
25
25
|
{
|
|
26
26
|
id: 'SCH-STATE-SOURCE',
|
|
27
|
-
ruleRevision: '
|
|
27
|
+
ruleRevision: '153bb37fbc7ddcf164dea299d6874251b6b2aeffa707e809044c5390f25b3fe6',
|
|
28
28
|
evaluate(project) {
|
|
29
29
|
const evidence = [];
|
|
30
30
|
const machineVocabularies = stateVocabularies(project);
|
|
@@ -53,10 +53,7 @@ export const schemaRules = [
|
|
|
53
53
|
}
|
|
54
54
|
if (ts.isCallExpression(node)) {
|
|
55
55
|
const machineOrigin = stateMachineConstructorOrigin(file, node.expression);
|
|
56
|
-
if (machineOrigin === '
|
|
57
|
-
evidence.push(violation(file, node, 'Schema declares a stateMachine; move the StateMachine relation to States.'));
|
|
58
|
-
}
|
|
59
|
-
else if (machineOrigin === 'ambiguous') {
|
|
56
|
+
if (machineOrigin === 'ambiguous') {
|
|
60
57
|
evidence.push(ambiguity(file, node, 'Schema call resembles stateMachine through a local facade, but its SDK origin is unresolved.'));
|
|
61
58
|
}
|
|
62
59
|
const values = enumValues(file, node);
|
|
@@ -64,14 +61,14 @@ export const schemaRules = [
|
|
|
64
61
|
ownedVocabularies?.has(vocabularyKey(values)) === true &&
|
|
65
62
|
!reportedEnums.has(node.pos)) {
|
|
66
63
|
reportedEnums.add(node.pos);
|
|
67
|
-
evidence.push(ambiguity(file, node, 'Schema declares an enum equal to its
|
|
64
|
+
evidence.push(ambiguity(file, node, 'Schema declares an enum equal to its module StateMachine vocabulary, but copied semantic ownership cannot be proven from literals alone.'));
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
67
|
const projection = stateMachineCodecProjection(node);
|
|
71
68
|
if (projection !== undefined) {
|
|
72
69
|
const origin = stateMachineOrigin(project, file, projection.owner);
|
|
73
70
|
if (origin === 'ambiguous') {
|
|
74
|
-
evidence.push(ambiguity(file, node, `Schema StateMachine codec ${projection.name} has an unresolved
|
|
71
|
+
evidence.push(ambiguity(file, node, `Schema StateMachine codec ${projection.name} has an unresolved Schema module export origin.`));
|
|
75
72
|
}
|
|
76
73
|
else if (origin === 'absent') {
|
|
77
74
|
evidence.push(violation(file, node, `Schema StateMachine codec ${projection.name} does not originate from an exported stateMachine.`));
|
|
@@ -232,7 +229,7 @@ function literalUnionValues(file, call) {
|
|
|
232
229
|
}
|
|
233
230
|
function stateVocabularies(project) {
|
|
234
231
|
const vocabularies = new Map();
|
|
235
|
-
for (const file of production(project, '
|
|
232
|
+
for (const file of production(project, 'schema')) {
|
|
236
233
|
if (file.submodule === undefined)
|
|
237
234
|
continue;
|
|
238
235
|
const submodule = file.submodule;
|
|
@@ -299,6 +296,16 @@ function persistedStatePropertyEvidence(project, file, value, placement) {
|
|
|
299
296
|
if (associationOrigin === 'resolved' && association.kind === 'absent') {
|
|
300
297
|
return violation(file, value, 'Schema stateProperty does not reference an exported StateMachine authority.');
|
|
301
298
|
}
|
|
299
|
+
if (associationOrigin === 'resolved' && association.kind === 'resolved') {
|
|
300
|
+
const separator = association.identity.lastIndexOf('#');
|
|
301
|
+
const machinePath = separator === -1 ? association.identity : association.identity.slice(0, separator);
|
|
302
|
+
const machineFile = project.filesByPath.get(machinePath);
|
|
303
|
+
if (machineFile?.layer !== 'schema' ||
|
|
304
|
+
machineFile.submodule === undefined ||
|
|
305
|
+
machineFile.submodule !== file.submodule) {
|
|
306
|
+
return violation(file, value, 'Schema stateProperty must reference an exported StateMachine authority in the same business module.');
|
|
307
|
+
}
|
|
308
|
+
}
|
|
302
309
|
if (associationOrigin === 'ambiguous' || association.kind === 'ambiguous') {
|
|
303
310
|
return ambiguity(file, value, 'Schema StateProperty has no exact StateMachine source.');
|
|
304
311
|
}
|
|
@@ -16,11 +16,11 @@ const FORBIDDEN_LAYERS = new Set([
|
|
|
16
16
|
]);
|
|
17
17
|
export const stateRules = [
|
|
18
18
|
{
|
|
19
|
-
id: '
|
|
20
|
-
ruleRevision: '
|
|
19
|
+
id: 'SCH-STATE-RELATION',
|
|
20
|
+
ruleRevision: '5dd255417705fa49bda9c79a65032408e2817616c03e8d761ed8c6d089a733d3',
|
|
21
21
|
evaluate(project) {
|
|
22
22
|
const evidence = [];
|
|
23
|
-
const files = production(project, '
|
|
23
|
+
const files = production(project, 'schema').filter((file) => file.submodule !== undefined);
|
|
24
24
|
const bySubmodule = new Map();
|
|
25
25
|
for (const file of files) {
|
|
26
26
|
if (file.submodule === undefined)
|
|
@@ -29,17 +29,8 @@ export const stateRules = [
|
|
|
29
29
|
owned.push(file);
|
|
30
30
|
bySubmodule.set(file.submodule, owned);
|
|
31
31
|
}
|
|
32
|
-
for (const [
|
|
32
|
+
for (const [, ownedFiles] of [...bySubmodule].sort(([left], [right]) => left.localeCompare(right))) {
|
|
33
33
|
const machines = ownedFiles.flatMap((file) => machineCalls(file).map((machine) => ({ file, ...machine })));
|
|
34
|
-
if (machines.length === 0) {
|
|
35
|
-
evidence.push(violation(ownedFiles[0], ownedFiles[0].source, `State submodule ${submodule} declares no stateMachine relation.`));
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (machines.length > 1) {
|
|
39
|
-
for (const machine of machines.slice(1)) {
|
|
40
|
-
evidence.push(violation(machine.file, machine.call, `State submodule ${submodule} declares more than one stateMachine relation.`));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
34
|
for (const machine of machines) {
|
|
44
35
|
if (machine.origin === 'ambiguous') {
|
|
45
36
|
evidence.push(ambiguity(machine.file, machine.call, 'State machine constructor is reached through a local facade; its SDK origin is unresolved.'));
|
|
@@ -48,13 +39,15 @@ export const stateRules = [
|
|
|
48
39
|
const exportStatus = machineExportStatus(machine.file, machine.call);
|
|
49
40
|
if (exportStatus !== 'exported') {
|
|
50
41
|
evidence.push(violation(machine.file, machine.call, exportStatus === 'private'
|
|
51
|
-
? 'State machine relation must be exported as its
|
|
42
|
+
? 'State machine relation must be exported as its Schema module StateMachine authority.'
|
|
52
43
|
: 'State machine relation must be assigned to one exported top-level binding.'));
|
|
53
44
|
}
|
|
54
45
|
evidence.push(...admitStaticRelation(machine.file, machine.call));
|
|
55
46
|
}
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
for (const machine of machines) {
|
|
48
|
+
if (machine.origin === 'resolved') {
|
|
49
|
+
evidence.push(...parallelAuthorityEvidence(ownedFiles, machine.file, machine.call));
|
|
50
|
+
}
|
|
58
51
|
}
|
|
59
52
|
}
|
|
60
53
|
for (const file of files) {
|
|
@@ -73,22 +66,22 @@ export const stateRules = [
|
|
|
73
66
|
},
|
|
74
67
|
},
|
|
75
68
|
{
|
|
76
|
-
id: '
|
|
77
|
-
ruleRevision: '
|
|
69
|
+
id: 'SCH-STATE-PURE',
|
|
70
|
+
ruleRevision: '8bc69ef2aea37f568d34953c81cad55b1a91ab021e5d6e9b98c6aee3db6f4dd5',
|
|
78
71
|
evaluate(project) {
|
|
79
72
|
const evidence = [];
|
|
80
|
-
for (const file of production(project, '
|
|
73
|
+
for (const file of production(project, 'schema').filter((candidate) => machineCalls(candidate).length > 0)) {
|
|
81
74
|
const exports = localExportNames(file);
|
|
82
75
|
for (const statement of file.source.statements) {
|
|
83
76
|
if (ts.isClassDeclaration(statement) &&
|
|
84
77
|
(hasExportModifier(statement) ||
|
|
85
78
|
(statement.name !== undefined && exports.has(statement.name.text)))) {
|
|
86
|
-
evidence.push(violation(file, statement, '
|
|
79
|
+
evidence.push(violation(file, statement, 'StateMachine declaration file exports executable behavior; move guards and callbacks to Rules or an effect-owning layer.'));
|
|
87
80
|
}
|
|
88
81
|
if (ts.isFunctionDeclaration(statement) &&
|
|
89
82
|
statement.name &&
|
|
90
83
|
(hasExportModifier(statement) || exports.has(statement.name.text))) {
|
|
91
|
-
evidence.push(violation(file, statement, '
|
|
84
|
+
evidence.push(violation(file, statement, 'StateMachine declaration file exports executable behavior; move guards and callbacks to Rules or an effect-owning layer.'));
|
|
92
85
|
}
|
|
93
86
|
if (!ts.isVariableStatement(statement))
|
|
94
87
|
continue;
|
|
@@ -108,7 +101,7 @@ export const stateRules = [
|
|
|
108
101
|
});
|
|
109
102
|
if (behavior === undefined)
|
|
110
103
|
continue;
|
|
111
|
-
evidence.push(violation(file, behavior, '
|
|
104
|
+
evidence.push(violation(file, behavior, 'StateMachine declaration file exports executable behavior; move guards and callbacks to Rules or an effect-owning layer.'));
|
|
112
105
|
}
|
|
113
106
|
}
|
|
114
107
|
for (const sourceImport of file.imports) {
|
|
@@ -116,11 +109,11 @@ export const stateRules = [
|
|
|
116
109
|
if ((target?.layer !== undefined && FORBIDDEN_LAYERS.has(target.layer)) ||
|
|
117
110
|
forbiddenIoImport(sourceImport.specifier) ||
|
|
118
111
|
sourceImport.specifier.startsWith('@astrale-os/adapter-')) {
|
|
119
|
-
evidence.push(violation(file, sourceImport.node, `
|
|
112
|
+
evidence.push(violation(file, sourceImport.node, `StateMachine declaration imports behavioral boundary ${sourceImport.specifier}.`));
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
115
|
for (const { node, name } of hasForbiddenGlobalCall(file)) {
|
|
123
|
-
evidence.push(violation(file, node, `
|
|
116
|
+
evidence.push(violation(file, node, `StateMachine declaration calls effectful global ${name}.`));
|
|
124
117
|
}
|
|
125
118
|
for (const machine of machineCalls(file)) {
|
|
126
119
|
const input = machine.call.arguments[0];
|
|
@@ -234,14 +227,14 @@ function parallelAuthorityEvidence(files, machineFile, machineCall) {
|
|
|
234
227
|
}
|
|
235
228
|
const duplicated = duplicatedProjection(declaration.initializer, vocabulary);
|
|
236
229
|
if (duplicated !== undefined) {
|
|
237
|
-
evidence.push(violation(file, declaration, `
|
|
230
|
+
evidence.push(violation(file, declaration, `Schema module exports a separate ${duplicated}; derive it from the StateMachine at the use site.`));
|
|
238
231
|
}
|
|
239
232
|
}
|
|
240
233
|
}
|
|
241
234
|
if (ts.isTypeAliasDeclaration(statement) &&
|
|
242
235
|
(hasExportModifier(statement) || locallyExported.has(statement.name.text)) &&
|
|
243
236
|
duplicatesClosedVocabulary(statement.type, vocabulary)) {
|
|
244
|
-
evidence.push(violation(file, statement, '
|
|
237
|
+
evidence.push(violation(file, statement, 'Schema module exports a separate state or event union; derive it with StateOf or EventOf.'));
|
|
245
238
|
}
|
|
246
239
|
}
|
|
247
240
|
}
|
|
@@ -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 = '82ac221b62ce58393ea997e44230449a6d08ed207d5e961c4791cdbd5725e071';
|
|
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-INT\tdomains\tdependency\terror\tEvery cross-Domain callable invocation implements a consumer-owned Integration inside a Provider and uses only the remote Domain's public facade\tTrace foreign callable invocations and report direct Action or Workflow calls, missing Integration contracts, non-Provider call sites, or private remote imports\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\tdeclaration\terror\tEvery authored declaration and public callable value has exactly one Schema submodule owner\tInventory declarations and callable inputs, results, and failures and report missing, duplicate, or layer-root owners\tschema-facade.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-POLICY-AUTH\tschema\tdeclaration\terror\tCallable authority is declared through Policy and Action implementations add no private authorization rule\tTrace callable admission and report authority conditions without one owning Policy\tpolicy.md\nSCH-STATE-SOURCE\tschema\tdeclaration\terror\tEvery StateMachine vocabulary exposed by Schema originates from its canonical States owner rather than a copied literal set\tResolve exact StateMachine origins; report same-owner exact Zod literals as indeterminate and ignore unrelated submodules or DSL method names\tarticle-schema.md\nSTA-ONE-RELATION\tstates\tdeclaration\terror\tEvery finite state topology has one immutable StateMachine relation containing its states, events, initial state, and legal transitions\tIdentify each StateMachine and report missing fields, mutable data, or duplicate transition authorities\tarticle-status.md\nSTA-PURE\tstates\tdeclaration\terror\tTransition relations contain no executable guard, permission, effect, retry policy, timer, clock, or provider behavior\tInspect transition values and resolved dependencies while treating state and event vocabulary as structural data\tterminal-states.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-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 States machine and one allowed decision; reject direct target writes and split precondition updates\tstate-transition.md\nWFL-MULTISTEP\tworkflows\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\nWFL-STEP-EFFECTS\tworkflows\tbehavior\terror\tEvery semantic asynchronous operation maps to one named step.run boundary\tTrace effects and report operations outside step.run\tpublication-workflow.md\nWFL-STEP-IDS\tworkflows\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\nWFL-NO-NEST\tworkflows\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\nWFL-INT-TYPES\tworkflows\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\nWFL-ONE-OP-STEP\tworkflows\tbehavior\terror\tEvery step owns exactly one semantic asynchronous operation\tTrace each step and report zero or several independently failing operations\tpublication-workflow.md\nWFL-STATE-CODEC\tworkflows\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\nWFL-RECOVERY\tworkflows\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\nWFL-XDOM-INT\tworkflows\tbehavior\terror\tA Workflow invokes another Domain only through a declared Integration and imports no foreign Domain\tResolve Workflow imports and operations and report foreign Domain imports or calls without Integration ownership\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\nACT-ONE-IMPL\tactions\tbehavior\terror\tEvery registered handler binding resolves to exactly one implementation owned by one semantic Actions submodule\tResolve the handler registry and report non-Action owners or duplicate registrations; SDK typing owns callable exhaustiveness\tsynchronous-result.md\nACT-ONE-OP\tactions\tbehavior\terror\tEvery Action performs one terminal semantic operation; only a native binary compatibility Action may precede its Integration call with one exact-receiver Query\tTrace every path and report several terminal effects, writes before effects, non-receiver prerequisite reads, or hidden orchestration\tsingle-operation.md\nACT-OP-KINDS\tactions\tbehavior\terror\tA semantic asynchronous operation is one Query definition, Mutation definition, or Integration call\tClassify every awaited effect and report operations outside the three allowed kinds\tintegration-operation.md\nACT-BOUNDARIES\tactions\tbehavior\terror\tActions use only invocation-bound query and mutate executors, including explicit caller self or union graph partitions, plus declared Integrations; Providers or foreign Domains are never imported\tInspect context use, authority-mode selection, dependencies, imports, and failure mapping; report raw or unbound graph executors, implicit privilege, concrete or foreign dependencies, broad mapping, or swallowed defects\tremote-integration.md\nACT-BINARY-RESULT\tactions\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\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 Application callable requirement\tMatch each invocation-bound public callable reference to the same foreign facade and callable selector under Application 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\tApplication 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, States, 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-INT\tdomains\tdependency\terror\tEvery cross-Domain callable invocation implements a consumer-owned Integration inside a Provider and uses only the remote Domain's public facade\tTrace foreign callable invocations and report direct Action or Workflow calls, missing Integration contracts, non-Provider call sites, or private remote imports\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\tdeclaration\terror\tEvery authored declaration and public callable value has exactly one Schema submodule owner\tInventory declarations and callable inputs, results, and failures and report missing, duplicate, or layer-root owners\tschema-facade.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-POLICY-AUTH\tschema\tdeclaration\terror\tCallable authority is declared through Policy and Action implementations add no private authorization rule\tTrace callable admission and report authority conditions without one owning Policy\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-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\nWFL-MULTISTEP\tworkflows\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\nWFL-STEP-EFFECTS\tworkflows\tbehavior\terror\tEvery semantic asynchronous operation maps to one named step.run boundary\tTrace effects and report operations outside step.run\tpublication-workflow.md\nWFL-STEP-IDS\tworkflows\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\nWFL-NO-NEST\tworkflows\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\nWFL-INT-TYPES\tworkflows\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\nWFL-ONE-OP-STEP\tworkflows\tbehavior\terror\tEvery step owns exactly one semantic asynchronous operation\tTrace each step and report zero or several independently failing operations\tpublication-workflow.md\nWFL-STATE-CODEC\tworkflows\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\nWFL-RECOVERY\tworkflows\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\nWFL-XDOM-INT\tworkflows\tbehavior\terror\tA Workflow invokes another Domain only through a declared Integration and imports no foreign Domain\tResolve Workflow imports and operations and report foreign Domain imports or calls without Integration ownership\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\nACT-ONE-IMPL\tactions\tbehavior\terror\tEvery registered handler binding resolves to exactly one implementation owned by one semantic Actions submodule\tResolve the handler registry and report non-Action owners or duplicate registrations; SDK typing owns callable exhaustiveness\tsynchronous-result.md\nACT-ONE-OP\tactions\tbehavior\terror\tEvery Action performs one terminal semantic operation; only a native binary compatibility Action may precede its Integration call with one exact-receiver Query\tTrace every path and report several terminal effects, writes before effects, non-receiver prerequisite reads, or hidden orchestration\tsingle-operation.md\nACT-OP-KINDS\tactions\tbehavior\terror\tA semantic asynchronous operation is one Query definition, Mutation definition, or Integration call\tClassify every awaited effect and report operations outside the three allowed kinds\tintegration-operation.md\nACT-BOUNDARIES\tactions\tbehavior\terror\tActions use only invocation-bound query and mutate executors, including explicit caller self or union graph partitions, plus declared Integrations; Providers or foreign Domains are never imported\tInspect context use, authority-mode selection, dependencies, imports, and failure mapping; report raw or unbound graph executors, implicit privilege, concrete or foreign dependencies, broad mapping, or swallowed defects\tremote-integration.md\nACT-BINARY-RESULT\tactions\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\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 Application callable requirement\tMatch each invocation-bound public callable reference to the same foreign facade and callable selector under Application 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\tApplication 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',
|
|
@@ -9,11 +9,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
9
9
|
facade: 'schema.ts',
|
|
10
10
|
required: true,
|
|
11
11
|
},
|
|
12
|
-
{
|
|
13
|
-
id: 'states',
|
|
14
|
-
sourcePath: 'states/',
|
|
15
|
-
required: false,
|
|
16
|
-
},
|
|
17
12
|
{
|
|
18
13
|
id: 'rules',
|
|
19
14
|
sourcePath: 'rules/',
|
|
@@ -87,24 +82,12 @@ export const domainPolicySource = Object.freeze({
|
|
|
87
82
|
},
|
|
88
83
|
]),
|
|
89
84
|
dependencies: frozenRows([
|
|
90
|
-
{
|
|
91
|
-
source: 'schema',
|
|
92
|
-
target: 'states',
|
|
93
|
-
kind: 'runtime',
|
|
94
|
-
condition: 'Schema reuses the lifecycle codec and vocabulary',
|
|
95
|
-
},
|
|
96
85
|
{
|
|
97
86
|
source: 'rules',
|
|
98
87
|
target: 'schema',
|
|
99
88
|
kind: 'type-only',
|
|
100
89
|
condition: 'Rules consume Domain values',
|
|
101
90
|
},
|
|
102
|
-
{
|
|
103
|
-
source: 'rules',
|
|
104
|
-
target: 'states',
|
|
105
|
-
kind: 'type-only',
|
|
106
|
-
condition: 'Rules decide lifecycle movement',
|
|
107
|
-
},
|
|
108
91
|
{
|
|
109
92
|
source: 'rules',
|
|
110
93
|
target: 'queries',
|
|
@@ -123,12 +106,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
123
106
|
kind: 'runtime',
|
|
124
107
|
condition: 'Queries address authored declaration values',
|
|
125
108
|
},
|
|
126
|
-
{
|
|
127
|
-
source: 'queries',
|
|
128
|
-
target: 'states',
|
|
129
|
-
kind: 'type-only',
|
|
130
|
-
condition: 'Query observations expose lifecycle values',
|
|
131
|
-
},
|
|
132
109
|
{
|
|
133
110
|
source: 'queries',
|
|
134
111
|
target: 'utils',
|
|
@@ -141,12 +118,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
141
118
|
kind: 'runtime',
|
|
142
119
|
condition: 'Mutations address authored declaration values',
|
|
143
120
|
},
|
|
144
|
-
{
|
|
145
|
-
source: 'mutations',
|
|
146
|
-
target: 'states',
|
|
147
|
-
kind: 'runtime',
|
|
148
|
-
condition: 'Mutations consume allowed lifecycle decisions',
|
|
149
|
-
},
|
|
150
121
|
{
|
|
151
122
|
source: 'mutations',
|
|
152
123
|
target: 'rules',
|
|
@@ -171,12 +142,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
171
142
|
kind: 'runtime',
|
|
172
143
|
condition: 'Workflows use public Domain values and event contracts',
|
|
173
144
|
},
|
|
174
|
-
{
|
|
175
|
-
source: 'workflows',
|
|
176
|
-
target: 'states',
|
|
177
|
-
kind: 'runtime',
|
|
178
|
-
condition: 'Workflows decide lifecycle movement before effects and atomic persistence',
|
|
179
|
-
},
|
|
180
145
|
{
|
|
181
146
|
source: 'workflows',
|
|
182
147
|
target: 'rules',
|
|
@@ -207,12 +172,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
207
172
|
kind: 'runtime',
|
|
208
173
|
condition: 'Migrations bind exact revision and declaration values',
|
|
209
174
|
},
|
|
210
|
-
{
|
|
211
|
-
source: 'migrations',
|
|
212
|
-
target: 'states',
|
|
213
|
-
kind: 'type-only',
|
|
214
|
-
condition: 'Migration transforms preserve machine-state vocabulary',
|
|
215
|
-
},
|
|
216
175
|
{
|
|
217
176
|
source: 'migrations',
|
|
218
177
|
target: 'rules',
|
|
@@ -303,12 +262,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
303
262
|
kind: 'runtime',
|
|
304
263
|
condition: 'Views map public values and bind callable descriptors',
|
|
305
264
|
},
|
|
306
|
-
{
|
|
307
|
-
source: 'views',
|
|
308
|
-
target: 'states',
|
|
309
|
-
kind: 'runtime',
|
|
310
|
-
condition: 'Views derive available lifecycle events for presentation',
|
|
311
|
-
},
|
|
312
265
|
{
|
|
313
266
|
source: 'views',
|
|
314
267
|
target: 'rules',
|
|
@@ -483,12 +436,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
483
436
|
kind: 'evidence',
|
|
484
437
|
condition: 'Focused system evidence needs Schema internals',
|
|
485
438
|
},
|
|
486
|
-
{
|
|
487
|
-
source: 'tests',
|
|
488
|
-
target: 'states',
|
|
489
|
-
kind: 'evidence',
|
|
490
|
-
condition: 'Lifecycle evidence needs States internals',
|
|
491
|
-
},
|
|
492
439
|
{
|
|
493
440
|
source: 'tests',
|
|
494
441
|
target: 'rules',
|
|
@@ -639,20 +586,6 @@ export const domainPolicySource = Object.freeze({
|
|
|
639
586
|
typescriptTarget: './schema/*/index.ts',
|
|
640
587
|
packageTarget: './schema/*/index.ts',
|
|
641
588
|
},
|
|
642
|
-
{
|
|
643
|
-
layer: 'states',
|
|
644
|
-
kind: 'facade',
|
|
645
|
-
specifier: '#states',
|
|
646
|
-
typescriptTarget: './states/index.ts',
|
|
647
|
-
packageTarget: './states/index.ts',
|
|
648
|
-
},
|
|
649
|
-
{
|
|
650
|
-
layer: 'states',
|
|
651
|
-
kind: 'submodule',
|
|
652
|
-
specifier: '#states/*',
|
|
653
|
-
typescriptTarget: './states/*/index.ts',
|
|
654
|
-
packageTarget: './states/*/index.ts',
|
|
655
|
-
},
|
|
656
589
|
{
|
|
657
590
|
layer: 'rules',
|
|
658
591
|
kind: 'facade',
|
|
@@ -86,8 +86,8 @@ export const domainRuleRequirements = Object.freeze([
|
|
|
86
86
|
row('SCH-EXACT-TYPES', DECLARATION),
|
|
87
87
|
row('SCH-POLICY-AUTH', DECLARATION_FLOW),
|
|
88
88
|
row('SCH-STATE-SOURCE', DECLARATION),
|
|
89
|
-
row('
|
|
90
|
-
row('
|
|
89
|
+
row('SCH-STATE-RELATION', DECLARATION),
|
|
90
|
+
row('SCH-STATE-PURE', DECLARATION_FLOW),
|
|
91
91
|
row('RUL-SYNC', BEHAVIOR),
|
|
92
92
|
row('RUL-PURE', BEHAVIOR),
|
|
93
93
|
row('RUL-EXPL-FACTS', BEHAVIOR),
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
export interface DomainPackageCompilation {
|
|
2
2
|
readonly root: string;
|
|
3
3
|
readonly typeClosure: readonly DomainPackageTypeClosure[];
|
|
4
|
-
readonly runtimeClosure: readonly DomainPackageRuntimeClosure[];
|
|
5
4
|
}
|
|
6
5
|
export interface DomainPackageTypeClosure {
|
|
7
6
|
readonly source: string;
|
|
8
7
|
readonly target: string;
|
|
9
8
|
}
|
|
10
|
-
export interface DomainPackageRuntimeClosure {
|
|
11
|
-
readonly source: string;
|
|
12
|
-
readonly target: string;
|
|
13
|
-
}
|
|
14
9
|
/** Compile one package's admitted Schema contracts with SDK-owned emit policy. */
|
|
15
10
|
export declare function compileDomainPackage(projectDir: string, entrypoints?: readonly string[]): DomainPackageCompilation;
|
|
@@ -53,13 +53,11 @@ export function compileDomainPackage(projectDir, entrypoints = ['schema/index.ts
|
|
|
53
53
|
const closure = admitSchemaClosure(project, packageConfiguration);
|
|
54
54
|
runCompiler(project, ['-p', configurationPath, '--noEmit']);
|
|
55
55
|
runCompiler(project, ['-p', packageConfiguration]);
|
|
56
|
-
relocateRuntimeClosure(root, closure.runtimeClosure);
|
|
57
56
|
relocateTypeClosure(root, closure.typeClosure);
|
|
58
|
-
rewriteEmittedReferences(root, closure.emittedReferences
|
|
57
|
+
rewriteEmittedReferences(root, closure.emittedReferences);
|
|
59
58
|
return Object.freeze({
|
|
60
59
|
root,
|
|
61
60
|
typeClosure: closure.typeClosure,
|
|
62
|
-
runtimeClosure: closure.runtimeClosure,
|
|
63
61
|
});
|
|
64
62
|
}
|
|
65
63
|
catch (cause) {
|
|
@@ -94,8 +92,6 @@ function admitSchemaClosure(project, configuration) {
|
|
|
94
92
|
relative(project, document.fileName).replaceAll('\\', '/'),
|
|
95
93
|
document,
|
|
96
94
|
]));
|
|
97
|
-
const stateRuntime = new Set();
|
|
98
|
-
const stateOwners = new Map();
|
|
99
95
|
const emittedReferences = [];
|
|
100
96
|
const pending = [...paths.keys()].filter((path) => path.startsWith('schema/')).sort();
|
|
101
97
|
const visited = new Set();
|
|
@@ -105,7 +101,6 @@ function admitSchemaClosure(project, configuration) {
|
|
|
105
101
|
continue;
|
|
106
102
|
visited.add(owner);
|
|
107
103
|
const document = paths.get(owner);
|
|
108
|
-
const ownerStateRoot = stateOwners.get(owner);
|
|
109
104
|
const visit = (node) => {
|
|
110
105
|
if (unsupportedModuleReference(node)) {
|
|
111
106
|
throw new TypeError(`Domain contract runtime ${owner} uses unsupported non-static dependency syntax.`);
|
|
@@ -118,32 +113,11 @@ function admitSchemaClosure(project, configuration) {
|
|
|
118
113
|
if (dependencyDocument !== undefined) {
|
|
119
114
|
const dependency = relative(project, dependencyDocument.fileName).replaceAll('\\', '/');
|
|
120
115
|
const typeOnly = isTypeOnlyReference(node);
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
if (!dependency.startsWith('states/')) {
|
|
124
|
-
throw new TypeError(`Domain Schema contract imports non-Schema source: ${dependency}.`);
|
|
125
|
-
}
|
|
126
|
-
const semanticRoot = stateSemanticRoot(dependency);
|
|
127
|
-
stateRuntime.add(dependency);
|
|
128
|
-
stateOwners.set(dependency, semanticRoot);
|
|
129
|
-
pending.push(dependency);
|
|
130
|
-
emittedReferences.push(Object.freeze({ owner, specifier, dependency }));
|
|
131
|
-
}
|
|
132
|
-
else if (!typeOnly && specifier.startsWith('#')) {
|
|
133
|
-
emittedReferences.push(Object.freeze({ owner, specifier, dependency }));
|
|
134
|
-
}
|
|
116
|
+
if (!typeOnly && !dependency.startsWith('schema/')) {
|
|
117
|
+
throw new TypeError(`Domain Schema contract imports non-Schema source: ${dependency}.`);
|
|
135
118
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (!dependency.startsWith('states/') || dependencyRoot !== ownerStateRoot) {
|
|
139
|
-
throw new TypeError(`Domain State runtime ${owner} imports outside semantic submodule ${ownerStateRoot}: ${dependency}.`);
|
|
140
|
-
}
|
|
141
|
-
stateRuntime.add(dependency);
|
|
142
|
-
stateOwners.set(dependency, ownerStateRoot);
|
|
143
|
-
pending.push(dependency);
|
|
144
|
-
if (!typeOnly) {
|
|
145
|
-
emittedReferences.push(Object.freeze({ owner, specifier, dependency }));
|
|
146
|
-
}
|
|
119
|
+
if (!typeOnly && specifier.startsWith('#')) {
|
|
120
|
+
emittedReferences.push(Object.freeze({ owner, specifier, dependency }));
|
|
147
121
|
}
|
|
148
122
|
}
|
|
149
123
|
}
|
|
@@ -151,12 +125,8 @@ function admitSchemaClosure(project, configuration) {
|
|
|
151
125
|
};
|
|
152
126
|
visit(document);
|
|
153
127
|
}
|
|
154
|
-
const runtimeClosure = Object.freeze([...stateRuntime].sort().map((source) => Object.freeze({
|
|
155
|
-
source,
|
|
156
|
-
target: `schema/.runtime/${source.replace(/\.(?:tsx?|mts|cts)$/u, '.js')}`,
|
|
157
|
-
})));
|
|
158
128
|
const typeClosure = Object.freeze([...paths.keys()]
|
|
159
|
-
.filter((path) => !path.startsWith('schema/')
|
|
129
|
+
.filter((path) => !path.startsWith('schema/'))
|
|
160
130
|
.sort()
|
|
161
131
|
.map((source) => Object.freeze({
|
|
162
132
|
source,
|
|
@@ -164,20 +134,11 @@ function admitSchemaClosure(project, configuration) {
|
|
|
164
134
|
})));
|
|
165
135
|
return Object.freeze({
|
|
166
136
|
typeClosure,
|
|
167
|
-
runtimeClosure,
|
|
168
137
|
emittedReferences: Object.freeze(emittedReferences.sort((left, right) => left.owner.localeCompare(right.owner) ||
|
|
169
138
|
left.specifier.localeCompare(right.specifier) ||
|
|
170
139
|
left.dependency.localeCompare(right.dependency))),
|
|
171
140
|
});
|
|
172
141
|
}
|
|
173
|
-
function stateSemanticRoot(source) {
|
|
174
|
-
const segments = source.split('/');
|
|
175
|
-
if (segments[0] !== 'states' || segments.length < 2)
|
|
176
|
-
return '';
|
|
177
|
-
if (segments.length === 2)
|
|
178
|
-
return source;
|
|
179
|
-
return `states/${segments[1]}/`;
|
|
180
|
-
}
|
|
181
142
|
function referencedModule(node) {
|
|
182
143
|
if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&
|
|
183
144
|
node.moduleSpecifier !== undefined &&
|
|
@@ -239,22 +200,7 @@ function relocateTypeClosure(root, closure) {
|
|
|
239
200
|
}
|
|
240
201
|
}
|
|
241
202
|
}
|
|
242
|
-
function
|
|
243
|
-
for (const { source, target } of closure) {
|
|
244
|
-
const emitted = resolve(root, source.replace(/\.(?:tsx?|mts|cts)$/u, ''));
|
|
245
|
-
const destination = resolve(root, target.replace(/\.js$/u, ''));
|
|
246
|
-
mkdirSync(dirname(destination), { recursive: true });
|
|
247
|
-
for (const extension of ['.js', '.d.ts']) {
|
|
248
|
-
const file = `${emitted}${extension}`;
|
|
249
|
-
if (!existsSync(file)) {
|
|
250
|
-
throw new TypeError(`Domain State runtime output is absent: ${source}.`);
|
|
251
|
-
}
|
|
252
|
-
renameSync(file, `${destination}${extension}`);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
function rewriteEmittedReferences(root, references, closure) {
|
|
257
|
-
const targets = new Map(closure.map(({ source, target }) => [source, target]));
|
|
203
|
+
function rewriteEmittedReferences(root, references) {
|
|
258
204
|
const grouped = new Map();
|
|
259
205
|
for (const reference of references) {
|
|
260
206
|
const current = grouped.get(reference.owner) ?? [];
|
|
@@ -262,7 +208,7 @@ function rewriteEmittedReferences(root, references, closure) {
|
|
|
262
208
|
grouped.set(reference.owner, current);
|
|
263
209
|
}
|
|
264
210
|
for (const [owner, ownedReferences] of grouped) {
|
|
265
|
-
const ownerTarget =
|
|
211
|
+
const ownerTarget = owner.replace(/\.(?:tsx?|mts|cts)$/u, '.js');
|
|
266
212
|
for (const extension of ['.js', '.d.ts']) {
|
|
267
213
|
const file = resolve(root, ownerTarget.replace(/\.js$/u, extension));
|
|
268
214
|
let source = readFileSync(file, 'utf8');
|
|
@@ -273,8 +219,7 @@ function rewriteEmittedReferences(root, references, closure) {
|
|
|
273
219
|
if (specifier !== undefined) {
|
|
274
220
|
const reference = ownedReferences.find((candidate) => candidate.specifier === specifier);
|
|
275
221
|
if (reference !== undefined) {
|
|
276
|
-
const dependencyTarget =
|
|
277
|
-
reference.dependency.replace(/\.(?:tsx?|mts|cts)$/u, '.js');
|
|
222
|
+
const dependencyTarget = reference.dependency.replace(/\.(?:tsx?|mts|cts)$/u, '.js');
|
|
278
223
|
const path = relative(dirname(ownerTarget), dependencyTarget).replaceAll('\\', '/');
|
|
279
224
|
const value = path.startsWith('./') || path.startsWith('../') ? path : `./${path}`;
|
|
280
225
|
const literal = moduleLiteral(node);
|
|
@@ -17,12 +17,9 @@ export async function packageDomain(input) {
|
|
|
17
17
|
admitDomainPackage(projectDir, manifest);
|
|
18
18
|
const contracts = admitContractManifest(manifest);
|
|
19
19
|
const self = admitSelfPackage(manifest.name, contracts.map(({ subpath }) => subpath));
|
|
20
|
-
const { typeClosure
|
|
20
|
+
const { typeClosure } = compileDomainPackage(projectDir, contracts.map(({ source }) => source));
|
|
21
21
|
const entrypoints = contracts.map(({ declaration }) => declaration);
|
|
22
|
-
const declarationEntrypoints =
|
|
23
|
-
...entrypoints,
|
|
24
|
-
...runtimeClosure.map(({ target }) => target.replace(/\.js$/u, '.d.ts')),
|
|
25
|
-
];
|
|
22
|
+
const declarationEntrypoints = entrypoints;
|
|
26
23
|
verifyPublishedJavaScript(projectDir, manifest);
|
|
27
24
|
const javascriptPackages = verifyContractJavaScript(root, self);
|
|
28
25
|
const normalized = await normalizeDeclarations({
|