arkgate 4.8.13 → 4.8.15

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 (126) hide show
  1. package/CHANGELOG.md +219 -4
  2. package/README.md +33 -22
  3. package/SECURITY.md +5 -3
  4. package/bin/ark-check-runtime.mjs +25 -57
  5. package/bin/ark-mcp-runtime.mjs +111 -2
  6. package/bin/ark-shared.mjs +140 -11
  7. package/bin/ark.mjs +7 -25
  8. package/bin/lib/adr-presence.mjs +97 -0
  9. package/bin/lib/agent-projection-formatters.mjs +2 -0
  10. package/bin/lib/agent-skills-package.mjs +241 -8
  11. package/bin/lib/analysis-completeness.mjs +38 -2
  12. package/bin/lib/analysis-engine.mjs +6 -6
  13. package/bin/lib/architecture-scan.mjs +33 -5
  14. package/bin/lib/ark-order-doctor.mjs +7 -1
  15. package/bin/lib/ark-order-report.mjs +2 -1
  16. package/bin/lib/ark-run-doctor.mjs +6 -0
  17. package/bin/lib/ark-run-report.mjs +6 -2
  18. package/bin/lib/arkrules-sensors.mjs +81 -0
  19. package/bin/lib/baseline-key.mjs +4 -1
  20. package/bin/lib/check-args.mjs +52 -2
  21. package/bin/lib/ci-and-commands.mjs +7 -2
  22. package/bin/lib/config-contract.mjs +64 -1
  23. package/bin/lib/design-smells.mjs +21 -1
  24. package/bin/lib/diagnostic-catalog.mjs +5 -3
  25. package/bin/lib/doctor-advisories.mjs +109 -17
  26. package/bin/lib/doctor-human.mjs +20 -6
  27. package/bin/lib/doctor-next-actions.mjs +14 -0
  28. package/bin/lib/doctor-plan.mjs +32 -2
  29. package/bin/lib/enforcement-honesty.mjs +47 -2
  30. package/bin/lib/first-run-help.mjs +19 -3
  31. package/bin/lib/gate-files.mjs +40 -3
  32. package/bin/lib/host-support-matrix.mjs +9 -1
  33. package/bin/lib/html-report-depth.mjs +2 -0
  34. package/bin/lib/html-report.mjs +13 -2
  35. package/bin/lib/import-resolve.mjs +74 -13
  36. package/bin/lib/improvement-compass-doctor.mjs +6 -1
  37. package/bin/lib/improvement-compass-map.mjs +3 -1
  38. package/bin/lib/install-migrate.mjs +23 -0
  39. package/bin/lib/layer-description.mjs +90 -8
  40. package/bin/lib/mcp-hook-payload.mjs +57 -1
  41. package/bin/lib/no-domain-frontend.mjs +91 -0
  42. package/bin/lib/presets.mjs +3 -4
  43. package/bin/lib/product-copy.mjs +19 -0
  44. package/bin/lib/projected-governed-coverage.mjs +114 -0
  45. package/bin/lib/recommend-cli.mjs +54 -0
  46. package/bin/lib/remediation.mjs +6 -2
  47. package/bin/lib/resolved-candidate-facts.mjs +225 -100
  48. package/bin/lib/rules-under-contract.mjs +117 -2
  49. package/bin/lib/scan-files.mjs +39 -0
  50. package/bin/lib/snippet-analysis.mjs +14 -8
  51. package/bin/lib/start-preview.mjs +8 -2
  52. package/bin/lib/states-transitions-presence.mjs +212 -0
  53. package/bin/lib/status-command.mjs +2 -0
  54. package/bin/lib/status-transition-catalog.mjs +410 -0
  55. package/bin/lib/team-parliament-io.mjs +10 -0
  56. package/bin/lib/upgrade-whats-new.mjs +3 -3
  57. package/bin/lib/violations.mjs +43 -1
  58. package/bin/lib/write-path-capabilities.mjs +20 -5
  59. package/bin/lib/write-path-detect.mjs +27 -2
  60. package/dist/{configTypes-j7so8B4O.d.ts → configTypes-Dt3DpVbd.d.ts} +19 -0
  61. package/dist/{diagnosticCatalog-DA565Lja.d.ts → diagnosticCatalog-BEg85XlE.d.ts} +3 -3
  62. package/dist/eslint/index.cjs +4 -4
  63. package/dist/eslint/index.d.ts +1 -1
  64. package/dist/eslint/index.js +4 -4
  65. package/dist/index.cjs +31 -31
  66. package/dist/index.d.ts +126 -19
  67. package/dist/index.js +31 -31
  68. package/dist/nestjs/index.cjs +5 -5
  69. package/dist/nestjs/index.d.ts +3 -3
  70. package/dist/nestjs/index.js +5 -5
  71. package/dist/runtime/index.cjs +15 -15
  72. package/dist/runtime/index.d.ts +6 -6
  73. package/dist/runtime/index.js +15 -15
  74. package/dist/{types-Djbs3KjE.d.ts → types-CN9tVMPz.d.ts} +3 -1
  75. package/dist/{types-tGhZUiGX.d.ts → types-TBiv0WHL.d.ts} +1 -1
  76. package/docs/README.md +8 -6
  77. package/docs/agent-guide.md +35 -17
  78. package/docs/ai-gates.md +13 -4
  79. package/docs/arkorder.md +11 -4
  80. package/docs/brownfield-adoption.md +4 -1
  81. package/docs/configuration.md +63 -14
  82. package/docs/develop.md +4 -1
  83. package/docs/diagnostics.md +30 -10
  84. package/docs/enthusiast/README.md +6 -1
  85. package/docs/enthusiast/how-to-agent-gates.md +5 -0
  86. package/docs/enthusiast/how-to-gallery-starter.md +2 -1
  87. package/docs/enthusiast/how-to-pick-shape.md +1 -1
  88. package/docs/package-surface.md +10 -6
  89. package/docs/product-voice.md +32 -6
  90. package/docs/threat-model.md +2 -2
  91. package/docs/typescript-support.md +3 -3
  92. package/docs/use.md +23 -11
  93. package/package.json +1 -1
  94. package/schemas/ark.config.schema.json +23 -2
  95. package/server.json +2 -2
  96. package/templates/agent-skills/README.md +7 -4
  97. package/templates/agent-skills/ark-adopt/SKILL.md +91 -6
  98. package/templates/agent-skills/ark-architect/SKILL.md +5 -18
  99. package/templates/agent-skills/ark-autopilot/SKILL.md +14 -6
  100. package/templates/agent-skills/ark-contract/SKILL.md +9 -20
  101. package/templates/agent-skills/ark-coverage/SKILL.md +13 -9
  102. package/templates/agent-skills/ark-explain/SKILL.md +11 -5
  103. package/templates/agent-skills/ark-explore/SKILL.md +39 -5
  104. package/templates/agent-skills/ark-fix/SKILL.md +15 -20
  105. package/templates/agent-skills/ark-loop/SKILL.md +14 -20
  106. package/templates/agent-skills/ark-order/SKILL.md +200 -0
  107. package/templates/agent-skills/ark-place/SKILL.md +49 -11
  108. package/templates/agent-skills/ark-runtime/SKILL.md +21 -6
  109. package/templates/agent-skills/ark-think/SKILL.md +24 -126
  110. package/templates/agent-skills/ark-upgrade/SKILL.md +14 -3
  111. package/templates/arkrules/DomainModel.json +14 -1
  112. package/templates/skills/ark-adopt.md +91 -6
  113. package/templates/skills/ark-architect.md +5 -18
  114. package/templates/skills/ark-autopilot.md +14 -6
  115. package/templates/skills/ark-contract.md +9 -20
  116. package/templates/skills/ark-coverage.md +13 -9
  117. package/templates/skills/ark-explain.md +11 -5
  118. package/templates/skills/ark-explore.md +39 -5
  119. package/templates/skills/ark-fix.md +15 -20
  120. package/templates/skills/ark-loop.md +14 -20
  121. package/templates/skills/ark-order.md +200 -0
  122. package/templates/skills/ark-place.md +49 -11
  123. package/templates/skills/ark-runtime.md +21 -6
  124. package/templates/skills/ark-think.md +24 -126
  125. package/templates/skills/ark-upgrade.md +14 -3
  126. package/templates/tests/ark-adoption-gaps.test.ts +5 -4
@@ -1,4 +1,4 @@
1
- import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-j7so8B4O.js';
1
+ import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-Dt3DpVbd.js';
2
2
 
3
3
  /**
4
4
  * Policy types for the Ark kernel.
@@ -145,6 +145,8 @@ interface ArchitectureLayer {
145
145
  */
146
146
  match?: (name: string) => boolean;
147
147
  description?: string;
148
+ trustBoundary?: 'public' | 'auth' | 'admin' | 'internal';
149
+ owners?: string[];
148
150
  order?: number;
149
151
  }
150
152
  type ArchitectureRule = ArkConfigRule;
@@ -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-Djbs3KjE.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-CN9tVMPz.js';
2
2
 
3
3
  /**
4
4
  * PolicyEngine
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.15`; not published until `publish-npm` for `v4.8.15`).
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
 
@@ -44,7 +46,8 @@ ark start → ark start --apply → ark-check --doctor
44
46
 
45
47
  `arkgate-check --doctor` shows what's wrong and what to do first. From **4.0.0**, doctor may
46
48
  also report **`rulesUnderContract`** (ArkRules counts) and **`packageVersionTruth`** when the
47
- CLI is ahead of the package.json pin. The compact router from `ark start` is enough for normal
49
+ CLI is ahead of the package.json pin. Compact doctor names ArkRules only when the
50
+ `arkRules` map is on — absence stays silent. The compact router from `ark start` is enough for normal
48
51
  feature work. Full `/ark-*` skills are **expert depth** and label residual **`[Layer]`** vs
49
52
  **`[ArkRules]`** (except experimental `/ark-runtime`):
50
53
 
@@ -227,10 +230,16 @@ The projection is **non-authoritative**. Enforcement is `ark-check` / host write
227
230
  CI (`--strict-merge`) — never AGENTS.md, skills, or this projection. Root API:
228
231
  `buildAgentProjectionBlock` / `mergeAgentProjectionDocument`.
229
232
 
230
- **Agent Skills packaging (4.3):** the same frozen **13** skill names are also shipped as
233
+ **Agent Skills packaging (4.3 / #216):** the same closed catalog ships as
231
234
  an Agent Skills–compatible package under `templates/agent-skills/<name>/SKILL.md` for hosts that
232
235
  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.
236
+ [Install skills — Ark and ecosystem](#install-skills-ark-and-ecosystem).
237
+ Closed catalog (`ARK_SKILL_NAMES`): first-class doors plus one-release stubs.
238
+ The *set* must exercise Layers + ArkRules + ArkRun + ArkOrder (when / not when / handoff).
239
+ First-class `/ark-order` mirrors `/ark-runtime`. ACS05 freeze was opened for that door
240
+ ([ADR 0036](adr/0036-skill-catalog-product-capacity.md)); Domain still closes the list.
241
+ Add a name only with a live ROADMAP item. Filter: **Contener · Guiar · Ordenar**
242
+ — contain the write, guide the next step, order leftover mess.
234
243
  Skill bodies coach residual lenses and anti false-done; they never enforce.
235
244
 
236
245
  ## Architecture playbook and `ark-check --recommend`
@@ -271,7 +280,7 @@ npx ark-check --recommend --json
271
280
  `--recommend` does not require `ark.config.json`. It exits `0` and prints a progressive
272
281
  adoption plan: archetype id, preset, `confidence`, `runnerUp`, `why` (shape signals),
273
282
  structured positive/negative `evidence`, discovered `signals.packageUnits`,
274
- `adoptInOrder.phase1`, `firstCommand` (`ark init --archetype …`), and `checkCommand`.
283
+ `adoptInOrder.phase1`, `firstCommand` (`ark start --apply --archetype …`), and `checkCommand`.
275
284
  When the top two shapes are close or projected governed coverage is below 90%, JSON sets
276
285
  `requiresConfirmation: true` and explains why in `confirmationReasons`.
277
286
 
@@ -316,12 +325,15 @@ as unresolved decisions, and restores the integration with `ark start --tools <h
316
325
  **Five doors (emphasize):** `/ark-adopt` = session 0 (greenfield scaffold + brownfield honesty —
317
326
  write the path). `/ark-place` = new feature (place **and write**). `/ark-autopilot` = apply
318
327
  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.
328
+ apply). `/ark-upgrade` = preview then apply in-turn. First-class extras: `/ark-runtime` wires
329
+ ArkRun; **`/ark-order`** wires ArkOrder. Other `/ark-*` names stay installed as
330
+ **one-release shortcuts**. Empty plan A is not “architecture healthy” if leftover design remains.
331
+ Filter: **Contener · Guiar · Ordenar** — contain the write, guide the next step, order leftover mess. Skills never enforce.
321
332
 
322
333
  **Team parliament:** adopt is a **contract session** (law-only). Feature work must not edit
323
334
  `ark.config.json` / `arkrules/*` / `.ark-baseline.json`. Prefer
324
- `ark-check --changed --base <merge-ref>` in local gates. `--contract-diff` + `--author`
335
+ `ark-check --local --base <merge-ref>` (or `--changed --base`) in local gates.
336
+ `--strict-merge` stays the CI merge line. `--contract-diff` + `--author`
325
337
  when `stewards` is set (`--author` is a GitHub handle or email, not git `user.name`).
326
338
  `ark status --vs <ref>` prints pin / contract / baseline drift.
327
339
 
@@ -537,7 +549,7 @@ ArkOrder — with its plane, its tier and whether it can *ever* be enforced, so
537
549
  Tier-2 shows up before you write the rule rather than after you wait for a run.
538
550
  ArkOrder: `proposeRelease` then `apply`; `refreshSigma`; ingest residual;
539
551
  capacity pack; `ReleaseStore`; ArkRun `decisionTape`. Extras door:
540
- `/ark-adopt`. First contact: doctor + `[ArkOrder]` on the check.
552
+ `/ark-adopt` (turn on) then **`/ark-order`** (wire one candidate). First contact: doctor + `[ArkOrder]` on the check.
541
553
  It also says *how*: only the ArkRules plane is promoted per rule; ArkRun and
542
554
  ArkOrder are switched by the plane-level `arkRun.mode` / `arkOrder.mode`, and
543
555
  `--promote --apply` writes ArkRules documents only.
@@ -758,7 +770,7 @@ Greenfield / empty-tree **depth** (only when doctor or a thin tree points here
758
770
  1. Run `ark-check --recommend --json` or MCP `ark_recommend`.
759
771
  2. Read `archetype`, `preset`, and `adoptInOrder.phase1` — scaffold only those directories first.
760
772
  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`.
773
+ 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
774
  5. Use `/ark-place` or `ark_place` for individual files after the contract exists.
763
775
  6. Re-check with `ark-check --doctor`, then `ark-check --root . --config ark.config.json --strict`.
764
776
 
@@ -823,7 +835,7 @@ directories (`utils/`, `lib/`) must be classified explicitly via `/ark-adopt`.
823
835
 
824
836
  ## Supported agent hosts
825
837
 
826
- **Day zero** is the compact path from `ark start` / `ark start --apply` (router + write path + CI plan) — not the full skill pack.
838
+ **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
839
 
828
840
  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
841
 
@@ -857,8 +869,13 @@ and [shared Claude/Grok/Antigravity homes](ai-gates.md#shared-claude--grok-home-
857
869
 
858
870
  ### Install skills — Ark and ecosystem {#install-skills-ark-and-ecosystem}
859
871
 
860
- The same **13** skill names ship two ways. **No new skill names** (4.3 freeze): packaging and
861
- routing only.
872
+ The same closed catalog ships two ways. **Closed catalog** (`ARK_SKILL_NAMES`): first-class
873
+ doors plus one-release stubs. The *set* must exercise Layers + ArkRules + ArkRun + ArkOrder
874
+ and route (when / not when / handoff). First-class `/ark-order`; leftover names stay as
875
+ one-release stubs. ACS05 freeze was opened for `/ark-order`; Domain still closes the list.
876
+ Add a name only with a live ROADMAP item
877
+ ([ADR 0036](adr/0036-skill-catalog-product-capacity.md) / issue #216).
878
+ Filter: **Contener · Guiar · Ordenar** — contain the write, guide the next step, order leftover mess. Skills never enforce.
862
879
 
863
880
  | Channel | What it installs | When to use |
864
881
  |---------|------------------|-------------|
@@ -868,7 +885,7 @@ routing only.
868
885
  **Canonical authoring source:** flat `templates/skills/<name>.md` (Ark install reads these).
869
886
 
870
887
  **Agent Skills package root** (generated, 1:1 content): `templates/agent-skills/<name>/SKILL.md`
871
- — ships in the npm tarball under `templates/`. Drift guard: `npm run check:agent-skills`.
888
+ — ships in the npm tarball under `templates/`. Drift guard: `npm run check:agent-skills` (layout 1:1 **and** 100% product coverage).
872
889
 
873
890
  ```bash
874
891
  # Ark — expert skill pack (preferred when you also want gates)
@@ -883,9 +900,10 @@ npx skills add https://github.com/pedroknigge/arkgate/tree/main/templates/agent-
883
900
  npx skills add ./node_modules/arkgate/templates/agent-skills --list
884
901
  ```
885
902
 
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
903
+ Closed names: first-class `ark-adopt`, `ark-autopilot`, `ark-coverage`, `ark-explain`,
904
+ `ark-explore`, `ark-order`, `ark-place`, `ark-runtime`, `ark-upgrade`; one-release stubs
905
+ `ark-architect`, `ark-contract`, `ark-fix`, `ark-loop`, `ark-think`. Root API:
906
+ `ARK_SKILL_NAMES` / `ARK_FIRST_CLASS_SKILL_NAMES` / `validateAgentSkillsPackage` (Domain
889
907
  `agentSkillsPackage`). Skills are **process** depth — they never decide pass/fail; enforcement
890
908
  remains `ark-check` / hooks / CI.
891
909
 
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) ·
@@ -26,7 +28,7 @@ overview: [develop.md](develop.md) · hub: [README.md](README.md).
26
28
  | **Claude Code** | Hard PreToolUse for listed ops when installed + trusted + (for `hard:true`) runtime-observed | Required `arkgate-check --strict-merge` status |
27
29
  | **Grok Build** | Hard PreToolUse for listed ops when installed + trusted + (for `hard:true`) runtime-observed | Required `arkgate-check --strict-merge` status |
28
30
  | **Google Antigravity** | Hard PreToolUse for listed write tools when installed + trusted + (for `hard:true`) runtime-observed | Required `arkgate-check --strict-merge` status |
29
- | **Cursor** | Hard preToolUse for Write/StrReplace when installed + trusted + runtime-observed | Required CI status (same check) |
31
+ | **Cursor** | Hard preToolUse for Write/StrReplace when installed + trusted + `failClosed` + runtime-observed | Required CI status (same check) |
30
32
  | **OpenAI Codex** | Hard PreToolUse for complete local `apply_patch` in CLI/Desktop when installed + trusted + runtime-observed | Required CI status (same check) |
31
33
  | **OpenCode** | **Advisory / best-effort** (MCP + optional experimental plugin) — **not** a hard boundary | Required CI status (same check) |
32
34
 
@@ -124,6 +126,11 @@ violations relative to the file's current on-disk state, so files with pre-exist
124
126
  (baselined) violations stay editable — they just can't get worse. New files block on
125
127
  every violation.
126
128
 
129
+ The hook classifies import targets with the same `layerForRelativePath` specificity as
130
+ `ark-check` (an explicit file pattern beats a broader glob such as `src/lib/**`).
131
+ `LEXICAL_EVIDENCE_INCOMPLETE` means the single-file check is provisional — `ark-check`
132
+ on the tree is the authority. Do not move files solely because the hook named a layer.
133
+
127
134
  ### Opt-in resident hook pilot (Z07)
128
135
 
129
136
  Set `ARK_RESIDENT_HOOK=1` on both `ark-mcp` and its hook command. The pilot reuses the
@@ -327,8 +334,10 @@ Cursor supports MCP servers (`.cursor/mcp.json`) and project hooks (`.cursor/hoo
327
334
  }
328
335
  ```
329
336
 
330
- When that hook is installed and trusted, Cursor **hard-blocks** agent `Write` / `StrReplace`
331
- for governed TypeScript sources (exit 2 or `permission: "deny"`). Repair envelopes may emit;
337
+ When that hook is installed and trusted **and** `failClosed` is `true`, Cursor **hard-blocks**
338
+ agent `Write` / `StrReplace` for governed TypeScript sources (exit 2 or `permission: "deny"`).
339
+ A hook without `failClosed` is fail-open: if the checker cannot run, the write still lands
340
+ (same idea as a file permission — no checker, no write). Repair envelopes may emit;
332
341
  Cursor does **not** guarantee Write `updated_input` reinjection — the agent must fix and retry
333
342
  from `agent_message`. Shell, Tab, and human edits still rely on CI.
334
343
 
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.
@@ -48,7 +48,10 @@ regenerate it unasked.
48
48
 
49
49
  Without this split, broad `**/app/**` Presentation patterns push every API handler into UI and
50
50
  create a Presentation→Persistence tsunami. Specificity still wins: more-specific Application
51
- globs beat Presentation. Adopt writes `.ark/golden-pattern.json` (load-bearing for `/ark-place`).
51
+ globs beat Presentation. **Captions** (what doctor prints next to the layer name) mention Next
52
+ App Router / Pages API / `app/api` only when Next is actually present — a library
53
+ `packages/*` monorepo keeps library-native language. Adopt writes `.ark/golden-pattern.json`
54
+ (load-bearing for `/ark-place`).
52
55
  `ark_place` requires `filePath` (fail-closed — never invents `components/*.tsx` or defaults to Presentation).
53
56
  ArkRules stay **opt-in** (not forced on by start/adopt).
54
57
 
@@ -9,7 +9,7 @@ The CLI, MCP server, and ESLint plugin all use the same parser, migration, defau
9
9
 
10
10
  ```json
11
11
  {
12
- "$schema": "https://unpkg.com/arkgate@2/schemas/ark.config.schema.json",
12
+ "$schema": "https://unpkg.com/arkgate@4/schemas/ark.config.schema.json",
13
13
  "schemaVersion": "1.3",
14
14
  "include": ["src"],
15
15
  "layers": [],
@@ -179,6 +179,45 @@ Layer fields:
179
179
  ```
180
180
 
181
181
  That sentence is product copy. Not “Rich domain model, business rules, and domain events.”
182
+ - **`layers[].trustBoundary`** (optional) — who this folder is for: `public` |
183
+ `auth` | `admin` | `internal`. Anyone, signed-in users, operators, or only
184
+ other code. `/ark-place` prints `trust: public` next to the layer name;
185
+ doctor, coverage, and the HTML report show the same tag. Changing the tag
186
+ does **not** change `policyHash` (same strip as `stewards` and
187
+ `layers[].description`) and does **not** need a weakening ack. Absence is
188
+ silent: never fails `--strict-config`, never invents a doctor residual, never
189
+ flips `valid`. A wrong value (`"trusted"`, empty string) fails the schema.
190
+ Compact starters may omit it. `/ark-adopt` writes it when the product map
191
+ already names that door; it does not invent tags. No `/ark-trust`. This is
192
+ **not** host/CI TLS and does **not** add import-rule teeth.
193
+ - **`layers[].owners`** (optional) — who owns this folder: GitHub handles or
194
+ emails (same identity as `stewards`). `/ark-place` prints `owner: @handle`
195
+ next to the layer name; doctor, coverage, and the HTML report show the same
196
+ names. Changing the list does **not** change `policyHash` and does **not**
197
+ need a weakening ack. Absence is silent unless **`requireLayerOwners`** is
198
+ `true`. A display name (`Pedro Knigge`), empty array, or empty string fails
199
+ the schema. Compact starters may omit it. `/ark-adopt` writes it when the
200
+ product map already names who owns the house; it does not invent people.
201
+ No `/ark-owners`. This is **not** import-rule teeth.
202
+ - **`requireLayerOwners`** (optional) — when `true`, every live (non-reserved)
203
+ layer must name `owners`. Doctor names the first missing house and the next
204
+ step. `--strict-config` / `--strict-merge` refuse. The write gate denies a
205
+ write into an unowned house (same idea as a folder with no name on the door).
206
+ Absence or `false` is silent. This flag **is** policy teeth (it stays in
207
+ `policyHash`). Flip it on after you have named owners incrementally.
208
+
209
+ ```json
210
+ "layers": [
211
+ {
212
+ "name": "Presentation",
213
+ "patterns": ["src/app/**"],
214
+ "description": "Storefront checkout — what shoppers see.",
215
+ "trustBoundary": "public",
216
+ "owners": ["pedroknigge"]
217
+ }
218
+ ]
219
+ ```
220
+
182
221
  - `intentPrefixes`, `forbiddenGlobals`, `mayImportInfrastructure`, `optional`
183
222
  - `reserved` / `allowEmpty` — future houses whose globs match nothing yet. `--strict-config` does not fail; `CONFIG_LAYER_PATTERN_NO_MATCHES` (typo warning) is skipped. A typo warning fires only when the glob is not reserved.
184
223
  - `capabilities: { deny: [...] }` — opt-in effect walls over the seven capability ids
@@ -297,9 +336,12 @@ steps under `plan.typeOnlyGroup` when volume is high.
297
336
 
298
337
  ### Next.js API shell (framework overlay / presets)
299
338
 
300
- When Next is detected (or `ui-surface` / monorepo patterns apply), **`app/api/**` and
301
- `pages/api/**` classify as Application orchestration**, not Presentation. UI routes stay
302
- Presentation. More-specific Application globs win over broad `**/app/**` Presentation patterns.
339
+ When Next is detected, **`app/api/**` and `pages/api/**` classify as Application
340
+ orchestration**, not Presentation. UI routes stay Presentation. More-specific Application
341
+ globs win over broad `**/app/**` Presentation patterns. Reserved `app/api` globs may still
342
+ appear on `ui-surface` / monorepo presets so a later Next route classifies correctly;
343
+ **layer captions** mention Next App Router / Pages API / `app/api` only when Next is
344
+ actually present. Library and package-monorepo start keep library-native captions.
303
345
  See [brownfield adoption](brownfield-adoption.md#nextjs-honesty-default-overlays--ui-surface--monorepo).
304
346
 
305
347
  ### ArkRules dual plane (when `arkRules` is present)
@@ -359,6 +401,9 @@ invariants, and a covered sample when the map is active.
359
401
  a hash-bound policy weakening. Empty `appliesTo: []` fails closed; zero-match globs emit
360
402
  `ARKRULE_SCOPE_EMPTY` (advisory warn / enforced fail). Enforced + proven uncovered →
361
403
  `INVARIANT_UNCOVERED` with `failsStrict` (partial evidence stays honest, never fake-green).
404
+ When `arkRules` is on and a Domain-role layer has code, empty `invariants[]` is doctor residual
405
+ `INVARIANT_CATALOG_EMPTY` (not “done”). Advisory unless a domain structure rule is already
406
+ `enforced` — then `--strict-merge` can refuse. Absence of `arkRules` stays silent.
362
407
 
363
408
  **What they do not do:** prove business semantics end-to-end; replace Layers import edges;
364
409
  make “green” mean elegant Shape. Promoting structure to enforced can force rename-to-pass
@@ -415,7 +460,7 @@ changing either contract changes its hash and invalidates the acknowledgement.
415
460
 
416
461
  Optional `stewards` lists **GitHub handles or emails** who may **loosen** the contract or
417
462
  **grow** the baseline (`pedroknigge` or `pedroknigge@users.noreply.github.com` — not
418
- `Pedro Knigge`). The field is metadata — it does not change the policy hash. `layers[].description` is stripped the same way (caption-only edits do not change `policyHash` and do not need a weakening ack; `contractHash` still fingerprints the raw config). The lock
463
+ `Pedro Knigge`). The field is metadata — it does not change the policy hash. `layers[].description`, `layers[].trustBoundary`, and `layers[].owners` are stripped the same way (caption-only, tag-only, or owner-list edits do not change `policyHash` and do not need a weakening ack; `contractHash` still fingerprints the raw config). `requireLayerOwners` stays in the hash. The lock
419
464
  matches `--author`, then `GITHUB_ACTOR` / `ARK_STEWARD`, then `GIT_AUTHOR_EMAIL`. A
420
465
  noreply GitHub mail and the handle are the same person. Git `user.name` is not identity.
421
466
 
@@ -442,6 +487,7 @@ type than product source:
442
487
 
443
488
  | Check | What it does |
444
489
  |-------|----------------|
490
+ | `ark-check --local --base origin/dev` | Opt-in local / multi-worktree cheap check. Same engine as `--changed`. Refused with `--strict-merge`. `ARK_CHECK_LOCAL=1` is the same unless CI or a full-tree report mode is on. |
445
491
  | `ark-check --changed --base origin/dev` | Layer check on touched sources only. A CSS/i18n PR pays almost nothing. |
446
492
  | `ark-check --against origin/dev` | New violation keys vs **that ref's** baseline (not only HEAD). |
447
493
  | `ark-check --contract-diff --base origin/dev` | Classifies tighten / loosen / reclassify / baseline-grow. |
@@ -450,15 +496,18 @@ type than product source:
450
496
  | `ark status --vs origin/dev` | One line: pin / contract / baseline drift vs that ref. |
451
497
 
452
498
  Write-gate ApplyPatch denies a batch that mixes law files with product source. Humans who
453
- never hit PreToolUse are unchanged. Local `pnpm` gates should call `--changed --base`, not
454
- only full-tree `--strict-merge`.
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.
499
+ never hit PreToolUse are unchanged. Local `pnpm` gates should call `--local --base` or
500
+ `--changed --base`, not only full-tree `--strict-merge`. Write hooks stay on the lexical
501
+ snippet path — they do not run a full-tree check. Analysis is per `--root` (each git
502
+ worktree has its own root); there is no machine-wide analysis lock.
503
+
504
+ `--changed` resolves the touched sources plus their import closure — not the whole
505
+ include tree. File-local ArkRules sensors (class shape, orchestration-only, thin-adapter,
506
+ writes-via-aggregate) and hint preload stay on the touched set. Layer and cycle sensors
507
+ see that closure, so a new illegal import or a cycle the change can complete still
508
+ fails. Untouched files outside the closure are left to the full-tree CI check. Same
509
+ engine; not a second analysis path. A `--changed` pass is not a full-tree structural
510
+ verdict.
462
511
 
463
512
  MCP clients can call `ark_policy_delta` with the previous `baseConfig`, an optional candidate
464
513
  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
@@ -164,6 +166,7 @@ npx arkgate agents-md --write # embed/refresh projection markers
164
166
  npx arkgate preflight --changes changes.json --json
165
167
  npx arkgate upgrade --json # managed content preview
166
168
  npx arkgate upgrade --apply
169
+ npx arkgate-check --local --base origin/dev
167
170
  npx arkgate-check --changed --base origin/dev
168
171
  npx arkgate-check --against origin/dev
169
172
  npx arkgate status --vs origin/dev
@@ -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 |
@@ -44,6 +44,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
44
44
  | [`ARKRULE_INVARIANT`](#ARKRULE_INVARIANT) | arkrules | ArkRule invariant failed |
45
45
  | [`ARKRULE_SCOPE_EMPTY`](#ARKRULE_SCOPE_EMPTY) | arkrules | ArkRule appliesTo matched zero files |
46
46
  | [`ARKRULE_HINT_BUDGET_EXHAUSTED`](#ARKRULE_HINT_BUDGET_EXHAUSTED) | arkrules | Structural-hint budget exhausted |
47
+ | [`INVARIANT_CATALOG_EMPTY`](#INVARIANT_CATALOG_EMPTY) | arkrules | Domain invariant catalog is empty |
47
48
  | [`INVARIANT_UNCOVERED`](#INVARIANT_UNCOVERED) | arkrules | Invariant without coverage evidence |
48
49
  | [`INVARIANT_COVERAGE_OUTSIDE_ROOTS`](#INVARIANT_COVERAGE_OUTSIDE_ROOTS) | arkrules | Covering test outside the declared coverage roots |
49
50
  | [`ARKRUN_MISSING_ROOT`](#ARKRUN_MISSING_ROOT) | arkrun | No kernel factory in composition roots |
@@ -58,7 +59,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
58
59
  | [`ARKORDER_GENERIC_UPDATE`](#ARKORDER_GENERIC_UPDATE) | arkorder | Generic update of ξ |
59
60
  | [`ARKORDER_TOO_MANY_PARAMS`](#ARKORDER_TOO_MANY_PARAMS) | arkorder | Too many slow keys |
60
61
  | [`ARKORDER_INGEST_WRITES_XI`](#ARKORDER_INGEST_WRITES_XI) | arkorder | ingest assigned into ξ |
61
- | [`ARKORDER_UNVALVED_RELEASE`](#ARKORDER_UNVALVED_RELEASE) | arkorder | Unvalved second freeze of ξ |
62
+ | [`ARKORDER_UNVALVED_RELEASE`](#ARKORDER_UNVALVED_RELEASE) | arkorder | Second freeze without the valve |
62
63
  | [`INVALID_CHANGE_PATH`](#INVALID_CHANGE_PATH) | preflight | Unsafe change path |
63
64
  | [`DUPLICATE_CHANGE_PATH`](#DUPLICATE_CHANGE_PATH) | preflight | Duplicate path in change set |
64
65
  | [`DELETE_TARGET_MISSING`](#DELETE_TARGET_MISSING) | preflight | Delete target missing |
@@ -97,6 +98,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
97
98
  | [`CONFIG_RULE_UNKNOWN_TO_LAYER`](#CONFIG_RULE_UNKNOWN_TO_LAYER) | config | Rule unknown to layer |
98
99
  | [`CONFIG_AMBIGUOUS_LAYERS`](#CONFIG_AMBIGUOUS_LAYERS) | config | Ambiguous layer classification |
99
100
  | [`CONFIG_UNCLASSIFIED_FILES`](#CONFIG_UNCLASSIFIED_FILES) | config | Unclassified included files |
101
+ | [`CONFIG_LAYER_MISSING_OWNER`](#CONFIG_LAYER_MISSING_OWNER) | config | Layer missing owner |
100
102
  | [`ARK_UNKNOWN`](#ARK_UNKNOWN) | meta | Unknown diagnostic |
101
103
 
102
104
  ## Layer and dependency graph
@@ -105,9 +107,9 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
105
107
 
106
108
  ### `LAYER_IMPORT_VIOLATION`
107
109
 
108
- **Layer import not allowed**
110
+ **This import is not allowed**
109
111
 
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.
112
+ - **Why:** This file imported a folder it may not reach. The write doesn’t land. The same check fails the pull request.
111
113
  - **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
114
 
113
115
  <a id="LAYER_INTENT_REFERENCE_VIOLATION"></a>
@@ -289,6 +291,15 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
289
291
  - **Why:** `orchestration-only`, `thin-adapter`, and `writes-via-aggregate` only evaluate files the hint loader preloaded. When eligible governed files exceed that budget (`coverage.maxFiles`, default `400` — there is no `arkrules.hintBudget`), those sensors never saw the rest of their scope. Enforced + unreviewed is not green. The finding names exact hinted/governed counts and per-sensor reviewed N/M of scope.
290
292
  - **Fix:** Raise `coverage.maxFiles` in ark.config.json (this cap also bounds structural-hint preload; `--doctor` names the coupling) so hinted/governed counts match, then re-run with `--strict-config`. An enforced hint sensor that cannot see its scope fails strict.
291
293
 
294
+ <a id="INVARIANT_CATALOG_EMPTY"></a>
295
+
296
+ ### `INVARIANT_CATALOG_EMPTY`
297
+
298
+ **Domain invariant catalog is empty** · often advisory
299
+
300
+ - **Why:** ArkRules is on and a Domain-role layer has code, but `invariants[]` has no phrases the code must preserve. Empty looks like “done” until someone fills the catalog.
301
+ - **Fix:** Add 1–2 short phrases to `invariants[]` in `arkrules/<Domain>.json` (or the mapped file). Starters show the shape. Advisory unless a domain structure rule is already enforced — then `--strict-merge` can refuse. Do not freeze this finding.
302
+
292
303
  <a id="INVARIANT_UNCOVERED"></a>
293
304
 
294
305
  ### `INVARIANT_UNCOVERED`
@@ -466,10 +477,10 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
466
477
 
467
478
  ### `ARKORDER_UNVALVED_RELEASE`
468
479
 
469
- **Unvalved second freeze of ξ**
480
+ **Second freeze without the valve**
470
481
 
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.
482
+ - **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.
483
+ - **Fix:** Change the choice with proposeRelease then apply. release() is only the first freeze. Never mechanical-safe.
473
484
 
474
485
  ## Atomic preflight and change sets
475
486
 
@@ -589,8 +600,8 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
589
600
 
590
601
  **Lexical evidence incomplete**
591
602
 
592
- - **Why:** Single-file validation cannot prove project module resolution. The write hook is already the verdict.
593
- - **Fix:** Re-run `npx arkgate-check --root . --config ark.config.json`, or treat the hook deny as final. Do not call `ark_prepare_change` from a hook deny.
603
+ - **Why:** This check only saw one file, so it cannot fully prove how the import resolves. The result is provisional — `ark-check` on the project is the authority.
604
+ - **Fix:** Run `npx arkgate-check --root . --config ark.config.json` to confirm. Do not call `ark_prepare_change` from a hook deny.
594
605
 
595
606
  <a id="ANALYSIS_COVERS_NO_FILES"></a>
596
607
 
@@ -598,7 +609,7 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
598
609
 
599
610
  **Analysis covered no files**
600
611
 
601
- - **Why:** No file matched the contract `include` and layer patterns under the analyzed root, so the run had nothing to check. Every rule is vacuously satisfied on an empty set: a green here would read exactly like a green over a governed tree while certifying nothing. Usual causes are a `--root` that is not the tree the contract describes (including a contract found outside the requested root, whose directory is then adopted as the project root), `include` / `exclude` patterns that match nothing, or layer patterns written for a different layout.
612
+ - **Why:** No file matched the contract `include` and layer patterns under the analyzed root, so the run had nothing to check. Every rule is vacuously satisfied on an empty set: a green here would read exactly like a green over a governed tree while certifying nothing. Usual causes are a `--root` that is not the tree the contract describes (including a contract found outside the requested root, whose directory is then adopted as the project root), `include` / `exclude` patterns that match nothing, layer patterns written for a different layout, or an `include` that matched files none of which belong to a layer.
602
613
  - **Fix:** Point `--root` at the tree the contract describes, or keep the contract inside that tree, or fix the `include` / `exclude` / layer patterns so they match real files — then re-run `npx arkgate-check --root . --config ark.config.json`. `--plan` and `--coverage` report the empty scope without refusing, and `--adopt-contract --write` proposes an `include` that matches the tree. This is a refusal about ArkGate's own inputs, not a finding about your code; no baseline or policy acknowledgement can suppress it, and `exclude` cannot silence it — the "is there source here" probe deliberately ignores the contract's own `exclude`, skips dot-directories, never follows a symlink, and skips `*.config.*` tooling files so a polyglot repo is not mistaken for a mismatch.
603
614
 
604
615
  <a id="ANALYSIS_HOST_UNAVAILABLE"></a>
@@ -850,6 +861,15 @@ never opting out of knowing.
850
861
  - **Why:** Included source files match no layer pattern; import rules will not enforce on them.
851
862
  - **Fix:** Extend layer patterns or narrow include so every governed file is classified.
852
863
 
864
+ <a id="CONFIG_LAYER_MISSING_OWNER"></a>
865
+
866
+ ### `CONFIG_LAYER_MISSING_OWNER`
867
+
868
+ **Layer missing owner**
869
+
870
+ - **Why:** `requireLayerOwners` is on and this layer has no owners. Writes to that house fail closed, like a folder with no name on the door.
871
+ - **Fix:** Add a GitHub handle or email to that layer’s owners in ark.config.json (`/ark-adopt`), then re-run. Reserved/allowEmpty houses may stay unnamed.
872
+
853
873
  ## Meta
854
874
 
855
875
  <a id="ARK_UNKNOWN"></a>
@@ -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 |
@@ -49,6 +49,11 @@ server with an explicit project root, compact Codex must contain valid project c
49
49
  SessionStart/PreToolUse Ark hooks, and CI must execute a fail-closed Ark command. Included but
50
50
  unclassified source files therefore remain red.
51
51
 
52
+ If gates are required and the tree has no short decision note yet (`docs/adr/` or
53
+ `docs/decisions/`), `--require-gates` and doctor point at that path. Soft hint —
54
+ not a fail, and silent when `--require-gates` is off. Not every change needs a
55
+ note; use one when you loosen a rule or add a real gate.
56
+
52
57
  Doctor JSON includes `writePath.mode` plus `enforcementLadder`: support, installation, observed
53
58
  evidence, covered operations, bypassability, and CI honesty. MCP registration stays advisory.
54
59