@skill-map/spec 0.19.0 → 0.20.0
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 +347 -6
- package/README.md +6 -6
- package/architecture.md +62 -55
- package/cli-contract.md +35 -14
- package/conformance/README.md +2 -2
- package/conformance/cases/kernel-empty-boot.json +2 -2
- package/conformance/cases/sidecar-end-to-end.json +3 -3
- package/conformance/coverage.md +5 -5
- package/conformance/fixtures/sidecar-end-to-end/.claude/agents/orphan.sm +1 -1
- package/conformance/fixtures/sidecar-example/agent-example.md +1 -1
- package/db-schema.md +18 -17
- package/index.json +36 -36
- package/interfaces/security-scanner.md +2 -2
- package/job-events.md +12 -12
- package/job-lifecycle.md +1 -1
- package/package.json +1 -1
- package/plugin-author-guide.md +112 -81
- package/plugin-kv-api.md +5 -5
- package/prompt-preamble.md +1 -1
- package/schemas/annotations.schema.json +4 -4
- package/schemas/api/rest-envelope.schema.json +4 -4
- package/schemas/conformance-case.schema.json +2 -2
- package/schemas/extensions/analyzer.schema.json +43 -0
- package/schemas/extensions/base.schema.json +5 -5
- package/schemas/extensions/extractor.schema.json +1 -1
- package/schemas/extensions/hook.schema.json +6 -4
- package/schemas/issue.schema.json +6 -6
- package/schemas/link.schema.json +2 -2
- package/schemas/plugins-registry.schema.json +1 -1
- package/schemas/project-config.schema.json +15 -1
- package/schemas/sidecar.schema.json +2 -2
- package/schemas/summaries/agent.schema.json +1 -1
- package/schemas/summaries/command.schema.json +1 -1
- package/schemas/summaries/hook.schema.json +1 -1
- package/schemas/{view-contracts.schema.json → view-slots.schema.json} +91 -54
- package/schemas/extensions/rule.schema.json +0 -43
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://skill-map.dev/spec/v0/view-
|
|
4
|
-
"title": "
|
|
5
|
-
"description": "Closed catalog of view
|
|
3
|
+
"$id": "https://skill-map.dev/spec/v0/view-slots.schema.json",
|
|
4
|
+
"title": "ViewSlots",
|
|
5
|
+
"description": "Closed catalog of view slots. A view slot is a kernel-published handle that names a visual surface in the UI, fixes the renderer that draws there, and fixes the payload shape the plugin emits. The plugin author picks ONE slot per view contribution; the kernel validates `ctx.emitContribution(id, payload)` against that slot's payload schema in `$defs.payloads`. There is no separate notion of a 'contract' — the slot IS the contract. Closed catalog by design: every new slot requires a spec change + UI renderer mount + scaffolder support + conformance fixtures + tests. Compounds catalog evolution cost; see ROADMAP.md §UI contribution system → 'Known limitations carried forward'. Slots are versioned via the manifest field `catalogCompat` (semver against the catalog as a whole), not per-slot.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"$defs": {
|
|
8
|
-
"
|
|
8
|
+
"SlotName": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"enum": [
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"node
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
11
|
+
"card.title.right",
|
|
12
|
+
"card.subtitle.left",
|
|
13
|
+
"card.footer.left.counter",
|
|
14
|
+
"card.footer.right",
|
|
15
|
+
"graph.node.alert",
|
|
16
|
+
"inspector.header.badge.counter",
|
|
17
|
+
"inspector.header.badge.tag",
|
|
18
|
+
"inspector.body.panel.breakdown",
|
|
19
|
+
"inspector.body.panel.records",
|
|
20
|
+
"inspector.body.panel.tree",
|
|
21
|
+
"inspector.body.panel.key-values",
|
|
22
|
+
"inspector.body.panel.link-list",
|
|
23
|
+
"inspector.body.panel.markdown",
|
|
24
|
+
"topbar.actions.indicator"
|
|
21
25
|
],
|
|
22
|
-
"description": "Closed enum of
|
|
26
|
+
"description": "Closed enum of slot identifiers. Adding an entry requires the full spec/UI/scaffolder/conformance round-trip per ROADMAP.md §UI contribution system. Removing or renaming an entry is a catalog-major-bump and triggers `sm plugins upgrade` migration. Slots that share a payload shape (e.g. `card.subtitle.left`, `card.footer.right`, and `card.footer.left.counter` all carry a counter) reference the same payload schema in `$defs.payloads`."
|
|
23
27
|
},
|
|
24
28
|
"Severity": {
|
|
25
29
|
"type": "string",
|
|
26
30
|
"enum": ["info", "warn", "success", "danger"],
|
|
27
|
-
"description": "Closed severity palette aligned with PrimeNG `<p-tag>` / `<p-message>` severities. Used by
|
|
31
|
+
"description": "Closed severity palette aligned with PrimeNG `<p-tag>` / `<p-message>` severities. Used by counter, tag, alert, and icon slots for color/contrast hints. The UI maps each severity to a theme-aware tint; plugins do not pick raw colors."
|
|
28
32
|
},
|
|
29
33
|
"IconString": {
|
|
30
34
|
"type": "string",
|
|
@@ -35,13 +39,13 @@
|
|
|
35
39
|
"IViewContribution": {
|
|
36
40
|
"type": "object",
|
|
37
41
|
"additionalProperties": false,
|
|
38
|
-
"required": ["
|
|
42
|
+
"required": ["slot"],
|
|
39
43
|
"properties": {
|
|
40
|
-
"
|
|
44
|
+
"slot": { "$ref": "#/$defs/SlotName" },
|
|
41
45
|
"label": {
|
|
42
46
|
"type": "string",
|
|
43
47
|
"maxLength": 64,
|
|
44
|
-
"description": "Short human-readable label. Used as metadata (docs / plugin-doctor / aria-label) and, for some
|
|
48
|
+
"description": "Short human-readable label. Used as metadata (docs / plugin-doctor / aria-label) and, for some slots, rendered in the chip / panel header / table label. English-only per AGENTS.md (`Externalized texts, not internationalized`). Per-slot notes specify whether it is rendered inline; counter slots keep it as metadata only."
|
|
45
49
|
},
|
|
46
50
|
"tooltip": {
|
|
47
51
|
"type": "string",
|
|
@@ -52,12 +56,12 @@
|
|
|
52
56
|
"emptyText": {
|
|
53
57
|
"type": "string",
|
|
54
58
|
"maxLength": 128,
|
|
55
|
-
"description": "Text shown in the empty placeholder when the
|
|
59
|
+
"description": "Text shown in the empty placeholder when the slot permits an empty payload. Defaults to a UI-supplied generic 'No data.' string. English-only."
|
|
56
60
|
},
|
|
57
61
|
"emitWhenEmpty": {
|
|
58
62
|
"type": "boolean",
|
|
59
63
|
"default": false,
|
|
60
|
-
"description": "When false (default), the kernel drops emissions whose payload is structurally empty (zero counter value, empty array, empty tree, etc.) so the slot stays silent. When true, the renderer surfaces an empty placeholder instead. Per-
|
|
64
|
+
"description": "When false (default), the kernel drops emissions whose payload is structurally empty (zero counter value, empty array, empty tree, etc.) so the slot stays silent. When true, the renderer surfaces an empty placeholder instead. Per-slot definition of 'empty' lives in the payload schema notes."
|
|
61
65
|
},
|
|
62
66
|
"priority": {
|
|
63
67
|
"type": "number",
|
|
@@ -67,15 +71,47 @@
|
|
|
67
71
|
},
|
|
68
72
|
"allOf": [
|
|
69
73
|
{
|
|
70
|
-
"if": {
|
|
71
|
-
|
|
74
|
+
"if": {
|
|
75
|
+
"properties": {
|
|
76
|
+
"slot": {
|
|
77
|
+
"enum": [
|
|
78
|
+
"card.subtitle.left",
|
|
79
|
+
"card.footer.left.counter",
|
|
80
|
+
"card.footer.right",
|
|
81
|
+
"inspector.header.badge.counter"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"then": { "required": ["slot", "icon"] }
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"if": { "properties": { "slot": { "const": "card.title.right" } } },
|
|
90
|
+
"then": { "required": ["slot", "icon"] }
|
|
72
91
|
}
|
|
73
92
|
],
|
|
74
|
-
"description": "Manifest-side declaration of a single view contribution, keyed in `IExtensionBase.viewContributions[<contributionId>]`. The plugin author picks the
|
|
93
|
+
"description": "Manifest-side declaration of a single view contribution, keyed in `IExtensionBase.viewContributions[<contributionId>]`. The plugin author picks ONE slot from the closed `SlotName` enum; the slot fixes the renderer and the payload shape. Slots whose renderer is the counter chip require `icon` in the manifest; same for `card.title.right` (the standalone icon slot)."
|
|
75
94
|
},
|
|
76
95
|
"payloads": {
|
|
77
|
-
"description": "Per-
|
|
78
|
-
"
|
|
96
|
+
"description": "Per-slot payload schemas. The kernel validates `ctx.emitContribution(id, payload)` calls against the entry corresponding to the declared slot before persisting to `scan_contributions`. Off-shape payloads emit an `extension.error` event and drop silently (mirror of `emitLink` off-contract drop pattern). Slots that share a renderer share a payload shape; the schema is defined inline at each slot to keep lookups direct (no internal indirection).",
|
|
97
|
+
"card.title.right": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"additionalProperties": false,
|
|
100
|
+
"properties": {
|
|
101
|
+
"icon": {
|
|
102
|
+
"$ref": "#/$defs/IconString",
|
|
103
|
+
"description": "Optional payload-time icon override. When omitted the manifest-declared `icon` (which is required for this slot — see `IViewContribution.allOf`) is rendered instead. Lets a plugin emit a different icon per node without redeclaring the manifest."
|
|
104
|
+
},
|
|
105
|
+
"severity": { "$ref": "#/$defs/Severity" },
|
|
106
|
+
"tooltip": { "type": "string", "maxLength": 256 }
|
|
107
|
+
},
|
|
108
|
+
"description": "Single icon per node — small standalone marker rendered next to the card title. The manifest requires `icon`; the payload optionally overrides it per node and may add `severity` (color tint) and `tooltip`. No counts, no labels — for chip + number use a counter slot; for label + severity use a tag slot. 'Empty' for `emitWhenEmpty` is the absence of both payload `icon` and a manifest fallback (in practice never empty since the manifest icon is required)."
|
|
109
|
+
},
|
|
110
|
+
"card.subtitle.left": { "$ref": "#/$defs/payloads/_counter" },
|
|
111
|
+
"card.footer.left.counter": { "$ref": "#/$defs/payloads/_counter" },
|
|
112
|
+
"card.footer.right": { "$ref": "#/$defs/payloads/_counter" },
|
|
113
|
+
"inspector.header.badge.counter": { "$ref": "#/$defs/payloads/_counter" },
|
|
114
|
+
"_counter": {
|
|
79
115
|
"type": "object",
|
|
80
116
|
"additionalProperties": false,
|
|
81
117
|
"required": ["value"],
|
|
@@ -91,9 +127,10 @@
|
|
|
91
127
|
"description": "Optional severity for visual tinting. The slot decides whether to honour it (`SLOT_REGISTRY[slot].respectSeverity`). The plugin emits the data; the UI decides the presentation."
|
|
92
128
|
}
|
|
93
129
|
},
|
|
94
|
-
"description": "Single icon + integer pair, modelled after the `.sm-gnode__stat` rows in the card footer. Manifest requires `icon
|
|
130
|
+
"description": "Single icon + integer pair, modelled after the `.sm-gnode__stat` rows in the card footer. Manifest requires `icon` (enforced by `IViewContribution.allOf` for every counter slot); payload carries `value`, optionally `severity` and `tooltip`. The manifest `label` is metadata (docs / plugin-doctor / aria-label) and is NOT rendered inline."
|
|
95
131
|
},
|
|
96
|
-
"
|
|
132
|
+
"inspector.header.badge.tag": { "$ref": "#/$defs/payloads/_tag" },
|
|
133
|
+
"_tag": {
|
|
97
134
|
"type": "object",
|
|
98
135
|
"additionalProperties": false,
|
|
99
136
|
"required": ["label"],
|
|
@@ -108,7 +145,23 @@
|
|
|
108
145
|
"tooltip": { "type": "string", "maxLength": 256 }
|
|
109
146
|
}
|
|
110
147
|
},
|
|
111
|
-
"node
|
|
148
|
+
"graph.node.alert": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"additionalProperties": false,
|
|
151
|
+
"properties": {
|
|
152
|
+
"icon": { "$ref": "#/$defs/IconString" },
|
|
153
|
+
"severity": { "$ref": "#/$defs/Severity" },
|
|
154
|
+
"count": {
|
|
155
|
+
"type": "integer",
|
|
156
|
+
"minimum": 1,
|
|
157
|
+
"maximum": 99,
|
|
158
|
+
"description": "Optional badge count rendered next to the icon (1-99; 99+ collapses to '99+'). Omit for an icon-only marker."
|
|
159
|
+
},
|
|
160
|
+
"tooltip": { "type": "string", "maxLength": 256 }
|
|
161
|
+
},
|
|
162
|
+
"description": "Decoration on the graph node (corner badge / pin). At least one of `icon`, `severity`, `count` is required. 'Empty' for `emitWhenEmpty` is the absence of `icon` AND `count`. Hard cap 1 marker per node per plugin extension (slot config enforces)."
|
|
163
|
+
},
|
|
164
|
+
"inspector.body.panel.breakdown": {
|
|
112
165
|
"type": "object",
|
|
113
166
|
"additionalProperties": false,
|
|
114
167
|
"required": ["entries"],
|
|
@@ -130,7 +183,7 @@
|
|
|
130
183
|
}
|
|
131
184
|
}
|
|
132
185
|
},
|
|
133
|
-
"
|
|
186
|
+
"inspector.body.panel.records": {
|
|
134
187
|
"type": "object",
|
|
135
188
|
"additionalProperties": false,
|
|
136
189
|
"required": ["columns", "rows"],
|
|
@@ -168,7 +221,7 @@
|
|
|
168
221
|
}
|
|
169
222
|
}
|
|
170
223
|
},
|
|
171
|
-
"
|
|
224
|
+
"inspector.body.panel.tree": {
|
|
172
225
|
"$ref": "#/$defs/payloads/_TreeNode",
|
|
173
226
|
"description": "Recursive tree rendered as an indented hierarchy. Hard caps: max depth 6, max 200 total nodes per tree (validator enforces). 'Empty' for `emitWhenEmpty` is the root having no `children`."
|
|
174
227
|
},
|
|
@@ -186,7 +239,7 @@
|
|
|
186
239
|
}
|
|
187
240
|
}
|
|
188
241
|
},
|
|
189
|
-
"
|
|
242
|
+
"inspector.body.panel.key-values": {
|
|
190
243
|
"type": "object",
|
|
191
244
|
"additionalProperties": false,
|
|
192
245
|
"required": ["entries"],
|
|
@@ -215,7 +268,7 @@
|
|
|
215
268
|
}
|
|
216
269
|
}
|
|
217
270
|
},
|
|
218
|
-
"
|
|
271
|
+
"inspector.body.panel.link-list": {
|
|
219
272
|
"type": "object",
|
|
220
273
|
"additionalProperties": false,
|
|
221
274
|
"required": ["entries"],
|
|
@@ -232,7 +285,7 @@
|
|
|
232
285
|
"type": "string",
|
|
233
286
|
"minLength": 1,
|
|
234
287
|
"maxLength": 512,
|
|
235
|
-
"description": "Node path within the scope. Resolved by the UI to a clickable link via `Router.navigate` — never rendered as a raw `[href]` (per the renderer attr-sanitization
|
|
288
|
+
"description": "Node path within the scope. Resolved by the UI to a clickable link via `Router.navigate` — never rendered as a raw `[href]` (per the renderer attr-sanitization analyzer)."
|
|
236
289
|
},
|
|
237
290
|
"label": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
238
291
|
"kind": {
|
|
@@ -247,7 +300,7 @@
|
|
|
247
300
|
}
|
|
248
301
|
}
|
|
249
302
|
},
|
|
250
|
-
"
|
|
303
|
+
"inspector.body.panel.markdown": {
|
|
251
304
|
"type": "object",
|
|
252
305
|
"additionalProperties": false,
|
|
253
306
|
"required": ["markdown"],
|
|
@@ -259,23 +312,7 @@
|
|
|
259
312
|
}
|
|
260
313
|
}
|
|
261
314
|
},
|
|
262
|
-
"
|
|
263
|
-
"type": "object",
|
|
264
|
-
"additionalProperties": false,
|
|
265
|
-
"properties": {
|
|
266
|
-
"icon": { "$ref": "#/$defs/IconString" },
|
|
267
|
-
"severity": { "$ref": "#/$defs/Severity" },
|
|
268
|
-
"count": {
|
|
269
|
-
"type": "integer",
|
|
270
|
-
"minimum": 1,
|
|
271
|
-
"maximum": 99,
|
|
272
|
-
"description": "Optional badge count rendered next to the icon (1-99; 99+ collapses to '99+'). Omit for an icon-only marker."
|
|
273
|
-
},
|
|
274
|
-
"tooltip": { "type": "string", "maxLength": 256 }
|
|
275
|
-
},
|
|
276
|
-
"description": "Decoration on the graph node (corner badge / pin). At least one of `icon`, `severity`, `count` is required. 'Empty' for `emitWhenEmpty` is the absence of `icon` AND `count`. Hard cap 1 marker per node per plugin extension (slot config enforces)."
|
|
277
|
-
},
|
|
278
|
-
"scope-stat": {
|
|
315
|
+
"topbar.actions.indicator": {
|
|
279
316
|
"type": "object",
|
|
280
317
|
"additionalProperties": false,
|
|
281
318
|
"required": ["value"],
|
|
@@ -285,13 +322,13 @@
|
|
|
285
322
|
{ "type": "integer", "minimum": 0 },
|
|
286
323
|
{ "type": "string", "minLength": 1, "maxLength": 64 }
|
|
287
324
|
],
|
|
288
|
-
"description": "Either a non-negative integer or a short string. The UI renders it as a single chip in
|
|
325
|
+
"description": "Either a non-negative integer or a short string. The UI renders it as a single chip in the topbar."
|
|
289
326
|
},
|
|
290
327
|
"label": { "type": "string", "minLength": 1, "maxLength": 32 },
|
|
291
328
|
"tooltip": { "type": "string", "maxLength": 256 },
|
|
292
329
|
"severity": { "$ref": "#/$defs/Severity" }
|
|
293
330
|
},
|
|
294
|
-
"description": "Single value summarizing the entire scope. Emitted ONCE per scan (not per node). Plugins use `ctx.emitScopeContribution(...)` (
|
|
331
|
+
"description": "Single value summarizing the entire scope. Emitted ONCE per scan (not per node). Plugins use `ctx.emitScopeContribution(...)` (analyzer context) — extractors do not see `emitScopeContribution`."
|
|
295
332
|
}
|
|
296
333
|
}
|
|
297
334
|
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://skill-map.dev/spec/v0/extensions/rule.schema.json",
|
|
4
|
-
"title": "ExtensionRule",
|
|
5
|
-
"description": "Manifest shape for a `Rule` extension. A rule consumes the full graph (nodes + links) after all extractors have run and emits `Issue[]`. Rules are dual-mode: `deterministic` rules MUST be byte-for-byte reproducible (same graph in → same issues out; time, random, and network are forbidden) and run synchronously inside `sm check` / `sm scan`. `probabilistic` rules invoke an LLM through the kernel's `RunnerPort` and execute only as queued jobs (`sm job submit rule:<id>`); their output MAY vary across runs and they NEVER participate in `sm scan`. See `architecture.md` §Execution modes for the full contract.",
|
|
6
|
-
"allOf": [
|
|
7
|
-
{ "$ref": "base.schema.json" }
|
|
8
|
-
],
|
|
9
|
-
"type": "object",
|
|
10
|
-
"required": ["id", "kind", "version", "emitsRuleIds", "defaultSeverity"],
|
|
11
|
-
"unevaluatedProperties": false,
|
|
12
|
-
"properties": {
|
|
13
|
-
"kind": { "const": "rule" },
|
|
14
|
-
"mode": {
|
|
15
|
-
"type": "string",
|
|
16
|
-
"enum": ["deterministic", "probabilistic"],
|
|
17
|
-
"default": "deterministic",
|
|
18
|
-
"description": "`deterministic` (default): pure code, byte-for-byte reproducible, runs during `sm check` and `sm scan`. `probabilistic`: invokes an LLM via `ctx.runner` and runs only as a queued job; never participates in scan-time pipelines. The kernel rejects probabilistic rules that try to register scan-time hooks at load time. Omitting the field is equivalent to declaring `deterministic`."
|
|
19
|
-
},
|
|
20
|
-
"emitsRuleIds": {
|
|
21
|
-
"type": "array",
|
|
22
|
-
"description": "List of `rule_id` values this rule may emit on issues. Typically a singleton (`trigger-collision` → emits `trigger-collision`). A rule emitting a `rule_id` not in this list → kernel logs `rule-id-violation` but keeps the issue (forward compatibility).",
|
|
23
|
-
"minItems": 1,
|
|
24
|
-
"items": { "type": "string" }
|
|
25
|
-
},
|
|
26
|
-
"defaultSeverity": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"enum": ["error", "warn", "info"],
|
|
29
|
-
"description": "Severity attached by default to emitted issues. Rules MAY override per-issue."
|
|
30
|
-
},
|
|
31
|
-
"consumes": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"enum": ["nodes", "links", "both"],
|
|
34
|
-
"default": "both",
|
|
35
|
-
"description": "Which slices of the graph the rule reads. The kernel MAY pass a restricted view when this is a strict subset."
|
|
36
|
-
},
|
|
37
|
-
"configurable": {
|
|
38
|
-
"type": "boolean",
|
|
39
|
-
"default": false,
|
|
40
|
-
"description": "If true, the rule reads its own config from `config_preferences` under the key `rules.<id>.<field>`. Implementations MAY surface these in `sm config`."
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|