@astrale-os/sdk 0.4.11 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/authenticate.d.ts +1 -1
- package/dist/auth/authenticate.d.ts.map +1 -1
- package/dist/auth/authenticate.js +2 -2
- package/dist/auth/authenticate.js.map +1 -1
- package/dist/auth/check.js +1 -1
- package/dist/auth/check.js.map +1 -1
- package/dist/auth/function-context.d.ts +1 -1
- package/dist/auth/function-context.d.ts.map +1 -1
- package/dist/auth/function-context.js +3 -3
- package/dist/auth/function-context.js.map +1 -1
- package/dist/auth/index.d.ts +15 -15
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +10 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/issuer-mint.d.ts +1 -1
- package/dist/auth/issuer-mint.d.ts.map +1 -1
- package/dist/auth/issuer-mint.js +2 -2
- package/dist/auth/issuer-mint.js.map +1 -1
- package/dist/auth/kernel-client.d.ts +1 -1
- package/dist/auth/kernel-client.d.ts.map +1 -1
- package/dist/auth/kernel-client.js +2 -2
- package/dist/auth/kernel-client.js.map +1 -1
- package/dist/auth/resolve.d.ts +2 -2
- package/dist/auth/resolve.d.ts.map +1 -1
- package/dist/auth/resolve.js +2 -2
- package/dist/auth/resolve.js.map +1 -1
- package/dist/auth/verify.d.ts +1 -1
- package/dist/auth/verify.d.ts.map +1 -1
- package/dist/auth/verify.js +2 -2
- package/dist/auth/verify.js.map +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/publish.js +1 -1
- package/dist/cli/publish.js.map +1 -1
- package/dist/cli/run.d.ts +9 -3
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +55 -5
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/spec.d.ts +1 -1
- package/dist/cli/spec.d.ts.map +1 -1
- package/dist/cli/spec.js +1 -1
- package/dist/cli/spec.js.map +1 -1
- package/dist/config/define-domain.d.ts +2 -2
- package/dist/config/define-domain.d.ts.map +1 -1
- package/dist/config/deploy.d.ts +2 -2
- package/dist/config/deploy.d.ts.map +1 -1
- package/dist/config/index.d.ts +6 -6
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -3
- package/dist/config/index.js.map +1 -1
- package/dist/define/index.d.ts +4 -4
- package/dist/define/index.d.ts.map +1 -1
- package/dist/define/index.js +2 -2
- package/dist/define/index.js.map +1 -1
- package/dist/define/remote-function.d.ts +7 -5
- package/dist/define/remote-function.d.ts.map +1 -1
- package/dist/define/remote-function.js.map +1 -1
- package/dist/define/view.d.ts +3 -3
- package/dist/define/view.d.ts.map +1 -1
- package/dist/deploy/check.d.ts +1 -1
- package/dist/deploy/check.d.ts.map +1 -1
- package/dist/deploy/check.js +1 -1
- package/dist/deploy/check.js.map +1 -1
- package/dist/deploy/index.d.ts +2 -2
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +2 -2
- package/dist/deploy/index.js.map +1 -1
- package/dist/dispatch/authorize.js +1 -1
- package/dist/dispatch/authorize.js.map +1 -1
- package/dist/dispatch/dispatcher.d.ts +11 -21
- package/dist/dispatch/dispatcher.d.ts.map +1 -1
- package/dist/dispatch/dispatcher.js +66 -65
- package/dist/dispatch/dispatcher.js.map +1 -1
- package/dist/dispatch/execute.d.ts +7 -6
- package/dist/dispatch/execute.d.ts.map +1 -1
- package/dist/dispatch/execute.js +1 -0
- package/dist/dispatch/execute.js.map +1 -1
- package/dist/dispatch/identity.d.ts +2 -2
- package/dist/dispatch/identity.d.ts.map +1 -1
- package/dist/dispatch/index.d.ts +6 -6
- package/dist/dispatch/index.d.ts.map +1 -1
- package/dist/dispatch/index.js +6 -6
- package/dist/dispatch/index.js.map +1 -1
- package/dist/dispatch/resolve.d.ts +1 -1
- package/dist/dispatch/resolve.d.ts.map +1 -1
- package/dist/dispatch/self.d.ts +1 -1
- package/dist/dispatch/self.d.ts.map +1 -1
- package/dist/domain/build-spec.d.ts +1 -1
- package/dist/domain/build-spec.d.ts.map +1 -1
- package/dist/domain/build-spec.js +2 -2
- package/dist/domain/build-spec.js.map +1 -1
- package/dist/domain/contract.d.ts +1 -1
- package/dist/domain/contract.d.ts.map +1 -1
- package/dist/domain/define.d.ts +4 -4
- package/dist/domain/define.d.ts.map +1 -1
- package/dist/domain/define.js +2 -2
- package/dist/domain/define.js.map +1 -1
- package/dist/domain/extend-functions.d.ts +1 -1
- package/dist/domain/extend-functions.d.ts.map +1 -1
- package/dist/domain/extend-functions.js +1 -1
- package/dist/domain/extend-functions.js.map +1 -1
- package/dist/domain/extend-views.d.ts +1 -1
- package/dist/domain/extend-views.d.ts.map +1 -1
- package/dist/domain/extend-views.js +1 -1
- package/dist/domain/extend-views.js.map +1 -1
- package/dist/domain/index.d.ts +4 -4
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +3 -3
- package/dist/domain/index.js.map +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/linter/analyze.d.ts +6 -0
- package/dist/linter/analyze.d.ts.map +1 -0
- package/dist/linter/analyze.js +12 -0
- package/dist/linter/analyze.js.map +1 -0
- package/dist/linter/diagnostic.d.ts +32 -0
- package/dist/linter/diagnostic.d.ts.map +1 -0
- package/dist/linter/diagnostic.js +35 -0
- package/dist/linter/diagnostic.js.map +1 -0
- package/dist/linter/index.d.ts +10 -0
- package/dist/linter/index.d.ts.map +1 -0
- package/dist/linter/index.js +6 -0
- package/dist/linter/index.js.map +1 -0
- package/dist/linter/lint.d.ts +8 -0
- package/dist/linter/lint.d.ts.map +1 -0
- package/dist/linter/lint.js +26 -0
- package/dist/linter/lint.js.map +1 -0
- package/dist/linter/oxlint/config.d.ts +14 -0
- package/dist/linter/oxlint/config.d.ts.map +1 -0
- package/dist/linter/oxlint/config.js +18 -0
- package/dist/linter/oxlint/config.js.map +1 -0
- package/dist/linter/oxlint/plugin.d.ts +13 -0
- package/dist/linter/oxlint/plugin.d.ts.map +1 -0
- package/dist/linter/oxlint/plugin.js +14 -0
- package/dist/linter/oxlint/plugin.js.map +1 -0
- package/dist/linter/oxlint/run.d.ts +7 -0
- package/dist/linter/oxlint/run.d.ts.map +1 -0
- package/dist/linter/oxlint/run.js +122 -0
- package/dist/linter/oxlint/run.js.map +1 -0
- package/dist/linter/preflight.d.ts +2 -0
- package/dist/linter/preflight.d.ts.map +1 -0
- package/dist/linter/preflight.js +162 -0
- package/dist/linter/preflight.js.map +1 -0
- package/dist/linter/project.d.ts +12 -0
- package/dist/linter/project.d.ts.map +1 -0
- package/dist/linter/project.js +88 -0
- package/dist/linter/project.js.map +1 -0
- package/dist/linter/report.d.ts +4 -0
- package/dist/linter/report.d.ts.map +1 -0
- package/dist/linter/report.js +22 -0
- package/dist/linter/report.js.map +1 -0
- package/dist/linter/rules/catalog.d.ts +56 -0
- package/dist/linter/rules/catalog.d.ts.map +1 -0
- package/dist/linter/rules/catalog.js +53 -0
- package/dist/linter/rules/catalog.js.map +1 -0
- package/dist/linter/rules/core-has-no-async.d.ts +3 -0
- package/dist/linter/rules/core-has-no-async.d.ts.map +1 -0
- package/dist/linter/rules/core-has-no-async.js +43 -0
- package/dist/linter/rules/core-has-no-async.js.map +1 -0
- package/dist/linter/rules/core-is-pure.d.ts +3 -0
- package/dist/linter/rules/core-is-pure.d.ts.map +1 -0
- package/dist/linter/rules/core-is-pure.js +74 -0
- package/dist/linter/rules/core-is-pure.js.map +1 -0
- package/dist/linter/rules/no-nested-steps.d.ts +3 -0
- package/dist/linter/rules/no-nested-steps.d.ts.map +1 -0
- package/dist/linter/rules/no-nested-steps.js +32 -0
- package/dist/linter/rules/no-nested-steps.js.map +1 -0
- package/dist/linter/rules/no-read-inside-mutate.d.ts +3 -0
- package/dist/linter/rules/no-read-inside-mutate.d.ts.map +1 -0
- package/dist/linter/rules/no-read-inside-mutate.js +64 -0
- package/dist/linter/rules/no-read-inside-mutate.js.map +1 -0
- package/dist/linter/rules/one-remote-definition-per-file.d.ts +3 -0
- package/dist/linter/rules/one-remote-definition-per-file.d.ts.map +1 -0
- package/dist/linter/rules/one-remote-definition-per-file.js +23 -0
- package/dist/linter/rules/one-remote-definition-per-file.js.map +1 -0
- package/dist/linter/rules/oxlint-ast.d.ts +30 -0
- package/dist/linter/rules/oxlint-ast.d.ts.map +1 -0
- package/dist/linter/rules/oxlint-ast.js +104 -0
- package/dist/linter/rules/oxlint-ast.js.map +1 -0
- package/dist/linter/rules/oxlint-rule.d.ts +45 -0
- package/dist/linter/rules/oxlint-rule.d.ts.map +1 -0
- package/dist/linter/rules/oxlint-rule.js +2 -0
- package/dist/linter/rules/oxlint-rule.js.map +1 -0
- package/dist/linter/rules/project-rule.d.ts +10 -0
- package/dist/linter/rules/project-rule.d.ts.map +1 -0
- package/dist/linter/rules/project-rule.js +24 -0
- package/dist/linter/rules/project-rule.js.map +1 -0
- package/dist/linter/rules/thin-schema-composition-root.d.ts +3 -0
- package/dist/linter/rules/thin-schema-composition-root.d.ts.map +1 -0
- package/dist/linter/rules/thin-schema-composition-root.js +23 -0
- package/dist/linter/rules/thin-schema-composition-root.js.map +1 -0
- package/dist/linter/source.d.ts +24 -0
- package/dist/linter/source.d.ts.map +1 -0
- package/dist/linter/source.js +279 -0
- package/dist/linter/source.js.map +1 -0
- package/dist/linter/suppression.d.ts +3 -0
- package/dist/linter/suppression.d.ts.map +1 -0
- package/dist/linter/suppression.js +11 -0
- package/dist/linter/suppression.js.map +1 -0
- package/dist/method/class.d.ts +3 -3
- package/dist/method/class.d.ts.map +1 -1
- package/dist/method/context.d.ts +6 -4
- package/dist/method/context.d.ts.map +1 -1
- package/dist/method/index.d.ts +5 -5
- package/dist/method/index.d.ts.map +1 -1
- package/dist/method/index.js +2 -2
- package/dist/method/index.js.map +1 -1
- package/dist/method/single.d.ts +2 -2
- package/dist/method/single.d.ts.map +1 -1
- package/dist/server/auxiliary-routes.d.ts +3 -3
- package/dist/server/auxiliary-routes.d.ts.map +1 -1
- package/dist/server/auxiliary-routes.js +11 -11
- package/dist/server/auxiliary-routes.js.map +1 -1
- package/dist/server/config.d.ts +1 -1
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/create.d.ts +2 -2
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/create.js +11 -11
- package/dist/server/create.js.map +1 -1
- package/dist/server/domain-entry.d.ts +5 -5
- package/dist/server/domain-entry.d.ts.map +1 -1
- package/dist/server/domain-entry.js +2 -2
- package/dist/server/domain-entry.js.map +1 -1
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +7 -7
- package/dist/server/index.js.map +1 -1
- package/dist/server/start.d.ts +1 -1
- package/dist/server/start.d.ts.map +1 -1
- package/dist/server/start.js.map +1 -1
- package/dist/server/worker-entry.d.ts +1 -1
- package/dist/server/worker-entry.d.ts.map +1 -1
- package/dist/server/worker-entry.js +3 -3
- package/dist/server/worker-entry.js.map +1 -1
- package/dist/step/index.d.ts +4 -4
- package/dist/step/index.d.ts.map +1 -1
- package/dist/step/index.js +2 -2
- package/dist/step/index.js.map +1 -1
- package/dist/step/inline.d.ts +1 -1
- package/dist/step/inline.d.ts.map +1 -1
- package/dist/step/inline.js +1 -1
- package/dist/step/inline.js.map +1 -1
- package/package.json +29 -8
- package/src/auth/authenticate.ts +3 -3
- package/src/auth/check.ts +1 -1
- package/src/auth/function-context.ts +4 -4
- package/src/auth/index.ts +15 -15
- package/src/auth/issuer-mint.ts +3 -3
- package/src/auth/kernel-client.ts +3 -3
- package/src/auth/resolve.ts +4 -4
- package/src/auth/verify.ts +3 -3
- package/src/cli/bin.ts +1 -1
- package/src/cli/index.ts +2 -2
- package/src/cli/publish.ts +1 -1
- package/src/cli/run.ts +59 -8
- package/src/cli/spec.ts +3 -3
- package/src/config/define-domain.ts +2 -2
- package/src/config/deploy.ts +2 -2
- package/src/config/index.ts +6 -6
- package/src/define/index.ts +4 -4
- package/src/define/remote-function.ts +7 -5
- package/src/define/view.ts +3 -3
- package/src/deploy/check.ts +2 -2
- package/src/deploy/index.ts +2 -2
- package/src/dispatch/authorize.ts +1 -1
- package/src/dispatch/dispatcher.ts +76 -83
- package/src/dispatch/execute.ts +8 -6
- package/src/dispatch/identity.ts +2 -2
- package/src/dispatch/index.ts +6 -6
- package/src/dispatch/resolve.ts +1 -1
- package/src/dispatch/self.ts +1 -1
- package/src/domain/build-spec.ts +4 -4
- package/src/domain/contract.ts +1 -1
- package/src/domain/define.ts +6 -6
- package/src/domain/extend-functions.ts +2 -2
- package/src/domain/extend-views.ts +2 -2
- package/src/domain/index.ts +4 -4
- package/src/index.ts +20 -20
- package/src/linter/analyze.ts +17 -0
- package/src/linter/diagnostic.ts +68 -0
- package/src/linter/docs/DIAGNOSTICS.md +47 -0
- package/src/linter/docs/JUDGMENT.md +81 -0
- package/src/linter/docs/PRINCIPLES.md +97 -0
- package/src/linter/docs/README.md +38 -0
- package/src/linter/docs/RULE-AUTHORING.md +144 -0
- package/src/linter/docs/RULES.md +153 -0
- package/src/linter/index.ts +14 -0
- package/src/linter/lint.ts +32 -0
- package/src/linter/oxlint/astrale-ox.d.ts +5 -0
- package/src/linter/oxlint/config.ts +19 -0
- package/src/linter/oxlint/plugin.js +16 -0
- package/src/linter/oxlint/run.ts +162 -0
- package/src/linter/preflight.ts +181 -0
- package/src/linter/project.ts +108 -0
- package/src/linter/report.ts +25 -0
- package/src/linter/rules/catalog.ts +67 -0
- package/src/linter/rules/core-has-no-async.js +43 -0
- package/src/linter/rules/core-is-pure.ts +103 -0
- package/src/linter/rules/no-nested-steps.js +37 -0
- package/src/linter/rules/no-read-inside-mutate.js +72 -0
- package/src/linter/rules/one-remote-definition-per-file.ts +29 -0
- package/src/linter/rules/oxlint-ast.js +110 -0
- package/src/linter/rules/oxlint-rule.ts +35 -0
- package/src/linter/rules/project-rule.ts +37 -0
- package/src/linter/rules/thin-schema-composition-root.ts +26 -0
- package/src/linter/source.ts +323 -0
- package/src/linter/suppression.ts +11 -0
- package/src/method/class.ts +3 -3
- package/src/method/context.ts +6 -4
- package/src/method/index.ts +5 -5
- package/src/method/single.ts +2 -2
- package/src/server/auxiliary-routes.ts +22 -17
- package/src/server/config.ts +1 -1
- package/src/server/create.ts +15 -15
- package/src/server/domain-entry.ts +7 -7
- package/src/server/index.ts +11 -11
- package/src/server/start.ts +3 -2
- package/src/server/worker-entry.ts +4 -4
- package/src/step/index.ts +4 -4
- package/src/step/inline.ts +2 -2
- package/dist/defer/index.d.ts +0 -24
- package/dist/defer/index.d.ts.map +0 -1
- package/dist/defer/index.js +0 -42
- package/dist/defer/index.js.map +0 -1
- package/src/defer/index.ts +0 -64
package/src/domain/build-spec.ts
CHANGED
|
@@ -24,11 +24,11 @@ import type { Schema } from '@astrale-os/kernel-dsl'
|
|
|
24
24
|
import { AbsolutePath } from '@astrale-os/kernel-core'
|
|
25
25
|
import { hashInstallGraph, serialize, zodToJsonSchema } from '@astrale-os/kernel-core/domain'
|
|
26
26
|
|
|
27
|
-
import type { AnyRemoteHandler } from '../method/single'
|
|
28
|
-
import type { RemoteDomain } from './define'
|
|
27
|
+
import type { AnyRemoteHandler } from '../method/single.js'
|
|
28
|
+
import type { RemoteDomain } from './define.js'
|
|
29
29
|
|
|
30
|
-
import { extractBinding } from './contract'
|
|
31
|
-
import { materializeRemoteDomain } from './define'
|
|
30
|
+
import { extractBinding } from './contract.js'
|
|
31
|
+
import { materializeRemoteDomain } from './define.js'
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Build the install-ready wire graph for a domain served at `url`: materialize
|
package/src/domain/contract.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
} from '@astrale-os/kernel-api/routed'
|
|
15
15
|
import type { BoundMethod } from '@astrale-os/kernel-core/domain'
|
|
16
16
|
|
|
17
|
-
import type { AnyRemoteHandler } from '../method/single'
|
|
17
|
+
import type { AnyRemoteHandler } from '../method/single.js'
|
|
18
18
|
|
|
19
19
|
export function toSdkContract(method: BoundMethod<AnyRemoteHandler>): MountableContract {
|
|
20
20
|
const handler = method.handler as {
|
package/src/domain/define.ts
CHANGED
|
@@ -14,17 +14,17 @@ import type { Core, Schema } from '@astrale-os/kernel-dsl'
|
|
|
14
14
|
|
|
15
15
|
import { bindMethods, compileDomain } from '@astrale-os/kernel-core/domain'
|
|
16
16
|
|
|
17
|
-
import type { DomainManifest } from '../config/define-domain'
|
|
18
|
-
import type { AnyRemoteFunctionDef, ViewDef } from '../define'
|
|
19
|
-
import type { SchemaMethodsImpl } from '../method/class'
|
|
20
|
-
import type { AnyRemoteHandler } from '../method/single'
|
|
17
|
+
import type { DomainManifest } from '../config/define-domain.js'
|
|
18
|
+
import type { AnyRemoteFunctionDef, ViewDef } from '../define/index.js'
|
|
19
|
+
import type { SchemaMethodsImpl } from '../method/class.js'
|
|
20
|
+
import type { AnyRemoteHandler } from '../method/single.js'
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
23
|
assertFunctionsMatchSchema,
|
|
24
24
|
buildFunctionSchemas,
|
|
25
25
|
DEFAULT_FUNCTIONS_FOLDER,
|
|
26
|
-
} from './extend-functions'
|
|
27
|
-
import { buildViewDeclarations, buildViewSchemas, DEFAULT_VIEWS_FOLDER } from './extend-views'
|
|
26
|
+
} from './extend-functions.js'
|
|
27
|
+
import { buildViewDeclarations, buildViewSchemas, DEFAULT_VIEWS_FOLDER } from './extend-views.js'
|
|
28
28
|
|
|
29
29
|
export type RemoteDomainConfig<S extends Schema, TDeps> = {
|
|
30
30
|
schema: S
|
|
@@ -22,9 +22,9 @@ import type { Schema } from '@astrale-os/kernel-dsl'
|
|
|
22
22
|
|
|
23
23
|
import { zodToJsonSchema } from '@astrale-os/kernel-core/domain'
|
|
24
24
|
|
|
25
|
-
import type { AnyRemoteFunctionDef } from '../define/remote-function'
|
|
25
|
+
import type { AnyRemoteFunctionDef } from '../define/remote-function.js'
|
|
26
26
|
|
|
27
|
-
import { resolveBinding } from './binding'
|
|
27
|
+
import { resolveBinding } from './binding.js'
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Default URL segment for a function's worker route (`<url>/functions/<slug>`).
|
|
@@ -29,9 +29,9 @@ import {
|
|
|
29
29
|
type EdgeEndpoint,
|
|
30
30
|
} from '@astrale-os/kernel-dsl'
|
|
31
31
|
|
|
32
|
-
import type { ViewDef } from '../define/view'
|
|
32
|
+
import type { ViewDef } from '../define/view.js'
|
|
33
33
|
|
|
34
|
-
import { joinWorkerPath, resolveBinding } from './binding'
|
|
34
|
+
import { joinWorkerPath, resolveBinding } from './binding.js'
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Default URL segment for a view's worker route (`<url>/views/<slug>`). Names the
|
package/src/domain/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { defineRemoteDomain } from './define'
|
|
2
|
-
export type { RemoteDomain, RemoteDomainConfig } from './define'
|
|
3
|
-
export { buildInstallGraph, buildInstallGraphHash } from './build-spec'
|
|
4
|
-
export { toSdkContract } from './contract'
|
|
1
|
+
export { defineRemoteDomain } from './define.js'
|
|
2
|
+
export type { RemoteDomain, RemoteDomainConfig } from './define.js'
|
|
3
|
+
export { buildInstallGraph, buildInstallGraphHash } from './build-spec.js'
|
|
4
|
+
export { toSdkContract } from './contract.js'
|
package/src/index.ts
CHANGED
|
@@ -14,15 +14,15 @@ export type {
|
|
|
14
14
|
ClassMethodsImpl,
|
|
15
15
|
InterfaceMethodsImpl,
|
|
16
16
|
SchemaMethodsImpl,
|
|
17
|
-
} from './method'
|
|
18
|
-
export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './method'
|
|
17
|
+
} from './method/index.js'
|
|
18
|
+
export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './method/index.js'
|
|
19
19
|
|
|
20
20
|
// ─── Domain configuration (astrale.config.ts) ────────────────────────────
|
|
21
21
|
// The author-facing way to declare a standalone domain + how it deploys. The
|
|
22
22
|
// runtime-domain COMPILER (`defineRemoteDomain`) is internal machinery — reach
|
|
23
23
|
// it via the `@astrale-os/sdk/domain` subpath when hand-rolling a worker, or
|
|
24
24
|
// (preferred) use `domainWorkerEntry` from `@astrale-os/sdk/server`.
|
|
25
|
-
export { defineDomain, deploy, defineAdapter } from './config'
|
|
25
|
+
export { defineDomain, deploy, defineAdapter } from './config/index.js'
|
|
26
26
|
export type {
|
|
27
27
|
DefineDomainConfig,
|
|
28
28
|
DomainDefinition,
|
|
@@ -35,10 +35,10 @@ export type {
|
|
|
35
35
|
DomainInfo,
|
|
36
36
|
WatchCtx,
|
|
37
37
|
WatchHandle,
|
|
38
|
-
} from './config'
|
|
38
|
+
} from './config/index.js'
|
|
39
39
|
|
|
40
40
|
// ─── Install graph (advanced) ────────────────────────────────────────────
|
|
41
|
-
export { buildInstallGraph, buildInstallGraphHash } from './domain'
|
|
41
|
+
export { buildInstallGraph, buildInstallGraphHash } from './domain/index.js'
|
|
42
42
|
|
|
43
43
|
// ─── Graph patching (advanced) ────────────────────────────────────────
|
|
44
44
|
// Author-facing patch types, re-exported from kernel-core (the single source).
|
|
@@ -67,20 +67,20 @@ export type {
|
|
|
67
67
|
// the reserved views / functions folder, keyed by its map slug; the same
|
|
68
68
|
// entry's `render` / `execute` (+ auth hooks) is mounted as a worker route by
|
|
69
69
|
// `createRemoteServer`.
|
|
70
|
-
export { defineView, defineRemoteFunction } from './define'
|
|
70
|
+
export { defineView, defineRemoteFunction } from './define/index.js'
|
|
71
71
|
export type {
|
|
72
72
|
ViewDef,
|
|
73
73
|
ViewRenderContext,
|
|
74
74
|
RemoteFunctionAuthorizeContext,
|
|
75
75
|
RemoteFunctionDef,
|
|
76
76
|
RemoteFunctionContext,
|
|
77
|
-
} from './define'
|
|
77
|
+
} from './define/index.js'
|
|
78
78
|
|
|
79
79
|
// ─── Durable-shaped steps ────────────────────────────────────────────────
|
|
80
|
-
export type { Step } from './step'
|
|
80
|
+
export type { Step } from './step/index.js'
|
|
81
81
|
|
|
82
|
-
// ───
|
|
83
|
-
export type { Defer, DeferredTask } from '
|
|
82
|
+
// ─── Invocation capabilities ─────────────────────────────────────────────
|
|
83
|
+
export type { Defer, DeferredTask, Sleep } from '@astrale-os/kernel-server'
|
|
84
84
|
|
|
85
85
|
// ─── Server ──────────────────────────────────────────────────────────────
|
|
86
86
|
// `createRemoteServer` dynamically imports `@hono/node-server` via `./server/start`.
|
|
@@ -94,8 +94,8 @@ export type { Defer, DeferredTask } from './defer'
|
|
|
94
94
|
// module load time. Exporting it from the barrel poisons browser bundlers
|
|
95
95
|
// (Vite/esbuild) that transitively load every re-export. Consumers that need it
|
|
96
96
|
// import from './deploy' directly.
|
|
97
|
-
export { MetaSchema } from './deploy/meta'
|
|
98
|
-
export type { Meta } from './deploy/meta'
|
|
97
|
+
export { MetaSchema } from './deploy/meta.js'
|
|
98
|
+
export type { Meta } from './deploy/meta.js'
|
|
99
99
|
|
|
100
100
|
// ─── Route binding (re-exported from kernel-api for consumer convenience) ─
|
|
101
101
|
export type {
|
|
@@ -110,22 +110,22 @@ export type {
|
|
|
110
110
|
} from '@astrale-os/kernel-api/routed'
|
|
111
111
|
|
|
112
112
|
// ─── Auth ────────────────────────────────────────────────────────────────
|
|
113
|
-
export type { RemoteIdentityConfig, AuthenticateResult } from './auth'
|
|
113
|
+
export type { RemoteIdentityConfig, AuthenticateResult } from './auth/index.js'
|
|
114
114
|
export type {
|
|
115
115
|
DomainAuthority,
|
|
116
116
|
FunctionContextApi,
|
|
117
117
|
FunctionCredentialOptions,
|
|
118
118
|
FunctionKernelOptions,
|
|
119
119
|
MintIssuedParams,
|
|
120
|
-
} from './auth'
|
|
120
|
+
} from './auth/index.js'
|
|
121
121
|
export {
|
|
122
122
|
authenticateRequest,
|
|
123
123
|
buildComposedGrant,
|
|
124
124
|
makeFunctionContext,
|
|
125
125
|
signCredential,
|
|
126
|
-
} from './auth'
|
|
127
|
-
export { AuthMissingError, AuthInvalidError } from './auth'
|
|
128
|
-
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth'
|
|
126
|
+
} from './auth/index.js'
|
|
127
|
+
export { AuthMissingError, AuthInvalidError } from './auth/index.js'
|
|
128
|
+
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth/index.js'
|
|
129
129
|
export type {
|
|
130
130
|
AuthContext,
|
|
131
131
|
Attestation,
|
|
@@ -137,11 +137,11 @@ export type {
|
|
|
137
137
|
export { selfGrant } from '@astrale-os/kernel-core'
|
|
138
138
|
|
|
139
139
|
// ─── Dispatch (escape hatch for custom integrations) ─────────────────────
|
|
140
|
-
export { SdkDispatcher, type SdkDispatcherConfig } from './dispatch'
|
|
140
|
+
export { SdkDispatcher, type SdkDispatcherConfig } from './dispatch/index.js'
|
|
141
141
|
export {
|
|
142
142
|
AuthorizationDeniedError,
|
|
143
143
|
MethodNotFoundError,
|
|
144
144
|
SdkValidationError,
|
|
145
145
|
SdkResultValidationError,
|
|
146
|
-
} from './dispatch'
|
|
147
|
-
export type { SelfResult, TypedSelf } from './dispatch'
|
|
146
|
+
} from './dispatch/index.js'
|
|
147
|
+
export type { SelfResult, TypedSelf } from './dispatch/index.js'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LintDiagnostic } from './diagnostic.js'
|
|
2
|
+
import type { DomainProject } from './project.js'
|
|
3
|
+
import type { AnalyzerRule } from './rules/project-rule.js'
|
|
4
|
+
|
|
5
|
+
import { coreIsPure } from './rules/core-is-pure.js'
|
|
6
|
+
import { oneRemoteDefinitionPerFile } from './rules/one-remote-definition-per-file.js'
|
|
7
|
+
import { thinSchemaCompositionRoot } from './rules/thin-schema-composition-root.js'
|
|
8
|
+
|
|
9
|
+
export const analyzerRules: readonly AnalyzerRule[] = [
|
|
10
|
+
thinSchemaCompositionRoot,
|
|
11
|
+
oneRemoteDefinitionPerFile,
|
|
12
|
+
coreIsPure,
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
export function analyzeProject(project: DomainProject): LintDiagnostic[] {
|
|
16
|
+
return analyzerRules.flatMap((rule) => rule.analyze(project))
|
|
17
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { RuleOwner } from './rules/catalog.js'
|
|
2
|
+
|
|
3
|
+
export type DiagnosticSeverity = 'error' | 'warning'
|
|
4
|
+
|
|
5
|
+
export type DiagnosticLocation = {
|
|
6
|
+
path: string
|
|
7
|
+
line: number
|
|
8
|
+
column: number
|
|
9
|
+
offset?: number
|
|
10
|
+
length?: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type LintDiagnostic = {
|
|
14
|
+
id: string
|
|
15
|
+
severity: DiagnosticSeverity
|
|
16
|
+
message: string
|
|
17
|
+
help?: string
|
|
18
|
+
url?: string
|
|
19
|
+
owner: RuleOwner | 'generic'
|
|
20
|
+
location?: DiagnosticLocation
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type LintResult = {
|
|
24
|
+
root: string
|
|
25
|
+
diagnostics: LintDiagnostic[]
|
|
26
|
+
files: number
|
|
27
|
+
durationMs: number
|
|
28
|
+
exitCode: 0 | 1
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class LinterToolError extends Error {
|
|
32
|
+
readonly exitCode = 2
|
|
33
|
+
|
|
34
|
+
constructor(message: string, options?: ErrorOptions) {
|
|
35
|
+
super(message, options)
|
|
36
|
+
this.name = 'LinterToolError'
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function compareDiagnostics(a: LintDiagnostic, b: LintDiagnostic): number {
|
|
41
|
+
return (
|
|
42
|
+
(a.location?.path ?? '').localeCompare(b.location?.path ?? '') ||
|
|
43
|
+
(a.location?.line ?? 0) - (b.location?.line ?? 0) ||
|
|
44
|
+
(a.location?.column ?? 0) - (b.location?.column ?? 0) ||
|
|
45
|
+
a.id.localeCompare(b.id) ||
|
|
46
|
+
a.message.localeCompare(b.message)
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function dedupeDiagnostics(diagnostics: readonly LintDiagnostic[]): LintDiagnostic[] {
|
|
51
|
+
const seen = new Set<string>()
|
|
52
|
+
const result: LintDiagnostic[] = []
|
|
53
|
+
for (const diagnostic of diagnostics) {
|
|
54
|
+
const location = diagnostic.location
|
|
55
|
+
const key = [
|
|
56
|
+
diagnostic.id,
|
|
57
|
+
location?.path ?? '',
|
|
58
|
+
location?.line ?? 0,
|
|
59
|
+
location?.column ?? 0,
|
|
60
|
+
location?.length ?? 0,
|
|
61
|
+
diagnostic.message,
|
|
62
|
+
].join(':')
|
|
63
|
+
if (seen.has(key)) continue
|
|
64
|
+
seen.add(key)
|
|
65
|
+
result.push(diagnostic)
|
|
66
|
+
}
|
|
67
|
+
return result.sort(compareDiagnostics)
|
|
68
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Diagnostics
|
|
2
|
+
|
|
3
|
+
Every Astrale diagnostic uses the engine-neutral `LintDiagnostic` model and contains:
|
|
4
|
+
|
|
5
|
+
- A stable `astrale/<slug>` identifier.
|
|
6
|
+
- `error` or `warning` severity.
|
|
7
|
+
- A message describing the violated invariant.
|
|
8
|
+
- Remediation and a documentation URL when available.
|
|
9
|
+
- A normalized source location when one exists.
|
|
10
|
+
- The policy owner: `sdk`, `oxlint`, or `analyzer`.
|
|
11
|
+
|
|
12
|
+
Messages describe domain policy rather than AST or analyzer implementation details. Engine changes must
|
|
13
|
+
not rename identifiers, suppressions, or output fields.
|
|
14
|
+
|
|
15
|
+
## Output
|
|
16
|
+
|
|
17
|
+
Stylish output is intended for people. JSON output preserves the complete `LintResult` for automation.
|
|
18
|
+
Diagnostics are sorted by path, position, identifier, and message. Duplicate reports with the same
|
|
19
|
+
identifier and source span are collapsed because dual ownership is a tooling defect.
|
|
20
|
+
|
|
21
|
+
Exit codes are part of the contract:
|
|
22
|
+
|
|
23
|
+
- `0`: no enabled error remains.
|
|
24
|
+
- `1`: policy diagnostics failed the run.
|
|
25
|
+
- `2`: configuration, dependency resolution, or an underlying tool failed.
|
|
26
|
+
|
|
27
|
+
Project preflight failures are tool errors, not suppressible policy diagnostics. Their messages must
|
|
28
|
+
name the conflicting package or tool and preserve the original cause.
|
|
29
|
+
|
|
30
|
+
## Suppressions
|
|
31
|
+
|
|
32
|
+
Astrale rules share one exact, engine-neutral suppression syntax:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// astrale-disable-next-line astrale/raw-path-only-at-boundary -- provider cache key requires a string
|
|
36
|
+
const key = node.path.raw
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
A suppression must:
|
|
40
|
+
|
|
41
|
+
- Name exact rule identifiers.
|
|
42
|
+
- Include a non-empty reason after `--`.
|
|
43
|
+
- Apply only to the following line.
|
|
44
|
+
- Continue to work if rule ownership moves between Oxlint and the analyzer.
|
|
45
|
+
|
|
46
|
+
Generic Oxlint rules continue to use Oxlint suppression syntax. Suppressions are exceptional evidence,
|
|
47
|
+
not compensation for an ambiguous or noisy rule.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Static-analysis Judgment
|
|
2
|
+
|
|
3
|
+
Not every valuable Astrale practice is a static rule. The linter must be honest about what it cannot
|
|
4
|
+
prove.
|
|
5
|
+
|
|
6
|
+
## False-positive budget
|
|
7
|
+
|
|
8
|
+
The burden of proof belongs to automation, not to the code author. If a rule cannot distinguish valid
|
|
9
|
+
code from a violation without inferring intent, its default disposition is `guidance` or `research`,
|
|
10
|
+
not `warning`.
|
|
11
|
+
|
|
12
|
+
Before implementing a rule, ask:
|
|
13
|
+
|
|
14
|
+
- Is the violation represented by syntax, resolved symbols, types, compiled schema, or an explicit
|
|
15
|
+
project contract?
|
|
16
|
+
- Can every common valid alternative be represented without a suppression?
|
|
17
|
+
- Does the diagnostic prevent a concrete failure often enough to justify its maintenance and review
|
|
18
|
+
cost?
|
|
19
|
+
- Would a narrower rule capture the mechanically decidable part without claiming the broader design
|
|
20
|
+
judgment?
|
|
21
|
+
|
|
22
|
+
The existence of a possible AST heuristic is not evidence that a rule should exist. Severity does not
|
|
23
|
+
solve ambiguity, and a local disable comment does not make systematic false positives acceptable.
|
|
24
|
+
|
|
25
|
+
## Keep in knowledge and review
|
|
26
|
+
|
|
27
|
+
The following require domain or product judgment:
|
|
28
|
+
|
|
29
|
+
- Whether bounded-context names and ownership reflect the business correctly.
|
|
30
|
+
- Which context semantically owns a cross-context edge.
|
|
31
|
+
- Whether a generic relation should instead be assignment, tagging, blocking, duplication, hierarchy,
|
|
32
|
+
or mention behavior.
|
|
33
|
+
- Whether an authorization check targets the correct resource and permission.
|
|
34
|
+
- Whether an intentionally open callable is appropriate.
|
|
35
|
+
- Whether deletion should cascade, reject, preserve, archive, or detach related data.
|
|
36
|
+
- Whether import conflict, identity, partial-failure, and idempotency semantics are adequate.
|
|
37
|
+
- Whether a set of writes forms one business invariant.
|
|
38
|
+
- Whether a query projects every fact required by the use case.
|
|
39
|
+
- Whether a fresh read is actually required after receiving hydrated data.
|
|
40
|
+
- Whether a helper legitimately owns its own durable step.
|
|
41
|
+
- Whether UI vocabulary, hierarchy, and interaction design are domain-first and high quality.
|
|
42
|
+
- Whether a feature should exist at all.
|
|
43
|
+
|
|
44
|
+
These topics may have simulations, review checklists, or evidence collectors. They must not become
|
|
45
|
+
static diagnostics based on filenames or keywords.
|
|
46
|
+
|
|
47
|
+
The registry keeps these ideas with an explicit `guidance` disposition and rationale. This is a design
|
|
48
|
+
record, not an implementation backlog. A narrower replacement may be proposed later under its own
|
|
49
|
+
detection contract.
|
|
50
|
+
|
|
51
|
+
## Heuristic promotion
|
|
52
|
+
|
|
53
|
+
A heuristic may begin as an opt-in warning when it provides useful evidence, but its message must say
|
|
54
|
+
what was observed rather than claim intent.
|
|
55
|
+
|
|
56
|
+
For example:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
Observed 101 get() calls after one children() page in scenario delete-large-issue.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
is valid evidence. The following overclaims:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
Your query architecture is wrong.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Promotion from warning to error requires repeated evidence across golden domains, a deterministic
|
|
69
|
+
contract, and documented valid exceptions.
|
|
70
|
+
|
|
71
|
+
Before a heuristic becomes even an opt-in warning, it must first move from `research` to `implement`.
|
|
72
|
+
Report-only prototypes may collect evidence, but they must not appear as ordinary project diagnostics.
|
|
73
|
+
|
|
74
|
+
## Knowledge relationship
|
|
75
|
+
|
|
76
|
+
Every accepted rule links to knowledge that explains why it exists. Knowledge entries may reference
|
|
77
|
+
the semantic identifier, but the registry is authoritative for automation disposition and lifecycle.
|
|
78
|
+
Executable owner, severity, and detection behavior apply only after an `implement` entry is accepted.
|
|
79
|
+
|
|
80
|
+
Agent skills should instruct agents to run the native project commands and interpret diagnostics. They
|
|
81
|
+
should not duplicate the entire rule catalog in prose.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Linter Principles
|
|
2
|
+
|
|
3
|
+
## Outcome
|
|
4
|
+
|
|
5
|
+
An Astrale domain should naturally compile, lint, and test toward the preferred architecture. Agents
|
|
6
|
+
and humans should not need to memorize a long style guide before receiving precise feedback.
|
|
7
|
+
|
|
8
|
+
Knowledge remains responsible for rationale, examples, and judgment. Mechanically decidable policy
|
|
9
|
+
belongs in executable tooling.
|
|
10
|
+
|
|
11
|
+
## Enforcement order
|
|
12
|
+
|
|
13
|
+
For every proposed convention, choose the earliest static layer that can enforce it correctly:
|
|
14
|
+
|
|
15
|
+
1. **SDK** uses its API, TypeScript types, schema compilation, and runtime contracts to reject invalid
|
|
16
|
+
states directly.
|
|
17
|
+
2. **Oxlint** reports file-local syntax, scope, or control-flow violations.
|
|
18
|
+
3. **Astrale analyzer** reports cross-file, import-graph, schema-aware, or project-shape violations.
|
|
19
|
+
A later static layer must not duplicate a diagnostic already owned reliably by an earlier layer. If
|
|
20
|
+
none can decide the convention without guessing, keep it in tests, review, or knowledge rather than
|
|
21
|
+
weakening the linter.
|
|
22
|
+
|
|
23
|
+
## Product principles
|
|
24
|
+
|
|
25
|
+
### One native workflow
|
|
26
|
+
|
|
27
|
+
Authors run ordinary package scripts. They do not assemble Oxlint plugins, TypeScript parser services,
|
|
28
|
+
schema inspectors, or analyzer configuration themselves.
|
|
29
|
+
|
|
30
|
+
### Prevent before reporting
|
|
31
|
+
|
|
32
|
+
If an SDK signature can require `authorize`, a linter should not be the primary enforcement mechanism.
|
|
33
|
+
If a complete schema-derived handler map can be expressed as a TypeScript type, a filesystem scanner
|
|
34
|
+
should not guess whether it is complete.
|
|
35
|
+
|
|
36
|
+
### High signal
|
|
37
|
+
|
|
38
|
+
The default decision is not to automate. A rule earns implementation only when the linter can identify
|
|
39
|
+
the prohibited state and its legitimate exceptions from machine-visible evidence. Even a useful
|
|
40
|
+
principle should remain guidance when detection depends on guessing intent, ownership, or architectural
|
|
41
|
+
quality.
|
|
42
|
+
|
|
43
|
+
An error-level rule must have a deterministic detection contract and a very low false-positive rate.
|
|
44
|
+
Warnings are held to the same honesty standard: lower severity does not make recurring false positives
|
|
45
|
+
acceptable. Suppressions are an escape hatch for exceptional code, not compensation for a vague rule.
|
|
46
|
+
|
|
47
|
+
### Stable diagnostics, replaceable engines
|
|
48
|
+
|
|
49
|
+
Accepted `astrale/<slug>` identifiers are Astrale contracts. Oxlint, a TypeScript project service, or
|
|
50
|
+
any future engine is an implementation detail. Changing engines must not rename accepted rules,
|
|
51
|
+
suppressions, or CI output.
|
|
52
|
+
|
|
53
|
+
### Strict defaults, narrow exceptions
|
|
54
|
+
|
|
55
|
+
New domains receive the strict preset. Configuration exists to describe real domain structure or a
|
|
56
|
+
documented exception, not to recreate an arbitrary lint stack. Suppressions are local, reasoned, and
|
|
57
|
+
auditable.
|
|
58
|
+
|
|
59
|
+
### Safe fixes only
|
|
60
|
+
|
|
61
|
+
`pnpm lint:fix` may apply transformations that preserve behavior and intent. Moving a declaration into
|
|
62
|
+
a guessed bounded context, inventing an authorization target, or grouping mutations automatically is
|
|
63
|
+
not a safe fix.
|
|
64
|
+
|
|
65
|
+
### Measured speed
|
|
66
|
+
|
|
67
|
+
The fast path must remain interactive. New engines or rules are admitted only with cold, warm, and
|
|
68
|
+
changed-file measurements against representative domains.
|
|
69
|
+
|
|
70
|
+
## Rule admission bar
|
|
71
|
+
|
|
72
|
+
A proposed rule may become `accepted` only when all of the following are true:
|
|
73
|
+
|
|
74
|
+
- The prohibited behavior has a concrete failure mode.
|
|
75
|
+
- The preferred behavior is stable across more than one domain.
|
|
76
|
+
- The primary owner is exactly one of `sdk`, `oxlint`, or `analyzer`.
|
|
77
|
+
- Valid and invalid examples can be stated without relying on taste.
|
|
78
|
+
- Detection does not require guessing business intent.
|
|
79
|
+
- Representative legitimate alternatives do not trigger.
|
|
80
|
+
- Every documented exception is either machine-visible or explicitly outside the rule's scope.
|
|
81
|
+
- The expected prevention value exceeds the cost of review, suppression, maintenance, and lost trust
|
|
82
|
+
from false positives.
|
|
83
|
+
- The diagnostic identifies a useful source location and remediation.
|
|
84
|
+
- Suppression semantics are defined.
|
|
85
|
+
- Runtime and maintenance cost are measured.
|
|
86
|
+
|
|
87
|
+
## Non-goals
|
|
88
|
+
|
|
89
|
+
The linter does not:
|
|
90
|
+
|
|
91
|
+
- Build a new JavaScript or TypeScript parser, formatter, or compiler.
|
|
92
|
+
- Replace `tsgo`, Oxlint, Vitest, schema compilation, or live domain verification.
|
|
93
|
+
- Infer the correct business bounded context from vocabulary alone.
|
|
94
|
+
- Prove that an authorization target expresses the intended business policy.
|
|
95
|
+
- Grade visual design quality or domain language by keyword.
|
|
96
|
+
- Promise zero migration work for arbitrary repositories that were not scaffolded with the system.
|
|
97
|
+
- Turn every recommendation into an error.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Astrale Linter
|
|
2
|
+
|
|
3
|
+
Astrale Linter is the SDK-owned authoring system that turns stable Astrale domain conventions into
|
|
4
|
+
type constraints and static diagnostics.
|
|
5
|
+
|
|
6
|
+
Domain authors use the ordinary project commands:
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
pnpm lint
|
|
10
|
+
pnpm lint:fix
|
|
11
|
+
pnpm typecheck
|
|
12
|
+
pnpm test
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Generated domains contain the compatible dependencies and Oxlint bridge. Authors should not need to
|
|
16
|
+
assemble parser services, plugins, or analyzer configuration themselves.
|
|
17
|
+
|
|
18
|
+
## Reference
|
|
19
|
+
|
|
20
|
+
- [PRINCIPLES.md](./PRINCIPLES.md) defines the enforcement philosophy and rule-admission bar.
|
|
21
|
+
- [JUDGMENT.md](./JUDGMENT.md) defines what must remain human or agent judgment.
|
|
22
|
+
- [RULE-AUTHORING.md](./RULE-AUTHORING.md) defines identifiers, metadata, lifecycle, and testing.
|
|
23
|
+
- [RULES.md](./RULES.md) is the canonical policy registry and implementation-status record.
|
|
24
|
+
- [DIAGNOSTICS.md](./DIAGNOSTICS.md) defines output, tool failures, and suppressions.
|
|
25
|
+
|
|
26
|
+
## Scope
|
|
27
|
+
|
|
28
|
+
The implementation is authoring-only and is exposed through `@astrale-os/sdk/linter`. It is not
|
|
29
|
+
re-exported from the isomorphic SDK root and must never enter a worker or browser bundle.
|
|
30
|
+
|
|
31
|
+
Each executable policy has one owner:
|
|
32
|
+
|
|
33
|
+
- `sdk` prevents invalid states through public types and authoring contracts.
|
|
34
|
+
- `oxlint` detects reliable file-local syntax and control-flow violations.
|
|
35
|
+
- `analyzer` detects project shape, import-graph, and cross-file violations.
|
|
36
|
+
|
|
37
|
+
Generic JavaScript and TypeScript rules remain owned by `@astrale-os/ox`. Astrale rules retain stable
|
|
38
|
+
`astrale/<slug>` identifiers regardless of their execution engine.
|