arkgate 4.4.0 → 4.5.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 +47 -2
- package/README.md +5 -4
- package/bin/ark-check-runtime.mjs +34 -13
- package/bin/ark-layer-match.mjs +25 -12
- package/bin/lib/analysis-engine.mjs +5 -5
- package/bin/lib/html-report.mjs +8 -1
- package/bin/lib/improvement-compass-map.mjs +507 -0
- package/bin/lib/improvement-compass-types.mjs +85 -0
- package/bin/lib/improvement-compass.mjs +10 -561
- package/bin/lib/managed-upgrade-honesty.mjs +201 -0
- package/bin/lib/managed-upgrade.mjs +37 -4
- package/bin/lib/status-command.mjs +127 -2
- package/bin/lib/status-manifest.mjs +163 -14
- package/dist/eslint/index.cjs +2 -2
- package/dist/eslint/index.js +2 -2
- package/dist/index.cjs +33 -33
- package/dist/index.d.ts +126 -21
- package/dist/index.js +33 -33
- package/docs/README.md +5 -5
- package/docs/agent-guide.md +35 -8
- package/docs/develop.md +3 -1
- package/docs/package-surface.md +7 -6
- package/docs/product-voice.md +4 -1
- package/docs/use.md +30 -0
- package/package.json +1 -1
- package/schemas/ark.status-manifest.schema.json +28 -1
- package/server.json +2 -2
package/docs/README.md
CHANGED
|
@@ -53,15 +53,15 @@ 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. 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. domain fitness & session truth for **4.5.0** with honesty modes / mandatory domain split / self-service residual, 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.
|
|
62
|
-
Next prepare: [releases/4.
|
|
63
|
-
Prior: [releases/4.
|
|
64
|
-
Previous: [releases/4.2.
|
|
61
|
+
Current published: [releases/4.4.0.md](releases/4.4.0.md) (`arkgate@4.4.0` on npm `latest`).
|
|
62
|
+
Next prepare: [releases/4.5.0.md](releases/4.5.0.md) (Status: prepared — not on npm until publish verify).
|
|
63
|
+
Prior: [releases/4.3.0.md](releases/4.3.0.md) (`arkgate@4.3.0`).
|
|
64
|
+
Previous: [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
65
|
Previous major: [releases/4.0.0.md](releases/4.0.0.md) (`arkgate@4.0.0`).
|
|
66
66
|
Config: [configuration.md](configuration.md) · Agent skills dual-plane: [agent-guide.md](agent-guide.md).
|
|
67
67
|
|
package/docs/agent-guide.md
CHANGED
|
@@ -59,7 +59,31 @@ path is authoritative only when that matching project id is also supplied. Only
|
|
|
59
59
|
`binding.status: "matched"` with `authoritative: true` is authoritative; calls that omit the
|
|
60
60
|
expectation remain compatible but are explicitly `unverified`.
|
|
61
61
|
|
|
62
|
-
###
|
|
62
|
+
### Session recipe (agent turn)
|
|
63
|
+
|
|
64
|
+
Default loop for each agent session (product language — no inventing residual):
|
|
65
|
+
|
|
66
|
+
1. **Bind identity** — call `ark_identity` with `project.expectedRoot` = exact absolute project
|
|
67
|
+
root. Reuse root + returned `projectId` on later tools. Only `binding.status: "matched"` with
|
|
68
|
+
`authoritative: true` is authoritative.
|
|
69
|
+
2. **Read status** — `ark status --json` / MCP `ark_status` for identity, write-path activation,
|
|
70
|
+
last-check summary, residual lens ids (`improvementCompass`), and primary next action.
|
|
71
|
+
3. **Act** — address residual / next action / stable `findingRef` from diagnostics. Never invent
|
|
72
|
+
green residual lenses. Projection, skills, and AGENTS.md never enforce.
|
|
73
|
+
4. **Doctor when compass mode is not full** — if `improvementCompass.mode` is `subset` or
|
|
74
|
+
`unavailable`, run `ark-check --doctor` (and `--json` for the full 15-lens map) before treating
|
|
75
|
+
residual as complete. When mode is `full`, status residual ids are a subset of doctor residual
|
|
76
|
+
for the same facts.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx ark status --json --expected-root /abs/project/root
|
|
80
|
+
# mode !== full → full residual map:
|
|
81
|
+
npx ark-check --doctor --json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Product path: [use.md — Session recipe](use.md#session-recipe-agent-turn).
|
|
85
|
+
|
|
86
|
+
### Improvement compass (doctor + status)
|
|
63
87
|
|
|
64
88
|
`ark-check --doctor` (human + `--json`) projects residual architecture work as a closed set of
|
|
65
89
|
**lenses** (`doctor.improvementCompass`). Always `notAScore: true`. Never feeds `valid`,
|
|
@@ -67,17 +91,20 @@ strict-merge exit, or plan `goal.met`. Out-of-scope lenses (scalability, app sec
|
|
|
67
91
|
full resilience) stay honest. Product path: [use.md — Improvement compass](use.md#improvement-compass-not-a-score).
|
|
68
92
|
Package surface row: [package-surface.md](package-surface.md).
|
|
69
93
|
|
|
70
|
-
**Status snapshot:**
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
**Status snapshot:** `ark status --json` / MCP `ark_status` project a thin `improvementCompass`
|
|
95
|
+
with explicit honesty **`mode`**: `full` \| `subset` \| `unavailable` (always `notAScore: true`).
|
|
96
|
+
Incomplete facts → `subset` / `unavailable` + reason — **never invent green residual**. Residual
|
|
97
|
+
never flips gate verdicts and never alone rewrites status `nextAction` as a score. When mode is
|
|
98
|
+
not `full`, follow the [session recipe](#session-recipe-agent-turn) and run doctor.
|
|
73
99
|
|
|
74
100
|
Compact router and skills read residual lenses in plain language; green edges alone are never
|
|
75
101
|
“architecture finished” while residual remains.
|
|
76
102
|
|
|
77
|
-
### Unified status snapshot (4.3)
|
|
103
|
+
### Unified status snapshot (4.3+)
|
|
78
104
|
|
|
79
105
|
For one machine-readable session/project manifest (identity binding, honest write-path activation,
|
|
80
|
-
last-check summary, rules residual counts, primary next action)
|
|
106
|
+
last-check summary, rules residual counts, primary next action, improvement-compass residual map)
|
|
107
|
+
use:
|
|
81
108
|
|
|
82
109
|
```bash
|
|
83
110
|
npx ark status --json
|
|
@@ -87,8 +114,8 @@ npx ark status --json --expected-root /abs/project/root
|
|
|
87
114
|
|
|
88
115
|
MCP parity tool: **`ark_status`** (same envelope; pass `project.expectedRoot` after `ark_identity`).
|
|
89
116
|
Schema: `arkgate/schema/status-manifest`. Never prompts; under `CI=1` JSON is forced. **Not a
|
|
90
|
-
score** — counts and
|
|
91
|
-
[Write-path honesty](#write-path-honesty).
|
|
117
|
+
score** — counts, honesty modes, and residual ids only. Write-path interpretation of activation vs
|
|
118
|
+
merge teeth is under [Write-path honesty](#write-path-honesty).
|
|
92
119
|
|
|
93
120
|
**Stable finding refs (4.3):** every factory-emitted diagnostic on CLI JSON, MCP analysis
|
|
94
121
|
envelopes, and opt-in hook repair payloads (`ARK_REPAIR_JSON`) carries:
|
package/docs/develop.md
CHANGED
|
@@ -69,7 +69,9 @@ can show `runtimeObserved: true` even when branch-protection policy is plan-unav
|
|
|
69
69
|
| Rules inventory (brownfield) | `arkgate-check --rules-inventory` · MCP `ark_rules_inventory` |
|
|
70
70
|
| Stable package API | [package-surface.md](package-surface.md) |
|
|
71
71
|
| Diagnostic codes (`ruleId` why/fix) | [diagnostics.md](diagnostics.md) · root `DIAGNOSTIC_CATALOG` |
|
|
72
|
-
| Session / project status snapshot | `ark status --json` · MCP `ark_status` · [
|
|
72
|
+
| Session / project status snapshot | `ark status --json` · MCP `ark_status` · [session recipe](agent-guide.md#session-recipe-agent-turn) · schema `arkgate/schema/status-manifest` |
|
|
73
|
+
| Status compass honesty | `improvementCompass.mode`: `full` \| `subset` \| `unavailable` · residual ⊆ doctor when `full` · [package-surface](package-surface.md) |
|
|
74
|
+
| Managed upgrade self-service | `ark upgrade --json` → `selfService` (activation labels + customized preserve) · [package-surface](package-surface.md) |
|
|
73
75
|
| Version-matched AGENTS projection | `ark agents-md` · [agent-guide](agent-guide.md) · **non-authoritative** (never enforces) |
|
|
74
76
|
| Stable finding refs (`findingRef` / `targetKey`) | analysis-result schema **1.5** · [agent-guide](agent-guide.md) · [package-surface](package-surface.md) |
|
|
75
77
|
| Agent Skills layout (same 13 names) | `templates/agent-skills/` · [agent-guide](agent-guide.md#install-skills-ark-and-ecosystem) · `npx skills add …` |
|
package/docs/package-surface.md
CHANGED
|
@@ -18,7 +18,7 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
18
18
|
|---------|----------------|-----------------|
|
|
19
19
|
| **CLI** | `arkgate` / `arkgate-check` (aliases `ark` / `ark-check`) | Flags and human text may improve; **JSON output shapes** for `--json` (check, doctor, plan, coverage, recommend, **status**, **agents-md**) are stable within a major. Additive fields OK; removals/renames are major. From 4.2, `--require-gates` implies strict config and verifies semantic Ark AGENTS, project-rooted MCP/compact Codex registration, and fail-closed CI rather than file presence alone. `ark status --json` is the unified status snapshot. `ark agents-md` is the version-matched agent projection (non-authoritative). |
|
|
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
|
-
| **Improvement compass (4.4)** | `ark-check --doctor --json` → `doctor.improvementCompass`; human doctor section **Improvement compass (not a score)**; HTML report `data-advisory="improvementCompass"`.
|
|
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
|
| **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. |
|
|
23
23
|
| **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. |
|
|
24
24
|
| **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. |
|
|
@@ -40,6 +40,7 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
40
40
|
| **ArkRules inventory / under-contract (4.0; layer context 4.2)** | `ark-check --rules-inventory [--json]`; doctor `rulesUnderContract`; MCP `ark_rules_inventory` | Additive. Honest counts (inventoried / under-contract / frozen) — **never a score**. When configured layer evidence exists it overrides filename role guesses: a Domain file named `handler` is not a controller candidate. Test/fixture/seed/migration/exclusion surfaces plus narrow development-identity, PostgreSQL OID, and technical I/O constants are silent. Without layer evidence, backward-compatible path/content heuristics remain. Structure/invariant diagnostics use adapter `1.4` provenance. |
|
|
41
41
|
| **`arkgate/schema/project-identity`** or **`arkgate/schema/ark.project-identity.schema.json`** | MCP canonical project, contract, runtime, expectation, and binding envelope | Schema `1.0`. Initial `expectedRoot` must be the exact project root. A contained descendant can match only when `expectedProjectId` is also present and correct; id-only matching stays non-authoritative. Mismatch codes are `PROJECT_ROOT_MISMATCH`, `PROJECT_ID_MISMATCH`, and `INVALID_PROJECT_EXPECTATION`. |
|
|
42
42
|
| **Package pin dual-truth (4.0)** | doctor JSON `packageVersionTruth`; upgrade JSON/human note when pin behind CLI | Additive, advisory. Surfaces after `upgrade --no-install` when managed CLI is ahead of package.json. |
|
|
43
|
+
| **Managed upgrade self-service honesty (4.5 / DF05)** | `ark upgrade [--json]` → `selfService` (+ human “Self-service honesty” lines) | Additive, advisory. Answers without a maintainer: write-path activation labels per selected host (`hard`\|`advisory`\|`unavailable`) and customized content-identity preserve (`customizedPaths` / `customizedContentPreserved`). Soft hosts never hard; upgrade never invents `hardWriteActive` from disk alone. Always `notAScore: true`. Not a gate input; not part of `planDigest`. |
|
|
43
44
|
| **Product honesty readiness split (4.1.1)** | doctor JSON `productHonesty` | Additive. `unfinished` / `headline` / `primaryNextAction` / `reasonIds` remain; EH adds `contractReadiness` (`ready`\|`partial`\|`not-ready`), `localWriteBoundary` (`advisory`\|`hard`\|`unverified`\|`unknown`), `architectureReasonIds`, `environmentResidualIds` / `environmentResiduals`. Soft-write hosts stay in evidence without alone forcing global **Not finished**. `notAScore: true` always. |
|
|
44
45
|
| **Policy transition analysis (3.1.0)** | `analyzePolicyDelta(...)`; MCP `ark_policy_delta`; CLI `--policy-base` / `--policy-base-ref` / `--policy-ack`; check JSON `policyDelta` | Additive schema `1.0`. Classifications and finding ids are deterministic. Weakening/judgment requires an acknowledgement bound to both policy hashes and the exact blocking finding set. |
|
|
45
46
|
| **Atomic change preflight (3.1.0)** | `preflightChange(...)`; CLI `ark preflight --changes <file> --json`; MCP `ark_prepare_change` | Additive schema `1.0`. One complete governed production-source `{path,content}` / `{path,delete:true}` batch; read-only; returns operation, content/tree/policy/compiler fingerprints and stable graph findings. MCP availability alone is advisory. |
|
|
@@ -51,7 +52,7 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
51
52
|
| **`arkgate/schema/analysis-result`** or **`arkgate/schema/ark.analysis-result.schema.json`** | Public CLI/MCP/hook diagnostic envelope (`schemaVersion`, `mode`, `valid`, `completeness`, `completenessReasons`, `diagnostics`, resolved identities) | Schema **`1.5`** adds optional stable finding refs on diagnostics: `findingRef` (`fnv1a-` + hex), `targetKey` (baseline-compatible freeze identity), `docsCodePath` (`docs/diagnostics.md#RULE_ID`). Factory-emitted diagnostics always include them; consumer-owned 1.0–1.4 values remain valid without them. `1.4` added optional `evidence.arkruleId` / `evidence.arkruleSource` for ArkRules; `1.3` distinguished `resolved-candidate-facts` from `lexical-compatibility`; partial/unavailable analysis is always non-green, and resolved complete/partial results require policy/resolver/facts/tree identities. `1.2` added completeness and remains accepted alongside consumer-owned 1.0/1.1 values. |
|
|
52
53
|
| **Stable finding refs (4.3)** | Root API `adapterFindingTargetKey` / `adapterFindingRefFromTargetKey` / `toAdapterDiagnostic` / `createAdapterResult`; CLI/MCP/repair envelopes via analysis-result diagnostics | Multi-turn re-address without fuzzy message match. `targetKey` **is** the baseline (occurrence) key so freeze identity is never orphaned; `findingRef` is a compact FNV-1a of that key. Line/message drift does not change the ref. Multi-turn fixture: `tests/fixtures/finding-refs/multi-turn-stability.json`. |
|
|
53
54
|
| **Diagnostic code catalog** | Root API `DIAGNOSTIC_CATALOG` / `getDiagnosticCatalogEntry` / `diagnosticDocsPath`; docs [diagnostics.md](diagnostics.md) (`#RULE_ID` anchors) | Closed vocabulary of public `ruleId`s with why/fix anchors. Cataloguing only — no new rule semantics. Remediation parity is test-guarded. Docs ship in the npm tarball. |
|
|
54
|
-
| **Status manifest** | CLI `ark status [--json]`; MCP `ark_status`; `arkgate/schema/status-manifest`; root API `buildStatusManifest` / `ARK_STATUS_MANIFEST_SCHEMA` | Schema `1.0`. One session/project snapshot: identity binding, honest write-path activation (`hard`\|`advisory`\|`unavailable`), last-check summary, rules residual counts, primary next action
|
|
55
|
+
| **Status manifest** | CLI `ark status [--json]`; MCP `ark_status`; `arkgate/schema/status-manifest`; root API `buildStatusManifest` / `ARK_STATUS_MANIFEST_SCHEMA` / `projectStatusImprovementCompass` | Schema `1.0`. One session/project snapshot: identity binding, honest write-path activation (`hard`\|`advisory`\|`unavailable`), last-check summary, rules residual counts, primary next action, and **`improvementCompass`** with honesty **`mode`** `full`\|`subset`\|`unavailable` (residual ids only; always `notAScore: true`; optional `reasonCode`/`reason`/`factsSource`/`contractHash`). **Not a score.** Residual never changes gate verdicts. Never prompts (`CI=1` forces JSON). Optional `--expected-root` / `--expected-project-id` (MCP `project`) for matched vs stale identity. |
|
|
55
56
|
| **Agent contract projection** | CLI `ark agents-md [--write] [--check] [--stdout] [--json]`; install/upgrade AGENTS templates; root API `buildAgentProjectionBlock` / `mergeAgentProjectionDocument` | Schema `1.0` (projection markers). Version-stamped managed block (`arkgateVersion` + contract summary + diagnostic short list). **Non-authoritative** — not a gate input; enforcement is ark-check / hooks / CI. Content-identity merge preserves customized regions outside markers. Drift: `--check` vs package version. |
|
|
56
57
|
| **Agent Skills packaging** | `templates/agent-skills/<name>/SKILL.md` (+ package README); root API `ARK_SKILL_NAMES` / `validateAgentSkillsPackage`; `npm run check:agent-skills` | Schema `1.0` (package contract). Same **13** skill names as flat templates; Agent Skills–compatible layout for `npx skills add`. No new skill names. Layout is generated 1:1 from `templates/skills/*.md`. |
|
|
57
58
|
| **`arkgate/schema/arkrules`** or **`arkgate/schema/ark.arkrules.schema.json`** | Per-layer structure sensors + invariant catalog (ADR 0012) | Schema `1.0`. Opt-in via root `arkRules` map (`ark.config` schema `1.1`). |
|
|
@@ -204,10 +205,10 @@ production deployment would need to satisfy; it is not a readiness certification
|
|
|
204
205
|
## Release notes (maintainers)
|
|
205
206
|
|
|
206
207
|
Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
|
|
207
|
-
(current published: [4.
|
|
208
|
-
next prepare: [4.
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
(current published: [4.4.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.4.0.md);
|
|
209
|
+
next prepare: [4.5.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.5.0.md);
|
|
210
|
+
prior published: [4.3.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.3.0.md),
|
|
211
|
+
[4.2.1.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.2.1.md);
|
|
211
212
|
previous: [4.2.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.2.0.md),
|
|
212
213
|
[4.1.1.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.1.1.md),
|
|
213
214
|
[4.1.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.1.0.md),
|
package/docs/product-voice.md
CHANGED
|
@@ -97,12 +97,15 @@ Examples:
|
|
|
97
97
|
| **diagnostic code** / **ruleId** | Stable public violation id (e.g. `LAYER_IMPORT_VIOLATION`) with shared why/fix anchors — catalog-linked, not prose-only ([diagnostics.md](diagnostics.md)) |
|
|
98
98
|
| **agent projection** | Version-matched AGENTS/CLAUDE (or equivalent) block generated from package + contract; **non-authoritative** — enforcement is ark-check / hooks / CI |
|
|
99
99
|
| **finding ref** | Stable id for a finding across turns (ruleId + target key), so agents re-address without fuzzy message match |
|
|
100
|
-
| **status snapshot** | One machine-readable project/session manifest (`ark status --json` shape): identity, activation honesty, last check, residual counts — not a numeric score |
|
|
100
|
+
| **status snapshot** | One machine-readable project/session manifest (`ark status --json` shape): identity, activation honesty, last check, residual counts, thin compass residual map — not a numeric score |
|
|
101
|
+
| **session recipe** | Agent loop: bind identity → read status → act on residual / findingRef; run doctor when status compass mode is not `full` |
|
|
102
|
+
| **compass mode** | Status honesty label for the projected residual map: `full` \| `subset` \| `unavailable` — never invent green residual |
|
|
101
103
|
| **improvement compass** | Closed projection of residual architecture work across fixed **lenses** (aligned to 15 common principles). Always `notAScore`. Never a gate input. |
|
|
102
104
|
| **lens** | One named principle dimension (`soc`, `dip`, `domain`, …) with status `ok` / `residual` / `not-instrumented` / `out-of-scope` and evidence refs from existing sensors |
|
|
103
105
|
| **topResidual** | Deterministic short list of residual lens ids — what to improve next, not a ranking score |
|
|
104
106
|
| **out-of-scope lens** | Principle Ark does not instrument (e.g. scalability APM, SAST) — say so; do not invent residual |
|
|
105
107
|
| **AI-easy architecture** | Small, pure, placeable modules and a golden pattern so the next agent turn stays ordered under the contract |
|
|
108
|
+
| **self-service upgrade honesty** | After managed upgrade, consumers can see write-path activation labels and customized-content preserve without asking a maintainer |
|
|
106
109
|
|
|
107
110
|
## Public docs are product-only (from 4.4.0)
|
|
108
111
|
|
package/docs/use.md
CHANGED
|
@@ -105,6 +105,34 @@ npx arkgate-check --install-agent-gates --skills-only --force
|
|
|
105
105
|
|
|
106
106
|
---
|
|
107
107
|
|
|
108
|
+
## Session recipe (agent turn)
|
|
109
|
+
|
|
110
|
+
Short loop so agents do not invent residual or re-run doctor every message:
|
|
111
|
+
|
|
112
|
+
1. **Bind identity** — MCP: call `ark_identity` with `project.expectedRoot` set to the project’s
|
|
113
|
+
exact absolute root; reuse that root plus the returned `projectId` on later Ark tools. CLI:
|
|
114
|
+
pass `--expected-root /abs/project/root` on `ark status` when you need matched vs stale binding.
|
|
115
|
+
2. **Read status** — `npx ark status --json` (or MCP `ark_status`) for identity, write-path
|
|
116
|
+
activation honesty, last-check summary, residual lens ids, and primary next action.
|
|
117
|
+
3. **Act** — work the residual / next action / stable `findingRef` from check diagnostics. Do not
|
|
118
|
+
invent green residual lenses. Green edges alone are never “architecture finished.”
|
|
119
|
+
4. **Doctor when status is incomplete** — if status `improvementCompass.mode` is **`subset`** or
|
|
120
|
+
**`unavailable`** (or compass facts are missing), run `npx ark-check --doctor` (add `--json` for
|
|
121
|
+
the full 15-lens map) before treating residual as complete. When mode is **`full`**, status
|
|
122
|
+
residual ids are a safe subset of doctor residual for the same facts.
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npx ark status --json --expected-root /abs/project/root
|
|
126
|
+
# when mode is not full:
|
|
127
|
+
npx ark-check --doctor
|
|
128
|
+
npx ark-check --doctor --json # doctor.improvementCompass
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Details: [agent-guide — Session recipe](agent-guide.md#session-recipe-agent-turn) ·
|
|
132
|
+
[package surface — status / compass](package-surface.md).
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
108
136
|
## Improvement compass (not a score)
|
|
109
137
|
|
|
110
138
|
Doctor shows an **improvement compass**: a closed set of architecture **lenses** (separation of
|
|
@@ -125,6 +153,8 @@ Improvement compass (not a score)
|
|
|
125
153
|
| Never a gate input | Residual alone does **not** fail CI or flip `valid` |
|
|
126
154
|
|
|
127
155
|
JSON: `ark-check --doctor --json` → `doctor.improvementCompass` (full lenses + `topResidual`).
|
|
156
|
+
Status also projects a thin residual map with honesty **`mode`**: `full` \| `subset` \| `unavailable`
|
|
157
|
+
(always `notAScore`) — see [Session recipe](#session-recipe-agent-turn).
|
|
128
158
|
Human doctor prints the short section above.
|
|
129
159
|
|
|
130
160
|
### Align → Stabilize → Shape
|
package/package.json
CHANGED
|
@@ -242,11 +242,12 @@
|
|
|
242
242
|
},
|
|
243
243
|
"improvementCompass": {
|
|
244
244
|
"type": "object",
|
|
245
|
-
"description": "
|
|
245
|
+
"description": "Thin improvement-compass residual ids with honesty mode (notAScore). full | subset | unavailable. Never a gate input; full lenses on doctor JSON. When full, residual ids ⊆ doctor residual for the same facts. unavailable never invents green residual.",
|
|
246
246
|
"additionalProperties": false,
|
|
247
247
|
"required": [
|
|
248
248
|
"schemaVersion",
|
|
249
249
|
"notAScore",
|
|
250
|
+
"mode",
|
|
250
251
|
"topResidual"
|
|
251
252
|
],
|
|
252
253
|
"properties": {
|
|
@@ -256,6 +257,13 @@
|
|
|
256
257
|
"notAScore": {
|
|
257
258
|
"const": true
|
|
258
259
|
},
|
|
260
|
+
"mode": {
|
|
261
|
+
"enum": [
|
|
262
|
+
"full",
|
|
263
|
+
"subset",
|
|
264
|
+
"unavailable"
|
|
265
|
+
]
|
|
266
|
+
},
|
|
259
267
|
"topResidual": {
|
|
260
268
|
"type": "array",
|
|
261
269
|
"items": {
|
|
@@ -263,6 +271,25 @@
|
|
|
263
271
|
"minLength": 1
|
|
264
272
|
},
|
|
265
273
|
"maxItems": 15
|
|
274
|
+
},
|
|
275
|
+
"reasonCode": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"minLength": 1
|
|
278
|
+
},
|
|
279
|
+
"reason": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"minLength": 1
|
|
282
|
+
},
|
|
283
|
+
"factsSource": {
|
|
284
|
+
"enum": [
|
|
285
|
+
"doctor-facts",
|
|
286
|
+
"report-snapshot",
|
|
287
|
+
"none"
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
"contractHash": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"minLength": 1
|
|
266
293
|
}
|
|
267
294
|
}
|
|
268
295
|
}
|
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.
|
|
9
|
+
"version": "4.5.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "arkgate",
|
|
14
|
-
"version": "4.
|
|
14
|
+
"version": "4.5.0",
|
|
15
15
|
"runtimeHint": "npx",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|