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
package/CHANGELOG.md CHANGED
@@ -3,13 +3,25 @@
3
3
  All notable changes to ArkGate (`arkgate`; formerly `ark-runtime-kernel`) are documented here or
4
4
  in the immutable pre-2.0 archive linked below.
5
5
 
6
+ ## 4.8.3 — 2026-08-30
7
+
8
+ **Patch** over **4.8.2**. Persistence writes in a use-case skip the aggregate (`writes-via-aggregate`). ArkOrder **`xiKeys`** names the slow product decisions; a managed-layer Prisma/pg write of those keys is `ARKORDER_XI_FIELD_WRITE`. Dead sensors (`too-many-params`, `ingest-writes-xi`) now emit. No new skill names. Does not close `K01` / `Z09`. **No required config migration.**
9
+
10
+ **Status: published** (on npm `latest`; see `docs/releases/4.8.3.md`).
11
+
12
+ ### Added
13
+ - **`writes-via-aggregate`:** tier-1 structure sensor (ADR 0032). Direct evidence = persistence driver import **and** a write token (`.insert` / `.create` / `INSERT INTO` / …). Default advisory; promotable. Absence of the rule is silent.
14
+ - Application + vertical-slice Features starter rules ship the sensor advisory. `/ark-place` `/ark-adopt` `/ark-contract` name the skip. No `Externals/` / `admission.ts` folder religion.
15
+ - **`arkOrder.xiKeys`:** optional 3–5 slow names. Empty stays silent. A use-case that persists a named key is `ARKORDER_XI_FIELD_WRITE`. Copy billing, rename the keys. Membership ids are not keys.
16
+ - ArkOrder sensors `ARKORDER_TOO_MANY_PARAMS` and `ARKORDER_INGEST_WRITES_XI` now emit (they were catalog-only).
17
+
6
18
  ## 4.8.2 — 2026-08-30
7
19
 
8
20
  **Patch** over **4.8.1**. Frozen 13 skills match four-plane honesty: ArkOrder on
9
21
  adopt / place / autopilot; ArkRun `kernelRoots`; kernel import `arkgate/runtime`.
10
22
  No `/ark-order` / `/ark-run`. Does not close `K01` / `Z09`. **No required config migration.**
11
23
 
12
- **Status: published** (on npm `latest`; see `docs/releases/4.8.2.md`).
24
+ **Status: published** (see `docs/releases/4.8.2.md`).
13
25
 
14
26
  ### Changed
15
27
  - **Skills four-plane honesty:** existing 13 names teach Layers, ArkRules, ArkRun, and ArkOrder. Adopt (session-0: schema `1.3+`, `planeRoots`, `maxXiKeys`) and Autopilot (grind) name ArkOrder; Place hands ArkOrder grind to Autopilot. ArkRun `kernelRoots` is preferred (`compositionRoots` alias). Kernel import is `arkgate/runtime` (companion deprecated). Skills never enforce.
@@ -18,7 +30,7 @@ No `/ark-order` / `/ark-run`. Does not close `K01` / `Z09`. **No required config
18
30
 
19
31
  **Patch** over **4.8.0**. ArkRules invariant coverage reads tests first and retains only files that mention a declared invariant id, so large repos no longer report `INVARIANT_UNCOVERED` / `never-had-tests` while covering tests sit on disk. Does not close `K01` / `Z09`. **No required config migration.**
20
32
 
21
- **Status: published** (on npm `latest`; see `docs/releases/4.8.1.md`).
33
+ **Status: published** (see `docs/releases/4.8.1.md`).
22
34
 
23
35
  ### Fixed
24
36
  - **INVARIANT_UNCOVERED on large trees:** `loadInvariantCoverageInputs` spent `MAX_COVERAGE_FILES` (400) on production facts before walking tests. Any repo with more than 400 governed files got `testGlobsMissing: true` and a false *never-had-tests* claim. Tests walk first; with `invariantIds`, a test is retained only if it mentions a catalog id. Doctor and policy-delta use the same ids. When the file budget is exhausted, the diagnostic says so instead of claiming the suite never existed.
@@ -30,7 +42,7 @@ No `/ark-order` / `/ark-run`. Does not close `K01` / `Z09`. **No required config
30
42
  the same tarball. `@arkgate/runtime` is **deprecated**. Does not close `K01` / `Z09`.
31
43
  ArkRules unchanged.
32
44
 
33
- **Status: published** (on npm `latest`; see `docs/releases/4.8.0.md`).
45
+ **Status: published** (see `docs/releases/4.8.0.md`).
34
46
 
35
47
  ### Added
36
48
  - **ArkOrder extra (`arkOrder`):** optional, silent when absent. Enforced skip: missing plane, Domain import of `arkgate/order`, generic `update` of ξ.
package/README.md CHANGED
@@ -29,11 +29,13 @@ Works with Cursor, Claude, Codex, and Grok.
29
29
 
30
30
  </div>
31
31
 
32
- > **ArkGate 4.8.2** is on npm `latest`. Write. Check. Ship. Adopted = required GitHub
32
+ > **ArkGate 4.8.3** is on npm `latest`. Write. Check. Ship. Adopted = required GitHub
33
33
  > status running `arkgate-check --strict-merge`, or an explicit `advisory-only` stance.
34
34
  > Status is compact (`arkgate-check --doctor`; `--all` for Details). Optional **ArkRun**
35
- > (`arkgate/runtime`) is an in-memory runtime — not Postgres. `@arkgate/runtime` is deprecated.
36
- > [4.8.2](docs/releases/4.8.2.md) · [4.8.1](docs/releases/4.8.1.md) · [4.8.0](docs/releases/4.8.0.md) · [Docs hub](docs/README.md) · [Voice](docs/product-voice.md)
35
+ > (`arkgate/runtime`) is an in-memory runtime — not Postgres. Optional **ArkOrder**
36
+ > (`arkgate/order`) stops the agent rewriting the few slow product decisions as CRUD.
37
+ > `@arkgate/runtime` is deprecated.
38
+ > [4.8.3](docs/releases/4.8.3.md) · [4.8.2](docs/releases/4.8.2.md) · [4.8.1](docs/releases/4.8.1.md) · [4.8.0](docs/releases/4.8.0.md) · [Docs hub](docs/README.md) · [Voice](docs/product-voice.md)
37
39
 
38
40
  ---
39
41
 
@@ -90,7 +92,7 @@ Aliases `ark` / `ark-check` / `ark-mcp` still work. npm / pnpm / yarn. No instal
90
92
 
91
93
  When the agent writes a bad import, the write doesn’t land.
92
94
  The same check fails the pull request. That is **ArkGate** — import rules, always on
93
- once you adopt. The other two are optional.
95
+ once you adopt. The other three are optional.
94
96
 
95
97
  | | Role | When |
96
98
  |--|------|------|
@@ -98,13 +100,17 @@ once you adopt. The other two are optional.
98
100
  | **Before merge** | `arkgate-check` as a **required** CI status | Always (ArkGate) |
99
101
  | **ArkRules** | Optional policies *inside* a layer | When you ask |
100
102
  | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) | Off unless you turn it on |
103
+ | **ArkOrder** | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`) | Off unless you turn it on |
101
104
 
102
- Layers (who may import whom) always run. ArkRules and ArkRun change no inter-layer
103
- verdict when absent. Label leftovers **`[Layer]`** vs **`[ArkRules]`**.
105
+ Layers (who may import whom) always run. ArkRules, ArkRun, and ArkOrder change no
106
+ inter-layer verdict when absent. Label leftovers **`[Layer]`** vs **`[ArkRules]`** vs
107
+ **`[ArkRun]`** vs **`[ArkOrder]`**.
104
108
  Details: [configuration](docs/configuration.md) · [use](docs/use.md).
105
109
 
106
110
  **Not** an API Gateway, a folder linter, a web framework, ORM, or job runner.
107
- ArkRun is in-memory — local and tests, not Postgres.
111
+ ArkRun is in-memory — local and tests, not Postgres. ArkOrder does not replace
112
+ import rules: layers can be green while the agent still PATCHes the billing plan
113
+ like a seat count.
108
114
 
109
115
  **Name note:** npm package `arkgate` — not affiliated with the separate Archgate CLI project.
110
116
 
@@ -211,6 +217,7 @@ expectation.
211
217
  | Placement + preflight for multi-file changes | ✅ | ❌ |
212
218
  | Honest governed % + dual plan (edges vs shape) | ✅ | ❌ |
213
219
  | Opt-in intra-layer ArkRules (structure + invariants) | ✅ | ❌ |
220
+ | Stops agents rewriting slow product decisions as CRUD (ArkOrder) | ✅ | ❌ |
214
221
  | Incomplete analysis cannot look green | ✅ | varies |
215
222
 
216
223
  ---
@@ -254,6 +261,29 @@ interfaces for production. Details: [docs/production-hardening.md](docs/producti
254
261
 
255
262
  ---
256
263
 
264
+ ## Optional ArkOrder
265
+
266
+ Layers stop a bad import. They do not stop a *legal* import that overwrites the
267
+ billing plan.
268
+
269
+ If the product can name a few slow decisions in an afternoon — plan, cycle,
270
+ tenancy; a clinical protocol; match rules — an agent will still ship one PUT
271
+ that changes them together with seats and invoices. The write gate stays green
272
+ because “what may be the plan” was never a rule.
273
+
274
+ **ArkOrder** (`arkgate/order`) is that rule. Off unless you add `arkOrder`.
275
+ Name the slow keys (`xiKeys`: plan, protocol, cost-code bound — not `projectId`).
276
+ Posting an invoice is absorbed. Changing plan is a new release, with a blast
277
+ radius. A generic `update` of the plan does not land. A use-case that PATCHes
278
+ those keys through Prisma is named. Same npm package.
279
+ In-memory. Not durable. Does not replace ArkRun.
280
+
281
+ Copy [examples/arkorder-billing/](examples/arkorder-billing/) and rename the
282
+ three keys. Compact starters leave it off. Details:
283
+ [configuration](docs/configuration.md) · [package surface](docs/package-surface.md).
284
+
285
+ ---
286
+
257
287
  ## Documentation
258
288
 
259
289
  | Audience | Link |
@@ -266,7 +296,8 @@ interfaces for production. Details: [docs/production-hardening.md](docs/producti
266
296
  | Config · package surface · TS | [configuration](docs/configuration.md) · [package-surface](docs/package-surface.md) · [typescript-support](docs/typescript-support.md) |
267
297
  | Brownfield | [docs/brownfield-adoption.md](docs/brownfield-adoption.md) |
268
298
  | Security | [SECURITY.md](SECURITY.md) |
269
- | Current published (4.8.2 on npm `latest`) | [docs/releases/4.8.2.md](docs/releases/4.8.2.md) · [CHANGELOG](CHANGELOG.md) |
299
+ | Current published (4.8.3 on npm `latest`) | [docs/releases/4.8.3.md](docs/releases/4.8.3.md) · [CHANGELOG](CHANGELOG.md) |
300
+ | Prior published (4.8.2) | [docs/releases/4.8.2.md](docs/releases/4.8.2.md) |
270
301
  | Prior published (4.8.1) | [docs/releases/4.8.1.md](docs/releases/4.8.1.md) |
271
302
  | Prior published (4.8.0) | [docs/releases/4.8.0.md](docs/releases/4.8.0.md) |
272
303
  | Prior published (4.7.6) | [docs/releases/4.7.6.md](docs/releases/4.7.6.md) |