arkgate 4.8.14 → 4.8.15
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 +133 -0
- package/README.md +13 -5
- package/bin/ark-check-runtime.mjs +17 -49
- package/bin/ark-mcp-runtime.mjs +111 -2
- package/bin/ark-shared.mjs +140 -11
- package/bin/ark.mjs +7 -25
- package/bin/lib/adr-presence.mjs +97 -0
- package/bin/lib/agent-skills-package.mjs +179 -1
- package/bin/lib/analysis-completeness.mjs +38 -2
- package/bin/lib/analysis-engine.mjs +6 -6
- package/bin/lib/architecture-scan.mjs +26 -4
- package/bin/lib/ark-run-doctor.mjs +6 -0
- package/bin/lib/ark-run-report.mjs +6 -2
- package/bin/lib/arkrules-sensors.mjs +81 -0
- package/bin/lib/baseline-key.mjs +4 -1
- package/bin/lib/check-args.mjs +52 -2
- package/bin/lib/config-contract.mjs +64 -1
- package/bin/lib/diagnostic-catalog.mjs +3 -1
- package/bin/lib/doctor-advisories.mjs +94 -10
- package/bin/lib/doctor-human.mjs +18 -5
- package/bin/lib/doctor-next-actions.mjs +14 -0
- package/bin/lib/doctor-plan.mjs +32 -2
- package/bin/lib/enforcement-honesty.mjs +47 -2
- package/bin/lib/first-run-help.mjs +8 -1
- package/bin/lib/host-support-matrix.mjs +9 -1
- package/bin/lib/html-report-depth.mjs +2 -0
- package/bin/lib/html-report.mjs +13 -2
- package/bin/lib/import-resolve.mjs +74 -13
- package/bin/lib/improvement-compass-doctor.mjs +6 -1
- package/bin/lib/improvement-compass-map.mjs +3 -1
- package/bin/lib/layer-description.mjs +90 -8
- package/bin/lib/mcp-hook-payload.mjs +56 -0
- package/bin/lib/no-domain-frontend.mjs +91 -0
- package/bin/lib/presets.mjs +3 -4
- package/bin/lib/product-copy.mjs +15 -0
- package/bin/lib/projected-governed-coverage.mjs +114 -0
- package/bin/lib/recommend-cli.mjs +54 -0
- package/bin/lib/remediation.mjs +4 -0
- package/bin/lib/resolved-candidate-facts.mjs +83 -66
- package/bin/lib/rules-under-contract.mjs +117 -2
- package/bin/lib/snippet-analysis.mjs +14 -8
- package/bin/lib/start-preview.mjs +5 -2
- package/bin/lib/states-transitions-presence.mjs +212 -0
- package/bin/lib/status-command.mjs +2 -0
- package/bin/lib/status-transition-catalog.mjs +410 -0
- package/bin/lib/team-parliament-io.mjs +10 -0
- package/bin/lib/violations.mjs +13 -1
- package/bin/lib/write-path-capabilities.mjs +20 -5
- package/bin/lib/write-path-detect.mjs +27 -2
- package/dist/{configTypes-j7so8B4O.d.ts → configTypes-Dt3DpVbd.d.ts} +19 -0
- package/dist/{diagnosticCatalog-DVx_2RmF.d.ts → diagnosticCatalog-BEg85XlE.d.ts} +3 -3
- package/dist/eslint/index.cjs +4 -4
- package/dist/eslint/index.d.ts +1 -1
- package/dist/eslint/index.js +4 -4
- package/dist/index.cjs +31 -31
- package/dist/index.d.ts +70 -9
- package/dist/index.js +31 -31
- package/dist/nestjs/index.cjs +5 -5
- package/dist/nestjs/index.d.ts +3 -3
- package/dist/nestjs/index.js +5 -5
- package/dist/runtime/index.cjs +15 -15
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.js +15 -15
- package/dist/{types-Djbs3KjE.d.ts → types-CN9tVMPz.d.ts} +3 -1
- package/dist/{types-tGhZUiGX.d.ts → types-TBiv0WHL.d.ts} +1 -1
- package/docs/README.md +1 -1
- package/docs/agent-guide.md +6 -4
- package/docs/ai-gates.md +10 -3
- package/docs/brownfield-adoption.md +4 -1
- package/docs/configuration.md +55 -7
- package/docs/develop.md +1 -0
- package/docs/diagnostics.md +23 -3
- package/docs/enthusiast/how-to-agent-gates.md +5 -0
- package/docs/enthusiast/how-to-pick-shape.md +1 -1
- package/docs/package-surface.md +7 -5
- package/docs/use.md +5 -0
- package/package.json +1 -1
- package/schemas/ark.config.schema.json +23 -2
- package/server.json +2 -2
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +82 -1
- package/templates/agent-skills/ark-autopilot/SKILL.md +6 -2
- package/templates/agent-skills/ark-coverage/SKILL.md +1 -1
- package/templates/agent-skills/ark-explain/SKILL.md +4 -2
- package/templates/agent-skills/ark-explore/SKILL.md +14 -1
- package/templates/agent-skills/ark-place/SKILL.md +38 -3
- package/templates/agent-skills/ark-runtime/SKILL.md +4 -2
- package/templates/agent-skills/ark-upgrade/SKILL.md +1 -1
- package/templates/arkrules/DomainModel.json +14 -1
- package/templates/skills/ark-adopt.md +82 -1
- package/templates/skills/ark-autopilot.md +6 -2
- package/templates/skills/ark-coverage.md +1 -1
- package/templates/skills/ark-explain.md +4 -2
- package/templates/skills/ark-explore.md +14 -1
- package/templates/skills/ark-place.md +38 -3
- package/templates/skills/ark-runtime.md +4 -2
- package/templates/skills/ark-upgrade.md +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-
|
|
1
|
+
import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-Dt3DpVbd.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Policy types for the Ark kernel.
|
|
@@ -145,6 +145,8 @@ interface ArchitectureLayer {
|
|
|
145
145
|
*/
|
|
146
146
|
match?: (name: string) => boolean;
|
|
147
147
|
description?: string;
|
|
148
|
+
trustBoundary?: 'public' | 'auth' | 'admin' | 'internal';
|
|
149
|
+
owners?: string[];
|
|
148
150
|
order?: number;
|
|
149
151
|
}
|
|
150
152
|
type ArchitectureRule = ArkConfigRule;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Policy, P as PolicyViolation, I as IntentName, j as IntentCreator, k as IntentRelationship, b as ArchitectureProfile, D as DomainEvent, E as EventMetadata, h as PolicyEnforcementMode, A as ArchitectureLayer, c as ArchitectureRule, d as ArkCheckConfig } from './types-
|
|
1
|
+
import { i as Policy, P as PolicyViolation, I as IntentName, j as IntentCreator, k as IntentRelationship, b as ArchitectureProfile, D as DomainEvent, E as EventMetadata, h as PolicyEnforcementMode, A as ArchitectureLayer, c as ArchitectureRule, d as ArkCheckConfig } from './types-CN9tVMPz.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* PolicyEngine
|
package/docs/README.md
CHANGED
|
@@ -73,7 +73,7 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
|
|
|
73
73
|
| Field adoption kit (scaffolding, not closed) | [field/](field/) |
|
|
74
74
|
| Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
|
|
75
75
|
|
|
76
|
-
Prepared: [CHANGELOG](../CHANGELOG.md) (`arkgate@4.8.
|
|
76
|
+
Prepared: [CHANGELOG](../CHANGELOG.md) (`arkgate@4.8.15`; not published until `publish-npm` for `v4.8.15`).
|
|
77
77
|
Current published: [releases/4.8.11.md](releases/4.8.11.md) (`arkgate@4.8.11` on npm `latest`; does not close `K01`).
|
|
78
78
|
Prior published: [releases/4.8.10.md](releases/4.8.10.md) (`arkgate@4.8.10`).
|
|
79
79
|
Prior published: [releases/4.8.9.md](releases/4.8.9.md) (`arkgate@4.8.9`).
|
package/docs/agent-guide.md
CHANGED
|
@@ -46,7 +46,8 @@ ark start → ark start --apply → ark-check --doctor
|
|
|
46
46
|
|
|
47
47
|
`arkgate-check --doctor` shows what's wrong and what to do first. From **4.0.0**, doctor may
|
|
48
48
|
also report **`rulesUnderContract`** (ArkRules counts) and **`packageVersionTruth`** when the
|
|
49
|
-
CLI is ahead of the package.json pin.
|
|
49
|
+
CLI is ahead of the package.json pin. Compact doctor names ArkRules only when the
|
|
50
|
+
`arkRules` map is on — absence stays silent. The compact router from `ark start` is enough for normal
|
|
50
51
|
feature work. Full `/ark-*` skills are **expert depth** and label residual **`[Layer]`** vs
|
|
51
52
|
**`[ArkRules]`** (except experimental `/ark-runtime`):
|
|
52
53
|
|
|
@@ -279,7 +280,7 @@ npx ark-check --recommend --json
|
|
|
279
280
|
`--recommend` does not require `ark.config.json`. It exits `0` and prints a progressive
|
|
280
281
|
adoption plan: archetype id, preset, `confidence`, `runnerUp`, `why` (shape signals),
|
|
281
282
|
structured positive/negative `evidence`, discovered `signals.packageUnits`,
|
|
282
|
-
`adoptInOrder.phase1`, `firstCommand` (`ark
|
|
283
|
+
`adoptInOrder.phase1`, `firstCommand` (`ark start --apply --archetype …`), and `checkCommand`.
|
|
283
284
|
When the top two shapes are close or projected governed coverage is below 90%, JSON sets
|
|
284
285
|
`requiresConfirmation: true` and explains why in `confirmationReasons`.
|
|
285
286
|
|
|
@@ -331,7 +332,8 @@ Filter: **Contener · Guiar · Ordenar** — contain the write, guide the next s
|
|
|
331
332
|
|
|
332
333
|
**Team parliament:** adopt is a **contract session** (law-only). Feature work must not edit
|
|
333
334
|
`ark.config.json` / `arkrules/*` / `.ark-baseline.json`. Prefer
|
|
334
|
-
`ark-check --
|
|
335
|
+
`ark-check --local --base <merge-ref>` (or `--changed --base`) in local gates.
|
|
336
|
+
`--strict-merge` stays the CI merge line. `--contract-diff` + `--author`
|
|
335
337
|
when `stewards` is set (`--author` is a GitHub handle or email, not git `user.name`).
|
|
336
338
|
`ark status --vs <ref>` prints pin / contract / baseline drift.
|
|
337
339
|
|
|
@@ -883,7 +885,7 @@ Filter: **Contener · Guiar · Ordenar** — contain the write, guide the next s
|
|
|
883
885
|
**Canonical authoring source:** flat `templates/skills/<name>.md` (Ark install reads these).
|
|
884
886
|
|
|
885
887
|
**Agent Skills package root** (generated, 1:1 content): `templates/agent-skills/<name>/SKILL.md`
|
|
886
|
-
— ships in the npm tarball under `templates/`. Drift guard: `npm run check:agent-skills
|
|
888
|
+
— ships in the npm tarball under `templates/`. Drift guard: `npm run check:agent-skills` (layout 1:1 **and** 100% product coverage).
|
|
887
889
|
|
|
888
890
|
```bash
|
|
889
891
|
# Ark — expert skill pack (preferred when you also want gates)
|
package/docs/ai-gates.md
CHANGED
|
@@ -28,7 +28,7 @@ overview: [develop.md](develop.md) · hub: [README.md](README.md).
|
|
|
28
28
|
| **Claude Code** | Hard PreToolUse for listed ops when installed + trusted + (for `hard:true`) runtime-observed | Required `arkgate-check --strict-merge` status |
|
|
29
29
|
| **Grok Build** | Hard PreToolUse for listed ops when installed + trusted + (for `hard:true`) runtime-observed | Required `arkgate-check --strict-merge` status |
|
|
30
30
|
| **Google Antigravity** | Hard PreToolUse for listed write tools when installed + trusted + (for `hard:true`) runtime-observed | Required `arkgate-check --strict-merge` status |
|
|
31
|
-
| **Cursor** | Hard preToolUse for Write/StrReplace when installed + trusted + runtime-observed | Required CI status (same check) |
|
|
31
|
+
| **Cursor** | Hard preToolUse for Write/StrReplace when installed + trusted + `failClosed` + runtime-observed | Required CI status (same check) |
|
|
32
32
|
| **OpenAI Codex** | Hard PreToolUse for complete local `apply_patch` in CLI/Desktop when installed + trusted + runtime-observed | Required CI status (same check) |
|
|
33
33
|
| **OpenCode** | **Advisory / best-effort** (MCP + optional experimental plugin) — **not** a hard boundary | Required CI status (same check) |
|
|
34
34
|
|
|
@@ -126,6 +126,11 @@ violations relative to the file's current on-disk state, so files with pre-exist
|
|
|
126
126
|
(baselined) violations stay editable — they just can't get worse. New files block on
|
|
127
127
|
every violation.
|
|
128
128
|
|
|
129
|
+
The hook classifies import targets with the same `layerForRelativePath` specificity as
|
|
130
|
+
`ark-check` (an explicit file pattern beats a broader glob such as `src/lib/**`).
|
|
131
|
+
`LEXICAL_EVIDENCE_INCOMPLETE` means the single-file check is provisional — `ark-check`
|
|
132
|
+
on the tree is the authority. Do not move files solely because the hook named a layer.
|
|
133
|
+
|
|
129
134
|
### Opt-in resident hook pilot (Z07)
|
|
130
135
|
|
|
131
136
|
Set `ARK_RESIDENT_HOOK=1` on both `ark-mcp` and its hook command. The pilot reuses the
|
|
@@ -329,8 +334,10 @@ Cursor supports MCP servers (`.cursor/mcp.json`) and project hooks (`.cursor/hoo
|
|
|
329
334
|
}
|
|
330
335
|
```
|
|
331
336
|
|
|
332
|
-
When that hook is installed and trusted
|
|
333
|
-
for governed TypeScript sources (exit 2 or `permission: "deny"`).
|
|
337
|
+
When that hook is installed and trusted **and** `failClosed` is `true`, Cursor **hard-blocks**
|
|
338
|
+
agent `Write` / `StrReplace` for governed TypeScript sources (exit 2 or `permission: "deny"`).
|
|
339
|
+
A hook without `failClosed` is fail-open: if the checker cannot run, the write still lands
|
|
340
|
+
(same idea as a file permission — no checker, no write). Repair envelopes may emit;
|
|
334
341
|
Cursor does **not** guarantee Write `updated_input` reinjection — the agent must fix and retry
|
|
335
342
|
from `agent_message`. Shell, Tab, and human edits still rely on CI.
|
|
336
343
|
|
|
@@ -48,7 +48,10 @@ regenerate it unasked.
|
|
|
48
48
|
|
|
49
49
|
Without this split, broad `**/app/**` Presentation patterns push every API handler into UI and
|
|
50
50
|
create a Presentation→Persistence tsunami. Specificity still wins: more-specific Application
|
|
51
|
-
globs beat Presentation.
|
|
51
|
+
globs beat Presentation. **Captions** (what doctor prints next to the layer name) mention Next
|
|
52
|
+
App Router / Pages API / `app/api` only when Next is actually present — a library
|
|
53
|
+
`packages/*` monorepo keeps library-native language. Adopt writes `.ark/golden-pattern.json`
|
|
54
|
+
(load-bearing for `/ark-place`).
|
|
52
55
|
`ark_place` requires `filePath` (fail-closed — never invents `components/*.tsx` or defaults to Presentation).
|
|
53
56
|
ArkRules stay **opt-in** (not forced on by start/adopt).
|
|
54
57
|
|
package/docs/configuration.md
CHANGED
|
@@ -9,7 +9,7 @@ The CLI, MCP server, and ESLint plugin all use the same parser, migration, defau
|
|
|
9
9
|
|
|
10
10
|
```json
|
|
11
11
|
{
|
|
12
|
-
"$schema": "https://unpkg.com/arkgate@
|
|
12
|
+
"$schema": "https://unpkg.com/arkgate@4/schemas/ark.config.schema.json",
|
|
13
13
|
"schemaVersion": "1.3",
|
|
14
14
|
"include": ["src"],
|
|
15
15
|
"layers": [],
|
|
@@ -179,6 +179,45 @@ Layer fields:
|
|
|
179
179
|
```
|
|
180
180
|
|
|
181
181
|
That sentence is product copy. Not “Rich domain model, business rules, and domain events.”
|
|
182
|
+
- **`layers[].trustBoundary`** (optional) — who this folder is for: `public` |
|
|
183
|
+
`auth` | `admin` | `internal`. Anyone, signed-in users, operators, or only
|
|
184
|
+
other code. `/ark-place` prints `trust: public` next to the layer name;
|
|
185
|
+
doctor, coverage, and the HTML report show the same tag. Changing the tag
|
|
186
|
+
does **not** change `policyHash` (same strip as `stewards` and
|
|
187
|
+
`layers[].description`) and does **not** need a weakening ack. Absence is
|
|
188
|
+
silent: never fails `--strict-config`, never invents a doctor residual, never
|
|
189
|
+
flips `valid`. A wrong value (`"trusted"`, empty string) fails the schema.
|
|
190
|
+
Compact starters may omit it. `/ark-adopt` writes it when the product map
|
|
191
|
+
already names that door; it does not invent tags. No `/ark-trust`. This is
|
|
192
|
+
**not** host/CI TLS and does **not** add import-rule teeth.
|
|
193
|
+
- **`layers[].owners`** (optional) — who owns this folder: GitHub handles or
|
|
194
|
+
emails (same identity as `stewards`). `/ark-place` prints `owner: @handle`
|
|
195
|
+
next to the layer name; doctor, coverage, and the HTML report show the same
|
|
196
|
+
names. Changing the list does **not** change `policyHash` and does **not**
|
|
197
|
+
need a weakening ack. Absence is silent unless **`requireLayerOwners`** is
|
|
198
|
+
`true`. A display name (`Pedro Knigge`), empty array, or empty string fails
|
|
199
|
+
the schema. Compact starters may omit it. `/ark-adopt` writes it when the
|
|
200
|
+
product map already names who owns the house; it does not invent people.
|
|
201
|
+
No `/ark-owners`. This is **not** import-rule teeth.
|
|
202
|
+
- **`requireLayerOwners`** (optional) — when `true`, every live (non-reserved)
|
|
203
|
+
layer must name `owners`. Doctor names the first missing house and the next
|
|
204
|
+
step. `--strict-config` / `--strict-merge` refuse. The write gate denies a
|
|
205
|
+
write into an unowned house (same idea as a folder with no name on the door).
|
|
206
|
+
Absence or `false` is silent. This flag **is** policy teeth (it stays in
|
|
207
|
+
`policyHash`). Flip it on after you have named owners incrementally.
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
"layers": [
|
|
211
|
+
{
|
|
212
|
+
"name": "Presentation",
|
|
213
|
+
"patterns": ["src/app/**"],
|
|
214
|
+
"description": "Storefront checkout — what shoppers see.",
|
|
215
|
+
"trustBoundary": "public",
|
|
216
|
+
"owners": ["pedroknigge"]
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
```
|
|
220
|
+
|
|
182
221
|
- `intentPrefixes`, `forbiddenGlobals`, `mayImportInfrastructure`, `optional`
|
|
183
222
|
- `reserved` / `allowEmpty` — future houses whose globs match nothing yet. `--strict-config` does not fail; `CONFIG_LAYER_PATTERN_NO_MATCHES` (typo warning) is skipped. A typo warning fires only when the glob is not reserved.
|
|
184
223
|
- `capabilities: { deny: [...] }` — opt-in effect walls over the seven capability ids
|
|
@@ -297,9 +336,12 @@ steps under `plan.typeOnlyGroup` when volume is high.
|
|
|
297
336
|
|
|
298
337
|
### Next.js API shell (framework overlay / presets)
|
|
299
338
|
|
|
300
|
-
When Next is detected
|
|
301
|
-
|
|
302
|
-
|
|
339
|
+
When Next is detected, **`app/api/**` and `pages/api/**` classify as Application
|
|
340
|
+
orchestration**, not Presentation. UI routes stay Presentation. More-specific Application
|
|
341
|
+
globs win over broad `**/app/**` Presentation patterns. Reserved `app/api` globs may still
|
|
342
|
+
appear on `ui-surface` / monorepo presets so a later Next route classifies correctly;
|
|
343
|
+
**layer captions** mention Next App Router / Pages API / `app/api` only when Next is
|
|
344
|
+
actually present. Library and package-monorepo start keep library-native captions.
|
|
303
345
|
See [brownfield adoption](brownfield-adoption.md#nextjs-honesty-default-overlays--ui-surface--monorepo).
|
|
304
346
|
|
|
305
347
|
### ArkRules dual plane (when `arkRules` is present)
|
|
@@ -359,6 +401,9 @@ invariants, and a covered sample when the map is active.
|
|
|
359
401
|
a hash-bound policy weakening. Empty `appliesTo: []` fails closed; zero-match globs emit
|
|
360
402
|
`ARKRULE_SCOPE_EMPTY` (advisory warn / enforced fail). Enforced + proven uncovered →
|
|
361
403
|
`INVARIANT_UNCOVERED` with `failsStrict` (partial evidence stays honest, never fake-green).
|
|
404
|
+
When `arkRules` is on and a Domain-role layer has code, empty `invariants[]` is doctor residual
|
|
405
|
+
`INVARIANT_CATALOG_EMPTY` (not “done”). Advisory unless a domain structure rule is already
|
|
406
|
+
`enforced` — then `--strict-merge` can refuse. Absence of `arkRules` stays silent.
|
|
362
407
|
|
|
363
408
|
**What they do not do:** prove business semantics end-to-end; replace Layers import edges;
|
|
364
409
|
make “green” mean elegant Shape. Promoting structure to enforced can force rename-to-pass
|
|
@@ -415,7 +460,7 @@ changing either contract changes its hash and invalidates the acknowledgement.
|
|
|
415
460
|
|
|
416
461
|
Optional `stewards` lists **GitHub handles or emails** who may **loosen** the contract or
|
|
417
462
|
**grow** the baseline (`pedroknigge` or `pedroknigge@users.noreply.github.com` — not
|
|
418
|
-
`Pedro Knigge`). The field is metadata — it does not change the policy hash. `layers[].description`
|
|
463
|
+
`Pedro Knigge`). The field is metadata — it does not change the policy hash. `layers[].description`, `layers[].trustBoundary`, and `layers[].owners` are stripped the same way (caption-only, tag-only, or owner-list edits do not change `policyHash` and do not need a weakening ack; `contractHash` still fingerprints the raw config). `requireLayerOwners` stays in the hash. The lock
|
|
419
464
|
matches `--author`, then `GITHUB_ACTOR` / `ARK_STEWARD`, then `GIT_AUTHOR_EMAIL`. A
|
|
420
465
|
noreply GitHub mail and the handle are the same person. Git `user.name` is not identity.
|
|
421
466
|
|
|
@@ -442,6 +487,7 @@ type than product source:
|
|
|
442
487
|
|
|
443
488
|
| Check | What it does |
|
|
444
489
|
|-------|----------------|
|
|
490
|
+
| `ark-check --local --base origin/dev` | Opt-in local / multi-worktree cheap check. Same engine as `--changed`. Refused with `--strict-merge`. `ARK_CHECK_LOCAL=1` is the same unless CI or a full-tree report mode is on. |
|
|
445
491
|
| `ark-check --changed --base origin/dev` | Layer check on touched sources only. A CSS/i18n PR pays almost nothing. |
|
|
446
492
|
| `ark-check --against origin/dev` | New violation keys vs **that ref's** baseline (not only HEAD). |
|
|
447
493
|
| `ark-check --contract-diff --base origin/dev` | Classifies tighten / loosen / reclassify / baseline-grow. |
|
|
@@ -450,8 +496,10 @@ type than product source:
|
|
|
450
496
|
| `ark status --vs origin/dev` | One line: pin / contract / baseline drift vs that ref. |
|
|
451
497
|
|
|
452
498
|
Write-gate ApplyPatch denies a batch that mixes law files with product source. Humans who
|
|
453
|
-
never hit PreToolUse are unchanged. Local `pnpm` gates should call `--
|
|
454
|
-
only full-tree `--strict-merge`.
|
|
499
|
+
never hit PreToolUse are unchanged. Local `pnpm` gates should call `--local --base` or
|
|
500
|
+
`--changed --base`, not only full-tree `--strict-merge`. Write hooks stay on the lexical
|
|
501
|
+
snippet path — they do not run a full-tree check. Analysis is per `--root` (each git
|
|
502
|
+
worktree has its own root); there is no machine-wide analysis lock.
|
|
455
503
|
|
|
456
504
|
`--changed` resolves the touched sources plus their import closure — not the whole
|
|
457
505
|
include tree. File-local ArkRules sensors (class shape, orchestration-only, thin-adapter,
|
package/docs/develop.md
CHANGED
|
@@ -166,6 +166,7 @@ npx arkgate agents-md --write # embed/refresh projection markers
|
|
|
166
166
|
npx arkgate preflight --changes changes.json --json
|
|
167
167
|
npx arkgate upgrade --json # managed content preview
|
|
168
168
|
npx arkgate upgrade --apply
|
|
169
|
+
npx arkgate-check --local --base origin/dev
|
|
169
170
|
npx arkgate-check --changed --base origin/dev
|
|
170
171
|
npx arkgate-check --against origin/dev
|
|
171
172
|
npx arkgate status --vs origin/dev
|
package/docs/diagnostics.md
CHANGED
|
@@ -44,6 +44,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
|
|
|
44
44
|
| [`ARKRULE_INVARIANT`](#ARKRULE_INVARIANT) | arkrules | ArkRule invariant failed |
|
|
45
45
|
| [`ARKRULE_SCOPE_EMPTY`](#ARKRULE_SCOPE_EMPTY) | arkrules | ArkRule appliesTo matched zero files |
|
|
46
46
|
| [`ARKRULE_HINT_BUDGET_EXHAUSTED`](#ARKRULE_HINT_BUDGET_EXHAUSTED) | arkrules | Structural-hint budget exhausted |
|
|
47
|
+
| [`INVARIANT_CATALOG_EMPTY`](#INVARIANT_CATALOG_EMPTY) | arkrules | Domain invariant catalog is empty |
|
|
47
48
|
| [`INVARIANT_UNCOVERED`](#INVARIANT_UNCOVERED) | arkrules | Invariant without coverage evidence |
|
|
48
49
|
| [`INVARIANT_COVERAGE_OUTSIDE_ROOTS`](#INVARIANT_COVERAGE_OUTSIDE_ROOTS) | arkrules | Covering test outside the declared coverage roots |
|
|
49
50
|
| [`ARKRUN_MISSING_ROOT`](#ARKRUN_MISSING_ROOT) | arkrun | No kernel factory in composition roots |
|
|
@@ -97,6 +98,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
|
|
|
97
98
|
| [`CONFIG_RULE_UNKNOWN_TO_LAYER`](#CONFIG_RULE_UNKNOWN_TO_LAYER) | config | Rule unknown to layer |
|
|
98
99
|
| [`CONFIG_AMBIGUOUS_LAYERS`](#CONFIG_AMBIGUOUS_LAYERS) | config | Ambiguous layer classification |
|
|
99
100
|
| [`CONFIG_UNCLASSIFIED_FILES`](#CONFIG_UNCLASSIFIED_FILES) | config | Unclassified included files |
|
|
101
|
+
| [`CONFIG_LAYER_MISSING_OWNER`](#CONFIG_LAYER_MISSING_OWNER) | config | Layer missing owner |
|
|
100
102
|
| [`ARK_UNKNOWN`](#ARK_UNKNOWN) | meta | Unknown diagnostic |
|
|
101
103
|
|
|
102
104
|
## Layer and dependency graph
|
|
@@ -289,6 +291,15 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
|
|
|
289
291
|
- **Why:** `orchestration-only`, `thin-adapter`, and `writes-via-aggregate` only evaluate files the hint loader preloaded. When eligible governed files exceed that budget (`coverage.maxFiles`, default `400` — there is no `arkrules.hintBudget`), those sensors never saw the rest of their scope. Enforced + unreviewed is not green. The finding names exact hinted/governed counts and per-sensor reviewed N/M of scope.
|
|
290
292
|
- **Fix:** Raise `coverage.maxFiles` in ark.config.json (this cap also bounds structural-hint preload; `--doctor` names the coupling) so hinted/governed counts match, then re-run with `--strict-config`. An enforced hint sensor that cannot see its scope fails strict.
|
|
291
293
|
|
|
294
|
+
<a id="INVARIANT_CATALOG_EMPTY"></a>
|
|
295
|
+
|
|
296
|
+
### `INVARIANT_CATALOG_EMPTY`
|
|
297
|
+
|
|
298
|
+
**Domain invariant catalog is empty** · often advisory
|
|
299
|
+
|
|
300
|
+
- **Why:** ArkRules is on and a Domain-role layer has code, but `invariants[]` has no phrases the code must preserve. Empty looks like “done” until someone fills the catalog.
|
|
301
|
+
- **Fix:** Add 1–2 short phrases to `invariants[]` in `arkrules/<Domain>.json` (or the mapped file). Starters show the shape. Advisory unless a domain structure rule is already enforced — then `--strict-merge` can refuse. Do not freeze this finding.
|
|
302
|
+
|
|
292
303
|
<a id="INVARIANT_UNCOVERED"></a>
|
|
293
304
|
|
|
294
305
|
### `INVARIANT_UNCOVERED`
|
|
@@ -589,8 +600,8 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
|
|
|
589
600
|
|
|
590
601
|
**Lexical evidence incomplete**
|
|
591
602
|
|
|
592
|
-
- **Why:**
|
|
593
|
-
- **Fix:**
|
|
603
|
+
- **Why:** This check only saw one file, so it cannot fully prove how the import resolves. The result is provisional — `ark-check` on the project is the authority.
|
|
604
|
+
- **Fix:** Run `npx arkgate-check --root . --config ark.config.json` to confirm. Do not call `ark_prepare_change` from a hook deny.
|
|
594
605
|
|
|
595
606
|
<a id="ANALYSIS_COVERS_NO_FILES"></a>
|
|
596
607
|
|
|
@@ -598,7 +609,7 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
|
|
|
598
609
|
|
|
599
610
|
**Analysis covered no files**
|
|
600
611
|
|
|
601
|
-
- **Why:** No file matched the contract `include` and layer patterns under the analyzed root, so the run had nothing to check. Every rule is vacuously satisfied on an empty set: a green here would read exactly like a green over a governed tree while certifying nothing. Usual causes are a `--root` that is not the tree the contract describes (including a contract found outside the requested root, whose directory is then adopted as the project root), `include` / `exclude` patterns that match nothing,
|
|
612
|
+
- **Why:** No file matched the contract `include` and layer patterns under the analyzed root, so the run had nothing to check. Every rule is vacuously satisfied on an empty set: a green here would read exactly like a green over a governed tree while certifying nothing. Usual causes are a `--root` that is not the tree the contract describes (including a contract found outside the requested root, whose directory is then adopted as the project root), `include` / `exclude` patterns that match nothing, layer patterns written for a different layout, or an `include` that matched files none of which belong to a layer.
|
|
602
613
|
- **Fix:** Point `--root` at the tree the contract describes, or keep the contract inside that tree, or fix the `include` / `exclude` / layer patterns so they match real files — then re-run `npx arkgate-check --root . --config ark.config.json`. `--plan` and `--coverage` report the empty scope without refusing, and `--adopt-contract --write` proposes an `include` that matches the tree. This is a refusal about ArkGate's own inputs, not a finding about your code; no baseline or policy acknowledgement can suppress it, and `exclude` cannot silence it — the "is there source here" probe deliberately ignores the contract's own `exclude`, skips dot-directories, never follows a symlink, and skips `*.config.*` tooling files so a polyglot repo is not mistaken for a mismatch.
|
|
603
614
|
|
|
604
615
|
<a id="ANALYSIS_HOST_UNAVAILABLE"></a>
|
|
@@ -850,6 +861,15 @@ never opting out of knowing.
|
|
|
850
861
|
- **Why:** Included source files match no layer pattern; import rules will not enforce on them.
|
|
851
862
|
- **Fix:** Extend layer patterns or narrow include so every governed file is classified.
|
|
852
863
|
|
|
864
|
+
<a id="CONFIG_LAYER_MISSING_OWNER"></a>
|
|
865
|
+
|
|
866
|
+
### `CONFIG_LAYER_MISSING_OWNER`
|
|
867
|
+
|
|
868
|
+
**Layer missing owner**
|
|
869
|
+
|
|
870
|
+
- **Why:** `requireLayerOwners` is on and this layer has no owners. Writes to that house fail closed, like a folder with no name on the door.
|
|
871
|
+
- **Fix:** Add a GitHub handle or email to that layer’s owners in ark.config.json (`/ark-adopt`), then re-run. Reserved/allowEmpty houses may stay unnamed.
|
|
872
|
+
|
|
853
873
|
## Meta
|
|
854
874
|
|
|
855
875
|
<a id="ARK_UNKNOWN"></a>
|
|
@@ -49,6 +49,11 @@ server with an explicit project root, compact Codex must contain valid project c
|
|
|
49
49
|
SessionStart/PreToolUse Ark hooks, and CI must execute a fail-closed Ark command. Included but
|
|
50
50
|
unclassified source files therefore remain red.
|
|
51
51
|
|
|
52
|
+
If gates are required and the tree has no short decision note yet (`docs/adr/` or
|
|
53
|
+
`docs/decisions/`), `--require-gates` and doctor point at that path. Soft hint —
|
|
54
|
+
not a fail, and silent when `--require-gates` is off. Not every change needs a
|
|
55
|
+
note; use one when you loosen a rule or add a real gate.
|
|
56
|
+
|
|
52
57
|
Doctor JSON includes `writePath.mode` plus `enforcementLadder`: support, installation, observed
|
|
53
58
|
evidence, covered operations, bypassability, and CI honesty. MCP registration stays advisory.
|
|
54
59
|
|
|
@@ -26,7 +26,7 @@ Run **`/ark-adopt`** on a greenfield or early-adoption repo (leftover `/ark-arch
|
|
|
26
26
|
| `adoptInOrder.phase1` | Folders to create first |
|
|
27
27
|
| `analogy` | Plain-language mental model |
|
|
28
28
|
| `antiPatterns` | What Ark will block later |
|
|
29
|
-
| `firstCommand` | Usually `ark
|
|
29
|
+
| `firstCommand` | Usually `ark start --apply --archetype <id>` |
|
|
30
30
|
|
|
31
31
|
Framework names appear only as secondary `toolHints` in JSON — never as the archetype label.
|
|
32
32
|
|
package/docs/package-surface.md
CHANGED
|
@@ -39,7 +39,7 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
39
39
|
|
|
40
40
|
| Surface | How you use it | Stability notes |
|
|
41
41
|
|---------|----------------|-----------------|
|
|
42
|
-
| **CLI** | `arkgate` / `arkgate-check` (aliases `ark` / `ark-check`); optional ArkRun **`ark-dashboard`** / **`arkgate-dashboard`** | Flags and human text may improve; **JSON output shapes** for `--json` (check, doctor, plan, coverage, recommend, **status**, **agents-md**, **report**) 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). **`arkgate report` / `ark report`** drafts an upstream GitHub issue for `pedroknigge/arkgate` (`package.json` `bugs.url`) — never the consumer repo. **Dashboard bins** poll an ArkRun inspector snapshot (ANSI + interval polling; `--url` / `--interval`); they are not a gate verdict. The main CLI also accepts `ark dashboard` / `arkgate dashboard` as a passthrough to those bins. |
|
|
42
|
+
| **CLI** | `arkgate` / `arkgate-check` (aliases `ark` / `ark-check`); optional ArkRun **`ark-dashboard`** / **`arkgate-dashboard`** | Flags and human text may improve; **JSON output shapes** for `--json` (check, doctor, plan, coverage, recommend, **status**, **agents-md**, **report**) 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. Soft ADR presence: when that demand (or doctor `required-merge`) is on and `docs/adr/` / `docs/decisions/` is missing, doctor JSON may add `adrPresence` and human copy points at a short decision note — never a fail, omitted when the demand is off. Soft states/transitions: when a conventional domain doc is already in play and the map is missing or heading-only, doctor JSON may add `statesTransitions` and human copy points at a short table (or one link) — never a fail, omitted when that doc is absent. Narrow status/transition catalog: when Domain-role code already names a closed status/state vocabulary and that map is still thin, doctor JSON may add `statusTransitionCatalog` with those names — never a fail, omitted when Domain has no such vocabulary, the domain doc is absent, or the map is already present. Soft no-Domain / UI-logic residual: when a Domain-role layer is declared but empty and presentation holds the tree (or `domain-logic-in-ui` is already present), doctor JSON may add `noDomainFrontend` and human copy points at one Domain file — never a fail, omitted when there is no frontend, Domain already has files, or the UI bag is too thin. `ark status --json` is the unified status snapshot. `ark agents-md` is the version-matched agent projection (non-authoritative). **`arkgate report` / `ark report`** drafts an upstream GitHub issue for `pedroknigge/arkgate` (`package.json` `bugs.url`) — never the consumer repo. **Dashboard bins** poll an ArkRun inspector snapshot (ANSI + interval polling; `--url` / `--interval`); they are not a gate verdict. The main CLI also accepts `ark dashboard` / `arkgate dashboard` as a passthrough to those bins. |
|
|
43
43
|
| **Upstream report CLI (4.8.10)** | `arkgate report` / `ark report` on the existing dual bins (no new bin, no new skill) | Default prints a draft for **upstream** `pedroknigge/arkgate` (`package.json` `bugs.url`) with the arkgate version and optional last-check snippet. Create only with `--submit` **and** `--i-confirm-submit` (after HITL) or TTY `Type submit to send`. `--yes` does not submit. Missing/unauthenticated `gh`: print the draft plus the exact `gh issue create --repo pedroknigge/arkgate` command, exit 2. Never files against the consumer repo. Not `ark-check --report` (HTML architecture report). |
|
|
44
44
|
| **Host write boundaries** | Generated trusted PreToolUse/preToolUse hooks + `ark-mcp --hook`; inspect with doctor/status | Hard is always operation-scoped and runtime-evidenced. From 4.6.3, Codex CLI and local ChatGPT Desktop/App Server can hard-block a complete `apply_patch` sent as `tool_input.command`; `.codex/hooks.json` on disk remains unverified until a fresh covered invocation. Hosted tools, specialized hook opt-outs, shell/direct writes, incomplete reconstruction, and humans rely on required CI. Repair envelopes may emit, but Codex reinjection is not guaranteed. |
|
|
45
45
|
| **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. |
|
|
@@ -66,15 +66,17 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
66
66
|
| **Report parity and snapshot evidence (4.2)** | `ark-check --report` → advisory sections (`data-advisory="contractHealth\|ambientState\|parseHealth\|arkRun"`, nested `governanceWeight`) + layer wall badges; `.ark/reports/*.json` | The report is a rendering of doctor truth. **Standing rule:** every doctor advisory ships with its report section — enforced by the `reportParity` guard, which enumerates the doctor's advisory keys and fails on any missing section. Snapshots add best-effort Git `HEAD`/branch/dirty provenance without a shell; unavailable Git is explicit. Evolution renders the Ark score delta only when both snapshots name the same ArkGate version, while retaining raw facts across versions. Thin `arkRun` on `latest.json` is `notAScore` residual honesty for `ark status`. |
|
|
67
67
|
| **MCP project identity (4.2)** | `ark_identity`; `arkgate/schema/project-identity` or `arkgate/schema/ark.project-identity.schema.json`; root API constants/helpers/types | Schema `1.0`. `projectId` hashes canonical root + config path and stays stable across contract edits/restarts; runtime id/start time are separate. Every project-bound tool result and error carries `projectIdentity`, `binding` (`matched` / `unverified` / `mismatch`), and `authoritative`. Canonical out-of-root config/file evidence fails before project data. |
|
|
68
68
|
| **MCP tools and compatibility resource** | `arkgate-mcp`; `ark_manifest`; `ark_status`; `ark://manifest` | Tool names and primary argument shapes are stable within a major. Every tool accepts additive `project.expectedRoot` / optional `expectedProjectId`. The initial handshake requires the exact project root; a contained descendant is authoritative only together with the matching project id. Legacy tool calls remain callable but `unverified` and non-authoritative. `ark_manifest` is the authoritative contract surface after binding. **`ark_status`** returns the status manifest envelope (parity with `ark status --json`). Standard `resources/read` cannot portably carry the expectation, so `ark://manifest` remains compatibility-only and always unverified/non-authoritative. The server never retargets from input. |
|
|
69
|
-
| **`ark.config.json`** | Layer globs, optional `layers[].description`, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds; optional **`coverage`** controls (`testGlobs`, `maxFiles`); optional **`arkRules`** map (schema `1.1+`); optional **`arkRun`** extra (schema `1.2+`); optional **`arkOrder`** extra (schema `1.3+`) | Versioned by `schemaVersion`; unknown fields fail closed and migrations preserve the previous supported major. Absence of `coverage`, `arkRules`, `arkRun`, or `arkOrder` is byte-for-byte silent on Layers / ArkRules verdicts. Enforced extra teeth share the CLI / MCP / hook / preflight / CI verdict and arm only when the layer plane is classified (same ArkRules floor). |
|
|
69
|
+
| **`ark.config.json`** | Layer globs, optional `layers[].description`, optional `layers[].trustBoundary`, optional `layers[].owners`, optional `requireLayerOwners`, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds; optional **`coverage`** controls (`testGlobs`, `maxFiles`); optional **`arkRules`** map (schema `1.1+`); optional **`arkRun`** extra (schema `1.2+`); optional **`arkOrder`** extra (schema `1.3+`) | Versioned by `schemaVersion`; unknown fields fail closed and migrations preserve the previous supported major. Absence of `coverage`, `arkRules`, `arkRun`, or `arkOrder` is byte-for-byte silent on Layers / ArkRules verdicts. Enforced extra teeth share the CLI / MCP / hook / preflight / CI verdict and arm only when the layer plane is classified (same ArkRules floor). |
|
|
70
70
|
| **Layer caption (`layers[].description`, 4.8.7)** | Optional string on each layer. Projected onto `ark_place` / prepare-write / MCP place JSON, doctor JSON + human, coverage JSON, and the HTML Purpose column when present. `/ark-adopt` writes it from the product map or glossary; `/ark-place` prints it next to layer name + globs. | Existing optional field — **no `schemaVersion` bump**, no new key, no 14th skill. Copy is **app context** (a product sentence such as `Purchase requests — from asked to received.`), not architecture jargon. Stripped from `policyHash` like `stewards`; caption-only edits are neutral. Absence is silent: never a residual, never a score, never `--strict-config` fail, never flips `valid`. Compact starters may omit. |
|
|
71
|
+
| **Layer trust (`layers[].trustBoundary`)** | Optional closed tag on each layer: `public` \| `auth` \| `admin` \| `internal`. Projected onto `ark_place` / prepare-write / MCP place JSON, doctor JSON + human, coverage JSON, and the HTML report when present. `/ark-adopt` writes it when the product map names that door; `/ark-place` prints `trust: public`. | Additive optional field — **no `schemaVersion` bump**, no new skill. Stripped from `policyHash` like `stewards` and `layers[].description`; tag-only edits are neutral. Absence is silent: never a residual, never a score, never `--strict-config` fail, never flips `valid`. Invalid values fail the schema. Compact starters may omit. Not host/CI TLS. Not an import-rule matrix. |
|
|
72
|
+
| **Layer owners (`layers[].owners` + `requireLayerOwners`)** | Optional GitHub handles or emails on each layer. Projected onto place / prepare-write / MCP / doctor / coverage / HTML when present. `requireLayerOwners: true` asks for owners on every live (non-reserved) layer: doctor names the first missing house, `--strict-config` refuses, and the write gate denies a write into that house. | Additive optional fields — **no `schemaVersion` bump**, no new skill. Owners are stripped from `policyHash` like captions; owner-only edits are neutral. The require flag stays in the hash. Absence of owners is silent unless the require flag is on. Invalid identity (display name) fails the schema. Compact starters may omit. Not import-rule teeth. No `/ark-owners`. |
|
|
71
73
|
| **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. |
|
|
72
74
|
| **`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`. |
|
|
73
75
|
| **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. |
|
|
74
76
|
| **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`. |
|
|
75
77
|
| **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. |
|
|
76
78
|
| **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. |
|
|
77
|
-
| **Team parliament (law vs feature)** | Optional `stewards` on `ark.config.json` (GitHub handle or email); CLI `--changed` / `--against` / `--base` / `--contract-diff` / `--contract-session` / `--persona` / `--author`; check JSON `teamParliament`; `ark status --vs`; write-gate mixed-batch deny | Additive. Law files must not mix with product source. Loosen / baseline-grow are steward-only when `stewards` is set. `--against` ratchets vs the base-ref baseline. `--changed` scans touched sources plus their import closure. `
|
|
79
|
+
| **Team parliament (law vs feature)** | Optional `stewards` on `ark.config.json` (GitHub handle or email); CLI `--local` / `--changed` / `--against` / `--base` / `--contract-diff` / `--contract-session` / `--persona` / `--author`; check JSON `teamParliament`; `ark status --vs`; write-gate mixed-batch deny | Additive. Law files must not mix with product source. Loosen / baseline-grow are steward-only when `stewards` is set. `--against` ratchets vs the base-ref baseline. `--changed` scans touched sources plus their import closure. `--local` (or `ARK_CHECK_LOCAL=1`) is the same cheap path and stays per `--root`; it cannot combine with `--strict-merge`. Check JSON may add `local`, `scope: "changed"`, `analysisRoot`. `stewards`, `layers[].description`, `layers[].trustBoundary`, and `layers[].owners` are excluded from policy hash. `requireLayerOwners` stays in the hash. Identity is handle or email, not git `user.name`. No org plane. |
|
|
78
80
|
| **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. |
|
|
79
81
|
| **Architecture change map (3.1.0)** | `arkgate/schema/change-map` or `arkgate/schema/ark.change-map.schema.json`; CLI `ark preflight --change-map <file>`; MCP `ark_prepare_change.changeMap` | Optional strict schema `1.0`. Canonical planned paths + operations + resolved Ark layers + dependencies between planned files. Preflight returns `changeMapHash`; absence is normal and adds no project file. Structural intent only, never behavioral completion. |
|
|
80
82
|
| **Structural convergence (3.1.0)** | `analyzeArchitectureConvergence(...)`; map-enabled `preflightChange(...)`; existing CLI/MCP preflight adapters | Additive `convergence` result with stable `satisfied`, `missing`, `contradictory`, and `unplanned` findings. Uses the supplied/current project tree as base and the explicit complete change set as candidate; no implicit Git or LLM input. `readOnly: true`; `behavioralCompletion: "not-evaluated"`. Structural mismatch makes preflight invalid. |
|
|
@@ -86,11 +88,11 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
86
88
|
| **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. ArkRun `ARKRUN_*` codes (RN05) share dual-depth `nextAction` / `enthusiastHint`; declaration-list adds are mechanical-safe only when the call-site literal already exists. Docs ship in the npm tarball. |
|
|
87
89
|
| **Status manifest** | CLI `ark status [--json] [--vs <ref>]`; 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, **`improvementCompass`** with honesty **`mode`** `full`\|`subset`\|`unavailable` (residual ids only; always `notAScore: true`; optional `reasonCode`/`reason`/`factsSource`/`contractHash`), optional **`vsBase`** (pin / contract / baseline grow vs a git ref; advisory only), and additive **`arkRun`** (`notAScore`; `present` / `mode` / `extraMergeTeeth` / residual count — null residual is unknown, not green). **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. |
|
|
88
90
|
| **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. |
|
|
89
|
-
| **Agent Skills packaging** | `templates/agent-skills/<name>/SKILL.md` (+ package README); root API `ARK_SKILL_NAMES` / `ARK_FIRST_CLASS_SKILL_NAMES` / `validateAgentSkillsPackage`; `npm run check:agent-skills` | Schema `1.0` (package contract). Closed catalog (`ARK_SKILL_NAMES`): first-class doors plus one-release stubs, 1:1 with flat `templates/skills/*.md`. First-class `/ark-order` (issue #216 / ADR 0036). Add a name only with a live ROADMAP item. |
|
|
91
|
+
| **Agent Skills packaging** | `templates/agent-skills/<name>/SKILL.md` (+ package README); root API `ARK_SKILL_NAMES` / `ARK_FIRST_CLASS_SKILL_NAMES` / `validateAgentSkillsPackage` / `validateSkillProductCapacity`; `npm run check:agent-skills` | Schema `1.0` (package contract). Closed catalog (`ARK_SKILL_NAMES`): first-class doors plus one-release stubs, 1:1 with flat `templates/skills/*.md`. First-class `/ark-order` (issue #216 / ADR 0036). `check:agent-skills` fails closed when a product plane or the north star drops out of skill bodies or living hubs. Add a name only with a live ROADMAP item. |
|
|
90
92
|
| **`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`). |
|
|
91
93
|
| **`arkgate/schema/resolved-candidate-facts`** or **`arkgate/schema/ark.resolved-candidate-facts.schema.json`** | Versioned parity-capable input for `analyzeResolvedProject` / `preflightResolvedChange` | Schema `1.2` is additive: optional `classShapes` (1.1) plus ArkRun `arkRunKernelCalls` / `arkRunManagedNews` / `arkRunCompositionRootHits` / `arkRunDeclarations` (RN03–RN04) and ArkOrder `arkOrderPlaneCalls` / `arkOrderGenericUpdates` / `arkOrderRootHits` (OR05). `1.0`/`1.1` payloads remain loadable. Tooling owns filesystem/compiler resolution; Domain/Kernel validate and evaluate supplied facts without importing those effects. Facts name resolver/compiler inputs, governed files, dependency evidence, completeness reasons, candidate tree/facts hashes, and (when present) ArkRun/ArkOrder call-site evidence. Tier-1 sensors emit `ARKRUN_*` / `ARKORDER_*` diagnostics from those facts: advisory never flips `valid`; enforced blocks. Extra absence is silent. |
|
|
92
94
|
| **Config JSON Schema** | `arkgate/schema` or `arkgate/schema/ark.config.schema.json` | Stable package resource subpaths for editor completion and contract tooling. |
|
|
93
|
-
| **Agent skills** | `/ark-*` templates; install via `--install-agent-gates` (often `--skills-only` on top of compact) **or** Agent Skills ecosystem path | **Day zero** is the compact router from `ark start` / `start --apply` + doctor — not the full skill pack. Closed catalog (`ARK_SKILL_NAMES`): first-class doors (including `/ark-order`) plus one-release stubs. Guided expert path remains `/ark-autopilot` after pack install. **4.0:** first-class doors except experimental `/ark-runtime` / `/ark-order` integrate **layers + ArkRules** and must label residual `[Layer]` vs `[ArkRules]`. **4.2:** repo catalogs are content-idempotent; the optional shared Codex home catalog is monotonic across 4.2.0+ installers. Pre-4.2 writers are outside that protocol and must be upgraded first. A durable pending-catalog journal preserves the floor across an interrupted install and is cleared only by its owning same/newer recovery. **4.3:** Agent Skills–compatible layout at `templates/agent-skills/<name>/SKILL.md` (1:1 with flat `templates/skills/*.md`); install via `npx skills add ./node_modules/arkgate/templates/agent-skills` (or the GitHub tree). **#216:** first-class `/ark-order`; ACS05 freeze opened (ADR 0036). Domain `ARK_SKILL_NAMES` + `validateAgentSkillsPackage`; drift `npm run check:agent-skills
|
|
95
|
+
| **Agent skills** | `/ark-*` templates; install via `--install-agent-gates` (often `--skills-only` on top of compact) **or** Agent Skills ecosystem path | **Day zero** is the compact router from `ark start` / `start --apply` + doctor — not the full skill pack. Closed catalog (`ARK_SKILL_NAMES`): first-class doors (including `/ark-order`) plus one-release stubs. Guided expert path remains `/ark-autopilot` after pack install. **4.0:** first-class doors except experimental `/ark-runtime` / `/ark-order` integrate **layers + ArkRules** and must label residual `[Layer]` vs `[ArkRules]`. **4.2:** repo catalogs are content-idempotent; the optional shared Codex home catalog is monotonic across 4.2.0+ installers. Pre-4.2 writers are outside that protocol and must be upgraded first. A durable pending-catalog journal preserves the floor across an interrupted install and is cleared only by its owning same/newer recovery. **4.3:** Agent Skills–compatible layout at `templates/agent-skills/<name>/SKILL.md` (1:1 with flat `templates/skills/*.md`); install via `npx skills add ./node_modules/arkgate/templates/agent-skills` (or the GitHub tree). **#216:** first-class `/ark-order`; ACS05 freeze opened (ADR 0036). Domain `ARK_SKILL_NAMES` + `validateAgentSkillsPackage` + `validateSkillProductCapacity`; drift `npm run check:agent-skills` (layout **and** 100% product coverage). Skills never enforce. |
|
|
94
96
|
| **ESLint subpath** | `arkgate/eslint` | Config-driven layer/import/purity rules plus ArkRun import/`new` envelope (`ark/no-arkrun-kernel-in-domain`, `ark/no-arkrun-direct-new`, `ark/no-arkrun-transport-bypass`) when `arkRun` is on, and ArkOrder envelope (`ark/no-arkorder-kernel-in-domain`, `ark/no-arkorder-generic-update`) when `arkOrder` is on; loads consumer `ark.config.json`. Absence of an extra is silent. Missing-root / missing-plane and undeclared-* stay CLI/MCP. |
|
|
95
97
|
| **GitHub Action** | `pedroknigge/arkgate` (see `action.yml`) | The `uses:` tag/SHA selects the checker source; `version` remains an optional exact npm compatibility override. |
|
|
96
98
|
| **Package metadata** | `arkgate/package.json` | Stable resource subpath for tooling that needs the installed manifest. |
|
package/docs/use.md
CHANGED
|
@@ -31,6 +31,11 @@ npx arkgate-check --doctor # status — one next step
|
|
|
31
31
|
npx arkgate-check --doctor --all # full details
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
`start --apply` refuses when projected governed coverage is below 50% or
|
|
35
|
+
shape confidence is weak (below 0.6 with coverage under 80%). That lock is
|
|
36
|
+
deliberate. Lock the shape with `--archetype <id>`, `--preset <name>`, or
|
|
37
|
+
`--force`, or inspect ranked shapes with `npx arkgate-check --recommend`.
|
|
38
|
+
|
|
34
39
|
Then keep working with your agent. Stuck? Run `--doctor` and do action **#1**. Compact first; `--all` for details.
|
|
35
40
|
|
|
36
41
|
| Stuck on… | Do this |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unpkg.com/arkgate@
|
|
3
|
+
"$id": "https://unpkg.com/arkgate@4/schemas/ark.config.schema.json",
|
|
4
4
|
"title": "ArkGate architecture contract",
|
|
5
5
|
"description": "Versioned contract consumed identically by ArkGate CLI, MCP, and ESLint surfaces.",
|
|
6
6
|
"type": "object",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"$schema": {
|
|
17
17
|
"type": "string",
|
|
18
18
|
"minLength": 1,
|
|
19
|
-
"default": "https://unpkg.com/arkgate@
|
|
19
|
+
"default": "https://unpkg.com/arkgate@4/schemas/ark.config.schema.json",
|
|
20
20
|
"description": "Editor-facing URL or local path for this JSON Schema."
|
|
21
21
|
},
|
|
22
22
|
"schemaVersion": {
|
|
@@ -650,6 +650,9 @@
|
|
|
650
650
|
},
|
|
651
651
|
"uniqueItems": true,
|
|
652
652
|
"default": []
|
|
653
|
+
},
|
|
654
|
+
"requireLayerOwners": {
|
|
655
|
+
"type": "boolean"
|
|
653
656
|
}
|
|
654
657
|
},
|
|
655
658
|
"$defs": {
|
|
@@ -694,6 +697,24 @@
|
|
|
694
697
|
"type": "string",
|
|
695
698
|
"minLength": 1
|
|
696
699
|
},
|
|
700
|
+
"trustBoundary": {
|
|
701
|
+
"type": "string",
|
|
702
|
+
"enum": [
|
|
703
|
+
"public",
|
|
704
|
+
"auth",
|
|
705
|
+
"admin",
|
|
706
|
+
"internal"
|
|
707
|
+
]
|
|
708
|
+
},
|
|
709
|
+
"owners": {
|
|
710
|
+
"type": "array",
|
|
711
|
+
"items": {
|
|
712
|
+
"type": "string",
|
|
713
|
+
"minLength": 1
|
|
714
|
+
},
|
|
715
|
+
"uniqueItems": true,
|
|
716
|
+
"minItems": 1
|
|
717
|
+
},
|
|
697
718
|
"forbiddenGlobals": {
|
|
698
719
|
"type": "array",
|
|
699
720
|
"items": {
|
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.8.
|
|
9
|
+
"version": "4.8.15",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "arkgate",
|
|
14
|
-
"version": "4.8.
|
|
14
|
+
"version": "4.8.15",
|
|
15
15
|
"runtimeHint": "npx",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
@@ -9,7 +9,7 @@ closed `/ark-*` catalog shipped as flat templates for Ark install.
|
|
|
9
9
|
**Closed catalog** (`ARK_SKILL_NAMES`) — first-class doors plus one-release
|
|
10
10
|
redirect stubs. Add a name only with a live ROADMAP item.
|
|
11
11
|
|
|
12
|
-
Package version when last generated context: **arkgate@4.8.
|
|
12
|
+
Package version when last generated context: **arkgate@4.8.15**
|
|
13
13
|
Schema: agent-skills package contract `1.0`
|
|
14
14
|
|
|
15
15
|
## Skills (closed catalog)
|