arkgate 4.8.2 → 4.8.3

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +15 -3
  2. package/README.md +39 -8
  3. package/bin/lib/analysis-engine.mjs +6 -6
  4. package/bin/lib/ark-order-facts.mjs +59 -0
  5. package/bin/lib/ark-order-sensors.mjs +31 -2
  6. package/bin/lib/arkrule-file-hints.mjs +6 -2
  7. package/bin/lib/arkrules-contract.mjs +1 -0
  8. package/bin/lib/arkrules-sensors.mjs +22 -2
  9. package/bin/lib/config-extras.mjs +2 -0
  10. package/bin/lib/diagnostic-catalog.mjs +2 -1
  11. package/bin/lib/remediation.mjs +9 -1
  12. package/bin/lib/resolved-candidate-facts.mjs +31 -0
  13. package/dist/{configTypes-BdCe_gvv.d.ts → configTypes-dNJ2C0yx.d.ts} +5 -0
  14. package/dist/{diagnosticCatalog-CPzH-MLN.d.ts → diagnosticCatalog-C5GgeyEE.d.ts} +97 -7
  15. package/dist/eslint/index.cjs +6 -6
  16. package/dist/eslint/index.d.ts +1 -1
  17. package/dist/eslint/index.js +6 -6
  18. package/dist/index.cjs +34 -34
  19. package/dist/index.d.ts +24 -7
  20. package/dist/index.js +34 -34
  21. package/dist/nestjs/index.cjs +5 -5
  22. package/dist/nestjs/index.d.ts +3 -3
  23. package/dist/nestjs/index.js +5 -5
  24. package/dist/runtime/index.cjs +15 -15
  25. package/dist/runtime/index.d.ts +6 -6
  26. package/dist/runtime/index.js +15 -15
  27. package/dist/{types-C9KApBzX.d.ts → types-DeK7SYGC.d.ts} +1 -1
  28. package/dist/{types-DCSlrRnV.d.ts → types-dK24fDZa.d.ts} +1 -1
  29. package/docs/README.md +4 -4
  30. package/docs/configuration.md +12 -8
  31. package/docs/develop.md +23 -2
  32. package/docs/diagnostics.md +9 -0
  33. package/docs/enthusiast/README.md +6 -4
  34. package/docs/package-surface.md +4 -2
  35. package/docs/product-voice.md +15 -5
  36. package/docs/use.md +8 -5
  37. package/package.json +1 -1
  38. package/schemas/ark.arkrules.schema.json +1 -0
  39. package/schemas/ark.config.schema.json +9 -0
  40. package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
  41. package/server.json +2 -2
  42. package/templates/agent-skills/README.md +1 -1
  43. package/templates/agent-skills/ark-adopt/SKILL.md +8 -3
  44. package/templates/agent-skills/ark-autopilot/SKILL.md +1 -1
  45. package/templates/agent-skills/ark-contract/SKILL.md +4 -0
  46. package/templates/agent-skills/ark-place/SKILL.md +6 -2
  47. package/templates/arkrules/ApplicationOrchestration.json +6 -0
  48. package/templates/skills/ark-adopt.md +8 -3
  49. package/templates/skills/ark-autopilot.md +1 -1
  50. package/templates/skills/ark-contract.md +4 -0
  51. package/templates/skills/ark-place.md +6 -2
@@ -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-DCSlrRnV.js';
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-dK24fDZa.js';
2
2
 
3
3
  /**
4
4
  * PolicyEngine
@@ -1,4 +1,4 @@
1
- import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-BdCe_gvv.js';
1
+ import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-dNJ2C0yx.js';
2
2
 
3
3
  /**
4
4
  * Policy types for the Ark kernel.
package/docs/README.md CHANGED
@@ -45,7 +45,7 @@ Product site: [arkgate.online](https://www.arkgate.online/) · npm: [`arkgate`](
45
45
  |-----|------------|
46
46
  | [CONTRIBUTING.md](../CONTRIBUTING.md) | Setup, rules, PR/release |
47
47
  | [ROADMAP.md](../ROADMAP.md) | Live implementation queue (one `doing` at a time). History: [archive/roadmap-history.md](archive/roadmap-history.md) |
48
- | [adr/](adr/README.md) | Architecture decisions |
48
+ | [adr/](adr/README.md) | Architecture decisions ([0032](adr/0032-writes-via-aggregate-sensor.md) writes-via-aggregate) |
49
49
  | [SECURITY.md](../SECURITY.md) · [threat-model.md](threat-model.md) | Security |
50
50
 
51
51
  ---
@@ -62,8 +62,8 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
62
62
  | Field adoption kit (scaffolding, not closed) | [field/](field/) |
63
63
  | Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
64
64
 
65
- Current published: [releases/4.8.2.md](releases/4.8.2.md) (`arkgate@4.8.2` on npm `latest`; does not close `K01`).
66
- Prior: [releases/4.8.1.md](releases/4.8.1.md) · [4.8.0](releases/4.8.0.md) · [4.7.6](releases/4.7.6.md) · [4.7.5](releases/4.7.5.md) · [4.7.4](releases/4.7.4.md) · [4.7.3](releases/4.7.3.md) · [4.7.2](releases/4.7.2.md) · [4.7.1](releases/4.7.1.md) · [4.7.0](releases/4.7.0.md) · [4.6.7](releases/4.6.7.md) · [4.6.6](releases/4.6.6.md) · [4.6.5](releases/4.6.5.md) · [4.6.4](releases/4.6.4.md) · [4.6.3](releases/4.6.3.md) · [4.6.2](releases/4.6.2.md) · [4.6.1](releases/4.6.1.md) · [4.6.0](releases/4.6.0.md).
65
+ Current published: [releases/4.8.3.md](releases/4.8.3.md) (`arkgate@4.8.3` on npm `latest`; does not close `K01`).
66
+ Prior: [releases/4.8.2.md](releases/4.8.2.md) · [releases/4.8.1.md](releases/4.8.1.md) · [4.8.0](releases/4.8.0.md) · [4.7.6](releases/4.7.6.md) · [4.7.5](releases/4.7.5.md) · [4.7.4](releases/4.7.4.md) · [4.7.3](releases/4.7.3.md) · [4.7.2](releases/4.7.2.md) · [4.7.1](releases/4.7.1.md) · [4.7.0](releases/4.7.0.md) · [4.6.7](releases/4.6.7.md) · [4.6.6](releases/4.6.6.md) · [4.6.5](releases/4.6.5.md) · [4.6.4](releases/4.6.4.md) · [4.6.3](releases/4.6.3.md) · [4.6.2](releases/4.6.2.md) · [4.6.1](releases/4.6.1.md) · [4.6.0](releases/4.6.0.md).
67
67
  Older notes: [releases/](releases/). Config: [configuration.md](configuration.md).
68
68
 
69
69
  ---
@@ -74,4 +74,4 @@ Older notes: [releases/](releases/). Config: [configuration.md](configuration.md
74
74
  2. **One primary flow** — `start` → doctor → optional guided work.
75
75
  3. **Honest hardness** — host write guarantees differ; a **required GitHub status context** running the merge CLI is the shared hard boundary.
76
76
  4. **History is not the product** — version archaeology lives under `releases/` and `plans/`, not the front door.
77
- 5. **Common language** — first-contact copy uses ordinary software words (import rules, the write doesn’t land, required CI). ArkGate is import rules; ArkRules is policies; ArkRun is an experimental runtime; ArkOrder is an optional pattern extra in the same npm package. Voice: [product-voice.md](product-voice.md).
77
+ 5. **Common language** — first-contact copy uses ordinary software words (import rules, the write doesn’t land, required CI). ArkGate is import rules; ArkRules is policies; ArkRun is an experimental runtime; ArkOrder stops the agent rewriting the few slow product decisions as CRUD. Voice: [product-voice.md](product-voice.md).
@@ -99,10 +99,12 @@ Top-level fields:
99
99
  preflight / CI verdict and arm only when the layer plane is classified (same ≥50%
100
100
  governed and ≥1 populated-layer floor as ArkRules).
101
101
  - **`arkOrder`** (optional, schema `1.3+`) — inline ArkOrder extra (`mode`, `planeRoots`,
102
- `managedLayers`, `maxXiKeys`). Absence is silent. Unknown keys fail closed.
102
+ `managedLayers`, `maxXiKeys`, **`xiKeys`**). Absence is silent. Unknown keys fail closed.
103
103
  Import `createOrderPlane` from `arkgate/order` (same package). Empty `planeRoots` in
104
- `enforced` mode fails closed (`ARKORDER_MISSING_PLANE`). Demotion or deletion is a
105
- policy-delta **weakening**. Haken: few slow keys (ξ); field ingest never mints a pattern.
104
+ `enforced` mode fails closed (`ARKORDER_MISSING_PLANE`). `xiKeys` are the 3–5 slow
105
+ names the product already knows (plan, protocol, cost-code bound). Empty `xiKeys`
106
+ leaves `ARKORDER_XI_FIELD_WRITE` silent. Membership ids are not keys. Demotion or
107
+ deletion is a policy-delta **weakening**. Field ingest never mints a pattern.
106
108
 
107
109
  Layer fields:
108
110
 
@@ -161,15 +163,17 @@ See [brownfield adoption](brownfield-adoption.md#nextjs-honesty-default-overlays
161
163
  | **Structure sensors** | Intra-layer heuristics | Only `mode: "enforced"` |
162
164
  | **Invariants** | Catalog + coverage evidence (not a business runtime) | Only enforced + proven-uncovered |
163
165
  | **ArkRun** (opt-in extra) | Kernel usage + complete declarations | Only `arkRun.mode: "enforced"` when classified |
166
+ | **ArkOrder** (opt-in extra) | Frozen pattern + four verbs (no `update`) | Only `arkOrder.mode: "enforced"` when classified |
164
167
 
165
- Absence of `arkRules` or `arkRun` adds **no** extra merge teeth. **Advisory** structure sensors, advisory
166
- invariants, and advisory ArkRun also add **no** merge teeth (FG-ARKRULES-ADVISORY-ONLY / ADR 0020) — packing every starter
167
- `arkrules/*` file does not make merge fail structure alone. Enforced structure/invariants/ArkRun arm
168
+ Absence of `arkRules`, `arkRun`, or `arkOrder` adds **no** extra merge teeth. **Advisory** structure sensors, advisory
169
+ invariants, advisory ArkRun, and advisory ArkOrder also add **no** merge teeth (FG-ARKRULES-ADVISORY-ONLY / ADR 0020 / ADR 0027) — packing every starter
170
+ `arkrules/*` file does not make merge fail structure alone. Enforced structure/invariants/ArkRun/ArkOrder arm
168
171
  `mergePlanes.extraMergeTeeth` only when the layer plane is honestly classified
169
172
  (governed ≥ 50% and ≥ 1 populated layer); empty classification never gets extra-plane teeth
170
173
  (P1M-EXTRATEETH-EMPTY-GRAPH). Extra planes **never** merge into one architecture
171
174
  score. Doctor exposes `rulesUnderContract.mergePlanes` (including `mergePlanes.arkRun`) for which plane can fail,
172
- and a dedicated `doctor.arkRun` section that is always `notAScore`.
175
+ and a dedicated `doctor.arkRun` section that is always `notAScore`. ArkOrder skip findings are
176
+ `ARKORDER_*` diagnostics on that same extra-teeth floor.
173
177
 
174
178
  Safety fields:
175
179
 
@@ -196,7 +200,7 @@ Each `arkrules/<Layer>.json` may declare:
196
200
 
197
201
  | Section | Purpose | Modes | What it really enforces |
198
202
  |---------|---------|--------|-------------------------|
199
- | `structure[]` | Closed sensor ids (e.g. `orchestration-only`, `thin-adapter`, `aggregate-private-state`, `always-valid-factory`, `domain-event-on-mutation`, `no-anemic-model`) | `advisory` (default) or `enforced` | **Heuristics of module shape** — not proof that logic was extracted to Domain. Tier-2 sensors (`no-anemic-model`) stay advisory-only (cannot promote to enforced). |
203
+ | `structure[]` | Closed sensor ids (e.g. `orchestration-only`, `thin-adapter`, `writes-via-aggregate`, `aggregate-private-state`, `always-valid-factory`, `domain-event-on-mutation`, `no-anemic-model`) | `advisory` (default) or `enforced` | **Heuristics of module shape** — not proof that logic was extracted to Domain. `writes-via-aggregate` is driver-import + write-token in the declaring layer (ADR 0032). Tier-2 sensors (`no-anemic-model`) stay advisory-only (cannot promote to enforced). |
200
204
  | `invariants[]` | Stable ids + description + `coverage` (`test` / `symbol`) + optional `appliesTo` globs | `advisory` or `enforced` | **Named policy + evidence** (symbol in source and/or test title/content). Does **not** execute business logic at check time and does **not** replace behavior/property tests. |
201
205
 
202
206
  **Reporting:** diagnostics carry `evidence.arkruleId` + `evidence.arkruleSource`. Label residual
package/docs/develop.md CHANGED
@@ -6,8 +6,9 @@ For **developers** integrating ArkGate into a product repo: agents, CI, config,
6
6
 
7
7
  When the agent writes a bad import, the write doesn’t land. The same check fails the pull
8
8
  request. Not an API Gateway. Not a folder linter. Without a required CI status,
9
- `ark.config.json` is just documentation. ArkGate is import rules. ArkRules and ArkRun
10
- are optional — policies and an experimental runtime, not a second install.
9
+ `ark.config.json` is just documentation. ArkGate is import rules. ArkRules, ArkRun,
10
+ and ArkOrder are optional — policies, an experimental runtime, and the extra that
11
+ stops slow product decisions being CRUD. Not a second install.
11
12
 
12
13
  If you only want the happy path, start at [use.md](use.md).
13
14
 
@@ -186,6 +187,26 @@ See [configuration.md](configuration.md), [package-surface.md](package-surface.m
186
187
 
187
188
  ---
188
189
 
190
+ ## Optional ArkOrder extra and plane
191
+
192
+ Layers can be green while the agent still PATCHes `plan` as if it were `seatCount`.
193
+ Optional **`arkOrder`** on `ark.config.json` (schema `1.3`) is the extra that makes
194
+ those few slow product decisions a write rule: field events absorb or escalate;
195
+ a generic `update` of the plan does not land. Absence is silent. Compact starters
196
+ leave it off.
197
+
198
+ The plane is `arkgate/order` in package `arkgate`, not a second install.
199
+ `createOrderPlane` is the factory. Call it only in `arkOrder.planeRoots`. Domain
200
+ stays plane-free. Empty `planeRoots` in `enforced` mode fails closed
201
+ (`ARKORDER_MISSING_PLANE`). In-memory. Not durable. Does not replace ArkRun.
202
+
203
+ Copy [examples/arkorder-billing/](../examples/arkorder-billing/) (`plan` / `cycle` /
204
+ `tenancy`) and rename the keys. Posting an invoice is absorbed; changing plan is a
205
+ new release. See [configuration.md](configuration.md) and
206
+ [package-surface.md](package-surface.md).
207
+
208
+ ---
209
+
189
210
  ## Migrate from `ark-runtime-kernel`
190
211
 
191
212
  Same product, new package name: [migrate-from-ark-runtime-kernel.md](migrate-from-ark-runtime-kernel.md).
@@ -400,6 +400,15 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
400
400
  - **Why:** An ingest() result is written into a Release or ξ store. ingest may absorb or escalate; it never mints a pattern.
401
401
  - **Fix:** Keep ingest results as absorb/escalate only. Change ξ with proposeRelease + release. Never mechanical-safe.
402
402
 
403
+ <a id="ARKORDER_XI_FIELD_WRITE"></a>
404
+
405
+ ### `ARKORDER_XI_FIELD_WRITE`
406
+
407
+ **Slow key written around the order plane**
408
+
409
+ - **Why:** A managed-layer file imports a persistence driver and writes a declared arkOrder.xiKeys name. Field events absorb or escalate; they do not PATCH the slow pattern.
410
+ - **Fix:** Keep invoices, seats, hours, and logs on ingest. Change the slow key with proposeRelease + release, then preflight again. Never mechanical-safe.
411
+
403
412
  ## Atomic preflight and change sets
404
413
 
405
414
  <a id="INVALID_CHANGE_PATH"></a>
@@ -25,16 +25,18 @@ aliases `ark` / `ark-check` still work).
25
25
 
26
26
  `ark start` and `ark-check --plan` will not claim "everything is guarded" while governed coverage is near zero. On Nest/Next/express starters, init also merges **framework filename conventions** into the layer globs so day-one coverage is real.
27
27
 
28
- ### Two kinds of rules (4.0 — optional extra)
28
+ ### Layers always. Extras when you ask.
29
29
 
30
30
  | Kind | Plain English |
31
31
  |------|---------------|
32
32
  | **Layers** | Who may import whom (always on after start) |
33
33
  | **ArkRules** (optional) | Habits *inside* a layer — structure and named invariants as data |
34
- | **ArkRun** (optional extra) | Kernel usage + complete declarations (`arkRun` on schema `1.2`) |
34
+ | **ArkRun** (optional extra) | How the app talks (`arkgate/runtime`; `arkRun` on schema `1.2`) |
35
+ | **ArkOrder** (optional extra) | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`; `arkOrder` on schema `1.3`) |
35
36
 
36
- You can stay on layers only. When you add ArkRules or ArkRun, start **advisory** and promote only with
37
- coverage. Compact starters leave ArkRun off. Residual labels: **`[Layer]`** vs **`[ArkRules]`**. Details:
37
+ You can stay on layers only. When you add an extra, start **advisory** and promote only with
38
+ coverage. Compact starters leave ArkRun and ArkOrder off. Residual labels: **`[Layer]`** vs
39
+ **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. Details:
38
40
  [use.md](../use.md) · [configuration](../configuration.md).
39
41
 
40
42
  ## Start here
@@ -3,7 +3,8 @@
3
3
  **Write. Check. Ship.**
4
4
  **When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.**
5
5
  That is the product wedge (host hook + required CI). Skills name the next step after that.
6
- **Not the wedge:** the optional in-process **ArkRun** runtime (`arkgate/runtime`).
6
+ **Not the wedge:** the optional in-process **ArkRun** runtime (`arkgate/runtime`) and the
7
+ optional **ArkOrder** pattern extra (`arkgate/order`).
7
8
 
8
9
  The check that must agree everywhere is small ([ADR 0026](adr/0026-gate-waist-facts-in-verdict-out.md)):
9
10
  `ark.config.json` + resolved-candidate-facts → one analysis-result (`valid`).
@@ -218,7 +219,8 @@ production deployment would need to satisfy; it is not a readiness certification
218
219
  ## Release notes (maintainers)
219
220
 
220
221
  Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
221
- (current published: [4.8.2.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.2.md);
222
+ (current published: [4.8.3.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.3.md);
223
+ prior published: [4.8.2.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.2.md);
222
224
  prior published: [4.8.1.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.1.md);
223
225
  prior published: [4.8.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.0.md);
224
226
  prior published: [4.7.6.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.7.6.md);
@@ -21,6 +21,10 @@ The same check fails the pull request.
21
21
  **ArkRun** is an optional runtime (`arkgate/runtime`). Experimental. In-memory.
22
22
  Not Postgres.
23
23
 
24
+ **ArkOrder** is the extra that stops the agent from rewriting the few slow
25
+ product decisions as CRUD (`arkgate/order`). Off unless you turn it on. Same
26
+ npm package. In-memory. Not durable. Does not replace ArkRun.
27
+
24
28
  ```text
25
29
  Write. the agent writes
26
30
  Check. bad imports don’t land — same check on the PR
@@ -31,6 +35,7 @@ Ship. required GitHub check, then merge
31
35
  ArkGate always import rules (write + required CI)
32
36
  ArkRules optional policies inside a layer
33
37
  ArkRun optional experimental runtime — in-memory, not Postgres
38
+ ArkOrder optional the few slow product decisions the agent must not CRUD
34
39
  ```
35
40
 
36
41
  Status first (`arkgate-check --doctor`). One next step. CLI flag `--doctor` stays;
@@ -45,7 +50,7 @@ On README, use, develop, the docs hub, and the product site:
45
50
  1. **Verbs:** `Write. Check. Ship.`
46
51
  2. **Deny:** `When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.`
47
52
  3. **Not-that (below the fold, one line):** `Not an API Gateway. Not a folder linter. If the check is not required on the PR, the config is just documentation.`
48
- 4. **Nouns (once, below the deny):** ArkGate is import rules. ArkRules is optional policies. ArkRun is an optional experimental runtime.
53
+ 4. **Nouns (once, below the deny):** ArkGate is import rules. ArkRules is optional policies. ArkRun is an optional experimental runtime. ArkOrder is the extra that stops the agent from rewriting the few slow product decisions (plan, protocol) as CRUD — named when the consumer opts in, never as the first noun.
49
54
 
50
55
  Do not lead with folders, `ark.config.json`, “contract”, “gate”, “house”, or “doctor”
51
56
  as the first noun. Historical: `If the AI writes an illegal import, the write is rejected`
@@ -72,9 +77,10 @@ Three beats when a line teaches:
72
77
  | The agent imported Infrastructure from Domain. The write didn’t land. Next: `/ark-place`. | Ship it 🚀 crush the spaghetti |
73
78
  | Import rules pass. The tree still needs a refactor. Next: one small change. | You don’t need to understand anything |
74
79
  | ArkRun is experimental. In-memory. Data is gone on restart. | The kernel is production-ready |
80
+ | The agent PATCHed the billing plan as if it were a seat count. The write didn’t land. Next: a new release, not `update`. | Freeze ξ. Four verbs. Haken slaving. |
75
81
  | Status: one light, one next step. | Become an architect in 60 seconds |
76
82
 
77
- **Brands, then the common word:** ArkGate, ArkRules, ArkRun. Gloss once.
83
+ **Brands, then the common word:** ArkGate, ArkRules, ArkRun, ArkOrder. Gloss once.
78
84
 
79
85
  | Say | Do not say on first contact |
80
86
  |-----|-----------------------------|
@@ -84,6 +90,7 @@ Three beats when a line teaches:
84
90
  | `arkgate-check --doctor` — **status**, one next step | control plane, coach, doctor as the product name |
85
91
  | optional policies inside a layer | dual plane, intra-layer sensors, Saturday tidy |
86
92
  | experimental runtime / in-memory / not Postgres | production kernel, durable runtime, training wheels |
93
+ | the few slow product decisions / billing plan vs seats / that PUT doesn’t land | four verbs, freeze a pattern, Haken, slaving, ξ vs s, extra plane, construction OS |
87
94
 
88
95
  Command names stay command names (`--doctor` is a flag). If a word is not here,
89
96
  cut it or put it below the fold (develop, JSON, ADRs).
@@ -94,7 +101,7 @@ cut it or put it below the fold (develop, JSON, ADRs).
94
101
 
95
102
  These are product law, not vibe:
96
103
 
97
- - **Write. Check. Ship.** ArkGate is the wedge. ArkRules and ArkRun never determine the `arkgate` package shape.
104
+ - **Write. Check. Ship.** ArkGate is the wedge. ArkRules, ArkRun, and ArkOrder never determine the `arkgate` package shape.
98
105
  - The check is deterministic. No LLM pass/fail. Skills and `AGENTS.md` never replace the check.
99
106
  - Doctor and status advisory surfaces project existing facts. They are not a second check and never flip the deny.
100
107
  - No numeric architecture / trust / depth score. Lights and counts, never Excellent/Good.
@@ -103,7 +110,8 @@ These are product law, not vibe:
103
110
  - A weaker config needs an explicit, hash-bound yes.
104
111
  - Host write hardness differs. Required CI is the shared hard line.
105
112
  - ArkRun stores are **in-memory**. Not production durability. Do not imply otherwise.
106
- - Absence of ArkRules or ArkRun is silent. Label leftovers **`[Layer]`** vs **`[ArkRules]`**.
113
+ - Absence of ArkRules, ArkRun, or ArkOrder is silent. Label leftovers **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**.
114
+ - ArkOrder is in-memory and not durable. It does not replace ArkRun. Do not imply a second npm package.
107
115
 
108
116
  Full engineering queue: [ROADMAP.md](../ROADMAP.md). Do not narrate phase ids in consumer copy.
109
117
 
@@ -147,6 +155,7 @@ a product PR — that is an owner `--contract-session` (config change).
147
155
  - Package AI decided pass/fail
148
156
  - Depth scores, trust scores, Excellent module bands
149
157
  - ArkRun as Postgres, an outbox, or Temporal
158
+ - ArkOrder as durable storage, a second npm package, or a replacement for ArkRun
150
159
  - New skill *names* without a live queue item
151
160
  - “the house stays up” / “training wheels” / “mimo” on first contact
152
161
 
@@ -169,8 +178,9 @@ Invoking a command **is** the approval. CLI checks; it does not silently rewrite
169
178
  - [ ] **Write. Check. Ship.** is on first-contact.
170
179
  - [ ] Deny is `When the agent writes a bad import, the write doesn’t land.`
171
180
  - [ ] One next action is obvious.
172
- - [ ] ArkGate / ArkRules / ArkRun are import rules / policies / experimental runtime.
181
+ - [ ] ArkGate / ArkRules / ArkRun / ArkOrder are import rules / policies / experimental runtime / the extra that stops slow product decisions being CRUD.
173
182
  - [ ] ArkRun is never implied durable / Postgres.
183
+ - [ ] ArkOrder is never implied durable, a second install, or a replacement for ArkRun.
174
184
  - [ ] Status lights read Setup / In progress / Ready to humans.
175
185
  - [ ] No score, no false done, no Gateway as the first sentence, no “disable the rules”.
176
186
  - [ ] A senior would paste the line into a PR without cringing.
package/docs/use.md CHANGED
@@ -80,11 +80,14 @@ The config only binds when the write doesn’t land and CI is required.
80
80
  |--|---------------|---------|
81
81
  | **ArkGate** (layers) | Import rules. The write doesn’t land. The PR fails. | Always — this is the product |
82
82
  | **ArkRules** | Optional policies *inside* a layer. | Off until you turn it on (start may ship advisory templates) |
83
- | **ArkRun** | Optional experimental runtime | Off. In-memory. Not Postgres. |
84
-
85
- Start always gives you **layers**. Compact starters do **not** turn on ArkRun.
86
- No ArkRules / ArkRun is fine only ArkGate runs. Leftovers are labeled
87
- **`[Layer]`** vs **`[ArkRules]`**. Green imports elegant design. ArkRun durable stores.
83
+ | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) | Off. In-memory. Not Postgres. |
84
+ | **ArkOrder** | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`) | Off. Name `xiKeys` (plan / protocol, not `projectId`). Invoices and seats still flow. In-memory. Not durable. |
85
+
86
+ Start always gives you **layers**. Compact starters do **not** turn on ArkRun or
87
+ ArkOrder. No extras is fine only ArkGate runs. Leftovers are labeled
88
+ **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. Green
89
+ imports ≠ elegant design. Green imports also ≠ a frozen billing plan. ArkRun ≠
90
+ durable stores. ArkOrder does not replace ArkRun.
88
91
 
89
92
  ### New modules vs config edits
90
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.8.2",
3
+ "version": "4.8.3",
4
4
  "description": "When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -60,6 +60,7 @@
60
60
  "domain-event-on-mutation",
61
61
  "orchestration-only",
62
62
  "thin-adapter",
63
+ "writes-via-aggregate",
63
64
  "no-anemic-model",
64
65
  "invariant-coverage"
65
66
  ]
@@ -882,6 +882,15 @@
882
882
  "type": "integer",
883
883
  "minimum": 1,
884
884
  "default": 7
885
+ },
886
+ "xiKeys": {
887
+ "type": "array",
888
+ "items": {
889
+ "type": "string",
890
+ "minLength": 1
891
+ },
892
+ "uniqueItems": true,
893
+ "default": []
885
894
  }
886
895
  }
887
896
  }
@@ -1 +1 @@
1
- {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json","title":"ArkGate resolved candidate facts","type":"object","additionalProperties":false,"required":["schemaVersion","completeness","completenessReasons","resolverIdentity","compilerIdentity","compilerOptionsHash","tsconfigHash","candidateTreeHash","evidenceRequirementsHash","files","dependencies","capabilityUses","ambientUses","publishCalls","intentReferences","safetyUses","factsHash"],"properties":{"schemaVersion":{"enum":["1.0","1.1","1.2"]},"completeness":{"enum":["complete","partial","unavailable"]},"completenessReasons":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"}}}},"resolverIdentity":{"type":"string","minLength":1},"compilerIdentity":{"type":"string","minLength":1},"compilerOptionsHash":{"type":"string","minLength":1},"tsconfigHash":{"type":"string","minLength":1},"candidateTreeHash":{"type":"string","minLength":1},"evidenceRequirementsHash":{"type":"string","minLength":1},"projectPackageName":{"type":"string","minLength":1},"files":{"type":"array","uniqueItems":true,"items":{"type":"object","additionalProperties":false,"required":["path","contentHash","parseStatus","parseDiagnosticCount","exportsOnlyTypes","typeOnlyExportNames","hasTopLevelSideEffects"],"properties":{"path":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"contentHash":{"type":"string","minLength":1},"parseStatus":{"enum":["parsed","invalid"]},"parseDiagnosticCount":{"type":"integer","minimum":0},"exportsOnlyTypes":{"type":"boolean"},"typeOnlyExportNames":{"type":"array","items":{"type":"string","minLength":1}},"hasTopLevelSideEffects":{"type":"boolean"}},"allOf":[{"if":{"properties":{"parseStatus":{"const":"parsed"}}},"then":{"properties":{"parseDiagnosticCount":{"const":0}}}},{"if":{"properties":{"parseStatus":{"const":"invalid"}}},"then":{"properties":{"parseDiagnosticCount":{"minimum":1}}}}]}},"dependencies":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","kind","typeOnly","line","resolution"],"properties":{"from":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"specifier":{"type":"string","minLength":1},"kind":{"enum":["import","export","dynamic-import","require"]},"typeOnly":{"type":"boolean"},"line":{"type":"integer","minimum":1},"resolution":{"enum":["resolved-project","resolved-external","unresolved","dynamic"]},"target":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"namedBindings":{"type":"array","items":{"type":"string","minLength":1}},"targetTypeOnlyExports":{"type":"boolean"},"sourcePureTypeModule":{"type":"boolean"},"namedBindingsTypeOnly":{"type":"boolean"},"portProofEligible":{"type":"boolean"}},"allOf":[{"if":{"properties":{"resolution":{"const":"resolved-project"}}},"then":{"required":["target"]},"else":{"not":{"required":["target"]}}},{"if":{"properties":{"resolution":{"const":"dynamic"}}},"else":{"required":["specifier"]}}]}},"capabilityUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol","capability","source"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1},"capability":{"enum":["network","filesystem","clock","randomness","environment","process","persistence"]},"source":{"enum":["ambient-global","import-based"]}}}},"ambientUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1}}}},"publishCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","objectHasIntent","arkPublishCandidate","hasSource"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"rawIntentName":{"type":"string","minLength":1},"objectHasIntent":{"type":"boolean"},"arkPublishCandidate":{"type":"boolean"},"hasSource":{"type":"boolean"},"sourceIntent":{"type":"string","minLength":1}}}},"intentReferences":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","intent"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"intent":{"type":"string","minLength":1}}}},"safetyUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["ts-suppression","any-cast","dynamic-import","dynamic-require","in-memory-store"]},"symbol":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"kind":{"const":"in-memory-store"}}},"then":{"required":["symbol"]},"else":{"not":{"required":["symbol"]}}}]}},"classShapes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","className","exported","hasPublicMutableFields","hasPublicSetters","hasPublicConstructor","hasStaticFactory","mutatingMethods"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"className":{"type":"string","minLength":1},"exported":{"type":"boolean"},"hasPublicMutableFields":{"type":"boolean"},"hasPublicSetters":{"type":"boolean"},"hasPublicConstructor":{"type":"boolean"},"hasStaticFactory":{"type":"boolean"},"dataOnly":{"type":"boolean"},"mutatingMethods":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","referencesGuardOrPublish"],"properties":{"name":{"type":"string","minLength":1},"referencesGuardOrPublish":{"type":"boolean"}}}}}}},"arkRunKernelCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind","callee","viaImport"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["factory","publisher","publish","raise","send","subscribe","register-handler","resolve","resolve-singleton"]},"callee":{"type":"string","minLength":1},"viaImport":{"type":"boolean"},"receiver":{"type":"string","minLength":1},"nameLiteral":{"type":"string","minLength":1}}}},"arkRunManagedNews":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","typeName"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"typeName":{"type":"string","minLength":1},"importedFrom":{"type":"string","minLength":1}}}},"arkRunCompositionRootHits":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","matchedRoot","hasKernelFactory"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"matchedRoot":{"type":"string","minLength":1},"hasKernelFactory":{"type":"boolean"}}}},"arkRunDeclarations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","uses","reactsTo","raises","sends"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"uses":{"type":"array","items":{"type":"string","minLength":1}},"reactsTo":{"type":"array","items":{"type":"string","minLength":1}},"raises":{"type":"array","items":{"type":"string","minLength":1}},"sends":{"type":"array","items":{"type":"string","minLength":1}}}}},"arkOrderPlaneCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","callee"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"callee":{"type":"string","minLength":1}}}},"arkOrderGenericUpdates":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","method"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"method":{"type":"string","minLength":1}}}},"arkOrderRootHits":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","matchedRoot","hasPlaneFactory"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"matchedRoot":{"type":"string","minLength":1},"hasPlaneFactory":{"type":"boolean"}}}},"factsHash":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"completeness":{"const":"complete"}}},"then":{"properties":{"completenessReasons":{"maxItems":0},"files":{"items":{"properties":{"parseStatus":{"const":"parsed"}}}}}}},{"if":{"properties":{"completeness":{"enum":["partial","unavailable"]}}},"then":{"properties":{"completenessReasons":{"minItems":1}}}}]}
1
+ {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json","title":"ArkGate resolved candidate facts","type":"object","additionalProperties":false,"required":["schemaVersion","completeness","completenessReasons","resolverIdentity","compilerIdentity","compilerOptionsHash","tsconfigHash","candidateTreeHash","evidenceRequirementsHash","files","dependencies","capabilityUses","ambientUses","publishCalls","intentReferences","safetyUses","factsHash"],"properties":{"schemaVersion":{"enum":["1.0","1.1","1.2"]},"completeness":{"enum":["complete","partial","unavailable"]},"completenessReasons":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"}}}},"resolverIdentity":{"type":"string","minLength":1},"compilerIdentity":{"type":"string","minLength":1},"compilerOptionsHash":{"type":"string","minLength":1},"tsconfigHash":{"type":"string","minLength":1},"candidateTreeHash":{"type":"string","minLength":1},"evidenceRequirementsHash":{"type":"string","minLength":1},"projectPackageName":{"type":"string","minLength":1},"files":{"type":"array","uniqueItems":true,"items":{"type":"object","additionalProperties":false,"required":["path","contentHash","parseStatus","parseDiagnosticCount","exportsOnlyTypes","typeOnlyExportNames","hasTopLevelSideEffects"],"properties":{"path":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"contentHash":{"type":"string","minLength":1},"parseStatus":{"enum":["parsed","invalid"]},"parseDiagnosticCount":{"type":"integer","minimum":0},"exportsOnlyTypes":{"type":"boolean"},"typeOnlyExportNames":{"type":"array","items":{"type":"string","minLength":1}},"hasTopLevelSideEffects":{"type":"boolean"}},"allOf":[{"if":{"properties":{"parseStatus":{"const":"parsed"}}},"then":{"properties":{"parseDiagnosticCount":{"const":0}}}},{"if":{"properties":{"parseStatus":{"const":"invalid"}}},"then":{"properties":{"parseDiagnosticCount":{"minimum":1}}}}]}},"dependencies":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","kind","typeOnly","line","resolution"],"properties":{"from":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"specifier":{"type":"string","minLength":1},"kind":{"enum":["import","export","dynamic-import","require"]},"typeOnly":{"type":"boolean"},"line":{"type":"integer","minimum":1},"resolution":{"enum":["resolved-project","resolved-external","unresolved","dynamic"]},"target":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"namedBindings":{"type":"array","items":{"type":"string","minLength":1}},"targetTypeOnlyExports":{"type":"boolean"},"sourcePureTypeModule":{"type":"boolean"},"namedBindingsTypeOnly":{"type":"boolean"},"portProofEligible":{"type":"boolean"}},"allOf":[{"if":{"properties":{"resolution":{"const":"resolved-project"}}},"then":{"required":["target"]},"else":{"not":{"required":["target"]}}},{"if":{"properties":{"resolution":{"const":"dynamic"}}},"else":{"required":["specifier"]}}]}},"capabilityUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol","capability","source"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1},"capability":{"enum":["network","filesystem","clock","randomness","environment","process","persistence"]},"source":{"enum":["ambient-global","import-based"]}}}},"ambientUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1}}}},"publishCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","objectHasIntent","arkPublishCandidate","hasSource"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"rawIntentName":{"type":"string","minLength":1},"objectHasIntent":{"type":"boolean"},"arkPublishCandidate":{"type":"boolean"},"hasSource":{"type":"boolean"},"sourceIntent":{"type":"string","minLength":1}}}},"intentReferences":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","intent"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"intent":{"type":"string","minLength":1}}}},"safetyUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["ts-suppression","any-cast","dynamic-import","dynamic-require","in-memory-store"]},"symbol":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"kind":{"const":"in-memory-store"}}},"then":{"required":["symbol"]},"else":{"not":{"required":["symbol"]}}}]}},"classShapes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","className","exported","hasPublicMutableFields","hasPublicSetters","hasPublicConstructor","hasStaticFactory","mutatingMethods"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"className":{"type":"string","minLength":1},"exported":{"type":"boolean"},"hasPublicMutableFields":{"type":"boolean"},"hasPublicSetters":{"type":"boolean"},"hasPublicConstructor":{"type":"boolean"},"hasStaticFactory":{"type":"boolean"},"dataOnly":{"type":"boolean"},"mutatingMethods":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","referencesGuardOrPublish"],"properties":{"name":{"type":"string","minLength":1},"referencesGuardOrPublish":{"type":"boolean"}}}}}}},"arkRunKernelCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind","callee","viaImport"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["factory","publisher","publish","raise","send","subscribe","register-handler","resolve","resolve-singleton"]},"callee":{"type":"string","minLength":1},"viaImport":{"type":"boolean"},"receiver":{"type":"string","minLength":1},"nameLiteral":{"type":"string","minLength":1}}}},"arkRunManagedNews":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","typeName"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"typeName":{"type":"string","minLength":1},"importedFrom":{"type":"string","minLength":1}}}},"arkRunCompositionRootHits":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","matchedRoot","hasKernelFactory"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"matchedRoot":{"type":"string","minLength":1},"hasKernelFactory":{"type":"boolean"}}}},"arkRunDeclarations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","uses","reactsTo","raises","sends"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"uses":{"type":"array","items":{"type":"string","minLength":1}},"reactsTo":{"type":"array","items":{"type":"string","minLength":1}},"raises":{"type":"array","items":{"type":"string","minLength":1}},"sends":{"type":"array","items":{"type":"string","minLength":1}}}}},"arkOrderPlaneCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","callee"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"callee":{"type":"string","minLength":1}}}},"arkOrderGenericUpdates":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","method"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"method":{"type":"string","minLength":1}}}},"arkOrderRootHits":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","matchedRoot","hasPlaneFactory"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"matchedRoot":{"type":"string","minLength":1},"hasPlaneFactory":{"type":"boolean"}}}},"arkOrderXiFieldWrites":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","key"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"key":{"type":"string","minLength":1}}}},"arkOrderIngestWritesXi":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1}}}},"arkOrderReleaseKeyCounts":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","keyCount"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"keyCount":{"type":"integer","minimum":1}}}},"factsHash":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"completeness":{"const":"complete"}}},"then":{"properties":{"completenessReasons":{"maxItems":0},"files":{"items":{"properties":{"parseStatus":{"const":"parsed"}}}}}}},{"if":{"properties":{"completeness":{"enum":["partial","unavailable"]}}},"then":{"properties":{"completenessReasons":{"minItems":1}}}}]}
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.2",
9
+ "version": "4.8.3",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "arkgate",
14
- "version": "4.8.2",
14
+ "version": "4.8.3",
15
15
  "runtimeHint": "npx",
16
16
  "transport": {
17
17
  "type": "stdio"
@@ -7,7 +7,7 @@
7
7
  This directory is the **Agent Skills–compatible** packaging of the same **13**
8
8
  `/ark-*` skills shipped as flat templates for Ark install. **No new skill names.**
9
9
 
10
- Package version when last generated context: **arkgate@4.8.1**
10
+ Package version when last generated context: **arkgate@4.8.3**
11
11
  Schema: agent-skills package contract `1.0`
12
12
 
13
13
  ## Skills (frozen catalog)
@@ -142,6 +142,7 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
142
142
  ### Adopt + ArkRules
143
143
  - After classify: emit or refresh `arkRules` for matched layers (exact names; generic mold for unknowns).
144
144
  - Mine rules → inventory + write advisory invariants/structure into `arkrules/<Layer>.json` **in this turn**.
145
+ - Application / Features templates include advisory `writes-via-aggregate`: driver import + write token in a use case is the skip. Do not copy `Externals/` / `admission.ts` folder religion.
145
146
  - Freeze baseline is **[Layer]** debt; inventory residual is **[ArkRules]** — report both.
146
147
 
147
148
  ### Adopt + ArkRun
@@ -156,8 +157,8 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
156
157
 
157
158
  ### Adopt + ArkOrder
158
159
  - User asked to turn the extra on: write **advisory** `arkOrder` on `ark.config.json` (`schemaVersion` `1.3+`) **in this turn**. Default `"mode": "advisory"` — never session-0 default `enforced`.
159
- - Required shape: `planeRoots` (real files; empty + enforced = `ARKORDER_MISSING_PLANE`), `managedLayers` (existing `layers[].name` only), `maxXiKeys` (default 7).
160
- - Example (consumer trees — not this library's 4-layer compact):
160
+ - Required shape: `planeRoots` (real files; empty + enforced = `ARKORDER_MISSING_PLANE`), `managedLayers` (existing `layers[].name` only), `maxXiKeys` (default 7), **`xiKeys`** (the 3–5 slow names; empty = field-write sensor silent).
161
+ - Example (consumer trees — not this library's 4-layer compact). Copy billing, **rename the three keys**:
161
162
 
162
163
  ```json
163
164
  {
@@ -166,11 +167,15 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
166
167
  "mode": "advisory",
167
168
  "planeRoots": ["src/main.ts"],
168
169
  "managedLayers": ["Application"],
169
- "maxXiKeys": 7
170
+ "maxXiKeys": 7,
171
+ "xiKeys": ["plan", "cycle", "tenancy"]
170
172
  }
171
173
  }
172
174
  ```
173
175
 
176
+ - `xiKeys` are meaning, not membership. `projectId` / `orgId` do not belong. If `proposeRelease` throws empty blast, that key does not order anything.
177
+ - A use-case that `prisma.*.update({ plan })` while `plan` is in `xiKeys` is **[ArkOrder]** `ARKORDER_XI_FIELD_WRITE`. Invoices and seats still flow through `ingest`.
178
+
174
179
  - Do **not** put `arkOrder` on the compact starter / `ark start` scaffold. Domain stays plane-free. Import `createOrderPlane` from `arkgate/order` (same npm package).
175
180
  - Absence is valid and **silent** — never force the extra. Do not invent `/ark-order`.
176
181
  - Demoting enforced → advisory or deleting the extra is policy-delta **weakening**.
@@ -147,7 +147,7 @@ When `arkRun` is present:
147
147
 
148
148
  ### Autopilot + ArkOrder
149
149
  When `arkOrder` is present:
150
- - Grind skip clusters with judgment: `ARKORDER_MISSING_PLANE` / `ARKORDER_KERNEL_IN_DOMAIN` / `ARKORDER_GENERIC_UPDATE` / `ARKORDER_TOO_MANY_PARAMS` / `ARKORDER_INGEST_WRITES_XI`. Freeze ξ with `release()`; never `update`/`patch`/`set`.
150
+ - Grind skip clusters with judgment: `ARKORDER_MISSING_PLANE` / `ARKORDER_KERNEL_IN_DOMAIN` / `ARKORDER_GENERIC_UPDATE` / `ARKORDER_TOO_MANY_PARAMS` / `ARKORDER_INGEST_WRITES_XI` / `ARKORDER_XI_FIELD_WRITE`. Freeze ξ with `release()`; never `update`/`patch`/`set`. Name `xiKeys`; do not persist those keys from a use-case.
151
151
  - Extra off → `/ark-adopt` (advisory). Do not invent `/ark-order`.
152
152
  - Skills never enforce.
153
153
 
@@ -43,6 +43,10 @@ restart/retargeting is required. `ark://manifest` never satisfies this preflight
43
43
 
44
44
  Label findings **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. Absence of extras is valid and silent. First-time extra is **`/ark-adopt`** (advisory). Wire one kernel candidate with **`/ark-runtime`**. New kernel-managed / plane-root file with **`/ark-place`**. Grind skip clusters with **`/ark-autopilot`**. Do not invent `/ark-run` or `/ark-order`. Skills never enforce.
45
45
 
46
+ Application / Features may declare advisory **`writes-via-aggregate`**: a use-case that imports a persistence driver and calls `.insert` / `.create` / `INSERT INTO` is the skip. Persistence adapters stay the write edge. Do not add `Externals/` or `admission.ts` as contract law.
47
+
48
+ When `arkOrder` is on, name **`xiKeys`** (3–5 slow product decisions). Membership ids are not keys. A use-case that persists those keys is `ARKORDER_XI_FIELD_WRITE`. Copy [examples/arkorder-billing/](../../../examples/arkorder-billing/) and rename the three keys.
49
+
46
50
  ## Subagent fan-out (optional, host-dependent)
47
51
 
48
52
  If the host supports **parallel subagents**, fan out read-only scouts; otherwise
@@ -127,8 +127,9 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
127
127
 
128
128
 
129
129
  ### Place + ArkRules
130
- - Choose layer from contract **and** check structure sensors for that layer (private state, factory, thin adapter).
130
+ - Choose layer from contract **and** check structure sensors for that layer (private state, factory, thin adapter, writes-via-aggregate).
131
131
  - Scaffold to satisfy **[ArkRules]** when present; state which sensors apply.
132
+ - Persistence **writes** (insert/update/delete against a driver) go through a Domain aggregate + persistence adapter. Application/Feature files that import Prisma/pg/Supabase and call `.insert` / `.create` are **[ArkRules]** `writes-via-aggregate`. Do not invent `Externals/` or `admission.ts`.
132
133
 
133
134
  ### Place + ArkRun
134
135
  When `arkRun` is present on the architecture config:
@@ -146,7 +147,8 @@ When `arkOrder` is present on the architecture config:
146
147
  - Import `createOrderPlane` from `arkgate/order` (same npm package). Domain-role files stay plane-free.
147
148
  - 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`.
148
149
  - 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`.
150
+ - Named slow keys live in `arkOrder.xiKeys`. A managed-layer Prisma/pg write of those keys is `ARKORDER_XI_FIELD_WRITE` absorb with `ingest` or change the pattern with `proposeRelease`.
151
+ - Skip clusters (`ARKORDER_MISSING_PLANE` / `ARKORDER_KERNEL_IN_DOMAIN` / `ARKORDER_GENERIC_UPDATE` / `ARKORDER_TOO_MANY_PARAMS` / `ARKORDER_INGEST_WRITES_XI` / `ARKORDER_XI_FIELD_WRITE`): place this artifact, then grind via `/ark-autopilot`. Extra not on → `/ark-adopt`. Do not invent `/ark-order`.
150
152
  - Absence of the extra is valid. Do not invent `/ark-order`. Skills never enforce.
151
153
 
152
154
  ## Subagent fan-out (optional, host-dependent)
@@ -178,6 +180,8 @@ the same files or weaken the gate.
178
180
  - Orchestrates a use case, no I/O of its own → application layer.
179
181
  - Talks to a database, queue, API, filesystem → an adapter layer on the side
180
182
  that matches the direction (driven/persistence vs driving/http).
183
+ **Writes** go through a Domain aggregate that uses a persistence port; the
184
+ adapter implements the port. Do not put `prisma.order.create` in a use case.
181
185
  - Reacts to events, long-running coordination (saga/workflow), scheduled
182
186
  jobs, projections → the event/workflow layers if the config declares them.
183
187
  When `arkRun` is on, wire those through the kernel (register + declarations),
@@ -8,6 +8,12 @@
8
8
  "sensor": "orchestration-only",
9
9
  "mode": "advisory",
10
10
  "description": "Application use cases orchestrate; keep domain branching in Domain."
11
+ },
12
+ {
13
+ "id": "writes-via-aggregate",
14
+ "sensor": "writes-via-aggregate",
15
+ "mode": "advisory",
16
+ "description": "Persistence writes go through a Domain aggregate and a persistence adapter; use cases do not call the driver."
11
17
  }
12
18
  ],
13
19
  "invariants": []
@@ -142,6 +142,7 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
142
142
  ### Adopt + ArkRules
143
143
  - After classify: emit or refresh `arkRules` for matched layers (exact names; generic mold for unknowns).
144
144
  - Mine rules → inventory + write advisory invariants/structure into `arkrules/<Layer>.json` **in this turn**.
145
+ - Application / Features templates include advisory `writes-via-aggregate`: driver import + write token in a use case is the skip. Do not copy `Externals/` / `admission.ts` folder religion.
145
146
  - Freeze baseline is **[Layer]** debt; inventory residual is **[ArkRules]** — report both.
146
147
 
147
148
  ### Adopt + ArkRun
@@ -156,8 +157,8 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
156
157
 
157
158
  ### Adopt + ArkOrder
158
159
  - User asked to turn the extra on: write **advisory** `arkOrder` on `ark.config.json` (`schemaVersion` `1.3+`) **in this turn**. Default `"mode": "advisory"` — never session-0 default `enforced`.
159
- - Required shape: `planeRoots` (real files; empty + enforced = `ARKORDER_MISSING_PLANE`), `managedLayers` (existing `layers[].name` only), `maxXiKeys` (default 7).
160
- - Example (consumer trees — not this library's 4-layer compact):
160
+ - Required shape: `planeRoots` (real files; empty + enforced = `ARKORDER_MISSING_PLANE`), `managedLayers` (existing `layers[].name` only), `maxXiKeys` (default 7), **`xiKeys`** (the 3–5 slow names; empty = field-write sensor silent).
161
+ - Example (consumer trees — not this library's 4-layer compact). Copy billing, **rename the three keys**:
161
162
 
162
163
  ```json
163
164
  {
@@ -166,11 +167,15 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
166
167
  "mode": "advisory",
167
168
  "planeRoots": ["src/main.ts"],
168
169
  "managedLayers": ["Application"],
169
- "maxXiKeys": 7
170
+ "maxXiKeys": 7,
171
+ "xiKeys": ["plan", "cycle", "tenancy"]
170
172
  }
171
173
  }
172
174
  ```
173
175
 
176
+ - `xiKeys` are meaning, not membership. `projectId` / `orgId` do not belong. If `proposeRelease` throws empty blast, that key does not order anything.
177
+ - A use-case that `prisma.*.update({ plan })` while `plan` is in `xiKeys` is **[ArkOrder]** `ARKORDER_XI_FIELD_WRITE`. Invoices and seats still flow through `ingest`.
178
+
174
179
  - Do **not** put `arkOrder` on the compact starter / `ark start` scaffold. Domain stays plane-free. Import `createOrderPlane` from `arkgate/order` (same npm package).
175
180
  - Absence is valid and **silent** — never force the extra. Do not invent `/ark-order`.
176
181
  - Demoting enforced → advisory or deleting the extra is policy-delta **weakening**.
@@ -147,7 +147,7 @@ When `arkRun` is present:
147
147
 
148
148
  ### Autopilot + ArkOrder
149
149
  When `arkOrder` is present:
150
- - Grind skip clusters with judgment: `ARKORDER_MISSING_PLANE` / `ARKORDER_KERNEL_IN_DOMAIN` / `ARKORDER_GENERIC_UPDATE` / `ARKORDER_TOO_MANY_PARAMS` / `ARKORDER_INGEST_WRITES_XI`. Freeze ξ with `release()`; never `update`/`patch`/`set`.
150
+ - Grind skip clusters with judgment: `ARKORDER_MISSING_PLANE` / `ARKORDER_KERNEL_IN_DOMAIN` / `ARKORDER_GENERIC_UPDATE` / `ARKORDER_TOO_MANY_PARAMS` / `ARKORDER_INGEST_WRITES_XI` / `ARKORDER_XI_FIELD_WRITE`. Freeze ξ with `release()`; never `update`/`patch`/`set`. Name `xiKeys`; do not persist those keys from a use-case.
151
151
  - Extra off → `/ark-adopt` (advisory). Do not invent `/ark-order`.
152
152
  - Skills never enforce.
153
153