arkgate 4.6.0 → 4.6.1

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 (75) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/README.md +9 -5
  3. package/bin/ark-check-runtime.mjs +98 -7
  4. package/bin/ark-mcp-runtime.mjs +17 -1
  5. package/bin/ark.mjs +5 -3
  6. package/bin/lib/agent-projection.mjs +1 -1
  7. package/bin/lib/analysis-engine.mjs +3 -3
  8. package/bin/lib/ci-and-commands.mjs +11 -11
  9. package/bin/lib/config-contract.mjs +2 -0
  10. package/bin/lib/contract-smells.mjs +5 -5
  11. package/bin/lib/design-smells.mjs +1 -1
  12. package/bin/lib/doctor-advisories.mjs +9 -0
  13. package/bin/lib/doctor-plan.mjs +4 -4
  14. package/bin/lib/field-install.mjs +1 -1
  15. package/bin/lib/html-report-advisories.mjs +20 -0
  16. package/bin/lib/improvement-compass-map.mjs +20 -20
  17. package/bin/lib/pilot-loop.mjs +1 -1
  18. package/bin/lib/post-green-path.mjs +2 -2
  19. package/bin/lib/prepare-change.mjs +9 -0
  20. package/bin/lib/product-copy.mjs +1 -1
  21. package/bin/lib/status-command.mjs +14 -0
  22. package/bin/lib/status-manifest.mjs +17 -0
  23. package/bin/lib/team-parliament-io.mjs +338 -0
  24. package/bin/lib/team-parliament.mjs +383 -0
  25. package/bin/lib/upgrade-whats-new.mjs +16 -0
  26. package/bin/lib/violations.mjs +8 -4
  27. package/dist/{configTypes-CC0FEXoF.d.ts → configTypes-B8uIcLaG.d.ts} +5 -0
  28. package/dist/eslint/index.cjs +2 -2
  29. package/dist/eslint/index.d.ts +1 -1
  30. package/dist/eslint/index.js +2 -2
  31. package/dist/index.cjs +19 -19
  32. package/dist/index.d.ts +61 -2
  33. package/dist/index.js +22 -22
  34. package/docs/README.md +5 -5
  35. package/docs/agent-guide.md +21 -17
  36. package/docs/configuration.md +36 -2
  37. package/docs/develop.md +13 -1
  38. package/docs/enthusiast/README.md +1 -1
  39. package/docs/enthusiast/how-to-agent-gates.md +3 -3
  40. package/docs/enthusiast/how-to-pick-shape.md +2 -2
  41. package/docs/enthusiast/tutorial-first-project.md +4 -3
  42. package/docs/package-surface.md +5 -3
  43. package/docs/product-voice.md +48 -10
  44. package/docs/use.md +6 -1
  45. package/package.json +2 -2
  46. package/schemas/ark.config.schema.json +9 -0
  47. package/schemas/ark.status-manifest.schema.json +51 -0
  48. package/server.json +3 -3
  49. package/templates/agent-skills/README.md +1 -1
  50. package/templates/agent-skills/ark-adopt/SKILL.md +46 -19
  51. package/templates/agent-skills/ark-architect/SKILL.md +24 -145
  52. package/templates/agent-skills/ark-autopilot/SKILL.md +40 -30
  53. package/templates/agent-skills/ark-contract/SKILL.md +21 -105
  54. package/templates/agent-skills/ark-coverage/SKILL.md +3 -0
  55. package/templates/agent-skills/ark-explain/SKILL.md +7 -4
  56. package/templates/agent-skills/ark-explore/SKILL.md +25 -17
  57. package/templates/agent-skills/ark-fix/SKILL.md +34 -157
  58. package/templates/agent-skills/ark-loop/SKILL.md +31 -153
  59. package/templates/agent-skills/ark-place/SKILL.md +25 -13
  60. package/templates/agent-skills/ark-runtime/SKILL.md +3 -3
  61. package/templates/agent-skills/ark-think/SKILL.md +5 -2
  62. package/templates/agent-skills/ark-upgrade/SKILL.md +11 -7
  63. package/templates/skills/ark-adopt.md +46 -19
  64. package/templates/skills/ark-architect.md +24 -145
  65. package/templates/skills/ark-autopilot.md +40 -30
  66. package/templates/skills/ark-contract.md +21 -105
  67. package/templates/skills/ark-coverage.md +3 -0
  68. package/templates/skills/ark-explain.md +7 -4
  69. package/templates/skills/ark-explore.md +25 -17
  70. package/templates/skills/ark-fix.md +34 -157
  71. package/templates/skills/ark-loop.md +31 -153
  72. package/templates/skills/ark-place.md +25 -13
  73. package/templates/skills/ark-runtime.md +3 -3
  74. package/templates/skills/ark-think.md +5 -2
  75. package/templates/skills/ark-upgrade.md +11 -7
@@ -1,10 +1,20 @@
1
1
  ---
2
2
  name: ark-place
3
- description: "Where does new code go? Names the layer, directory, and naming for a new artifact from the contract, and scaffolds it there. Autonomous."
3
+ description: "Where does new code go? Names the layer, directory, and naming for a new artifact from the contract, and writes it there. Autonomous."
4
4
  ---
5
5
 
6
6
  # /ark-place — Where does this code go?
7
7
 
8
+ ## Autonomy contract
9
+
10
+ Invoking this skill **is** the approval. If the user described an artifact, **write the
11
+ files** in this turn (prepare-write + scaffold). A path table alone is incomplete.
12
+ The CLI is a **sensor and gate**. **CLI budget:** `ark_identity` then `ark_place` (or
13
+ read `ark.config.json`); write; `ark-check`. Do not ask which layer they prefer.
14
+
15
+ **Still never:** weaken `ark.config.json`; invent `mechanical-safe` kinds; claim leftover
16
+ design work is finished because one file landed.
17
+
8
18
  ## Improvement compass (process preflight)
9
19
 
10
20
  When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
@@ -34,8 +44,8 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
34
44
 
35
45
  | Use `/ark-place` when… | Do **not** use it when… |
36
46
  |------------------------|-------------------------|
37
- | New artifact: where + scaffold under contract | Existing violation fix → `/ark-fix` |
38
- | Naming / directory for a known kind | Contract layers wrong `/ark-contract`; full shape choice greenfield → `/ark-architect` |
47
+ | New artifact: where + **write** under the config | Existing violation cluster → `/ark-autopilot` |
48
+ | Naming / directory for a known kind | Session 0 / config missing or lying → `/ark-adopt` (then come back) |
39
49
 
40
50
  The user describes something they need to build (a saga, a background job, an
41
51
  event handler, a repository, an HTTP client, a use case, a projection, …).
@@ -83,7 +93,7 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
83
93
  1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
84
94
  2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
85
95
  3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
86
- 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).
96
+ 4. Missing layer home: add it via **`/ark-adopt`** in this session if needed, then write the file; never invent `mechanical-safe`.
87
97
  5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
88
98
 
89
99
 
@@ -132,17 +142,19 @@ the same files or weaken the gate.
132
142
  3. **Answer concretely**: layer name, target directory (from the layer's
133
143
  `patterns`), intent-name prefix if the layer declares `intentPrefixes`, and
134
144
  which layers it may/may not import (from `rules`).
135
- 4. **If the layer isn't adopted yet** (suggested but no directory): say so,
136
- give the conventional directory from `suggestedLayers`, and offer
137
- `/ark-contract` to adopt it don't silently drop the code into a
145
+ 4. **If the layer isn't adopted yet** (suggested but no directory): write the
146
+ layer into `ark.config.json` (session-0 honesty — same as `/ark-adopt` for
147
+ that glob) **then** write the file. Don't silently drop the code into a
138
148
  wrong-but-existing layer.
139
- 5. **If asked to create it**: scaffold the file(s) in place, following the
140
- nearest existing sibling's style, and any port/adapter split the rules force.
149
+ 5. **Write it.** If the user described the artifact, scaffold the file(s) in
150
+ place this turn (prepare-write), following the nearest existing sibling's
151
+ style, and any port/adapter split the rules force. A path table without
152
+ files is incomplete unless they asked “where only.”
141
153
 
142
154
  ## Critical handoffs
143
155
 
144
- - If the user needs bulk adoption / wrong contract, not a single artifact: **STOP — do not continue this skill as complete.** **STOP wrong skill: invoke /ark-adopt or /ark-contract** instead of ad-hoc multi-file grinding without a plan.
145
- - If contract lacks a home for the artifact: **STOP do not continue this skill as complete.** Adopt the layer via `/ark-contract` first.
156
+ - If the user needs bulk adoption / wrong config, not a single artifact: **STOP — do not continue this skill as complete.** Switch to **`/ark-adopt`** (write the path) instead of ad-hoc multi-file grinding without a plan.
157
+ - If the config lacks a home for the artifact: add the layer **in this turn**, then write the file.
146
158
  - If doctor is **ENFORCE · design-weak** and the user is asking to reshape existing structure
147
159
  (not place one new artifact): place only the new file under the golden/contract home, then
148
160
  hand off **one** pilot via `pilotLoop.nextPilot` / `/ark-explore` shape-focus — never multi-pilot
@@ -159,8 +171,8 @@ the same files or weaken the gate.
159
171
 
160
172
  ## Related onboarding
161
173
 
162
- - Run **after** shape adoption: `/ark-architect` or `ark init --archetype` on greenfield;
163
- `/ark-adopt` on brownfield.
174
+ - Run **after** session 0: `/ark-adopt` (or `ark init --archetype` / `ark-check --recommend`
175
+ on greenfield). Brownfield: `/ark-adopt` first if the config is missing or lying.
164
176
  - `ark-check --recommend` / MCP `ark_recommend` picks phase-1 dirs; gallery starters in
165
177
  `examples/*-starter/` show correct placement per archetype.
166
178
  - Related demos: `docs/demos/` (write-gate self-correction, brownfield, autopilot).
@@ -19,7 +19,7 @@ one feature at a time.
19
19
 
20
20
  This skill is **experimental runtime** only. Do **not** treat runtime adoption as residual on the
21
21
  resilience lens unless the user explicitly opts into the experimental kernel. Prefer doctor compass
22
- for static architecture residual; hand static residual to `/ark-explore` / `/ark-fix`.
22
+ for static architecture residual; hand static residual to `/ark-explore` / `/ark-autopilot`.
23
23
 
24
24
  ## Dual engine (mandatory)
25
25
 
@@ -86,7 +86,7 @@ the same files or weaken the gate.
86
86
 
87
87
  ## Critical handoffs
88
88
 
89
- - No static gates yet: **STOP — do not continue this skill as complete.** Run `/ark-architect` or `/ark-adopt` first.
89
+ - No static gates yet: **STOP — do not continue this skill as complete.** Run `/ark-adopt` first (`ark-check --recommend` / leftover `/ark-architect`).
90
90
  - Runtime companion unavailable from npm and no ArkGate source checkout: **STOP** and report the distribution boundary.
91
91
  - Inventory finds nothing: stop; do not introduce kernel speculatively.
92
92
 
@@ -102,7 +102,7 @@ the same files or weaken the gate.
102
102
 
103
103
  ## Related onboarding
104
104
 
105
- - Adopt static gates and application shape **first** (`/ark-architect`, `/ark-adopt`).
105
+ - Adopt static gates and application shape **first** (`/ark-adopt`).
106
106
  - Runtime kernel is optional and separate from enthusiast onboarding.
107
107
 
108
108
  ## Verify and report
@@ -5,6 +5,9 @@ description: Host-side architectural reasoning — 2–3 enforceable options on
5
5
 
6
6
  # /ark-think — Architectural reasoning (host LLM only)
7
7
 
8
+ **Shortcut.** One decision only. Full map → **`/ark-explore`**. Apply → **`/ark-autopilot`**.
9
+ Session 0 → **`/ark-adopt`**.
10
+
8
11
  You are the user's architecture thinking partner **inside** the project's Ark contract.
9
12
  This skill does **not** call any LLM API from the arkgate package. **You** (the host agent)
10
13
  reason; the write-gate and CI remain deterministic.
@@ -39,8 +42,8 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
39
42
  | Use `/ark-think` when… | Do **not** use it when… |
40
43
  |------------------------|-------------------------|
41
44
  | One decision: new layer vs slice, port vs shared, peerIsolation choice | Full map / ranked residual / dual-plan seed → `/ark-explore` |
42
- | 2–3 options already bounded by a known surface | Apply remediation → `/ark-fix` / `/ark-loop` / `/ark-autopilot` |
43
- | Trade-offs before writing a **new** feature | Brownfield contract wrong / false-green → `/ark-adopt` then `/ark-contract` |
45
+ | 2–3 options already bounded by a known surface | Apply remediation → `/ark-autopilot` |
46
+ | Trade-offs before writing a **new** feature | Brownfield config wrong / false-green → `/ark-adopt` |
44
47
  | Explain *why* a rule exists in *this* tree | HTML tour → `/ark-explain`; fitness numbers → `/ark-coverage` |
45
48
 
46
49
  If you lack a product map and the tree is messy: run a **compressed** explore pass first
@@ -9,9 +9,14 @@ Upgrade the published `arkgate` package and its managed gates without treating a
9
9
  filename, package version, or similar-looking file as proof of ownership. The
10
10
  preview is the source of truth: inspect it before applying anything.
11
11
 
12
- For greenfield onboarding, start with `/ark-architect` (or
13
- `ark-check --recommend`); for a brownfield repository, use `/ark-adopt` before
14
- this upgrade flow.
12
+ ## Autonomy contract
13
+
14
+ Invoking this skill **is** the approval. Preview, then `--apply` **in this turn**.
15
+ Stopping at preview is incomplete unless the probe failed or a conflict needs
16
+ `--accept-conflicts` / `--refresh-skills` consent.
17
+
18
+ For session 0, start with `/ark-adopt` (or `ark-check --recommend`); brownfield
19
+ honesty is `/ark-adopt` before this upgrade flow.
15
20
 
16
21
  ## Improvement compass (process preflight)
17
22
 
@@ -99,7 +104,7 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
99
104
  1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
100
105
  2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
101
106
  3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
102
- 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).
107
+ 4. After upgrade, leftover architecture work is **`/ark-autopilot`** (never invent `mechanical-safe`).
103
108
  5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
104
109
 
105
110
 
@@ -241,9 +246,8 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
241
246
  `doctor.deepModuleCoach` honesty. Run `npx arkgate agents-md --check` and
242
247
  `npx arkgate status --json`. If MCP was used, restart MCP after package bump and re-bind
243
248
  identity. Treat provider-unavailable CI required-check evidence as `unverified`, never as proof
244
- that merges are blocked. If new violations appear, hand off to `/ark-fix` for a small set or
245
- `/ark-loop` / `/ark-autopilot` for residual debt; do not regenerate a baseline without explicit
246
- approval.
249
+ that merges are blocked. If new violations appear, hand off to `/ark-autopilot`; do not regenerate a baseline without
250
+ explicit approval.
247
251
 
248
252
  ## Active host vs deferred hosts
249
253