@skill-map/spec 0.6.0 → 0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,124 @@
1
1
  # Spec changelog
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f41dbad: Step 6.1 — Spec migration: rename the canonical config file from
8
+ `.skill-map.json` (single project-root file) to `.skill-map/settings.json`
9
+ inside the `.skill-map/` scope folder, with a sibling `.skill-map/settings.local.json`
10
+ partner for machine-specific overrides. Aligns the spec with the layered
11
+ config hierarchy described in the roadmap (library defaults → user → user-local
12
+ → project → project-local → env / flags).
13
+
14
+ **Spec change (breaking, minor under pre-1.0 versioning policy)**:
15
+
16
+ - `spec/schemas/project-config.schema.json` description updated to point at
17
+ `.skill-map/settings.json` and explicitly mention the `.local.json` partner
18
+ and the layered-merge contract. The schema _shape_ (keys, types, validation
19
+ rules) is unchanged — only the on-disk filename moves. Consumers that read
20
+ values without caring about the source path are unaffected; consumers that
21
+ hard-code the filename must update.
22
+ - `spec/db-schema.md` §Scopes: `history.share: true` reference updated to
23
+ `.skill-map/settings.json`.
24
+ - `spec/conformance/coverage.md` row #6 description updated to reference the
25
+ new path and the optional `settings.local.json` overlay.
26
+
27
+ **Why minor (not major) at pre-1.0**: per `spec/versioning.md` §Pre-1.0,
28
+ breaking changes ARE allowed in minor bumps while the spec is `0.y.z`. The
29
+ shape of the data is unchanged; only the file name on disk moves.
30
+
31
+ **No backward-compat shim**: there is no real implementation of the loader
32
+ yet (lands in 6.2), so no live consumer reads `.skill-map.json` today. The
33
+ only known prior reference is the demo `mock-collection/.claude/commands/init*.md`
34
+ fixture, which is updated together with `sm init` in 6.5.
35
+
36
+ **Runtime change**: none in 6.1 — pure spec edit. The matching loader,
37
+ `sm init`, and `sm config` verbs land in subsequent sub-steps.
38
+
39
+ **Roadmap update**: `ROADMAP.md` §Configuration "Spec migration" call-out
40
+ flipped from "pending" to "landed Step 6.1, 2026-04-27".
41
+
42
+ Test count: unchanged (213 → 213 — spec-only edit).
43
+
44
+ - 8a4667f: Step 6.6 — `sm plugins enable / disable` + the `config_plugins`
45
+ override layer they read from. The two stub verbs become real, and
46
+ the `PluginLoader` finally honours user intent: a disabled plugin
47
+ surfaces in `sm plugins list` with status `disabled`, but its
48
+ extensions are NOT imported and the kernel will not run them.
49
+
50
+ **Decision (recorded in spec)**: enable/disable resolution favours the
51
+ DB row over `settings.json` over the installed default. The DB
52
+ override is local-machine; `settings.json` is the team-shared baseline.
53
+ A developer can locally disable a misbehaving plugin without
54
+ committing the toggle to the team's config; conversely, a baseline
55
+ that explicitly enables a plugin is overridable per-machine. The rule
56
+ is documented in `spec/db-schema.md` §`config_plugins`.
57
+
58
+ **Spec change (additive, patch)**:
59
+
60
+ - `spec/db-schema.md` — appended an "Effective enable/disable
61
+ resolution" subsection under `config_plugins` documenting the
62
+ three-layer precedence (DB > `settings.json` > installed default).
63
+ No schema changes; the `config_plugins` table itself was already
64
+ defined in the initial migration.
65
+
66
+ **Runtime change**:
67
+
68
+ - `src/kernel/types/plugin.ts` — `TPluginLoadStatus` gains a `disabled`
69
+ variant. JSDoc explains all five states.
70
+ - `src/kernel/adapters/sqlite/plugins.ts` — new file. Storage helpers
71
+ over the `config_plugins` table: `setPluginEnabled` (upsert),
72
+ `getPluginEnabled` (single read), `loadPluginOverrideMap` (bulk
73
+ read for one round-trip per process), `deletePluginOverride`
74
+ (idempotent drop, used by future `sm config reset plugins.<id>`).
75
+ - `src/kernel/config/plugin-resolver.ts` — new file.
76
+ `resolvePluginEnabled` implements the precedence above;
77
+ `makeEnabledResolver` curries the layered config and DB map into
78
+ the `(id) => boolean` shape `IPluginLoaderOptions.resolveEnabled`
79
+ expects.
80
+ - `src/kernel/adapters/plugin-loader.ts` — new optional
81
+ `resolveEnabled` callback in `IPluginLoaderOptions`. When supplied,
82
+ the loader checks AFTER manifest + specCompat validation and
83
+ short-circuits with `status: 'disabled'` (manifest preserved,
84
+ extensions array omitted, reason `"disabled by config_plugins or
85
+ settings.json"`). Omitting the callback keeps the legacy "always
86
+ load" behaviour for tests / kernel-empty-boot.
87
+ - `src/cli/commands/plugins.ts` — wires the loader to the resolver:
88
+ every read (`list / show / doctor`) loads `config_plugins` once and
89
+ feeds the resolver. Two new commands `PluginsEnableCommand` and
90
+ `PluginsDisableCommand` write to the DB. `--all` toggles every
91
+ discovered plugin; `<id>` and `--all` are mutually exclusive.
92
+ `sm plugins doctor` now treats `disabled` as intentional (does not
93
+ contribute to the issue list, does not flip exit code).
94
+ - `src/cli/commands/plugins.ts` — adds `off` to the status icon legend
95
+ in human output (`off mock-a@0.1.0 · disabled by config_plugins or
96
+ settings.json`).
97
+ - `src/cli/commands/stubs.ts` — `PluginsEnableCommand` and
98
+ `PluginsDisableCommand` removed; replaced-at-step comment kept.
99
+ - `context/cli-reference.md` — regenerated; the two new verbs appear
100
+ with their flag tables.
101
+
102
+ **Tests**:
103
+
104
+ - `src/test/plugin-overrides.test.ts` — 8 unit tests covering storage
105
+ round-trip (upsert + read), `loadPluginOverrideMap` bulk read,
106
+ `deletePluginOverride` idempotency, resolver precedence (default ⇒
107
+ true, `settings.json` overrides default, DB overrides
108
+ `settings.json`), `makeEnabledResolver` currying, and PluginLoader
109
+ surfacing `disabled` status with manifest preserved + no extensions
110
+ - omitting the resolver still loads.
111
+ - `src/test/plugins-cli.test.ts` — 9 end-to-end tests via the binary:
112
+ `disable <id>` writes a DB row + `sm plugins list` reflects `off`,
113
+ `enable <id>` flips back, `--all` covers every discovered plugin,
114
+ unknown id → exit 5, no-arg → exit 2, both `<id>` and `--all` →
115
+ exit 2, `settings.json` baseline overridden by DB `enable`,
116
+ `settings.json` baseline applies when DB has no row, and
117
+ `sm plugins doctor` exits 0 when the only non-loaded plugin is
118
+ intentionally disabled.
119
+
120
+ Test count: 273 → 291 (+18).
121
+
3
122
  ## 0.6.0
4
123
 
5
124
  ### Minor Changes
@@ -13,7 +13,7 @@ This file is hand-maintained. A CI check before spec release compares the schema
13
13
  | 3 | `issue.schema.json` | — | 🔴 missing | Needs fixture triggering `trigger-collision` + `broken-ref` + `superseded`. |
14
14
  | 4 | `scan-result.schema.json` | `basic-scan`, `kernel-empty-boot` | 🟢 covered | Zero-filled (empty-boot) + populated (minimal-claude) both asserted. |
15
15
  | 5 | `execution-record.schema.json` | — | 🔴 missing | Blocked by Step 5 (history). Needs a case that runs a `local` action and inspects `state_executions` via `sm history --json`. |
16
- | 6 | `project-config.schema.json` | — | 🔴 missing | Case: init a scope, write a partial `.skill-map.json`, assert effective config after merge. |
16
+ | 6 | `project-config.schema.json` | — | 🔴 missing | Case: init a scope, write a partial `.skill-map/settings.json` (optionally with a `.skill-map/settings.local.json` overlay), assert effective config after the layered merge. |
17
17
  | 7 | `plugins-registry.schema.json` | — | 🔴 missing | Two sub-cases required: (a) `PluginManifest` validation via `sm plugins show --json`; (b) aggregate `PluginsRegistry` via `sm plugins list --json`. |
18
18
  | 8 | `job.schema.json` | — | 🔴 missing | Blocked by Step 10 (job system). Needs a case that submits a local action (no LLM), inspects `sm job show --json`. |
19
19
  | 9 | `report-base.schema.json` | — | 🔴 missing | Indirect coverage once any summarizer case lands. Direct contract case: validate a handcrafted minimal report ({confidence, safety}) against the base schema. |
package/db-schema.md CHANGED
@@ -19,7 +19,7 @@ Two scopes. Each has its own database file and its own migration ledger.
19
19
  | `project` (default) | `./.skill-map/skill-map.db` | The current repository. |
20
20
  | `global` (`-g`) | `~/.skill-map/skill-map.db` | User-level skill directories (e.g. `~/.claude/`). |
21
21
 
22
- The project DB is gitignored by default. Teams MAY opt in to sharing it by setting `history.share: true` in `.skill-map.json` — the file is then committed and the execution log becomes a team artifact. Both zones use the same schema.
22
+ The project DB is gitignored by default. Teams MAY opt in to sharing it by setting `history.share: true` in `.skill-map/settings.json` — the file is then committed and the execution log becomes a team artifact. Both zones use the same schema.
23
23
 
24
24
  The `--db <path>` CLI flag overrides location for both scopes as an escape hatch.
25
25
 
@@ -272,6 +272,14 @@ Persists user-toggled enable/disable overrides. Discovery is still filesystem-ba
272
272
  | `config_json` | TEXT | NULL |
273
273
  | `updated_at` | INTEGER | NOT NULL |
274
274
 
275
+ **Effective enable/disable resolution.** A plugin is enabled iff the highest-precedence layer that mentions it says so. Order from highest to lowest:
276
+
277
+ 1. `config_plugins.enabled` for the row whose `plugin_id` matches — written by `sm plugins enable/disable`. Local-machine user override; never committed (the DB is gitignored unless `history.share: true`).
278
+ 2. `.skill-map/settings.json#/plugins/<id>/enabled` — committed team-shared baseline.
279
+ 3. Installed default — every discovered plugin is enabled until told otherwise.
280
+
281
+ The DB intentionally takes precedence over `settings.json` so a developer can locally disable a misbehaving plugin without committing the toggle to the team's config. Conversely, a team baseline that explicitly enables a plugin is overridable per-machine — no agreement is required to experiment.
282
+
275
283
  ### `config_preferences`
276
284
 
277
285
  General-purpose key-value for user preferences (`sm config set`).
package/index.json CHANGED
@@ -190,11 +190,11 @@
190
190
  }
191
191
  ]
192
192
  },
193
- "specPackageVersion": "0.6.0",
193
+ "specPackageVersion": "0.6.1",
194
194
  "integrity": {
195
195
  "algorithm": "sha256",
196
196
  "files": {
197
- "CHANGELOG.md": "e74921b61ca835c4ebc8f2a4814d2c9513a59ce47c8c719b4d17865b39d93cba",
197
+ "CHANGELOG.md": "73e7db22a362dfe6b1d7aa8f456d57d2106936b831c7de6fc9b44c9f7f9642a2",
198
198
  "README.md": "8bd57e02d9a9d3f0a4efd18c0f0bd1f4bbe13eb206add0317659e48eab435e7e",
199
199
  "architecture.md": "99f9d6a1a90e6c96d3c8a6f36c2650da4a1af0a1bc21173ea8eb2c492008539a",
200
200
  "cli-contract.md": "bab14bb72ddd8a57e00808f7f12741c63a33da99055b278e4407ab9b4bb7e2c1",
@@ -203,7 +203,7 @@
203
203
  "conformance/cases/kernel-empty-boot.json": "175524674b14d993d29f10080d7697074b3a2eee25b359ff903344d73c6acc98",
204
204
  "conformance/cases/orphan-detection.json": "7fea6e866d775d09cadb70ccd764f6c8317ca61316c6d187a97cb2466db4e19e",
205
205
  "conformance/cases/rename-high.json": "f23513893e25fc4259db06a497906137de981da775d8ab2ef262554d54af5f27",
206
- "conformance/coverage.md": "a67fb38c69765bb3cafb78c75e211c530ab00a88d8ccf0254335d3b6d4f69b8d",
206
+ "conformance/coverage.md": "ef98b87b70c46d7deb9853a8015c3e366a296088a70e13e4ffe223d91b9b4622",
207
207
  "conformance/fixtures/minimal-claude/agents/reviewer.md": "d0dd681ba63838301e480116aa09825329f01832b0116de5c5476fdd8a5dcf54",
208
208
  "conformance/fixtures/minimal-claude/commands/status.md": "3f36e053fd1c059ffd902f84a55be8a458c26072f97cb37dd7e97314ae2a9bf5",
209
209
  "conformance/fixtures/minimal-claude/hooks/pre-commit.md": "ec9cec8ac4ce34d40ec055ffd90e8f06ea3e5764d6ec3ee84e0d97de71b930c7",
@@ -215,7 +215,7 @@
215
215
  "conformance/fixtures/preamble-v1.txt": "1e0aeef224b64477bdc13a949c3ad402e68249caf499ecdba1302371677c068b",
216
216
  "conformance/fixtures/rename-high-after/skills/bar.md": "16f7678829c7702f8ebaeef920a891756da198466a1884badd8d8b4a7d1bab6a",
217
217
  "conformance/fixtures/rename-high-before/skills/foo.md": "16f7678829c7702f8ebaeef920a891756da198466a1884badd8d8b4a7d1bab6a",
218
- "db-schema.md": "e9b436b143e2e56985c69498c7d48527bde0baa441be586e2740a4051b366c2d",
218
+ "db-schema.md": "002224f629403a247c0243d4b242c1e35e28bd93073ea53137ec1d30084d9bd7",
219
219
  "interfaces/security-scanner.md": "81dc3dc2c439a75f4603b6d52e714f44ac564032c8aa424385ebbf4502adae3e",
220
220
  "job-events.md": "08796b7fbeb55e5b03cf3bc394224e70a23438a4d15a46ad1d70121c2c68b967",
221
221
  "job-lifecycle.md": "1fe88b1a2ed204e41bb41ac172fbb3e912dccd0dd8a1f8ea8e21a681b336d6ee",
@@ -242,7 +242,7 @@
242
242
  "schemas/link.schema.json": "3e92f5c9def61a857a2c7b22846d82b988157de083463615144ddc92403a489e",
243
243
  "schemas/node.schema.json": "14f345fac450f5728c895d1b878e0015eabb9d72ba9da4a8d2236c82933d3fcf",
244
244
  "schemas/plugins-registry.schema.json": "92b2052bd06e366709dd6e1449d99408999e33707c4007afc7662980e73c3ef1",
245
- "schemas/project-config.schema.json": "286895996eb8cfb8054eb53a9042ea89fbaa36c1eb9e38fdcfbe08440ae692e3",
245
+ "schemas/project-config.schema.json": "a37acdd6198e38dfc429161d92988170ddac91c6e98969e0aaaa8d717f5b9ba3",
246
246
  "schemas/report-base.schema.json": "a1021e9a59b4df9f99cd92454d797e88469766e7d49f52d231c4645ffdfdad8f",
247
247
  "schemas/scan-result.schema.json": "5efe9b1954c5e729c4b55dbc4dd51263d97967d16c0b3cea398877ace74d37b7",
248
248
  "schemas/summaries/agent.schema.json": "3d22558eeb170e00c4fc32018a810d27333cc632c9e528ff386100cfdfded087",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skill-map/spec",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "JSON Schemas, prose contracts, and conformance suite for the skill-map specification.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://skill-map.dev/spec/v0/project-config.schema.json",
4
4
  "title": "ProjectConfig",
5
- "description": "Shape of `.skill-map.json` at the project root. All fields optional; defaults apply when absent. camelCase keys throughout — consistent with the rest of the spec.",
5
+ "description": "Shape of `.skill-map/settings.json` (and its `.skill-map/settings.local.json` partner) inside a scope. Loaded by the layered config hierarchy (library defaults → user → user-local → project → project-local → env/flags) and deep-merged per key. All fields optional; defaults apply when absent. camelCase keys throughout — consistent with the rest of the spec.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "properties": {