arkgate 2.12.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -0
- package/README.md +90 -51
- package/bin/ark-check.mjs +156 -39
- package/bin/ark-mcp.mjs +119 -6
- package/bin/ark-shared.mjs +216 -129
- package/bin/ark.mjs +134 -34
- package/bin/lib/adapter-contract.mjs +93 -0
- package/bin/lib/agent-gates.mjs +13 -0
- package/bin/lib/analysis-engine.mjs +1171 -0
- package/bin/lib/architecture-scan.mjs +84 -127
- package/bin/lib/ci-and-commands.mjs +40 -3
- package/bin/lib/codex-home.mjs +7 -0
- package/bin/lib/config-contract.mjs +331 -0
- package/bin/lib/config-warnings.mjs +7 -205
- package/bin/lib/doctor-plan.mjs +43 -16
- package/bin/lib/enforcement-profiles.mjs +97 -0
- package/bin/lib/field-install.mjs +67 -10
- package/bin/lib/gate-files.mjs +42 -3
- package/bin/lib/graph-cycles.mjs +4 -54
- package/bin/lib/hook-templates.mjs +33 -1
- package/bin/lib/host-support-matrix.mjs +83 -0
- package/bin/lib/install-migrate.mjs +99 -30
- package/bin/lib/mcp-adoption.mjs +35 -3
- package/bin/lib/open-html.mjs +75 -0
- package/bin/lib/presets.mjs +45 -4
- package/bin/lib/safety-diagnostics.mjs +36 -15
- package/bin/lib/scan-files.mjs +12 -1
- package/bin/lib/skill-install.mjs +72 -1
- package/bin/lib/source-policy.mjs +36 -0
- package/bin/lib/start-preview.mjs +271 -0
- package/bin/lib/ts-resolve.mjs +13 -3
- package/bin/lib/weakest-link.mjs +417 -0
- package/bin/lib/write-path-capabilities.mjs +186 -0
- package/bin/lib/write-path-detect.mjs +62 -99
- package/compat/nestjs.cjs +2 -0
- package/compat/nestjs.d.ts +2 -0
- package/compat/nestjs.js +1 -0
- package/compat/runtime.cjs +2 -0
- package/compat/runtime.d.ts +2 -0
- package/compat/runtime.js +1 -0
- package/dist/configContract-BxSIwVRo.d.cts +259 -0
- package/dist/configContract-BxSIwVRo.d.ts +259 -0
- package/dist/eslint/index.cjs +500 -61
- package/dist/eslint/index.d.cts +36 -20
- package/dist/eslint/index.d.ts +36 -20
- package/dist/eslint/index.js +500 -61
- package/dist/index.cjs +1349 -2741
- package/dist/index.d.cts +449 -483
- package/dist/index.d.ts +449 -483
- package/dist/index.js +1325 -2687
- package/docs/agent-guide.md +58 -34
- package/docs/ai-gates.md +79 -21
- package/docs/configuration.md +97 -0
- package/docs/enthusiast/README.md +3 -3
- package/docs/enthusiast/how-to-agent-gates.md +7 -3
- package/docs/migrate-from-ark-runtime-kernel.md +5 -3
- package/docs/package-surface.md +19 -19
- package/docs/production-hardening.md +31 -5
- package/docs/threat-model.md +65 -0
- package/docs/typescript-support.md +30 -3
- package/package.json +46 -11
- package/schemas/ark.analysis-result.schema.json +91 -0
- package/schemas/ark.config.schema.json +750 -0
- package/server.json +2 -2
- package/templates/hooks/pre-commit-ark +37 -0
- package/templates/skills/ark-architect.md +3 -2
- package/templates/skills/ark-coverage.md +2 -2
- package/templates/skills/ark-runtime.md +8 -5
- package/templates/skills/ark-upgrade.md +36 -16
- package/tests/fixtures/ts-consumer/ark.config.json +2 -0
- package/dist/eslint/index.cjs.map +0 -1
- package/dist/eslint/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/nestjs/index.cjs +0 -2498
- package/dist/nestjs/index.cjs.map +0 -1
- package/dist/nestjs/index.d.cts +0 -22
- package/dist/nestjs/index.d.ts +0 -22
- package/dist/nestjs/index.js +0 -2474
- package/dist/nestjs/index.js.map +0 -1
- package/dist/runtime/index.cjs +0 -3352
- package/dist/runtime/index.cjs.map +0 -1
- package/dist/runtime/index.d.cts +0 -2
- package/dist/runtime/index.d.ts +0 -2
- package/dist/runtime/index.js +0 -3270
- package/dist/runtime/index.js.map +0 -1
- package/dist/types-BZ17b9i5.d.cts +0 -1068
- package/dist/types-BZ17b9i5.d.ts +0 -1068
package/dist/eslint/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { A as ArkConfig } from '../configContract-BxSIwVRo.cjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Pure layer-glob matching for ark.config.json.
|
|
3
5
|
*
|
|
@@ -6,7 +8,7 @@
|
|
|
6
8
|
* (`npm run generate:layer-match` / `npm run check:layer-match`).
|
|
7
9
|
* Behavioral parity tests remain a safety net.
|
|
8
10
|
*/
|
|
9
|
-
type LayerConfig
|
|
11
|
+
type LayerConfig = {
|
|
10
12
|
name: string;
|
|
11
13
|
patterns?: string[];
|
|
12
14
|
exclude?: string[];
|
|
@@ -21,7 +23,7 @@ type LayerConfig$1 = {
|
|
|
21
23
|
* (same **or** cross layer). Same-slice → allow. Needs fromPath/toPath; missing
|
|
22
24
|
* paths/slices → fail-open.
|
|
23
25
|
*/
|
|
24
|
-
type EdgeRule
|
|
26
|
+
type EdgeRule = {
|
|
25
27
|
from: string;
|
|
26
28
|
to: string;
|
|
27
29
|
allowed?: boolean;
|
|
@@ -47,12 +49,12 @@ type EdgeCheckOptions = {
|
|
|
47
49
|
/** Repo-relative path of the imported module. */
|
|
48
50
|
toPath?: string;
|
|
49
51
|
/** Layer configs — used to infer sliceFolders when the rule omits them. */
|
|
50
|
-
layers?: LayerConfig
|
|
52
|
+
layers?: LayerConfig[];
|
|
51
53
|
};
|
|
52
54
|
declare function globToRegExp(pattern: string): RegExp;
|
|
53
55
|
declare function patternSpecificity(pattern: string): number;
|
|
54
|
-
declare function layerForRelativePath(relPath: string, layers: LayerConfig
|
|
55
|
-
declare function isEdgeDenied(rules: EdgeRule
|
|
56
|
+
declare function layerForRelativePath(relPath: string, layers: LayerConfig[] | undefined): string | undefined;
|
|
57
|
+
declare function isEdgeDenied(rules: EdgeRule[] | undefined, from: string, to: string, options?: EdgeCheckOptions): boolean;
|
|
56
58
|
|
|
57
59
|
type RuleContext = {
|
|
58
60
|
report(descriptor: Record<string, unknown>): void;
|
|
@@ -62,8 +64,28 @@ type RuleContext = {
|
|
|
62
64
|
physicalFilename?: string;
|
|
63
65
|
/** ESLint ≤8 API — still present on some hosts; removed in ESLint 10. */
|
|
64
66
|
getFilename?: () => string;
|
|
67
|
+
/** ESLint 9+ source/scope API. */
|
|
68
|
+
sourceCode?: SourceCode;
|
|
69
|
+
/** ESLint ≤8 source/scope API. */
|
|
70
|
+
getSourceCode?: () => SourceCode;
|
|
65
71
|
options?: unknown[];
|
|
66
72
|
};
|
|
73
|
+
type ScopeVariable = {
|
|
74
|
+
defs?: unknown[];
|
|
75
|
+
};
|
|
76
|
+
type ScopeReference = {
|
|
77
|
+
identifier?: AstNode;
|
|
78
|
+
resolved?: ScopeVariable | null;
|
|
79
|
+
isValueReference?: boolean;
|
|
80
|
+
};
|
|
81
|
+
type Scope = {
|
|
82
|
+
set?: Map<string, ScopeVariable>;
|
|
83
|
+
references?: ScopeReference[];
|
|
84
|
+
upper?: Scope | null;
|
|
85
|
+
};
|
|
86
|
+
type SourceCode = {
|
|
87
|
+
getScope?: (node: AstNode) => Scope;
|
|
88
|
+
};
|
|
67
89
|
type RuleListener = Record<string, (node: AstNode) => void>;
|
|
68
90
|
type AstNode = {
|
|
69
91
|
type?: string;
|
|
@@ -78,6 +100,15 @@ type AstNode = {
|
|
|
78
100
|
properties?: AstNode[];
|
|
79
101
|
importKind?: string;
|
|
80
102
|
specifiers?: AstNode[];
|
|
103
|
+
parent?: AstNode;
|
|
104
|
+
init?: AstNode;
|
|
105
|
+
computed?: boolean;
|
|
106
|
+
loc?: {
|
|
107
|
+
start?: {
|
|
108
|
+
line?: number;
|
|
109
|
+
column?: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
81
112
|
};
|
|
82
113
|
type ArkRule = {
|
|
83
114
|
meta: {
|
|
@@ -94,21 +125,6 @@ type ArkEslintPlugin = {
|
|
|
94
125
|
rules: Record<string, ArkRule>;
|
|
95
126
|
configs?: Record<string, unknown>;
|
|
96
127
|
};
|
|
97
|
-
type LayerConfig = {
|
|
98
|
-
name: string;
|
|
99
|
-
patterns?: string[];
|
|
100
|
-
exclude?: string[];
|
|
101
|
-
forbiddenGlobals?: string[];
|
|
102
|
-
};
|
|
103
|
-
type EdgeRule = {
|
|
104
|
-
from: string;
|
|
105
|
-
to: string;
|
|
106
|
-
allowed?: boolean;
|
|
107
|
-
};
|
|
108
|
-
type ArkConfig = {
|
|
109
|
-
layers?: LayerConfig[];
|
|
110
|
-
rules?: EdgeRule[];
|
|
111
|
-
};
|
|
112
128
|
declare function findConfigPath(startFile: string): string | null;
|
|
113
129
|
declare function loadArkConfig(configPath: string): ArkConfig | null;
|
|
114
130
|
/** Resolve relative import specifier to an absolute path candidate (TS-oriented). */
|
package/dist/eslint/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { A as ArkConfig } from '../configContract-BxSIwVRo.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Pure layer-glob matching for ark.config.json.
|
|
3
5
|
*
|
|
@@ -6,7 +8,7 @@
|
|
|
6
8
|
* (`npm run generate:layer-match` / `npm run check:layer-match`).
|
|
7
9
|
* Behavioral parity tests remain a safety net.
|
|
8
10
|
*/
|
|
9
|
-
type LayerConfig
|
|
11
|
+
type LayerConfig = {
|
|
10
12
|
name: string;
|
|
11
13
|
patterns?: string[];
|
|
12
14
|
exclude?: string[];
|
|
@@ -21,7 +23,7 @@ type LayerConfig$1 = {
|
|
|
21
23
|
* (same **or** cross layer). Same-slice → allow. Needs fromPath/toPath; missing
|
|
22
24
|
* paths/slices → fail-open.
|
|
23
25
|
*/
|
|
24
|
-
type EdgeRule
|
|
26
|
+
type EdgeRule = {
|
|
25
27
|
from: string;
|
|
26
28
|
to: string;
|
|
27
29
|
allowed?: boolean;
|
|
@@ -47,12 +49,12 @@ type EdgeCheckOptions = {
|
|
|
47
49
|
/** Repo-relative path of the imported module. */
|
|
48
50
|
toPath?: string;
|
|
49
51
|
/** Layer configs — used to infer sliceFolders when the rule omits them. */
|
|
50
|
-
layers?: LayerConfig
|
|
52
|
+
layers?: LayerConfig[];
|
|
51
53
|
};
|
|
52
54
|
declare function globToRegExp(pattern: string): RegExp;
|
|
53
55
|
declare function patternSpecificity(pattern: string): number;
|
|
54
|
-
declare function layerForRelativePath(relPath: string, layers: LayerConfig
|
|
55
|
-
declare function isEdgeDenied(rules: EdgeRule
|
|
56
|
+
declare function layerForRelativePath(relPath: string, layers: LayerConfig[] | undefined): string | undefined;
|
|
57
|
+
declare function isEdgeDenied(rules: EdgeRule[] | undefined, from: string, to: string, options?: EdgeCheckOptions): boolean;
|
|
56
58
|
|
|
57
59
|
type RuleContext = {
|
|
58
60
|
report(descriptor: Record<string, unknown>): void;
|
|
@@ -62,8 +64,28 @@ type RuleContext = {
|
|
|
62
64
|
physicalFilename?: string;
|
|
63
65
|
/** ESLint ≤8 API — still present on some hosts; removed in ESLint 10. */
|
|
64
66
|
getFilename?: () => string;
|
|
67
|
+
/** ESLint 9+ source/scope API. */
|
|
68
|
+
sourceCode?: SourceCode;
|
|
69
|
+
/** ESLint ≤8 source/scope API. */
|
|
70
|
+
getSourceCode?: () => SourceCode;
|
|
65
71
|
options?: unknown[];
|
|
66
72
|
};
|
|
73
|
+
type ScopeVariable = {
|
|
74
|
+
defs?: unknown[];
|
|
75
|
+
};
|
|
76
|
+
type ScopeReference = {
|
|
77
|
+
identifier?: AstNode;
|
|
78
|
+
resolved?: ScopeVariable | null;
|
|
79
|
+
isValueReference?: boolean;
|
|
80
|
+
};
|
|
81
|
+
type Scope = {
|
|
82
|
+
set?: Map<string, ScopeVariable>;
|
|
83
|
+
references?: ScopeReference[];
|
|
84
|
+
upper?: Scope | null;
|
|
85
|
+
};
|
|
86
|
+
type SourceCode = {
|
|
87
|
+
getScope?: (node: AstNode) => Scope;
|
|
88
|
+
};
|
|
67
89
|
type RuleListener = Record<string, (node: AstNode) => void>;
|
|
68
90
|
type AstNode = {
|
|
69
91
|
type?: string;
|
|
@@ -78,6 +100,15 @@ type AstNode = {
|
|
|
78
100
|
properties?: AstNode[];
|
|
79
101
|
importKind?: string;
|
|
80
102
|
specifiers?: AstNode[];
|
|
103
|
+
parent?: AstNode;
|
|
104
|
+
init?: AstNode;
|
|
105
|
+
computed?: boolean;
|
|
106
|
+
loc?: {
|
|
107
|
+
start?: {
|
|
108
|
+
line?: number;
|
|
109
|
+
column?: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
81
112
|
};
|
|
82
113
|
type ArkRule = {
|
|
83
114
|
meta: {
|
|
@@ -94,21 +125,6 @@ type ArkEslintPlugin = {
|
|
|
94
125
|
rules: Record<string, ArkRule>;
|
|
95
126
|
configs?: Record<string, unknown>;
|
|
96
127
|
};
|
|
97
|
-
type LayerConfig = {
|
|
98
|
-
name: string;
|
|
99
|
-
patterns?: string[];
|
|
100
|
-
exclude?: string[];
|
|
101
|
-
forbiddenGlobals?: string[];
|
|
102
|
-
};
|
|
103
|
-
type EdgeRule = {
|
|
104
|
-
from: string;
|
|
105
|
-
to: string;
|
|
106
|
-
allowed?: boolean;
|
|
107
|
-
};
|
|
108
|
-
type ArkConfig = {
|
|
109
|
-
layers?: LayerConfig[];
|
|
110
|
-
rules?: EdgeRule[];
|
|
111
|
-
};
|
|
112
128
|
declare function findConfigPath(startFile: string): string | null;
|
|
113
129
|
declare function loadArkConfig(configPath: string): ArkConfig | null;
|
|
114
130
|
/** Resolve relative import specifier to an absolute path candidate (TS-oriented). */
|