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

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.
@@ -12,8 +12,9 @@ export declare const FILE_MEMORY_LIMIT: number;
12
12
  */
13
13
  export interface ReceivedFile {
14
14
  /**
15
- * The upload receipt the caller sent. It is bound to the user who uploaded the file and expires
16
- * 15 minutes after the upload. Only that user, or a Domain acting for them, can read or attach it.
15
+ * The upload receipt the caller sent. It names the user who uploaded the file and expires one
16
+ * hour after the upload. Until then it serves whoever presents it to the Kernel: this Domain may
17
+ * read or attach it as itself or for its caller.
17
18
  */
18
19
  readonly receipt: schema.values.BlobReceipt;
19
20
  /**
@@ -30,8 +31,12 @@ export interface ReceivedFile {
30
31
  /**
31
32
  * A callable input as its handler receives it: a file object in place of the receipt at each
32
33
  * `file()` field.
34
+ *
35
+ * A receipt is a branded string, so it is matched before any other primitive. Every other
36
+ * primitive, branded ids such as `NodeId` included, is left as is: a branded string is also an
37
+ * object type, and mapping over it would map over the string's methods.
33
38
  */
34
- export type WithFiles<Input> = 0 extends 1 & Input ? Input : Input extends schema.values.BlobReceipt ? ReceivedFile : Input extends object ? {
39
+ export type WithFiles<Input> = 0 extends 1 & Input ? Input : Input extends schema.values.BlobReceipt ? ReceivedFile : Input extends string | number | bigint | boolean | symbol | null | undefined ? Input : Input extends object ? {
35
40
  [Key in keyof Input]: WithFiles<Input[Key]>;
36
41
  } : Input;
37
42
  /** What a `file()` field admits, checked when the handler reads the file. */
@@ -13,7 +13,7 @@ export function properties(selected, input) {
13
13
  }
14
14
  sources.set(property.key, name);
15
15
  if (isBlobProperty(property)) {
16
- // A received file attaches as the receipt its caller uploaded it under.
16
+ // A received file attaches as its upload receipt.
17
17
  const receipt = isReceivedFile(value) ? value.receipt : value;
18
18
  if (typeof receipt !== 'string') {
19
19
  throw new TypeError(`Blob Property ${property.key} requires an upload receipt or a received file.`);
@@ -39,8 +39,8 @@ export function admitRuntimeRegistry(domain, input) {
39
39
  });
40
40
  }
41
41
  /**
42
- * A file is read and attached as the caller, with the receipt they uploaded. A call to an
43
- * `anonymous` callable may carry no credential, and then has no caller to do it as.
42
+ * A received file is read as the caller. A call to an `anonymous` callable may carry no
43
+ * credential, and then has no caller to read it as.
44
44
  */
45
45
  function refuseAnonymousFile(address, callable) {
46
46
  if (callable.auth !== 'anonymous' || filePositionsOf(callable).length === 0)
@@ -32,8 +32,9 @@ export function context(request, runtime, callable, authentication, self) {
32
32
  });
33
33
  }
34
34
  /**
35
- * The input with a file object at each `file()` field, which reads the file as the caller: the
36
- * receipt is bound to the user who uploaded it, never to this Domain.
35
+ * The input with a file object at each `file()` field, which reads the file as the caller. The
36
+ * receipt serves whoever presents it; reading for the caller works on every Kernel, including those
37
+ * that bind a receipt to its uploader.
37
38
  */
38
39
  function filesOf(callable, input, authentication) {
39
40
  const positions = filePositionsOf(callable);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The Kernel's syscall references, without loading the Kernel Schema: `K` from `@astrale-os/sdk/schema`
3
+ * compiles the whole Kernel Schema when its module loads, which a Worker pays at startup.
4
+ */
5
+ export type { FunctionRef, SyscallRef, } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
6
+ export { download, execution, function, identity, install, introspect, journal, mutate, query, register, uninstall, upload, view, } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
@@ -0,0 +1 @@
1
+ export { download, execution, function, identity, install, introspect, journal, mutate, query, register, uninstall, upload, view, } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
@@ -0,0 +1,2 @@
1
+ import type { SourceRuleVerifier } from './verifier.js';
2
+ export declare const runtimeImportRules: readonly SourceRuleVerifier[];
@@ -0,0 +1,119 @@
1
+ import ts from 'typescript';
2
+ import { resolveProjectImport, } from '../../adapters/typescript/index.js';
3
+ import { production, violation } from './shared.js';
4
+ const SCHEMA_LAYER = 'schema';
5
+ const SDK_SCHEMA_ENTRY = '@astrale-os/sdk/schema';
6
+ /** The root file the Worker entry loads; every other root file is build-side composition. */
7
+ const RUNTIME_ROOT = 'runtime';
8
+ /**
9
+ * A Schema `errors` or `states` kind directory, root or module. Runtime layers import these
10
+ * focused facades as values; they load only `@astrale-os/sdk/schema/errors` or `@astrale-os/sdk/state`.
11
+ */
12
+ const WORKER_SCHEMA_KINDS = /^schema\/(?:modules\/[^/]+\/)?(?:errors|states)(?:\/|$)/u;
13
+ export const runtimeImportRules = [
14
+ {
15
+ id: 'IMP-RUNTIME-SCHEMA',
16
+ ruleRevision: '51788c73aac5d44d72c200e1c7b48faea8adb40e364ac31c1eb805cd80efd6ee',
17
+ evaluate(project) {
18
+ const layers = workerLayers(project);
19
+ const runtimeRoot = project.policy.rootFiles.find(({ id }) => id === RUNTIME_ROOT)?.sourcePath;
20
+ const evidence = [];
21
+ for (const file of production(project)) {
22
+ if (!loadedByWorker(file, layers, runtimeRoot))
23
+ continue;
24
+ for (const sourceImport of file.imports) {
25
+ if (erased(sourceImport))
26
+ continue;
27
+ const target = schemaTarget(project, file, sourceImport.specifier);
28
+ if (target === undefined)
29
+ continue;
30
+ evidence.push(violation(file, sourceImport.node, `${file.path} loads ${target} into the Worker with ${sourceImport.specifier}; ${remedy(sourceImport)}`));
31
+ }
32
+ }
33
+ return evidence;
34
+ },
35
+ },
36
+ ];
37
+ /**
38
+ * The layers the Worker loads: those `runtime.ts` reaches through runtime or composition
39
+ * dependency edges. Schema stays build-side whatever the table says, since it owns the builder.
40
+ */
41
+ function workerLayers(project) {
42
+ const layerIds = new Set(project.policy.layers.map(({ id }) => id));
43
+ const reached = new Set();
44
+ const pending = [RUNTIME_ROOT];
45
+ while (pending.length > 0) {
46
+ const source = pending.pop();
47
+ for (const edge of project.policy.dependencies) {
48
+ if (edge.source !== source || (edge.kind !== 'runtime' && edge.kind !== 'composition')) {
49
+ continue;
50
+ }
51
+ if (!layerIds.has(edge.target) || edge.target === SCHEMA_LAYER || reached.has(edge.target)) {
52
+ continue;
53
+ }
54
+ reached.add(edge.target);
55
+ pending.push(edge.target);
56
+ }
57
+ }
58
+ return reached;
59
+ }
60
+ function loadedByWorker(file, layers, runtimeRoot) {
61
+ if (file.path === runtimeRoot)
62
+ return true;
63
+ if (file.layer === undefined)
64
+ return false;
65
+ // An errors or states directory is the only Schema source runtime code may load, so it stays light.
66
+ return layers.has(file.layer) || isWorkerSchemaKind(file);
67
+ }
68
+ /** `import type`, `export type`, and `import('...')` types leave no module edge in the bundle. */
69
+ function erased(sourceImport) {
70
+ const node = sourceImport.node;
71
+ if (ts.isImportTypeNode(node))
72
+ return true;
73
+ if (ts.isImportDeclaration(node))
74
+ return node.importClause?.isTypeOnly === true;
75
+ if (ts.isExportDeclaration(node))
76
+ return node.isTypeOnly;
77
+ return false;
78
+ }
79
+ /** What the import loads when it is the SDK Schema entry or a Schema file outside `errors/` and `states/`. */
80
+ function schemaTarget(project, file, specifier) {
81
+ if (specifier === SDK_SCHEMA_ENTRY)
82
+ return 'the SDK Schema entry';
83
+ const schemaAlias = project.policy.aliases.some(({ layer, specifier: alias }) => layer === SCHEMA_LAYER &&
84
+ (alias.endsWith('/*') ? specifier.startsWith(alias.slice(0, -1)) : specifier === alias));
85
+ if (!schemaAlias && !specifier.startsWith('.'))
86
+ return undefined;
87
+ const target = resolveProjectImport(project, file, specifier);
88
+ if (target !== undefined) {
89
+ if (target.layer !== SCHEMA_LAYER || isWorkerSchemaKind(target))
90
+ return undefined;
91
+ return `Schema source ${target.path}`;
92
+ }
93
+ // An unresolved relative import is IMP-LAYER-ALIAS evidence; an unresolved alias still names Schema.
94
+ if (!schemaAlias || WORKER_SCHEMA_KINDS.test(`schema/${specifier.slice('#schema/'.length)}/`)) {
95
+ return undefined;
96
+ }
97
+ return 'the authored Schema';
98
+ }
99
+ function isWorkerSchemaKind(file) {
100
+ return file.layer === SCHEMA_LAYER && WORKER_SCHEMA_KINDS.test(file.governedPath);
101
+ }
102
+ function remedy(sourceImport) {
103
+ const node = sourceImport.node;
104
+ const inlineTypes = (ts.isImportDeclaration(node) &&
105
+ node.importClause !== undefined &&
106
+ node.importClause.name === undefined &&
107
+ node.importClause.namedBindings !== undefined &&
108
+ ts.isNamedImports(node.importClause.namedBindings) &&
109
+ node.importClause.namedBindings.elements.length > 0 &&
110
+ node.importClause.namedBindings.elements.every(({ isTypeOnly }) => isTypeOnly)) ||
111
+ (ts.isExportDeclaration(node) &&
112
+ node.exportClause !== undefined &&
113
+ ts.isNamedExports(node.exportClause) &&
114
+ node.exportClause.elements.length > 0 &&
115
+ node.exportClause.elements.every(({ isTypeOnly }) => isTypeOnly));
116
+ return inlineTypes
117
+ ? 'inline type specifiers keep the module edge; write the declaration as import type or export type.'
118
+ : 'import it as a type and read Schema values from the resolved Domain the SDK hands the handler, Query, or Mutation.';
119
+ }
@@ -9,6 +9,7 @@ import { policyEdgeRules } from './policy-edges.js';
9
9
  import { providerRules } from './providers.js';
10
10
  import { queryRules } from './queries.js';
11
11
  import { pureRuleRules } from './rules.js';
12
+ import { runtimeImportRules } from './runtime-imports.js';
12
13
  import { schemaRules } from './schema.js';
13
14
  import { stateRules } from './states.js';
14
15
  import { testRules } from './tests.js';
@@ -18,6 +19,7 @@ import { viewRules } from './views.js';
18
19
  import { workflowRules } from './workflows.js';
19
20
  export const sourceRuleVerifiers = Object.freeze([
20
21
  ...globalRules,
22
+ ...runtimeImportRules,
21
23
  ...legacyFolderRules,
22
24
  ...schemaRules,
23
25
  ...policyEdgeRules,
@@ -1,7 +1,7 @@
1
1
  /** Generated from the validated Domain knowledge catalog. Regenerate with pnpm sync:linter-policy. */
2
- export const domainPolicyDigest = '1670968631f3f691356b5f79b2ba96f4c9f1be44e643616338c1ec0685658b29';
2
+ export const domainPolicyDigest = '65f2d6f6ef25c229e67eddc6123283ce32f9dd7e49d5b822445c8e106f81738b';
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\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",
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-RUNTIME-SCHEMA\timports\tdependency\terror\tWorker runtime code reads Schema values from the resolved Domain it receives and imports the authored Schema and the SDK Schema entry only as types\tFollow runtime and composition dependency edges from runtime.ts to the layers the Worker loads; in runtime.ts, those layers, and Schema errors and states directories, report every import, re-export, or literal dynamic import of @astrale-os/sdk/schema or of a Schema file outside an errors or states directory that is not an import type or export type declaration\truntime-schema-types.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',
@@ -94,7 +94,7 @@ export const domainPolicySource = Object.freeze({
94
94
  source: 'queries',
95
95
  target: 'schema',
96
96
  kind: 'runtime',
97
- condition: 'Queries address authored declaration values',
97
+ condition: 'Queries address authored declarations through their Domain projection and load only Schema errors and states facades',
98
98
  },
99
99
  {
100
100
  source: 'queries',
@@ -106,7 +106,7 @@ export const domainPolicySource = Object.freeze({
106
106
  source: 'mutations',
107
107
  target: 'schema',
108
108
  kind: 'runtime',
109
- condition: 'Mutations address authored declaration values',
109
+ condition: 'Mutations address authored declarations through their Domain projection and load only Schema errors and states facades',
110
110
  },
111
111
  {
112
112
  source: 'mutations',
@@ -130,7 +130,7 @@ export const domainPolicySource = Object.freeze({
130
130
  source: 'functions',
131
131
  target: 'schema',
132
132
  kind: 'runtime',
133
- condition: 'Functions implement authored callable values and use public Domain contracts',
133
+ condition: 'Functions implement authored callable contracts, read Schema values from the resolved Domain, and load only Schema errors and states facades',
134
134
  },
135
135
  {
136
136
  source: 'functions',
@@ -64,6 +64,7 @@ export const domainRuleRequirements = Object.freeze([
64
64
  row('DEP-ALLOWLIST', DEPENDENCY),
65
65
  row('IMP-FACADE', DEPENDENCY),
66
66
  row('IMP-SDK-BOUNDARY', DEPENDENCY),
67
+ row('IMP-RUNTIME-SCHEMA', DEPENDENCY),
67
68
  row('IMP-LAYER-ALIAS', DEPENDENCY),
68
69
  row('IMP-ALIAS-CFG', DEPENDENCY),
69
70
  row('IMP-STATIC', DEPENDENCY),
@@ -18,12 +18,11 @@ remind: method({
18
18
  A durable callable needs `authenticated` or `authorized` auth, a value input and output, and a
19
19
  remote binding. Implement it with `defineWorkflow`; `defineAction` refuses a durable callable.
20
20
 
21
- A durable Workflow receives each `file()` input field as a file reference, a string, not a file
22
- object. A receipt is bound to the user who uploaded it and lives 15 minutes, while the Steps act as
23
- the Domain and the run may last longer. At the durable start the Kernel therefore checks each
24
- receipt for the caller and against the field's `maxBytes` and `mediaTypes`, and replaces it by a
25
- reference bound to this Execution and to the Domain; neither the Execution record nor the engine
26
- journal holds the receipt. See [Files in a durable Workflow](#files-in-a-durable-workflow).
21
+ A durable Workflow receives each `file()` input field as the caller sent it: an upload receipt, a
22
+ string, not a file object. The Kernel checks each receipt and the field's `maxBytes` and
23
+ `mediaTypes` when it admits the call. A receipt lasts one hour from its upload, while the run may
24
+ last much longer: **attach each file the run keeps to a Node in its first Steps**, then read it from
25
+ that Node. See [Files in a durable Workflow](#files-in-a-durable-workflow).
27
26
 
28
27
  ```ts
29
28
  export const remind = defineWorkflow<typeof schema>()(
@@ -211,51 +210,54 @@ receipt, even though its precondition no longer holds.
211
210
 
212
211
  ## Files in a durable Workflow
213
212
 
214
- A `file()` field of a durable callable reaches the Workflow as a file reference: the Kernel
215
- exchanged the caller's receipt for it when it started the Execution, after checking the receipt for
216
- the caller and the file against the field's `maxBytes` and `mediaTypes`. A refused receipt refuses
217
- the call with `FUNCTION_INPUT_INVALID`, the refusal's code as its reason and the field's JSON
218
- Pointer as `path`, and no Execution is recorded. A replay of the same idempotency key compares each
219
- file field by its content, so the same file under a fresh receipt is the same call; a replay still
220
- needs a valid receipt.
213
+ A `file()` field of a durable callable reaches the Workflow as the upload receipt the caller sent.
214
+ The Kernel checked the receipt and the file against the field's `maxBytes` and `mediaTypes` when it
215
+ admitted the call: a refused field refuses the call with `FUNCTION_INPUT_INVALID`, the refusal's
216
+ code as its reason and the field's JSON Pointer as `path`, and no Execution is recorded. A replay of
217
+ the same idempotency key compares each file field by its content, so the same file under a fresh
218
+ receipt is the same call.
221
219
 
222
- A Step uses the reference wherever a receipt goes, through its own `kernel` and `mutate`, which act
223
- as the Domain for this Execution:
220
+ **Use the file fast.** A receipt serves whoever presents it, the Domain's Steps included, for one
221
+ hour from the upload, and no longer. Attach each file the run keeps to a Node in its first Steps,
222
+ before anything that may wait (a `sleep`, an `awaitSignal`, a slow call). Afterwards read it from
223
+ that Node, for as long as the run lasts:
224
224
 
225
225
  ```ts
226
226
  export const importBalance = defineWorkflow<typeof schema>()(
227
227
  'importBalance',
228
228
  async ({ input, step }) => {
229
- const lines = await step.run('count-lines', async ({ kernel }) => {
230
- const { body } = await kernel.content.download({ receipt: input.balance })
231
- // A Uint8Array, or chunks as they arrive.
232
- const chunks = body instanceof Uint8Array ? [body] : await Array.fromAsync(body)
233
- return new TextDecoder().decode(await new Blob(chunks).bytes()).split('\n').length
234
- })
229
+ // First: attach the file, as the Domain, while the receipt lasts.
235
230
  await step.mutate(
236
231
  'attach',
237
232
  recordBalance, // writes input.balance as the TrialBalance `source` blob Property
238
233
  { fiscalYear: input.fiscalYear, balance: input.balance },
239
234
  { as: 'executor' },
240
235
  )
236
+ // Then process it. Within the hour the receipt still reads it; later, read the attached Node
237
+ // (`kernel.content.download({ node, property })`).
238
+ const lines = await step.run('count-lines', async ({ kernel }) => {
239
+ const { body } = await kernel.content.download({ receipt: input.balance })
240
+ // A Uint8Array, or chunks as they arrive.
241
+ const chunks = body instanceof Uint8Array ? [body] : await Array.fromAsync(body)
242
+ return new TextDecoder().decode(await new Blob(chunks).bytes()).split('\n').length
243
+ })
241
244
  return { lines }
242
245
  },
243
246
  )
244
247
  ```
245
248
 
246
- - **Bound to its run.** The reference is accepted only from a Step of the Execution it names, as
247
- the Domain, while the engine holds that run unfinished and for at most 7 days. The caller cannot
248
- use it, nor another Execution of the same Domain, nor anyone once the run ended. It never expires
249
- within the run: a Step may read or attach it long after the original receipt expired.
250
- - **Attach to keep the file.** While the run lasts its Execution keeps the content. Afterwards only
251
- the Nodes a Step attached it to keep it: attach the file in a Step, and keep the Node.
252
- - **Not passed on.** A Step cannot hand its reference to a child durable call, which accepts only a
253
- receipt of its caller: attach the file, then pass the Node.
254
- - **No file object yet.** The Workflow receives the reference string, not the file object an Action
249
+ - **One hour, then refused.** A Step that presents the receipt after it expired, a retry after a
250
+ long engine outage included, is refused `BLOB_RECEIPT_INVALID`. The run cannot recover the file:
251
+ the user uploads it again.
252
+ - **Attach to keep the file.** The Execution keeps no file. Only the Nodes a Step attached it to
253
+ keep it; a file nothing attached is removed by the Host's collection some days later.
254
+ - **Passing it on.** A Step may pass the receipt to a child call, durable or not, while it lasts;
255
+ past it, attach the file and pass the Node.
256
+ - **No file object yet.** The Workflow receives the receipt string, not the file object an Action
255
257
  receives (`stream()`, `text()`, `bytes()`), so the field's `maxBytes` and `mediaTypes` are checked
256
- by the Kernel at the start and by the Property when a Step attaches the file, not on each read.
257
- - **The envelope.** The run's engine input names each reference in `files`, its JSON Pointer and
258
- `Ref`; the SDK does not need it to run the Workflow.
258
+ by the Kernel at the call and by the Property when a Step attaches the file, not on each read.
259
+ - **Keep it private.** The receipt is in the run's input, which the engine and the Execution record
260
+ hold. Never log it, and never return it as output.
259
261
 
260
262
  ## Testing
261
263
 
@@ -107,10 +107,12 @@ the deadline; a child does not inherit the parent's idempotency key. Detached
107
107
  ## Receiving a file
108
108
 
109
109
  A file never travels inside a call. The client uploads its bytes to the Kernel first, and the call
110
- carries the receipt the upload returned: a signed string, bound to the user who uploaded the file,
111
- valid for 15 minutes. A callable declares where it takes a file with a `file()` input field. Its
112
- handler receives a file object there, reads the file with the caller's authority if it needs to,
113
- and attaches it to a blob Property, also as the caller.
110
+ carries the receipt the upload returned: a signed string that names the user who uploaded the
111
+ file, valid for one hour, and that serves whoever presents it to the Kernel until then. A callable
112
+ declares where it takes a file with a `file()` input field; the Kernel checks the receipt and the
113
+ field's `maxBytes` and `mediaTypes` when it admits the call. Its handler receives a file object
114
+ there, reads the file if it needs to, and attaches it to a blob Property of the Domain as the
115
+ Domain itself.
114
116
 
115
117
  ```ts
116
118
  import { defineAction, type ReceivedFile } from '@astrale-os/sdk/action'
@@ -155,7 +157,7 @@ export const importBalance = defineAction<typeof Schema>()(
155
157
  async ({ input, mutate }) => {
156
158
  const csv = await input.balance.text() // whole file, in memory: 10 MiB at most
157
159
  if (!csv.startsWith('account,')) throw new Error('Not a trial balance.')
158
- await mutate(recordBalance, input, { as: 'caller' })
160
+ await mutate(recordBalance, input, { as: 'executor' }) // the Domain writes its own record
159
161
  return csv.split('\n').length.toString()
160
162
  },
161
163
  )
@@ -184,9 +186,9 @@ await session.invoke(reference(ledger, ledger.functions.importBalance), {
184
186
  | `bytes()` | The whole file as a `Uint8Array`. |
185
187
 
186
188
  - **As the caller.** Each read downloads the file again with `kernel.caller.content.download({
187
- receipt })`. The receipt is the caller's: the Kernel refuses it to this Domain's own authority,
188
- and to any other user, with `BLOB_RECEIPT_INVALID`. Nothing is kept between reads; a file read
189
- twice is downloaded twice.
189
+ receipt })`. The receipt serves whoever presents it until it expires, this Domain's own authority
190
+ included; past its hour the Kernel refuses it with `BLOB_RECEIPT_INVALID`. Nothing is kept between
191
+ reads; a file read twice is downloaded twice.
190
192
  - **In memory up to `FILE_MEMORY_LIMIT`.** `text()` and `bytes()` hold the whole file, so they
191
193
  refuse a file larger than `FILE_MEMORY_LIMIT` (10 MiB, exported by `@astrale-os/sdk/action`) with
192
194
  `FileReadError` `FILE_MEMORY_LIMIT`, before reading it when its size is known. Read a larger file
@@ -209,23 +211,23 @@ await session.invoke(reference(ledger, ledger.functions.importBalance), {
209
211
 
210
212
  A blob Property value takes the file object as it is in every Mutation the SDK authors (`mutate`,
211
213
  `graph.mutate`, a defined Mutation's `build`, `createNode`, `updateNode`) and writes its receipt.
212
- Attach as the caller, `mutate(definition, input, { as: 'caller' })` or `graph.caller.mutate`, since
213
- only the user who uploaded the file can attach its receipt; the Kernel then applies the caller's
214
- permissions to the write and the Property's constraints to the file. The raw Kernel builder of
215
- `kernel.caller.mutate((m) => ...)` takes `file.receipt`. Attaching never reads the file.
214
+ Attach the file to the Domain's own records as the Domain, `mutate(definition, input, { as:
215
+ 'executor' })`: the Domain decides the write, and the Kernel applies the Property's constraints to
216
+ the file. A write `{ as: 'caller' }` also takes the receipt, under the caller's permissions. The raw
217
+ Kernel builder of `kernel.mutate((m) => ...)` takes `file.receipt`. Attaching never reads the file.
216
218
 
217
- - **Within 15 minutes.** A receipt expires 15 minutes after its upload. Read and attach the file in
219
+ - **Within the hour.** A receipt expires one hour after its upload. Read and attach the file in
218
220
  the invocation that received it; keep the attached Node, never the receipt.
219
- - **Authenticated callables only.** A file is read and attached as the caller, and a call to an
221
+ - **Authenticated callables only.** A received file is read as the caller, and a call to an
220
222
  `anonymous` callable may carry no caller. The runtime refuses a `file()` field in the input of an
221
223
  `anonymous` callable when it is built or served.
222
224
  - **Passing it on.** To hand the file to a dependency that takes it in a `file()` field, send its
223
- receipt as the caller: `dependencies.files.caller.invoke(d => d.functions.scan, { file:
225
+ receipt, as the caller or as the Domain: `dependencies.files.caller.invoke(d => d.functions.scan, { file:
224
226
  input.balance.receipt })`.
225
- - **Durable Workflows.** A durable Workflow's input holds a file reference at each `file()`
226
- field, not a file object: at the durable start the Kernel exchanges the caller's receipt for a
227
- reference bound to the Execution, which its Steps use as the Domain wherever a receipt goes
228
- (`kernel.content.download({ receipt })`, a blob Property value) while the run lasts. See
227
+ - **Durable Workflows.** A durable Workflow's input holds the receipt itself at each `file()`
228
+ field, not a file object. Its Steps use it as the Domain (`kernel.content.download({ receipt })`,
229
+ a blob Property value) only until it expires, one hour after the upload: attach the file to a
230
+ Node in the run's first Steps. See
229
231
  [Files in a durable Workflow](durable-workflows.md#files-in-a-durable-workflow).
230
232
 
231
233
  ### Testing a handler
@@ -58,6 +58,15 @@ A Role binding is `{ role, members?, granters? }` and names members, granters, o
58
58
  the same Edge. Build refuses it on a dependency's Role with `A Core Identity of a dependency
59
59
  holds only the Domain's own Roles.`
60
60
 
61
+ Who may install a binding depends on who owns the Role. Toward a Role the installed Domain owns,
62
+ the installer needs no authority over it. Toward a dependency's Role, a Kernel Role included, the
63
+ installer must be Root or hold `can_grant_extension` toward that exact Role, directly or through
64
+ its own compositions: holding the Role, or a bundle that contains it, is not enough. Since only an
65
+ installation writes `can_grant_extension`, an instance's administrators install such a Domain only
66
+ when a release installed under Root names them granters of those Roles, as a Shell release does for
67
+ its administrator profile. Otherwise the install is refused with `SCHEMA_REQUIREMENTS_UNSATISFIED`,
68
+ and its denials name each `extends_with` or `can_grant_extension` Edge the installer may not write.
69
+
61
70
  A release binding is the only way a Domain composes Identities into Roles, its own included: the
62
71
  Kernel DSL refuses a Core Edge whose Class is not the Domain's own (`DV_CORE_EDGE_CLASS`), and
63
72
  Kernel `extends_with` is final. Bundles such as `member` extending `guest`, or a Team extending a
@@ -111,8 +120,8 @@ never both: `requirements({ roles, functions })` throws. Moving a Domain:
111
120
 
112
121
  | Legacy | Roles and scopes |
113
122
  | --- | --- |
114
- | `functions: [f]` | `scopes: [{ on: f, operations: ['call'] }]`; for a protected Kernel callable the Domain calls as itself, also `{ role: K.core.nodes['graph.reader'], members: [requirements.domain] }` (its Kernel Role) |
115
- | `classes: [{ class: C, operations }]` | `scopes: [{ on: C, operations }]` |
123
+ | `functions: [f]` | for a callable of another Domain, `scopes: [{ on: f, operations: ['call'] }]`; for a protected Kernel callable, its Kernel Role and no scope, such as `{ role: K.core.nodes['graph.writer'], members: [requirements.domain] }` for `mutate`: a scope toward a Kernel target installs only under Root (A20) |
124
+ | `classes: [{ class: C, operations }]` | for a Class of another Domain, `scopes: [{ on: C, operations }]`; for a Kernel Class, the Kernel Role its Policy admits, such as `domain.reader` to read `K.classes.Class` |
116
125
  | `core: [{ subject: s, ... }]` | a Role with the capabilities, and `{ role, members: [s] }` |
117
126
  | `authority: { grant, revoke }` | `granters` of the Roles the Domain may grant |
118
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/sdk",
3
- "version": "0.6.0-beta.57",
3
+ "version": "0.6.0-beta.59",
4
4
  "description": "Schema-first SDK for defining, composing, and deploying Astrale domains",
5
5
  "keywords": [
6
6
  "astrale",
@@ -56,6 +56,10 @@
56
56
  "types": "./dist/platform/schema/addressing/index.d.ts",
57
57
  "import": "./dist/platform/schema/addressing/index.js"
58
58
  },
59
+ "./schema/references": {
60
+ "types": "./dist/platform/schema/references/index.d.ts",
61
+ "import": "./dist/platform/schema/references/index.js"
62
+ },
59
63
  "./value": {
60
64
  "types": "./dist/platform/value/index.d.ts",
61
65
  "import": "./dist/platform/value/index.js"