@skill-map/spec 0.1.1 → 0.2.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # Spec changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 79aed4d: **Breaking**: rename `dispatch-lifecycle.md` → `job-lifecycle.md`.
8
+
9
+ ROADMAP decision #30 renamed the domain term "dispatch" to "job" (tables `state_jobs`, artifact "job file"). The spec prose filename had lagged behind; this change closes that gap.
10
+
11
+ All internal references updated: `architecture.md`, `cli-contract.md`, `db-schema.md`, `prompt-preamble.md`, `versioning.md`, `schemas/job.schema.json`, `README.md`, and `package.json` `files` list. `index.json` regenerated.
12
+
13
+ **Migration**: any external consumer that links to `spec/dispatch-lifecycle.md` (by URL or filename) MUST update to `spec/job-lifecycle.md`. The canonical URL becomes `https://skill-map.dev/spec/v0/job-lifecycle.md`.
14
+
15
+ Classification: breaking change on a normative prose doc. Per `versioning.md` §Pre-1.0, minor bumps MAY contain breaking changes while the spec is `0.Y.Z`.
16
+
17
+ ## 0.1.2
18
+
19
+ ### Patch Changes
20
+
21
+ - f4214fe: Expand `spec/README.md` §Distribution with concrete install and usage snippets now that `@skill-map/spec` is live on npm: install command, loading a schema via `exports`, and a small integrity-verification example using the `index.json` sha256 block.
22
+
3
23
  ## 0.1.1
4
24
 
5
25
  ### Patch Changes
package/README.md CHANGED
@@ -10,7 +10,7 @@ This document is the **source of truth**. The reference implementation under `..
10
10
  - The **extension contract**: six extension kinds (detector, adapter, rule, action, audit, renderer) with their input/output shapes.
11
11
  - The **CLI contract**: verb set, flags, exit codes, JSON introspection.
12
12
  - The **persistence contract**: table catalog owned by the kernel, plugin key-value API.
13
- - The **job contract**: lifecycle states, event stream, prompt preamble, dispatch semantics.
13
+ - The **job contract**: lifecycle states, event stream, prompt preamble, submit/claim/record semantics.
14
14
  - The **frontmatter standard**: base fields and per-kind extensions.
15
15
  - The **summary standard**: shape of action-produced summaries per kind.
16
16
  - The **plugin manifest**: metadata, spec-compat range, storage mode, security declarations.
@@ -47,7 +47,7 @@ spec/
47
47
  ├── prompt-preamble.md ← canonical injection-mitigation preamble (Step 0a phase 3)
48
48
  ├── db-schema.md ← table catalog (kernel-owned) (Step 0a phase 3)
49
49
  ├── plugin-kv-api.md ← ctx.store contract for storage mode A (Step 0a phase 3)
50
- ├── dispatch-lifecycle.md ← queued → running → completed | failed (Step 0a phase 3)
50
+ ├── job-lifecycle.md ← queued → running → completed | failed (Step 0a phase 3)
51
51
  ├── schemas/ ← JSON Schemas (Step 0a phase 2)
52
52
  │ ├── node.schema.json
53
53
  │ ├── link.schema.json
@@ -84,7 +84,7 @@ spec/
84
84
  - **Building a custom detector, rule, or renderer?** Read `architecture.md`, then the relevant schema.
85
85
  - **Building an alternative CLI implementation?** Read `cli-contract.md` and run `conformance/`.
86
86
  - **Integrating a new platform (adapter)?** Read `architecture.md` §adapters, then the Claude adapter source in `../src/extensions/adapters/claude/` as a worked example.
87
- - **Shipping a job-running runner?** Read `job-events.md`, `dispatch-lifecycle.md`, `prompt-preamble.md`.
87
+ - **Shipping a job-running runner?** Read `job-events.md`, `job-lifecycle.md`, `prompt-preamble.md`.
88
88
 
89
89
  ## Relationship to the reference implementation
90
90
 
@@ -96,9 +96,44 @@ When spec and reference impl disagree, the spec wins. File an issue; one of them
96
96
 
97
97
  ## Distribution
98
98
 
99
- - This directory is published to npm as `@skill-map/spec`.
100
- - Schemas are also published to JSON Schema Store when the domain is live.
101
- - Canonical URLs (stable across versions) land with Step 13.
99
+ Published to npm as [`@skill-map/spec`](https://www.npmjs.com/package/@skill-map/spec).
100
+
101
+ ### Install
102
+
103
+ ```bash
104
+ npm i @skill-map/spec
105
+ ```
106
+
107
+ ### Use — load a schema
108
+
109
+ ```js
110
+ import specIndex from '@skill-map/spec';
111
+ import nodeSchema from '@skill-map/spec/schemas/node.schema.json' with { type: 'json' };
112
+
113
+ console.log(specIndex.specVersion); // → "0.0.1" (payload version, tracks file shape)
114
+ console.log(specIndex.integrity.algorithm); // → "sha256"
115
+ console.log(nodeSchema.$id); // → "https://skill-map.dev/spec/v0/node.schema.json"
116
+ ```
117
+
118
+ Every JSON Schema is exported individually via `@skill-map/spec/schemas/*.json`. Prose documents ship in the tarball for reference but are not `exports`-surfaced.
119
+
120
+ ### Verify integrity
121
+
122
+ The package ships `index.json` with a sha256 per file. To verify a local installation matches what was published:
123
+
124
+ ```js
125
+ import { readFileSync } from 'node:fs';
126
+ import { createHash } from 'node:crypto';
127
+ import index from '@skill-map/spec';
128
+
129
+ const file = 'schemas/node.schema.json';
130
+ const actual = createHash('sha256').update(readFileSync(`node_modules/@skill-map/spec/${file}`)).digest('hex');
131
+ console.log(actual === index.integrity.files[file] ? 'ok' : 'drift');
132
+ ```
133
+
134
+ ### JSON Schema Store
135
+
136
+ The schemas will be registered on JSON Schema Store once the canonical URLs under `skill-map.dev/spec/v0/` are stable (Step 13).
102
137
 
103
138
  ## License
104
139
 
package/architecture.md CHANGED
@@ -47,7 +47,7 @@ An implementation MUST expose these five ports. Each is an interface (TypeScript
47
47
 
48
48
  Persistence for all kernel tables in all three zones (`scan_*`, `state_*`, `config_*`). Exposes typed repositories, not raw SQL. Implementations MAY back this with SQLite, Postgres, in-memory, or anything else, as long as:
49
49
 
50
- - Transactional semantics for atomic claim (see `dispatch-lifecycle.md`).
50
+ - Transactional semantics for atomic claim (see `job-lifecycle.md`).
51
51
  - Migration application with `PRAGMA user_version`-equivalent tracking.
52
52
  - Read isolation sufficient to avoid phantom reads across a single scan write.
53
53
 
@@ -77,7 +77,7 @@ Two reference implementations:
77
77
  - `ClaudeCliRunner` — subprocess `claude -p < jobfile`.
78
78
  - `MockRunner` — deterministic fake for tests.
79
79
 
80
- The Skill runner does NOT implement this port: it runs inside an agent session and closes jobs via `sm record` callback. See `dispatch-lifecycle.md`.
80
+ The Skill runner does NOT implement this port: it runs inside an agent session and closes jobs via `sm record` callback. See `job-lifecycle.md`.
81
81
 
82
82
  ### `ProgressEmitterPort`
83
83
 
package/cli-contract.md CHANGED
@@ -186,7 +186,7 @@ Actions are not invoked via `sm actions`; invocation is via `sm job submit` (see
186
186
 
187
187
  ### Jobs
188
188
 
189
- See `dispatch-lifecycle.md` for the state machine; this table is the CLI surface.
189
+ See `job-lifecycle.md` for the state machine; this table is the CLI surface.
190
190
 
191
191
  | Command | Purpose |
192
192
  |---|---|
package/db-schema.md CHANGED
@@ -4,7 +4,7 @@ Normative catalog of tables owned by the kernel. Plugins MAY add their own table
4
4
 
5
5
  The spec assumes a relational, SQL-like store but is **engine-agnostic**. The reference implementation uses SQLite (`node:sqlite`) + Kysely + `CamelCasePlugin`. Alternative backends (Postgres, DuckDB, in-memory) are permitted as long as:
6
6
 
7
- - Atomic single-statement transitions are available for the job claim (see `dispatch-lifecycle.md`).
7
+ - Atomic single-statement transitions are available for the job claim (see `job-lifecycle.md`).
8
8
  - Migrations track applied versions per scope.
9
9
  - Read isolation avoids phantom reads inside a single scan write.
10
10
 
package/index.json CHANGED
@@ -116,8 +116,8 @@
116
116
  "title": "CLI contract"
117
117
  },
118
118
  {
119
- "file": "dispatch-lifecycle.md",
120
- "title": "Dispatch lifecycle"
119
+ "file": "job-lifecycle.md",
120
+ "title": "Job lifecycle"
121
121
  },
122
122
  {
123
123
  "file": "job-events.md",
@@ -159,10 +159,10 @@
159
159
  "integrity": {
160
160
  "algorithm": "sha256",
161
161
  "files": {
162
- "CHANGELOG.md": "d545e5baffe09ddcb454f8dde36ad9226a6dca05ed8108a1ea2231935d7489f1",
163
- "README.md": "d2b4c6debb9b7c4fdd34488e237672d8aff7687715744cf2c455977d5bc9813d",
164
- "architecture.md": "fdb1ed50f12bf7b7fb89663c651277b7ba5ed729bd3dc02f3963c51e4d480b12",
165
- "cli-contract.md": "ddb7d62f45398866dba2f25da544f8376d76582170712cb5a0010bb826ffb46a",
162
+ "CHANGELOG.md": "88908b684eabb5f508d6fe65a49e0786d1789ca9c8d2eb4195103c837ece1160",
163
+ "README.md": "7737242efe28e82b7ba4e2324e0ff6917a42e84c5bde9b940e409c8282d573eb",
164
+ "architecture.md": "6c25d25eabee7473fa25aa7884f1d3e3e8bed70eda3d688f7755ae9d5d4b0fd1",
165
+ "cli-contract.md": "321f625a9fbfdccf16f226dc76ca158bfb3392da5f96fc7b8faab4aa952a284a",
166
166
  "conformance/README.md": "4e41ff823b55ce3c274a033c5152ae0b2759fc714a714d7815593d8be84c8a4c",
167
167
  "conformance/cases/basic-scan.json": "24623da0cad8c8c54b3ff9b09820ea1276fe8b8f0fc680bf6e8abeb4edb8e424",
168
168
  "conformance/cases/kernel-empty-boot.json": "175524674b14d993d29f10080d7697074b3a2eee25b359ff903344d73c6acc98",
@@ -172,12 +172,12 @@
172
172
  "conformance/fixtures/minimal-claude/notes/architecture.md": "5a7e6fdbb1556733dacebad63758057dc1e19090b5a983292c0c65e90b98bcf1",
173
173
  "conformance/fixtures/minimal-claude/skills/hello.md": "8598074020430f294ff1eac39876302448f004b6c48446d453092159319bcbee",
174
174
  "conformance/fixtures/preamble-v1.txt": "1e0aeef224b64477bdc13a949c3ad402e68249caf499ecdba1302371677c068b",
175
- "db-schema.md": "490e539f771fb9781fc97afef4f16d86b19eb9ecd9080eca9fcb8bc9605ae0a4",
176
- "dispatch-lifecycle.md": "e2367bb51c638a9fbb20eec35c0603b2c4adb3668add50fec7be676521798f16",
175
+ "db-schema.md": "d2dfd52c2bc2a6b00ec6c89acc09240b409a6cfe29a06394351e6de5bc1de651",
177
176
  "interfaces/security-scanner.md": "468f8ee412594b14b389c36cefa9ca75a5dec652adbf03ab8bbc7f57ca980253",
178
177
  "job-events.md": "947d2124acc29f78df8f493549f0d1bdff8159caf621fe8307423c90d7d05f58",
178
+ "job-lifecycle.md": "ef3e96357784088e253c5b47ea4e1d4b04a5fdd1b3efb7ab55d70d006ed7e09f",
179
179
  "plugin-kv-api.md": "fb7cbaea6e18ad696e108fd6ec7a118dc9be6ffef4cf08cc92e511feafa9be30",
180
- "prompt-preamble.md": "12f7489b5d9886070cfa43cf1f3871b46f2b478f3ead0db292f13e46239b417b",
180
+ "prompt-preamble.md": "9b7478ddce0a77043983f35932677d702319348048fe5d6b1c60257bd1c9f605",
181
181
  "schemas/conformance-case.schema.json": "2740874e00269de6d8121300339401d0283197b6d97dcd77538ec5d108b14de2",
182
182
  "schemas/execution-record.schema.json": "ec0f3acf1d0ce099c059d73eb434936bfd1bcf12023693bd572efb2a7352faa6",
183
183
  "schemas/frontmatter/agent.schema.json": "3c7ff5e485c1edd40d643ba0e0669fb920a511dfc174b91caff63473585b993d",
@@ -187,7 +187,7 @@
187
187
  "schemas/frontmatter/note.schema.json": "9806b371193c802803638682f9a625f8277152ad3ef68939eb5f05fff2ef65f4",
188
188
  "schemas/frontmatter/skill.schema.json": "b99b8ab23bee01333b4a04946cd9fc13d373d827ef6ddfc7d058daf637f2f80b",
189
189
  "schemas/issue.schema.json": "40f6f8abadcce0fd8eac9df27ffcc20b2fc9fda6970142ddb8e7e56b1760b9b1",
190
- "schemas/job.schema.json": "6e6e791b63cf72591a5a9c72f469b803a69d9bdb6687d780d797ee1f47f8b9f4",
190
+ "schemas/job.schema.json": "582999899f8846f70c4d745d2813e53b97a4f5ccd3d8d163eeb68b201e7124e4",
191
191
  "schemas/link.schema.json": "3e92f5c9def61a857a2c7b22846d82b988157de083463615144ddc92403a489e",
192
192
  "schemas/node.schema.json": "14f345fac450f5728c895d1b878e0015eabb9d72ba9da4a8d2236c82933d3fcf",
193
193
  "schemas/plugins-registry.schema.json": "69388548a51496f2597145154911a208bef12d5c805ed71901e236525dccadf9",
@@ -199,7 +199,7 @@
199
199
  "schemas/summaries/hook.schema.json": "36f876f3b1a60d45be97a0848c79fd18744b434dfdcefc366f033b253d56268c",
200
200
  "schemas/summaries/note.schema.json": "ae510f3ee1b6092c1061625e425c9bb7de9c9caa3f3774770c148f658d505753",
201
201
  "schemas/summaries/skill.schema.json": "f01bab92c51d64ee23e61587e42cf0dc5b37a2f518f5b12b3d1d456390338aa8",
202
- "versioning.md": "c526fb0068672016411a6660fe4a0ec5ef78086da96ba5e8277ce4e6adfec4bc"
202
+ "versioning.md": "37e42e323d0bfed647b72a3bd4ffc1ddd3f71b74dda1ba56025762518f070ccb"
203
203
  }
204
204
  }
205
205
  }
@@ -1,4 +1,4 @@
1
- # Dispatch lifecycle
1
+ # Job lifecycle
2
2
 
3
3
  Normative state machine for jobs. A `Job` (see `schemas/job.schema.json`) is the runtime instance of an `Action` applied to one or more `Node`s. Every job moves through this lifecycle exactly once.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skill-map/spec",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "JSON Schemas, prose contracts, and conformance suite for the skill-map specification.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "versioning.md",
34
34
  "architecture.md",
35
35
  "cli-contract.md",
36
- "dispatch-lifecycle.md",
36
+ "job-lifecycle.md",
37
37
  "job-events.md",
38
38
  "prompt-preamble.md",
39
39
  "db-schema.md",
@@ -102,7 +102,7 @@ The preamble establishes a promise from the model:
102
102
  - `safety` MUST conform to `schemas/report-base.schema.json#/properties/safety`.
103
103
  - `confidence` MUST be a number in `[0.0, 1.0]`.
104
104
 
105
- The kernel validates every report against the action's declared schema (which MUST extend `report-base.schema.json`). A report that lacks `safety` or `confidence`, or whose values are of the wrong shape, is rejected; the job transitions to `failed` with reason `report-invalid` (see `dispatch-lifecycle.md`).
105
+ The kernel validates every report against the action's declared schema (which MUST extend `report-base.schema.json`). A report that lacks `safety` or `confidence`, or whose values are of the wrong shape, is rejected; the job transitions to `failed` with reason `report-invalid` (see `job-lifecycle.md`).
106
106
 
107
107
  Implementations MUST NOT tolerate the absence of `safety`. If a model returns a report without it, the failure is the runner's problem to surface, not the kernel's to tolerate.
108
108
 
@@ -40,7 +40,7 @@
40
40
  "status": {
41
41
  "type": "string",
42
42
  "enum": ["queued", "running", "completed", "failed"],
43
- "description": "Lifecycle state. See `dispatch-lifecycle.md` for allowed transitions."
43
+ "description": "Lifecycle state. See `job-lifecycle.md` for allowed transitions."
44
44
  },
45
45
  "failureReason": {
46
46
  "type": ["string", "null"],
package/versioning.md CHANGED
@@ -28,7 +28,7 @@ Rule of thumb: if a strict v1 implementation could fail a v1.X conformance run,
28
28
  All of the following are normative and governed by this policy:
29
29
 
30
30
  - Every JSON Schema in `schemas/` (fields, types, required, enums, defaults, `additionalProperties`).
31
- - Every MUST / SHOULD / MAY statement in prose documents (`architecture.md`, `cli-contract.md`, `job-events.md`, `prompt-preamble.md`, `db-schema.md`, `plugin-kv-api.md`, `dispatch-lifecycle.md`).
31
+ - Every MUST / SHOULD / MAY statement in prose documents (`architecture.md`, `cli-contract.md`, `job-events.md`, `prompt-preamble.md`, `db-schema.md`, `plugin-kv-api.md`, `job-lifecycle.md`).
32
32
  - Exit codes, verb names, required flags, canonical error messages marked "normative".
33
33
  - Conformance fixtures and cases — removing or tightening a case is major.
34
34