arkgate 4.8.0 → 4.8.2
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 +20 -0
- package/README.md +5 -3
- package/bin/lib/analysis-engine.mjs +4 -4
- package/bin/lib/architecture-scan.mjs +7 -2
- package/bin/lib/invariant-coverage-io.mjs +61 -24
- package/bin/lib/invariant-coverage.mjs +4 -1
- package/bin/lib/policy-delta-io.mjs +8 -2
- package/bin/lib/rules-under-contract.mjs +8 -2
- package/dist/{diagnosticCatalog-RiKPUFRG.d.ts → diagnosticCatalog-CPzH-MLN.d.ts} +7 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/nestjs/index.cjs +1 -1
- package/dist/nestjs/index.js +1 -1
- package/dist/runtime/index.cjs +15 -15
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +15 -15
- package/docs/README.md +2 -2
- package/docs/agent-guide.md +10 -9
- package/docs/package-surface.md +3 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +41 -13
- package/templates/agent-skills/ark-architect/SKILL.md +4 -4
- package/templates/agent-skills/ark-autopilot/SKILL.md +22 -4
- package/templates/agent-skills/ark-contract/SKILL.md +7 -7
- package/templates/agent-skills/ark-coverage/SKILL.md +11 -5
- package/templates/agent-skills/ark-explain/SKILL.md +10 -4
- package/templates/agent-skills/ark-explore/SKILL.md +12 -4
- package/templates/agent-skills/ark-fix/SKILL.md +3 -3
- package/templates/agent-skills/ark-loop/SKILL.md +3 -3
- package/templates/agent-skills/ark-place/SKILL.md +12 -3
- package/templates/agent-skills/ark-runtime/SKILL.md +13 -11
- package/templates/agent-skills/ark-think/SKILL.md +13 -7
- package/templates/agent-skills/ark-upgrade/SKILL.md +12 -4
- package/templates/skills/ark-adopt.md +41 -13
- package/templates/skills/ark-architect.md +4 -4
- package/templates/skills/ark-autopilot.md +22 -4
- package/templates/skills/ark-contract.md +7 -7
- package/templates/skills/ark-coverage.md +11 -5
- package/templates/skills/ark-explain.md +10 -4
- package/templates/skills/ark-explore.md +12 -4
- package/templates/skills/ark-fix.md +3 -3
- package/templates/skills/ark-loop.md +3 -3
- package/templates/skills/ark-place.md +12 -3
- package/templates/skills/ark-runtime.md +13 -11
- package/templates/skills/ark-think.md +13 -7
- package/templates/skills/ark-upgrade.md +12 -4
|
@@ -139,21 +139,24 @@ retain `projectIdentity.projectId`, then pass both `expectedRoot` and `expectedP
|
|
|
139
139
|
uncertain, do not consume MCP analysis: use the workspace-local CLI and report that MCP
|
|
140
140
|
restart/retargeting is required. `ark://manifest` never satisfies this preflight.
|
|
141
141
|
|
|
142
|
-
## Dual plane — layers +
|
|
142
|
+
## Dual plane — layers + extras (mandatory, except /ark-runtime)
|
|
143
143
|
|
|
144
|
-
ArkGate has **
|
|
144
|
+
ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; you **always label** findings so they never blur. Absence of an extra is silent and valid. Skills never enforce. ArkOrder is an extra **inside** the `arkgate` package (`arkgate/order`), not a second install.
|
|
145
145
|
|
|
146
146
|
| Plane | What it protects | Where it lives | Sensors / tools |
|
|
147
147
|
|-------|------------------|----------------|-----------------|
|
|
148
148
|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
|
|
149
149
|
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
|
|
150
|
+
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
151
|
+
| **ArkOrder** (extra) | Operational pattern (ξ vs s) | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
|
|
150
152
|
|
|
151
153
|
**Rules for every report / answer:**
|
|
152
|
-
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a
|
|
154
|
+
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** or **`[ArkOrder]`** (or a table with those headers).
|
|
153
155
|
2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
|
|
154
156
|
3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
|
|
155
157
|
4. Editing `arkrules/*` or applying structure fixes is **`/ark-adopt`** / **`/ark-autopilot`** — explore does not write (never invent `mechanical-safe`).
|
|
156
158
|
5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
|
|
159
|
+
6. Never write `arkRun` or `arkOrder` from this skill. When extras are present, label residual **`[ArkRun]`** / **`[ArkOrder]`**. Do not invent `/ark-run` or `/ark-order`.
|
|
157
160
|
|
|
158
161
|
|
|
159
162
|
### Explore + ArkRules
|
|
@@ -162,6 +165,10 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
|
|
|
162
165
|
- Dual-plan **B** may include: place advisory structure rules, extract one inventory candidate to Domain + `arkrules` entry, promote one covered invariant.
|
|
163
166
|
- Field path: note whether starters emit `arkrules/*`.
|
|
164
167
|
|
|
168
|
+
### Explore + extras
|
|
169
|
+
- Map extras when present; never write `arkRun` / `arkOrder`. Extra off → residual `n/a` / silent.
|
|
170
|
+
- Field path may name `examples/arkorder-billing/` (ArkOrder fixture — map only). First extra write is `/ark-adopt`; grind is `/ark-autopilot`.
|
|
171
|
+
|
|
165
172
|
## Output mode (pick one — do not invent a fourth)
|
|
166
173
|
|
|
167
174
|
| Mode | When | Deliverable |
|
|
@@ -289,6 +296,7 @@ When `examples/`, `templates/`, gallery starters, eval fixtures, or docs claim
|
|
|
289
296
|
3. Diff **rule strength** across archetypes (missing denies = soft false-green for consumers).
|
|
290
297
|
4. Note import style vs package surface docs (`arkgate` root barrel vs preferred subpath).
|
|
291
298
|
5. Flag **false promises**: demo fails under its own check, or green with a hollow contract.
|
|
299
|
+
6. When extras are on, label residual `[ArkRun]` / `[ArkOrder]`. Field path may name `examples/arkorder-billing/`. Never write extras from this skill.
|
|
292
300
|
|
|
293
301
|
If the repo is a **pure app** (no examples): state **Field path: internal** and do one of:
|
|
294
302
|
- Name the **norm for new code** that the residual implies (e.g. “no new `platform/db` in routes”), or
|
|
@@ -431,7 +439,7 @@ End with **exactly** these headings (markdown `###`):
|
|
|
431
439
|
- **Sensor:** commands/tools run
|
|
432
440
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
433
441
|
- **Result:** one-line outcome
|
|
434
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
442
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** vs **[ArkOrder]** (or `n/a` if unused)
|
|
435
443
|
- **Compass:** top residual lenses | `n/a`
|
|
436
444
|
- **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
|
|
437
445
|
- **Handoff:** `/ark-…` / CLI / `none`
|
|
@@ -46,9 +46,9 @@ retain `projectIdentity.projectId`, then pass both `expectedRoot` and `expectedP
|
|
|
46
46
|
uncertain, do not consume MCP analysis: use the workspace-local CLI and report that MCP
|
|
47
47
|
restart/retargeting is required. `ark://manifest` never satisfies this preflight.
|
|
48
48
|
|
|
49
|
-
## Dual plane — layers +
|
|
49
|
+
## Dual plane — layers + extras (mandatory, except /ark-runtime)
|
|
50
50
|
|
|
51
|
-
Label findings **`[Layer]`** vs **`[ArkRules]`**.
|
|
51
|
+
Label findings **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. Absence of extras is valid and silent. Extra skip clusters (`ARKRUN_*` / `ARKORDER_*`) are **`/ark-autopilot`**. Do not invent `/ark-run` or `/ark-order`. Skills never enforce.
|
|
52
52
|
|
|
53
53
|
## Subagent fan-out (optional, host-dependent)
|
|
54
54
|
|
|
@@ -83,7 +83,7 @@ Skill incomplete if missing any field below.
|
|
|
83
83
|
- **Sensor:** commands/tools run
|
|
84
84
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
85
85
|
- **Result:** one-line outcome
|
|
86
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
86
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** vs **[ArkOrder]** (or `n/a` if unused)
|
|
87
87
|
- **Compass:** top residual lenses | `n/a`
|
|
88
88
|
- **Handoff:** `/ark-autopilot` / `/ark-adopt` / `none`
|
|
89
89
|
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
@@ -41,9 +41,9 @@ restart/retargeting is required. `ark://manifest` never satisfies this preflight
|
|
|
41
41
|
|
|
42
42
|
Atomic multi-file work uses **`ark_prepare_change`** with the same matched `project` envelope.
|
|
43
43
|
|
|
44
|
-
## Dual plane — layers +
|
|
44
|
+
## Dual plane — layers + extras (mandatory, except /ark-runtime)
|
|
45
45
|
|
|
46
|
-
Label findings **`[Layer]`** vs **`[ArkRules]`**. Never invent `mechanical-safe` kinds.
|
|
46
|
+
Label findings **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. Absence of extras is valid and silent. Extra skip clusters (`ARKRUN_*` / `ARKORDER_*`) are **`/ark-autopilot`**. Never invent `mechanical-safe` kinds. Do not invent `/ark-run` or `/ark-order`. Skills never enforce.
|
|
47
47
|
|
|
48
48
|
## Subagent fan-out (optional, host-dependent)
|
|
49
49
|
|
|
@@ -79,7 +79,7 @@ Skill incomplete if missing any field below.
|
|
|
79
79
|
- **Sensor:** commands/tools run
|
|
80
80
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
81
81
|
- **Result:** one-line outcome
|
|
82
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
82
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** vs **[ArkOrder]** (or `n/a` if unused)
|
|
83
83
|
- **Compass:** top residual lenses | `n/a`
|
|
84
84
|
- **Handoff:** `/ark-autopilot` / `/ark-explore` / `none`
|
|
85
85
|
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
@@ -20,8 +20,12 @@ description: "Where does new code go? Names the folder from the rules file and w
|
|
|
20
20
|
- Golden pattern is load-bearing when present. Adopt generates it.
|
|
21
21
|
- Do not default a repository to Presentation.
|
|
22
22
|
- When `arkRun` is on: scaffold through the kernel (no `new` of managed types; declare
|
|
23
|
-
`uses` / `reactsTo` / `raises` / `sends
|
|
23
|
+
`uses` / `reactsTo` / `raises` / `sends`; factory only in `arkRun.kernelRoots`,
|
|
24
|
+
`compositionRoots` alias). Extra off → do not introduce the kernel. Enable it
|
|
24
25
|
via `/ark-adopt`. Skills never enforce.
|
|
26
|
+
- When `arkOrder` is on: factory only in `arkOrder.planeRoots`; Domain stays plane-free;
|
|
27
|
+
freeze ξ with `release()`. Extra off → do not introduce the plane. Enable it via
|
|
28
|
+
`/ark-adopt`. Skills never enforce.
|
|
25
29
|
|
|
26
30
|
## Autonomy contract
|
|
27
31
|
|
|
@@ -66,6 +70,7 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
|
|
|
66
70
|
| New artifact: where + **write** under the config | Existing violation cluster → `/ark-autopilot` |
|
|
67
71
|
| Naming / directory for a known kind | Session 0 / config missing or lying → `/ark-adopt` (then come back) |
|
|
68
72
|
| Kernel-managed artifact when `arkRun` is already on | Extra not chosen yet → `/ark-adopt` (advisory `arkRun`); evaluate / migrate a hand-rolled bus → `/ark-runtime` |
|
|
73
|
+
| Plane-root artifact when `arkOrder` is already on | Extra not chosen yet → `/ark-adopt` (advisory `arkOrder`); skip cluster grind → `/ark-autopilot` |
|
|
69
74
|
|
|
70
75
|
The user describes something they need to build (a saga, a background job, an
|
|
71
76
|
event handler, a repository, an HTTP client, a use case, a projection, …).
|
|
@@ -108,7 +113,7 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
|
|
|
108
113
|
|-------|------------------|----------------|-----------------|
|
|
109
114
|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
|
|
110
115
|
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
|
|
111
|
-
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime` | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
116
|
+
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
112
117
|
| **ArkOrder** (extra) | Operational pattern (ξ vs s) | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
|
|
113
118
|
|
|
114
119
|
**Rules for every report / answer:**
|
|
@@ -128,7 +133,7 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
|
|
|
128
133
|
### Place + ArkRun
|
|
129
134
|
When `arkRun` is present on the architecture config:
|
|
130
135
|
- Scaffold kernel-managed artifacts **through the kernel**, not `new` of an admitted type (`ARKRUN_DIRECT_NEW`).
|
|
131
|
-
- Call `createStrictArkKernel` (or an admission sibling) only inside `arkRun.compositionRoots
|
|
136
|
+
- Call `createStrictArkKernel` (or an admission sibling) only inside `arkRun.kernelRoots` (`compositionRoots` is a legacy alias — still valid). Each call is a new instance — no process-wide `getKernel()`.
|
|
132
137
|
- Domain-role files stay kernel-free (`ARKRUN_KERNEL_IN_DOMAIN`). Import from `arkgate/runtime` (or `arkgate/nestjs`). `@arkgate/runtime` is deprecated.
|
|
133
138
|
- List `uses` / `reactsTo` / `raises` / `sends` when `requireDeclarations` is on. Adding an existing call-site literal to the declaration list is the only mechanical-safe ArkRun edit; inventing a new emit / handle / depend is judgment.
|
|
134
139
|
- Do not import a homemade bus (`EventEmitter`, queue clients) in `managedLayers` — send on the kernel transport (`local` / `localBlocking` / `broker`; `ephemeral` defaults true). No shipped cloud SDKs.
|
|
@@ -141,6 +146,7 @@ When `arkOrder` is present on the architecture config:
|
|
|
141
146
|
- Import `createOrderPlane` from `arkgate/order` (same npm package). Domain-role files stay plane-free.
|
|
142
147
|
- Freeze ξ with `release()`; derive s with `project()`; field `ingest()` never mints a pattern; `proposeRelease()` needs a non-empty blast. There is no `update`/`patch`/`set`.
|
|
143
148
|
- Call the factory only inside `arkOrder.planeRoots`. Empty roots in `enforced` mode is `ARKORDER_MISSING_PLANE`.
|
|
149
|
+
- Skip clusters (`ARKORDER_MISSING_PLANE` / `ARKORDER_KERNEL_IN_DOMAIN` / `ARKORDER_GENERIC_UPDATE` / `ARKORDER_TOO_MANY_PARAMS` / `ARKORDER_INGEST_WRITES_XI`): place this artifact, then grind via `/ark-autopilot`. Extra not on → `/ark-adopt`. Do not invent `/ark-order`.
|
|
144
150
|
- Absence of the extra is valid. Do not invent `/ark-order`. Skills never enforce.
|
|
145
151
|
|
|
146
152
|
## Subagent fan-out (optional, host-dependent)
|
|
@@ -208,6 +214,9 @@ the same files or weaken the gate.
|
|
|
208
214
|
- If `arkRun` is on and the user is grinding skip violations (`new` of managed types, homemade
|
|
209
215
|
bus) across many files: place this artifact through the kernel, then leftover `/ark-fix` /
|
|
210
216
|
`/ark-autopilot`. Extra not on → `/ark-adopt` (advisory) or `/ark-runtime` (evaluate).
|
|
217
|
+
- If `arkOrder` is on and the user is grinding skip violations (`ARKORDER_*`) across many files:
|
|
218
|
+
place this artifact on a plane root, then leftover `/ark-fix` / `/ark-autopilot`. Extra not on
|
|
219
|
+
→ `/ark-adopt` (advisory). Do not invent `/ark-order`.
|
|
211
220
|
|
|
212
221
|
## Operating rules
|
|
213
222
|
|
|
@@ -11,7 +11,7 @@ to evaluate or wire the kernel. **This skill never enforces** — the write / CI
|
|
|
11
11
|
does when the `arkRun` extra is on. Do **not** invent `/ark-run`. `@arkgate/runtime` is deprecated.
|
|
12
12
|
|
|
13
13
|
**When:** evaluate a hand-rolled bus / outbox / saga / projection / policy / Nest adapter against
|
|
14
|
-
the kernel, or wire an extra that is already on (
|
|
14
|
+
the kernel, or wire an extra that is already on (kernel root, declarations, transport).
|
|
15
15
|
**Not when:** session 0 / extra not chosen (`/ark-adopt`); one new file (`/ark-place`); skip-violation
|
|
16
16
|
grind (`/ark-autopilot` / leftover `/ark-fix`).
|
|
17
17
|
|
|
@@ -50,9 +50,9 @@ retain `projectIdentity.projectId`, then pass both `expectedRoot` and `expectedP
|
|
|
50
50
|
uncertain, do not consume MCP analysis: use the workspace-local CLI and report that MCP
|
|
51
51
|
restart/retargeting is required. `ark://manifest` never satisfies this preflight.
|
|
52
52
|
|
|
53
|
-
## Out of scope for ArkRules
|
|
53
|
+
## Out of scope for ArkRules and ArkOrder
|
|
54
54
|
|
|
55
|
-
This skill is **runtime-kernel only**. Do not mix ArkRules structure/invariants here;
|
|
55
|
+
This skill is **runtime-kernel only**. Do not mix ArkRules structure/invariants here; do **not** turn this skill into an ArkOrder skill. Hand off first extras to `/ark-adopt`, new files to `/ark-place`, skip clusters to `/ark-autopilot`. Label kernel-usage residual **`[ArkRun]`** so it never blurs with **`[Layer]`**, **`[ArkRules]`**, or **`[ArkOrder]`**.
|
|
56
56
|
|
|
57
57
|
## Subagent fan-out (optional, host-dependent)
|
|
58
58
|
|
|
@@ -75,20 +75,22 @@ the same files or weaken the gate.
|
|
|
75
75
|
adapters apply.
|
|
76
76
|
2. **Read the extra** — open `ark.config.json`. If `arkRun` is absent and the user wants the extra,
|
|
77
77
|
**STOP — do not continue this skill as complete.** Handoff **`/ark-adopt`** to write **advisory**
|
|
78
|
-
`arkRun` (schema `1.2+`; `
|
|
79
|
-
invent the extra here. If the extra is present, note `mode`,
|
|
80
|
-
`
|
|
78
|
+
`arkRun` (schema `1.2+`; **`kernelRoots` preferred**, `compositionRoots` alias, `managedLayers`,
|
|
79
|
+
`requireDeclarations`). Do not invent the extra here. If the extra is present, note `mode`,
|
|
80
|
+
`kernelRoots` (or alias `compositionRoots`), managed layers, and `requireDeclarations`; doctor
|
|
81
|
+
`arkRun` is `notAScore`.
|
|
81
82
|
3. **Pick ONE target** — the smallest, most self-contained candidate (fewest
|
|
82
83
|
call sites). Migrating everything at once is how adoptions die. List the
|
|
83
84
|
rest as follow-ups in the report. New files after the extra is on go through **`/ark-place`**.
|
|
84
85
|
4. **Resolve availability** — `npm install arkgate` already ships `arkgate/runtime`.
|
|
85
86
|
Import from `arkgate/runtime` (or `arkgate/nestjs`). `@arkgate/runtime` is deprecated.
|
|
86
87
|
5. **Wire through the kernel** — read the
|
|
87
|
-
[
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
[experimental opt-in surfaces](https://github.com/pedroknigge/arkgate/blob/main/docs/package-surface.md#experimental-opt-in-surfaces)
|
|
89
|
+
(primary kernel guide; import `arkgate/runtime` from the same `arkgate` tarball). Optional
|
|
90
|
+
durability non-claim: [production-hardening.md](https://github.com/pedroknigge/arkgate/blob/main/docs/production-hardening.md).
|
|
91
|
+
Do **not** treat `packages/runtime/README.md` (deprecated companion leftover) as the kernel guide.
|
|
90
92
|
- Call `createStrictArkKernel` (or an admission sibling: `createArkKernel`, `*FromConfig`) **only**
|
|
91
|
-
inside `arkRun.compositionRoots
|
|
93
|
+
inside `arkRun.kernelRoots` (`compositionRoots` is a legacy alias — still valid). Each call is a new instance — no process-wide singleton.
|
|
92
94
|
- Keep Domain-role layers kernel-free (`ARKRUN_KERNEL_IN_DOMAIN`).
|
|
93
95
|
- Resolve managed types from the kernel; do not construct admitted types with `new`
|
|
94
96
|
(`ARKRUN_DIRECT_NEW`).
|
|
@@ -155,7 +157,7 @@ End with **exactly** these headings (markdown `###`):
|
|
|
155
157
|
- **Sensor:** commands/tools run
|
|
156
158
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
157
159
|
- **Result:** one-line outcome
|
|
158
|
-
- **Planes:** **`[ArkRun]`** residual (or `n/a` if extra absent) — do not mix with `[Layer]` / `[ArkRules]`
|
|
160
|
+
- **Planes:** **`[ArkRun]`** residual (or `n/a` if extra absent) — do not mix with `[Layer]` / `[ArkRules]` / `[ArkOrder]`
|
|
159
161
|
- **Compass:** `n/a` (runtime skill; static residual → explore/fix) | top residual if doctor was run
|
|
160
162
|
- **Handoff:** `/ark-…` / CLI / `none`
|
|
161
163
|
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
@@ -69,20 +69,22 @@ retain `projectIdentity.projectId`, then pass both `expectedRoot` and `expectedP
|
|
|
69
69
|
uncertain, do not consume MCP analysis: use the workspace-local CLI and report that MCP
|
|
70
70
|
restart/retargeting is required. `ark://manifest` never satisfies this preflight.
|
|
71
71
|
|
|
72
|
-
## Dual plane — layers +
|
|
72
|
+
## Dual plane — layers + extras (mandatory, except /ark-runtime)
|
|
73
73
|
|
|
74
|
-
ArkGate has **
|
|
74
|
+
ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; you **always label** findings so they never blur. Absence of an extra is silent and valid. Skills never enforce. ArkOrder is an extra **inside** the `arkgate` package (`arkgate/order`), not a second install.
|
|
75
75
|
|
|
76
76
|
| Plane | What it protects | Where it lives | Sensors / tools |
|
|
77
77
|
|-------|------------------|----------------|-----------------|
|
|
78
78
|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
|
|
79
79
|
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
|
|
80
|
+
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
81
|
+
| **ArkOrder** (extra) | Operational pattern (ξ vs s) | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
|
|
80
82
|
|
|
81
83
|
**Rules for every report / answer:**
|
|
82
|
-
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a
|
|
84
|
+
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** or **`[ArkOrder]`** (or a table with those headers).
|
|
83
85
|
2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
|
|
84
86
|
3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
|
|
85
|
-
4. Editing `arkrules/*` or promoting modes is **`/ark-contract`**; fixing code under a structure sensor is **`/ark-fix`** / **`/ark-loop`** (judgment, never invent mechanical-safe).
|
|
87
|
+
4. Editing `arkrules/*` or promoting modes is **`/ark-adopt`** / leftover **`/ark-contract`**; fixing code under a structure sensor is leftover **`/ark-fix`** / **`/ark-loop`** or **`/ark-autopilot`** (judgment, never invent mechanical-safe). Extra decisions stay on existing doors. Do not invent `/ark-run` or `/ark-order`.
|
|
86
88
|
5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
|
|
87
89
|
|
|
88
90
|
|
|
@@ -90,6 +92,9 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
|
|
|
90
92
|
- For ONE decision, consider options on **both** planes when relevant: e.g. new layer wall **vs** structure sensor **vs** invariant catalog entry.
|
|
91
93
|
- Every option must state enforceability: which plane holds it after the change.
|
|
92
94
|
|
|
95
|
+
### Think + extras
|
|
96
|
+
- Extra decisions stay enforceable on existing doors (`/ark-adopt` session 0, `/ark-place` new file, `/ark-autopilot` grind, `/ark-runtime` one kernel candidate). No new skill name. Do not invent `/ark-run` or `/ark-order`.
|
|
97
|
+
|
|
93
98
|
## Subagent fan-out (optional, host-dependent)
|
|
94
99
|
|
|
95
100
|
When the user asks to go faster **or** the work naturally splits (multiple packages,
|
|
@@ -126,8 +131,9 @@ feature dirs, plan clusters), you **may** dispatch **subagents**:
|
|
|
126
131
|
migration cost, **pilot + kill-switch** if the option adds a layer or wall.
|
|
127
132
|
7. **Surface hard lines** — never suggest: weakening `ark.config.json` to pass, silent
|
|
128
133
|
judgment auto-apply, codemod engines, or skipping write-gate/CI.
|
|
129
|
-
8. **Hand off** — placement `/ark-place`;
|
|
130
|
-
`/ark-
|
|
134
|
+
8. **Hand off** — placement `/ark-place`; first extra `/ark-adopt`; grind `/ark-autopilot`;
|
|
135
|
+
map-only `/ark-explore`; leftover config `/ark-contract`; leftover cluster `/ark-fix` /
|
|
136
|
+
`/ark-loop`. Extra decisions stay on those doors. Do not invent `/ark-run` or `/ark-order`.
|
|
131
137
|
When the user needs action not advice: **STOP — do not continue this skill as complete** — invoke the handoff skill.
|
|
132
138
|
|
|
133
139
|
## Output format
|
|
@@ -154,7 +160,7 @@ End with **exactly** these headings (markdown `###`):
|
|
|
154
160
|
- **Sensor:** commands/tools run
|
|
155
161
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
156
162
|
- **Result:** one-line outcome
|
|
157
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
163
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** vs **[ArkOrder]** (or `n/a` if unused)
|
|
158
164
|
- **Compass:** top residual lenses | `n/a`
|
|
159
165
|
- **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
|
|
160
166
|
- **Handoff:** `/ark-…` / CLI / `none`
|
|
@@ -116,27 +116,35 @@ a stale MCP is non-authoritative: `ark_identity` diagnoses it and project tools
|
|
|
116
116
|
`PROCESS_PACKAGE_STALE` until restart. Prefer project-local CLI meanwhile. A modern stale global
|
|
117
117
|
`ark upgrade` hands off automatically; pre-4.6.4 globals need one `npx arkgate upgrade` entry.
|
|
118
118
|
|
|
119
|
-
## Dual plane — layers +
|
|
119
|
+
## Dual plane — layers + extras (mandatory, except /ark-runtime)
|
|
120
120
|
|
|
121
|
-
ArkGate has **
|
|
121
|
+
ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; you **always label** findings so they never blur. Absence of an extra is silent and valid. Skills never enforce. ArkOrder is an extra **inside** the `arkgate` package (`arkgate/order`), not a second install.
|
|
122
122
|
|
|
123
123
|
| Plane | What it protects | Where it lives | Sensors / tools |
|
|
124
124
|
|-------|------------------|----------------|-----------------|
|
|
125
125
|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
|
|
126
126
|
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
|
|
127
|
+
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
128
|
+
| **ArkOrder** (extra) | Operational pattern (ξ vs s) | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
|
|
127
129
|
|
|
128
130
|
**Rules for every report / answer:**
|
|
129
|
-
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a
|
|
131
|
+
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** or **`[ArkOrder]`** (or a table with those headers).
|
|
130
132
|
2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
|
|
131
133
|
3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
|
|
132
134
|
4. After upgrade, leftover architecture work is **`/ark-autopilot`** (never invent `mechanical-safe`).
|
|
133
135
|
5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
|
|
136
|
+
6. Schema `1.3` extras stay off unless already on. Pin teaches `arkgate/runtime` (same tarball), not the deprecated companion. Do not invent `/ark-run` or `/ark-order`.
|
|
134
137
|
|
|
135
138
|
|
|
136
139
|
### Upgrade + ArkRules
|
|
137
140
|
- Refresh skills + note if templates gained ArkRules deepen; do not force consumers to adopt `arkRules`.
|
|
138
141
|
- After upgrade: doctor `rulesUnderContract` if map exists; dual-truth note if `--no-install` left package pin old.
|
|
139
142
|
|
|
143
|
+
### Upgrade + extras
|
|
144
|
+
- Schema `1.3` extras (`arkRun` / `arkOrder`) stay off unless already on. Do not turn extras on during upgrade.
|
|
145
|
+
- Pin teaches `arkgate/runtime` (same tarball). `@arkgate/runtime` is deprecated. Do not send agents to `packages/runtime/README.md` as the kernel guide.
|
|
146
|
+
- After 4.8.2, customized skills may lag — opt-in `--refresh-skills` with consent so the frozen 13 names pick up four-plane deepen. No new skill names.
|
|
147
|
+
|
|
140
148
|
## Safety contract
|
|
141
149
|
|
|
142
150
|
- Always invoke the **project-local** CLI (`npx arkgate` /
|
|
@@ -305,7 +313,7 @@ End with exactly this structure:
|
|
|
305
313
|
- **Active host:** host and verified status
|
|
306
314
|
- **Deferred hosts:** `none` or host plus future action
|
|
307
315
|
- **Result:** old → new version and managed-upgrade outcome
|
|
308
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
316
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** vs **[ArkOrder]** (or `n/a` if unused)
|
|
309
317
|
- **Compass:** top residual lenses | `n/a`
|
|
310
318
|
- **Handoff:** `/ark-…`, CLI action, or `none`
|
|
311
319
|
- **Incomplete?** `no` or `yes — <missing work>`
|