arkgate 4.8.13 → 4.8.14

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 (83) hide show
  1. package/CHANGELOG.md +86 -4
  2. package/README.md +23 -20
  3. package/SECURITY.md +5 -3
  4. package/bin/ark-check-runtime.mjs +9 -9
  5. package/bin/lib/agent-projection-formatters.mjs +2 -0
  6. package/bin/lib/agent-skills-package.mjs +63 -8
  7. package/bin/lib/analysis-engine.mjs +1 -1
  8. package/bin/lib/architecture-scan.mjs +8 -2
  9. package/bin/lib/ark-order-doctor.mjs +7 -1
  10. package/bin/lib/ark-order-report.mjs +2 -1
  11. package/bin/lib/ci-and-commands.mjs +7 -2
  12. package/bin/lib/design-smells.mjs +21 -1
  13. package/bin/lib/diagnostic-catalog.mjs +2 -2
  14. package/bin/lib/doctor-advisories.mjs +15 -7
  15. package/bin/lib/doctor-human.mjs +2 -1
  16. package/bin/lib/first-run-help.mjs +11 -2
  17. package/bin/lib/gate-files.mjs +40 -3
  18. package/bin/lib/install-migrate.mjs +23 -0
  19. package/bin/lib/mcp-hook-payload.mjs +1 -1
  20. package/bin/lib/product-copy.mjs +4 -0
  21. package/bin/lib/remediation.mjs +2 -2
  22. package/bin/lib/resolved-candidate-facts.mjs +144 -36
  23. package/bin/lib/scan-files.mjs +39 -0
  24. package/bin/lib/start-preview.mjs +3 -0
  25. package/bin/lib/upgrade-whats-new.mjs +3 -3
  26. package/bin/lib/violations.mjs +30 -0
  27. package/dist/{diagnosticCatalog-DA565Lja.d.ts → diagnosticCatalog-DVx_2RmF.d.ts} +1 -1
  28. package/dist/eslint/index.cjs +1 -1
  29. package/dist/eslint/index.js +1 -1
  30. package/dist/index.cjs +23 -23
  31. package/dist/index.d.ts +60 -14
  32. package/dist/index.js +17 -17
  33. package/dist/nestjs/index.cjs +1 -1
  34. package/dist/nestjs/index.js +1 -1
  35. package/dist/runtime/index.cjs +11 -11
  36. package/dist/runtime/index.d.ts +1 -1
  37. package/dist/runtime/index.js +11 -11
  38. package/docs/README.md +8 -6
  39. package/docs/agent-guide.md +29 -13
  40. package/docs/ai-gates.md +3 -1
  41. package/docs/arkorder.md +11 -4
  42. package/docs/configuration.md +7 -6
  43. package/docs/develop.md +3 -1
  44. package/docs/diagnostics.md +7 -7
  45. package/docs/enthusiast/README.md +6 -1
  46. package/docs/enthusiast/how-to-gallery-starter.md +2 -1
  47. package/docs/package-surface.md +6 -4
  48. package/docs/product-voice.md +32 -6
  49. package/docs/threat-model.md +2 -2
  50. package/docs/typescript-support.md +3 -3
  51. package/docs/use.md +18 -11
  52. package/package.json +1 -1
  53. package/server.json +2 -2
  54. package/templates/agent-skills/README.md +7 -4
  55. package/templates/agent-skills/ark-adopt/SKILL.md +9 -5
  56. package/templates/agent-skills/ark-architect/SKILL.md +5 -18
  57. package/templates/agent-skills/ark-autopilot/SKILL.md +8 -4
  58. package/templates/agent-skills/ark-contract/SKILL.md +9 -20
  59. package/templates/agent-skills/ark-coverage/SKILL.md +12 -8
  60. package/templates/agent-skills/ark-explain/SKILL.md +7 -3
  61. package/templates/agent-skills/ark-explore/SKILL.md +25 -4
  62. package/templates/agent-skills/ark-fix/SKILL.md +15 -20
  63. package/templates/agent-skills/ark-loop/SKILL.md +14 -20
  64. package/templates/agent-skills/ark-order/SKILL.md +200 -0
  65. package/templates/agent-skills/ark-place/SKILL.md +11 -8
  66. package/templates/agent-skills/ark-runtime/SKILL.md +17 -4
  67. package/templates/agent-skills/ark-think/SKILL.md +24 -126
  68. package/templates/agent-skills/ark-upgrade/SKILL.md +13 -2
  69. package/templates/skills/ark-adopt.md +9 -5
  70. package/templates/skills/ark-architect.md +5 -18
  71. package/templates/skills/ark-autopilot.md +8 -4
  72. package/templates/skills/ark-contract.md +9 -20
  73. package/templates/skills/ark-coverage.md +12 -8
  74. package/templates/skills/ark-explain.md +7 -3
  75. package/templates/skills/ark-explore.md +25 -4
  76. package/templates/skills/ark-fix.md +15 -20
  77. package/templates/skills/ark-loop.md +14 -20
  78. package/templates/skills/ark-order.md +200 -0
  79. package/templates/skills/ark-place.md +11 -8
  80. package/templates/skills/ark-runtime.md +17 -4
  81. package/templates/skills/ark-think.md +24 -126
  82. package/templates/skills/ark-upgrade.md +13 -2
  83. package/templates/tests/ark-adoption-gaps.test.ts +5 -4
package/docs/README.md CHANGED
@@ -10,10 +10,12 @@ AI can build fast—and make a mess just as fast.
10
10
 
11
11
  Keep the product easy to understand, change, and trust.
12
12
 
13
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
13
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
14
14
 
15
15
  Safer changes, fewer surprises, and extra protection only when you choose it.
16
16
 
17
+ That is **Contener · Guiar · Ordenar**.
18
+
17
19
  Pick your path. Skip everything else.
18
20
 
19
21
  | You are… | Start here |
@@ -34,7 +36,7 @@ Product site: [arkgate.online](https://www.arkgate.online/) · npm: [`arkgate`](
34
36
  | [use.md](use.md) | One flow: install → doctor → day-to-day |
35
37
  | [enthusiast/](enthusiast/README.md) | Tutorials and plain-language track |
36
38
  | [demos/](demos/) | Short end-to-end demos |
37
- | [product-voice.md](product-voice.md) | How ArkGate should sound (Write. Check. Ship.) |
39
+ | [product-voice.md](product-voice.md) | How ArkGate should sound (Write. Check. Ship. · Contener · Guiar · Ordenar) |
38
40
 
39
41
  ### Develop (integrate)
40
42
  | Doc | What it is |
@@ -44,7 +46,7 @@ Product site: [arkgate.online](https://www.arkgate.online/) · npm: [`arkgate`](
44
46
  | [agent-guide.md](agent-guide.md) | Agent, CLI, and MCP reference (incl. `ark status --json` / MCP `ark_status`) |
45
47
  | [diagnostics.md](diagnostics.md) | Public diagnostic `ruleId` catalog (why / fix anchors) |
46
48
  | [configuration.md](configuration.md) | `ark.config.json` contract |
47
- | [arkorder.md](arkorder.md) | Optional ArkOrder extra: library + sensors, not a service |
49
+ | [arkorder.md](arkorder.md) | Optional ArkOrder extra: library + sensors, not a service. Proof: [billing gallery](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing) (GitHub, not in the npm tarball) |
48
50
  | [brownfield-adoption.md](brownfield-adoption.md) | Existing messy repos |
49
51
  | [package-surface.md](package-surface.md) | Stable vs experimental package surface |
50
52
  | [typescript-support.md](typescript-support.md) | TS 5 / 6 / 7 analysis boundary |
@@ -52,9 +54,9 @@ Product site: [arkgate.online](https://www.arkgate.online/) · npm: [`arkgate`](
52
54
  ### Contribute (library)
53
55
  | Doc | What it is |
54
56
  |-----|------------|
55
- | [CONTRIBUTING.md](../CONTRIBUTING.md) | Setup, rules, PR/release |
57
+ | [CONTRIBUTING.md](../CONTRIBUTING.md) | Setup, rules, thin publish |
56
58
  | [ROADMAP.md](../ROADMAP.md) | Live implementation queue (one `doing` at a time). History: [archive/roadmap-history.md](archive/roadmap-history.md) |
57
- | [adr/](adr/README.md) | Architecture decisions ([0032](adr/0032-writes-via-aggregate-sensor.md) writes-via-aggregate · [0033](adr/0033-arkorder-runtime-half-is-arkrun.md) ArkOrder runtime half · [0034](adr/0034-arkorder-valved-loop.md) valved loop) |
59
+ | [adr/](adr/README.md) | Architecture decisions ([0032](adr/0032-writes-via-aggregate-sensor.md) writes-via-aggregate · [0033](adr/0033-arkorder-runtime-half-is-arkrun.md) ArkOrder runtime half · [0034](adr/0034-arkorder-valved-loop.md) valved loop · [0036](adr/0036-skill-catalog-product-capacity.md) skill catalog capacity) |
58
60
  | [SECURITY.md](../SECURITY.md) · [threat-model.md](threat-model.md) | Security |
59
61
 
60
62
  ---
@@ -71,7 +73,7 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
71
73
  | Field adoption kit (scaffolding, not closed) | [field/](field/) |
72
74
  | Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
73
75
 
74
- Prepared: [CHANGELOG](../CHANGELOG.md) (`arkgate@4.8.13`; not published).
76
+ Prepared: [CHANGELOG](../CHANGELOG.md) (`arkgate@4.8.14`; not published until `publish-npm` for `v4.8.14`).
75
77
  Current published: [releases/4.8.11.md](releases/4.8.11.md) (`arkgate@4.8.11` on npm `latest`; does not close `K01`).
76
78
  Prior published: [releases/4.8.10.md](releases/4.8.10.md) (`arkgate@4.8.10`).
77
79
  Prior published: [releases/4.8.9.md](releases/4.8.9.md) (`arkgate@4.8.9`).
@@ -10,10 +10,12 @@ AI can build fast—and make a mess just as fast.
10
10
 
11
11
  Keep the product easy to understand, change, and trust.
12
12
 
13
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
13
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
14
14
 
15
15
  Safer changes, fewer surprises, and extra protection only when you choose it.
16
16
 
17
+ That is **Contener · Guiar · Ordenar**.
18
+
17
19
  This guide is the **develop** reference for agents and codegen: write hooks, advisory MCP tools,
18
20
  CI, and `/ark-*` skills.
19
21
 
@@ -227,10 +229,16 @@ The projection is **non-authoritative**. Enforcement is `ark-check` / host write
227
229
  CI (`--strict-merge`) — never AGENTS.md, skills, or this projection. Root API:
228
230
  `buildAgentProjectionBlock` / `mergeAgentProjectionDocument`.
229
231
 
230
- **Agent Skills packaging (4.3):** the same frozen **13** skill names are also shipped as
232
+ **Agent Skills packaging (4.3 / #216):** the same closed catalog ships as
231
233
  an Agent Skills–compatible package under `templates/agent-skills/<name>/SKILL.md` for hosts that
232
234
  install via `npx skills` (in addition to Ark `--install-agent-gates`). See
233
- [Install skills — Ark and ecosystem](#install-skills-ark-and-ecosystem). No new skill names.
235
+ [Install skills — Ark and ecosystem](#install-skills-ark-and-ecosystem).
236
+ Closed catalog (`ARK_SKILL_NAMES`): first-class doors plus one-release stubs.
237
+ The *set* must exercise Layers + ArkRules + ArkRun + ArkOrder (when / not when / handoff).
238
+ First-class `/ark-order` mirrors `/ark-runtime`. ACS05 freeze was opened for that door
239
+ ([ADR 0036](adr/0036-skill-catalog-product-capacity.md)); Domain still closes the list.
240
+ Add a name only with a live ROADMAP item. Filter: **Contener · Guiar · Ordenar**
241
+ — contain the write, guide the next step, order leftover mess.
234
242
  Skill bodies coach residual lenses and anti false-done; they never enforce.
235
243
 
236
244
  ## Architecture playbook and `ark-check --recommend`
@@ -316,8 +324,10 @@ as unresolved decisions, and restores the integration with `ark start --tools <h
316
324
  **Five doors (emphasize):** `/ark-adopt` = session 0 (greenfield scaffold + brownfield honesty —
317
325
  write the path). `/ark-place` = new feature (place **and write**). `/ark-autopilot` = apply
318
326
  plan A + one Shape refactor (invoke = approval). `/ark-explore` = map + dual-plan seed (no
319
- apply). `/ark-upgrade` = preview then apply in-turn. Other `/ark-*` names stay installed as
320
- **shortcuts**. Empty plan A is not “architecture healthy” if leftover design remains.
327
+ apply). `/ark-upgrade` = preview then apply in-turn. First-class extras: `/ark-runtime` wires
328
+ ArkRun; **`/ark-order`** wires ArkOrder. Other `/ark-*` names stay installed as
329
+ **one-release shortcuts**. Empty plan A is not “architecture healthy” if leftover design remains.
330
+ Filter: **Contener · Guiar · Ordenar** — contain the write, guide the next step, order leftover mess. Skills never enforce.
321
331
 
322
332
  **Team parliament:** adopt is a **contract session** (law-only). Feature work must not edit
323
333
  `ark.config.json` / `arkrules/*` / `.ark-baseline.json`. Prefer
@@ -537,7 +547,7 @@ ArkOrder — with its plane, its tier and whether it can *ever* be enforced, so
537
547
  Tier-2 shows up before you write the rule rather than after you wait for a run.
538
548
  ArkOrder: `proposeRelease` then `apply`; `refreshSigma`; ingest residual;
539
549
  capacity pack; `ReleaseStore`; ArkRun `decisionTape`. Extras door:
540
- `/ark-adopt`. First contact: doctor + `[ArkOrder]` on the check.
550
+ `/ark-adopt` (turn on) then **`/ark-order`** (wire one candidate). First contact: doctor + `[ArkOrder]` on the check.
541
551
  It also says *how*: only the ArkRules plane is promoted per rule; ArkRun and
542
552
  ArkOrder are switched by the plane-level `arkRun.mode` / `arkOrder.mode`, and
543
553
  `--promote --apply` writes ArkRules documents only.
@@ -758,7 +768,7 @@ Greenfield / empty-tree **depth** (only when doctor or a thin tree points here
758
768
  1. Run `ark-check --recommend --json` or MCP `ark_recommend`.
759
769
  2. Read `archetype`, `preset`, and `adoptInOrder.phase1` — scaffold only those directories first.
760
770
  3. Run `ark init --archetype <id> --yes`, `--apply-policy-pack enthusiast-<preset>`, or `ark init --preset <preset> --yes` when no `ark.config.json` exists (or let `ark start --apply` install the compact contract).
761
- 4. Optional: `--write-plan` for `ark-adoption-plan.json`; copy a gallery starter from `examples/README.md`.
771
+ 4. Optional: `--write-plan` for `ark-adoption-plan.json`; copy a gallery starter from `examples/README.md`. ArkOrder proof on that index is [arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing) (not a starter; GitHub tree, not in the npm tarball).
762
772
  5. Use `/ark-place` or `ark_place` for individual files after the contract exists.
763
773
  6. Re-check with `ark-check --doctor`, then `ark-check --root . --config ark.config.json --strict`.
764
774
 
@@ -823,7 +833,7 @@ directories (`utils/`, `lib/`) must be classified explicitly via `/ark-adopt`.
823
833
 
824
834
  ## Supported agent hosts
825
835
 
826
- **Day zero** is the compact path from `ark start` / `ark start --apply` (router + write path + CI plan) — not the full skill pack.
836
+ **Day zero** is the compact path from `ark start` / `ark start --apply` (router + write path + CI plan; merges Ark into an existing project-owned `AGENTS.md` / `.mcp.json`) — not the full skill pack.
827
837
 
828
838
  Wire write-gate + MCP for the active host; add the full `/ark-*` skill pack only as **expert depth** (`--skills-only` or full install when you want guided autopilot):
829
839
 
@@ -857,8 +867,13 @@ and [shared Claude/Grok/Antigravity homes](ai-gates.md#shared-claude--grok-home-
857
867
 
858
868
  ### Install skills — Ark and ecosystem {#install-skills-ark-and-ecosystem}
859
869
 
860
- The same **13** skill names ship two ways. **No new skill names** (4.3 freeze): packaging and
861
- routing only.
870
+ The same closed catalog ships two ways. **Closed catalog** (`ARK_SKILL_NAMES`): first-class
871
+ doors plus one-release stubs. The *set* must exercise Layers + ArkRules + ArkRun + ArkOrder
872
+ and route (when / not when / handoff). First-class `/ark-order`; leftover names stay as
873
+ one-release stubs. ACS05 freeze was opened for `/ark-order`; Domain still closes the list.
874
+ Add a name only with a live ROADMAP item
875
+ ([ADR 0036](adr/0036-skill-catalog-product-capacity.md) / issue #216).
876
+ Filter: **Contener · Guiar · Ordenar** — contain the write, guide the next step, order leftover mess. Skills never enforce.
862
877
 
863
878
  | Channel | What it installs | When to use |
864
879
  |---------|------------------|-------------|
@@ -883,9 +898,10 @@ npx skills add https://github.com/pedroknigge/arkgate/tree/main/templates/agent-
883
898
  npx skills add ./node_modules/arkgate/templates/agent-skills --list
884
899
  ```
885
900
 
886
- Frozen names: `ark-adopt`, `ark-architect`, `ark-autopilot`, `ark-contract`, `ark-coverage`,
887
- `ark-explain`, `ark-explore`, `ark-fix`, `ark-loop`, `ark-place`, `ark-runtime`, `ark-think`,
888
- `ark-upgrade`. Root API: `ARK_SKILL_NAMES` / `validateAgentSkillsPackage` (Domain
901
+ Closed names: first-class `ark-adopt`, `ark-autopilot`, `ark-coverage`, `ark-explain`,
902
+ `ark-explore`, `ark-order`, `ark-place`, `ark-runtime`, `ark-upgrade`; one-release stubs
903
+ `ark-architect`, `ark-contract`, `ark-fix`, `ark-loop`, `ark-think`. Root API:
904
+ `ARK_SKILL_NAMES` / `ARK_FIRST_CLASS_SKILL_NAMES` / `validateAgentSkillsPackage` (Domain
889
905
  `agentSkillsPackage`). Skills are **process** depth — they never decide pass/fail; enforcement
890
906
  remains `ark-check` / hooks / CI.
891
907
 
package/docs/ai-gates.md CHANGED
@@ -10,10 +10,12 @@ AI can build fast—and make a mess just as fast.
10
10
 
11
11
  Keep the product easy to understand, change, and trust.
12
12
 
13
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
13
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
14
14
 
15
15
  Safer changes, fewer surprises, and extra protection only when you choose it.
16
16
 
17
+ That is **Contener · Guiar · Ordenar**.
18
+
17
19
  This page is host install depth (hooks / MCP / CI).
18
20
 
19
21
  This page is **develop** depth (install hooks/MCP/CI per host). Product path: [use.md](use.md) ·
package/docs/arkorder.md CHANGED
@@ -8,9 +8,14 @@ Import: `arkgate/order` (same npm package `arkgate`). Off until you add
8
8
  `arkOrder`. Absence is silent. In-memory. Not durable. A library plus
9
9
  sensors, not a service. Does **not** replace ArkRun.
10
10
 
11
- Turn the extra on with `/ark-adopt`. First contact is doctor + `[ArkOrder]`
11
+ Turn the extra on with `/ark-adopt`. Wire one candidate with **`/ark-order`**
12
+ (mirrors `/ark-runtime`). First contact is doctor + `[ArkOrder]`
12
13
  on the check. Names like ξ live below, in the valve and sensor tables.
13
14
 
15
+ Proof (GitHub, not in the npm tarball):
16
+ [examples/arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing).
17
+ First freeze is `release()`. Later plan change is `proposeRelease` then `apply`.
18
+
14
19
  Canonical plan seed: [plans/arkorder/README.md](plans/arkorder/README.md).
15
20
  ADRs: [0027](adr/0027-arkorder-gated-extra-plane.md)–[0030](adr/0030-opt-in-extras-same-npm-package.md),
16
21
  [0033](adr/0033-arkorder-runtime-half-is-arkrun.md) (runtime half is ArkRun),
@@ -255,15 +260,17 @@ In-memory `ReleaseStore` is **not** durable. Doctor / status `arkOrder` stays
255
260
 
256
261
  ## Doctor / start / status
257
262
 
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:
263
+ `--doctor` always emits an ArkOrder row (`notAScore`). Verdicts stay silent
264
+ when the extra is off (Layers unchanged, not a score). The first human line
265
+ is always the one-breath — including the compact first screen:
260
266
 
261
267
  **Layers stop a bad import. ArkOrder stops rewriting a big product choice —
262
268
  like the billing plan — as if it were a seat count. Change those choices
263
269
  through a valve, not a generic update.**
264
270
 
265
271
  `ark start` leaves extras off (`Optional extras stay off. This start is
266
- layers only — they stop bad imports.`).
272
+ layers only — they stop bad imports.`) and still prints that one-breath plus
273
+ `Next: examples/arkorder-billing`, then `/ark-adopt` and `/ark-order`.
267
274
  `ark status` projects a thin `arkOrder` slice (present / mode / leftover
268
275
  count). A deny prints `[ArkOrder]` next to `ARKORDER_*`, the same envelope
269
276
  as a bad import.
@@ -453,12 +453,13 @@ Write-gate ApplyPatch denies a batch that mixes law files with product source. H
453
453
  never hit PreToolUse are unchanged. Local `pnpm` gates should call `--changed --base`, not
454
454
  only full-tree `--strict-merge`.
455
455
 
456
- `--changed` honors the touched-file list for **file-local** ArkRules structure sensors
457
- (class shape, orchestration-only, thin-adapter, writes-via-aggregate) and for
458
- structural-hint preload. Import-edge, layer, and cycle sensors still evaluate the full
459
- governed graph. That is a bound on the existing scan, not a second analysis engine, and
460
- it does not turn a full-tree run into a seconds-long one. A `--changed` pass is not a
461
- full-tree structural verdict.
456
+ `--changed` resolves the touched sources plus their import closure — not the whole
457
+ include tree. File-local ArkRules sensors (class shape, orchestration-only, thin-adapter,
458
+ writes-via-aggregate) and hint preload stay on the touched set. Layer and cycle sensors
459
+ see that closure, so a new illegal import or a cycle the change can complete still
460
+ fails. Untouched files outside the closure are left to the full-tree CI check. Same
461
+ engine; not a second analysis path. A `--changed` pass is not a full-tree structural
462
+ verdict.
462
463
 
463
464
  MCP clients can call `ark_policy_delta` with the previous `baseConfig`, an optional candidate
464
465
  contract (the current project contract is the default), and the same optional acknowledgement.
package/docs/develop.md CHANGED
@@ -11,10 +11,12 @@ AI can build fast—and make a mess just as fast.
11
11
 
12
12
  Keep the product easy to understand, change, and trust.
13
13
 
14
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
14
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
15
15
 
16
16
  Safer changes, fewer surprises, and extra protection only when you choose it.
17
17
 
18
+ That is **Contener · Guiar · Ordenar**.
19
+
18
20
  For **developers** integrating ArkGate into a product repo: agents, CI, config, brownfield, and power tools.
19
21
 
20
22
  If you only want the happy path, start at [use.md](use.md). Optional ArkOrder
@@ -24,7 +24,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
24
24
 
25
25
  | ruleId | Category | Title |
26
26
  |--------|----------|-------|
27
- | [`LAYER_IMPORT_VIOLATION`](#LAYER_IMPORT_VIOLATION) | layer | Layer import not allowed |
27
+ | [`LAYER_IMPORT_VIOLATION`](#LAYER_IMPORT_VIOLATION) | layer | This import is not allowed |
28
28
  | [`LAYER_INTENT_REFERENCE_VIOLATION`](#LAYER_INTENT_REFERENCE_VIOLATION) | layer | Intent referenced across a blocked layer edge |
29
29
  | [`LAYER_REFERENCE_VIOLATION`](#LAYER_REFERENCE_VIOLATION) | layer | Layer reference blocked (snippet / AI gate) |
30
30
  | [`CIRCULAR_DEPENDENCY`](#CIRCULAR_DEPENDENCY) | layer | Dependency cycle |
@@ -58,7 +58,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
58
58
  | [`ARKORDER_GENERIC_UPDATE`](#ARKORDER_GENERIC_UPDATE) | arkorder | Generic update of ξ |
59
59
  | [`ARKORDER_TOO_MANY_PARAMS`](#ARKORDER_TOO_MANY_PARAMS) | arkorder | Too many slow keys |
60
60
  | [`ARKORDER_INGEST_WRITES_XI`](#ARKORDER_INGEST_WRITES_XI) | arkorder | ingest assigned into ξ |
61
- | [`ARKORDER_UNVALVED_RELEASE`](#ARKORDER_UNVALVED_RELEASE) | arkorder | Unvalved second freeze of ξ |
61
+ | [`ARKORDER_UNVALVED_RELEASE`](#ARKORDER_UNVALVED_RELEASE) | arkorder | Second freeze without the valve |
62
62
  | [`INVALID_CHANGE_PATH`](#INVALID_CHANGE_PATH) | preflight | Unsafe change path |
63
63
  | [`DUPLICATE_CHANGE_PATH`](#DUPLICATE_CHANGE_PATH) | preflight | Duplicate path in change set |
64
64
  | [`DELETE_TARGET_MISSING`](#DELETE_TARGET_MISSING) | preflight | Delete target missing |
@@ -105,9 +105,9 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
105
105
 
106
106
  ### `LAYER_IMPORT_VIOLATION`
107
107
 
108
- **Layer import not allowed**
108
+ **This import is not allowed**
109
109
 
110
- - **Why:** A module import (or re-export) crosses a layer edge that ark.config.json does not allow. The architecture contract forbids that dependency direction so outer infrastructure cannot leak into pure or inner layers.
110
+ - **Why:** This file imported a folder it may not reach. The write doesn’t land. The same check fails the pull request.
111
111
  - **Fix:** Branch by import kind: constants/types/pure → adopt into DomainModel or SharedKernel (do not invent a port); kernel/events/bootstrap from Persistence → inject a port or move the map to SharedTypes (Persistence must not emit); define a port only when the target is a real use-case. Type-only edges use `import type`. Then preflight again. Do not weaken the layer rule without a hash-bound policy acknowledgement.
112
112
 
113
113
  <a id="LAYER_INTENT_REFERENCE_VIOLATION"></a>
@@ -466,10 +466,10 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
466
466
 
467
467
  ### `ARKORDER_UNVALVED_RELEASE`
468
468
 
469
- **Unvalved second freeze of ξ**
469
+ **Second freeze without the valve**
470
470
 
471
- - **Why:** release() ran after a pattern was already frozen and the new ξ differs. First freeze is release(); later pattern change is proposeRelease then apply.
472
- - **Fix:** Change ξ with proposeRelease then apply(ProposeResult). release() is only the first freeze. Never mechanical-safe.
471
+ - **Why:** release() already froze the big choice. A later release() with a different value does not land. First freeze is release(); later change is proposeRelease then apply.
472
+ - **Fix:** Change the choice with proposeRelease then apply. release() is only the first freeze. Never mechanical-safe.
473
473
 
474
474
  ## Atomic preflight and change sets
475
475
 
@@ -11,10 +11,12 @@ AI can build fast—and make a mess just as fast.
11
11
 
12
12
  Keep the product easy to understand, change, and trust.
13
13
 
14
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
14
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
15
15
 
16
16
  Safer changes, fewer surprises, and extra protection only when you choose it.
17
17
 
18
+ That is **Contener · Guiar · Ordenar**.
19
+
18
20
  Plain-language onboarding for builders who use AI agents but are not professional
19
21
  developers. This track follows [Diátaxis](https://diataxis.fr/): tutorial, how-to,
20
22
  reference, and explanation. Package: **`arkgate`** (CLI: `arkgate` / `arkgate-check`;
@@ -70,6 +72,7 @@ Reproducible scripts — no video required:
70
72
  - [Write-gate self-correction](../demos/01-write-gate-self-correction.md)
71
73
  - [Brownfield baseline adoption](../demos/02-brownfield-baseline-adoption.md)
72
74
  - [Co-pilot autopilot, end to end](https://github.com/pedroknigge/arkgate/blob/main/docs/demos/03-copilot-autopilot.md)
75
+ - [ArkOrder billing — first freeze, then valve](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing) (GitHub tree, not in the npm tarball; not a gallery starter)
73
76
 
74
77
  ## Gallery starters
75
78
 
@@ -84,6 +87,8 @@ Reproducible scripts — no video required:
84
87
 
85
88
  Deep teaching example (runnable API + break exercises): [hexagonal-order-api](https://github.com/pedroknigge/arkgate/tree/main/examples/hexagonal-order-api).
86
89
 
90
+ ArkOrder proof (optional extra, not a starter): [arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing) — first freeze is `release()`; later plan change is `proposeRelease` then `apply`. Index: [examples/README.md](https://github.com/pedroknigge/arkgate/blob/main/examples/README.md).
91
+
87
92
  ## Brownfield vs greenfield
88
93
 
89
94
  | Situation | Use |
@@ -12,12 +12,13 @@ npm run check
12
12
 
13
13
  Pick by archetype — see [examples/README.md](https://github.com/pedroknigge/arkgate/blob/main/examples/README.md).
14
14
 
15
- ## When to use a starter vs hexagonal-order-api
15
+ ## When to use a starter vs hexagonal-order-api vs billing
16
16
 
17
17
  | Need | Use |
18
18
  |------|-----|
19
19
  | Fast baseline layout | `*-starter/` gallery |
20
20
  | Runnable API + break exercises | `hexagonal-order-api/` |
21
+ | ArkOrder freeze / valve (optional extra) | [arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing) — not a starter, not in the npm tarball |
21
22
 
22
23
  ## After copying
23
24
 
@@ -10,10 +10,12 @@ AI can build fast—and make a mess just as fast.
10
10
 
11
11
  Keep the product easy to understand, change, and trust.
12
12
 
13
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
13
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
14
14
 
15
15
  Safer changes, fewer surprises, and extra protection only when you choose it.
16
16
 
17
+ That is **Contener · Guiar · Ordenar**.
18
+
17
19
  That is the product wedge (host hook + required CI). Skills name the next step after that.
18
20
  **Not the wedge:** the optional in-process **ArkRun** runtime (`arkgate/runtime`) and the
19
21
  optional **ArkOrder** pattern extra (`arkgate/order`).
@@ -72,7 +74,7 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
72
74
  | **Managed upgrade self-service honesty (4.5 / DF05)** | `ark upgrade [--json]` → `selfService` (+ human “Self-service honesty” lines) | Additive, advisory. Answers without a maintainer: write-path activation labels per selected host (`hard`\|`advisory`\|`unavailable`) and customized content-identity preserve (`customizedPaths` / `customizedContentPreserved`). Soft hosts never hard; upgrade never invents `hardWriteActive` from disk alone. Always `notAScore: true`. Not a gate input; not part of `planDigest`. |
73
75
  | **Product honesty readiness split (4.1.1)** | doctor JSON `productHonesty` | Additive. `unfinished` / `headline` / `primaryNextAction` / `reasonIds` remain; EH adds `contractReadiness` (`ready`\|`partial`\|`not-ready`), `localWriteBoundary` (`advisory`\|`hard`\|`unverified`\|`unknown`), `architectureReasonIds`, `environmentResidualIds` / `environmentResiduals`. Soft-write hosts stay in evidence without alone forcing global **Not finished**. `notAScore: true` always. |
74
76
  | **Policy transition analysis (3.1.0)** | `analyzePolicyDelta(...)`; MCP `ark_policy_delta`; CLI `--policy-base` / `--policy-base-ref` / `--policy-ack`; check JSON `policyDelta` | Additive schema `1.0`. Classifications and finding ids are deterministic. Weakening/judgment requires an acknowledgement bound to both policy hashes and the exact blocking finding set. |
75
- | **Team parliament (law vs feature)** | Optional `stewards` on `ark.config.json` (GitHub handle or email); CLI `--changed` / `--against` / `--base` / `--contract-diff` / `--contract-session` / `--persona` / `--author`; check JSON `teamParliament`; `ark status --vs`; write-gate mixed-batch deny | Additive. Law files must not mix with product source. Loosen / baseline-grow are steward-only when `stewards` is set. `--against` ratchets vs the base-ref baseline. `--changed` scans touched sources. `stewards` and `layers[].description` are excluded from policy hash. Identity is handle or email, not git `user.name`. No org plane. |
77
+ | **Team parliament (law vs feature)** | Optional `stewards` on `ark.config.json` (GitHub handle or email); CLI `--changed` / `--against` / `--base` / `--contract-diff` / `--contract-session` / `--persona` / `--author`; check JSON `teamParliament`; `ark status --vs`; write-gate mixed-batch deny | Additive. Law files must not mix with product source. Loosen / baseline-grow are steward-only when `stewards` is set. `--against` ratchets vs the base-ref baseline. `--changed` scans touched sources plus their import closure. `stewards` and `layers[].description` are excluded from policy hash. Identity is handle or email, not git `user.name`. No org plane. |
76
78
  | **Atomic change preflight (3.1.0)** | `preflightChange(...)`; CLI `ark preflight --changes <file> --json`; MCP `ark_prepare_change` | Additive schema `1.0`. One complete governed production-source `{path,content}` / `{path,delete:true}` batch; read-only; returns operation, content/tree/policy/compiler fingerprints and stable graph findings. MCP availability alone is advisory. |
77
79
  | **Architecture change map (3.1.0)** | `arkgate/schema/change-map` or `arkgate/schema/ark.change-map.schema.json`; CLI `ark preflight --change-map <file>`; MCP `ark_prepare_change.changeMap` | Optional strict schema `1.0`. Canonical planned paths + operations + resolved Ark layers + dependencies between planned files. Preflight returns `changeMapHash`; absence is normal and adds no project file. Structural intent only, never behavioral completion. |
78
80
  | **Structural convergence (3.1.0)** | `analyzeArchitectureConvergence(...)`; map-enabled `preflightChange(...)`; existing CLI/MCP preflight adapters | Additive `convergence` result with stable `satisfied`, `missing`, `contradictory`, and `unplanned` findings. Uses the supplied/current project tree as base and the explicit complete change set as candidate; no implicit Git or LLM input. `readOnly: true`; `behavioralCompletion: "not-evaluated"`. Structural mismatch makes preflight invalid. |
@@ -84,11 +86,11 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
84
86
  | **Diagnostic code catalog** | Root API `DIAGNOSTIC_CATALOG` / `getDiagnosticCatalogEntry` / `diagnosticDocsPath`; docs [diagnostics.md](diagnostics.md) (`#RULE_ID` anchors) | Closed vocabulary of public `ruleId`s with why/fix anchors. Cataloguing only — no new rule semantics. Remediation parity is test-guarded. ArkRun `ARKRUN_*` codes (RN05) share dual-depth `nextAction` / `enthusiastHint`; declaration-list adds are mechanical-safe only when the call-site literal already exists. Docs ship in the npm tarball. |
85
87
  | **Status manifest** | CLI `ark status [--json] [--vs <ref>]`; MCP `ark_status`; `arkgate/schema/status-manifest`; root API `buildStatusManifest` / `ARK_STATUS_MANIFEST_SCHEMA` / `projectStatusImprovementCompass` | Schema `1.0`. One session/project snapshot: identity binding, honest write-path activation (`hard`\|`advisory`\|`unavailable`), last-check summary, rules residual counts, primary next action, **`improvementCompass`** with honesty **`mode`** `full`\|`subset`\|`unavailable` (residual ids only; always `notAScore: true`; optional `reasonCode`/`reason`/`factsSource`/`contractHash`), optional **`vsBase`** (pin / contract / baseline grow vs a git ref; advisory only), and additive **`arkRun`** (`notAScore`; `present` / `mode` / `extraMergeTeeth` / residual count — null residual is unknown, not green). **Not a score.** Residual never changes gate verdicts. Never prompts (`CI=1` forces JSON). Optional `--expected-root` / `--expected-project-id` (MCP `project`) for matched vs stale identity. |
86
88
  | **Agent contract projection** | CLI `ark agents-md [--write] [--check] [--stdout] [--json]`; install/upgrade AGENTS templates; root API `buildAgentProjectionBlock` / `mergeAgentProjectionDocument` | Schema `1.0` (projection markers). Version-stamped managed block (`arkgateVersion` + contract summary + diagnostic short list). **Non-authoritative** — not a gate input; enforcement is ark-check / hooks / CI. Content-identity merge preserves customized regions outside markers. Drift: `--check` vs package version. |
87
- | **Agent Skills packaging** | `templates/agent-skills/<name>/SKILL.md` (+ package README); root API `ARK_SKILL_NAMES` / `validateAgentSkillsPackage`; `npm run check:agent-skills` | Schema `1.0` (package contract). Same **13** skill names as flat templates; Agent Skills–compatible layout for `npx skills add`. No new skill names. Layout is generated 1:1 from `templates/skills/*.md`. |
89
+ | **Agent Skills packaging** | `templates/agent-skills/<name>/SKILL.md` (+ package README); root API `ARK_SKILL_NAMES` / `ARK_FIRST_CLASS_SKILL_NAMES` / `validateAgentSkillsPackage`; `npm run check:agent-skills` | Schema `1.0` (package contract). Closed catalog (`ARK_SKILL_NAMES`): first-class doors plus one-release stubs, 1:1 with flat `templates/skills/*.md`. First-class `/ark-order` (issue #216 / ADR 0036). Add a name only with a live ROADMAP item. |
88
90
  | **`arkgate/schema/arkrules`** or **`arkgate/schema/ark.arkrules.schema.json`** | Per-layer structure sensors + invariant catalog (ADR 0012) | Schema `1.0`. Opt-in via root `arkRules` map (`ark.config` schema `1.1`). |
89
91
  | **`arkgate/schema/resolved-candidate-facts`** or **`arkgate/schema/ark.resolved-candidate-facts.schema.json`** | Versioned parity-capable input for `analyzeResolvedProject` / `preflightResolvedChange` | Schema `1.2` is additive: optional `classShapes` (1.1) plus ArkRun `arkRunKernelCalls` / `arkRunManagedNews` / `arkRunCompositionRootHits` / `arkRunDeclarations` (RN03–RN04) and ArkOrder `arkOrderPlaneCalls` / `arkOrderGenericUpdates` / `arkOrderRootHits` (OR05). `1.0`/`1.1` payloads remain loadable. Tooling owns filesystem/compiler resolution; Domain/Kernel validate and evaluate supplied facts without importing those effects. Facts name resolver/compiler inputs, governed files, dependency evidence, completeness reasons, candidate tree/facts hashes, and (when present) ArkRun/ArkOrder call-site evidence. Tier-1 sensors emit `ARKRUN_*` / `ARKORDER_*` diagnostics from those facts: advisory never flips `valid`; enforced blocks. Extra absence is silent. |
90
92
  | **Config JSON Schema** | `arkgate/schema` or `arkgate/schema/ark.config.schema.json` | Stable package resource subpaths for editor completion and contract tooling. |
91
- | **Agent skills** | `/ark-*` templates; install via `--install-agent-gates` (often `--skills-only` on top of compact) **or** Agent Skills ecosystem path | **Day zero** is the compact router from `ark start` / `start --apply` + doctor — not the full skill pack. Skill *names* (frozen **13**) and the guided expert path (`/ark-autopilot` after pack install) are stable; internal skill prose may evolve. **4.0:** all skills except experimental `/ark-runtime` integrate **layers + ArkRules** and must label residual `[Layer]` vs `[ArkRules]`. **4.2:** repo catalogs are content-idempotent; the optional shared Codex home catalog is monotonic across 4.2.0+ installers. Pre-4.2 writers are outside that protocol and must be upgraded first. A durable pending-catalog journal preserves the floor across an interrupted install and is cleared only by its owning same/newer recovery. **4.3:** Agent Skills–compatible layout at `templates/agent-skills/<name>/SKILL.md` (1:1 with flat `templates/skills/*.md`); install via `npx skills add ./node_modules/arkgate/templates/agent-skills` (or the GitHub tree). Domain `ARK_SKILL_NAMES` + `validateAgentSkillsPackage`; drift `npm run check:agent-skills`. Skills never enforce. |
93
+ | **Agent skills** | `/ark-*` templates; install via `--install-agent-gates` (often `--skills-only` on top of compact) **or** Agent Skills ecosystem path | **Day zero** is the compact router from `ark start` / `start --apply` + doctor — not the full skill pack. Closed catalog (`ARK_SKILL_NAMES`): first-class doors (including `/ark-order`) plus one-release stubs. Guided expert path remains `/ark-autopilot` after pack install. **4.0:** first-class doors except experimental `/ark-runtime` / `/ark-order` integrate **layers + ArkRules** and must label residual `[Layer]` vs `[ArkRules]`. **4.2:** repo catalogs are content-idempotent; the optional shared Codex home catalog is monotonic across 4.2.0+ installers. Pre-4.2 writers are outside that protocol and must be upgraded first. A durable pending-catalog journal preserves the floor across an interrupted install and is cleared only by its owning same/newer recovery. **4.3:** Agent Skills–compatible layout at `templates/agent-skills/<name>/SKILL.md` (1:1 with flat `templates/skills/*.md`); install via `npx skills add ./node_modules/arkgate/templates/agent-skills` (or the GitHub tree). **#216:** first-class `/ark-order`; ACS05 freeze opened (ADR 0036). Domain `ARK_SKILL_NAMES` + `validateAgentSkillsPackage`; drift `npm run check:agent-skills`. Skills never enforce. |
92
94
  | **ESLint subpath** | `arkgate/eslint` | Config-driven layer/import/purity rules plus ArkRun import/`new` envelope (`ark/no-arkrun-kernel-in-domain`, `ark/no-arkrun-direct-new`, `ark/no-arkrun-transport-bypass`) when `arkRun` is on, and ArkOrder envelope (`ark/no-arkorder-kernel-in-domain`, `ark/no-arkorder-generic-update`) when `arkOrder` is on; loads consumer `ark.config.json`. Absence of an extra is silent. Missing-root / missing-plane and undeclared-* stay CLI/MCP. |
93
95
  | **GitHub Action** | `pedroknigge/arkgate` (see `action.yml`) | The `uses:` tag/SHA selects the checker source; `version` remains an optional exact npm compatibility override. |
94
96
  | **Package metadata** | `arkgate/package.json` | Stable resource subpath for tooling that needs the installed manifest. |
@@ -42,6 +42,26 @@ ArkOrder optional big product choices (billing plan, not seat counts)
42
42
  Status first (`arkgate-check --doctor`). One next step. CLI flag `--doctor` stays;
43
43
  human copy says **status**.
44
44
 
45
+ **Contener · Guiar · Ordenar** is the product north star (not a score). First
46
+ contact says it in ordinary English: contain the write, guide the next step,
47
+ order leftover mess.
48
+
49
+ - **Contener** — decide what the AI may write, and in what shape. ArkGate is
50
+ this: import rules, write + required CI. ArkRules is optional shape inside a
51
+ part.
52
+ - **Guiar** — show a proven next step so a non-expert is not stuck. Doctor
53
+ action #1. Skills. ArkRun is an optional experimental runtime.
54
+ - **Ordenar** — tidy a messy tree toward a clean one, one small refactor at a
55
+ time. ArkOrder is the optional extra for the few big product choices (billing
56
+ plan, not seat counts).
57
+
58
+ The skill *set* must cover Layers + ArkRules + ArkRun + ArkOrder and say when /
59
+ not when / handoff. First-class `/ark-order`; leftover `/ark-*` names are
60
+ one-release stubs. ACS05 freeze was opened for that door
61
+ ([ADR 0036](adr/0036-skill-catalog-product-capacity.md)); Domain `ARK_SKILL_NAMES`
62
+ still closes the list. See [agent guide — skills](agent-guide.md#install-skills-ark-and-ecosystem).
63
+ Skills never enforce. ξ / Haken stay below the fold.
64
+
45
65
  ---
46
66
 
47
67
  ## Locked first-contact
@@ -53,8 +73,9 @@ On the eight canonical public openings — `README.md`, `docs/use.md`,
53
73
  1. **Verbs:** `Write. Check. Ship.`
54
74
  2. **Deny:** `When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.`
55
75
  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.`
56
- 4. **Story:** the exact four-paragraph introduction below, with no visible heading or labels.
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.
76
+ 4. **Story:** the exact four-paragraph introduction below, with no visible heading or labels. Paragraph 3 is the north star in ordinary English.
77
+ 5. **Caption (immediately after the four paragraphs):** `That is **Contener · Guiar · Ordenar**.`
78
+ 6. **Technical nouns (below the introduction):** ArkGate is import rules. ArkRules is optional policies. ArkRun is an optional experimental runtime. ArkOrder is the extra for the few big product choices (billing plan, not seat counts) — named when the consumer opts in, never as the first noun. No ξ / Haken / slaving on the first screen.
58
79
 
59
80
  Do not lead with folders, `ark.config.json`, “contract”, “gate”, “house”, or “doctor”
60
81
  as the first noun. Historical: `If the AI writes an illegal import, the write is rejected`
@@ -75,10 +96,12 @@ AI can build fast—and make a mess just as fast.
75
96
 
76
97
  Keep the product easy to understand, change, and trust.
77
98
 
78
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
99
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
79
100
 
80
101
  Safer changes, fewer surprises, and extra protection only when you choose it.
81
102
 
103
+ That is **Contener · Guiar · Ordenar**.
104
+
82
105
  Do not add technical terms to these four paragraphs. In the next section, explain that
83
106
  ArkGate checks imports, ArkRules is optional, ArkRun is experimental and in-memory,
84
107
  and ArkOrder is optional and stops rewriting a big product choice like the billing plan.
@@ -173,7 +196,7 @@ a product PR — that is an owner `--contract-session` (config change).
173
196
  - Emoji rain, crush-it, fake amigo, “you don’t need to understand”
174
197
  - Auto-fix-everything / magic codemod
175
198
  - Suggest / Adapt / Enforce as settings you pick — they are lights (Setup / In progress / Ready)
176
- - Skill-shopping thirteen names as onboarding
199
+ - Skill-shopping leftover shortcut names as onboarding
177
200
  - “Healthy / done” while leftover design work remains
178
201
  - “MCP is active” because a file exists
179
202
  - Package AI decided pass/fail
@@ -193,13 +216,16 @@ npx arkgate start → start --apply → arkgate-check
193
216
  ```
194
217
 
195
218
  Five commands, not a menu exam: adopt · place · autopilot · explore · upgrade.
196
- Invoking a command **is** the approval. CLI checks; it does not silently rewrite.
219
+ First-class extras: runtime (ArkRun) · **order** (ArkOrder). Other `/ark-*` names
220
+ are one-release shortcuts. Invoking a command **is** the approval. CLI checks; it
221
+ does not silently rewrite.
197
222
 
198
223
  ---
199
224
 
200
225
  ## Checklist before shipping copy
201
226
 
202
- - [ ] **Write. Check. Ship.** is on first-contact.
227
+ - [ ] **Write. Check. Ship.** is on first-contact (the deny / wedge).
228
+ - [ ] **Contener · Guiar · Ordenar** is on first-contact in ordinary English (contain the write, guide the next step, order leftover mess).
203
229
  - [ ] Deny is `When the agent writes a bad import, the write doesn’t land.`
204
230
  - [ ] One next action is obvious.
205
231
  - [ ] ArkGate / ArkRules / ArkRun / ArkOrder are import rules / policies / experimental runtime / the extra that stops a big product choice being rewritten like a seat count.
@@ -33,7 +33,7 @@ infrastructure beyond how this package is published.
33
33
  | T4 | Config weakened (`peerIsolation: false`, empty rules) | False green | semantic policy-delta guard in strict merge; hash-bound `--policy-ack`; `--contract-session` required even when `stewards[]` is empty; present-state safety diagnostics |
34
34
  | T5 | Baseline ratcheted open | Debt reintroduced | `--update-baseline` requires `--contract-session` even with an empty steward list (`--force` is concentration, not parliament); unused/stale signals; occurrence keys |
35
35
  | T6 | Stale MCP/global CLI or wrong root | Gate points at old package / wrong tree | project identity binding; stale process non-authoritative + `PROCESS_PACKAGE_STALE`; project-local upgrade handoff |
36
- | T7 | Malicious dependency in publish | Compromised gate | signed tags, npm provenance, dependency-review, CodeQL, Semgrep, `verify-package-files` |
36
+ | T7 | Malicious dependency in publish | Compromised gate | annotated tags, npm provenance, dependency-review, CodeQL, Semgrep, `verify-package-files` |
37
37
  | T8 | Path traversal in hooks/check | Read/write outside project | root resolution + under-root import resolve |
38
38
  | T9 | Runtime InMemory mistaken for durable | Data loss | durability stance docs + safety InMemory production detector |
39
39
  | T10 | Repair payload silently applied | Unexpected rewrites | repair never writes; host must re-inject; exit 2 on deny |
@@ -48,7 +48,7 @@ Codex apply_patch --PreToolUse--> arkgate-mcp (hard for complete trusted + obser
48
48
  Any MCP host --tool call----> arkgate-mcp (advisory validation)
49
49
  Human IDE --disk/git-----> working tree
50
50
  working tree --PR-----------> CI ark-check --strict-merge
51
- npm publish <-- signed tag --- GitHub Release + provenance
51
+ npm publish <-- annotated tag --- GitHub Release + provenance
52
52
  ```
53
53
 
54
54
  Codex hosted tools, specialized hook opt-outs, shell/direct writes, and incomplete patch
@@ -176,10 +176,10 @@ The release compatibility workflow packs the candidate first, then tests clean c
176
176
  - **npm / pnpm / Yarn**;
177
177
  - project TypeScript **5.9.3 / 6.0.3 / 7.0.2**.
178
178
 
179
- That is **36** installed-artifact cells on the **full matrix** path (`push` to `main`, PR labels
180
- `full-matrix` / `release`, or release-prep branch names such as `feat/4.1*`). Ordinary PRs run a
179
+ That is **36** installed-artifact cells on the **full matrix** path (`push` to `main`, or an
180
+ explicit `full-matrix` label). Ordinary PRs run a
181
181
  **slim** packed smoke: **one** cell (Node 20 + npm) that still exercises TS 5/6/7 in-process.
182
- See [CONTRIBUTING.md — CI profiles](../CONTRIBUTING.md#ci-profiles-pr-slim-vs-full-matrix).
182
+ See [CONTRIBUTING.md — CI](../CONTRIBUTING.md#ci-this-repo).
183
183
 
184
184
  Each cell verifies that the project's `tsc` stays on the requested project compiler and that
185
185
  ArkGate resolves its fallback as exact 6.0.3 when the project API is unusable. Reports record
package/docs/use.md CHANGED
@@ -11,10 +11,12 @@ AI can build fast—and make a mess just as fast.
11
11
 
12
12
  Keep the product easy to understand, change, and trust.
13
13
 
14
- ArkGate stops bad shortcuts. ArkRules protects how each part should behave. ArkRun keeps work moving. ArkOrder protects the few big choices that should not change by accident.
14
+ Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
15
15
 
16
16
  Safer changes, fewer surprises, and extra protection only when you choose it.
17
17
 
18
+ That is **Contener · Guiar · Ordenar**.
19
+
18
20
  For **anyone** shipping TypeScript with an AI coding agent.
19
21
 
20
22
  ---
@@ -24,7 +26,7 @@ For **anyone** shipping TypeScript with an AI coding agent.
24
26
  ```bash
25
27
  npm install -D arkgate typescript
26
28
  npx arkgate start # preview what will change
27
- npx arkgate start --apply # install compact config + host router + CI plan
29
+ npx arkgate start --apply # install compact config + host router + CI; merge write-path gates into existing AGENTS.md / .mcp.json
28
30
  npx arkgate-check --doctor # status — one next step
29
31
  npx arkgate-check --doctor --all # full details
30
32
  ```
@@ -56,11 +58,10 @@ In those cases a boundary linter or editor rules may be enough; see [README —
56
58
 
57
59
  ### Why it exists
58
60
 
59
- AI coding agents write code at unprecedented speeds, but they tend to take the shortest path to solve a problem. If an agent needs data in a Domain layer, it might directly import a database adapter. Left unchecked, this creates spaghetti code and technical debt at light speed.
60
-
61
- Traditional linters catch these architectural violations in CI *after* the agent has finished its work, breaking the flow and requiring manual intervention.
62
-
63
- ArkGate solves this by shifting the check to the exact moment of writing. By intercepting file writes, it ensures that if the agent writes a bad import, the write doesn't land. The agent gets immediate feedback and can self-correct before the code even touches your disk.
61
+ AI takes the shortest path. Contain the write so a bad import never lands. Guide
62
+ the next step so a non-expert is not stuck. Order leftover mess toward a clean
63
+ tree, one small refactor at a time. Traditional linters catch this only after
64
+ the agent finished; ArkGate checks at write time and again on the PR.
64
65
 
65
66
  ---
66
67
 
@@ -86,10 +87,10 @@ The config only binds when the write doesn’t land and CI is required.
86
87
 
87
88
  | | Plain English | Default |
88
89
  |--|---------------|---------|
89
- | **ArkGate** (layers) | Import rules. The write doesn’t land. The PR fails. | Always — this is the product |
90
- | **ArkRules** | Optional policies *inside* a layer. | Off until you turn it on (start may ship advisory templates) |
91
- | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) | Off. In-memory. Not Postgres. |
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. |
90
+ | **ArkGate** (layers) | **Contener** — import rules. The write doesn’t land. The PR fails. | Always — this is the product |
91
+ | **ArkRules** | **Contener** — optional policies *inside* a layer. | Off until you turn it on (start may ship advisory templates) |
92
+ | **ArkRun** | **Guiar** — optional experimental runtime (`arkgate/runtime`) | Off. In-memory. Not Postgres. |
93
+ | **ArkOrder** | **Ordenar** extra the few big choices (billing plan, not seat counts). 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
94
 
94
95
  Start always gives you **layers**. Compact starters do **not** turn on ArkRun or
95
96
  ArkOrder. No extras is fine — only ArkGate runs. Leftovers are labeled
@@ -97,6 +98,11 @@ ArkOrder. No extras is fine — only ArkGate runs. Leftovers are labeled
97
98
  imports ≠ elegant design. Green imports also ≠ a frozen billing plan. ArkRun ≠
98
99
  durable stores. ArkOrder does not replace ArkRun.
99
100
 
101
+ Want to see the freeze and valve? The billing gallery lives on GitHub, not in
102
+ the npm tarball:
103
+ [examples/arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing).
104
+ First freeze is `release()`. Later plan change is `proposeRelease` then `apply`.
105
+
100
106
  ### New modules vs config edits
101
107
 
102
108
  **Happy path:** put a new module under an existing layer directory/glob (`layers[].patterns`). Usually
@@ -229,6 +235,7 @@ Empty plan A is **not** “architecture finished.”
229
235
  - Plain-language track: [enthusiast/](enthusiast/README.md)
230
236
  - First project tutorial: [enthusiast/tutorial-first-project.md](enthusiast/tutorial-first-project.md)
231
237
  - Demos: [demos/](demos/)
238
+ - ArkOrder proof (first freeze, then valve): [billing gallery](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing) (GitHub, not in the npm tarball)
232
239
 
233
240
  ---
234
241
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.8.13",
3
+ "version": "4.8.14",
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",