arkgate 3.7.0 → 3.8.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 +76 -1145
- package/README.md +59 -19
- package/bin/ark-check-runtime.mjs +1598 -0
- package/bin/ark-check.mjs +32 -1565
- package/bin/ark-mcp-runtime.mjs +1976 -0
- package/bin/ark-mcp.mjs +84 -1495
- package/bin/ark-shared.mjs +34 -38
- package/bin/ark.mjs +33 -66
- package/bin/lib/adapter-contract.mjs +161 -9
- package/bin/lib/agent-gates.mjs +1 -0
- package/bin/lib/analysis-completeness.mjs +28 -0
- package/bin/lib/analysis-engine.mjs +8 -8
- package/bin/lib/analysis-policy.mjs +27 -0
- package/bin/lib/architecture-scan.mjs +70 -357
- package/bin/lib/auto-patch.mjs +76 -8
- package/bin/lib/ci-and-commands.mjs +1 -1
- package/bin/lib/codex-home.mjs +43 -16
- package/bin/lib/design-delta.mjs +4 -0
- package/bin/lib/doctor-advisories.mjs +4 -3
- package/bin/lib/doctor-plan.mjs +40 -41
- package/bin/lib/enforcement-state.mjs +2 -0
- package/bin/lib/github-enforcement.mjs +443 -0
- package/bin/lib/hook-templates.mjs +12 -148
- package/bin/lib/html-report-advisories.mjs +1 -1
- package/bin/lib/html-report-depth.mjs +9 -0
- package/bin/lib/html-report.mjs +5 -5
- package/bin/lib/install-migrate.mjs +83 -79
- package/bin/lib/managed-upgrade.mjs +622 -0
- package/bin/lib/mcp-adoption.mjs +3 -1
- package/bin/lib/parse-health.mjs +6 -5
- package/bin/lib/port-proof.mjs +2 -2
- package/bin/lib/prepare-change.mjs +68 -38
- package/bin/lib/prepare-write.mjs +7 -1
- package/bin/lib/resident-doctor-client.mjs +55 -0
- package/bin/lib/resident-hook.mjs +247 -0
- package/bin/lib/resolved-candidate-facts.mjs +1160 -0
- package/bin/lib/scan-files.mjs +19 -6
- package/bin/lib/snippet-analysis.mjs +119 -0
- package/bin/lib/source-policy.mjs +24 -0
- package/bin/lib/typescript-host.mjs +15 -18
- package/bin/lib/unavailable-analysis.mjs +76 -0
- package/bin/lib/upgrade-command.mjs +115 -0
- package/bin/lib/weakest-link.mjs +21 -179
- package/bin/lib/write-path-capabilities.mjs +167 -16
- package/bin/lib/write-path-detect.mjs +3 -2
- package/dist/eslint/index.cjs +3 -3
- package/dist/eslint/index.d.ts +3 -0
- package/dist/eslint/index.js +3 -3
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1073 -141
- package/dist/index.js +7 -7
- package/docs/agent-guide.md +103 -59
- package/docs/ai-gates.md +97 -16
- package/docs/demos/01-write-gate-self-correction.md +2 -2
- package/docs/enthusiast/README.md +10 -10
- package/docs/enthusiast/how-to-gallery-starter.md +2 -2
- package/docs/enthusiast/reference-commands.md +18 -1
- package/docs/enthusiast/tutorial-first-project.md +2 -2
- package/docs/package-surface.md +98 -12
- package/docs/typescript-support.md +109 -37
- package/package.json +32 -4
- package/schemas/ark.analysis-result.schema.json +159 -2
- package/schemas/ark.design-delta.schema.json +1 -0
- package/schemas/ark.enforcement-state.schema.json +84 -0
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -0
- package/server.json +2 -2
- package/templates/skills/ark-explore.md +5 -5
- package/templates/skills/ark-fix.md +1 -1
- package/templates/skills/ark-runtime.md +15 -8
- package/templates/skills/ark-upgrade.md +122 -182
- package/bin/lib/ai-velocity.mjs +0 -293
- package/bin/lib/graph-cycles.mjs +0 -6
- package/bin/lib/safety-diagnostics.mjs +0 -284
- package/bin/lib/ts-resolve.mjs +0 -228
- package/dist/configTypes-DAPvBqK6.d.cts +0 -61
- package/dist/eslint/index.d.cts +0 -146
- package/dist/index.d.cts +0 -986
package/dist/eslint/index.d.cts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { A as ArkConfig } from '../configTypes-DAPvBqK6.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Pure layer-glob matching for ark.config.json.
|
|
5
|
-
*
|
|
6
|
-
* **Canonical algorithm** for CLI, ESLint, and library consumers.
|
|
7
|
-
* The CLI load path uses the generated `bin/ark-layer-match.mjs`
|
|
8
|
-
* (`npm run generate:layer-match` / `npm run check:layer-match`).
|
|
9
|
-
* Behavioral parity tests remain a safety net.
|
|
10
|
-
*/
|
|
11
|
-
type LayerConfig = {
|
|
12
|
-
name: string;
|
|
13
|
-
patterns?: string[];
|
|
14
|
-
exclude?: string[];
|
|
15
|
-
forbiddenGlobals?: string[];
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Layer-to-layer dependency rule from ark.config.json.
|
|
19
|
-
*
|
|
20
|
-
* - Classic: `{ from, to, allowed: false }` denies **cross-layer** edges only.
|
|
21
|
-
* Same-layer is always allowed without peerIsolation (historical short-circuit).
|
|
22
|
-
* - `peerIsolation: true` + `allowed: false`: deny only when slice ids differ
|
|
23
|
-
* (same **or** cross layer). Same-slice → allow. Needs fromPath/toPath; missing
|
|
24
|
-
* paths/slices → fail-open.
|
|
25
|
-
*/
|
|
26
|
-
type EdgeRule = {
|
|
27
|
-
from: string;
|
|
28
|
-
to: string;
|
|
29
|
-
allowed?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* When true with `allowed: false`: deny only when importer and importee resolve
|
|
32
|
-
* to different slice ids (parent/name, e.g. features/auth). Works same-layer
|
|
33
|
-
* and cross-layer. See findDeniedEdgeRule.
|
|
34
|
-
*/
|
|
35
|
-
peerIsolation?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Path segment names that own the slice id as the *next* segment
|
|
38
|
-
* (e.g. `["features"]` → `src/features/auth/...` has slice `auth`).
|
|
39
|
-
* When omitted, inferred from the layer's glob patterns (segment before `**`/`*`).
|
|
40
|
-
*/
|
|
41
|
-
sliceFolders?: string[];
|
|
42
|
-
/** Optional override message for scanners / write-gate. */
|
|
43
|
-
message?: string;
|
|
44
|
-
};
|
|
45
|
-
/** Options for path-aware edge checks (peer isolation). */
|
|
46
|
-
type EdgeCheckOptions = {
|
|
47
|
-
/** Repo-relative path of the importing file. */
|
|
48
|
-
fromPath?: string;
|
|
49
|
-
/** Repo-relative path of the imported module. */
|
|
50
|
-
toPath?: string;
|
|
51
|
-
/** Layer configs — used to infer sliceFolders when the rule omits them. */
|
|
52
|
-
layers?: LayerConfig[];
|
|
53
|
-
};
|
|
54
|
-
declare function globToRegExp(pattern: string): RegExp;
|
|
55
|
-
declare function patternSpecificity(pattern: string): number;
|
|
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;
|
|
58
|
-
|
|
59
|
-
type RuleContext = {
|
|
60
|
-
report(descriptor: Record<string, unknown>): void;
|
|
61
|
-
/** ESLint 9+ / 10: preferred path on the context object. */
|
|
62
|
-
filename?: string;
|
|
63
|
-
/** ESLint 8-style physical path when linting with processors / virtual files. */
|
|
64
|
-
physicalFilename?: string;
|
|
65
|
-
/** ESLint ≤8 API — still present on some hosts; removed in ESLint 10. */
|
|
66
|
-
getFilename?: () => string;
|
|
67
|
-
/** ESLint 9+ source/scope API. */
|
|
68
|
-
sourceCode?: SourceCode;
|
|
69
|
-
/** ESLint ≤8 source/scope API. */
|
|
70
|
-
getSourceCode?: () => SourceCode;
|
|
71
|
-
options?: unknown[];
|
|
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
|
-
};
|
|
89
|
-
type RuleListener = Record<string, (node: AstNode) => void>;
|
|
90
|
-
type AstNode = {
|
|
91
|
-
type?: string;
|
|
92
|
-
name?: string;
|
|
93
|
-
value?: unknown;
|
|
94
|
-
source?: AstNode;
|
|
95
|
-
callee?: AstNode;
|
|
96
|
-
object?: AstNode;
|
|
97
|
-
property?: AstNode;
|
|
98
|
-
key?: AstNode;
|
|
99
|
-
arguments?: AstNode[];
|
|
100
|
-
properties?: AstNode[];
|
|
101
|
-
importKind?: string;
|
|
102
|
-
specifiers?: AstNode[];
|
|
103
|
-
parent?: AstNode;
|
|
104
|
-
init?: AstNode;
|
|
105
|
-
computed?: boolean;
|
|
106
|
-
loc?: {
|
|
107
|
-
start?: {
|
|
108
|
-
line?: number;
|
|
109
|
-
column?: number;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
type ArkRule = {
|
|
114
|
-
meta: {
|
|
115
|
-
type: 'problem';
|
|
116
|
-
docs: {
|
|
117
|
-
description: string;
|
|
118
|
-
};
|
|
119
|
-
messages: Record<string, string>;
|
|
120
|
-
schema: unknown[];
|
|
121
|
-
};
|
|
122
|
-
create(context: RuleContext): RuleListener;
|
|
123
|
-
};
|
|
124
|
-
type ArkEslintPlugin = {
|
|
125
|
-
rules: Record<string, ArkRule>;
|
|
126
|
-
configs?: Record<string, unknown>;
|
|
127
|
-
};
|
|
128
|
-
declare function findConfigPath(startFile: string): string | null;
|
|
129
|
-
declare function loadArkConfig(configPath: string): ArkConfig | null;
|
|
130
|
-
/** Resolve relative import specifier to an absolute path candidate (TS-oriented). */
|
|
131
|
-
declare function resolveRelativeImport(fromFile: string, specifier: string): string | null;
|
|
132
|
-
/**
|
|
133
|
-
* Config-driven layer import boundary (primary editor gate).
|
|
134
|
-
* Replaces path-token domain/infra heuristics when ark.config.json is present.
|
|
135
|
-
* Rule id kept as `no-domain-infra-imports` for recommended-config / upgrade stability.
|
|
136
|
-
*/
|
|
137
|
-
declare const noDomainInfraImports: ArkRule;
|
|
138
|
-
declare const noRawEventPublish: ArkRule;
|
|
139
|
-
declare const requirePublishSource: ArkRule;
|
|
140
|
-
declare const noForbiddenGlobals: ArkRule;
|
|
141
|
-
declare const noDeniedCapabilities: ArkRule;
|
|
142
|
-
declare const plugin: ArkEslintPlugin;
|
|
143
|
-
|
|
144
|
-
// @ts-ignore
|
|
145
|
-
export = plugin;
|
|
146
|
-
export { findConfigPath, globToRegExp, isEdgeDenied, layerForRelativePath, loadArkConfig, noDeniedCapabilities, noDomainInfraImports, noForbiddenGlobals, noRawEventPublish, patternSpecificity, plugin, requirePublishSource, resolveRelativeImport };
|