arkgate 4.5.5 → 4.5.7

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/docs/README.md CHANGED
@@ -53,13 +53,12 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
53
53
  | Area | Path |
54
54
  |------|------|
55
55
  | Release notes (by version) | [releases/](releases/) · [CHANGELOG.md](../CHANGELOG.md) |
56
- | Epic plans (seeded + shipped) | [plans/](plans/) — maintainer seeds (e.g. deep-module coach post-4.5 **implemented, not published**; domain fitness & session truth for **4.5.0**; improvement compass for **4.4.0**; agent contract surface for **4.3.0**). Product how-to stays in use/develop/agent-guide; plans are not required reading to use the package. |
56
+ | Epic plans (seeded + shipped) | [plans/](plans/) — maintainer seeds (e.g. [field-upgrade-mcp-truth](plans/field-upgrade-mcp-truth/README.md) **shipped in 4.5.6**; deep-module coach **shipped in 4.5.5**; domain fitness & session truth for **4.5.0**; improvement compass for **4.4.0**; agent contract surface for **4.3.0**). Product how-to stays in use/develop/agent-guide; plans are not required reading to use the package. |
57
57
  | Claims audit | [audit/claims-matrix.md](audit/claims-matrix.md) |
58
58
  | Field adoption kit (scaffolding, not closed) | [field/](field/) |
59
59
  | Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
60
60
 
61
- Current published: [releases/4.5.0.md](releases/4.5.0.md) (`arkgate@4.5.0` on npm `latest`).
62
- Prepared next: [releases/4.5.5.md](releases/4.5.5.md) (`arkgate@4.5.5` — not on `latest` until publish).
61
+ Current published: [releases/4.5.6.md](releases/4.5.6.md) (`arkgate@4.5.6` on npm `latest`).
63
62
  Prior: [releases/4.4.0.md](releases/4.4.0.md) (`arkgate@4.4.0`).
64
63
  Previous: [releases/4.3.0.md](releases/4.3.0.md) · [releases/4.2.1.md](releases/4.2.1.md) · [releases/4.2.0.md](releases/4.2.0.md) · [releases/4.1.1.md](releases/4.1.1.md).
65
64
  Previous major: [releases/4.0.0.md](releases/4.0.0.md) (`arkgate@4.0.0`).
@@ -40,12 +40,14 @@ npx ark-check --install-agent-gates --skills-only --force
40
40
 
41
41
  ### Write-path honesty
42
42
 
43
- Claude/Grok/Antigravity can hard-block listed PreToolUse ops when installed and trusted.
44
- Cursor/Codex/OpenCode remain **advisory at write**. For every host, the repository-wide hard
45
- boundary is a **required GitHub status context** that runs `arkgate-check --strict-merge` (alias
46
- `ark-check --strict-merge`) — the CLI name is not the status context name. Never claim
47
- Cursor/Codex/OpenCode hard write. Soft-write alone does not mean the project is unfinished; doctor
48
- keeps it as an environment residual. See [ai-gates.md](ai-gates.md) and the README host matrix.
43
+ Claude/Grok/Antigravity/Cursor can hard-block listed PreToolUse / preToolUse ops when installed
44
+ and trusted (Cursor: `Write` / `StrReplace` via `.cursor/hooks.json`). Codex/OpenCode remain
45
+ **advisory at write**. For every host, the repository-wide hard boundary is a **required GitHub
46
+ status context** that runs `arkgate-check --strict-merge` (alias `ark-check --strict-merge`) —
47
+ the CLI name is not the status context name. Never claim Codex/OpenCode hard write; never claim
48
+ Cursor hard write without the trusted hooks file covering Write|StrReplace. Soft-write alone does
49
+ not mean the project is unfinished; doctor keeps it as an environment residual. See
50
+ [ai-gates.md](ai-gates.md) and the README host matrix.
49
51
 
50
52
  Surface the same plane from the CLI: pair **`ark status --json`** (activation facts) with
51
53
  **`ark-check --doctor`** (`doctor.writePath`) — advisory local write on soft hosts → **required**
@@ -83,6 +85,27 @@ npx ark-check --doctor --json
83
85
 
84
86
  Product path: [use.md — Session recipe](use.md#session-recipe-agent-turn).
85
87
 
88
+ ### Multi-project MCP and upgrade honesty (4.5.6)
89
+
90
+ One human often has **N checkouts** and **N package pins**. Product rules:
91
+
92
+ | Rule | Why |
93
+ |------|-----|
94
+ | One checkout = one `project.expectedRoot` | Identity (WI01) fail-closes cross-project evidence when used correctly |
95
+ | After `npm install arkgate@…`, restart/retarget Ark MCP | Process `arkgateVersion` is startup-loaded; long-lived MCP can lag install |
96
+ | Read `processPackage` on every tool response | `processPackageMismatch` / `processStale` + `nextAction` when process ≠ project install |
97
+ | Prefer project-local CLI until versions align | CLI always available; MCP analysis is not “fully current” while process is stale |
98
+ | Upgrade each package that pins arkgate | Monorepo “done” is not one package’s pin |
99
+ | Registry-aware `ark upgrade --apply` | Does not false-skip when CLI == pin but registry is ahead; skip JSON has `reasonCode` + `suggestedInstallCmd` |
100
+ | Skills: `skillDrift` + optional `--refresh-skills` | Customized skill bodies stay preserved unless you opt in; never silent overwrite of true edits |
101
+
102
+ ```bash
103
+ npx arkgate upgrade --json # skillDrift, whatsNew, hostSelection
104
+ npx arkgate upgrade --apply # registry-aware package step, then re-preview
105
+ # digest-bound apply + optional skill refresh:
106
+ npx arkgate upgrade --apply --no-install --plan-digest sha256:… --refresh-skills
107
+ ```
108
+
86
109
  ### Two-axis done recipe
87
110
 
88
111
  Architecture residual and feature residual are **separate axes**. Never collapse them:
package/docs/ai-gates.md CHANGED
@@ -286,20 +286,30 @@ Use both: the MCP server for discovery, the hook for enforcement.
286
286
 
287
287
  ## Cursor
288
288
 
289
- Cursor supports MCP servers (`.cursor/mcp.json`):
289
+ Cursor supports MCP servers (`.cursor/mcp.json`) and project hooks (`.cursor/hooks.json`):
290
290
 
291
291
  ```json
292
292
  {
293
- "mcpServers": {
294
- "ark": {
295
- "command": "npx",
296
- "args": ["ark-mcp", "--root", ".", "--config", "ark.config.json"]
297
- }
293
+ "version": 1,
294
+ "hooks": {
295
+ "preToolUse": [
296
+ {
297
+ "command": "npx arkgate-mcp --hook --hook-repair --fail-on-new-smells --root . --root-env CURSOR_PROJECT_DIR --config ark.config.json",
298
+ "matcher": "Write|StrReplace",
299
+ "failClosed": true,
300
+ "timeout": 30
301
+ }
302
+ ]
298
303
  }
299
304
  }
300
305
  ```
301
306
 
302
- Cursor has no pre-write hook, so the gate is advisory at write time pair it with a rules file so the agent actually calls it. `.cursor/rules/ark.mdc`:
307
+ When that hook is installed and trusted, Cursor **hard-blocks** agent `Write` / `StrReplace`
308
+ for governed TypeScript sources (exit 2 or `permission: "deny"`). Repair envelopes may emit;
309
+ Cursor does **not** guarantee Write `updated_input` reinjection — the agent must fix and retry
310
+ from `agent_message`. Shell, Tab, and human edits still rely on CI.
311
+
312
+ Pair with MCP + a rules file so the agent also calls advisory tools. `.cursor/rules/ark.mdc`:
303
313
 
304
314
  ```markdown
305
315
  ---
@@ -307,15 +317,15 @@ description: Ark architecture contract
307
317
  alwaysApply: true
308
318
  ---
309
319
 
310
- Before writing or editing any TypeScript source file, call the `validate_code`
311
- tool from the `ark` MCP server with the full post-edit file content and its
312
- path. If it reports violations, fix them before writing. The architecture
313
- contract is available authoritatively from `ark_manifest` after `ark_identity`
314
- matches. `ark://manifest` is compatibility-only and always unverified.
320
+ Before trusting Ark MCP evidence, call `ark_identity` with `project.expectedRoot`
321
+ set to the exact project root. Then call `ark_manifest`. Before writing TypeScript,
322
+ prefer MCP `ark_prepare_write` / `validate_code` when available; the project
323
+ `.cursor/hooks.json` hard gate still blocks invalid Write/StrReplace.
315
324
  ```
316
325
 
317
- Your repository backstop in Cursor is CI: `ark-check` fails its check on anything that slips
318
- through. It blocks the merge only when that status is required by repository policy.
326
+ Your repository backstop remains CI: `ark-check` fails its check on anything that slips
327
+ through (Shell bypass, Tab, incomplete coverage). It blocks the merge only when that status
328
+ is required by repository policy.
319
329
 
320
330
  ## OpenAI Codex CLI
321
331
 
@@ -8,8 +8,9 @@ npx arkgate-check --install-agent-gates --tools claude,cursor,codex,grok
8
8
 
9
9
  Installs:
10
10
 
11
- - Write-path configuration (Claude/Grok hard PreToolUse; Cursor/Codex advisory MCP)
12
- PreToolUse uses **`--hook-repair`** (W4): on deny, stderr may include
11
+ - Write-path configuration (Claude/Grok/Antigravity/Cursor hard PreToolUse when covered;
12
+ Codex advisory MCP)
13
+ — PreToolUse / Cursor `preToolUse` uses **`--hook-repair`** (W4): on deny, stderr may include
13
14
  `ARK_REPAIR_JSON` / `ARK_AUTOPATCH_JSON` for hosts that re-inject a patch.
14
15
  Still exit 2 / hard block; never silent write. Drop `--hook-repair` for
15
16
  reject-only prose, or set `ARK_HOOK_REPAIR=0` and omit the flag.
@@ -20,7 +21,7 @@ Installs:
20
21
  | Host | Extra paths |
21
22
  |------|-------------|
22
23
  | Claude Code | `.claude/settings.json`, `.claude/skills/` |
23
- | Cursor | `.cursor/mcp.json`, `.cursor/rules/ark.mdc`, `.cursor/commands/` |
24
+ | Cursor | `.cursor/mcp.json`, `.cursor/hooks.json`, `.cursor/rules/ark.mdc`, `.cursor/commands/` |
24
25
  | Codex | `.codex/hooks.json`, `.codex/config.toml`, `.agents/skills/` |
25
26
  | **Grok Build** | `.grok/config.toml`, `.grok/hooks/`, `.grok/skills/` |
26
27
 
@@ -20,7 +20,9 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
20
20
  | **Programmatic gate API** | `import { analyzeProject, loadContract, createAICodeGate, ... } from 'arkgate'` | The root export is the static gate/config/analysis contract listed below. It intentionally contains no runtime-kernel implementation. |
21
21
  | **Improvement compass (4.4; status honesty 4.5)** | `ark-check --doctor --json` → `doctor.improvementCompass`; human doctor section **Improvement compass (not a score)**; HTML report `data-advisory="improvementCompass"`. **`ark status --json` / MCP `ark_status`** project a thin `improvementCompass` residual map with explicit honesty **`mode`**: `full` \| `subset` \| `unavailable` (always `notAScore: true`). When `mode` is `full`, status residual lens **ids** are a **subset of** doctor residual for the same facts (report snapshot stores the thin slice after `--report`). Incomplete or missing session facts → `subset` / `unavailable` + `reasonCode` / `reason` — **never invent green residual**. Residual never flips `valid` / strict-merge / `goal.met`. When status mode ≠ full, run doctor for full 15-lens detail. | Additive schema `1.0`. Closed **15** lens ids (`soc`, `cohesion`, `coupling`, `srp`, `dip`, `ocp`, `encapsulation`, `modularity`, `scalability`, `resilience`, `security`, `maintainability`, `testability`, `domain`, `stack`) with status `ok` \| `residual` \| `not-instrumented` \| `out-of-scope`, evidence refs, optional `nextAction`, capped `topResidual`, always **`notAScore: true`**. Projection from existing smells / walls / cohesion / ArkRules / design-weak only — **never** a gate input. Out-of-scope locked for scalability, resilience, and app security (no residual invent from missing SAST/APM). Root API: `buildImprovementCompass` / `IMPROVEMENT_LENS_IDS`; status: `projectStatusImprovementCompass` / `STATUS_COMPASS_MODES`. |
22
22
  | **Deep-module coach (post-4.5 advisory)** | `ark-check --doctor --json` → `doctor.deepModuleCoach`; human doctor section **Deep-module coach (advisory — not a score)** always when doctor runs (empty candidates / hot-path `unavailable` are honesty, not omission); HTML `data-advisory="deepModuleCoach"`. | Additive schema `1.0`. Always **`notAScore: true`**. **`hotPaths`**: recent-churn heuristic from bounded git log; `available` + `status` `ok` \| `unavailable`; empty `paths` when history missing/incomplete — **never invent**. **`deepeningCandidates`**: cards projected only from existing design smells / physical cohesion / reshape pilot / pilotLoop / residual compass lenses — **empty when no evidence** (no fake candidates). Never flips `valid`, strict-merge, completeness green, or `goal.met`. Prefer deep modules / named seams / test-at-public-interface process language in skills. Domain pure + CLI gen mirror (`deepeningCoach.ts` / `bin/lib/deepening-coach.mjs`); **not** a root package export — consume via `doctor.deepModuleCoach` (or the gen mirror in Tooling). |
23
- | **Upgrade what’s new (4.5.5)** | `ark upgrade --json` → `whatsNew` (+ human **Suggested improvements** block). | Always **`notAScore: true`**, **`neverGateInput: true`**. Closed try/inspect list: deep-module coach, improvement compass, session/status honesty, two-axis done, self-service honesty. Never invents residual or flips gates. |
23
+ | **Upgrade what’s new (4.5.6+)** | `ark upgrade --json` → `whatsNew` (+ human **Suggested improvements** block; also on preview). | Always **`notAScore: true`**, **`neverGateInput: true`**. Closed try/inspect list: deep-module coach, improvement compass, session/status honesty, two-axis done, self-service honesty, registry-aware upgrade, skill drift/refresh, multi-project MCP. Never invents residual or flips gates. |
24
+ | **Field upgrade truth (4.5.6)** | `ark upgrade` registry-aware install; JSON `reasonCode` / `suggestedInstallCmd`; `skillDrift`; `--refresh-skills`; `postUpgradeChecks`; `hostSelection`. | No false-skip when registry ahead; offline honesty; customized skills preserved unless opt-in refresh; checks are advisory only. |
25
+ | **MCP process package honesty (4.5.6)** | Every MCP tool context → `processPackage` (`processPackageMismatch` / `processStale`, versions, `nextAction`). | Multi-checkout users: restart MCP after pin bump; prefer project-local CLI until identity matched and versions align. Fail-closed identity (WI01) unchanged. |
24
26
  | **Doctor design fitness** | `ark-check --doctor --json` → `doctor.designFitness`, `doctor.designSmells[]` | Additive. Stable smell `id`s: `io-under-application`, `handler-in-persistence`, `god-module`, `domain-logic-in-ui`, `facade-sql-in-routes`, `mixed-pattern-cluster`, `soft-contract`. `handler-in-persistence` covers static ES imports/re-exports of framework HTTP surfaces (`next/server`), `defineRoute` calls, and existing handler bodies inside Persistence-role layers or specific persistence paths; `require()` and dynamic `import()` are outside this narrow advisory, and a generic `Infrastructure` role alone is not Persistence. Persistence candidates are filtered and sorted before the bounded content scan so large application prefixes cannot hide the advisory. The detector inspects the first 800 sorted Persistence candidates; later candidates are uninspected, so **absence of a smell is not full-tree proof** above that envelope (incomplete/`partial` analysis also never proves “no smells”). **4.2 feedback hardening:** mode labels preserve the observed SUGGEST/ADAPT/ENFORCE state; a local permission/UI-state `canEdit` name alone is not a domain smell; real UI business rules route Domain → Application → UI; seed/fixture/demo/migration/generated files are not god-module pilots. Each smell has `evidence[]`, `fix`, technical `message`, and plain-language **`outcome`**. Does **not** fail the gate by itself. |
25
27
  | **Post-green Shape door** | `doctor.postGreenPath`, `doctor.primaryNextAction`, `doctor.healthyFinishedForbidden` | Additive when `designFitness.designWeak`. Single Shape door (`id: clarify-for-ai`): explore shape-focus → dual-plan B → autopilot only with OK. Never empty plan A = healthy finished. |
26
28
  | **Golden pattern (new code)** | Optional `.ark/golden-pattern.json`; doctor JSON `doctor.goldenPattern`; MCP `ark_place` / `ark_prepare_write` → `goldenPattern` | Additive, **advisory for NEW code only**. Required fields: `name`, `norm`; optional `newCodeHome`, `examplePath`, `schemaVersion`. **Absent is normal** (no claim). Never ENFORCE; never clears design-weak. Malformed → `invalid: true`, not silent guidance. |
@@ -207,8 +209,8 @@ production deployment would need to satisfy; it is not a readiness certification
207
209
  ## Release notes (maintainers)
208
210
 
209
211
  Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
210
- (current published: [4.5.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.5.0.md); prepared: [4.5.5.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.5.5.md);
211
- prior published: [4.4.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.4.0.md), [4.3.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.3.0.md),
212
+ (current published: [4.5.6.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.5.6.md);
213
+ prior published: [4.5.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.5.0.md), [4.4.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.4.0.md), [4.3.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.3.0.md),
212
214
  [4.2.1.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.2.1.md);
213
215
  previous: [4.2.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.2.0.md),
214
216
  [4.1.1.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.1.1.md),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.5.5",
3
+ "version": "4.5.7",
4
4
  "description": "ArkGate — architecture co-pilot for AI TypeScript (write gate, CI gate, plan/loop; optional ArkRules)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/pedroknigge/arkgate",
7
7
  "source": "github"
8
8
  },
9
- "version": "4.5.5",
9
+ "version": "4.5.7",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "arkgate",
14
- "version": "4.5.5",
14
+ "version": "4.5.7",
15
15
  "runtimeHint": "npx",
16
16
  "transport": {
17
17
  "type": "stdio"
@@ -7,7 +7,7 @@
7
7
  This directory is the **Agent Skills–compatible** packaging of the same **13**
8
8
  `/ark-*` skills shipped as flat templates for Ark install. **No new skill names.**
9
9
 
10
- Package version when last generated context: **arkgate@4.5.0**
10
+ Package version when last generated context: **arkgate@4.5.6**
11
11
  Schema: agent-skills package contract `1.0`
12
12
 
13
13
  ## Skills (frozen catalog)
@@ -35,16 +35,34 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
35
35
  ## Suggested improvements (what to try next)
36
36
 
37
37
  After `ark upgrade` (preview or apply), read JSON **`whatsNew`** or the human **Suggested improvements**
38
- block. It lists concrete try/inspect actions for this package line (advisory only — not a score):
38
+ block (also on preview when nothing to apply). It lists concrete try/inspect actions for this package
39
+ line (advisory only — not a score):
39
40
 
40
41
  1. **Deep-module coach** — `ark-check --doctor` → `doctor.deepModuleCoach` (hot paths + deepening)
41
42
  2. **Improvement compass** — residual lenses on doctor/HTML (not a score)
42
43
  3. **Session recipe** — `ark status --json` honesty modes; doctor when mode is not full
43
44
  4. **Two-axis done** — architecture residual vs feature/ticket residual (Enforce green ≠ feature done)
44
45
  5. **Self-service honesty** — upgrade `selfService` write-path labels + customized preserve
46
+ 6. **Registry-aware upgrade** — `reasonCode` / `suggestedInstallCmd` when package install is skipped or needed
47
+ 7. **Skill drift + refresh** — `skillDrift`; opt-in `--refresh-skills` for customized skill rewrite
48
+ 8. **Multi-project MCP** — `processPackage` mismatch/stale on every MCP tool; restart after package bump
45
49
 
46
50
  Never invent gate verdicts from these suggestions. Missing residual is honest empty, not green.
47
51
 
52
+ ## Field truth (package install + skills + multi-project MCP)
53
+
54
+ | Situation | Honest product behavior |
55
+ |-----------|-------------------------|
56
+ | CLI version == `node_modules` but npm registry is ahead | `--apply` **installs** (does not false-skip). Inspect `reasonCode: BEHIND_REGISTRY`. |
57
+ | Offline / `npm view` failed | May skip with `REGISTRY_UNAVAILABLE` + `suggestedInstallCmd` — do not invent a version. |
58
+ | Skills customized after install | Preserved by default. Preview `skillDrift` shows counts. **`--refresh-skills`** rewrites customized *skills* only with consent. |
59
+ | Conflicted managed assets | Still need `--accept-conflicts`. Never silent overwrite of true edits. |
60
+ | Multiple checkouts / monorepo packages | One `expectedRoot` per project; upgrade **each** pin; restart MCP after bump; prefer project-local CLI until identity matched **and** process version aligns. |
61
+ | Active host not in `--tools` / manifest | Preview `hostSelection` notes it and suggests `--tools` expansion. |
62
+
63
+ **Post-apply:** read `postUpgradeChecks` (advisory). Confirm pin↔CLI, run doctor (compass + deepModuleCoach),
64
+ `agents-md --check`, `ark status --json`, and MCP version note if MCP was used.
65
+
48
66
 
49
67
  ## Dual engine (mandatory)
50
68
 
@@ -62,6 +80,11 @@ retain `projectIdentity.projectId`, then pass both `expectedRoot` and `expectedP
62
80
  uncertain, do not consume MCP analysis: use the workspace-local CLI and report that MCP
63
81
  restart/retargeting is required. `ark://manifest` never satisfies this preflight.
64
82
 
83
+ **Process package honesty:** every tool response includes `processPackage` (`processArkgateVersion`,
84
+ `projectInstalledVersion`, `processPackageMismatch` / `processStale`, `nextAction`). After
85
+ `npm install arkgate@…`, **restart/retarget MCP** so process version matches install. Until then,
86
+ prefer project-local CLI and do not treat MCP analysis as fully current.
87
+
65
88
  ## Dual plane — layers + ArkRules (mandatory, except /ark-runtime)
66
89
 
67
90
  ArkGate has **two opt-in planes**. The user chooses which to use; you **always label** findings so they never blur.
@@ -111,8 +134,8 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
111
134
  | `current` | Content identity matches the candidate. | Record/adopt safely; metadata-only stamps may refresh. |
112
135
  | `stale` | Recorded managed content still matches its old identity. | Safe candidate replacement. |
113
136
  | `missing` | Candidate is absent. | Create if new; require consent if a recorded asset was deleted. |
114
- | `customized` | User content diverged without a competing managed base. | Preserve it. |
115
- | `conflicted` | Both managed base and user content diverged. | Preserve and require explicit consent. |
137
+ | `customized` | User content diverged without a competing managed base. | Preserve it. Opt-in rewrite for **skills only**: `--refresh-skills`. |
138
+ | `conflicted` | Both managed base and user content diverged. | Preserve and require explicit consent (`--accept-conflicts`). |
116
139
  | `retired` | A recorded asset is no longer selected by the candidate. | Preserve its file and manifest identity; take no action. |
117
140
 
118
141
  ## Procedure
@@ -172,16 +195,18 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
172
195
  that customized files remain non-applying and that any deletion/conflict is
173
196
  blocked.
174
197
 
175
- 3. **Update and re-preview.** If the registry is newer, run (project-local CLI):
198
+ 3. **Update and re-preview.** If the registry is newer **or** CLI == pin but registry is ahead
199
+ (field false-skip is fixed), run (project-local CLI):
176
200
 
177
201
  ```bash
178
202
  npx arkgate upgrade --apply
179
203
  ```
180
204
 
181
- This updates through the detected package manager and hands control to the new
182
- package for a fresh preview. Review that new preview; do not assume the old
183
- candidate and new candidate are identical. If already on the latest package,
184
- retain the current read-only preview.
205
+ This updates through the detected package manager (registry-aware) and hands control to the new
206
+ package for a fresh preview. On skip, read `reasonCode` / `suggestedInstallCmd` agents must not
207
+ invent recovery. Review the new preview; do not assume old and new candidates are identical.
208
+ If already current (`ALREADY_CURRENT`), retain the read-only preview and still read `whatsNew`
209
+ + `skillDrift`.
185
210
 
186
211
  For pnpm repositories with `minimumReleaseAge`, use the repository's existing
187
212
  trusted first-party exception mechanism when the new release is still cooling
@@ -199,18 +224,25 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
199
224
  ```
200
225
 
201
226
  If recorded deletion/conflict recovery is desired, ask first and then add
202
- `--accept-conflicts`. Never add it merely to make the run green. Run a second
203
- preview and require `summary.changed: 0`.
227
+ `--accept-conflicts`. Never add it merely to make the run green.
228
+
229
+ If customized **skills** should match package templates after pin bump, ask first and add
230
+ `--refresh-skills` on the digest-bound apply (or a new preview that includes the flag). Never
231
+ add it merely to make the run green. Run a second preview and require `summary.changed: 0`
232
+ (unless more deliberate refreshes remain).
204
233
 
205
- 5. **Verify enforcement and architecture.** Run
234
+ 5. **Verify enforcement and architecture (post-upgrade checks).** Read apply JSON
235
+ `postUpgradeChecks` when present. Also run:
206
236
  `npx arkgate-check --doctor --json` (or the project-local `ark-check`) and
207
237
  the same fail-closed architecture command used by managed apply (normally
208
238
  `npx arkgate-check --root . --config ark.config.json --strict-merge --json`).
209
- Require `completeness: "complete"` and `ok: true`. Treat provider-unavailable CI
210
- required-check evidence as `unverified`, never as proof that merges are
211
- blocked. If new violations appear, hand off to `/ark-fix` for a small set or
212
- `/ark-loop` / `/ark-autopilot` for residual debt; do not regenerate a baseline
213
- without explicit approval.
239
+ Require `completeness: "complete"` and `ok: true`. Confirm `doctor.improvementCompass` and
240
+ `doctor.deepModuleCoach` honesty. Run `npx arkgate agents-md --check` and
241
+ `npx arkgate status --json`. If MCP was used, restart MCP after package bump and re-bind
242
+ identity. Treat provider-unavailable CI required-check evidence as `unverified`, never as proof
243
+ that merges are blocked. If new violations appear, hand off to `/ark-fix` for a small set or
244
+ `/ark-loop` / `/ark-autopilot` for residual debt; do not regenerate a baseline without explicit
245
+ approval.
214
246
 
215
247
  ## Active host vs deferred hosts
216
248
 
@@ -35,16 +35,34 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
35
35
  ## Suggested improvements (what to try next)
36
36
 
37
37
  After `ark upgrade` (preview or apply), read JSON **`whatsNew`** or the human **Suggested improvements**
38
- block. It lists concrete try/inspect actions for this package line (advisory only — not a score):
38
+ block (also on preview when nothing to apply). It lists concrete try/inspect actions for this package
39
+ line (advisory only — not a score):
39
40
 
40
41
  1. **Deep-module coach** — `ark-check --doctor` → `doctor.deepModuleCoach` (hot paths + deepening)
41
42
  2. **Improvement compass** — residual lenses on doctor/HTML (not a score)
42
43
  3. **Session recipe** — `ark status --json` honesty modes; doctor when mode is not full
43
44
  4. **Two-axis done** — architecture residual vs feature/ticket residual (Enforce green ≠ feature done)
44
45
  5. **Self-service honesty** — upgrade `selfService` write-path labels + customized preserve
46
+ 6. **Registry-aware upgrade** — `reasonCode` / `suggestedInstallCmd` when package install is skipped or needed
47
+ 7. **Skill drift + refresh** — `skillDrift`; opt-in `--refresh-skills` for customized skill rewrite
48
+ 8. **Multi-project MCP** — `processPackage` mismatch/stale on every MCP tool; restart after package bump
45
49
 
46
50
  Never invent gate verdicts from these suggestions. Missing residual is honest empty, not green.
47
51
 
52
+ ## Field truth (package install + skills + multi-project MCP)
53
+
54
+ | Situation | Honest product behavior |
55
+ |-----------|-------------------------|
56
+ | CLI version == `node_modules` but npm registry is ahead | `--apply` **installs** (does not false-skip). Inspect `reasonCode: BEHIND_REGISTRY`. |
57
+ | Offline / `npm view` failed | May skip with `REGISTRY_UNAVAILABLE` + `suggestedInstallCmd` — do not invent a version. |
58
+ | Skills customized after install | Preserved by default. Preview `skillDrift` shows counts. **`--refresh-skills`** rewrites customized *skills* only with consent. |
59
+ | Conflicted managed assets | Still need `--accept-conflicts`. Never silent overwrite of true edits. |
60
+ | Multiple checkouts / monorepo packages | One `expectedRoot` per project; upgrade **each** pin; restart MCP after bump; prefer project-local CLI until identity matched **and** process version aligns. |
61
+ | Active host not in `--tools` / manifest | Preview `hostSelection` notes it and suggests `--tools` expansion. |
62
+
63
+ **Post-apply:** read `postUpgradeChecks` (advisory). Confirm pin↔CLI, run doctor (compass + deepModuleCoach),
64
+ `agents-md --check`, `ark status --json`, and MCP version note if MCP was used.
65
+
48
66
 
49
67
  ## Dual engine (mandatory)
50
68
 
@@ -62,6 +80,11 @@ retain `projectIdentity.projectId`, then pass both `expectedRoot` and `expectedP
62
80
  uncertain, do not consume MCP analysis: use the workspace-local CLI and report that MCP
63
81
  restart/retargeting is required. `ark://manifest` never satisfies this preflight.
64
82
 
83
+ **Process package honesty:** every tool response includes `processPackage` (`processArkgateVersion`,
84
+ `projectInstalledVersion`, `processPackageMismatch` / `processStale`, `nextAction`). After
85
+ `npm install arkgate@…`, **restart/retarget MCP** so process version matches install. Until then,
86
+ prefer project-local CLI and do not treat MCP analysis as fully current.
87
+
65
88
  ## Dual plane — layers + ArkRules (mandatory, except /ark-runtime)
66
89
 
67
90
  ArkGate has **two opt-in planes**. The user chooses which to use; you **always label** findings so they never blur.
@@ -111,8 +134,8 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
111
134
  | `current` | Content identity matches the candidate. | Record/adopt safely; metadata-only stamps may refresh. |
112
135
  | `stale` | Recorded managed content still matches its old identity. | Safe candidate replacement. |
113
136
  | `missing` | Candidate is absent. | Create if new; require consent if a recorded asset was deleted. |
114
- | `customized` | User content diverged without a competing managed base. | Preserve it. |
115
- | `conflicted` | Both managed base and user content diverged. | Preserve and require explicit consent. |
137
+ | `customized` | User content diverged without a competing managed base. | Preserve it. Opt-in rewrite for **skills only**: `--refresh-skills`. |
138
+ | `conflicted` | Both managed base and user content diverged. | Preserve and require explicit consent (`--accept-conflicts`). |
116
139
  | `retired` | A recorded asset is no longer selected by the candidate. | Preserve its file and manifest identity; take no action. |
117
140
 
118
141
  ## Procedure
@@ -172,16 +195,18 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
172
195
  that customized files remain non-applying and that any deletion/conflict is
173
196
  blocked.
174
197
 
175
- 3. **Update and re-preview.** If the registry is newer, run (project-local CLI):
198
+ 3. **Update and re-preview.** If the registry is newer **or** CLI == pin but registry is ahead
199
+ (field false-skip is fixed), run (project-local CLI):
176
200
 
177
201
  ```bash
178
202
  npx arkgate upgrade --apply
179
203
  ```
180
204
 
181
- This updates through the detected package manager and hands control to the new
182
- package for a fresh preview. Review that new preview; do not assume the old
183
- candidate and new candidate are identical. If already on the latest package,
184
- retain the current read-only preview.
205
+ This updates through the detected package manager (registry-aware) and hands control to the new
206
+ package for a fresh preview. On skip, read `reasonCode` / `suggestedInstallCmd` agents must not
207
+ invent recovery. Review the new preview; do not assume old and new candidates are identical.
208
+ If already current (`ALREADY_CURRENT`), retain the read-only preview and still read `whatsNew`
209
+ + `skillDrift`.
185
210
 
186
211
  For pnpm repositories with `minimumReleaseAge`, use the repository's existing
187
212
  trusted first-party exception mechanism when the new release is still cooling
@@ -199,18 +224,25 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
199
224
  ```
200
225
 
201
226
  If recorded deletion/conflict recovery is desired, ask first and then add
202
- `--accept-conflicts`. Never add it merely to make the run green. Run a second
203
- preview and require `summary.changed: 0`.
227
+ `--accept-conflicts`. Never add it merely to make the run green.
228
+
229
+ If customized **skills** should match package templates after pin bump, ask first and add
230
+ `--refresh-skills` on the digest-bound apply (or a new preview that includes the flag). Never
231
+ add it merely to make the run green. Run a second preview and require `summary.changed: 0`
232
+ (unless more deliberate refreshes remain).
204
233
 
205
- 5. **Verify enforcement and architecture.** Run
234
+ 5. **Verify enforcement and architecture (post-upgrade checks).** Read apply JSON
235
+ `postUpgradeChecks` when present. Also run:
206
236
  `npx arkgate-check --doctor --json` (or the project-local `ark-check`) and
207
237
  the same fail-closed architecture command used by managed apply (normally
208
238
  `npx arkgate-check --root . --config ark.config.json --strict-merge --json`).
209
- Require `completeness: "complete"` and `ok: true`. Treat provider-unavailable CI
210
- required-check evidence as `unverified`, never as proof that merges are
211
- blocked. If new violations appear, hand off to `/ark-fix` for a small set or
212
- `/ark-loop` / `/ark-autopilot` for residual debt; do not regenerate a baseline
213
- without explicit approval.
239
+ Require `completeness: "complete"` and `ok: true`. Confirm `doctor.improvementCompass` and
240
+ `doctor.deepModuleCoach` honesty. Run `npx arkgate agents-md --check` and
241
+ `npx arkgate status --json`. If MCP was used, restart MCP after package bump and re-bind
242
+ identity. Treat provider-unavailable CI required-check evidence as `unverified`, never as proof
243
+ that merges are blocked. If new violations appear, hand off to `/ark-fix` for a small set or
244
+ `/ark-loop` / `/ark-autopilot` for residual debt; do not regenerate a baseline without explicit
245
+ approval.
214
246
 
215
247
  ## Active host vs deferred hosts
216
248