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.
Files changed (88) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/README.md +90 -51
  3. package/bin/ark-check.mjs +156 -39
  4. package/bin/ark-mcp.mjs +119 -6
  5. package/bin/ark-shared.mjs +216 -129
  6. package/bin/ark.mjs +134 -34
  7. package/bin/lib/adapter-contract.mjs +93 -0
  8. package/bin/lib/agent-gates.mjs +13 -0
  9. package/bin/lib/analysis-engine.mjs +1171 -0
  10. package/bin/lib/architecture-scan.mjs +84 -127
  11. package/bin/lib/ci-and-commands.mjs +40 -3
  12. package/bin/lib/codex-home.mjs +7 -0
  13. package/bin/lib/config-contract.mjs +331 -0
  14. package/bin/lib/config-warnings.mjs +7 -205
  15. package/bin/lib/doctor-plan.mjs +43 -16
  16. package/bin/lib/enforcement-profiles.mjs +97 -0
  17. package/bin/lib/field-install.mjs +67 -10
  18. package/bin/lib/gate-files.mjs +42 -3
  19. package/bin/lib/graph-cycles.mjs +4 -54
  20. package/bin/lib/hook-templates.mjs +33 -1
  21. package/bin/lib/host-support-matrix.mjs +83 -0
  22. package/bin/lib/install-migrate.mjs +99 -30
  23. package/bin/lib/mcp-adoption.mjs +35 -3
  24. package/bin/lib/open-html.mjs +75 -0
  25. package/bin/lib/presets.mjs +45 -4
  26. package/bin/lib/safety-diagnostics.mjs +36 -15
  27. package/bin/lib/scan-files.mjs +12 -1
  28. package/bin/lib/skill-install.mjs +72 -1
  29. package/bin/lib/source-policy.mjs +36 -0
  30. package/bin/lib/start-preview.mjs +271 -0
  31. package/bin/lib/ts-resolve.mjs +13 -3
  32. package/bin/lib/weakest-link.mjs +417 -0
  33. package/bin/lib/write-path-capabilities.mjs +186 -0
  34. package/bin/lib/write-path-detect.mjs +62 -99
  35. package/compat/nestjs.cjs +2 -0
  36. package/compat/nestjs.d.ts +2 -0
  37. package/compat/nestjs.js +1 -0
  38. package/compat/runtime.cjs +2 -0
  39. package/compat/runtime.d.ts +2 -0
  40. package/compat/runtime.js +1 -0
  41. package/dist/configContract-BxSIwVRo.d.cts +259 -0
  42. package/dist/configContract-BxSIwVRo.d.ts +259 -0
  43. package/dist/eslint/index.cjs +500 -61
  44. package/dist/eslint/index.d.cts +36 -20
  45. package/dist/eslint/index.d.ts +36 -20
  46. package/dist/eslint/index.js +500 -61
  47. package/dist/index.cjs +1349 -2741
  48. package/dist/index.d.cts +449 -483
  49. package/dist/index.d.ts +449 -483
  50. package/dist/index.js +1325 -2687
  51. package/docs/agent-guide.md +58 -34
  52. package/docs/ai-gates.md +79 -21
  53. package/docs/configuration.md +97 -0
  54. package/docs/enthusiast/README.md +3 -3
  55. package/docs/enthusiast/how-to-agent-gates.md +7 -3
  56. package/docs/migrate-from-ark-runtime-kernel.md +5 -3
  57. package/docs/package-surface.md +19 -19
  58. package/docs/production-hardening.md +31 -5
  59. package/docs/threat-model.md +65 -0
  60. package/docs/typescript-support.md +30 -3
  61. package/package.json +46 -11
  62. package/schemas/ark.analysis-result.schema.json +91 -0
  63. package/schemas/ark.config.schema.json +750 -0
  64. package/server.json +2 -2
  65. package/templates/hooks/pre-commit-ark +37 -0
  66. package/templates/skills/ark-architect.md +3 -2
  67. package/templates/skills/ark-coverage.md +2 -2
  68. package/templates/skills/ark-runtime.md +8 -5
  69. package/templates/skills/ark-upgrade.md +36 -16
  70. package/tests/fixtures/ts-consumer/ark.config.json +2 -0
  71. package/dist/eslint/index.cjs.map +0 -1
  72. package/dist/eslint/index.js.map +0 -1
  73. package/dist/index.cjs.map +0 -1
  74. package/dist/index.js.map +0 -1
  75. package/dist/nestjs/index.cjs +0 -2498
  76. package/dist/nestjs/index.cjs.map +0 -1
  77. package/dist/nestjs/index.d.cts +0 -22
  78. package/dist/nestjs/index.d.ts +0 -22
  79. package/dist/nestjs/index.js +0 -2474
  80. package/dist/nestjs/index.js.map +0 -1
  81. package/dist/runtime/index.cjs +0 -3352
  82. package/dist/runtime/index.cjs.map +0 -1
  83. package/dist/runtime/index.d.cts +0 -2
  84. package/dist/runtime/index.d.ts +0 -2
  85. package/dist/runtime/index.js +0 -3270
  86. package/dist/runtime/index.js.map +0 -1
  87. package/dist/types-BZ17b9i5.d.cts +0 -1068
  88. 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 ← walk tree contract **day-zero origin** → gates
27
- 2. /ark-autopilot ← explore first, dual plan, safe fixes, leave gates on
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. Agents that are unsure should **only** run `/ark-autopilot` (or the three
40
- commands above).
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 in two places
47
- you always care about:
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** | `arkgate-mcp` write gate (blocks bad edits) |
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 event/intent governance.
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` → `/ark-autopilot`**.
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 | Stay on autopilot until doctor is happy |
69
- | Tech lead on a messy monorepo | Autopilot (or deeper `/ark-adopt` if you want a focused brownfield pass) |
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** | Gates can honestly protect you | Build features; fix with `/ark-fix` if blocked |
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 # contract → day-zero origin gates + plan
110
- # in agent:
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, then **day-zero origin**, then gates).
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
- **Default is always `/ark-autopilot`.** The rest are escapes, not a second curriculum.
150
- Generated `AGENTS.md` includes a **skill routing table** (trigger → skill). Skills are
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; never silent
159
- write). See [docs/ai-gates.md](docs/ai-gates.md).
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
- | Migrate hand-rolled bus/outbox (TS) | `/ark-runtime` |
174
- | Bump ArkGate + refresh all agent hosts | `/ark-upgrade` |
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 gate (arkgate-mcp) — agent PreToolUse / MCP tools
186
- ├─► CI gate (arkgate-check) PR / main
187
- └─► Runtime kernel (opt-in) — only if you call it
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:** skills install into Claude / Cursor / Codex / Grok; `ark start` freezes **day-zero origin** under `.ark/reports/` **before** agent docs/CI templates.
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, required CI/MCP/write gates,
196
- PreToolUse hook presence, and bypass diagnostics for dynamic imports, TypeScript suppressions,
197
- explicit `any` casts, InMemory runtime defaults, and disabled peer isolation.
198
- - **Trust / coverage (2.12):** package unit-test floors on the broad product surface
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). Explore dual-plan + day-zero origin first (see above). Roadmap next: Q2 repair dogfood matrix.
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
- | Block **AI writes** before they land | ✅ | ❌ |
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 setup: contract → origin → gates → plan
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 + Adoption card + origin/latest
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: runtime kernel
279
+ ## Optional experimental runtime kernel
243
280
 
244
- Gates need **no app code changes**. If you also want runtime intent/event contracts,
245
- use the **opt-in** subpath (preferred):
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
- Root `import { } from 'arkgate'` still re-exports kernel symbols for compatibility
253
- in this major; prefer `arkgate/runtime` for new code.
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: `arkgate/nestjs` (optional peer `@nestjs/common`).
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 (`InMemoryOutboxStore`, `InMemoryAuditStore`,
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 opt-in)** | [docs/package-surface.md](docs/package-surface.md) |
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**.