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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,128 @@ All notable changes to ArkGate (`arkgate`; formerly `ark-runtime-kernel`) are do
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
No changes are scheduled after the prepared stable release.
|
|
8
|
+
|
|
9
|
+
## 3.0.0 — 2026-07-13
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Compact active-host onboarding:** `ark start` now asks for the active host on a TTY (or
|
|
14
|
+
detects it non-interactively), writes at most five project files / 25 KB, and uses one
|
|
15
|
+
package/MCP-backed router instead of copied per-host skill packs. It does not alter
|
|
16
|
+
`package.json` unless `--install` is explicit; host removal and re-addition are previewed,
|
|
17
|
+
safe, and reversible.
|
|
18
|
+
|
|
19
|
+
- **Canonical analysis engine bundle:** graph policy, cycle evaluation, and configuration
|
|
20
|
+
diagnostics now have one Kernel implementation shared by the library, CLI, and MCP. A documented
|
|
21
|
+
standalone CLI bundle preserves the package's self-hosted boundary and is protected by a CI drift
|
|
22
|
+
check and Kernel/bundle parity fixtures.
|
|
23
|
+
- **Symbol-aware semantic analysis:** one Kernel extractor now resolves forbidden ambient
|
|
24
|
+
capabilities through local symbols, aliases, `globalThis`, static keys, and destructuring, and
|
|
25
|
+
classifies TS/JS dependency forms across ESM, CommonJS, type-only, and unresolved dynamic edges.
|
|
26
|
+
CLI, safety diagnostics, and AICodeGate consume the same generated implementation. The supported
|
|
27
|
+
soundness envelope is documented and guarded by a labeled adversarial corpus plus TypeScript
|
|
28
|
+
5/6/7 and mutation matrices.
|
|
29
|
+
- **Versioned adapter parity:** CLI JSON, MCP structured results, write hooks, ESLint, and the
|
|
30
|
+
GitHub Action now expose the same `ark.analysis-result` v1 diagnostics. A generated JSON Schema,
|
|
31
|
+
committed compatibility fixture, exact golden corpus, and mandatory CI parity job prevent
|
|
32
|
+
adapter drift; source-policy decisions no longer live privately inside ESLint.
|
|
33
|
+
- **Runtime package isolation:** the next-major `arkgate` root now contains only gate APIs. The
|
|
34
|
+
optional runtime and NestJS adapter build independently as experimental `@arkgate/runtime`;
|
|
35
|
+
deprecated subpath shims contain no implementation. The non-atomic store is now presented as
|
|
36
|
+
`InMemoryEventBuffer`, with production recovery and durability requirements made explicit.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- **Deterministic offline setup tests:** `ark start` fixtures that do not exercise installation now
|
|
41
|
+
pass `--no-install`, preventing a published current version from turning unit tests into registry
|
|
42
|
+
installs.
|
|
43
|
+
- **Node 26 watch fallback:** `ark-check --watch` falls back to bounded polling when recursive
|
|
44
|
+
`fs.watch` fails asynchronously with `EMFILE`, instead of crashing the watcher process.
|
|
45
|
+
|
|
46
|
+
## 2.13.0 — 2026-07-11
|
|
47
|
+
|
|
48
|
+
- Added the stable, deterministic analysis IR and public in-memory API: `loadContract`,
|
|
49
|
+
`analyzeProject`, `analyzeChange`, and `explainViolation`.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- **Temp-worktree release verification:** Codex multi-project fixtures now keep the simulated
|
|
54
|
+
primary project outside temp-root policy even when the repository itself is checked out under
|
|
55
|
+
`/tmp`, so the release confidence gate is reproducible without weakening fail-closed temp MCP
|
|
56
|
+
rewrites.
|
|
57
|
+
- **Test and Codex-home isolation:** Vitest now redirects `CODEX_HOME` to a disposable test home,
|
|
58
|
+
so direct helper calls and spawned CLIs cannot rewrite the developer's real Codex config. Temp
|
|
59
|
+
project installs also recognize an explicitly exported default `~/.codex` as the real home and
|
|
60
|
+
skip implicit MCP rewiring unless `--codex-home` is requested.
|
|
61
|
+
- **Workflow retry boundary:** `RetryPolicy` now retries only `step.execute` failures and
|
|
62
|
+
timeouts. A snapshot-store or completion-audit failure after a successful effect is terminal,
|
|
63
|
+
enters compensation, and never executes the completed effect again.
|
|
64
|
+
- **Scanner bypass corpus:** forbidden-global checks now use single-file TypeScript symbols, so
|
|
65
|
+
local `fetch` / `Date` bindings do not false-positive while ambient aliases and
|
|
66
|
+
`globalThis.Date.now()` remain violations. CLI, AICodeGate, and ESLint share the verdict.
|
|
67
|
+
TypeScript `import x = require('...')` now creates a dependency edge, and direct
|
|
68
|
+
`require(expr)` emits `DYNAMIC_REQUIRE_NOT_ALLOWLISTED` (strict profiles fail unless the file
|
|
69
|
+
is reviewed in `dynamicImportAllowlist`). The scan cache is versioned past the old semantics.
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
|
|
73
|
+
- **Versioned configuration contract:** `ark.config.json` now carries `$schema` and
|
|
74
|
+
`schemaVersion: "1.0"`. One canonical loader validates and migrates the contract for CLI, MCP,
|
|
75
|
+
and ESLint with path-specific diagnostics and a fail-closed unknown-key policy. The generated
|
|
76
|
+
JSON Schema ships at the stable `arkgate/schema` subpath; unversioned configs from the previous
|
|
77
|
+
major migrate deterministically in memory.
|
|
78
|
+
- **Active-host enforcement capabilities:** doctor and adoption checks now project
|
|
79
|
+
`hard-write`, `advisory-write`, `merge-gate`, and `repair-payload` from the active host only,
|
|
80
|
+
with evidence paths and a separate repo-wide inventory. Claude/Grok hooks can no longer make
|
|
81
|
+
Codex, Cursor, or an unknown host appear hard-enforced; human doctor output names the host and
|
|
82
|
+
separates advisory MCP checks from the shared CI check and its external required-status policy.
|
|
83
|
+
- **Host-compatible enforcement profiles:** generated CI now uses `--strict-merge`, while
|
|
84
|
+
`--strict` remains a compatibility alias; neither depends on an editor hook. The optional
|
|
85
|
+
`--require-write-hook <host>` check verifies Claude/Grok explicitly, reports Cursor/Codex as
|
|
86
|
+
advisory-write plus the shared CI check only, and makes `ark start` reject impossible,
|
|
87
|
+
mismatched, or preserved-incompatible requests before writing project files.
|
|
88
|
+
- **Executable regression confidence gate:** `npm run test:confidence` now combines the existing
|
|
89
|
+
broad Vitest coverage thresholds with real Stryker mutation testing over write-path detection,
|
|
90
|
+
dependency extraction, forbidden-global detection, baseline keys, and workflow retry logic.
|
|
91
|
+
CI and both npm release paths invoke the same gate; mutation score fails below 90%.
|
|
92
|
+
- **Q2 repair dogfood closed:** deny → `ARK_REPAIR_JSON`/`autoPatch` → host re-inject →
|
|
93
|
+
revalidation allow proven via shipped `bin/ark-mcp.mjs` (Claude/Grok hooks already
|
|
94
|
+
`--hook-repair`; `doctor.writePath.mode = repair`).
|
|
95
|
+
- **Q3 weakest-link sensors:** `bin/lib/weakest-link.mjs` + doctor adoption gaps
|
|
96
|
+
(`enforcement-ci-*`, config drift, pre-commit missing); maintained
|
|
97
|
+
`templates/hooks/pre-commit-ark`; optional `ARK_DOCTOR_GITHUB=1` branch-protection
|
|
98
|
+
report (honest unavailable / not-protected — never fake green).
|
|
99
|
+
- **Q5 scale bench:** `scripts/ark-scale-bench.mjs` / `npm run bench:scale` (real
|
|
100
|
+
ark-check cold/warm p50/p95 on generated trees).
|
|
101
|
+
- **Q6 module budgets:** `scripts/check-module-budgets.mjs` / `npm run check:module-budgets`.
|
|
102
|
+
- **Q8 fault-injection tests:** compensation failure audit, cancellation-ignoring timeout,
|
|
103
|
+
outbox retry attempts + clear (durability boundary).
|
|
104
|
+
- **Q9 threat model + package allowlist:** `docs/threat-model.md`,
|
|
105
|
+
`scripts/verify-package-files.mjs` / `npm run check:package-files`.
|
|
106
|
+
|
|
107
|
+
### Changed
|
|
108
|
+
|
|
109
|
+
- **Product identity retained:** ArkGate, `arkgate`, the `arkgate*` / `ark*` commands,
|
|
110
|
+
`ark.config.json`, `ark://`, `ARK_*`, the existing GitHub repository, and `arkgate.online` remain
|
|
111
|
+
canonical. The unpublished local rename experiment was reversed before any external cutover.
|
|
112
|
+
- **Truthful host support matrix and runtime status:** one capability-backed matrix now drives
|
|
113
|
+
README and generated `AGENTS.md` guarantees for Claude, Grok, Cursor, and Codex. Doctor exposes
|
|
114
|
+
both the supported host profile and repository evidence; public docs distinguish hard local
|
|
115
|
+
hooks, advisory MCP, CI checks, and required-status merge blocking. The optional runtime/Nest
|
|
116
|
+
surface is explicitly experimental and is not required for architecture-gate adoption.
|
|
117
|
+
- **Active host vs deferred Codex on upgrade/doctor:** `/ark-upgrade` greens the
|
|
118
|
+
**session host** first; Codex `$CODEX_HOME` prompts/MCP multi-project debt is
|
|
119
|
+
**deferred** when the session host is **known and not Codex** (Grok/Claude/Cursor).
|
|
120
|
+
Unknown host (CI/plain shell) keeps original severity. Doctor marks deferred gaps
|
|
121
|
+
`deferred: true` (severity `info`), prefixes the message, and omits them from Top
|
|
122
|
+
actions. Temp/upgrade MCP `--root` stays urgent (fail-closed). New helpers:
|
|
123
|
+
`detectActiveAgentHost`, `codexConcernIsActive` (do not treat `CODEX_HOME` alone
|
|
124
|
+
as Codex). `ark-check` advisory for stale Codex-home skills notes the deferral.
|
|
125
|
+
Completion contract adds **Active host** / **Deferred hosts**.
|
|
126
|
+
- **ROADMAP Track Q:** Q2 `done`; Q3/Q5/Q6/Q8/Q9 `doing` with residual external/DoD
|
|
127
|
+
items listed; Q4/Q7/Q10 remain `todo` (no false complete).
|
|
128
|
+
|
|
7
129
|
## 2.12.0 — 2026-07-10
|
|
8
130
|
|
|
9
131
|
### Fixed
|
package/README.md
CHANGED
|
@@ -16,6 +16,9 @@ and makes sure a “green” check means something real.
|
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
+
> **ArkGate 3.0** passed its independent beta-exit audit. The npm badge reports the version
|
|
20
|
+
> currently available in the registry.
|
|
21
|
+
|
|
19
22
|
---
|
|
20
23
|
|
|
21
24
|
## The only flow (humans and agents)
|
|
@@ -23,8 +26,10 @@ and makes sure a “green” check means something real.
|
|
|
23
26
|
If you remember nothing else:
|
|
24
27
|
|
|
25
28
|
```text
|
|
26
|
-
1. npx arkgate start ←
|
|
27
|
-
|
|
29
|
+
1. npx arkgate start ← read-only preview: files + commands + projected coverage
|
|
30
|
+
npx arkgate start --apply ← apply exactly the previewed mutations
|
|
31
|
+
2. Compact router ← MCP/AGENTS routes place, validate, and architecture checks
|
|
32
|
+
/ark-autopilot ← optional full guided workflow after its skill pack is installed
|
|
28
33
|
3. npx arkgate-check --doctor ← “where am I?” anytime (one status screen)
|
|
29
34
|
```
|
|
30
35
|
|
|
@@ -36,22 +41,26 @@ If you remember nothing else:
|
|
|
36
41
|
| New ArkGate version | `/ark-upgrade` |
|
|
37
42
|
|
|
38
43
|
**Everything else is optional.** You do not need to learn “modes”, 11 skills, or the runtime
|
|
39
|
-
kernel to get value.
|
|
40
|
-
|
|
44
|
+
kernel to get value. The compact router is enough for normal work; install `/ark-autopilot` only
|
|
45
|
+
when you want the full guided workflow.
|
|
41
46
|
|
|
42
47
|
---
|
|
43
48
|
|
|
44
49
|
## What it is (30 seconds)
|
|
45
50
|
|
|
46
|
-
**ArkGate** = a machine-readable architecture file (`ark.config.json`) enforced
|
|
47
|
-
|
|
51
|
+
**ArkGate** = a machine-readable architecture file (`ark.config.json`) enforced at CI, with
|
|
52
|
+
host-specific protection while an agent writes:
|
|
53
|
+
|
|
54
|
+
**Name note:** this is the TypeScript architecture-enforcement package published as `arkgate`.
|
|
55
|
+
It is not affiliated with the separate Archgate CLI project.
|
|
48
56
|
|
|
49
57
|
| When | Tool |
|
|
50
58
|
|------|------|
|
|
51
|
-
| **While the AI writes** |
|
|
52
|
-
| **Before merge** | `arkgate-check` CI |
|
|
59
|
+
| **While the AI writes** | Hard PreToolUse block on Claude/Grok; advisory MCP on Cursor/Codex |
|
|
60
|
+
| **Before merge** | `arkgate-check` CI check; merge blocking requires it as a required status |
|
|
53
61
|
|
|
54
|
-
Optional later: runtime kernel (`createArkKernel`) if you want
|
|
62
|
+
Optional later: the **experimental** runtime kernel (`createArkKernel`) if you want to evaluate
|
|
63
|
+
event/intent governance. It is not required for gate adoption.
|
|
55
64
|
|
|
56
65
|
It is **not** a web framework, ORM, or job runner.
|
|
57
66
|
|
|
@@ -61,12 +70,13 @@ It is **not** a web framework, ORM, or job runner.
|
|
|
61
70
|
|
|
62
71
|
## Who it’s for
|
|
63
72
|
|
|
64
|
-
Same start for almost everyone: **`npx arkgate start` →
|
|
73
|
+
Same start for almost everyone: **`npx arkgate start` → compact router** (then
|
|
74
|
+
`/ark-autopilot` when you opt into the full skill pack).
|
|
65
75
|
|
|
66
76
|
| You are… | Same start, then… |
|
|
67
77
|
|----------|-------------------|
|
|
68
|
-
| Builder with AI |
|
|
69
|
-
| Tech lead on a messy monorepo |
|
|
78
|
+
| Builder with AI | Use the compact router and doctor; add autopilot when you want guided remediation |
|
|
79
|
+
| Tech lead on a messy monorepo | Add autopilot (or deeper `/ark-adopt` for a focused brownfield pass) |
|
|
70
80
|
| Power user | Same flow; use `ark-check --plan` / `--coverage` when you want the raw sensor |
|
|
71
81
|
|
|
72
82
|
**Not for:** no TypeScript, “just one lint rule”, or looking for an app framework.
|
|
@@ -82,7 +92,7 @@ mode you configure:
|
|
|
82
92
|
|-------|--------|-----------|
|
|
83
93
|
| **Suggest** | New/thin project | Finish `start` + autopilot |
|
|
84
94
|
| **Adapt** | Not fully protected yet | Keep autopilot / adopt until clean |
|
|
85
|
-
| **Enforce** |
|
|
95
|
+
| **Enforce** | Contract coverage is honest and checked edges are clean | Keep the host-appropriate write path; require the CI status if it must block merges |
|
|
86
96
|
|
|
87
97
|
You **arrive** at Enforce. You never “turn on Enforce”.
|
|
88
98
|
|
|
@@ -106,8 +116,9 @@ Full checklist (CI, MCP, Codex, imports): **[docs/migrate-from-ark-runtime-kerne
|
|
|
106
116
|
|
|
107
117
|
```bash
|
|
108
118
|
npm install -D arkgate typescript
|
|
109
|
-
npx arkgate start #
|
|
110
|
-
#
|
|
119
|
+
npx arkgate start # read-only preview: exact mutations + projected coverage
|
|
120
|
+
npx arkgate start --apply # apply the compact contract → active-host router → CI plan
|
|
121
|
+
# optional, after installing the full skill pack:
|
|
111
122
|
# /ark-autopilot
|
|
112
123
|
npx arkgate-check --doctor # status light + next action
|
|
113
124
|
```
|
|
@@ -117,7 +128,7 @@ Aliases `ark` / `ark-check` / `ark-mcp` still work. **npm / pnpm / yarn**. No in
|
|
|
117
128
|
<details>
|
|
118
129
|
<summary>What <code>/ark-autopilot</code> does under the hood (optional detail)</summary>
|
|
119
130
|
|
|
120
|
-
1. Setup if needed (`ark start` — contract
|
|
131
|
+
1. Setup if needed (`ark start` — compact contract + active-host router + CI gate; create an HTML/origin report explicitly when you need one).
|
|
121
132
|
2. **Explore pass** (decision-grade map of *this* product; field path when demos exist).
|
|
122
133
|
3. **Dual plan:** **A** remediation from `--plan` (mechanical-safe only by default); **B** pattern/evolution bets (never auto-applied as mechanical-safe). Empty plan ≠ “healthy” without explore/B.
|
|
123
134
|
4. Apply A → re-check; judgment only when you ask for full apply.
|
|
@@ -143,11 +154,12 @@ npx arkgate-check --coverage
|
|
|
143
154
|
|
|
144
155
|
## Other skills (only when you need them)
|
|
145
156
|
|
|
146
|
-
Install once: `npx arkgate-check --install-agent-gates`
|
|
157
|
+
Install once: `npx arkgate-check --install-agent-gates`
|
|
147
158
|
(`--tools claude,cursor,codex,grok` to pick hosts.)
|
|
148
159
|
|
|
149
|
-
**
|
|
150
|
-
|
|
160
|
+
**The compact router is the default; `/ark-autopilot` is the full guided option.** The rest are
|
|
161
|
+
escapes, not a second curriculum. Full-install `AGENTS.md` includes a **skill routing table**
|
|
162
|
+
(trigger → skill). Skills are
|
|
151
163
|
**dual-engine** (CLI sensor + read real source) and end with a fixed **completion contract**;
|
|
152
164
|
critical handoffs say **STOP** and name the next skill (hosts must follow — markdown cannot chain calls).
|
|
153
165
|
When the host allows it, skills may **fan out parallel subagents** (disjoint scopes);
|
|
@@ -155,8 +167,9 @@ otherwise they **fall back to sequential**.
|
|
|
155
167
|
|
|
156
168
|
**Write path (Track W):** Prefer MCP **`ark_prepare_write`** when you have a snippet (place +
|
|
157
169
|
constrain + validate + optional `autoPatch` + `judgmentBrief`). PreToolUse hooks with
|
|
158
|
-
`--hook-repair` emit machine-readable repair payloads on deny (still hard block;
|
|
159
|
-
write).
|
|
170
|
+
`--hook-repair` on Claude/Grok emit machine-readable repair payloads on deny (still hard block;
|
|
171
|
+
never silent write). Cursor/Codex MCP calls remain advisory. See
|
|
172
|
+
[docs/ai-gates.md](docs/ai-gates.md).
|
|
160
173
|
|
|
161
174
|
| Need | Skill |
|
|
162
175
|
|------|--------|
|
|
@@ -170,11 +183,24 @@ write). See [docs/ai-gates.md](docs/ai-gates.md).
|
|
|
170
183
|
| Edit `ark.config.json` safely | `/ark-contract` |
|
|
171
184
|
| Plain-language tour of the report | `/ark-explain` |
|
|
172
185
|
| Deep coverage + opportunities audit | `/ark-coverage` |
|
|
173
|
-
|
|
|
174
|
-
| Bump ArkGate + refresh
|
|
186
|
+
| Evaluate the experimental runtime against hand-rolled bus/outbox (TS) | `/ark-runtime` |
|
|
187
|
+
| Bump ArkGate + refresh active host (defer Codex when not on Codex) | `/ark-upgrade` |
|
|
188
|
+
|
|
189
|
+
### Host enforcement support
|
|
190
|
+
|
|
191
|
+
<!-- arkgate-host-support:start -->
|
|
192
|
+
| Host | Local write boundary | MCP validation | CI / merge path | Repair payload |
|
|
193
|
+
|------|----------------------|----------------|-----------------|----------------|
|
|
194
|
+
| Claude Code | Hard block for PreToolUse `Write` / `Edit` / `MultiEdit` | Advisory; the agent must call it | Available `arkgate-check --strict-merge` check | Emitted on hook deny; host must re-inject |
|
|
195
|
+
| Grok Build | Hard block for PreToolUse `write` / `search_replace` (plus aliases) | Advisory; the agent must call it | Available `arkgate-check --strict-merge` check | Emitted on hook deny; host must re-inject |
|
|
196
|
+
| Cursor | No hard hook; MCP/rules are advisory | Advisory; the agent must call it | Available `arkgate-check --strict-merge` check | No hard-boundary payload |
|
|
197
|
+
| OpenAI Codex | No hard hook; MCP/rules are advisory | Advisory; the agent must call it | Available `arkgate-check --strict-merge` check | No hard-boundary payload |
|
|
198
|
+
|
|
199
|
+
This table describes the supported profile **after its files are installed and the host loads/trusts them**. A hard local boundary covers only the listed hook operations; alternate tools, direct filesystem writes, and human edits still rely on CI. MCP validation is advisory because the agent must call it. The CI check blocks a merge only when the repository makes that status required. Repair payloads never write code silently: the host must re-inject the candidate and ArkGate revalidates it. Run `arkgate-check --doctor` for the evidence actually detected in the current repository.
|
|
200
|
+
<!-- arkgate-host-support:end -->
|
|
201
|
+
|
|
202
|
+
Detailed setup: [docs/ai-gates.md](docs/ai-gates.md).
|
|
175
203
|
|
|
176
|
-
Hosts with full MCP/hooks: **Claude Code**, **Cursor**, **Codex**, **Grok Build**.
|
|
177
|
-
More: [docs/ai-gates.md](docs/ai-gates.md). Health: **`npx arkgate-check --doctor`**.
|
|
178
204
|
---
|
|
179
205
|
|
|
180
206
|
## How it works (short)
|
|
@@ -182,22 +208,29 @@ More: [docs/ai-gates.md](docs/ai-gates.md). Health: **`npx arkgate-check --docto
|
|
|
182
208
|
```
|
|
183
209
|
ark.config.json
|
|
184
210
|
│
|
|
185
|
-
├─► Write
|
|
186
|
-
├─► CI
|
|
187
|
-
└─► Runtime kernel
|
|
211
|
+
├─► Write path (arkgate-mcp) — hard hook or advisory MCP, by host
|
|
212
|
+
├─► CI check (arkgate-check) — merge block only when status is required
|
|
213
|
+
└─► Runtime kernel — experimental opt-in; gates do not need it
|
|
188
214
|
```
|
|
189
215
|
|
|
190
216
|
- **Presets:** hexagonal, layered, feature-sliced, monorepo, ui-surface, vertical-slice, ddd-bounded-contexts (+ aliases clean-architecture / onion-architecture). Layers start optional; doctor suggests tightening populated cores. Cross-slice / cross-context bans use optional `peerIsolation` rules.
|
|
217
|
+
- **Versioned config:** generated contracts include `$schema` + `schemaVersion`; CLI, MCP, and
|
|
218
|
+
ESLint validate through the same loader. Unknown keys fail with their JSON path. See the
|
|
219
|
+
[configuration and editor guide](docs/configuration.md).
|
|
191
220
|
- **Frameworks:** Nest / Next / express / library layouts get sensible globs on init so day-one coverage is real.
|
|
192
221
|
- **Brownfield:** baseline ratchet, refuse to freeze a wrong contract, `/ark-adopt` for mature trees.
|
|
193
|
-
- **Agents:**
|
|
222
|
+
- **Agents:** `ark start` asks for (or detects) one active host and writes one compact router, not copied skill packs, in at most five project files and 25 KB. Use `ark-check --install-agent-gates --skills-only --tools <host>` later when you explicitly want the full `/ark-*` skill set. Reports are opt-in with `ark-check --report`.
|
|
194
223
|
- **Write protocol (2.10 / Track W):** mechanical-safe **autoPatch** on the write gate (`import type`); MCP **`ark_prepare_write`** (place + validate + patch + judgmentBrief); opt-in hook **`--hook-repair`** (`ARK_REPAIR_JSON`); doctor **`writePath`** (repair vs reject-only); loop-cost eval (`npm run eval:loop-cost`). Port-proof inject is **judgment** (arity change), not silent auto-apply.
|
|
195
|
-
- **Fail-closed CI (2.11):** `--strict` combines config coverage,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
224
|
+
- **Fail-closed CI (2.11):** `--strict-merge` combines config coverage, shared gate-file
|
|
225
|
+
presence, and bypass diagnostics for dynamic imports, TypeScript suppressions, explicit `any`
|
|
226
|
+
casts, InMemory runtime defaults, and disabled peer isolation. `--strict` is a compatibility
|
|
227
|
+
alias. Neither requires an editor hook; use `--require-write-hook claude|grok` when that local
|
|
228
|
+
guarantee is part of the check.
|
|
229
|
+
- **Trust / coverage (3.0 release baseline):** package unit-test floors on the broad product surface
|
|
199
230
|
(statements/lines **≥80%**, branches/functions **≥85%**; enforcement-critical modules **≥95%**
|
|
200
|
-
branch).
|
|
231
|
+
branch). The V05 beta-exit audit passed with 12 pinned public adoptions, 97% median governed
|
|
232
|
+
coverage, and zero P0/P1 findings. Stable publication remains the signed-tag, GitHub Release,
|
|
233
|
+
and provenance-backed npm workflow documented in [the 3.0.0 release notes](docs/releases/3.0.0.md).
|
|
201
234
|
- **TypeScript:** project compilers 5.x / 6.x / 7.x — gate falls back to a nested JS-API TypeScript when TS 7’s main export is version-only ([docs/typescript-support.md](docs/typescript-support.md)).
|
|
202
235
|
|
|
203
236
|
### Why not only ESLint / dependency-cruiser / Nx?
|
|
@@ -205,7 +238,7 @@ ark.config.json
|
|
|
205
238
|
| | ArkGate | Typical boundary linter |
|
|
206
239
|
|--|:---:|:---:|
|
|
207
240
|
| CI import rules | ✅ | ✅ |
|
|
208
|
-
|
|
|
241
|
+
| Hard-block supported-host AI writes before they land | ✅ (Claude/Grok hooks) | ❌ |
|
|
209
242
|
| Contract agents can read (`ark://manifest`) | ✅ | ❌ |
|
|
210
243
|
| Placement tools (`ark_place`, …) | ✅ | ❌ |
|
|
211
244
|
| Honest governed % + adoption path | ✅ | ❌ |
|
|
@@ -219,13 +252,17 @@ ark.config.json
|
|
|
219
252
|
## Common commands
|
|
220
253
|
|
|
221
254
|
```bash
|
|
222
|
-
npx arkgate start # guided
|
|
255
|
+
npx arkgate start # guided read-only preview
|
|
256
|
+
npx arkgate start --apply # apply the compact active-host setup (≤5 files)
|
|
257
|
+
npx arkgate start --tools codex --apply # select the host explicitly
|
|
258
|
+
npx arkgate start --install --apply # also add arkgate to package.json (explicit only)
|
|
259
|
+
npx arkgate start --remove-host codex # preview compact-host removal; add --apply to confirm
|
|
223
260
|
npx arkgate-check --doctor # health + Adoption gaps (not just fitness)
|
|
224
261
|
npx arkgate-check --doctor --json # machine-readable doctor.adoption
|
|
225
262
|
npx arkgate-check --strict # fail-closed CI + installed-gate/safety checks
|
|
226
263
|
npx arkgate-check --plan # safe-to-auto-fix vs your call
|
|
227
264
|
npx arkgate-check --coverage # Governed: N%
|
|
228
|
-
npx arkgate-check --report ark-report.html # showcase HTML
|
|
265
|
+
npx arkgate-check --report ark-report.html # showcase HTML (opens in browser on local TTY; --no-open to skip)
|
|
229
266
|
npx arkgate-check --baseline # only NEW violations fail
|
|
230
267
|
npx arkgate upgrade # package + gates/skills + MCP/Codex normalize
|
|
231
268
|
```
|
|
@@ -239,24 +276,25 @@ CI (example):
|
|
|
239
276
|
|
|
240
277
|
---
|
|
241
278
|
|
|
242
|
-
## Optional
|
|
279
|
+
## Optional experimental runtime kernel
|
|
243
280
|
|
|
244
|
-
Gates need **no app code changes**.
|
|
245
|
-
|
|
281
|
+
Gates need **no app code changes**. The runtime API is currently **experimental** and is not a
|
|
282
|
+
production-readiness claim. If you want to evaluate runtime intent/event contracts, use the
|
|
283
|
+
separate experimental package:
|
|
246
284
|
|
|
247
285
|
```ts
|
|
248
|
-
import { createStrictArkKernelFromConfig } from 'arkgate/runtime';
|
|
286
|
+
import { createStrictArkKernelFromConfig } from '@arkgate/runtime';
|
|
249
287
|
// see docs/production-hardening.md and docs/package-surface.md
|
|
250
288
|
```
|
|
251
289
|
|
|
252
|
-
|
|
253
|
-
|
|
290
|
+
The stable `arkgate` package does not bundle runtime implementation. The deprecated
|
|
291
|
+
`arkgate/runtime` forwarding shim requires `@arkgate/runtime` and is removed in ArkGate 4.
|
|
254
292
|
|
|
255
|
-
NestJS:
|
|
293
|
+
NestJS: `@arkgate/runtime/nestjs` (optional peer `@nestjs/common`).
|
|
256
294
|
|
|
257
295
|
### Durability stance (built-in stores)
|
|
258
296
|
|
|
259
|
-
The kernel’s default stores (`
|
|
297
|
+
The kernel’s default stores (`InMemoryEventBuffer`, `InMemoryAuditStore`,
|
|
260
298
|
`InMemoryReadModelStore`, `InMemoryWorkflowStore`) are **reference in-memory only**:
|
|
261
299
|
fine for tests, demos, and single-process local work — they **do not** survive restarts
|
|
262
300
|
and are **not** production durability. Implement the store interfaces (or inject your own)
|
|
@@ -269,7 +307,7 @@ for real systems. Details: [docs/production-hardening.md](docs/production-harden
|
|
|
269
307
|
| Audience | Link |
|
|
270
308
|
|----------|------|
|
|
271
309
|
| New builders (plain language) | [docs/enthusiast/](docs/enthusiast/README.md) |
|
|
272
|
-
| **Package surface (stable vs
|
|
310
|
+
| **Package surface (stable vs experimental)** | [docs/package-surface.md](docs/package-surface.md) |
|
|
273
311
|
| Wire Claude / Cursor / Codex / Grok + **ESLint (CI-parity)** | [docs/ai-gates.md](docs/ai-gates.md) |
|
|
274
312
|
| **TypeScript 5 / 6 / 7 support** | [docs/typescript-support.md](docs/typescript-support.md) |
|
|
275
313
|
| Migrate from `ark-runtime-kernel` | [docs/migrate-from-ark-runtime-kernel.md](docs/migrate-from-ark-runtime-kernel.md) |
|
|
@@ -277,6 +315,7 @@ for real systems. Details: [docs/production-hardening.md](docs/production-harden
|
|
|
277
315
|
| Agent / MCP tools | [docs/agent-guide.md](docs/agent-guide.md) |
|
|
278
316
|
| Demos | [docs/demos/](docs/demos/) |
|
|
279
317
|
| Examples | [examples/](examples/README.md) |
|
|
318
|
+
| Release 3.0.0 | [release notes and publication checklist](docs/releases/3.0.0.md) |
|
|
280
319
|
| Roadmap | [ROADMAP.md](ROADMAP.md) · [Changelog](CHANGELOG.md) |
|
|
281
320
|
|
|
282
321
|
---
|
|
@@ -290,11 +329,11 @@ npm run typecheck
|
|
|
290
329
|
npm run check:architecture # Ark gates itself
|
|
291
330
|
```
|
|
292
331
|
|
|
293
|
-
**Website:** [arkgate.online](https://www.arkgate.online/)
|
|
294
|
-
**npm:** [`arkgate`](https://www.npmjs.com/package/arkgate) · formerly `ark-runtime-kernel`
|
|
295
|
-
**Product:** **ArkGate** — architecture co-pilot / gate for AI TypeScript (not a runtime kernel).
|
|
296
|
-
CLI: `arkgate` · `arkgate-check` · `arkgate-mcp` (aliases `ark` / `ark-check` / `ark-mcp` still work for one major).
|
|
297
|
-
MCP registry: `io.github.pedroknigge/arkgate`.
|
|
332
|
+
**Website:** [arkgate.online](https://www.arkgate.online/)
|
|
333
|
+
**npm:** [`arkgate`](https://www.npmjs.com/package/arkgate) · formerly `ark-runtime-kernel`
|
|
334
|
+
**Product:** **ArkGate** — architecture co-pilot / gate for AI TypeScript (not a runtime kernel).
|
|
335
|
+
CLI: `arkgate` · `arkgate-check` · `arkgate-mcp` (aliases `ark` / `ark-check` / `ark-mcp` still work for one major).
|
|
336
|
+
MCP registry: `io.github.pedroknigge/arkgate`.
|
|
298
337
|
**Source:** [github.com/pedroknigge/arkgate](https://github.com/pedroknigge/arkgate)
|
|
299
338
|
|
|
300
339
|
Node ≥ 18 · **MIT**.
|