arkgate 3.8.3 → 3.9.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 +63 -0
- package/README.md +94 -345
- package/bin/ark-mcp-runtime.mjs +137 -11
- package/bin/lib/agent-gates.mjs +4 -0
- package/bin/lib/ci-and-commands.mjs +28 -21
- package/bin/lib/doctor-plan.mjs +37 -28
- package/bin/lib/hook-templates.mjs +13 -9
- package/bin/lib/host-support-matrix.mjs +64 -4
- package/bin/lib/install-migrate.mjs +92 -0
- package/bin/lib/managed-upgrade.mjs +2 -0
- package/bin/lib/mcp-adoption.mjs +60 -2
- package/bin/lib/post-green-path.mjs +2 -2
- package/bin/lib/skill-install.mjs +46 -2
- package/bin/lib/start-preview.mjs +13 -1
- package/bin/lib/write-path-capabilities.mjs +67 -18
- package/bin/lib/write-path-detect.mjs +11 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/README.md +70 -0
- package/docs/agent-guide.md +59 -17
- package/docs/ai-gates.md +97 -11
- package/docs/develop.md +127 -0
- package/docs/enthusiast/README.md +2 -0
- package/docs/package-surface.md +3 -3
- package/docs/product-voice.md +194 -0
- package/docs/use.md +88 -0
- package/package.json +5 -1
- package/server.json +2 -2
- package/templates/hooks/opencode-ark-write-gate.mjs +85 -0
- package/templates/skills/ark-autopilot.md +20 -7
- package/templates/skills/ark-explore.md +17 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,69 @@ in the immutable pre-2.0 archive linked below.
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
+
## 3.9.0 — 2026-07-23
|
|
9
|
+
|
|
10
|
+
**Beautiful Path** minor: one primary flow, doctor as control plane, progressive disclosure, and
|
|
11
|
+
senior-grade product voice — plus residual beauty, write-path honesty, Shape coach depth, and
|
|
12
|
+
field-claim scaffolding. **No required config migration.** Does not weaken write gate or CI.
|
|
13
|
+
Z09 / residual `RB-11` remain open (longitudinal claim gate; field kit is scaffolding only).
|
|
14
|
+
Not a rewrite of the analysis engine. No plan-B silent codemod. No fake hard write on Cursor/Codex.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **Product voice canon:** `docs/product-voice.md` — lexicon (including **design-weak** / **residual**
|
|
19
|
+
/ hard vs advisory write), **Do** table, doctor/deny microcopy models, progressive-disclosure rule.
|
|
20
|
+
Linked from README and Agents knowledge map.
|
|
21
|
+
- **Field program kit (not closed):** `docs/field/` — Z09 preregistration template, cohort D30/D90
|
|
22
|
+
checklist, independent-reviewer manifesto + open signed-identity decision. Explicit **status: not
|
|
23
|
+
closed**; does not invent adopter counts or close `RB-11` / C-028 residual.
|
|
24
|
+
- **Release notes:** `docs/releases/3.9.0.md`.
|
|
25
|
+
- **Docs information architecture:** three public lanes — [docs/use.md](docs/use.md) (anyone),
|
|
26
|
+
[docs/develop.md](docs/develop.md) (integrate), [CONTRIBUTING.md](CONTRIBUTING.md) (library);
|
|
27
|
+
hub [docs/README.md](docs/README.md); history under [docs/archive/](docs/archive/README.md).
|
|
28
|
+
Historical release notes and epic plans remain in-repo but are not the product front door.
|
|
29
|
+
- **Maintainer workflow:** `.grok/workflows/product-beauty-audit.rhai` — read-only parallel audit of
|
|
30
|
+
product surfaces against product-voice criteria (report-only by default).
|
|
31
|
+
- **Host enforcement expansion (prepared, not npm-published as a separate release):**
|
|
32
|
+
- **Google Antigravity** (`antigravity` / alias `agy`): `.agents/hooks.json` PreToolUse install,
|
|
33
|
+
`ark-mcp --hook` adapter for `toolCall` + write tools (`write_to_file`,
|
|
34
|
+
`replace_file_content`, `multi_replace_file_content`), doctor inventory, hard-write when
|
|
35
|
+
installed + trusted (same ladder as Claude/Grok).
|
|
36
|
+
- **OpenCode** (`opencode`): merge/write `opencode.json` MCP (`type: local`), advisory-only
|
|
37
|
+
write path, optional experimental plugin template
|
|
38
|
+
`templates/hooks/opencode-ark-write-gate.mjs` (never claimed hard).
|
|
39
|
+
- Canonical host matrix + README/`docs/ai-gates.md` honesty rows updated.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **README first-run narrative:** one door (`start` → doctor → optional `/ark-autopilot`); skills
|
|
44
|
+
section reframed as expert escapes, not a second curriculum; status lights language tightened;
|
|
45
|
+
host matrix states **required CI status** as the merge hard boundary and labels
|
|
46
|
+
Cursor/Codex/OpenCode advisory at write (Antigravity hard when covered).
|
|
47
|
+
- **Compact router** (`compactAgentInstructions`): primary path = doctor + place/validate/check;
|
|
48
|
+
full `/ark-*` pack documented as optional expert depth with install command.
|
|
49
|
+
- **Doctor human surface:** status-light copy matches product voice; top block is **Primary next
|
|
50
|
+
action** (#1) plus optional **Also** list; design-weak mode uses warn `!` (not green `✓`);
|
|
51
|
+
edge-clean under design-weak no longer claims absolute “matches the contract”; New-here primary
|
|
52
|
+
is finish `start` → doctor (not a competing recommend/architect curriculum); Cursor/Codex write
|
|
53
|
+
path lines state advisory + required CI. JSON ids (`postGreenPath`, `primaryNextAction`,
|
|
54
|
+
`clarify-for-ai`) unchanged.
|
|
55
|
+
- **Post-green primary action string:** senior-grade Shape residual wording; same skill chain.
|
|
56
|
+
- **Agent install messaging:** install-agent-gates prints compact vs expert-skill-pack profile hints.
|
|
57
|
+
- **Skill frontmatter / mode tables:** `/ark-autopilot` = guided end-to-end; ranks **Enforce ·
|
|
58
|
+
design-weak** Shape door; `/ark-explore` = specialized map / post-green door with status-light
|
|
59
|
+
table and smell-envelope honesty (absence ≠ full-tree proof).
|
|
60
|
+
- **Agent guide / AI gates / package surface:** default path and host write honesty aligned; design
|
|
61
|
+
smell envelope documented; no “default = full skill pack.”
|
|
62
|
+
|
|
63
|
+
### Tests
|
|
64
|
+
|
|
65
|
+
- `q01PostGreenPath` — primary-action wording, design-weak mode mark `!`, no absolute contract-match
|
|
66
|
+
under residual.
|
|
67
|
+
- `skillsSurface` — autopilot/explore Shape door ranking; compact router progressive disclosure.
|
|
68
|
+
- `q06ReleaseSurfaces` — 3.9.0 notes, product-voice Do/lexicon, field kit not-closed.
|
|
69
|
+
- Compact-start / adoption-gaps / codex residual honesty expectations updated for voice.
|
|
70
|
+
|
|
8
71
|
## 3.8.3 — 2026-07-22
|
|
9
72
|
|
|
10
73
|
Corrective **patch** over 3.8.2 from multi-repo field evidence (PROPIA pnpm workspace upgrade;
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**One contract. One gate. One co-pilot.**
|
|
6
6
|
|
|
7
|
-
Your AI writes most of the code. ArkGate keeps that
|
|
7
|
+
Your AI writes most of the code. ArkGate keeps that work inside an architecture you can trust —
|
|
8
8
|
and makes sure a “green” check means something real.
|
|
9
9
|
|
|
10
10
|
[](https://www.arkgate.online/)
|
|
@@ -16,395 +16,150 @@ and makes sure a “green” check means something real.
|
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
-
> **ArkGate 3.
|
|
20
|
-
>
|
|
21
|
-
> [Release notes](
|
|
22
|
-
|
|
23
|
-
> **TypeScript 7 distribution note:** ArkGate prefers a usable project compiler API, then its
|
|
24
|
-
> exact, physically distinct TypeScript 6 analysis host. Analysis reports required
|
|
25
|
-
> `complete | partial | unavailable` status; incomplete results cannot look green. See the
|
|
26
|
-
> [exact boundary](docs/typescript-support.md).
|
|
19
|
+
> **ArkGate 3.9.0** is the next prepared release (**Beautiful Path**). **npm `latest` is still
|
|
20
|
+
> 3.8.3** until publication succeeds.
|
|
21
|
+
> [Release notes](docs/releases/3.9.0.md) · [Docs hub](docs/README.md) · [Product voice](docs/product-voice.md)
|
|
27
22
|
|
|
28
23
|
---
|
|
29
24
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
If you remember nothing else:
|
|
33
|
-
|
|
34
|
-
```text
|
|
35
|
-
1. npx arkgate start ← read-only preview: files + commands + projected coverage
|
|
36
|
-
npx arkgate start --apply ← apply exactly the previewed mutations
|
|
37
|
-
2. Compact router ← MCP/AGENTS routes place, validate, and architecture checks
|
|
38
|
-
/ark-autopilot ← optional full guided workflow after its skill pack is installed
|
|
39
|
-
3. npx arkgate-check --doctor ← “where am I?” anytime (one status screen)
|
|
40
|
-
```
|
|
25
|
+
## Choose your path
|
|
41
26
|
|
|
42
|
-
|
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| **Messy / spaghetti code** (even if the gate is green) | **`/ark-explore`** then **`/ark-autopilot`** — [below](#less-spaghetti-after-the-gate-is-green) |
|
|
48
|
-
| New ArkGate version | `/ark-upgrade` |
|
|
27
|
+
| You are… | Go here |
|
|
28
|
+
|----------|---------|
|
|
29
|
+
| **Anyone** (ship with AI, minimal jargon) | **[Use ArkGate](docs/use.md)** |
|
|
30
|
+
| **Developer** (hosts, CI, config, brownfield) | **[Develop with ArkGate](docs/develop.md)** |
|
|
31
|
+
| **Contributor** (improve this library) | **[CONTRIBUTING](CONTRIBUTING.md)** |
|
|
49
32
|
|
|
50
|
-
|
|
51
|
-
kernel to get value. The compact router is enough for normal work; install `/ark-autopilot` only
|
|
52
|
-
when you want the full guided workflow.
|
|
33
|
+
Full map: **[docs/README.md](docs/README.md)**
|
|
53
34
|
|
|
54
35
|
---
|
|
55
36
|
|
|
56
|
-
##
|
|
37
|
+
## Start in one minute
|
|
57
38
|
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
```bash
|
|
40
|
+
npm install -D arkgate typescript
|
|
41
|
+
npx arkgate start # preview files + commands
|
|
42
|
+
npx arkgate start --apply # compact contract + host router + CI plan
|
|
43
|
+
npx arkgate-check --doctor # control plane: status light + primary next action
|
|
44
|
+
```
|
|
60
45
|
|
|
61
|
-
|
|
62
|
-
It is not affiliated with the separate Archgate CLI project.
|
|
46
|
+
That is the product. Doctor is the control plane — when stuck, do **primary next action #1**.
|
|
63
47
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Optional later: the **experimental** runtime kernel (`createArkKernel`) if you want to evaluate
|
|
70
|
-
event/intent governance. It is not required for gate adoption.
|
|
48
|
+
```text
|
|
49
|
+
start → doctor → day-to-day (place + gate)
|
|
50
|
+
↘ optional /ark-autopilot after skill pack
|
|
51
|
+
```
|
|
71
52
|
|
|
72
|
-
|
|
53
|
+
Aliases `ark` / `ark-check` / `ark-mcp` still work. npm / pnpm / yarn. No install lifecycle scripts.
|
|
73
54
|
|
|
74
55
|

|
|
75
56
|
|
|
76
57
|
---
|
|
77
58
|
|
|
78
|
-
##
|
|
59
|
+
## What it is
|
|
79
60
|
|
|
80
|
-
|
|
81
|
-
`/ark-autopilot` when you opt into the full skill pack).
|
|
61
|
+
A machine-readable architecture file (`ark.config.json`) plus enforcement:
|
|
82
62
|
|
|
83
|
-
|
|
|
84
|
-
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
| Power user | Same flow; use `ark-check --plan` / `--coverage` when you want the raw sensor |
|
|
63
|
+
| When | Tool |
|
|
64
|
+
|------|------|
|
|
65
|
+
| **While the AI writes** | Hard PreToolUse on supported hosts; advisory MCP elsewhere |
|
|
66
|
+
| **Before merge** | `arkgate-check` as a **required** CI status |
|
|
88
67
|
|
|
89
|
-
**Not
|
|
68
|
+
**Not** a web framework, ORM, or job runner. Optional experimental runtime is separate and not required for the gate.
|
|
90
69
|
|
|
91
|
-
|
|
70
|
+
**Name note:** npm package `arkgate` — not affiliated with the separate Archgate CLI project.
|
|
92
71
|
|
|
93
|
-
|
|
72
|
+
---
|
|
94
73
|
|
|
95
|
-
|
|
96
|
-
mode you configure:
|
|
74
|
+
## Status lights (not settings)
|
|
97
75
|
|
|
98
76
|
| Light | Means | Your move |
|
|
99
77
|
|-------|--------|-----------|
|
|
100
|
-
| **Suggest** |
|
|
101
|
-
| **Adapt** | Not fully protected
|
|
102
|
-
| **Enforce** |
|
|
103
|
-
| **Enforce · design-weak** | Edges clean
|
|
104
|
-
|
|
105
|
-
You **arrive** at Enforce. You never “turn on Enforce”.
|
|
106
|
-
**Enforce does not mean the design is elegant** — only that the contract’s import edges are honest.
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Less spaghetti after the gate is green
|
|
111
|
-
|
|
112
|
-
A green check can still leave god modules, SQL in routes, and three patterns at once.
|
|
113
|
-
That residual is **Shape** work — plan **B**, never auto-applied as mechanical-safe.
|
|
114
|
-
|
|
115
|
-
```text
|
|
116
|
-
1. /ark-explore ← map + dual-plan B + extraction cards (no apply)
|
|
117
|
-
2. /ark-autopilot ← apply A (edges); B only with your ok, one pilot at a time
|
|
118
|
-
3. npx arkgate-check --doctor
|
|
119
|
-
npx arkgate-check --plan --json ← designWeak + patternBets when residual remains
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
| If… | Skill |
|
|
123
|
-
|-----|--------|
|
|
124
|
-
| Need the map / “what’s the golden pattern?” | `/ark-explore` |
|
|
125
|
-
| Ready to execute the dual plan | `/ark-autopilot` |
|
|
126
|
-
| Contract still lies (false-green, wrong globs) | `/ark-adopt` first, then explore |
|
|
127
|
-
| One cluster only | `/ark-fix` (+ extraction card) |
|
|
128
|
-
| Only care about governed% / gates installed | `/ark-coverage` (not the Shape map) |
|
|
129
|
-
|
|
130
|
-
Phases: **Align** (honest contract) → **Stabilize** (real baseline) → **Shape** (golden pattern + pilot).
|
|
131
|
-
Details: [docs/brownfield-adoption.md](docs/brownfield-adoption.md) §6 · skills install: `npx arkgate-check --install-agent-gates`.
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## Upgrading from `ark-runtime-kernel`?
|
|
136
|
-
|
|
137
|
-
**Same product**, new package name. Config and `/ark-*` skills stay.
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
npm uninstall ark-runtime-kernel && npm install -D arkgate
|
|
141
|
-
npx arkgate-check --install-agent-gates --force
|
|
142
|
-
npx arkgate-check --doctor
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Full checklist (CI, MCP, Codex, imports): **[migrate-from-ark-runtime-kernel.md](https://github.com/pedroknigge/arkgate/blob/main/docs/migrate-from-ark-runtime-kernel.md)**.
|
|
78
|
+
| **Suggest** | Thin / new tree | Finish `start` → doctor |
|
|
79
|
+
| **Adapt** | Not fully protected | Doctor action #1 |
|
|
80
|
+
| **Enforce** | Honest edges under the contract | Keep write path + CI |
|
|
81
|
+
| **Enforce · design-weak** | Edges clean; design residual remains | Shape residual — not “done” |
|
|
146
82
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
## Start in one minute
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
npm install -D arkgate typescript
|
|
153
|
-
npx arkgate start # read-only preview: exact mutations + projected coverage
|
|
154
|
-
npx arkgate start --apply # apply the compact contract → active-host router → CI plan
|
|
155
|
-
# optional, after installing the full skill pack:
|
|
156
|
-
# /ark-autopilot
|
|
157
|
-
npx arkgate-check --doctor # status light + next action
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Aliases `ark` / `ark-check` / `ark-mcp` still work. **npm / pnpm / yarn**. No install lifecycle scripts.
|
|
161
|
-
|
|
162
|
-
<details>
|
|
163
|
-
<summary>What <code>/ark-autopilot</code> does under the hood (optional detail)</summary>
|
|
164
|
-
|
|
165
|
-
1. Setup if needed (`ark start` previews; review, then `ark start --apply`).
|
|
166
|
-
2. **Explore pass** (decision-grade map of *this* product; field path when demos exist).
|
|
167
|
-
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.
|
|
168
|
-
4. Apply A → re-check; judgment only when you ask for full apply.
|
|
169
|
-
5. Gates on + latest report (evolution vs frozen origin).
|
|
170
|
-
|
|
171
|
-
Standalone recon without applying: `/ark-explore`.
|
|
172
|
-
|
|
173
|
-
</details>
|
|
174
|
-
|
|
175
|
-
<details>
|
|
176
|
-
<summary>Manual / power-user CLI only</summary>
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
npx arkgate init
|
|
180
|
-
npx arkgate-check
|
|
181
|
-
npx arkgate-check --plan
|
|
182
|
-
npx arkgate-check --coverage
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
</details>
|
|
83
|
+
Details: [docs/use.md](docs/use.md).
|
|
186
84
|
|
|
187
85
|
---
|
|
188
86
|
|
|
189
|
-
##
|
|
190
|
-
|
|
191
|
-
Install once: `npx arkgate-check --install-agent-gates`
|
|
192
|
-
(`--tools claude,cursor,codex,grok` to pick hosts.)
|
|
193
|
-
|
|
194
|
-
**The compact router is the default; `/ark-autopilot` is the full guided option.** The rest are
|
|
195
|
-
escapes, not a second curriculum. Full-install `AGENTS.md` includes a **skill routing table**
|
|
196
|
-
(trigger → skill). Skills are
|
|
197
|
-
**dual-engine** (CLI sensor + read real source) and end with a fixed **completion contract**;
|
|
198
|
-
critical handoffs say **STOP** and name the next skill (hosts must follow — markdown cannot chain calls).
|
|
199
|
-
When the host allows it, skills may **fan out parallel subagents** (disjoint scopes);
|
|
200
|
-
otherwise they **fall back to sequential**.
|
|
201
|
-
|
|
202
|
-
**Write path (Track W):** Prefer MCP **`ark_prepare_write`** when you have a snippet (place +
|
|
203
|
-
constrain + validate + optional `autoPatch` + `judgmentBrief`). PreToolUse hooks with
|
|
204
|
-
`--hook-repair` on Claude/Grok emit machine-readable repair payloads on deny (still hard block;
|
|
205
|
-
never silent write). Cursor/Codex MCP calls remain advisory. See
|
|
206
|
-
[docs/ai-gates.md](docs/ai-gates.md).
|
|
207
|
-
|
|
208
|
-
For a complete multi-file architecture-source candidate, use MCP **`ark_prepare_change`** or
|
|
209
|
-
`ark preflight --changes change-set.json --json`. Creates, updates, and deletes are evaluated as
|
|
210
|
-
one read-only graph, so an edge or cycle that appears only across the batch is rejected before any
|
|
211
|
-
project file is written. With `--change-map map.json` (or MCP `changeMap`), the same verdict also
|
|
212
|
-
classifies planned structure as satisfied, missing, contradictory, or unplanned. This is structural
|
|
213
|
-
convergence only: behavioral completion is always reported as not evaluated.
|
|
214
|
-
|
|
215
|
-
ArkGate 3.8.0 closes the former compiler-free atomic-path divergence with versioned
|
|
216
|
-
resolved-candidate facts and a differential adapter corpus, including `tsconfig` aliases and
|
|
217
|
-
workspace edges. Strict CI remains the final merge boundary; lexical/single-snippet feedback is
|
|
218
|
-
explicitly partial and non-green.
|
|
219
|
-
|
|
220
|
-
Every blocking diagnostic carries stable rule/location/evidence fields plus one deterministic
|
|
221
|
-
`nextAction`; human CLI/hook text prints that same action. A complete Codex `ApplyPatch` payload is
|
|
222
|
-
reconstructed and sent through the same atomic engine before per-file safety checks. Codex remains
|
|
223
|
-
honestly bypassable/advisory because not every Code Mode write dispatches the project hook. The
|
|
224
|
-
verdict depends only on the explicit contract and candidate—not `AGENTS.md`, skills, injected prose,
|
|
225
|
-
or an LLM.
|
|
226
|
-
|
|
227
|
-
| Need | Skill | Not |
|
|
228
|
-
|------|--------|-----|
|
|
229
|
-
| Only the apply loop for plan **A** (edges) | `/ark-loop` | empty A + design residual → explore |
|
|
230
|
-
| Empty greenfield shape/scaffold | `/ark-architect` | brownfield → adopt |
|
|
231
|
-
| Brownfield contract match / baseline / manifest | `/ark-adopt` | map-only → explore |
|
|
232
|
-
| Map / dual-plan **seed** / spaghetti Shape plan (no apply) | `/ark-explore` | fitness-only → coverage |
|
|
233
|
-
| New file placement | `/ark-place` | — |
|
|
234
|
-
| Gate violation on a change | `/ark-fix` | bulk → loop/autopilot |
|
|
235
|
-
| One design decision (2–3 options) | `/ark-think` | full dual-plan → explore |
|
|
236
|
-
| Edit `ark.config.json` safely | `/ark-contract` | — |
|
|
237
|
-
| Plain-language tour / HTML report | `/ark-explain` | recon → explore |
|
|
238
|
-
| Ark **fitness** (governed%, gates, install gaps) | `/ark-coverage` | full recon → explore |
|
|
239
|
-
| Evaluate experimental runtime | `/ark-runtime` | — |
|
|
240
|
-
| Bump ArkGate + refresh active host | `/ark-upgrade` | — |
|
|
241
|
-
|
|
242
|
-
Brownfield phases: **Align** (honest contract) → **Stabilize** (real baseline) → **Shape** (golden pattern + pilot). ENFORCE with empty plan A can still be **design-weak** — that residual is explore/autopilot **B**, not “done.”
|
|
243
|
-
|
|
244
|
-
### Host enforcement support
|
|
87
|
+
## Host enforcement support
|
|
245
88
|
|
|
246
89
|
<!-- arkgate-host-support:start -->
|
|
247
90
|
| Host | Local write boundary | MCP validation | CI / merge path | Repair payload |
|
|
248
91
|
|------|----------------------|----------------|-----------------|----------------|
|
|
249
|
-
| Claude Code | Hard block for PreToolUse `Write` / `Edit` / `MultiEdit` | Advisory; the agent must call it |
|
|
250
|
-
| Grok Build | Hard block for PreToolUse `write` / `search_replace` (plus aliases) | Advisory; the agent must call it |
|
|
251
|
-
|
|
|
252
|
-
|
|
|
92
|
+
| Claude Code | **Hard** block for listed ops (PreToolUse `Write` / `Edit` / `MultiEdit`) when installed + trusted | Advisory; the agent must call it | **Required status** = hard merge boundary (`arkgate-check --strict-merge`) | Emitted on hook deny; host must re-inject |
|
|
93
|
+
| Grok Build | **Hard** block for listed ops (PreToolUse `write` / `search_replace` (plus aliases)) when installed + trusted | Advisory; the agent must call it | **Required status** = hard merge boundary (`arkgate-check --strict-merge`) | Emitted on hook deny; host must re-inject |
|
|
94
|
+
| Google Antigravity | **Hard** block for listed ops (PreToolUse `write_to_file` / `replace_file_content` / `multi_replace_file_content`) when installed + trusted | Advisory; the agent must call it | **Required status** = hard merge boundary (`arkgate-check --strict-merge`) | Emitted on hook deny; host must re-inject |
|
|
95
|
+
| Cursor | **Advisory only** at write (no hard hook) | Advisory; the agent must call it | **Required status** = hard merge boundary (same CI) | No hard-boundary payload |
|
|
96
|
+
| OpenAI Codex | **Advisory / best-effort** at write (not equivalent to Claude/Grok hard block) | Advisory; the agent must call it | **Required status** = hard merge boundary (same CI) | No hard-boundary payload |
|
|
97
|
+
| OpenCode | **Advisory / best-effort** at write (MCP + optional plugin; not a hard boundary) | Advisory; the agent must call it | **Required status** = hard merge boundary (same CI) | No hard-boundary payload |
|
|
98
|
+
|
|
99
|
+
**Read the CI column:** for every host, the repository-wide hard guarantee is a **required**
|
|
100
|
+
merge check — not “CI file present.” Cursor/Codex/OpenCode never get a fake hard write claim.
|
|
253
101
|
|
|
254
102
|
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.
|
|
255
103
|
<!-- arkgate-host-support:end -->
|
|
256
104
|
|
|
257
|
-
Assets stay non-hard without fresh covered-operation evidence; MCP stays advisory.
|
|
258
|
-
|
|
259
105
|
#### Why the hard guarantee lives at the merge gate
|
|
260
106
|
|
|
261
107
|
The split above is a deliberate trade-off, not a gap. ArkGate validates at the earliest boundary
|
|
262
108
|
each host offers and enforces at the earliest boundary a repository can make non-bypassable: the
|
|
263
|
-
required merge status. Hard hooks (Claude Code, Grok Build) deny the listed
|
|
264
|
-
write time; advisory surfaces (MCP, rules) coach the agent
|
|
265
|
-
can be routed around — another tool, a direct filesystem
|
|
266
|
-
guarantee ArkGate claims for every path is the
|
|
267
|
-
the repository makes that status required.
|
|
268
|
-
owns correctness.
|
|
109
|
+
required merge status. Hard hooks (Claude Code, Grok Build, Google Antigravity) deny the listed
|
|
110
|
+
write operations at write time; advisory surfaces (MCP, rules, OpenCode plugins) coach the agent
|
|
111
|
+
while it works. But any local boundary can be routed around — another tool, a direct filesystem
|
|
112
|
+
write, a human edit — so the only guarantee ArkGate claims for every path is the
|
|
113
|
+
`arkgate-check --strict-merge` check, and only when the repository makes that status required.
|
|
114
|
+
Local checks optimize feedback speed; the merge gate owns correctness.
|
|
269
115
|
|
|
270
116
|
A useful consequence: the contract doubles as a pressure sensor. Recurring violations or baseline
|
|
271
117
|
exceptions concentrated on one layer edge are evidence that the current design stopped fitting the
|
|
272
118
|
code — a reason to reshape the contract deliberately (start with `/ark-explore`), never to weaken
|
|
273
119
|
the gate.
|
|
274
120
|
|
|
275
|
-
|
|
121
|
+
Setup per host: [docs/ai-gates.md](docs/ai-gates.md) · Develop path: [docs/develop.md](docs/develop.md)
|
|
276
122
|
|
|
277
123
|
---
|
|
278
124
|
|
|
279
|
-
##
|
|
280
|
-
|
|
281
|
-
```
|
|
282
|
-
ark.config.json
|
|
283
|
-
│
|
|
284
|
-
├─► Write path (arkgate-mcp) — hard hook or advisory MCP, by host
|
|
285
|
-
├─► CI check (arkgate-check) — merge block only when status is required
|
|
286
|
-
└─► Runtime kernel — experimental opt-in; gates do not need it
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
- **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.
|
|
290
|
-
- **Versioned config:** generated contracts include `$schema` + `schemaVersion`; CLI, MCP, and
|
|
291
|
-
ESLint validate through the same loader. Unknown keys fail with their JSON path. Strict merge
|
|
292
|
-
also compares the contract transition and blocks unacknowledged weakening with hashes and stable
|
|
293
|
-
finding ids. See the [configuration and editor guide](docs/configuration.md).
|
|
294
|
-
- **Frameworks:** Nest / Next / express / library layouts get sensible globs on init so day-one coverage is real.
|
|
295
|
-
- **Brownfield:** baseline ratchet, refuse to freeze a wrong contract, `/ark-adopt` for mature trees.
|
|
296
|
-
- **Agents:** `ark start` previews one compact active-host router (≤5 files / 25 KB); `--apply`
|
|
297
|
-
writes those exact bytes. Full skills remain explicit via `--install-agent-gates --skills-only`;
|
|
298
|
-
reports remain opt-in via `ark-check --report`.
|
|
299
|
-
- **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.
|
|
300
|
-
- **Enforcement state:** doctor JSON exposes schema-backed `writePath.enforcementState` with
|
|
301
|
-
separate analyzed, configured, installed, runtime-observed, operation-coverage, active,
|
|
302
|
-
bypassable, required, and hard evidence for local write, advisory MCP, and CI merge boundaries.
|
|
303
|
-
Provider-unavailable required status remains `unverified`; local workflow text never proves
|
|
304
|
-
branch protection. The older
|
|
305
|
-
`enforcementLadder` projection remains for compatibility.
|
|
306
|
-
- **Opt-in design delta (Z10):**
|
|
307
|
-
`--doctor --fail-on-new-smells --base-ref <ref>` blocks only new/worsened semantic
|
|
308
|
-
`domain-logic-in-ui`; historical/unrelated work stays green and missing bases fail closed.
|
|
309
|
-
- **Fail-closed CI (2.11):** `--strict-merge` combines config coverage, shared gate-file
|
|
310
|
-
presence, and bypass diagnostics for dynamic imports, TypeScript suppressions, explicit `any`
|
|
311
|
-
casts, InMemory runtime defaults, and disabled peer isolation. `--strict` is a compatibility
|
|
312
|
-
alias. Neither requires an editor hook; use `--require-write-hook claude|grok` when that local
|
|
313
|
-
guarantee is part of the check.
|
|
314
|
-
- **Resolved analysis + completeness (3.8.0):** schema 1.3 identifies
|
|
315
|
-
`resolved-candidate-facts` versus `lexical-compatibility`, requires structured incompleteness
|
|
316
|
-
reasons, and exposes policy/resolver/facts/tree identities for resolved results. Single-file
|
|
317
|
-
lexical checks are explicitly `partial`/non-green; governed parse diagnostics also make plan
|
|
318
|
-
`goal.met: false` and normal JSON `valid:false`/`ok:false`. Strict merge exits `1`; a missing
|
|
319
|
-
host is `unavailable` and exits `2`.
|
|
320
|
-
- **Release evidence:** independent 3.0 audit baseline plus signed-tag, GitHub Release, and
|
|
321
|
-
provenance-backed npm publication; see the [3.1.0 release notes](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/3.1.0.md).
|
|
322
|
-
- **TypeScript:** 3.8.0 passed all 36 packed compatibility cells for project
|
|
323
|
-
compilers 5.9.3 / 6.0.3 / 7.0.2 across npm, pnpm, and Yarn. ArkGate prefers a usable project
|
|
324
|
-
API, then its exact `typescript-ark-host@6.0.3`; the project `tsc` remains project-owned.
|
|
325
|
-
Yarn uses strict PnP for TS5/6 and the `node-modules` linker for native TS7; that mode is explicit
|
|
326
|
-
in the report. See the exact boundary in
|
|
327
|
-
[docs/typescript-support.md](docs/typescript-support.md).
|
|
328
|
-
|
|
329
|
-
### Why not only ESLint / dependency-cruiser / Nx?
|
|
125
|
+
## Why not only ESLint / Nx / cruiser?
|
|
330
126
|
|
|
331
127
|
| | ArkGate | Typical boundary linter |
|
|
332
128
|
|--|:---:|:---:|
|
|
333
129
|
| CI import rules | ✅ | ✅ |
|
|
334
|
-
| Hard-block
|
|
130
|
+
| Hard-block AI writes on supported hosts | ✅ | ❌ |
|
|
335
131
|
| Contract agents can read (`ark://manifest`) | ✅ | ❌ |
|
|
336
|
-
| Placement
|
|
337
|
-
| Honest governed % +
|
|
338
|
-
|
|
|
339
|
-
| TypeScript 5.9 / 6.0 / 7.0 packed consumers | ✅ (3.8.0; 36/36 packed CI cells) | varies |
|
|
340
|
-
| Incomplete analysis can satisfy plan/result/strict merge | ❌ (`partial` / `unavailable` fail closed) | varies |
|
|
341
|
-
| Adoption scorecard (hosts / MCP / origin) | ✅ | ❌ |
|
|
342
|
-
| **Editor ESLint on-disk relative-import parity; resolved CI backstop** | ✅ (`arkgate/eslint`) | varies |
|
|
132
|
+
| Placement + preflight for multi-file changes | ✅ | ❌ |
|
|
133
|
+
| Honest governed % + dual plan (edges vs shape) | ✅ | ❌ |
|
|
134
|
+
| Incomplete analysis cannot look green | ✅ | varies |
|
|
343
135
|
|
|
344
136
|
---
|
|
345
137
|
|
|
346
138
|
## Common commands
|
|
347
139
|
|
|
348
140
|
```bash
|
|
349
|
-
npx arkgate start
|
|
350
|
-
npx arkgate
|
|
351
|
-
npx arkgate
|
|
352
|
-
npx arkgate
|
|
353
|
-
npx arkgate
|
|
354
|
-
npx arkgate-check --
|
|
355
|
-
npx arkgate-check --doctor --json # adoption + schema-backed writePath.enforcementState
|
|
356
|
-
npx arkgate-check --doctor --fail-on-new-smells --base-ref origin/main # opt-in design ratchet
|
|
357
|
-
npx arkgate-check --strict # fail-closed CI + installed-gate/safety checks
|
|
358
|
-
npx arkgate-check --plan # safe-to-auto-fix vs your call
|
|
359
|
-
npx arkgate-check --coverage # Governed: N%
|
|
360
|
-
npx arkgate-check --report ark-report.html # showcase HTML (opens in browser on local TTY; --no-open to skip)
|
|
361
|
-
npx arkgate-check --baseline # only NEW violations fail
|
|
362
|
-
npx arkgate preflight --changes changes.json --json # atomic read-only batch verdict
|
|
363
|
-
npx arkgate preflight --changes changes.json --change-map map.json --json # intent hash + structural convergence
|
|
364
|
-
npx arkgate upgrade --json # read-only managed-content preview + planDigest
|
|
365
|
-
npx arkgate upgrade --apply # update package, then re-preview with the new CLI
|
|
366
|
-
# run the emitted nextCommand to apply only that preview, including --plan-digest
|
|
141
|
+
npx arkgate start --apply
|
|
142
|
+
npx arkgate-check --doctor
|
|
143
|
+
npx arkgate-check --plan
|
|
144
|
+
npx arkgate-check --coverage
|
|
145
|
+
npx arkgate-check --strict-merge # CI / required status
|
|
146
|
+
npx arkgate-check --install-agent-gates --tools claude,cursor,codex,grok
|
|
367
147
|
```
|
|
368
148
|
|
|
369
|
-
|
|
370
|
-
unrelated files, and requires explicit consent for recorded deletions or conflicts. It never
|
|
371
|
-
rewrites a Codex home or another global directory implicitly.
|
|
372
|
-
|
|
373
|
-
CI (example):
|
|
374
|
-
|
|
375
|
-
```yaml
|
|
376
|
-
- run: npx arkgate-check --root . --config ark.config.json --strict
|
|
377
|
-
# or: uses: pedroknigge/arkgate@<tag-or-SHA> # runs that checked-out revision
|
|
378
|
-
```
|
|
149
|
+
More: [docs/develop.md](docs/develop.md) · enthusiast track: [docs/enthusiast/](docs/enthusiast/README.md)
|
|
379
150
|
|
|
380
151
|
---
|
|
381
152
|
|
|
382
|
-
## Optional experimental runtime
|
|
153
|
+
## Optional experimental runtime
|
|
383
154
|
|
|
384
|
-
Gates need **no app
|
|
385
|
-
production-readiness claim. If you want to evaluate runtime intent/event contracts, use the
|
|
386
|
-
separate experimental package:
|
|
387
|
-
|
|
388
|
-
```ts
|
|
389
|
-
import { createStrictArkKernelFromConfig } from '@arkgate/runtime';
|
|
390
|
-
// see the repository production-hardening and package-surface guides
|
|
391
|
-
```
|
|
155
|
+
Gates need **no** app runtime. The experimental `@arkgate/runtime` companion is separate and is not a production-readiness claim.
|
|
392
156
|
|
|
393
|
-
|
|
394
|
-
`arkgate/runtime` forwarding shim requires `@arkgate/runtime` and is removed in ArkGate 4.
|
|
395
|
-
The companion is not currently present in the npm registry and the root release workflow does
|
|
396
|
-
not publish it; the import above documents the intended boundary. Source-checkout evaluation
|
|
397
|
-
requires `npm run build:runtime` followed by installing the local `packages/runtime` folder.
|
|
157
|
+
### Durability stance
|
|
398
158
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
The kernel’s default stores (`InMemoryEventBuffer`, `InMemoryAuditStore`,
|
|
404
|
-
`InMemoryReadModelStore`, `InMemoryWorkflowStore`) are **reference in-memory only**:
|
|
405
|
-
fine for tests, demos, and single-process local work — they **do not** survive restarts
|
|
406
|
-
and are **not** production durability. Implement the store interfaces (or inject your own)
|
|
407
|
-
for real systems. Details: [production-hardening.md](https://github.com/pedroknigge/arkgate/blob/main/docs/production-hardening.md).
|
|
159
|
+
Default stores (`InMemoryEventBuffer`, `InMemoryAuditStore`, `InMemoryReadModelStore`,
|
|
160
|
+
`InMemoryWorkflowStore`) are **reference in-memory only** — fine for tests and demos; they
|
|
161
|
+
**do not** survive restarts and are **not** production durability. Implement the store interfaces
|
|
162
|
+
for real systems. Details: [docs/production-hardening.md](docs/production-hardening.md).
|
|
408
163
|
|
|
409
164
|
---
|
|
410
165
|
|
|
@@ -412,39 +167,33 @@ for real systems. Details: [production-hardening.md](https://github.com/pedrokni
|
|
|
412
167
|
|
|
413
168
|
| Audience | Link |
|
|
414
169
|
|----------|------|
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
|
419
|
-
|
|
|
420
|
-
|
|
|
421
|
-
|
|
|
422
|
-
| Security
|
|
423
|
-
|
|
|
424
|
-
|
|
|
425
|
-
| Latest release (3.8.3) | [release notes](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/3.8.3.md) · [3.0.0 baseline](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/3.0.0.md) |
|
|
426
|
-
| Roadmap and decisions | [ROADMAP.md](https://github.com/pedroknigge/arkgate/blob/main/ROADMAP.md) · [ADRs](https://github.com/pedroknigge/arkgate/tree/main/docs/adr) · [Changelog](CHANGELOG.md) |
|
|
170
|
+
| **Docs hub** | [docs/README.md](docs/README.md) |
|
|
171
|
+
| Anyone | [docs/use.md](docs/use.md) |
|
|
172
|
+
| Developers integrating ArkGate | [docs/develop.md](docs/develop.md) |
|
|
173
|
+
| Contributors to this library | [CONTRIBUTING.md](CONTRIBUTING.md) |
|
|
174
|
+
| Host install detail | [docs/ai-gates.md](docs/ai-gates.md) |
|
|
175
|
+
| Config · package surface · TS | [configuration](docs/configuration.md) · [package-surface](docs/package-surface.md) · [typescript-support](docs/typescript-support.md) |
|
|
176
|
+
| Brownfield | [docs/brownfield-adoption.md](docs/brownfield-adoption.md) |
|
|
177
|
+
| Security | [SECURITY.md](SECURITY.md) |
|
|
178
|
+
| Latest release (3.9.0) | [docs/releases/3.9.0.md](docs/releases/3.9.0.md) · [CHANGELOG](CHANGELOG.md) |
|
|
179
|
+
| History / maintainer evidence | [docs/archive/](docs/archive/README.md) |
|
|
427
180
|
|
|
428
181
|
---
|
|
429
182
|
|
|
430
|
-
##
|
|
183
|
+
## Contribute to this library
|
|
431
184
|
|
|
432
185
|
```bash
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
npm run
|
|
436
|
-
npm run check:architecture # Ark gates itself
|
|
186
|
+
git clone https://github.com/pedroknigge/arkgate
|
|
187
|
+
cd arkgate && npm ci && npm run build
|
|
188
|
+
npm test && npm run check:architecture
|
|
437
189
|
```
|
|
438
190
|
|
|
439
|
-
|
|
440
|
-
**npm:** [`arkgate`](https://www.npmjs.com/package/arkgate) · formerly `ark-runtime-kernel`
|
|
441
|
-
**Product:** **ArkGate** — architecture co-pilot / gate for AI TypeScript (not a runtime kernel).
|
|
442
|
-
CLI: `arkgate` · `arkgate-check` · `arkgate-mcp` (aliases `ark` / `ark-check` / `ark-mcp` still work for one major).
|
|
443
|
-
MCP registry: [`io.github.pedroknigge/arkgate`](https://registry.modelcontextprotocol.io/) (`server.json` @ package version).
|
|
444
|
-
**Source:** [github.com/pedroknigge/arkgate](https://github.com/pedroknigge/arkgate)
|
|
445
|
-
|
|
446
|
-
Node ≥ 18 · **MIT**.
|
|
191
|
+
Full guide: [CONTRIBUTING.md](CONTRIBUTING.md) · queue: [ROADMAP.md](ROADMAP.md)
|
|
447
192
|
|
|
448
193
|
---
|
|
449
194
|
|
|
195
|
+
**Website:** [arkgate.online](https://www.arkgate.online/) · **npm:** [`arkgate`](https://www.npmjs.com/package/arkgate)
|
|
196
|
+
**MCP:** [`io.github.pedroknigge/arkgate`](https://registry.modelcontextprotocol.io/)
|
|
197
|
+
Node ≥ 18 · **MIT**
|
|
198
|
+
|
|
450
199
|
**Ark doesn’t invent your product. It keeps AI-generated TypeScript inside an architecture you can trust — and tells you when it isn’t really enforcing anything yet.**
|