arkgate 4.5.7 → 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 (83) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/README.md +18 -12
  3. package/bin/ark-check-runtime.mjs +107 -8
  4. package/bin/ark-mcp-runtime.mjs +17 -1
  5. package/bin/ark.mjs +5 -3
  6. package/bin/lib/agent-homes.mjs +296 -0
  7. package/bin/lib/agent-projection.mjs +2 -2
  8. package/bin/lib/analysis-engine.mjs +3 -3
  9. package/bin/lib/ci-and-commands.mjs +16 -16
  10. package/bin/lib/config-contract.mjs +2 -0
  11. package/bin/lib/contract-smells.mjs +5 -5
  12. package/bin/lib/design-smells.mjs +4 -8
  13. package/bin/lib/doctor-advisories.mjs +9 -0
  14. package/bin/lib/doctor-plan.mjs +39 -15
  15. package/bin/lib/field-install.mjs +1 -1
  16. package/bin/lib/golden-pattern.mjs +1 -1
  17. package/bin/lib/host-support-matrix.mjs +4 -4
  18. package/bin/lib/html-report-advisories.mjs +20 -0
  19. package/bin/lib/html-report-depth.mjs +7 -8
  20. package/bin/lib/html-report.mjs +2 -1
  21. package/bin/lib/improvement-compass-map.mjs +20 -20
  22. package/bin/lib/install-migrate.mjs +12 -0
  23. package/bin/lib/pilot-loop.mjs +1 -1
  24. package/bin/lib/post-green-path.mjs +5 -4
  25. package/bin/lib/prepare-change.mjs +9 -0
  26. package/bin/lib/product-copy.mjs +32 -0
  27. package/bin/lib/skill-write.mjs +1 -1
  28. package/bin/lib/status-command.mjs +14 -0
  29. package/bin/lib/status-manifest.mjs +17 -0
  30. package/bin/lib/team-parliament-io.mjs +338 -0
  31. package/bin/lib/team-parliament.mjs +383 -0
  32. package/bin/lib/upgrade-whats-new.mjs +32 -0
  33. package/bin/lib/violations.mjs +8 -4
  34. package/dist/{configTypes-CC0FEXoF.d.ts → configTypes-B8uIcLaG.d.ts} +5 -0
  35. package/dist/eslint/index.cjs +2 -2
  36. package/dist/eslint/index.d.ts +1 -1
  37. package/dist/eslint/index.js +2 -2
  38. package/dist/index.cjs +8 -8
  39. package/dist/index.d.ts +61 -2
  40. package/dist/index.js +8 -8
  41. package/docs/README.md +5 -4
  42. package/docs/agent-guide.md +31 -24
  43. package/docs/ai-gates.md +19 -0
  44. package/docs/configuration.md +36 -2
  45. package/docs/develop.md +16 -4
  46. package/docs/enthusiast/README.md +1 -1
  47. package/docs/enthusiast/how-to-agent-gates.md +3 -3
  48. package/docs/enthusiast/how-to-pick-shape.md +2 -2
  49. package/docs/enthusiast/tutorial-first-project.md +4 -3
  50. package/docs/package-surface.md +5 -3
  51. package/docs/product-voice.md +126 -82
  52. package/docs/use.md +13 -6
  53. package/package.json +1 -1
  54. package/schemas/ark.config.schema.json +9 -0
  55. package/schemas/ark.status-manifest.schema.json +51 -0
  56. package/server.json +2 -2
  57. package/templates/agent-skills/README.md +1 -1
  58. package/templates/agent-skills/ark-adopt/SKILL.md +46 -19
  59. package/templates/agent-skills/ark-architect/SKILL.md +24 -145
  60. package/templates/agent-skills/ark-autopilot/SKILL.md +40 -30
  61. package/templates/agent-skills/ark-contract/SKILL.md +21 -105
  62. package/templates/agent-skills/ark-coverage/SKILL.md +3 -0
  63. package/templates/agent-skills/ark-explain/SKILL.md +7 -4
  64. package/templates/agent-skills/ark-explore/SKILL.md +29 -21
  65. package/templates/agent-skills/ark-fix/SKILL.md +34 -157
  66. package/templates/agent-skills/ark-loop/SKILL.md +31 -153
  67. package/templates/agent-skills/ark-place/SKILL.md +25 -13
  68. package/templates/agent-skills/ark-runtime/SKILL.md +3 -3
  69. package/templates/agent-skills/ark-think/SKILL.md +5 -2
  70. package/templates/agent-skills/ark-upgrade/SKILL.md +13 -8
  71. package/templates/skills/ark-adopt.md +46 -19
  72. package/templates/skills/ark-architect.md +24 -145
  73. package/templates/skills/ark-autopilot.md +40 -30
  74. package/templates/skills/ark-contract.md +21 -105
  75. package/templates/skills/ark-coverage.md +3 -0
  76. package/templates/skills/ark-explain.md +7 -4
  77. package/templates/skills/ark-explore.md +29 -21
  78. package/templates/skills/ark-fix.md +34 -157
  79. package/templates/skills/ark-loop.md +31 -153
  80. package/templates/skills/ark-place.md +25 -13
  81. package/templates/skills/ark-runtime.md +3 -3
  82. package/templates/skills/ark-think.md +5 -2
  83. package/templates/skills/ark-upgrade.md +13 -8
@@ -16,11 +16,19 @@ deliberately in the same change). Voice is product surface, not marketing decora
16
16
  A track so simple a newcomer enters, so strict a senior trusts — and the AI ships faster
17
17
  because the design space is small and honest.
18
18
 
19
- - **Gate side:** machine-readable contract + write gate + CI. Deterministic. Fail-closed.
20
- Green must mean something real. Two planes: **Layers** (inter) always; **ArkRules** (intra)
21
- opt-in.
22
- - **Co-pilot side:** where code belongs, who talks to whom, how; dual plan **A** (edges) +
23
- **B** (shape); one pilot at a time; never silent judgment codemod; never weaken the contract.
19
+ - **Gate side:** architecture config (`ark.config.json`) + pre-write block where the host
20
+ supports it + required CI. Deterministic. Don’t show green if we could not verify.
21
+ Two planes: **import rules** (who may import whom) always; **ArkRules** (structure rules
22
+ inside a layer) opt-in.
23
+ - **Coach side:** where code belongs, who talks to whom, how; fix imports first, then leftover
24
+ design work; one small refactor at a time; never silent auto-reshape; never weaken the config.
25
+ - **Five-door autonomy:** invoking `/ark-adopt`, `/ark-place`, `/ark-autopilot`, `/ark-explore`,
26
+ or `/ark-upgrade` **is** the approval. The agent writes or maps in that turn. CLI/MCP are
27
+ sensor + gate. Silent reshape from the compact router (unasked) stays forbidden.
28
+ - **Team parliament:** the architecture file is a **constitution**. A product change must not
29
+ amend it. Stewards own loosen and baseline-grow. The ratchet is **new vs the branch you
30
+ merge to**, not only the file on this checkout. A small PR pays `--changed --base`, not
31
+ the whole tree. Humans who never hit the write hook are allowed to ignore Ark.
24
32
  - **Agent contract surface (4.3.0):** agents read **guardrail catalogs** and **scan** evidence;
25
33
  they **process** (judge / coach) outside the package. Projection and skills never become the
26
34
  pass/fail gate.
@@ -29,7 +37,7 @@ because the design space is small and honest.
29
37
  rank. Out-of-scope lenses (perf, app security tooling, full resilience) stay honest.
30
38
  - **Vibe-coder dual depth:** human doctor and skills lead with plain outcomes and one next move;
31
39
  experts keep full JSON. Full-AI workflows get the same single door — not a skill menu exam.
32
- - **False done is forbidden:** Enforce ≠ elegant design. `design-weak` / residual must not
40
+ - **False done is forbidden:** “Rules on” ≠ elegant design. Leftover design work must not
33
41
  read as “healthy finished.” Empty ArkRules inventory is not a score. MCP configuration on
34
42
  disk is not proof that the current process belongs to this project.
35
43
 
@@ -47,57 +55,66 @@ Examples:
47
55
 
48
56
  | Bad | Good |
49
57
  |-----|------|
50
- | Ship it 🚀 your architecture is crushed! | Checked edges are clean. Residual design smells mean the tree is still design-weak. Next: `/ark-explore` shape-focus. |
58
+ | Ship it 🚀 your architecture is crushed! | Import rules check out. Leftover design smells mean the tree is still messy. Next: `/ark-explore` shape-focus. |
51
59
  | You don’t need to understand anything. | Doctor reports one status light and one primary next action. Run `ark-check --doctor`. |
52
- | Become an architect in 60 seconds. | Install pins the contract and compact router. Full guided cleanup is `/ark-autopilot` after skills install. |
60
+ | Become an architect in 60 seconds. | Install pins `ark.config.json` and a short agent router. Full guided cleanup is `/ark-autopilot` after skills install. |
53
61
 
54
62
  ---
55
63
 
56
- ## Lexicon (prefer)
57
-
58
- | Term | Use for |
59
- |------|---------|
60
- | **contract** | `ark.config.json` layers, rules, include — the machine-readable architecture file |
61
- | **Layers plane** | Inter-layer edges: imports, placement, purity, isolation |
62
- | **ArkRules** (opt-in) | Intra-layer structure sensors + domain invariant catalogs as data (`arkrules/*`) |
63
- | **advisory ArkRules** | Default sensor mode — **not** merge teeth; does not fail CI/merge alone (FG-ARKRULES-ADVISORY-ONLY) |
64
- | **extraMergeTeeth** | Only when enforced structure/invariant rules exist **and** classification is honest (≥50% governed, ≥1 populated layer) |
65
- | **dual-plane residual** | Label findings **`[Layer]`** vs **`[ArkRules]`** — never blur them |
66
- | **rulesUnderContract** | Doctor/inventory counts for ArkRules **never a score** |
67
- | **type-only placement debt** | `import type` edges on the violations list with `failsStrict:false` prefer SharedTypes / owning layer; not runtime coupling |
68
- | **gate** / **write gate** | Host boundary that blocks or advises on invalid writes |
69
- | **edges** | Allowed import graph (plan **A** / remediation) |
70
- | **baseline** | Frozen known debt; does not make a wrong contract honest |
71
- | **remediation** | Fixing violations against the contract |
72
- | **pilot** | One extraction / reshape cluster at a time |
73
- | **shape** | Design residual after edges are clean (plan **B**) |
74
- | **design-weak** | Edges clean under Enforce, but design smells / pattern residual remain not “done” |
75
- | **residual** | Work still open after a green edge check (usually Shape / plan **B**) |
76
- | **co-pilot** | Guidance that proposes order and pilots without silent codemod |
77
- | **fail-closed** | Incomplete analysis or unproven enforcement never looks green |
78
- | **honest coverage** | Governed % and empty scope that cannot false-green |
79
- | **mechanical-safe** | Deterministic auto-apply class only |
80
- | **judgment** | Human/agent design work; never silent auto-apply as mechanical-safe |
81
- | **doctor** | Control plane: status light + next action |
82
- | **compact router** | Default onboarding agent instructions (not the full skill pack) |
83
- | **hard write** | Non-bypassable PreToolUse block for listed ops (Claude/Grok when installed + trusted) |
84
- | **advisory write** | MCP/rules coach only (Cursor/Codex at write time) — not a hard block |
85
- | **project identity** | Stable canonical root + config identity returned by `ark_identity`; separate from contract and process identity |
86
- | **matched binding** | Live MCP answered for the exact project root, or for a contained descendant together with the matching project id; only this binding is authoritative |
87
- | **authoritative manifest** | Contract returned by `ark_manifest` after a matched identity handshake |
88
- | **compatibility manifest resource** | `ark://manifest` through standard `resources/read`; always unverified/non-authoritative because the request cannot portably carry a project expectation |
89
- | **configured on disk** | Host files name an Ark MCP command; says nothing about which process is currently running |
90
- | **runtime observed** | A live `ark_identity` response matched this workspace; never infer it from `.codex/config.toml` or hook files |
91
- | **required CI / status context** | Merge hard boundary when the repository makes the Ark job a **required GitHub status context** (CLI: `arkgate-check --strict-merge` / `ark-check --strict-merge`) |
92
- | **contract ready** | Project/layers/ArkRules honesty residual clear not the same as “hard local write” |
93
- | **environment residual** | Permanent host/provider posture (e.g. soft-write Codex) kept in evidence without forcing global **Not finished** |
94
- | **guardrail catalog** | Closed vocabulary of allowed sensors, capabilities, diagnostic `ruleId`s, and skill roles agents and copy choose from the catalog; they do not invent free-form enforcement claims |
95
- | **scan** | Deterministic engine / CLI / MCP evidence pass (layers, ArkRules sensors, status facts, prepare-write). Same inputs → same verdict. No LLM. |
96
- | **process** (agent judgment) | Skill- or agent-side coaching: placement, dual-plan, pilot choice, remediation order. Improves prevention; **never** package pass/fail |
97
- | **diagnostic code** / **ruleId** | Stable public violation id (e.g. `LAYER_IMPORT_VIOLATION`) with shared why/fix anchors catalog-linked, not prose-only ([diagnostics.md](diagnostics.md)) |
98
- | **agent projection** | Version-matched AGENTS/CLAUDE (or equivalent) block generated from package + contract; **non-authoritative** — enforcement is ark-check / hooks / CI |
99
- | **finding ref** | Stable id for a finding across turns (ruleId + target key), so agents re-address without fuzzy message match |
100
- | **status snapshot** | One machine-readable project/session manifest (`ark status --json` shape): identity, activation honesty, last check, residual counts, thin compass residual map not a numeric score |
64
+ ## Lexicon (prefer) — 4.6 common words
65
+
66
+ **Brands (keep):** **ArkGate** (product / npm `arkgate`) and **ArkRules** (opt-in structure rules
67
+ inside a layer). Gloss on first mention; do not rebrand.
68
+
69
+ Human copy prefers the **common** column. JSON field names (`designWeak`, `ruleId`, MCP tools)
70
+ stay stable unless a change explicitly adds an alias.
71
+
72
+ | Prefer (human) | Was / JSON | Use for |
73
+ |----------------|------------|---------|
74
+ | **architecture config** | contract | `ark.config.json` layers, rules, include |
75
+ | **import rules** / **allowed dependencies** | Layers plane / edges | Who may import whom; placement, purity, isolation |
76
+ | **ArkRules** (opt-in; gloss: structure rules inside a layer) | ArkRules | Intra-layer sensors + domain invariant catalogs (`arkrules/*`) |
77
+ | **advisory ArkRules** | advisory ArkRules | Default sensor mode — **not** merge teeth; does not fail CI/merge alone |
78
+ | **extra merge checks** | extraMergeTeeth | Only when enforced structure/invariant rules exist **and** classification is honest |
79
+ | **label `[Layer]` vs `[ArkRules]`** | dual-plane residual | Never blur import-rule findings with ArkRules findings |
80
+ | **ArkRules counts** | rulesUnderContract | Doctor/inventory counts **never a score** |
81
+ | **type-only import debt** | type-only placement debt | `import type` on the violations list with `failsStrict:false` |
82
+ | **pre-write block** | hard write | Host actually blocks listed edit ops (installed + trusted) |
83
+ | **warning only (not blocked)** | advisory write | MCP/rules coach; not a hard block |
84
+ | **import graph** | edges | Allowed imports (fix these first) |
85
+ | **baseline** | baseline | Frozen known debt; does not make a wrong config honest |
86
+ | **fix** | remediation | Fixing violations against the config |
87
+ | **one small refactor** | pilot | One extraction / reshape cluster at a time |
88
+ | **shape / leftover design work** | **design-weak** / residual | Imports clean under Enforce, but design smells remain not “done” |
89
+ | **coach** | co-pilot | Guidance that proposes order without silent auto-reshape |
90
+ | **don’t show green if unverified** | fail-closed | Incomplete analysis or unproven enforcement never looks green |
91
+ | **honest coverage** | honest coverage | Governed % and empty scope that cannot false-green |
92
+ | **safe to auto-apply** | mechanical-safe | Deterministic auto-apply class only |
93
+ | **your judgment** | judgment | Human/agent design work; invoke of an apply door is the approval not silent compact-router reshape |
94
+ | **five doors** | skill menu of 13 | adopt · place · autopilot · explore · upgrade other names are shortcuts |
95
+ | **law / constitution** | contract + baseline + ArkRules files | `ark.config.json`, `arkrules/*`, `.ark-baseline.json` a different change type than product |
96
+ | **steward** | contract owner | GitHub handle or email in `stewards`; only they may loosen the law or grow the baseline |
97
+ | **several hands** | multi-author / CODEOWNERS | Doctor asks for stewards or shows list drift; adopt proposes handles or emails, never invents names |
98
+ | **contract session** | `--contract-session` | Explicit this diff is a law change”; still never mixed with product files |
99
+ | **vs the base branch** | `--against` / `--changed --base` / `status --vs` | Ratchet and honesty against the ref you merge to |
100
+ | **doctor** | doctor | Status light + next action |
101
+ | **short agent router** | compact router | Default onboarding agent instructions (not the full skill pack) |
102
+ | **right project?** | matched binding / project identity | Live MCP answered for this exact project root (+ id). `ark_identity` |
103
+ | **authoritative config read** | authoritative manifest | `ark_manifest` after a matched identity handshake |
104
+ | **compatibility manifest** | `ark://manifest` | Always unverified request cannot carry a project expectation |
105
+ | **configured on disk** | configured on disk | Host files name an Ark MCP command; not proof of the live process |
106
+ | **runtime observed** | runtime observed | A live `ark_identity` matched this workspace |
107
+ | **required CI status** | required CI / status context | Merge hard boundary: required GitHub status running `arkgate-check --strict-merge` |
108
+ | **config ready** | contract ready | Project/import-rules/ArkRules honesty clear not the same as a local pre-write block |
109
+ | **host limitation** | environment residual | Permanent soft-write host (e.g. Codex) — do not paint the whole project unfinished |
110
+ | **allowed rule ids** | guardrail catalog | Closed vocabulary of sensors, capabilities, `ruleId`s, skill roles |
111
+ | **check (tool)** | scan | Deterministic engine / CLI / MCP. Same inputs → same verdict. No LLM. |
112
+ | **coaching / your judgment** | process | Skill- or agent-side. **Never** package pass/fail |
113
+ | **diagnostic code** / **ruleId** | ruleId | Stable public violation id — catalog-linked ([diagnostics.md](diagnostics.md)) |
114
+ | **agent summary** | agent projection | Version-matched AGENTS/CLAUDE block; **non-authoritative** |
115
+ | **finding id** | finding ref | Stable id (ruleId + target key) across turns |
116
+ | **status snapshot** | status snapshot | `ark status --json`: identity, activation, last check, leftover counts — not a score |
117
+ | **shared agent skills (home)** | Codex/Claude/Grok home catalog | Machine floor: always latest additive; never downgrade |
101
118
  | **session recipe** | Agent loop: bind identity → read status → act on residual / findingRef; run doctor when status compass mode is not `full` |
102
119
  | **compass mode** | Status honesty label for the projected residual map: `full` \| `subset` \| `unavailable` — never invent green residual |
103
120
  | **improvement compass** | Closed projection of residual architecture work across fixed **lenses** (aligned to 15 common principles). Always `notAScore`. Never a gate input. |
@@ -158,20 +175,20 @@ gate → same binary verdict on every parity-capable adapter
158
175
 
159
176
  | Do | Example |
160
177
  |----|---------|
161
- | Name the status light + plain fact + term + next action | “Enforce · design-weak. Checked edges are honest; design smells remain. Next: one Shape door — explore → dual-plan B → autopilot with OK.” |
178
+ | Name the status light + plain fact + next action | “Enforce · leftover design work. Import rules check out; design smells remain. Next: one Shape door — explore → plan B → autopilot with OK.” |
162
179
  | Rank one primary door under residual | Doctor **Primary next action** #1; **Also** only for secondary |
163
180
  | Label expert skills as escapes | “Install skill pack only when doctor or a STOP handoff names a skill.” |
164
- | State host write honesty | “Cursor/Codex: advisory write. Required GitHub status context is the hard merge boundary.” |
181
+ | State host write honesty | “Cursor: pre-write block for Write/StrReplace when hooks are trusted. Codex: warning only (not blocked). Required GitHub status is the merge boundary.” |
165
182
  | Soft-write ≠ unfinished project | “Architecture contract ready; Codex local writes are advisory.” Keep `soft-write-host` in evidence; reserve **Not finished** for contract/project debt. |
166
183
  | Keep Suggest on start → doctor | New-here primary is finish `start`, not a competing recommend/architect curriculum |
167
- | Qualify edge-clean under design-weak | “None on checked edges … design residual remains. Not healthy finished.” |
168
- | Prefer fail-closed over fake hard | Incomplete analysis, unobserved hooks, and soft MCP never paint as hard green |
169
- | State project binding before verdict | “Ark MCP matched this workspace; `ark_manifest` evidence is authoritative.” Otherwise: “Ark MCP is configured, but runtime identity is unverified. Restart and call `ark_identity` with the exact project root.” |
184
+ | Qualify import-clean under leftover design | “None on checked importsleftover design work remains. Not healthy finished.” |
185
+ | Prefer unverified-as-not-green | Incomplete analysis, unobserved hooks, and soft MCP never paint as a hard green pre-write block |
186
+ | State project binding before verdict | “Ark MCP matched this workspace; `ark_manifest` evidence is for this project.” Otherwise: “Ark MCP is configured, but we have not proven this is the right project. Restart and call `ark_identity` with the exact project root.” |
170
187
  | Keep inventory claims evidence-bound | “Possible rule candidate in the configured Application layer.” A filename or technical constant alone is not Domain evidence. |
171
188
  | Honesty clear ≠ architecture healthy | `productHonesty.finished` means residual **architecture** honesty sensors are clear — not a green graph score. Open blocking violations, ADAPT/SUGGEST with debt, dual-truth pin, or design residual keep `unfinished: true`. Permanent soft-write alone does **not**. |
172
189
  | Separate CI runtime from provider policy | Successful CI run ≠ required status; GitHub Free plan 403 → `unavailable-plan`, not “CI never ran.” |
173
190
  | Prefer catalog language for agent DX | “Stable `ruleId` with why/fix anchors.” Not a free-form list of “things that might be wrong.” |
174
- | Name scan before process | “Scan: two layer import violations. Process: fix the Application→Domain edge first.” |
191
+ | Name the check before coaching | “Check: two layer import violations. Next: fix the Application→Domain import first.” |
175
192
  | Label projection non-enforcing | “Regenerated agent contract for this package version. Enforcement remains ark-check / hooks / required CI.” |
176
193
  | Keep status counts honest | “Inventory and residual counts are evidence — not a health score.” |
177
194
  | Prefer deep modules | “Small interface, hide the complexity. Name the seam; test at the public interface.” |
@@ -189,7 +206,7 @@ gate → same binary verdict on every parity-capable adapter
189
206
  | “auto-refactor your whole app” / magic codemod claims | We never silent-apply plan B |
190
207
  | “modes you pick” for Suggest/Adapt/Enforce | Those are **status lights**, not settings |
191
208
  | Skill-shopping lists as the default curriculum | Progressive disclosure: one door first |
192
- | “Healthy / done” while design-weak | False done |
209
+ | “Healthy / done” while leftover design work remains | False done |
193
210
  | “Honesty clear” as “architecture finished” | Honesty clear only means residual honesty sensors are quiet; graph/mode debt is separate |
194
211
  | “Not finished” solely because host is Codex/Cursor | Soft-write is environment residual; do not paint a green whole-tree project as unfinished architecture |
195
212
  | “MCP installed / active” because a config file exists | Say **configured on disk · runtime unverified** until `ark_identity` matches the expected root |
@@ -233,16 +250,17 @@ Skills table in docs = **escapes / expert**, not a second onboarding track.
233
250
 
234
251
  ## Hero phrases (approved)
235
252
 
236
- - One contract. One gate. One co-pilot.
253
+ - One architecture config. One check. One coach.
237
254
  - Green must mean something real.
238
255
  - You arrive at Enforce; you never turn it on.
239
- - Enforce does not mean the design is elegant — only that checked edges are honest.
240
- - Empty plan A is not “architecture healthy” when design residual remains.
241
- - One pilot at a time. Pattern bets are never mechanical-safe.
256
+ - Enforce does not mean the design is elegant — only that checked imports are honest.
257
+ - A clean import check is not “architecture healthy” when leftover design work remains.
258
+ - One small refactor at a time. Pattern bets are never auto-applied.
242
259
  - Doctor is the control plane: status light + next action.
243
- - Scan is deterministic. Process is judgment. Only the gate decides pass/fail.
260
+ - The check is deterministic. Coaching is judgment. Only the gate decides pass/fail.
244
261
  - Guardrails are a catalog, not free generation.
245
- - Agent docs project the contract; they never replace the gate.
262
+ - Agent docs summarize the config; they never replace the gate.
263
+ - **ArkGate** and **ArkRules** are product names — gloss them; don’t invent a second brand.
246
264
 
247
265
  ## Hero phrases (forbidden)
248
266
 
@@ -263,38 +281,47 @@ Each model line follows the sentence template: **plain fact · term · next acti
263
281
 
264
282
  | Light | Model line |
265
283
  |-------|------------|
266
- | **Suggest** | Thin or new tree. Contract is not yet the control plane. Next: `ark start` preview, then `--apply`; re-run doctor. |
267
- | **Adapt** | Contract and tree still disagree, or debt is open. Write path does not fully protect you yet. Next: doctor top action #1. |
268
- | **Enforce** | Honest coverage and clean checked edges. Keep host write path + required CI. |
269
- | **Enforce · design-weak** | Checked edges are honest; design smells remain. Green is not elegant design. Next: one Shape door — map (`/ark-explore` shape-focus) dual-plan B apply B only with `/ark-autopilot` and OK. |
284
+ | **Suggest** | Thin or new tree. Architecture config is not yet in charge. Next: `ark start` preview, then `--apply`; re-run doctor. |
285
+ | **Adapt** | Config and tree still disagree, or debt is open. The write path does not fully protect you yet. Next: doctor top action #1. |
286
+ | **Enforce** | Honest coverage and clean checked imports. Keep the host write path + required CI. |
287
+ | **Enforce · leftover design work** | Import rules check out; design smells remain. Green is not elegant design. Next: map (`/ark-explore` shape-focus) then apply one small refactor with `/ark-autopilot` (invoke = apply). |
270
288
 
271
289
  ### Primary next action
272
290
 
273
291
  - Lead with the **outcome**, then the **skill or command**, then the **constraint** (never mechanical-safe / never skill-shop).
274
- - When design-weak, rank the single Shape path first; do not list explore / coverage / think as equal first choices.
292
+ - When leftover design work remains, rank the single Shape path first; do not list explore / coverage / think as equal first choices.
275
293
 
276
294
  ### Deny / gate failure
277
295
 
278
296
  ```text
279
- [What failed in plain terms]. [Rule or evidence id]. Next: [one fix path — /ark-fix, prepare-write, or contract edit].
297
+ [What failed in plain terms]. [Rule or evidence id]. Next: [one fix path — /ark-autopilot, /ark-place, or /ark-adopt].
280
298
  ```
281
299
 
282
300
  Never: mock the user, imply the gate is optional, or suggest disabling rules to “finish.”
301
+ Never: tell an agent to edit `ark.config.json` to clear a product-PR red. That is a **contract
302
+ session** for a steward — split the PR.
303
+
304
+ ```text
305
+ This change mixes the constitution with product files. Next: split the PR, or run a steward
306
+ --contract-session that touches only ark.config / arkrules / .ark-baseline.json.
307
+ ```
283
308
 
284
309
  ### Healthy finished
285
310
 
286
- Print “Healthy — nothing to do” **only** when there is no design-weak residual and no open top actions.
287
- Otherwise name the residual.
311
+ Print “Healthy — nothing to do” **only** when there is no leftover design work and no open top actions.
312
+ Otherwise name the leftover work.
288
313
 
289
314
  ---
290
315
 
291
316
  ## Compact router model
292
317
 
293
- Keep short. Three jobs only:
318
+ Keep short. Five doors only:
294
319
 
295
320
  1. Point at **doctor** as status.
296
- 2. Day-to-day place / validate / check.
297
- 3. Point at **full skill pack install** as optional expert depth not a skill catalog dump.
321
+ 2. Session 0: **`/ark-adopt`**. Day-to-day new files: **`/ark-place`**.
322
+ 3. Apply / leftover design: **`/ark-explore`** then **`/ark-autopilot`** (invoke = apply one refactor).
323
+ 4. Bump: **`/ark-upgrade`**.
324
+ 5. Full skill pack is optional expert depth — not a 13-name exam.
298
325
 
299
326
  ---
300
327
 
@@ -302,11 +329,27 @@ Keep short. Three jobs only:
302
329
 
303
330
  | Skill role | Frontmatter tone |
304
331
  |------------|------------------|
305
- | `/ark-autopilot` | Guided **end-to-end** path (explore dual plan apply A; B with OK) |
306
- | `/ark-explore` | Map / dual-plan **seed** only; primary post-green map half |
307
- | Others | Specialized escape; name when **not** to use them |
332
+ | `/ark-adopt` | Session 0 write the path (greenfield + brownfield) |
333
+ | `/ark-place` | New feature place **and write** |
334
+ | `/ark-autopilot` | Apply A + one Shape refactor; invoke = approval |
335
+ | `/ark-explore` | Map / dual-plan **seed** only |
336
+ | `/ark-upgrade` | Preview then apply in-turn |
337
+ | Others | Shortcut to a door above |
338
+
339
+ Autonomy contract on every door. Never claim silent full-tree reshape from the compact router.
340
+
341
+ ---
342
+
343
+ ## Autonomy contract (skills)
344
+
345
+ Invoking a five-door skill **is** the approval. Write or map in the same turn.
346
+
347
+ **CLI budget:** identity only if using MCP; one doctor / recommend / upgrade preview; then work;
348
+ then check. Forbidden as the deliverable: dumping `--plan` JSON, “approve?”, or
349
+ `STOP — invoke /ark-X` for work that door absorbs.
308
350
 
309
- Keep dual-engine rules and **STOP** handoffs. Never claim silent full-tree reshape.
351
+ **Still never:** weaken the architecture config; invent `mechanical-safe` kinds; claim finished
352
+ while leftover design work remains; batch every Shape bet in one turn.
310
353
 
311
354
  ---
312
355
 
@@ -315,7 +358,8 @@ Keep dual-engine rules and **STOP** handoffs. Never claim silent full-tree resha
315
358
  - [ ] One next action is obvious.
316
359
  - [ ] Status light is not a mode picker.
317
360
  - [ ] No false done under design-weak / incomplete analysis.
318
- - [ ] Technical terms present (contract, gate, edges, pilot) without slang.
361
+ - [ ] Technical terms present (architecture config, import rules, ArkGate, ArkRules) without slang.
362
+ - [ ] Leftover design work is never called “done”.
319
363
  - [ ] Expert skills are labeled expert — not the default curriculum.
320
364
  - [ ] Scan vs process is not blurred with package LLM pass/fail.
321
365
  - [ ] Codes, sensors, and capabilities stay inside the guardrail catalog.
package/docs/use.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  For **anyone** shipping TypeScript with an AI coding agent. You do not need to study clean architecture first.
4
4
 
5
- **One contract. One gate. One co-pilot.**
5
+ **One architecture config. One check. One coach.**
6
6
 
7
7
  ---
8
8
 
@@ -21,7 +21,7 @@ Then keep working with your agent. The doctor is the **control plane**: when stu
21
21
  |-----------|---------|
22
22
  | Unsure | `npx arkgate-check --doctor` |
23
23
  | Agent broke architecture | Fix the edge doctor names (or re-run check) |
24
- | Code is green but still a mess | Shape residual — see below |
24
+ | Code is green but still a mess | Leftover design work — see below |
25
25
  | New ArkGate version | Follow doctor / upgrade guidance |
26
26
 
27
27
  Full skill pack is **optional** (expert depth). Day-to-day: compact router + doctor is enough.
@@ -47,7 +47,7 @@ In those cases a boundary linter or editor rules may be enough; see [README —
47
47
  |------|----------------|
48
48
  | While the AI writes | Host write gate or advisory MCP (depends on host) |
49
49
  | Before merge | Make the Ark job a **required GitHub status context** running `arkgate-check --strict-merge` (alias `ark-check`) |
50
- | Anytime | Doctor: Suggest / Adapt / Enforce (+ design-weak if residual) |
50
+ | Anytime | Doctor: Suggest / Adapt / Enforce (+ leftover design work if the design is still messy) |
51
51
 
52
52
  **Codex / Cursor / OpenCode:** local write stays advisory forever — that is not unfinished architecture. Doctor may say **contract ready** while still reminding you that local writes are advisory; **Not finished** is reserved for real project/contract debt.
53
53
 
@@ -96,14 +96,21 @@ outside the package. **Enforce green ≠ feature done.**
96
96
 
97
97
  That is **Shape** work (plan B) — suggested, never auto-applied as silent magic.
98
98
 
99
- 1. Doctor confirms design-weak (and residual lenses on the improvement compass)
100
- 2. Guided map / dual plan (skill pack: `/ark-explore` then `/ark-autopilot` with your OK)
101
- 3. One pilot at a time · re-run doctor
99
+ 1. Doctor confirms leftover design work (and residual lenses on the improvement compass)
100
+ 2. Guided map / dual plan (skill pack: `/ark-explore` then `/ark-autopilot` applies one refactor)
101
+ 3. One small refactor at a time · re-run doctor
102
+
103
+ **Teams:** do not amend `ark.config.json` in a product PR. Local gate:
104
+ `npx arkgate-check --changed --base origin/dev`. Law-only PRs use
105
+ `--contract-session` (stewards own loosen / baseline-grow). Checkout honesty:
106
+ `npx arkgate status --vs origin/dev`.
102
107
 
103
108
  Install skills only when you want that guided path:
104
109
 
105
110
  ```bash
106
111
  npx arkgate-check --install-agent-gates --skills-only --force
112
+ # optional: refresh shared Claude/Grok/Codex home skills (never downgrades)
113
+ # npx arkgate-check --install-agent-gates --skills-only --agent-homes --force
107
114
  ```
108
115
 
109
116
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.5.7",
3
+ "version": "4.6.1",
4
4
  "description": "ArkGate — architecture co-pilot for AI TypeScript (write gate, CI gate, plan/loop; optional ArkRules)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -632,6 +632,15 @@
632
632
  "minLength": 1
633
633
  },
634
634
  "default": {}
635
+ },
636
+ "stewards": {
637
+ "type": "array",
638
+ "items": {
639
+ "type": "string",
640
+ "minLength": 1
641
+ },
642
+ "uniqueItems": true,
643
+ "default": []
635
644
  }
636
645
  },
637
646
  "$defs": {
@@ -292,6 +292,57 @@
292
292
  "minLength": 1
293
293
  }
294
294
  }
295
+ },
296
+ "vsBase": {
297
+ "type": "object",
298
+ "description": "Checkout vs a git base ref: pin, contract identity, baseline grow. Advisory honesty only — never a gate input.",
299
+ "additionalProperties": false,
300
+ "required": [
301
+ "baseRef",
302
+ "line",
303
+ "pinLocal",
304
+ "pinBase",
305
+ "contractEqual",
306
+ "baselineGrew"
307
+ ],
308
+ "properties": {
309
+ "baseRef": {
310
+ "type": "string",
311
+ "minLength": 1
312
+ },
313
+ "line": {
314
+ "type": "string",
315
+ "minLength": 1
316
+ },
317
+ "pinLocal": {
318
+ "anyOf": [
319
+ {
320
+ "type": "string",
321
+ "minLength": 1
322
+ },
323
+ {
324
+ "type": "null"
325
+ }
326
+ ]
327
+ },
328
+ "pinBase": {
329
+ "anyOf": [
330
+ {
331
+ "type": "string",
332
+ "minLength": 1
333
+ },
334
+ {
335
+ "type": "null"
336
+ }
337
+ ]
338
+ },
339
+ "contractEqual": {
340
+ "type": "boolean"
341
+ },
342
+ "baselineGrew": {
343
+ "type": "boolean"
344
+ }
345
+ }
295
346
  }
296
347
  }
297
348
  }
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/pedroknigge/arkgate",
7
7
  "source": "github"
8
8
  },
9
- "version": "4.5.7",
9
+ "version": "4.6.1",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "arkgate",
14
- "version": "4.5.7",
14
+ "version": "4.6.1",
15
15
  "runtimeHint": "npx",
16
16
  "transport": {
17
17
  "type": "stdio"
@@ -7,7 +7,7 @@
7
7
  This directory is the **Agent Skills–compatible** packaging of the same **13**
8
8
  `/ark-*` skills shipped as flat templates for Ark install. **No new skill names.**
9
9
 
10
- Package version when last generated context: **arkgate@4.5.6**
10
+ Package version when last generated context: **arkgate@4.6.1**
11
11
  Schema: agent-skills package contract `1.0`
12
12
 
13
13
  ## Skills (frozen catalog)