arkgate 4.4.0 → 4.5.5

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 (52) hide show
  1. package/CHANGELOG.md +71 -2
  2. package/README.md +7 -4
  3. package/bin/ark-check-runtime.mjs +38 -13
  4. package/bin/ark-layer-match.mjs +25 -12
  5. package/bin/lib/adapter-contract.mjs +5 -5
  6. package/bin/lib/analysis-engine.mjs +5 -5
  7. package/bin/lib/ci-and-commands.mjs +5 -0
  8. package/bin/lib/deep-module-coach.mjs +177 -0
  9. package/bin/lib/deepening-coach.mjs +177 -0
  10. package/bin/lib/doctor-plan.mjs +14 -0
  11. package/bin/lib/html-report-advisories.mjs +33 -0
  12. package/bin/lib/html-report-depth.mjs +9 -0
  13. package/bin/lib/html-report.mjs +8 -1
  14. package/bin/lib/improvement-compass-map.mjs +507 -0
  15. package/bin/lib/improvement-compass-types.mjs +85 -0
  16. package/bin/lib/improvement-compass.mjs +10 -561
  17. package/bin/lib/managed-upgrade-honesty.mjs +201 -0
  18. package/bin/lib/managed-upgrade.mjs +54 -4
  19. package/bin/lib/remediation.mjs +5 -5
  20. package/bin/lib/status-command.mjs +127 -2
  21. package/bin/lib/status-manifest.mjs +163 -14
  22. package/bin/lib/upgrade-whats-new.mjs +110 -0
  23. package/dist/eslint/index.cjs +2 -2
  24. package/dist/eslint/index.js +2 -2
  25. package/dist/index.cjs +28 -28
  26. package/dist/index.d.ts +126 -21
  27. package/dist/index.js +28 -28
  28. package/docs/README.md +5 -5
  29. package/docs/agent-guide.md +50 -8
  30. package/docs/brownfield-adoption.md +12 -0
  31. package/docs/develop.md +3 -1
  32. package/docs/package-surface.md +8 -6
  33. package/docs/product-voice.md +25 -1
  34. package/docs/use.md +33 -0
  35. package/package.json +1 -1
  36. package/schemas/ark.status-manifest.schema.json +28 -1
  37. package/server.json +2 -2
  38. package/templates/agent-skills/README.md +2 -2
  39. package/templates/agent-skills/ark-adopt/SKILL.md +13 -0
  40. package/templates/agent-skills/ark-explore/SKILL.md +21 -0
  41. package/templates/agent-skills/ark-fix/SKILL.md +7 -0
  42. package/templates/agent-skills/ark-loop/SKILL.md +7 -0
  43. package/templates/agent-skills/ark-place/SKILL.md +7 -0
  44. package/templates/agent-skills/ark-think/SKILL.md +7 -0
  45. package/templates/agent-skills/ark-upgrade/SKILL.md +14 -0
  46. package/templates/skills/ark-adopt.md +13 -0
  47. package/templates/skills/ark-explore.md +21 -0
  48. package/templates/skills/ark-fix.md +7 -0
  49. package/templates/skills/ark-loop.md +7 -0
  50. package/templates/skills/ark-place.md +7 -0
  51. package/templates/skills/ark-think.md +7 -0
  52. package/templates/skills/ark-upgrade.md +14 -0
@@ -34,6 +34,26 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
34
34
 
35
35
  **Map residual lenses → dual-plan B seeds.** Plain Align / Stabilize / Shape from compass + design-weak — not a scorecard.
36
36
 
37
+ ## Deep modules (process)
38
+
39
+ - Prefer **deep modules**: small **interface**, complexity hidden behind it (not a depth score).
40
+ - When proposing a port/adapter or Shape pilot, **name the seam** (callers stay stable; behavior swaps behind it). One adapter → seam still hypothetical; two real adapters → seam justified.
41
+ - Apply the **deletion test** before extracting “just for tests”: if deleting the module makes complexity *vanish*, it was pass-through; if complexity *reappears* across callers, it earned its keep.
42
+ - Prefer verification **at the public interface** of the seam (locality/leverage), not private pass-through layers.
43
+ - When doctor surfaces **hot paths** or **deepening candidates**, treat them as advisory residual only — never as a gate fail; bias dual-plan B pilots toward recent churn when listed.
44
+
45
+ ## Domain glossary (process)
46
+
47
+ If the consumer tree has a **domain glossary**, prefer its terms for layer/slice folders, pilot names, and next-action prose:
48
+
49
+ | Common root names (detect, do not require) |
50
+ |--------------------------------------------|
51
+ | `CONTEXT.md`, `docs/glossary.md`, `docs/domain.md`, `docs/ubiquitous-language.md`, `docs/CONTEXT.md` |
52
+
53
+ - Call out **glossary vs code** conflicts when names disagree with lived folders.
54
+ - **Missing glossary is normal** — do not warn-spam or invent a glossary file.
55
+ - Glossary content never enforces; the gate remains `ark.config.json` + scan.
56
+
37
57
  ## When / not when
38
58
 
39
59
  | Use `/ark-explore` when… | Do **not** use it when… |
@@ -390,6 +410,7 @@ End with **exactly** these headings (markdown `###`):
390
410
  - **Result:** one-line outcome
391
411
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
392
412
  - **Compass:** top residual lenses | `n/a`
413
+ - **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
393
414
  - **Handoff:** `/ark-…` / CLI / `none`
394
415
  - **Incomplete?** `no` | `yes — <what is missing>`
395
416
 
@@ -28,6 +28,12 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
28
28
 
29
29
  **Name residual lenses** on each cluster (SoC, DIP, coupling, …). Still no weaken-gate to clear a lens.
30
30
 
31
+ ## Deep modules (process)
32
+
33
+ - Prefer fixes that leave a **deep module** at a named **seam** (port in the owning layer; adapter outside).
34
+ - Apply the **deletion test** before extracting a layer “just so tests can mock it.”
35
+ - After a port/inject fix, **test at the public interface** of the seam (match remediation `nextAction` language), not only private internals.
36
+
31
37
  ## When / not when
32
38
 
33
39
  | Use `/ark-fix` when… | Do **not** use it when… |
@@ -198,6 +204,7 @@ End with **exactly** these headings (markdown `###`):
198
204
  - **Result:** one-line outcome
199
205
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
200
206
  - **Compass:** top residual lenses | `n/a`
207
+ - **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
201
208
  - **Handoff:** `/ark-…` / CLI / `none`
202
209
  - **Incomplete?** `no` | `yes — <what is missing>`
203
210
 
@@ -31,6 +31,12 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
31
31
 
32
32
  **Lens language on each cluster** while looping edges; residual shape lenses hand off to explore/autopilot.
33
33
 
34
+ ## Deep modules (process)
35
+
36
+ - Judgment remediations that introduce ports: **name the seam**, prefer deep modules, **test at the public interface**.
37
+ - Do not invent pass-through files that fail the **deletion test** just to clear a plan step.
38
+ - Empty plan A is edge residual only — Shape residual still needs explore/autopilot; green edges ≠ feature done.
39
+
34
40
  ## When / not when
35
41
 
36
42
  | Use `/ark-loop` when… | Do **not** use it when… |
@@ -193,6 +199,7 @@ End with **exactly** these headings (markdown `###`):
193
199
  - **Result:** one-line outcome
194
200
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
195
201
  - **Compass:** top residual lenses | `n/a`
202
+ - **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
196
203
  - **Handoff:** `/ark-…` / CLI / `none`
197
204
  - **Incomplete?** `no` | `yes — <what is missing>`
198
205
 
@@ -24,6 +24,12 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
24
24
 
25
25
  **Where so the AI doesn’t mess up next time** — golden pattern + layer home before the write.
26
26
 
27
+ ## Deep modules (process)
28
+
29
+ - Place so new code stays **deep**: one small public surface per concern; hide implementation details.
30
+ - If the artifact is a port or adapter, **name the seam** and put the interface where callers should depend (usually Domain/Application), implementation on the outer side.
31
+ - Do not scaffold empty pass-through modules that fail the **deletion test** (complexity would vanish if deleted).
32
+
27
33
  ## When / not when
28
34
 
29
35
  | Use `/ark-place` when… | Do **not** use it when… |
@@ -175,6 +181,7 @@ End with **exactly** these headings (markdown `###`):
175
181
  - **Result:** one-line outcome
176
182
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
177
183
  - **Compass:** top residual lenses | `n/a`
184
+ - **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
178
185
  - **Handoff:** `/ark-…` / CLI / `none`
179
186
  - **Incomplete?** `no` | `yes — <what is missing>`
180
187
 
@@ -28,6 +28,12 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
28
28
 
29
29
  **2–3 options labeled by lens impact** (what residual improves / what stays out-of-scope).
30
30
 
31
+ ## Deep modules (process)
32
+
33
+ - Prefer **deep modules** (small interface, hidden complexity). Never invent a depth score.
34
+ - Label the **seam** on each option that introduces a port/adapter; apply the **deletion test** before pass-through extracts “for testability.”
35
+ - Recommend tests **at the public interface** of the chosen seam.
36
+
31
37
  ## When / not when
32
38
 
33
39
  | Use `/ark-think` when… | Do **not** use it when… |
@@ -146,6 +152,7 @@ End with **exactly** these headings (markdown `###`):
146
152
  - **Result:** one-line outcome
147
153
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
148
154
  - **Compass:** top residual lenses | `n/a`
155
+ - **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
149
156
  - **Handoff:** `/ark-…` / CLI / `none`
150
157
  - **Incomplete?** `no` | `yes — <what is missing>`
151
158
 
@@ -32,6 +32,20 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
32
32
 
33
33
  **After upgrade:** refresh projection; re-doctor; compass residual still drives process, not scores.
34
34
 
35
+ ## Suggested improvements (what to try next)
36
+
37
+ After `ark upgrade` (preview or apply), read JSON **`whatsNew`** or the human **Suggested improvements**
38
+ block. It lists concrete try/inspect actions for this package line (advisory only — not a score):
39
+
40
+ 1. **Deep-module coach** — `ark-check --doctor` → `doctor.deepModuleCoach` (hot paths + deepening)
41
+ 2. **Improvement compass** — residual lenses on doctor/HTML (not a score)
42
+ 3. **Session recipe** — `ark status --json` honesty modes; doctor when mode is not full
43
+ 4. **Two-axis done** — architecture residual vs feature/ticket residual (Enforce green ≠ feature done)
44
+ 5. **Self-service honesty** — upgrade `selfService` write-path labels + customized preserve
45
+
46
+ Never invent gate verdicts from these suggestions. Missing residual is honest empty, not green.
47
+
48
+
35
49
  ## Dual engine (mandatory)
36
50
 
37
51
  Use the semantic sensor (`ark-check --doctor --json` plus the strict contract