arkgate 2.7.0 → 2.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 +27 -1
- package/bin/lib/agent-gates.mjs +48 -228
- package/bin/lib/architecture-scan.mjs +20 -0
- package/bin/lib/ast-scan.mjs +232 -4
- package/bin/lib/codex-home.mjs +320 -0
- package/bin/lib/doctor-plan.mjs +2 -0
- package/bin/lib/remediation.mjs +44 -12
- package/bin/lib/ts-resolve.mjs +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.cjs +1 -1
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.js +1 -1
- package/dist/nestjs/index.js.map +1 -1
- package/dist/runtime/index.cjs +1 -1
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/docs/agent-guide.md +1 -1
- package/docs/ai-gates.md +41 -7
- package/docs/brownfield-adoption.md +7 -0
- package/docs/demos/03-copilot-autopilot.md +3 -2
- package/docs/enthusiast/reference-commands.md +2 -2
- package/package.json +2 -1
- package/server.json +2 -2
- package/templates/skills/ark-explain.md +3 -2
- package/templates/skills/ark-loop.md +2 -1
package/docs/agent-guide.md
CHANGED
|
@@ -195,7 +195,7 @@ npx arkgate-check --install-agent-gates --tools claude,cursor,codex,grok
|
|
|
195
195
|
|------|------------|-----|-------------|
|
|
196
196
|
| Claude Code | PreToolUse hook | `.mcp.json` / `claude mcp add` | `.claude/skills/<name>/SKILL.md` |
|
|
197
197
|
| Cursor | Advisory (rules + MCP) | `.cursor/mcp.json` | `.cursor/commands/` |
|
|
198
|
-
| OpenAI Codex | MCP + CI |
|
|
198
|
+
| OpenAI Codex | MCP + CI | `$CODEX_HOME/config.toml` (global; absolute `--root`; multi-project → secondary `ark_<slug>` unless `--force`) | `$CODEX_HOME/prompts` (`--codex-home`) |
|
|
199
199
|
| **Grok Build** | PreToolUse hook (`.grok/hooks/`) | `.grok/config.toml` + `.mcp.json` | `.grok/skills/<name>/SKILL.md` |
|
|
200
200
|
|
|
201
201
|
Full copy-paste setups: [ai-gates.md](ai-gates.md). Skill inventory: main [README](../README.md#agent-skills-ark-).
|
package/docs/ai-gates.md
CHANGED
|
@@ -189,20 +189,54 @@ Your hard backstop in Cursor is CI: `ark-check` fails the PR on anything that sl
|
|
|
189
189
|
|
|
190
190
|
Recommended for Ark projects.
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
Unlike Claude/Cursor (project-local MCP files), **Codex loads MCP servers only from
|
|
193
|
+
`$CODEX_HOME/config.toml`** (default `~/.codex/config.toml`) — a **global** home file.
|
|
194
|
+
Hand-editing with relative `--root .` is wrong: Codex does not use the project as cwd, so
|
|
195
|
+
`.` resolves against the launch directory. Prefer absolute paths, or let Ark write them:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
npx ark-check --install-agent-gates --tools codex
|
|
199
|
+
# optional: install /ark-* slash prompts into $CODEX_HOME/prompts
|
|
200
|
+
npx ark-check --install-agent-gates --codex-home
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Example shape (absolute paths — also what install writes):
|
|
193
204
|
|
|
194
205
|
```toml
|
|
195
206
|
[mcp_servers.ark]
|
|
196
207
|
command = "npx"
|
|
197
|
-
args = ["
|
|
208
|
+
args = ["arkgate-mcp", "--root", "/absolute/path/to/project", "--config", "/absolute/path/to/project/ark.config.json"]
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Then **restart Codex** — it does not hot-load MCP servers. Expect resource `ark://manifest`
|
|
212
|
+
and tools `validate_code`, `ark_check`, `ark_coverage`, `ark_place`.
|
|
213
|
+
|
|
214
|
+
Same model as Cursor for enforcement: MCP for discovery/validation, `ark-check` in CI as
|
|
215
|
+
the hard gate. Register the MCP server as soon as the repo is adopted.
|
|
216
|
+
|
|
217
|
+
### Multi-project Codex (home config last-wins)
|
|
218
|
+
|
|
219
|
+
`[mcp_servers.ark]` is a **single primary** binding. If project A is already registered and
|
|
220
|
+
you install gates for project B **without** `--force`, Ark does **not** silently steal
|
|
221
|
+
primary A. It writes a **scoped secondary** table:
|
|
222
|
+
|
|
223
|
+
```toml
|
|
224
|
+
[mcp_servers.ark] # primary — still project A
|
|
225
|
+
# ...
|
|
226
|
+
|
|
227
|
+
[mcp_servers.ark_proj-b_a1b2c3d4] # secondary — basename + path hash (no slug collisions)
|
|
228
|
+
# absolute --root for B
|
|
198
229
|
```
|
|
199
230
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
231
|
+
| Goal | Command |
|
|
232
|
+
|------|---------|
|
|
233
|
+
| Add B without moving primary | `ark-check --install-agent-gates --tools codex` (no `--force`) |
|
|
234
|
+
| Make B the primary binding | `ark-check --install-agent-gates --tools codex --force` |
|
|
235
|
+
| Doctor: primary points at another permanent project | gap id `codex-home-multi-project` (warn if no secondary yet; info if scoped table already present) |
|
|
203
236
|
|
|
204
|
-
`ark-check --
|
|
205
|
-
|
|
237
|
+
`ark-check --doctor` surfaces the multi-project state so you are not left thinking B owns
|
|
238
|
+
`ark://manifest` when only a secondary table exists. Temp/upgrade primary roots are still
|
|
239
|
+
rewritten fail-closed (not multi-project).
|
|
206
240
|
|
|
207
241
|
## Grok Build (xAI)
|
|
208
242
|
|
|
@@ -71,6 +71,13 @@ violations — the ratchet only moves toward zero.
|
|
|
71
71
|
- **Value import of pure type module** (`targetTypeOnlyExports` — plan:
|
|
72
72
|
`import-type-from-pure-type-module`): convert static import to `import type`. Not safe for
|
|
73
73
|
`require()` / dynamic `import()`.
|
|
74
|
+
- **Named type exports from mixed modules** (`namedBindingsTypeOnly` — plan:
|
|
75
|
+
`import-type-of-type-exports`): value-syntax `import { Row }` / `export { Row }` where every
|
|
76
|
+
binding is an `export type` / `interface` on the target — convert to `import type` /
|
|
77
|
+
`export type`. Still **judgment** when any binding is a value, dual-space name
|
|
78
|
+
(`export type Foo` + `export const Foo`), the target has top-level side effects (including
|
|
79
|
+
impure value-export initializers like `export const db = connect()`), or the edge is
|
|
80
|
+
`require` / dynamic `import()`.
|
|
74
81
|
- **Raw infrastructure access** (value coupling — always **judgment**): relocate data-access
|
|
75
82
|
**verbatim** into a repository/adapter. Same query bytes = same behavior; do NOT rewrite the
|
|
76
83
|
query. If CODEOWNERS reserves the data layer, migrate one route as a pattern and hand bulk
|
|
@@ -40,8 +40,9 @@ npx ark-check --plan --json # { ok, plan: { goal, counts, steps } }
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Each step is tagged `mechanical-safe` / `judgment` / `deferred` with a `confidence`,
|
|
43
|
-
`rationale`, and often `remediationKind`.
|
|
44
|
-
|
|
43
|
+
`rationale`, and often `remediationKind`. Auto-safe kinds: type-only type move, pure-type **file**
|
|
44
|
+
relocate, `import type` of pure-type modules, and named type-export imports from mixed modules
|
|
45
|
+
(`import-type-of-type-exports`). `goal.met` is true only when
|
|
45
46
|
there are no active violations **and** governed coverage is meaningful — so a clean plan that
|
|
46
47
|
checks almost nothing is not "done."
|
|
47
48
|
|
|
@@ -51,7 +51,7 @@ arkgate-check --watch
|
|
|
51
51
|
|
|
52
52
|
| `class` | Agent may auto-apply? | Examples (`remediationKind`) |
|
|
53
53
|
|---------|----------------------|------------------------------|
|
|
54
|
-
| `mechanical-safe` | Yes (validate + rollback) | `type-only-import-move`, `pure-type-file-relocate`, `import-type-from-pure-type-module` |
|
|
54
|
+
| `mechanical-safe` | Yes (validate + rollback) | `type-only-import-move`, `pure-type-file-relocate`, `import-type-from-pure-type-module`, `import-type-of-type-exports` |
|
|
55
55
|
| `judgment` | No — propose | value imports, ports, infra relocate, cycles |
|
|
56
56
|
| `deferred` | No | unclear shape |
|
|
57
57
|
|
|
@@ -62,4 +62,4 @@ When present on violations:
|
|
|
62
62
|
- `fixClass` — e.g. `port-inversion`, `file-move`
|
|
63
63
|
- `effort` — `small` | `medium`
|
|
64
64
|
- `enthusiastHint` — plain English fix guidance
|
|
65
|
-
- plan enrichment: `class`, `remediationKind`, `typeOnly`, `sourcePureTypeModule`, `targetTypeOnlyExports`
|
|
65
|
+
- plan enrichment: `class`, `remediationKind`, `typeOnly`, `sourcePureTypeModule`, `targetTypeOnlyExports`, `namedBindingsTypeOnly`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkgate",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "ArkGate — architecture co-pilot for AI TypeScript (write gate, CI gate, plan/loop)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"check:cli-pure": "node scripts/generate-cli-pure.mjs --check",
|
|
76
76
|
"test:ts-compat": "node scripts/ts-compat-matrix.mjs 5.9.3 && node scripts/ts-compat-matrix.mjs 6.0.3 && node scripts/ts-compat-matrix.mjs 7.0.2",
|
|
77
77
|
"eval:agent": "node eval/run.mjs",
|
|
78
|
+
"eval:corpus": "node eval/validate-corpus.mjs",
|
|
78
79
|
"eval:comparative": "node eval/comparative-run.mjs",
|
|
79
80
|
"clean": "rm -rf dist",
|
|
80
81
|
"release:npm": "node scripts/release-npm.mjs",
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/pedroknigge/arkgate",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.8.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "arkgate",
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.8.0",
|
|
15
15
|
"runtimeHint": "npx",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
@@ -47,8 +47,9 @@ dependency direction, matrix, violations, enforcement points, Ark fitness score,
|
|
|
47
47
|
**Senior diagnostics** block (coupling fan-in/out, deny density, purity surface, pattern
|
|
48
48
|
forensics, baseline taxonomy) for tech leads.
|
|
49
49
|
|
|
50
|
-
When explaining the **plan**, name the
|
|
51
|
-
(type-only move, pure-type file relocate, `import type` of pure-type modules
|
|
50
|
+
When explaining the **plan**, name the four `mechanical-safe` remediation kinds only
|
|
51
|
+
(type-only move, pure-type file relocate, `import type` of pure-type modules,
|
|
52
|
+
`import-type-of-type-exports` for named type exports from mixed modules) — everything
|
|
52
53
|
else is judgment/deferred and must not be auto-applied.
|
|
53
54
|
|
|
54
55
|
## Spoken / written explanation
|
|
@@ -32,8 +32,9 @@ validating every change with `ark-check` and rolling back regressions.
|
|
|
32
32
|
| `type-only-import-move` | Move type to owning layer; re-export for back-compat |
|
|
33
33
|
| `pure-type-file-relocate` | Relocate pure-type file to owning layer (or rename out of false Domain globs) |
|
|
34
34
|
| `import-type-from-pure-type-module` | Convert value import of pure-type module to `import type` |
|
|
35
|
+
| `import-type-of-type-exports` | Convert value-syntax named import/export of type-only exports from a mixed module to `import type` / `export type` |
|
|
35
36
|
|
|
36
|
-
Never auto: value imports, dynamic import/require,
|
|
37
|
+
Never auto: value imports (including mixed bindings with values), dynamic import/require, forbidden globals, cycles, infra moves.
|
|
37
38
|
|
|
38
39
|
## Steps
|
|
39
40
|
|