arkgate 4.8.11 → 4.8.13

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 (41) hide show
  1. package/CHANGELOG.md +43 -2
  2. package/README.md +22 -32
  3. package/bin/ark-check-runtime.mjs +2 -0
  4. package/bin/lib/analysis-engine.mjs +4 -4
  5. package/bin/lib/ark-order-doctor.mjs +154 -0
  6. package/bin/lib/ark-order-report.mjs +64 -0
  7. package/bin/lib/ark-order-sensors.mjs +1 -1
  8. package/bin/lib/diagnostic-catalog.mjs +2 -2
  9. package/bin/lib/doctor-advisories.mjs +91 -18
  10. package/bin/lib/doctor-human.mjs +2 -10
  11. package/bin/lib/doctor-plan.mjs +4 -3
  12. package/bin/lib/extra-merge-teeth.mjs +32 -4
  13. package/bin/lib/html-report-advisories.mjs +2 -0
  14. package/bin/lib/html-report-depth.mjs +8 -18
  15. package/bin/lib/html-report.mjs +16 -0
  16. package/bin/lib/remediation.mjs +5 -5
  17. package/bin/lib/rules-under-contract.mjs +14 -0
  18. package/bin/lib/start-preview.mjs +1 -0
  19. package/bin/lib/status-command.mjs +28 -0
  20. package/bin/lib/status-manifest.mjs +23 -0
  21. package/bin/lib/violations.mjs +10 -1
  22. package/dist/{diagnosticCatalog-DiflIock.d.ts → diagnosticCatalog-DA565Lja.d.ts} +1 -1
  23. package/dist/eslint/index.cjs +4 -4
  24. package/dist/eslint/index.js +4 -4
  25. package/dist/index.cjs +31 -31
  26. package/dist/index.d.ts +71 -3
  27. package/dist/index.js +31 -31
  28. package/dist/nestjs/index.cjs +1 -1
  29. package/dist/nestjs/index.js +1 -1
  30. package/dist/runtime/index.cjs +15 -15
  31. package/dist/runtime/index.d.ts +1 -1
  32. package/dist/runtime/index.js +15 -15
  33. package/docs/README.md +4 -3
  34. package/docs/agent-guide.md +2 -1
  35. package/docs/arkorder.md +28 -10
  36. package/docs/package-surface.md +2 -1
  37. package/docs/product-voice.md +9 -8
  38. package/docs/use.md +1 -1
  39. package/package.json +1 -1
  40. package/schemas/ark.status-manifest.schema.json +47 -0
  41. package/server.json +2 -2
package/docs/README.md CHANGED
@@ -71,8 +71,9 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
71
71
  | Field adoption kit (scaffolding, not closed) | [field/](field/) |
72
72
  | Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
73
73
 
74
- Prepared: [releases/4.8.11.md](releases/4.8.11.md) (`arkgate@4.8.11`; not published).
75
- Current published: [releases/4.8.10.md](releases/4.8.10.md) (`arkgate@4.8.10` on npm `latest`; does not close `K01`).
74
+ Prepared: [CHANGELOG](../CHANGELOG.md) (`arkgate@4.8.13`; not published).
75
+ Current published: [releases/4.8.11.md](releases/4.8.11.md) (`arkgate@4.8.11` on npm `latest`; does not close `K01`).
76
+ Prior published: [releases/4.8.10.md](releases/4.8.10.md) (`arkgate@4.8.10`).
76
77
  Prior published: [releases/4.8.9.md](releases/4.8.9.md) (`arkgate@4.8.9`).
77
78
  Prior: [releases/4.8.6.md](releases/4.8.6.md) · [releases/4.8.5.md](releases/4.8.5.md) · [releases/4.8.4.md](releases/4.8.4.md) · [releases/4.8.3.md](releases/4.8.3.md) · [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).
78
79
  Older notes: [releases/](releases/). Config: [configuration.md](configuration.md).
@@ -85,4 +86,4 @@ Older notes: [releases/](releases/). Config: [configuration.md](configuration.md
85
86
  2. **One primary flow** — `start` → doctor → optional guided work.
86
87
  3. **Honest hardness** — host write guarantees differ; a **required GitHub status context** running the merge CLI is the shared hard boundary.
87
88
  4. **History is not the product** — version archaeology lives under `releases/` and `plans/`, not the front door.
88
- 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).
89
+ 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 rewriting a big product choice (like billing plan) as if it were a seat count. Voice: [product-voice.md](product-voice.md).
@@ -536,7 +536,8 @@ npx ark-check --promote <ruleId> --apply # write mode "enforced" into that
536
536
  ArkOrder — with its plane, its tier and whether it can *ever* be enforced, so
537
537
  Tier-2 shows up before you write the rule rather than after you wait for a run.
538
538
  ArkOrder: `proposeRelease` then `apply`; `refreshSigma`; ingest residual;
539
- capacity pack; `ReleaseStore`; ArkRun `decisionTape`. No `/ark-order` skill.
539
+ capacity pack; `ReleaseStore`; ArkRun `decisionTape`. Extras door:
540
+ `/ark-adopt`. First contact: doctor + `[ArkOrder]` on the check.
540
541
  It also says *how*: only the ArkRules plane is promoted per rule; ArkRun and
541
542
  ArkOrder are switched by the plane-level `arkRun.mode` / `arkOrder.mode`, and
542
543
  `--promote --apply` writes ArkRules documents only.
package/docs/arkorder.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # ArkOrder
2
2
 
3
- **Write. Check. Ship.** Layers can be green while an agent still PATCHes the
4
- billing plan as if it were a seat count. ArkOrder is the extra that names the
5
- few slow product decisions and stops that write.
3
+ **Layers stop a bad import. ArkOrder stops rewriting a big product choice
4
+ like the billing plan as if it were a seat count. Change those choices
5
+ through a valve, not a generic update.**
6
6
 
7
7
  Import: `arkgate/order` (same npm package `arkgate`). Off until you add
8
- `arkOrder` on schema `1.3`. Absence is silent. In-memory. Not durable. It is
9
- a library plus sensors, not a service. Does **not** replace ArkRun.
8
+ `arkOrder`. Absence is silent. In-memory. Not durable. A library plus
9
+ sensors, not a service. Does **not** replace ArkRun.
10
10
 
11
- First-contact copy: freeze through a valve / no `update`. Haken vs s) lives
12
- below. **ArkOrder freezes the pattern through a valve. ArkRun is how the residual travels.**
11
+ Turn the extra on with `/ark-adopt`. First contact is doctor + `[ArkOrder]`
12
+ on the check. Names like ξ live below, in the valve and sensor tables.
13
13
 
14
14
  Canonical plan seed: [plans/arkorder/README.md](plans/arkorder/README.md).
15
15
  ADRs: [0027](adr/0027-arkorder-gated-extra-plane.md)–[0030](adr/0030-opt-in-extras-same-npm-package.md),
@@ -189,8 +189,9 @@ one axis: the factory root.
189
189
  Do not rename `planeRoots` to `kernelRoots`. They name different factories.
190
190
  List both on `ark-check --sensors` (same table, same tier vocabulary).
191
191
 
192
- Turn extras on with `/ark-adopt`. Place new files with `/ark-place`. There is
193
- no `/ark-order` skill.
192
+ Turn extras on with `/ark-adopt`. Place new files with `/ark-place`. First
193
+ contact is doctor + the `[ArkOrder]` check label — same envelope as a bad
194
+ import. A dedicated `/ark-order` skill is not required for that.
194
195
 
195
196
  ---
196
197
 
@@ -247,10 +248,26 @@ cash received against amount due, not a key to freeze or change with
247
248
 
248
249
  The valved loop ships in **4.8.6** ([ADR 0034](adr/0034-arkorder-valved-loop.md)).
249
250
  In-memory `ReleaseStore` is **not** durable. Doctor / status `arkOrder` stays
250
- `notAScore`. This does **not** close `K01` / `Z09`. No `/ark-order` skill.
251
+ `notAScore`. This does **not** close `K01` / `Z09`. The extras door stays
252
+ `/ark-adopt`.
251
253
 
252
254
  ---
253
255
 
256
+ ## Doctor / start / status
257
+
258
+ `--doctor` always emits an ArkOrder row (`notAScore`). Absence is a silent
259
+ line. When the extra is on, the first human line is the one-breath:
260
+
261
+ **Layers stop a bad import. ArkOrder stops rewriting a big product choice —
262
+ like the billing plan — as if it were a seat count. Change those choices
263
+ through a valve, not a generic update.**
264
+
265
+ `ark start` leaves extras off (`Optional extras stay off. This start is
266
+ layers only — they stop bad imports.`).
267
+ `ark status` projects a thin `arkOrder` slice (present / mode / leftover
268
+ count). A deny prints `[ArkOrder]` next to `ARKORDER_*`, the same envelope
269
+ as a bad import.
270
+
254
271
  ## Next step
255
272
 
256
273
  ```bash
@@ -258,4 +275,5 @@ npx arkgate-check --doctor
258
275
  # gallery (not in the npm tarball):
259
276
  # https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing
260
277
  # /ark-adopt to turn arkOrder on advisory
278
+ # Proof deny: skip corpus trees/xi-field-write (Prisma PATCH of plan)
261
279
  ```
@@ -266,7 +266,8 @@ production deployment would need to satisfy; it is not a readiness certification
266
266
  ## Release notes (maintainers)
267
267
 
268
268
  Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
269
- (current published: [4.8.10.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.10.md);
269
+ (current published: [4.8.11.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.11.md);
270
+ prior published: [4.8.10.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.10.md);
270
271
  prior published: [4.8.9.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.9.md);
271
272
  prior published: [4.8.8.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.8.md);
272
273
  prior published: [4.8.7.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.7.md);
@@ -21,9 +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.
24
+ **ArkOrder** is the extra that stops rewriting a big product choice like
25
+ the billing plan — as if it were a seat count (`arkgate/order`). Change those
26
+ choices through a valve, not a generic update. Off unless you turn it on.
27
+ Same npm package. In-memory. Not durable. Does not replace ArkRun.
27
28
 
28
29
  ```text
29
30
  Write. the agent writes
@@ -35,7 +36,7 @@ Ship. required GitHub check, then merge
35
36
  ArkGate always import rules (write + required CI)
36
37
  ArkRules optional policies inside a layer
37
38
  ArkRun optional experimental runtime — in-memory, not Postgres
38
- ArkOrder optional the few slow product decisions the agent must not CRUD
39
+ ArkOrder optional big product choices (billing plan, not seat counts)
39
40
  ```
40
41
 
41
42
  Status first (`arkgate-check --doctor`). One next step. CLI flag `--doctor` stays;
@@ -53,7 +54,7 @@ On the eight canonical public openings — `README.md`, `docs/use.md`,
53
54
  2. **Deny:** `When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.`
54
55
  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.`
55
56
  4. **Story:** the exact four-paragraph introduction below, with no visible heading or labels.
56
- 5. **Technical nouns (below the introduction):** 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.
57
+ 5. **Technical nouns (below the introduction):** ArkGate is import rules. ArkRules is optional policies. ArkRun is an optional experimental runtime. ArkOrder stops rewriting a big product choice (like billing plan) as if it were a seat count — named when the consumer opts in, never as the first noun. No ξ / Haken / slaving on the first screen.
57
58
 
58
59
  Do not lead with folders, `ark.config.json`, “contract”, “gate”, “house”, or “doctor”
59
60
  as the first noun. Historical: `If the AI writes an illegal import, the write is rejected`
@@ -80,7 +81,7 @@ Safer changes, fewer surprises, and extra protection only when you choose it.
80
81
 
81
82
  Do not add technical terms to these four paragraphs. In the next section, explain that
82
83
  ArkGate checks imports, ArkRules is optional, ArkRun is experimental and in-memory,
83
- and ArkOrder is optional and for a few slow product decisions.
84
+ and ArkOrder is optional and stops rewriting a big product choice like the billing plan.
84
85
 
85
86
  ---
86
87
 
@@ -113,7 +114,7 @@ Three beats when a line teaches:
113
114
  | `arkgate-check --doctor` — **status**, one next step | control plane, coach, doctor as the product name |
114
115
  | optional policies inside a layer | dual plane, intra-layer sensors, Saturday tidy |
115
116
  | experimental runtime / in-memory / not Postgres | production kernel, durable runtime, training wheels |
116
- | the few slow product decisions / billing plan vs seats / that PUT doesn’t land / `proposeRelease` then `apply` | four verbs, freeze a pattern, Haken, slaving, ξ vs s, extra plane, construction OS |
117
+ | Layers stop a bad import. ArkOrder stops rewriting a big product choice (like billing plan) as if it were a seat count. Change those choices through a valve, not a generic update. | four verbs, freeze a pattern, Haken, slaving, ξ vs s, extra plane, construction OS, Prisma PATCH of a named slow key |
117
118
 
118
119
  Command names stay command names (`--doctor` is a flag). If a word is not here,
119
120
  cut it or put it below the fold (develop, JSON, ADRs).
@@ -201,7 +202,7 @@ Invoking a command **is** the approval. CLI checks; it does not silently rewrite
201
202
  - [ ] **Write. Check. Ship.** is on first-contact.
202
203
  - [ ] Deny is `When the agent writes a bad import, the write doesn’t land.`
203
204
  - [ ] One next action is obvious.
204
- - [ ] ArkGate / ArkRules / ArkRun / ArkOrder are import rules / policies / experimental runtime / the extra that stops slow product decisions being CRUD.
205
+ - [ ] ArkGate / ArkRules / ArkRun / ArkOrder are import rules / policies / experimental runtime / the extra that stops a big product choice being rewritten like a seat count.
205
206
  - [ ] ArkRun is never implied durable / Postgres.
206
207
  - [ ] ArkOrder is never implied durable, a second install, or a replacement for ArkRun.
207
208
  - [ ] Status lights read Setup / In progress / Ready to humans.
package/docs/use.md CHANGED
@@ -89,7 +89,7 @@ The config only binds when the write doesn’t land and CI is required.
89
89
  | **ArkGate** (layers) | Import rules. The write doesn’t land. The PR fails. | Always — this is the product |
90
90
  | **ArkRules** | Optional policies *inside* a layer. | Off until you turn it on (start may ship advisory templates) |
91
91
  | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) | Off. In-memory. Not Postgres. |
92
- | **ArkOrder** | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`). Library + sensors, [not a service](arkorder.md). Valve: `proposeRelease` then `apply`; `refreshSigma`; ingest residual; capacity pack; `ReleaseStore`; ArkRun `decisionTape`. ArkOrder freezes the pattern through a valve. ArkRun is how the residual travels. | Off. Name `xiKeys` (plan / protocol, not `projectId`). Derive recomputable statuses; invoices and seats still flow. In-memory. Not durable. |
92
+ | **ArkOrder** | Stops rewriting a big product choice (like billing plan) as if it were a seat count. Change it through a valve, not a generic update. Library + sensors, [not a service](arkorder.md). | Off. Same npm package (`arkgate/order`). Name the few choices (`xiKeys`). Invoices and seats still flow. In-memory. Not durable. |
93
93
 
94
94
  Start always gives you **layers**. Compact starters do **not** turn on ArkRun or
95
95
  ArkOrder. No extras is fine — only ArkGate runs. Leftovers are labeled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.8.11",
3
+ "version": "4.8.13",
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",
@@ -390,6 +390,53 @@
390
390
  ]
391
391
  }
392
392
  }
393
+ },
394
+ "arkOrder": {
395
+ "type": "object",
396
+ "description": "ArkOrder extra residual (notAScore). present/mode from config; residual is a finding-id count (null = unknown, not green). extraMergeTeeth is honesty, never a score.",
397
+ "additionalProperties": false,
398
+ "required": [
399
+ "notAScore",
400
+ "present",
401
+ "mode",
402
+ "extraMergeTeeth",
403
+ "residual"
404
+ ],
405
+ "properties": {
406
+ "notAScore": {
407
+ "const": true
408
+ },
409
+ "present": {
410
+ "type": "boolean"
411
+ },
412
+ "mode": {
413
+ "anyOf": [
414
+ {
415
+ "enum": [
416
+ "advisory",
417
+ "enforced"
418
+ ]
419
+ },
420
+ {
421
+ "type": "null"
422
+ }
423
+ ]
424
+ },
425
+ "extraMergeTeeth": {
426
+ "type": "boolean"
427
+ },
428
+ "residual": {
429
+ "anyOf": [
430
+ {
431
+ "type": "integer",
432
+ "minimum": 0
433
+ },
434
+ {
435
+ "type": "null"
436
+ }
437
+ ]
438
+ }
439
+ }
393
440
  }
394
441
  }
395
442
  }
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.11",
9
+ "version": "4.8.13",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "arkgate",
14
- "version": "4.8.11",
14
+ "version": "4.8.13",
15
15
  "runtimeHint": "npx",
16
16
  "transport": {
17
17
  "type": "stdio"