arkgate 4.8.13 → 4.8.14

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 +86 -4
  2. package/README.md +23 -20
  3. package/SECURITY.md +5 -3
  4. package/bin/ark-check-runtime.mjs +9 -9
  5. package/bin/lib/agent-projection-formatters.mjs +2 -0
  6. package/bin/lib/agent-skills-package.mjs +63 -8
  7. package/bin/lib/analysis-engine.mjs +1 -1
  8. package/bin/lib/architecture-scan.mjs +8 -2
  9. package/bin/lib/ark-order-doctor.mjs +7 -1
  10. package/bin/lib/ark-order-report.mjs +2 -1
  11. package/bin/lib/ci-and-commands.mjs +7 -2
  12. package/bin/lib/design-smells.mjs +21 -1
  13. package/bin/lib/diagnostic-catalog.mjs +2 -2
  14. package/bin/lib/doctor-advisories.mjs +15 -7
  15. package/bin/lib/doctor-human.mjs +2 -1
  16. package/bin/lib/first-run-help.mjs +11 -2
  17. package/bin/lib/gate-files.mjs +40 -3
  18. package/bin/lib/install-migrate.mjs +23 -0
  19. package/bin/lib/mcp-hook-payload.mjs +1 -1
  20. package/bin/lib/product-copy.mjs +4 -0
  21. package/bin/lib/remediation.mjs +2 -2
  22. package/bin/lib/resolved-candidate-facts.mjs +144 -36
  23. package/bin/lib/scan-files.mjs +39 -0
  24. package/bin/lib/start-preview.mjs +3 -0
  25. package/bin/lib/upgrade-whats-new.mjs +3 -3
  26. package/bin/lib/violations.mjs +30 -0
  27. package/dist/{diagnosticCatalog-DA565Lja.d.ts → diagnosticCatalog-DVx_2RmF.d.ts} +1 -1
  28. package/dist/eslint/index.cjs +1 -1
  29. package/dist/eslint/index.js +1 -1
  30. package/dist/index.cjs +23 -23
  31. package/dist/index.d.ts +60 -14
  32. package/dist/index.js +17 -17
  33. package/dist/nestjs/index.cjs +1 -1
  34. package/dist/nestjs/index.js +1 -1
  35. package/dist/runtime/index.cjs +11 -11
  36. package/dist/runtime/index.d.ts +1 -1
  37. package/dist/runtime/index.js +11 -11
  38. package/docs/README.md +8 -6
  39. package/docs/agent-guide.md +29 -13
  40. package/docs/ai-gates.md +3 -1
  41. package/docs/arkorder.md +11 -4
  42. package/docs/configuration.md +7 -6
  43. package/docs/develop.md +3 -1
  44. package/docs/diagnostics.md +7 -7
  45. package/docs/enthusiast/README.md +6 -1
  46. package/docs/enthusiast/how-to-gallery-starter.md +2 -1
  47. package/docs/package-surface.md +6 -4
  48. package/docs/product-voice.md +32 -6
  49. package/docs/threat-model.md +2 -2
  50. package/docs/typescript-support.md +3 -3
  51. package/docs/use.md +18 -11
  52. package/package.json +1 -1
  53. package/server.json +2 -2
  54. package/templates/agent-skills/README.md +7 -4
  55. package/templates/agent-skills/ark-adopt/SKILL.md +9 -5
  56. package/templates/agent-skills/ark-architect/SKILL.md +5 -18
  57. package/templates/agent-skills/ark-autopilot/SKILL.md +8 -4
  58. package/templates/agent-skills/ark-contract/SKILL.md +9 -20
  59. package/templates/agent-skills/ark-coverage/SKILL.md +12 -8
  60. package/templates/agent-skills/ark-explain/SKILL.md +7 -3
  61. package/templates/agent-skills/ark-explore/SKILL.md +25 -4
  62. package/templates/agent-skills/ark-fix/SKILL.md +15 -20
  63. package/templates/agent-skills/ark-loop/SKILL.md +14 -20
  64. package/templates/agent-skills/ark-order/SKILL.md +200 -0
  65. package/templates/agent-skills/ark-place/SKILL.md +11 -8
  66. package/templates/agent-skills/ark-runtime/SKILL.md +17 -4
  67. package/templates/agent-skills/ark-think/SKILL.md +24 -126
  68. package/templates/agent-skills/ark-upgrade/SKILL.md +13 -2
  69. package/templates/skills/ark-adopt.md +9 -5
  70. package/templates/skills/ark-architect.md +5 -18
  71. package/templates/skills/ark-autopilot.md +8 -4
  72. package/templates/skills/ark-contract.md +9 -20
  73. package/templates/skills/ark-coverage.md +12 -8
  74. package/templates/skills/ark-explain.md +7 -3
  75. package/templates/skills/ark-explore.md +25 -4
  76. package/templates/skills/ark-fix.md +15 -20
  77. package/templates/skills/ark-loop.md +14 -20
  78. package/templates/skills/ark-order.md +200 -0
  79. package/templates/skills/ark-place.md +11 -8
  80. package/templates/skills/ark-runtime.md +17 -4
  81. package/templates/skills/ark-think.md +24 -126
  82. package/templates/skills/ark-upgrade.md +13 -2
  83. package/templates/tests/ark-adoption-gaps.test.ts +5 -4
package/CHANGELOG.md CHANGED
@@ -5,6 +5,85 @@ in the immutable pre-2.0 archive linked below.
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 4.8.14 — 2026-09-06
9
+
10
+ **Patch** over **4.8.13**. Catch npm `latest` up to `main`: first-class
11
+ `/ark-order` (#217 / #216) and the other ships that landed after tag
12
+ `v4.8.13`. **Write. Check. Ship.** **No required config migration.** No
13
+ `schemaVersion` bump. Does not close `K01` / `Z09`. This mother
14
+ `ark.config.json` still does **not** turn `arkOrder` on.
15
+
16
+ **Status: prepared** (npm `latest` remains **4.8.13** until Actions `publish-npm`
17
+ runs with `tag=v4.8.14` and `dry_run=false`).
18
+
19
+ ### Added
20
+ - Skill catalog covers 100% of product capacity (issue [#216](https://github.com/pedroknigge/arkgate/issues/216) /
21
+ [ADR 0036](docs/adr/0036-skill-catalog-product-capacity.md) / [#217](https://github.com/pedroknigge/arkgate/pull/217)).
22
+ First-class `/ark-order` mirrors `/ark-runtime` for ArkOrder. Leftover
23
+ `/ark-architect` / `/ark-contract` / `/ark-fix` / `/ark-loop` / `/ark-think`
24
+ stay as one-release redirect stubs. Remaining doors speak Contener · Guiar ·
25
+ Ordenar and name the sibling for each job. ACS05 “no new skill names” freeze
26
+ opened; the catalog stays closed in Domain (`ARK_SKILL_NAMES`). Leftover
27
+ `/ark-fix` / `/ark-loop` stubs keep the Y04 mechanical-edit hygiene outcomes.
28
+ Skills never enforce.
29
+
30
+ ### Changed
31
+ - First-contact leftovers after the north-star / billing / one-breath ships
32
+ ([#225](https://github.com/pedroknigge/arkgate/pull/225)): gallery index and
33
+ the hexagonal demo open in ordinary English; `arkgate-check --help` leads with
34
+ the deny; the write-gate fallback and the two newcomer deny codes
35
+ (`LAYER_IMPORT_VIOLATION`, `ARKORDER_UNVALVED_RELEASE`) drop ξ /
36
+ “architecture contract” from the first line.
37
+ - Doctor / start first-contact always tell the ArkOrder one-breath (what it
38
+ is, when to use it, next step) even when the extra is off ([#224](https://github.com/pedroknigge/arkgate/pull/224)).
39
+ Reuses `/ark-order` and `examples/arkorder-billing`. Verdicts stay silent (not a
40
+ score; Layers unchanged).
41
+ - First-contact now names **Contener · Guiar · Ordenar** in ordinary English
42
+ (contain the write, guide the next step, order leftover mess)
43
+ ([#222](https://github.com/pedroknigge/arkgate/pull/222)). README, doctor
44
+ one-light, CLI help, host projections, and first-class skills share the same
45
+ breath. Write. Check. Ship. stays the deny.
46
+ - Billing gallery is the undeniable ArkOrder proof path
47
+ ([#223](https://github.com/pedroknigge/arkgate/pull/223)): site/docs
48
+ (`docs/use.md`, docs hub, enthusiast) →
49
+ [examples/README.md](https://github.com/pedroknigge/arkgate/blob/main/examples/README.md)
50
+ → [examples/arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing)
51
+ (first freeze `release()`, later `proposeRelease` then `apply`). Still GitHub-only;
52
+ not added to the npm tarball or `GALLERY_STARTERS`.
53
+ - Living docs (AGENTS hub, claims matrix, agent-guide skill install, product-voice
54
+ filter) restate the catalog after `#217`: first-class `/ark-order`, leftover
55
+ shortcuts as one-release stubs, ACS05 freeze opened, Domain still closes
56
+ `ARK_SKILL_NAMES`. The skill *set* covers Layers + ArkRules + ArkRun + ArkOrder
57
+ (Contener · Guiar · Ordenar). Historical 14/14 100% and last 4.8.3 C-020 stay
58
+ Planned.
59
+ - Pre-adoption publish is the thin path: slim CI on prepare PRs (no `release`
60
+ label or branch-name full-matrix), annotated tags (unsigned allowed),
61
+ CHANGELOG + `publish-npm` provenance. MCP registry, site, companion republish,
62
+ and `docs/releases/` notes stay optional.
63
+
64
+ ### Fixed
65
+ - `--changed` no longer builds facts for the whole include tree (issue
66
+ [#205](https://github.com/pedroknigge/arkgate/issues/205) /
67
+ [#221](https://github.com/pedroknigge/arkgate/pull/221)). The check now
68
+ resolves touched sources plus their import closure, skips the unused
69
+ tsconfig file walk, and does not list every governed file just to filter
70
+ the diff. File-local ArkRules sensors stay on the touched set. Full-tree
71
+ `ark-check` is unchanged. Dual gate (write + PR) stays the merge line.
72
+ - Short `arkgate-check --help` now names `--changed --base <ref>` as the local /
73
+ pre-push fast path (issue [#204](https://github.com/pedroknigge/arkgate/issues/204) /
74
+ [#220](https://github.com/pedroknigge/arkgate/pull/220)).
75
+ Encyclopedia `--help --all` is unchanged.
76
+ - `ark-check` human warnings now print `path:line` the way denies already do
77
+ (ArkOrder / ArkRun advisory findings already carried the location; the
78
+ printer dropped it). Findings with no file say so — they are about the
79
+ project rules, not a line you just edited. The green `--plan` pointer names
80
+ the first evidence path next to each design smell (issue #203).
81
+ - `start --apply` / `--install-agent-gates` now merge the Ark write-path
82
+ contract into a project-owned `AGENTS.md` and upsert `mcpServers.ark` in
83
+ existing `.mcp.json` (and host copies) without `--force`. Doctor no longer
84
+ reports `gatesMissing: ["AGENTS.md", ".mcp.json"]` after the stranger happy
85
+ path on a repo that already had those files (issue #210).
86
+
8
87
  ## 4.8.13 — 2026-09-06
9
88
 
10
89
  **Patch** over **4.8.12**. Publish gate: remaining ArkOrder doctor/deny branches so
@@ -13,8 +92,9 @@ this is the ship. **Write. Check. Ship.** **No required config migration.** No
13
92
  `schemaVersion` bump. Does not close `K01` / `Z09`. No new skill names. This
14
93
  mother `ark.config.json` still does **not** turn `arkOrder` on.
15
94
 
16
- **Status: prepared** (tree candidate; npm `latest` remains **4.8.11** until the
17
- signed-tag provenance workflow succeeds).
95
+ **Status: prepared** (tag `v4.8.13` and the GitHub Release already exist;
96
+ npm `latest` remains **4.8.11** until Actions `publish-npm` runs with
97
+ `tag=v4.8.13` and `dry_run=false`).
18
98
 
19
99
  ### Fixed
20
100
  - Confidence coverage: remaining ArkOrder doctor/deny `Next:` and HTML/doctor
@@ -29,8 +109,10 @@ them through doctor / start / status / the check label, in plain words.
29
109
  Does not close `K01` / `Z09`. No new skill names. This mother `ark.config.json`
30
110
  still does **not** turn `arkOrder` on.
31
111
 
32
- **Status: prepared** (tree candidate; npm `latest` remains **4.8.11** until the
33
- signed-tag provenance workflow succeeds).
112
+ **Status: tagged, not published** (tag `v4.8.12` stands; `publish-npm` failed
113
+ the 81% branch floor at 80.97%. Do not retag. Do not ship this version to npm.
114
+ Consumers stay on **4.8.11** until **4.8.13** is published.
115
+ npm `latest` remains **4.8.11**).
34
116
 
35
117
  ### Added
36
118
  - Doctor / HTML / status `arkOrder` section (`notAScore`), same envelope as
package/README.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
  Works with Cursor, Claude, Codex, and Grok.
19
21
 
20
22
  [![Website](https://img.shields.io/badge/website-arkgate.online-0a0a0a)](https://www.arkgate.online/)
@@ -37,7 +39,7 @@ Works with Cursor, Claude, Codex, and Grok.
37
39
 
38
40
  </div>
39
41
 
40
- > **ArkGate 4.8.13** is prepared on this tree; npm `latest` remains **4.8.11**.
42
+ > **ArkGate 4.8.14** is prepared on this tree; npm `latest` remains **4.8.13** until `publish-npm` for `v4.8.14`.
41
43
  > Write. Check. Ship. Adopted = required GitHub
42
44
  > status running `arkgate-check --strict-merge`, or an explicit `advisory-only` stance.
43
45
  > Status is compact (`arkgate-check --doctor`; `--all` for Details). Optional **ArkRun**
@@ -45,7 +47,7 @@ Works with Cursor, Claude, Codex, and Grok.
45
47
  > (`arkgate/order`) stops rewriting a big product choice — like the billing plan —
46
48
  > as if it were a seat count. Change those choices through a valve, not a generic update.
47
49
  > `@arkgate/runtime` is deprecated.
48
- > [4.8.13 prepared](CHANGELOG.md) · [4.8.11 published](docs/releases/4.8.11.md) · [4.8.10](docs/releases/4.8.10.md) · [4.8.9](docs/releases/4.8.9.md) · [4.8.8](docs/releases/4.8.8.md) · [4.8.7](docs/releases/4.8.7.md) · [4.8.6](docs/releases/4.8.6.md) · [4.8.5](docs/releases/4.8.5.md) · [4.8.4](docs/releases/4.8.4.md) · [4.8.3](docs/releases/4.8.3.md) · [4.8.2](docs/releases/4.8.2.md) · [4.8.1](docs/releases/4.8.1.md) · [4.8.0](docs/releases/4.8.0.md) · [Docs hub](docs/README.md) · [Voice](docs/product-voice.md)
50
+ > [4.8.14 prepared](CHANGELOG.md) · [4.8.11 published](docs/releases/4.8.11.md) · [4.8.10](docs/releases/4.8.10.md) · [4.8.9](docs/releases/4.8.9.md) · [4.8.8](docs/releases/4.8.8.md) · [4.8.7](docs/releases/4.8.7.md) · [4.8.6](docs/releases/4.8.6.md) · [4.8.5](docs/releases/4.8.5.md) · [4.8.4](docs/releases/4.8.4.md) · [4.8.3](docs/releases/4.8.3.md) · [4.8.2](docs/releases/4.8.2.md) · [4.8.1](docs/releases/4.8.1.md) · [4.8.0](docs/releases/4.8.0.md) · [Docs hub](docs/README.md) · [Voice](docs/product-voice.md)
49
51
 
50
52
  ---
51
53
 
@@ -106,15 +108,15 @@ See [docs/package-surface.md](docs/package-surface.md#installing-from-git).
106
108
 
107
109
  When the agent writes a bad import, the write doesn’t land.
108
110
  The same check fails the pull request. That is **ArkGate** — import rules, always on
109
- once you adopt. The other three are optional.
111
+ once you adopt (**Contener**). The other three are optional.
110
112
 
111
113
  | | Role | When |
112
114
  |--|------|------|
113
115
  | **While the agent writes** | The write doesn’t land on supported hosts; warning only elsewhere | Always (ArkGate) |
114
116
  | **Before merge** | `arkgate-check` as a **required** CI status | Always (ArkGate) |
115
- | **ArkRules** | Optional policies *inside* a layer | When you ask |
116
- | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) | Off unless you turn it on |
117
- | **ArkOrder** | Stops rewriting a big product choice (like billing plan) as if it were a seat count. Change it through a valve, not a generic update (`arkgate/order`) | Off unless you turn it on |
117
+ | **ArkRules** | Optional policies *inside* a layer (**Contener** — shape) | When you ask |
118
+ | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) (**Guiar**) | Off unless you turn it on |
119
+ | **ArkOrder** | Extra for the few big choices billing plan, not seat counts (`arkgate/order`) (**Ordenar**) | Off unless you turn it on |
118
120
 
119
121
  Layers (who may import whom) always run. ArkRules, ArkRun, and ArkOrder change no
120
122
  inter-layer verdict when absent. Label leftovers **`[Layer]`** vs **`[ArkRules]`** vs
@@ -142,15 +144,13 @@ check: [4.3.0 — What ArkGate is / isn't](docs/releases/4.3.0.md#what-arkgate-i
142
144
 
143
145
  ## Why it exists
144
146
 
145
- AI coding agents generate code at unprecedented speeds. However, they tend to take the shortest path to solve a problem. If an agent needs data in a Domain layer, it might directly import a database adapter. Left unchecked, this creates spaghetti code and technical debt at light speed.
146
-
147
- Traditional linters catch these architectural violations in CI *after* the agent has finished its work, breaking the flow.
148
-
149
- ArkGate solves this by shifting the check to the exact moment of writing:
147
+ AI takes the shortest path. Contain the write so a bad import never lands. Guide
148
+ the next step so a non-expert is not stuck. Order leftover mess toward a clean
149
+ tree, one small refactor at a time.
150
150
 
151
- 1. **Fail fast at the write boundary.** Through IDE hooks and MCP, ArkGate intercepts the file write. If the agent writes a bad import, the write doesn't land. The agent gets immediate feedback and can self-correct before saving to disk.
152
- 2. **The check is the single source of truth.** A simple `ark.config.json` defines your layers and allowed edges.
153
- 3. **Honest reporting.** Green imports do not equal elegant design. ArkGate separates structural correctness from design smells, providing an improvement compass to guide leftover design work without blocking the PR.
151
+ Traditional linters catch this only in CI after the agent finished. ArkGate
152
+ checks at write time and again on the PR. Green imports are not elegant design
153
+ leftover mess is **needs a refactor**, not “done”.
154
154
 
155
155
  ---
156
156
 
@@ -251,7 +251,7 @@ npx arkgate-check --strict-merge # CI / required status
251
251
  npx arkgate-check --install-agent-gates --tools claude,cursor,codex,grok,antigravity
252
252
  # optional: refresh shared home skills (Claude/Grok/Antigravity/Codex; never downgrades)
253
253
  # npx arkgate-check --install-agent-gates --skills-only --agent-homes --force
254
- # optional: same 13 skills via Agent Skills ecosystem (no new names)
254
+ # optional: closed skill catalog via Agent Skills ecosystem (ARK_SKILL_NAMES)
255
255
  # npx skills add ./node_modules/arkgate/templates/agent-skills
256
256
  # optional ArkRun: poll the loopback inspector (ANSI TUI — not a gate)
257
257
  # npx ark-dashboard --url http://127.0.0.1:<port>/snapshot
@@ -313,9 +313,12 @@ Name the few choices (`xiKeys`: plan, cycle, tenancy — not seat counts). First
313
313
  freeze is `release()`. Later change is `proposeRelease` then `apply`. A generic
314
314
  `update` does not land.
315
315
 
316
- The billing gallery lives on GitHub, not in the npm tarball:
317
- [examples/arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing).
318
- Compact starters leave it off. Details: [ArkOrder](docs/arkorder.md).
316
+ Proof path (GitHub, not the npm tarball):
317
+ [examples/arkorder-billing](https://github.com/pedroknigge/arkgate/tree/main/examples/arkorder-billing)
318
+ first freeze is `release()`; later plan change is `proposeRelease` then `apply`.
319
+ Gallery index:
320
+ [examples/README.md](https://github.com/pedroknigge/arkgate/blob/main/examples/README.md).
321
+ Compact starters leave the extra off. Details: [ArkOrder](docs/arkorder.md).
319
322
 
320
323
  ---
321
324
 
@@ -331,7 +334,7 @@ Compact starters leave it off. Details: [ArkOrder](docs/arkorder.md).
331
334
  | Config · package surface · TS | [configuration](docs/configuration.md) · [package-surface](docs/package-surface.md) · [typescript-support](docs/typescript-support.md) |
332
335
  | Brownfield | [docs/brownfield-adoption.md](docs/brownfield-adoption.md) |
333
336
  | Security | [SECURITY.md](SECURITY.md) |
334
- | Prepared (4.8.13; not published) | [CHANGELOG](CHANGELOG.md) |
337
+ | Prepared (4.8.14; not published) | [CHANGELOG](CHANGELOG.md) |
335
338
  | Current published (4.8.11 on npm `latest`) | [docs/releases/4.8.11.md](docs/releases/4.8.11.md) · [CHANGELOG](CHANGELOG.md) |
336
339
  | Prior published (4.8.10) | [docs/releases/4.8.10.md](docs/releases/4.8.10.md) · [CHANGELOG](CHANGELOG.md) |
337
340
  | Prior published (4.8.9) | [docs/releases/4.8.9.md](docs/releases/4.8.9.md) · [CHANGELOG](CHANGELOG.md) |
package/SECURITY.md CHANGED
@@ -28,9 +28,11 @@ a private security contact without including exploit details.
28
28
  ArkGate releases are GitHub-first:
29
29
 
30
30
  1. Changes land on GitHub and must pass CI plus the dedicated security workflow.
31
- 2. A GitHub Release is created from a signed `vX.Y.Z` tag (`git tag -s`). The publish
32
- workflow verifies the signature and fails closed for unsigned tags. The local override
33
- exists only for explicit emergency use and is not enabled in CI.
31
+ 2. A GitHub Release is created from an **annotated** `vX.Y.Z` tag (`git tag -a` is
32
+ enough). The publish workflow checks that the tag matches `package.json` and is
33
+ annotated. Unsigned annotated tags are allowed. Signed tags still verify when
34
+ present. Set `ARK_REQUIRE_SIGNED_RELEASE_TAG=true` on the publish job only if
35
+ you want signed-only again.
34
36
  3. The manual `Publish npm` workflow verifies the tag, requires the GitHub Release to
35
37
  exist, reruns release checks, publishes npm with provenance, and uploads a SHA-256
36
38
  checksum for the npm tarball to the GitHub Release.
@@ -77,6 +77,7 @@ import {
77
77
  writeBaseline,
78
78
  printViolation,
79
79
  printViolationBreakdown,
80
+ printWarning,
80
81
  CONCENTRATION_MIN_VIOLATIONS,
81
82
  } from './lib/violations.mjs';
82
83
  import {
@@ -102,6 +103,8 @@ import {
102
103
  UNGOVERNED_PROBE_CAP,
103
104
  collectGovernedFiles,
104
105
  countUngovernedSourceFiles,
106
+ governedFilesFromRelativePaths,
107
+ isGovernedSourcePath,
105
108
  normalize,
106
109
  walk,
107
110
  } from './lib/scan-files.mjs';
@@ -123,7 +126,6 @@ import {
123
126
  applyAgainstRatchet,
124
127
  bindTeamBaseRefs,
125
128
  contractSessionFrom,
126
- filterChangedGovernedFiles,
127
129
  runTeamPreflight,
128
130
  ungovernedDumpMessage,
129
131
  } from './lib/team-parliament-io.mjs';
@@ -1405,8 +1407,7 @@ async function main() {
1405
1407
  }
1406
1408
  const manifest = readManifest(root, args.manifest);
1407
1409
  const rules = manifest?.architecture?.rules ?? config.rules;
1408
- const allGovernedFiles = loadGovernedFiles();
1409
- if (verdictPath) {
1410
+ if (verdictPath && !args.changed) {
1410
1411
  const refusal = emptyAnalysisRefusalNow();
1411
1412
  if (refusal) {
1412
1413
  reportEmptyAnalysis(refusal);
@@ -1414,10 +1415,9 @@ async function main() {
1414
1415
  }
1415
1416
  }
1416
1417
  if (args.failUngoverned && teamParliament?.changeSet?.productPaths?.length) {
1417
- const governedRel = new Set(
1418
- allGovernedFiles.map((abs) => normalize(path.relative(root, abs)))
1418
+ const dumped = teamParliament.changeSet.productPaths.filter(
1419
+ (rel) => !isGovernedSourcePath(root, rel, config)
1419
1420
  );
1420
- const dumped = teamParliament.changeSet.productPaths.filter((rel) => !governedRel.has(rel));
1421
1421
  if (dumped.length > 0) {
1422
1422
  const message = ungovernedDumpMessage(dumped);
1423
1423
  if (args.json) {
@@ -1430,8 +1430,8 @@ async function main() {
1430
1430
  }
1431
1431
  }
1432
1432
  const files = args.changed
1433
- ? filterChangedGovernedFiles(allGovernedFiles, root, changedPaths, normalize)
1434
- : allGovernedFiles;
1433
+ ? governedFilesFromRelativePaths(root, changedPaths, config)
1434
+ : loadGovernedFiles();
1435
1435
 
1436
1436
  // --coverage is a pure glob/report view (no TypeScript resolver), so serve it BEFORE the
1437
1437
  // TS import: the report must work — and exit 0 — even when typescript isn't installed.
@@ -1966,7 +1966,7 @@ async function main() {
1966
1966
  }, null, 2));
1967
1967
  } else {
1968
1968
  for (const warning of warnings) {
1969
- console.error(`${color.yellow('warning')} ${warning.ruleId} ${warning.message}`);
1969
+ printWarning(warning);
1970
1970
  }
1971
1971
  for (const violation of activeViolations) {
1972
1972
  printViolation(violation);
@@ -105,6 +105,8 @@ export function buildAgentProjectionBody(facts) {
105
105
  '',
106
106
  AGENT_PROJECTION_NON_ENFORCEMENT_LABEL,
107
107
  '',
108
+ 'Contener · Guiar · Ordenar — contain the write, guide the next step, order leftover mess. Skills never enforce.',
109
+ '',
108
110
  `- **arkgateVersion:** \`${version}\` (must match the installed package; regenerate with \`ark agents-md --write\` after upgrade)`,
109
111
  `- **projectionSchema:** \`${ARK_AGENT_PROJECTION_SCHEMA_VERSION}\``,
110
112
  `- **profile:** \`${profile}\`${host ? ` · **host:** \`${host}\`` : ''}`,
@@ -19,7 +19,51 @@ export const FLAT_SKILL_TEMPLATES_RELATIVE_ROOT = 'templates/skills';
19
19
  /** Required entry filename inside each skill directory (Agent Skills standard). */
20
20
  export const AGENT_SKILL_ENTRY_FILENAME = 'SKILL.md';
21
21
  /**
22
- * Closed skill-name freeze (ACS / ADR skill freeze). Exactly these 13 names ship.
22
+ * North-star filter for first-class doors. Not a score. Not enforcement.
23
+ * Skills speak these so an agent picks the right sibling.
24
+ */
25
+ export const ARK_SKILL_NORTH_STAR = Object.freeze(['Contener', 'Guiar', 'Ordenar']);
26
+ /**
27
+ * First-class doors. Each must have crisp when / not when / handoff.
28
+ * Sorted alphabetically.
29
+ */
30
+ export const ARK_FIRST_CLASS_SKILL_NAMES = Object.freeze([
31
+ 'ark-adopt',
32
+ 'ark-autopilot',
33
+ 'ark-coverage',
34
+ 'ark-explain',
35
+ 'ark-explore',
36
+ 'ark-order',
37
+ 'ark-place',
38
+ 'ark-runtime',
39
+ 'ark-upgrade',
40
+ ]);
41
+ /**
42
+ * One-release redirect stubs. Muscle memory / old docs still resolve.
43
+ * Values are first-class doors. Capability surface must stay zero-loss.
44
+ */
45
+ export const ARK_SKILL_STUB_REDIRECTS = Object.freeze({
46
+ 'ark-architect': 'ark-adopt',
47
+ 'ark-contract': 'ark-adopt',
48
+ 'ark-fix': 'ark-autopilot',
49
+ 'ark-loop': 'ark-autopilot',
50
+ 'ark-think': 'ark-explore',
51
+ });
52
+ /**
53
+ * Product surface → first-class doors that exercise it.
54
+ * Standing check: every surface has at least one first-class door.
55
+ */
56
+ export const ARK_SKILL_CAPACITY = Object.freeze({
57
+ Layers: ['ark-adopt', 'ark-place', 'ark-explore', 'ark-autopilot', 'ark-coverage', 'ark-explain'],
58
+ ArkRules: ['ark-adopt', 'ark-explore', 'ark-autopilot'],
59
+ ArkRun: ['ark-adopt', 'ark-runtime', 'ark-place', 'ark-autopilot'],
60
+ ArkOrder: ['ark-adopt', 'ark-order', 'ark-place', 'ark-autopilot'],
61
+ Contener: ['ark-adopt', 'ark-place', 'ark-upgrade'],
62
+ Guiar: ['ark-explore', 'ark-autopilot', 'ark-explain', 'ark-coverage', 'ark-runtime'],
63
+ Ordenar: ['ark-order'],
64
+ });
65
+ /**
66
+ * Closed shipped catalog (first-class + one-release stubs).
23
67
  * Sorted alphabetically for deterministic inventory diffs.
24
68
  */
25
69
  export const ARK_SKILL_NAMES = Object.freeze([
@@ -32,12 +76,13 @@ export const ARK_SKILL_NAMES = Object.freeze([
32
76
  'ark-explore',
33
77
  'ark-fix',
34
78
  'ark-loop',
79
+ 'ark-order',
35
80
  'ark-place',
36
81
  'ark-runtime',
37
82
  'ark-think',
38
83
  'ark-upgrade',
39
84
  ]);
40
- /** Count of frozen skill names (must stay 13 until a ROADMAP item lifts the freeze). */
85
+ /** Count of shipped skill names (first-class + stubs). */
41
86
  export const ARK_SKILL_NAME_COUNT = ARK_SKILL_NAMES.length;
42
87
  const AGENT_SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
43
88
  /**
@@ -51,10 +96,20 @@ export function isValidAgentSkillName(name) {
51
96
  return false;
52
97
  return AGENT_SKILL_NAME_PATTERN.test(name);
53
98
  }
54
- /** True when `name` is one of the frozen 13 Ark skill names. */
99
+ /** True when `name` is in the closed shipped catalog. */
55
100
  export function isArkSkillName(name) {
56
101
  return ARK_SKILL_NAMES.includes(name);
57
102
  }
103
+ /** True when `name` is a first-class door (not a redirect stub). */
104
+ export function isFirstClassArkSkillName(name) {
105
+ return ARK_FIRST_CLASS_SKILL_NAMES.includes(name);
106
+ }
107
+ /** First-class door a leftover name redirects to, or null. */
108
+ export function arkSkillStubRedirect(name) {
109
+ if (!(name in ARK_SKILL_STUB_REDIRECTS))
110
+ return null;
111
+ return ARK_SKILL_STUB_REDIRECTS[name];
112
+ }
58
113
  /**
59
114
  * Parse a skill markdown document with optional YAML frontmatter.
60
115
  * Supports the simple `key: value` / `key: "quoted"` form used by Ark templates
@@ -135,7 +190,7 @@ export function validateAgentSkillDocument(input) {
135
190
  else if (requireArk && !isArkSkillName(name)) {
136
191
  issues.push({
137
192
  code: 'UNKNOWN_SKILL_NAME',
138
- message: `Skill name "${name}" is not in the frozen Ark 13-skill catalog (no new skill names).`,
193
+ message: `Skill name "${name}" is not in the closed Ark skill catalog (ARK_SKILL_NAMES).`,
139
194
  skillName: name,
140
195
  });
141
196
  }
@@ -163,7 +218,7 @@ export function validateAgentSkillDocument(input) {
163
218
  return issues;
164
219
  }
165
220
  /**
166
- * Validate a full Agent Skills package inventory against the frozen 13-name catalog.
221
+ * Validate a full Agent Skills package inventory against the closed catalog.
167
222
  * Detects missing, extra, duplicate, invalid, and (when supplied) flat-template drift.
168
223
  */
169
224
  export function validateAgentSkillsPackage(entries) {
@@ -201,7 +256,7 @@ export function validateAgentSkillsPackage(entries) {
201
256
  if (!seen.has(expected)) {
202
257
  issues.push({
203
258
  code: 'MISSING_SKILL',
204
- message: `Missing frozen skill "${expected}" from Agent Skills package.`,
259
+ message: `Missing catalog skill "${expected}" from Agent Skills package.`,
205
260
  skillName: expected,
206
261
  });
207
262
  }
@@ -212,14 +267,14 @@ export function validateAgentSkillsPackage(entries) {
212
267
  if (!issues.some((i) => i.code === 'UNKNOWN_SKILL_NAME' && i.skillName === name)) {
213
268
  issues.push({
214
269
  code: 'EXTRA_SKILL',
215
- message: `Extra skill "${name}" is not in the frozen Ark 13-skill catalog.`,
270
+ message: `Extra skill "${name}" is not in the closed Ark skill catalog.`,
216
271
  skillName: name,
217
272
  });
218
273
  }
219
274
  else {
220
275
  issues.push({
221
276
  code: 'EXTRA_SKILL',
222
- message: `Extra skill "${name}" is not in the frozen Ark 13-skill catalog.`,
277
+ message: `Extra skill "${name}" is not in the closed Ark skill catalog.`,
223
278
  skillName: name,
224
279
  });
225
280
  }