@astrale-os/sdk 0.6.0-beta.55 → 0.6.0-beta.57

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.
Files changed (74) hide show
  1. package/README.md +11 -10
  2. package/dist/application/index.d.ts +2 -1
  3. package/dist/application/query/execution/crossings.d.ts +6 -1
  4. package/dist/application/query/execution/crossings.js +15 -1
  5. package/dist/application/query/execution/legacy/declared-classes.d.ts +10 -0
  6. package/dist/application/query/execution/legacy/declared-classes.js +9 -0
  7. package/dist/application/requirements/canonical.d.ts +7 -0
  8. package/dist/application/requirements/canonical.js +16 -0
  9. package/dist/application/requirements/classes.d.ts +9 -7
  10. package/dist/application/requirements/classes.js +35 -42
  11. package/dist/application/requirements/functions.d.ts +3 -1
  12. package/dist/application/requirements/functions.js +12 -27
  13. package/dist/application/requirements/index.d.ts +34 -16
  14. package/dist/application/requirements/index.js +17 -20
  15. package/dist/application/requirements/legacy/authority.d.ts +21 -0
  16. package/dist/application/requirements/{authority.js → legacy/authority.js} +5 -2
  17. package/dist/application/requirements/legacy/classes.d.ts +22 -0
  18. package/dist/application/requirements/legacy/classes.js +24 -0
  19. package/dist/application/requirements/legacy/core.d.ts +30 -0
  20. package/dist/application/requirements/{core.js → legacy/core.js} +15 -13
  21. package/dist/application/requirements/legacy/functions.d.ts +7 -0
  22. package/dist/application/requirements/legacy/functions.js +15 -0
  23. package/dist/application/requirements/legacy/index.d.ts +43 -0
  24. package/dist/application/requirements/legacy/index.js +1 -0
  25. package/dist/application/requirements/legacy/requirements.d.ts +31 -0
  26. package/dist/application/requirements/legacy/requirements.js +31 -0
  27. package/dist/application/requirements/requirement.d.ts +30 -19
  28. package/dist/application/requirements/roles.d.ts +17 -0
  29. package/dist/application/requirements/roles.js +62 -0
  30. package/dist/application/requirements/scopes.d.ts +16 -0
  31. package/dist/application/requirements/scopes.js +34 -0
  32. package/dist/deployment/build/build.d.ts +3 -5
  33. package/dist/deployment/build/compile.js +12 -64
  34. package/dist/deployment/build/legacy/requirements.d.ts +11 -0
  35. package/dist/deployment/build/legacy/requirements.js +79 -0
  36. package/dist/deployment/build/material.js +0 -3
  37. package/dist/execution/invocation/dispatch/context.js +2 -1
  38. package/dist/platform/schema/class-authoring.d.ts +9 -7
  39. package/dist/platform/schema/class-authoring.js +3 -2
  40. package/dist/platform/schema/index.d.ts +1 -1
  41. package/dist/testing/query.js +2 -1
  42. package/dist/tooling/linter/adapters/typescript/discover.js +8 -2
  43. package/dist/tooling/linter/adapters/typescript/index.d.ts +6 -0
  44. package/dist/tooling/linter/adapters/typescript/index.js +1 -0
  45. package/dist/tooling/linter/adapters/typescript/legacy.d.ts +20 -0
  46. package/dist/tooling/linter/adapters/typescript/legacy.js +28 -0
  47. package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +1 -2
  48. package/dist/tooling/linter/implementations/source/callable-requirements.js +7 -44
  49. package/dist/tooling/linter/implementations/source/const-initializer.d.ts +3 -0
  50. package/dist/tooling/linter/implementations/source/const-initializer.js +31 -0
  51. package/dist/tooling/linter/implementations/source/domain-requirements.d.ts +8 -0
  52. package/dist/tooling/linter/implementations/source/domain-requirements.js +35 -0
  53. package/dist/tooling/linter/implementations/source/global.js +21 -8
  54. package/dist/tooling/linter/implementations/source/legacy/requirements.d.ts +10 -0
  55. package/dist/tooling/linter/implementations/source/legacy/requirements.js +40 -0
  56. package/dist/tooling/linter/implementations/source/legacy-folders.d.ts +3 -0
  57. package/dist/tooling/linter/implementations/source/legacy-folders.js +126 -0
  58. package/dist/tooling/linter/implementations/source/mutations.js +7 -22
  59. package/dist/tooling/linter/implementations/source/requirement-entries.d.ts +24 -0
  60. package/dist/tooling/linter/implementations/source/requirement-entries.js +52 -0
  61. package/dist/tooling/linter/implementations/source/schema.d.ts +3 -0
  62. package/dist/tooling/linter/implementations/source/schema.js +9 -5
  63. package/dist/tooling/linter/implementations/source/tests.js +1 -1
  64. package/dist/tooling/linter/implementations/source/verifiers.js +2 -0
  65. package/dist/tooling/linter/policy/generated.js +2 -2
  66. package/dist/tooling/linter/requirements/registry.js +2 -0
  67. package/docs/accounts/scenarios.tsv +12 -0
  68. package/docs/handler-dependencies.md +5 -3
  69. package/docs/legacy.md +113 -0
  70. package/docs/queries.md +3 -2
  71. package/docs/requirements.md +134 -0
  72. package/package.json +4 -4
  73. package/dist/application/requirements/authority.d.ts +0 -7
  74. package/dist/application/requirements/core.d.ts +0 -14
@@ -0,0 +1,52 @@
1
+ import ts from 'typescript';
2
+ import { objectProperty, staticText, unwrap } from '../../adapters/typescript/index.js';
3
+ import { lexicalConstInitializer } from './const-initializer.js';
4
+ export const NO_REQUIREMENT_ENTRIES = Object.freeze({
5
+ callables: Object.freeze([]),
6
+ classes: Object.freeze([]),
7
+ indeterminate: false,
8
+ });
9
+ /** The elements of an array property; `undefined` when absent, `opaque` when not a literal. */
10
+ export function arrayElements(object, name) {
11
+ const property = objectProperty(object, name);
12
+ if (property === undefined)
13
+ return undefined;
14
+ if (!ts.isPropertyAssignment(property))
15
+ return 'opaque';
16
+ const value = unwrap(property.initializer);
17
+ return ts.isArrayLiteralExpression(value) ? value.elements : 'opaque';
18
+ }
19
+ /** One object entry of a requirement list, through one immutable lexical alias at most. */
20
+ export function entryObject(expression) {
21
+ if (ts.isSpreadElement(expression))
22
+ return undefined;
23
+ let value = unwrap(expression);
24
+ if (ts.isIdentifier(value)) {
25
+ const initializer = lexicalConstInitializer(value);
26
+ if (initializer === undefined)
27
+ return undefined;
28
+ value = unwrap(initializer);
29
+ }
30
+ return ts.isObjectLiteralExpression(value) ? value : undefined;
31
+ }
32
+ /** The value a static object assigns to a property. */
33
+ export function assigned(object, name) {
34
+ const property = objectProperty(object, name);
35
+ return property !== undefined && ts.isPropertyAssignment(property)
36
+ ? property.initializer
37
+ : undefined;
38
+ }
39
+ /** The string literals of a static array, or `undefined` when any is not one. */
40
+ export function operationNames(expression) {
41
+ const value = unwrap(expression);
42
+ if (!ts.isArrayLiteralExpression(value))
43
+ return undefined;
44
+ const names = [];
45
+ for (const element of value.elements) {
46
+ const text = ts.isSpreadElement(element) ? undefined : staticText(element);
47
+ if (text === undefined)
48
+ return undefined;
49
+ names.push(text);
50
+ }
51
+ return names;
52
+ }
@@ -1,2 +1,5 @@
1
+ import ts from 'typescript';
1
2
  import type { SourceRuleVerifier } from './verifier.js';
3
+ import { type SourceFile } from '../../adapters/typescript/index.js';
4
+ export declare function locallyConstructedDeclarations(file: SourceFile): ts.CallExpression[];
2
5
  export declare const schemaRules: readonly SourceRuleVerifier[];
@@ -221,7 +221,7 @@ function declarationKindFile(project, file) {
221
221
  const layer = project.policy.layers.find(({ id }) => id === 'schema');
222
222
  if (!layer)
223
223
  return undefined;
224
- const segments = file.path.slice(layer.sourcePath.length).split('/');
224
+ const segments = file.governedPath.slice(layer.sourcePath.length).split('/');
225
225
  const nestedModule = segments[0] === 'modules';
226
226
  const kind = segments[nestedModule ? 2 : 0];
227
227
  if (!kind || !OWNED_DECLARATION_KINDS.has(kind))
@@ -269,7 +269,7 @@ function expectedDeclarationConstructor(file, expression, kind) {
269
269
  candidate.name === constructor.name &&
270
270
  candidate.member === constructor.member));
271
271
  }
272
- function locallyConstructedDeclarations(file) {
272
+ export function locallyConstructedDeclarations(file) {
273
273
  const declarations = [];
274
274
  visit(file.source, (node) => {
275
275
  if (ts.isCallExpression(node) && declarationConstructor(file, node))
@@ -382,10 +382,12 @@ export const schemaRules = [
382
382
  for (const file of project.files) {
383
383
  if (file.layer !== 'schema')
384
384
  continue;
385
- const relative = file.path.slice(layer.sourcePath.length);
385
+ // A legacy/ folder is read as its owner (MOD-LEGACY), where a keeper file may sit flat.
386
+ const relative = file.governedPath.slice(layer.sourcePath.length);
386
387
  const segments = relative.split('/');
388
+ const keeper = file.legacy?.keeper === true;
387
389
  if (segments.length === 1) {
388
- if (!rootFiles.has(relative)) {
390
+ if (!rootFiles.has(relative) && !keeper) {
389
391
  evidence.push(violation(file, file.source, `Schema root source ${file.path} is flat; only ${[...rootFiles]
390
392
  .map((name) => `${layer.sourcePath}${name}`)
391
393
  .join(' and ')} may be flat.`));
@@ -403,12 +405,14 @@ export const schemaRules = [
403
405
  if (rootDirectory !== 'modules')
404
406
  continue;
405
407
  if (segments.length === 2) {
408
+ if (keeper)
409
+ continue;
406
410
  evidence.push(violation(file, file.source, `Schema modules source ${file.path} is flat; declarations must belong to ${layer.sourcePath}modules/<module>/.`));
407
411
  continue;
408
412
  }
409
413
  const moduleName = segments[1];
410
414
  if (segments.length === 3) {
411
- if (segments[2] !== 'index.ts') {
415
+ if (segments[2] !== 'index.ts' && !keeper) {
412
416
  evidence.push(violation(file, file.source, `Schema module source ${file.path} is flat; only ${layer.sourcePath}modules/${moduleName}/index.ts may be flat.`));
413
417
  }
414
418
  continue;
@@ -24,7 +24,7 @@ export const testRules = [
24
24
  const hasFocusedEvidence = project.files.some((candidate) => candidate.layer === layer &&
25
25
  candidate.submodule === submodule &&
26
26
  candidate.role === 'focused-test' &&
27
- candidate.path.startsWith(`${physicalOwner}/__tests__/`));
27
+ candidate.governedPath.startsWith(`${physicalOwner}/__tests__/`));
28
28
  if (!hasFocusedEvidence) {
29
29
  evidence.push(violation(file, file.source, `Semantic submodule ${physicalOwner} has no local __tests__ evidence.`));
30
30
  }
@@ -3,6 +3,7 @@ import { definitionRules } from './definitions.js';
3
3
  import { dependencyRules } from './dependencies.js';
4
4
  import { globalRules } from './global.js';
5
5
  import { integrationRules } from './integrations.js';
6
+ import { legacyFolderRules } from './legacy-folders.js';
6
7
  import { mutationRules } from './mutations.js';
7
8
  import { policyEdgeRules } from './policy-edges.js';
8
9
  import { providerRules } from './providers.js';
@@ -17,6 +18,7 @@ import { viewRules } from './views.js';
17
18
  import { workflowRules } from './workflows.js';
18
19
  export const sourceRuleVerifiers = Object.freeze([
19
20
  ...globalRules,
21
+ ...legacyFolderRules,
20
22
  ...schemaRules,
21
23
  ...policyEdgeRules,
22
24
  ...stateRules,
@@ -1,7 +1,7 @@
1
1
  /** Generated from the validated Domain knowledge catalog. Regenerate with pnpm sync:linter-policy. */
2
- export const domainPolicyDigest = '29e28297047ecdd98b0d0a35d5ce2fbeaea0a7693d3aa2fd4b2a2a0c6cd2756d';
2
+ export const domainPolicyDigest = '1670968631f3f691356b5f79b2ba96f4c9f1be44e643616338c1ec0685658b29';
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, 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 and Mutation 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-POLICY-NAME\tschema\tdeclaration\twarning\tEvery Policy is named as the sentence its subject completes, in the Domain's words: each business hop to the object in order, the object last\tRead each Policy name against its match and report a permission prefix such as can or may, a graph mechanics word such as source, target, sub, super, subject, object, or caller, or a business hop of the match the name omits\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\nSCH-EDGE-KEY-ORDER\tschema\tdeclaration\terror\tA Policy edge in role form lists the source's role first\tResolve the Edge Class's declaration and report ends whose first key is another role than the source's; an unresolved Class or a spread or computed key proves nothing\tpolicy-edge.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\tQuery V6: Every 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\tv6-filtered-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-errors.md\nQRY-SINGLE\tqueries\tdataflow\terror\tQuery V6: Every 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\tv6-single-query.md\nQRY-COMPOSE-TYPED\tqueries\tdataflow\terror\tQuery V6: A 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\tv6-dependent-query.md\nQRY-COMPOSE-STABLE\tqueries\tdeclaration\terror\tQuery V6: Every 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\tv6-dependent-query.md\nQRY-COLL-FANOUT\tqueries\tdataflow\twarning\tQuery V6: Three 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\tv6-collection-union.md\nQRY-PROJECT-PURE\tqueries\tdataflow\terror\tEvery Query project or output callback is synchronous and performs only pure value transformation\tInspect project and output 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 Query of several reads or steps, a composite, or a paginated Query makes no point-in-time graph snapshot claim beyond one Kernel invocation\tReject shared-snapshot claims across a Query's facets, steps or split reads, composite leaves, unions or continuations and route stronger consistency to an explicit Kernel facility\tsteps.md\nQRY-CLOCK\tqueries\tdataflow\terror\tA Query's build and output read no clock: a Query that depends on the time takes now in its input\tInspect build, each of its steps, and output written inline, their callbacks included, and report Date.now, Date, performance.now, process.hrtime or process.uptime called, new Date() without arguments, or Temporal.Now\tdefined-query.md\nQRY-ROWS\tqueries\tdataflow\twarning\tA Query's bounds multiply to at most 10,000 rows\tCount each read's rows as a call counts them, from constant bounds only, and report a Query past 10,000 rows with its count\tdefined-query.md\nQRY-FALSY\tqueries\tdataflow\twarning\tA condition entry that compares with a value that may be false or 0 tests the value with !== undefined, or states that false or 0 means no filter: gated on the value itself, the entry is falsy and skipped\tInspect the condition entries of build and its steps wherever falsy entries are skipped: what a where, is, some, none, every, atLeast, atMost or exactly callback returns, and the arguments of and and or. Report an entry A && B, or A ? B : a falsy literal, whose B passes the value A reads to eq, in, gt, gte, lt, lte, between, startsWith, atMost or exactly when the type of A admits false or a number\tfiltered-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-EFFECT\tfunctions\tbehavior\terror\tEvery Action performs at most one effect, as its terminal operation; the Queries and read-only calls it needs precede that effect\tTrace every path and report two effects, an operation after the effect, or hidden orchestration\tmutation-operation.md\nFNC-OP-KINDS\tfunctions\tbehavior\terror\tA semantic asynchronous operation is one Query, Mutation, Integration call, dependency invocation, or canonical Kernel operation; a Query or a call that changes no state is an observation, every other operation is an effect\tClassify every awaited operation including dependency and Kernel calls as an observation or an effect; report undeclared kinds and hidden multiple effects\tintegration-operation.md\nFNC-BOUNDARIES\tfunctions\tbehavior\terror\tHandlers use self-default kernel and graph capabilities, query and mutate under the authority as names, 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 effect sites that cannot commit together\tInventory effect sites in the definition and report fewer than two or effects one Mutation could commit; early exit, rejection, and recovery paths may execute fewer\tpublication-workflow.md\nFNC-STEP-EFFECTS\tfunctions\tbehavior\terror\tEvery semantic asynchronous operation runs inside a named step: step.run, or the durable step.query and step.mutate shorthands\tTrace operations and report each one outside a named step\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 starts another step, whether step.run, step.query or step.mutate, directly or through a reachable helper\tInspect callback call graphs and report every nested step 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-STEP-READS\tfunctions\tbehavior\terror\tA durable step reads nothing before its effect: the effect builds its request and guards only from the Workflow input and earlier step results, so a retried step resends the same request\tIn a durable Workflow, report a step.run callback, inline or a named local function, whose read precedes an effect or builds its arguments unless the two take exclusive branches, where a local helper's operations run where the step calls it, a read is a Query or a raw Kernel read and an effect is a Mutation or a call its types prove durable; a call of unprovable kind is not counted\tpublication-workflow.md\nFNC-EFFECT-STEP\tfunctions\tbehavior\twarning\tEvery step makes at most one effect, so a step that fails leaves no committed effect the Workflow cannot see\tIn a durable Workflow, report a step.run callback, inline or a named local function, where one run can make two effects, counting an effect a local helper runs on each of its calls and an effect in a loop or an iterating Array callback as several, and effects in exclusive branches of the step's body as one run each, where an effect is a Mutation or a call its types prove durable; a call of unprovable kind is not counted\tpublication-workflow.md\nFNC-STEP-RETRY\tfunctions\tbehavior\twarning\tEvery effect a durable step repeats when it is retried survives the repetition: Mutations, durable calls and keyed Integration operations carry the step key, and any other effect is idempotent\tIn a durable Workflow, report a step.run callback, inline or a named local function, that invokes a callable its types prove not durable, invokes an untyped Path, written as a string or typed as one, or calls global fetch\tpublication-workflow.md\nFNC-REPLAY-VALUES\tfunctions\tbehavior\twarning\tCode of a durable Workflow outside its steps reads no value that differs on replay: the clock and randomness are read inside a step\tIn a durable Workflow, report a read of the global clock or randomness, Date.now, new Date() or Date() without argument, Math.random, crypto.randomUUID, crypto.getRandomValues or performance.now, in the run's own body, in a function it invokes immediately or an iterating Array callback there, including the arguments of a step call; a step callback and any other nested function are not inspected\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\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-CALLABLE\troutes\tdeclaration\terror\tEvery native HTTP Route targets exactly one admitted Action or Workflow definition\tResolve every route target and report forged missing or several definitions\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\tinterruption-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\nMOD-LEGACY\tmodules\tstructure\terror\tA legacy/ folder sits beside one owner, mirrors that owner's structure, and is reached only through its index facade, from its owner or from other legacy code\tClassify each file under legacy/ as its owner's with the legacy directory removed, admit flat keeper files that construct no Schema declaration, and report nested legacy folders, keepers that construct declarations, and imports of legacy source from outside its owner or past its facade\tlegacy-folder.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, 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 and Mutation 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\nQLT-LEGACY-TAG\tquality\tdeclaration\terror\tEvery declaration a legacy/ folder exports is named legacy, Legacy, or LEGACY_ and tagged @deprecated with its ledger id, replacement, and removal condition\tInspect each exported declaration of production files under legacy/ and report a missing prefix, a missing @deprecated tag, or a tag without a (L-<REPO>-<n>) ledger id, Replaced by, or Removal:\tlegacy-folder.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-POLICY-NAME\tschema\tdeclaration\twarning\tEvery Policy is named as the sentence its subject completes, in the Domain's words: each business hop to the object in order, the object last\tRead each Policy name against its match and report a permission prefix such as can or may, a graph mechanics word such as source, target, sub, super, subject, object, or caller, or a business hop of the match the name omits\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\nSCH-EDGE-KEY-ORDER\tschema\tdeclaration\terror\tA Policy edge in role form lists the source's role first\tResolve the Edge Class's declaration and report ends whose first key is another role than the source's; an unresolved Class or a spread or computed key proves nothing\tpolicy-edge.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\tQuery V6: Every 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\tv6-filtered-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-errors.md\nQRY-SINGLE\tqueries\tdataflow\terror\tQuery V6: Every 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\tv6-single-query.md\nQRY-COMPOSE-TYPED\tqueries\tdataflow\terror\tQuery V6: A 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\tv6-dependent-query.md\nQRY-COMPOSE-STABLE\tqueries\tdeclaration\terror\tQuery V6: Every 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\tv6-dependent-query.md\nQRY-COLL-FANOUT\tqueries\tdataflow\twarning\tQuery V6: Three 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\tv6-collection-union.md\nQRY-PROJECT-PURE\tqueries\tdataflow\terror\tEvery Query project or output callback is synchronous and performs only pure value transformation\tInspect project and output 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 Query of several reads or steps, a composite, or a paginated Query makes no point-in-time graph snapshot claim beyond one Kernel invocation\tReject shared-snapshot claims across a Query's facets, steps or split reads, composite leaves, unions or continuations and route stronger consistency to an explicit Kernel facility\tsteps.md\nQRY-CLOCK\tqueries\tdataflow\terror\tA Query's build and output read no clock: a Query that depends on the time takes now in its input\tInspect build, each of its steps, and output written inline, their callbacks included, and report Date.now, Date, performance.now, process.hrtime or process.uptime called, new Date() without arguments, or Temporal.Now\tdefined-query.md\nQRY-ROWS\tqueries\tdataflow\twarning\tA Query's bounds multiply to at most 10,000 rows\tCount each read's rows as a call counts them, from constant bounds only, and report a Query past 10,000 rows with its count\tdefined-query.md\nQRY-FALSY\tqueries\tdataflow\twarning\tA condition entry that compares with a value that may be false or 0 tests the value with !== undefined, or states that false or 0 means no filter: gated on the value itself, the entry is falsy and skipped\tInspect the condition entries of build and its steps wherever falsy entries are skipped: what a where, is, some, none, every, atLeast, atMost or exactly callback returns, and the arguments of and and or. Report an entry A && B, or A ? B : a falsy literal, whose B passes the value A reads to eq, in, gt, gte, lt, lte, between, startsWith, atMost or exactly when the type of A admits false or a number\tfiltered-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-EFFECT\tfunctions\tbehavior\terror\tEvery Action performs at most one effect, as its terminal operation; the Queries and read-only calls it needs precede that effect\tTrace every path and report two effects, an operation after the effect, or hidden orchestration\tmutation-operation.md\nFNC-OP-KINDS\tfunctions\tbehavior\terror\tA semantic asynchronous operation is one Query, Mutation, Integration call, dependency invocation, or canonical Kernel operation; a Query or a call that changes no state is an observation, every other operation is an effect\tClassify every awaited operation including dependency and Kernel calls as an observation or an effect; report undeclared kinds and hidden multiple effects\tintegration-operation.md\nFNC-BOUNDARIES\tfunctions\tbehavior\terror\tHandlers use self-default kernel and graph capabilities, query and mutate under the authority as names, 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 effect sites that cannot commit together\tInventory effect sites in the definition and report fewer than two or effects one Mutation could commit; early exit, rejection, and recovery paths may execute fewer\tpublication-workflow.md\nFNC-STEP-EFFECTS\tfunctions\tbehavior\terror\tEvery semantic asynchronous operation runs inside a named step: step.run, or the durable step.query and step.mutate shorthands\tTrace operations and report each one outside a named step\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 starts another step, whether step.run, step.query or step.mutate, directly or through a reachable helper\tInspect callback call graphs and report every nested step 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-STEP-READS\tfunctions\tbehavior\terror\tA durable step reads nothing before its effect: the effect builds its request and guards only from the Workflow input and earlier step results, so a retried step resends the same request\tIn a durable Workflow, report a step.run callback, inline or a named local function, whose read precedes an effect or builds its arguments unless the two take exclusive branches, where a local helper's operations run where the step calls it, a read is a Query or a raw Kernel read and an effect is a Mutation or a call its types prove durable; a call of unprovable kind is not counted\tpublication-workflow.md\nFNC-EFFECT-STEP\tfunctions\tbehavior\twarning\tEvery step makes at most one effect, so a step that fails leaves no committed effect the Workflow cannot see\tIn a durable Workflow, report a step.run callback, inline or a named local function, where one run can make two effects, counting an effect a local helper runs on each of its calls and an effect in a loop or an iterating Array callback as several, and effects in exclusive branches of the step's body as one run each, where an effect is a Mutation or a call its types prove durable; a call of unprovable kind is not counted\tpublication-workflow.md\nFNC-STEP-RETRY\tfunctions\tbehavior\twarning\tEvery effect a durable step repeats when it is retried survives the repetition: Mutations, durable calls and keyed Integration operations carry the step key, and any other effect is idempotent\tIn a durable Workflow, report a step.run callback, inline or a named local function, that invokes a callable its types prove not durable, invokes an untyped Path, written as a string or typed as one, or calls global fetch\tpublication-workflow.md\nFNC-REPLAY-VALUES\tfunctions\tbehavior\twarning\tCode of a durable Workflow outside its steps reads no value that differs on replay: the clock and randomness are read inside a step\tIn a durable Workflow, report a read of the global clock or randomness, Date.now, new Date() or Date() without argument, Math.random, crypto.randomUUID, crypto.getRandomValues or performance.now, in the run's own body, in a function it invokes immediately or an iterating Array callback there, including the arguments of a step call; a step callback and any other nested function are not inspected\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\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-CALLABLE\troutes\tdeclaration\terror\tEvery native HTTP Route targets exactly one admitted Action or Workflow definition\tResolve every route target and report forged missing or several definitions\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\tinterruption-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',
@@ -57,6 +57,7 @@ export const domainRuleRequirements = Object.freeze([
57
57
  row('MOD-SUBMODULE', STRUCTURE),
58
58
  row('MOD-REQUIRED', STRUCTURE),
59
59
  row('MOD-GOVERNED', STRUCTURE),
60
+ row('MOD-LEGACY', STRUCTURE_DEPENDENCY),
60
61
  row('ROOT-FACADE', STRUCTURE),
61
62
  row('ROOT-COMPOSE', STRUCTURE_DEPENDENCY),
62
63
  row('ROOT-PACKAGE', EVIDENCE),
@@ -77,6 +78,7 @@ export const domainRuleRequirements = Object.freeze([
77
78
  row('QLT-CANON-VALUES', DATAFLOW),
78
79
  row('QLT-DEF-IDS', DECLARATION),
79
80
  row('QLT-TYPED-COORD', DECLARATION),
81
+ row('QLT-LEGACY-TAG', DECLARATION),
80
82
  row('NODE-INHERITED', DECLARATION),
81
83
  row('DOM-PUBLIC-DEPS', DEPENDENCY),
82
84
  row('DOM-CALL-DECLARED', BEHAVIOR_DEPENDENCY),
@@ -0,0 +1,12 @@
1
+ scenario title expected owner_repo status evidence notes
2
+ S17 A Domain's release asks the Shell Role user.writer for the Domain itself accepted sdk proven src/deployment/build/__tests__/build.test.ts (compiles Roles and scopes to the capabilities the published Kernel admits and validates); __tests__/scenarios/release-serving.test.ts SDK part only: { role: <dependency Role>, members: [requirements.domain] } compiles to a release the published kernel-protocol admits and validates; the installation gate (R2, R3) is proven by the Kernel and the Shell
3
+ S19 A release names S.admin, a dependency Core Identity, granter of its own Role (K1) accepted sdk proven src/deployment/build/__tests__/build.test.ts (admits a dependency Core Identity holding an own Role (K1), and refuses it on a foreign one) Build admits the holder through the published validateRequirements since kernel-protocol 1.0.0-beta.35, and refuses a dependency Core Identity holding a dependency's Role
4
+ S21 A release names a Core Identity of a Domain outside its dependencies as a Role member refused sdk proven src/deployment/build/__tests__/build.test.ts (refuses what the published Kernel refuses) Build refuses through the published validateRequirements; with K1 the Kernel still refuses a holder outside the exact dependency closure
5
+ S23 A Domain's release asks the Kernel Role identity.registrar refused kernel proven-elsewhere kernel and shell installation tests (R2, R3) The SDK compiles the request; the installation refuses it when the installer cannot grant the Role
6
+ SDK-1 A Domain release declares Roles with members and granters, the installed Domain among them accepted sdk proven src/application/requirements/__tests__/requirements.test.ts; src/deployment/build/__tests__/build.test.ts; __tests__/scenarios/release-serving.test.ts requirements({ roles }) with requirements.domain; canonical as admitRequirements requires; served release.json validated against its Bundle
7
+ SDK-2 A Domain release declares scopes on a Class and on a callable accepted sdk proven src/application/requirements/__tests__/requirements.test.ts; src/deployment/build/__tests__/build.test.ts Class operations on a Class, ['call'] on a Function or Method
8
+ SDK-3 A requirement set mixes roles or scopes with the legacy keys refused sdk proven src/application/requirements/__tests__/requirements.test.ts (refuses roles or scopes beside a legacy key); src/deployment/build/__tests__/build.test.ts (rejects Runtime, requirement, and route disagreement after serialization) TypeError at capture; RELEASE_INVALID when restoring mixed Build material
9
+ SDK-4 A Domain still authored in the legacy shape builds the same release bytes as before accepted sdk proven src/deployment/build/legacy/__tests__/requirements.test.ts; src/application/requirements/legacy/__tests__/requirements.test.ts L-SDK-1, L-SDK-2: requirement, document and digest bytes recorded before Kernel Roles
10
+ SDK-5 A Query crosses a dependency Class without the read and traverse scopes refused sdk proven src/application/query/execution/__tests__/crossings.test.ts; src/testing/__tests__/query.test.ts S12 reads Class scopes; legacy classes through L-SDK-3
11
+ SDK-6 astrale-domain lint matches a remote call or a foreign Mutation plan to a scope accepted sdk proven src/tooling/linter/implementations/source/__tests__/rules.test.ts; src/tooling/linter/implementations/source/__tests__/domain-requirements.test.ts PRV-XDOM-REQ, FNC-XDOM-REQ, DOM-CALL-DECLARED, MUT-PLAN-REQ; legacy functions and classes through L-SDK-4
12
+ SDK-7 A new Domain from create-astrale-domain declares its graph Roles accepted sdk proven create-astrale-domain/src/scaffold/__tests__/scaffold.test.ts; create-astrale-domain/__tests__/cli.test.ts graph.reader and graph.writer for requirements.domain, no scope, since a scope toward a Kernel target installs only under Root
@@ -68,7 +68,9 @@ const directory = language.resolve(DirectorySchema)
68
68
  export const domain = defineDomain({
69
69
  schema,
70
70
  runtime,
71
- requirements: requirements({ functions: [directory.functions.lookup] }),
71
+ requirements: requirements({
72
+ scopes: [{ on: directory.functions.lookup, operations: ['call'] }],
73
+ }),
72
74
  })
73
75
  ```
74
76
 
@@ -80,7 +82,7 @@ export const lookup = defineAction<typeof schema>()('lookup', ({ dependencies, i
80
82
  )
81
83
  ```
82
84
 
83
- Other callable shapes use the same invoker and require their own exact Domain requirements:
85
+ Other callable shapes use the same invoker and require their own exact `call` scope:
84
86
 
85
87
  ```ts
86
88
  await dependencies.directory.caller.invoke(d => d.classes.Employee.static.methods.create, input)
@@ -373,5 +375,5 @@ no longer refuses them. Replace such a test (`kernel === null`, `graph === null`
373
375
  implementations add `self({ via, domain, context })`, which resolves to `{ graph: { self }, close }`.
374
376
 
375
377
  The linter accepts direct declared dependencies and canonical Kernel references. It checks exact
376
- callable requirements, rejects foreign handler imports, and reports opaque selectors as
378
+ `call` scopes, rejects foreign handler imports, and reports opaque selectors as
377
379
  indeterminate. Requirement analysis never executes selectors during compilation.
package/docs/legacy.md ADDED
@@ -0,0 +1,113 @@
1
+ # Legacy: keeping old behaviour without letting it spread
2
+
3
+ A change of design rarely lands everywhere at once: releases already installed, callers on older
4
+ versions and stored data keep the previous shape. This method keeps that previous behaviour
5
+ working, in one place, named, tested and ready to delete, while every other file reads as the new
6
+ design. It is shared by the Astrale repositories; this page is the reference they mirror.
7
+
8
+ The aim is that removing the old behaviour later is a deletion: delete each `legacy/` folder, its
9
+ seam's one call and its ledger row, replace each named relaxation by its target value, and nothing
10
+ else changes.
11
+
12
+ ## The rules
13
+
14
+ 1. **Target code is the only code outside `legacy/`.** Every file outside a `legacy/` folder reads
15
+ as the target design. Old names, old shapes, migration helpers and bridges live in a `legacy/`
16
+ folder next to the owner they serve (`src/application/requirements/legacy/`,
17
+ `domain/schema/modules/user/legacy/`), never in a repository-wide dumping ground. A file in it is
18
+ named for what it keeps (`legacy/member-of-group.ts`), never `compat.ts`.
19
+ 2. **Legacy is named.** Every exported legacy symbol starts with `legacy` (`legacyRequirements`,
20
+ `LEGACY_USER_INHERITANCE`) or, for a type or class, `Legacy` (`LegacyRequirementsInput`). The one
21
+ exception is a public name a release already exported, kept as a deprecated alias so no import
22
+ breaks; the ledger row lists it.
23
+ 3. **Legacy is tagged.** Every legacy export carries
24
+ `@deprecated <what it keeps> (<ledger id>). Replaced by <target symbol>. Removal: <condition>.`
25
+ 4. **One seam per owner.** Target code reaches legacy code through one explicit, named call per
26
+ owner, and the seam is target code:
27
+
28
+ ```ts
29
+ // The one seam to the legacy shape: a key only that shape declares selects it.
30
+ if (isLegacyCapabilities(input)) return legacyRequirements(input)
31
+ ```
32
+
33
+ When the test that selects legacy belongs to legacy, the legacy function makes it and answers
34
+ `undefined` otherwise, so the seam stays one call:
35
+ `const legacy = legacyRequirementEntries(definition); if (legacy !== undefined) return legacy`.
36
+ No `if (legacy)` is scattered through target modules.
37
+ 5. **Relaxations are named constants.** When the target must be relaxed for existing data (a
38
+ property that will become required, a Class that will become final), the target declaration
39
+ imports a named relaxation instead of writing the relaxed value inline:
40
+ `inheritance: LEGACY_USER_INHERITANCE` (`'open'`, target `'final'`). Removal replaces each
41
+ import by its target value.
42
+ 6. **Ledger.** Each repository keeps `legacy/LEDGER.md` at its package root (one per package when
43
+ packages are published separately) with one row per item:
44
+
45
+ `| id | legacy item (file) | replaced by | seam | removal condition | evidence (test) |`
46
+
47
+ Ids are `L-<REPO>-<n>` (`L-SDK-1`, `L-SHELL-3`) and are never reused. A repository with several
48
+ ledgers gives each package's ledger a one-letter prefix (`L-SHELL-C1` for the client SDK,
49
+ `L-SHELL-U2` for the screens) so ids stay unique across them. The seam column names the
50
+ seam's file in backticks: the boundary test reads it.
51
+ 7. **Evidence.** Each item has a test under `legacy/__tests__/` proving the old input or behaviour
52
+ still works (byte for byte where the old output is persisted or signed), and the target path has
53
+ its own tests that never import `legacy/`. A boundary test (`legacy-boundary.test.*`) fails when
54
+ a file outside a `legacy/` folder imports one without being a seam the ledger lists, when a
55
+ `legacy/` folder has no row, or when a legacy export is not named and tagged.
56
+ 8. **No new legacy consumers.** Docs, examples and scaffolds show only the target API. Legacy
57
+ documentation, when kept, moves to `docs/legacy/`. Remaining consumers that cannot move yet are
58
+ listed under the ledger table, with the reason.
59
+
60
+ ## In a Domain project
61
+
62
+ `astrale-domain lint` applies the method to Domain source:
63
+
64
+ - **Where.** A `legacy/` folder sits beside one owner: the Domain root (`legacy/`), a semantic
65
+ submodule (`functions/user/legacy/`), the Schema root (`schema/legacy/`), a Schema module
66
+ (`schema/modules/user/legacy/`) or a declaration-kind directory (`schema/policies/legacy/`).
67
+ `legacy` is therefore a reserved directory name, and folders do not nest.
68
+ - **Transparent.** Every rule reads a file in the folder as its owner's, with `legacy/` removed:
69
+ `schema/policies/legacy/is-self.ts` is a Policy leaf and declares one Policy,
70
+ `schema/modules/user/legacy/policies/owns-user.ts` is a Policy leaf of the module,
71
+ `schema/legacy/schema.ts` is a Schema facade, and `functions/user/legacy/__tests__/` is the
72
+ owner's focused evidence.
73
+ - **Keeper files.** Where the owner admits only its facade (the Domain root, the Schema root, a
74
+ Schema module), the folder may also hold flat files named for what they keep, such as
75
+ `relaxations.ts`; they construct no Schema declaration, which goes in its kind directory under
76
+ the folder.
77
+ - **Seam.** The folder exposes an `index.ts` facade (`#functions/user/legacy`,
78
+ `../legacy/index.js`). Only files of its owner (its seam) and other legacy code import it; no
79
+ file outside the folder imports past it. A layer that composes an owner's legacy, such as
80
+ `runtime.ts` registering legacy Actions, reaches it through the owner's own facade.
81
+ - **Tags.** Every declaration a legacy folder exports is named `legacy…`, `Legacy…` or `LEGACY_…`
82
+ and carries the `@deprecated … (L-<REPO>-<n>). Replaced by … Removal: …` tag.
83
+
84
+ `MOD-LEGACY` checks the placement, keepers and seams, and `QLT-LEGACY-TAG` the names and tags;
85
+ both are errors.
86
+
87
+ ## Adding a legacy item
88
+
89
+ 1. Write the target code first, with its own tests, as if the old shape never existed.
90
+ 2. Move what keeps the old behaviour into `legacy/` next to its owner; rename its exports with the
91
+ `legacy`/`Legacy` prefix and tag each one.
92
+ 3. Add the seam: one call from the owner's target entry point. If the old behaviour must be
93
+ recognized, prefer the guard the upstream owner already publishes (here the Kernel's
94
+ `isLegacyCapabilities`) over a new heuristic.
95
+ 4. Move or write the evidence under `legacy/__tests__/`. Where old output is persisted, signed or
96
+ hashed, record its exact bytes before the move and assert them after.
97
+ 5. Add the ledger row. Run the boundary test.
98
+
99
+ ## Removing a legacy item
100
+
101
+ When its removal condition holds, in a release that may break: delete the `legacy/` folder, the
102
+ seam's call (the target branch stays), the row and the consumers listed under the table; replace
103
+ named relaxations by their target values. If anything else has to change, the item was not fully
104
+ isolated: record that in the ledger before the next one.
105
+
106
+ ## In this repository
107
+
108
+ [`legacy/LEDGER.md`](../legacy/LEDGER.md) lists the items. The pre-Roles capability shape
109
+ (`functions`, `classes`, `authority`, `core`) is kept through four seams, one per owner it touches:
110
+ authoring (`requirements()`, L-SDK-1), Build compilation (L-SDK-2), the Query crossing check
111
+ (L-SDK-3) and the source rules of `astrale-domain lint` (L-SDK-4). Query V6 and the Mutation closure
112
+ form predate this method; their rows list their several importers until they are removed.
113
+ `__tests__/unit/legacy-boundary.test.ts` enforces the rules above.
package/docs/queries.md CHANGED
@@ -339,8 +339,9 @@ Before a step sends anything, the SDK checks:
339
339
  - **Requirements (S12).** A read `{ as: 'caller' }` answers only what both the caller and the
340
340
  Domain may observe, and leaves out the rest without saying so. Of a Class of a direct
341
341
  dependency whose read and traverse rules both admit only some callers, a relation that crosses
342
- it needs `read` or `traverse` on it in the Domain's `requirements({ classes })`. Of one whose
343
- read rule admits only some callers, a relation's condition that tests one of its values needs
342
+ it needs the scope `read` or `traverse` on it in the Domain's requirements:
343
+ `requirements({ scopes: [{ on: Class, operations: ['traverse'] }] })`. Of one whose read rule
344
+ admits only some callers, a relation's condition that tests one of its values needs the scope
344
345
  `read` on it: the Kernel drops what that test cannot decide. Otherwise the call throws a
345
346
  `TypeError` naming the Query, the relation and the requirement to add. A rule that admits every
346
347
  caller (`true`, or none) needs nothing. A requirement covers its own Class only, as the Kernel's