arkgate 3.9.1 → 4.0.0

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 (78) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +16 -4
  3. package/bin/ark-check-runtime.mjs +75 -3
  4. package/bin/ark-mcp-runtime.mjs +94 -0
  5. package/bin/lib/adapter-contract.mjs +14 -1
  6. package/bin/lib/ambient-state.mjs +64 -8
  7. package/bin/lib/analysis-engine.mjs +8 -8
  8. package/bin/lib/architecture-scan.mjs +35 -2
  9. package/bin/lib/arkrule-file-hints.mjs +71 -0
  10. package/bin/lib/arkrules-contract.mjs +382 -0
  11. package/bin/lib/arkrules-sensors.mjs +411 -0
  12. package/bin/lib/config-contract.mjs +85 -6
  13. package/bin/lib/doctor-advisories.mjs +22 -5
  14. package/bin/lib/doctor-plan.mjs +68 -13
  15. package/bin/lib/effective-contract-load.mjs +116 -0
  16. package/bin/lib/enforcement-honesty.mjs +225 -0
  17. package/bin/lib/field-install.mjs +104 -0
  18. package/bin/lib/graph-blind.mjs +254 -0
  19. package/bin/lib/html-report-advisories.mjs +29 -3
  20. package/bin/lib/install-migrate.mjs +20 -2
  21. package/bin/lib/invariant-coverage-io.mjs +157 -0
  22. package/bin/lib/invariant-coverage.mjs +127 -0
  23. package/bin/lib/pilot-loop.mjs +19 -0
  24. package/bin/lib/policy-delta-io.mjs +33 -0
  25. package/bin/lib/post-green-path.mjs +22 -1
  26. package/bin/lib/presets.mjs +241 -1
  27. package/bin/lib/remediation.mjs +28 -0
  28. package/bin/lib/resolved-candidate-facts.mjs +14 -1
  29. package/bin/lib/rules-inventory.mjs +144 -0
  30. package/bin/lib/rules-under-contract.mjs +66 -0
  31. package/bin/lib/start-preview.mjs +24 -7
  32. package/bin/lib/upgrade-command.mjs +48 -2
  33. package/dist/{configTypes-DAPvBqK6.d.ts → configTypes-CC0FEXoF.d.ts} +16 -3
  34. package/dist/eslint/index.cjs +2 -2
  35. package/dist/eslint/index.d.ts +1 -1
  36. package/dist/eslint/index.js +2 -2
  37. package/dist/index.cjs +14 -7
  38. package/dist/index.d.ts +615 -20
  39. package/dist/index.js +13 -6
  40. package/docs/README.md +4 -3
  41. package/docs/agent-guide.md +7 -3
  42. package/docs/ai-gates.md +6 -1
  43. package/docs/brownfield-adoption.md +20 -0
  44. package/docs/configuration.md +37 -4
  45. package/docs/develop.md +8 -2
  46. package/docs/enthusiast/README.md +11 -0
  47. package/docs/package-surface.md +13 -11
  48. package/docs/product-voice.md +9 -2
  49. package/docs/use.md +9 -0
  50. package/package.json +4 -17
  51. package/schemas/ark.analysis-result.schema.json +9 -1
  52. package/schemas/ark.arkrules.schema.json +141 -0
  53. package/schemas/ark.config.schema.json +10 -2
  54. package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
  55. package/server.json +3 -3
  56. package/templates/arkrules/ApplicationOrchestration.json +14 -0
  57. package/templates/arkrules/DomainModel.json +32 -0
  58. package/templates/arkrules/PersistenceAdapters.json +14 -0
  59. package/templates/arkrules/PresentationAdapters.json +14 -0
  60. package/templates/skills/ark-adopt.md +28 -1
  61. package/templates/skills/ark-architect.md +23 -0
  62. package/templates/skills/ark-autopilot.md +27 -1
  63. package/templates/skills/ark-contract.md +27 -1
  64. package/templates/skills/ark-coverage.md +30 -0
  65. package/templates/skills/ark-explain.md +23 -0
  66. package/templates/skills/ark-explore.md +30 -2
  67. package/templates/skills/ark-fix.md +23 -0
  68. package/templates/skills/ark-loop.md +23 -0
  69. package/templates/skills/ark-place.md +30 -0
  70. package/templates/skills/ark-runtime.md +4 -0
  71. package/templates/skills/ark-think.md +24 -1
  72. package/templates/skills/ark-upgrade.md +23 -0
  73. package/compat/nestjs.cjs +0 -2
  74. package/compat/nestjs.d.ts +0 -2
  75. package/compat/nestjs.js +0 -1
  76. package/compat/runtime.cjs +0 -2
  77. package/compat/runtime.d.ts +0 -2
  78. package/compat/runtime.js +0 -1
@@ -19,6 +19,28 @@ Use the semantic sensor (`ark-check --doctor --json` plus the strict contract
19
19
  check) and direct inspection of every managed file the preview will change.
20
20
  Neither signal replaces the other.
21
21
 
22
+
23
+ ## Dual plane — layers + ArkRules (mandatory, except /ark-runtime)
24
+
25
+ ArkGate has **two opt-in planes**. The user chooses which to use; you **always label** findings so they never blur.
26
+
27
+ | Plane | What it protects | Where it lives | Sensors / tools |
28
+ |-------|------------------|----------------|-----------------|
29
+ | **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
30
+ | **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
31
+
32
+ **Rules for every report / answer:**
33
+ 1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
34
+ 2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
35
+ 3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
36
+ 4. Editing `arkrules/*` or promoting modes is **`/ark-contract`**; fixing code under a structure sensor is **`/ark-fix`** / **`/ark-loop`** (judgment, never invent mechanical-safe).
37
+ 5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
38
+
39
+
40
+ ### Upgrade + ArkRules
41
+ - Refresh skills + note if templates gained ArkRules deepen; do not force consumers to adopt `arkRules`.
42
+ - After upgrade: doctor `rulesUnderContract` if map exists; dual-truth note if `--no-install` left package pin old.
43
+
22
44
  ## Safety contract
23
45
 
24
46
  - `ark upgrade` is read-only. It reports the selected profile and hosts, every
@@ -133,6 +155,7 @@ End with exactly this structure:
133
155
  - **Active host:** host and verified status
134
156
  - **Deferred hosts:** `none` or host plus future action
135
157
  - **Result:** old → new version and managed-upgrade outcome
158
+ - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
136
159
  - **Handoff:** `/ark-…`, CLI action, or `none`
137
160
  - **Incomplete?** `no` or `yes — <missing work>`
138
161
 
package/compat/nestjs.cjs DELETED
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = require('@arkgate/runtime/nestjs');
@@ -1,2 +0,0 @@
1
- /** @deprecated Install `@arkgate/runtime` and import from `@arkgate/runtime/nestjs`. */
2
- export * from '@arkgate/runtime/nestjs';
package/compat/nestjs.js DELETED
@@ -1 +0,0 @@
1
- export * from '@arkgate/runtime/nestjs';
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = require('@arkgate/runtime');
@@ -1,2 +0,0 @@
1
- /** @deprecated Install and import from `@arkgate/runtime`. This shim is removed in ArkGate 4. */
2
- export * from '@arkgate/runtime';
package/compat/runtime.js DELETED
@@ -1 +0,0 @@
1
- export * from '@arkgate/runtime';