@kungfu-tech/kfd 1.0.0-alpha.1 → 1.0.0-alpha.3

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/README.md CHANGED
@@ -113,6 +113,23 @@ e.g. `https://kfd.libkungfu.dev/1`). This repository publishes
113
113
  `@kungfu-tech/kfd` — the decision texts plus a machine-readable
114
114
  `registry.json` — which the site consumes as its single fact source.
115
115
 
116
+ Machine consumers that need KFD-owned standard identity should read
117
+ `standards.json`. It is the versioned metadata surface for stable standard
118
+ keys, document routes, schema IDs, and KFD-owned concept names. In Node or
119
+ TypeScript projects, import it as:
120
+
121
+ ```js
122
+ import standards from "@kungfu-tech/kfd/standards.json" with { type: "json" };
123
+ ```
124
+
125
+ KFD-3 also publishes a general collaboration-interface schema and witness
126
+ schema under `schemas/kfd-3/`. These schemas are for participant-facing product
127
+ interfaces, not only agent APIs. A product such as Kungfu may implement an
128
+ agent-first profile, but that profile remains a product-specific realization of
129
+ KFD-3. The KFD-owned boundary is the standard vocabulary, schema IDs, and
130
+ closed-world evidence shape. See
131
+ [`docs/kfd-3-collaboration-interface.md`](docs/kfd-3-collaboration-interface.md).
132
+
116
133
  ## Current decisions
117
134
 
118
135
  | ID | Kind | Title | Status |
@@ -137,6 +154,9 @@ reference KFDs; KFDs never depend on repository internals.
137
154
  ```text
138
155
  decisions/ one markdown file per decision (kfd-N.md)
139
156
  registry.json machine-readable index (schemaVersion 1, contract kfd-registry)
157
+ standards.json machine-readable KFD standard metadata (schemaVersion 1,
158
+ contract kfd-standards-metadata)
159
+ schemas/ JSON schemas for package metadata and KFD-owned schema IDs
140
160
  site/ machine-readable site bundle for kfd.libkungfu.dev renderers
141
161
  release-impact.json
142
162
  Buildchain surface-aware impact ledger for production release passports
@@ -144,11 +164,12 @@ scripts/ conformance check: registry and documents must agree
144
164
  ```
145
165
 
146
166
  `node scripts/check.mjs` (also `pnpm run check`) verifies numbering
147
- uniqueness, registry/document agreement, status validity, and the release
148
- impact ledger required by Buildchain production release passports. Releases are
149
- governed by Buildchain; this package versions itself under KFD-1's own rules:
150
- the outer package line remains `v1.0`, while patch and prerelease numbers are
151
- advanced by Buildchain release promotion.
167
+ uniqueness, registry/document agreement, standards metadata/schema agreement,
168
+ status validity, and the release impact ledger required by Buildchain
169
+ production release passports. Releases are governed by Buildchain; this package
170
+ versions itself under KFD-1's own rules: the outer package line remains `v1.0`,
171
+ while patch and prerelease numbers are advanced by Buildchain release
172
+ promotion.
152
173
 
153
174
  ## Release impact ledger
154
175
 
package/docs/MAP.md CHANGED
@@ -8,7 +8,10 @@
8
8
  | What should a site renderer consume to render `kfd.libkungfu.dev`? | [`../site/kfd-site.json`](../site/kfd-site.json) |
9
9
  | What is the top-level product accountability principle? | [KFD-2](../decisions/kfd-2.md) |
10
10
  | What stance should products take toward humans and agents as reasoning participants? | [KFD-3](../decisions/kfd-3.md) |
11
+ | What schema should products use for KFD-3 participant-facing collaboration interfaces? | [`kfd-3-collaboration-interface.md`](kfd-3-collaboration-interface.md) |
11
12
  | What does a specific decision say? | [`../decisions/`](../decisions) (index: [`../registry.json`](../registry.json)) |
13
+ | What machine metadata should Buildchain or another consumer import for KFD standard identity and schema IDs? | [`../standards.json`](../standards.json) |
14
+ | What schema validates the standards metadata surface? | [`../schemas/kfd-standards.schema.json`](../schemas/kfd-standards.schema.json) |
12
15
  | How do I cite a decision? | [`../README.md`](../README.md) — cite by number, e.g. `KFD-1` |
13
16
  | How do decisions change over time? | [`../CONTRIBUTING.md`](../CONTRIBUTING.md) — append-only; explicit supersession mints a new number |
14
17
  | How is this package versioned and released? | [KFD-1](../decisions/kfd-1.md) applied to itself; Buildchain governs releases |
@@ -0,0 +1,59 @@
1
+ # KFD-3 Collaboration Interface
2
+
3
+ KFD-3 is a cooperation standard for intelligent participants. It is not an
4
+ agent-only standard. Products can use it for humans, agents, operators,
5
+ extension authors, API consumers, hosted-service users, service integrators,
6
+ maintainers, and other participants who need to understand value, choices, and
7
+ constraints before cooperating.
8
+
9
+ The KFD-owned schema surface is intentionally general:
10
+
11
+ - `schemas/kfd-3/collaboration-interface.schema.json` declares a product's
12
+ participant-facing collaboration interface.
13
+ - `schemas/kfd-3/witness.schema.json` declares release or build evidence that
14
+ the interface is discoverable, classified, constraint-transparent, and closed
15
+ over reachable participant-facing entrypoints.
16
+
17
+ KFD owns the standard identity, schema IDs, concept names, and compatibility
18
+ rules. Product repositories own their concrete profiles. For example, Kungfu
19
+ may expose an agent-first profile because agents are a first-class participant
20
+ in the current product, but that profile remains a Kungfu implementation of
21
+ KFD-3 rather than the definition of KFD-3 itself.
22
+
23
+ ## Required shape
24
+
25
+ A product collaboration interface should identify:
26
+
27
+ - participant profiles, such as `human`, `agent`, `operator`,
28
+ `extension-author`, or `api-consumer`;
29
+ - minimal entrypoints that let each participant discover the rest of the
30
+ interface;
31
+ - participant-visible surfaces, such as CLI commands, JSON APIs, manuals,
32
+ skills, GUI routes, envelopes, packages, or protocols;
33
+ - visible constraints, including what is restricted, why, and where review or
34
+ escalation happens;
35
+ - choice paths that let participants choose or decline safe cooperation modes;
36
+ - a closure policy for reachable participant-facing entrypoints.
37
+
38
+ The KFD-3 witness schema is intentionally stricter about closure: a passing
39
+ closed-world proof reports reachable entrypoints, classified entrypoints, and
40
+ an empty `unclassifiedEntrypoints` list. This prevents a product from exposing
41
+ a participant-facing or callable backdoor API outside the declared interface.
42
+
43
+ ## Product profile boundary
44
+
45
+ Concrete product profiles may add their own contracts, registry fields, command
46
+ metadata, generated manuals, or audit output. Those fields should reference the
47
+ KFD-3 schema IDs from `standards.json` instead of copying KFD-owned terms.
48
+
49
+ Examples:
50
+
51
+ - A Kungfu agent-first bridge can map local commands, provider skills, command
52
+ metadata, and operating manuals into a KFD-3 collaboration interface.
53
+ - A Buildchain release passport can carry a KFD-3 witness once a downstream
54
+ product can freeze and verify the concrete interface artifact.
55
+ - A hosted surface can use the same standard to show where policy constraints,
56
+ permission gates, and user choices are visible before cooperation is
57
+ requested.
58
+
59
+ This keeps KFD-3 general while making real product interfaces testable.
package/package.json CHANGED
@@ -1,15 +1,28 @@
1
1
  {
2
2
  "name": "@kungfu-tech/kfd",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "Kung Fu Decisions (KFD): the kungfu-systems organization-wide decision registry, as a consumable artifact",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "README.md",
8
8
  "decisions",
9
9
  "registry.json",
10
+ "standards.json",
11
+ "schemas",
10
12
  "site",
11
13
  "docs"
12
14
  ],
15
+ "exports": {
16
+ "./package.json": "./package.json",
17
+ "./README.md": "./README.md",
18
+ "./registry.json": "./registry.json",
19
+ "./standards.json": "./standards.json",
20
+ "./site/kfd-site.json": "./site/kfd-site.json",
21
+ "./schemas/*.json": "./schemas/*.json",
22
+ "./schemas/*/*.json": "./schemas/*/*.json",
23
+ "./decisions/*.md": "./decisions/*.md",
24
+ "./docs/*": "./docs/*"
25
+ },
13
26
  "scripts": {
14
27
  "check": "node scripts/check.mjs"
15
28
  },
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kfd.libkungfu.dev/schemas/kfd-1/contract-world.schema.json",
4
+ "title": "KFD-1 contract world",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "contract",
9
+ "standard",
10
+ "factSource",
11
+ "surfaces"
12
+ ],
13
+ "properties": {
14
+ "schemaVersion": {
15
+ "const": 1
16
+ },
17
+ "contract": {
18
+ "const": "kfd-1-contract-world"
19
+ },
20
+ "standard": {
21
+ "const": "kfd-1"
22
+ },
23
+ "factSource": {
24
+ "type": "string",
25
+ "minLength": 1
26
+ },
27
+ "surfaces": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "required": [
32
+ "id",
33
+ "class",
34
+ "description"
35
+ ],
36
+ "properties": {
37
+ "id": {
38
+ "type": "string",
39
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
40
+ },
41
+ "class": {
42
+ "enum": [
43
+ "integration-time",
44
+ "cross-time"
45
+ ]
46
+ },
47
+ "description": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ }
51
+ },
52
+ "additionalProperties": false
53
+ }
54
+ }
55
+ },
56
+ "additionalProperties": true
57
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kfd.libkungfu.dev/schemas/kfd-1/witness.schema.json",
4
+ "title": "KFD-1 witness",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "contract",
9
+ "standard",
10
+ "contractWorld",
11
+ "evidence"
12
+ ],
13
+ "properties": {
14
+ "schemaVersion": {
15
+ "const": 1
16
+ },
17
+ "contract": {
18
+ "const": "kfd-1-witness"
19
+ },
20
+ "standard": {
21
+ "const": "kfd-1"
22
+ },
23
+ "contractWorld": {
24
+ "type": "object",
25
+ "required": [
26
+ "schemaId",
27
+ "digest"
28
+ ],
29
+ "properties": {
30
+ "schemaId": {
31
+ "const": "https://kfd.libkungfu.dev/schemas/kfd-1/contract-world.schema.json"
32
+ },
33
+ "digest": {
34
+ "type": "string",
35
+ "minLength": 1
36
+ }
37
+ },
38
+ "additionalProperties": false
39
+ },
40
+ "evidence": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "object",
44
+ "required": [
45
+ "kind",
46
+ "path"
47
+ ],
48
+ "properties": {
49
+ "kind": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ },
53
+ "path": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ }
57
+ },
58
+ "additionalProperties": true
59
+ }
60
+ }
61
+ },
62
+ "additionalProperties": true
63
+ }
@@ -0,0 +1,348 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kfd.libkungfu.dev/schemas/kfd-3/collaboration-interface.schema.json",
4
+ "title": "KFD-3 collaboration interface",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "contract",
9
+ "standard",
10
+ "product",
11
+ "sourceRegistry",
12
+ "participants",
13
+ "minimalEntrypoints",
14
+ "surfaces",
15
+ "transparentConstraints",
16
+ "choicePaths",
17
+ "closure"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": {
21
+ "const": 1
22
+ },
23
+ "contract": {
24
+ "const": "kfd-3-collaboration-interface"
25
+ },
26
+ "standard": {
27
+ "const": "kfd-3"
28
+ },
29
+ "product": {
30
+ "type": "object",
31
+ "required": [
32
+ "name",
33
+ "version"
34
+ ],
35
+ "properties": {
36
+ "name": {
37
+ "type": "string",
38
+ "minLength": 1
39
+ },
40
+ "version": {
41
+ "type": "string",
42
+ "minLength": 1
43
+ },
44
+ "repository": {
45
+ "type": "string",
46
+ "minLength": 1
47
+ }
48
+ },
49
+ "additionalProperties": true
50
+ },
51
+ "sourceRegistry": {
52
+ "$ref": "#/$defs/artifactPointer"
53
+ },
54
+ "participants": {
55
+ "type": "array",
56
+ "minItems": 1,
57
+ "items": {
58
+ "$ref": "#/$defs/participant"
59
+ }
60
+ },
61
+ "minimalEntrypoints": {
62
+ "type": "array",
63
+ "minItems": 1,
64
+ "items": {
65
+ "$ref": "#/$defs/entrypoint"
66
+ }
67
+ },
68
+ "surfaces": {
69
+ "type": "array",
70
+ "minItems": 1,
71
+ "items": {
72
+ "$ref": "#/$defs/surface"
73
+ }
74
+ },
75
+ "transparentConstraints": {
76
+ "type": "array",
77
+ "items": {
78
+ "$ref": "#/$defs/transparentConstraint"
79
+ }
80
+ },
81
+ "choicePaths": {
82
+ "type": "array",
83
+ "items": {
84
+ "$ref": "#/$defs/choicePath"
85
+ }
86
+ },
87
+ "closure": {
88
+ "type": "object",
89
+ "required": [
90
+ "classificationMode",
91
+ "unclassifiedEntrypointsPolicy"
92
+ ],
93
+ "properties": {
94
+ "classificationMode": {
95
+ "enum": [
96
+ "closed-world",
97
+ "declared-open"
98
+ ]
99
+ },
100
+ "unclassifiedEntrypointsPolicy": {
101
+ "enum": [
102
+ "fail",
103
+ "warn",
104
+ "documented-open"
105
+ ]
106
+ },
107
+ "reachableSurfaceSource": {
108
+ "type": "string",
109
+ "minLength": 1
110
+ }
111
+ },
112
+ "additionalProperties": true
113
+ }
114
+ },
115
+ "additionalProperties": true,
116
+ "$defs": {
117
+ "artifactPointer": {
118
+ "type": "object",
119
+ "required": [
120
+ "path"
121
+ ],
122
+ "properties": {
123
+ "path": {
124
+ "type": "string",
125
+ "minLength": 1
126
+ },
127
+ "schemaId": {
128
+ "type": "string",
129
+ "format": "uri"
130
+ },
131
+ "sha256": {
132
+ "type": "string",
133
+ "pattern": "^[0-9a-f]{64}$"
134
+ }
135
+ },
136
+ "additionalProperties": true
137
+ },
138
+ "participant": {
139
+ "type": "object",
140
+ "required": [
141
+ "id",
142
+ "kind",
143
+ "description"
144
+ ],
145
+ "properties": {
146
+ "id": {
147
+ "type": "string",
148
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
149
+ },
150
+ "kind": {
151
+ "enum": [
152
+ "human",
153
+ "agent",
154
+ "operator",
155
+ "extension-author",
156
+ "api-consumer",
157
+ "hosted-service-user",
158
+ "service-integrator",
159
+ "maintainer",
160
+ "other"
161
+ ]
162
+ },
163
+ "description": {
164
+ "type": "string",
165
+ "minLength": 1
166
+ }
167
+ },
168
+ "additionalProperties": true
169
+ },
170
+ "entrypoint": {
171
+ "type": "object",
172
+ "required": [
173
+ "id",
174
+ "surface",
175
+ "participants"
176
+ ],
177
+ "properties": {
178
+ "id": {
179
+ "type": "string",
180
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
181
+ },
182
+ "surface": {
183
+ "type": "string",
184
+ "minLength": 1
185
+ },
186
+ "participants": {
187
+ "type": "array",
188
+ "minItems": 1,
189
+ "items": {
190
+ "type": "string",
191
+ "minLength": 1
192
+ }
193
+ },
194
+ "purpose": {
195
+ "type": "string",
196
+ "minLength": 1
197
+ }
198
+ },
199
+ "additionalProperties": true
200
+ },
201
+ "surface": {
202
+ "type": "object",
203
+ "required": [
204
+ "id",
205
+ "kind",
206
+ "participants",
207
+ "value",
208
+ "discoverability"
209
+ ],
210
+ "properties": {
211
+ "id": {
212
+ "type": "string",
213
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
214
+ },
215
+ "kind": {
216
+ "enum": [
217
+ "cli-command",
218
+ "json-api",
219
+ "markdown-doc",
220
+ "skill",
221
+ "gui",
222
+ "web",
223
+ "config",
224
+ "envelope",
225
+ "package",
226
+ "protocol",
227
+ "other"
228
+ ]
229
+ },
230
+ "participants": {
231
+ "type": "array",
232
+ "minItems": 1,
233
+ "items": {
234
+ "type": "string",
235
+ "minLength": 1
236
+ }
237
+ },
238
+ "value": {
239
+ "type": "string",
240
+ "minLength": 1
241
+ },
242
+ "discoverability": {
243
+ "type": "object",
244
+ "required": [
245
+ "fromMinimalEntrypoint"
246
+ ],
247
+ "properties": {
248
+ "fromMinimalEntrypoint": {
249
+ "type": "boolean"
250
+ },
251
+ "path": {
252
+ "type": "string",
253
+ "minLength": 1
254
+ }
255
+ },
256
+ "additionalProperties": true
257
+ },
258
+ "maturity": {
259
+ "type": "string",
260
+ "minLength": 1
261
+ }
262
+ },
263
+ "additionalProperties": true
264
+ },
265
+ "transparentConstraint": {
266
+ "type": "object",
267
+ "required": [
268
+ "id",
269
+ "appliesTo",
270
+ "restriction",
271
+ "rationale",
272
+ "reviewPath"
273
+ ],
274
+ "properties": {
275
+ "id": {
276
+ "type": "string",
277
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
278
+ },
279
+ "appliesTo": {
280
+ "type": "array",
281
+ "minItems": 1,
282
+ "items": {
283
+ "type": "string",
284
+ "minLength": 1
285
+ }
286
+ },
287
+ "restriction": {
288
+ "type": "string",
289
+ "minLength": 1
290
+ },
291
+ "rationale": {
292
+ "type": "string",
293
+ "minLength": 1
294
+ },
295
+ "reviewPath": {
296
+ "type": "string",
297
+ "minLength": 1
298
+ }
299
+ },
300
+ "additionalProperties": true
301
+ },
302
+ "choicePath": {
303
+ "type": "object",
304
+ "required": [
305
+ "id",
306
+ "participants",
307
+ "choices"
308
+ ],
309
+ "properties": {
310
+ "id": {
311
+ "type": "string",
312
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
313
+ },
314
+ "participants": {
315
+ "type": "array",
316
+ "minItems": 1,
317
+ "items": {
318
+ "type": "string",
319
+ "minLength": 1
320
+ }
321
+ },
322
+ "choices": {
323
+ "type": "array",
324
+ "minItems": 1,
325
+ "items": {
326
+ "type": "object",
327
+ "required": [
328
+ "id",
329
+ "label"
330
+ ],
331
+ "properties": {
332
+ "id": {
333
+ "type": "string",
334
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
335
+ },
336
+ "label": {
337
+ "type": "string",
338
+ "minLength": 1
339
+ }
340
+ },
341
+ "additionalProperties": true
342
+ }
343
+ }
344
+ },
345
+ "additionalProperties": true
346
+ }
347
+ }
348
+ }
@@ -0,0 +1,153 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kfd.libkungfu.dev/schemas/kfd-3/witness.schema.json",
4
+ "title": "KFD-3 witness",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "contract",
9
+ "standard",
10
+ "collaborationInterface",
11
+ "sourceRegistry",
12
+ "evidence",
13
+ "closure"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "const": 1
18
+ },
19
+ "contract": {
20
+ "const": "kfd-3-witness"
21
+ },
22
+ "standard": {
23
+ "const": "kfd-3"
24
+ },
25
+ "collaborationInterface": {
26
+ "type": "object",
27
+ "required": [
28
+ "schemaId",
29
+ "digest"
30
+ ],
31
+ "properties": {
32
+ "schemaId": {
33
+ "const": "https://kfd.libkungfu.dev/schemas/kfd-3/collaboration-interface.schema.json"
34
+ },
35
+ "digest": {
36
+ "type": "string",
37
+ "minLength": 1
38
+ }
39
+ },
40
+ "additionalProperties": false
41
+ },
42
+ "sourceRegistry": {
43
+ "$ref": "#/$defs/artifactPointer"
44
+ },
45
+ "evidence": {
46
+ "type": "object",
47
+ "required": [
48
+ "minimalEntrypoints",
49
+ "discoverability",
50
+ "transparentConstraints",
51
+ "choicePaths"
52
+ ],
53
+ "properties": {
54
+ "minimalEntrypoints": {
55
+ "type": "array",
56
+ "minItems": 1,
57
+ "items": {
58
+ "$ref": "#/$defs/artifactPointer"
59
+ }
60
+ },
61
+ "discoverability": {
62
+ "type": "array",
63
+ "items": {
64
+ "$ref": "#/$defs/artifactPointer"
65
+ }
66
+ },
67
+ "transparentConstraints": {
68
+ "type": "array",
69
+ "items": {
70
+ "$ref": "#/$defs/artifactPointer"
71
+ }
72
+ },
73
+ "choicePaths": {
74
+ "type": "array",
75
+ "items": {
76
+ "$ref": "#/$defs/artifactPointer"
77
+ }
78
+ },
79
+ "manuals": {
80
+ "type": "array",
81
+ "items": {
82
+ "$ref": "#/$defs/artifactPointer"
83
+ }
84
+ }
85
+ },
86
+ "additionalProperties": true
87
+ },
88
+ "closure": {
89
+ "type": "object",
90
+ "required": [
91
+ "classificationMode",
92
+ "reachableEntrypoints",
93
+ "classifiedEntrypoints",
94
+ "unclassifiedEntrypoints"
95
+ ],
96
+ "properties": {
97
+ "classificationMode": {
98
+ "const": "closed-world"
99
+ },
100
+ "reachableEntrypoints": {
101
+ "type": "array",
102
+ "items": {
103
+ "type": "string",
104
+ "minLength": 1
105
+ }
106
+ },
107
+ "classifiedEntrypoints": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "string",
111
+ "minLength": 1
112
+ }
113
+ },
114
+ "unclassifiedEntrypoints": {
115
+ "type": "array",
116
+ "maxItems": 0
117
+ }
118
+ },
119
+ "additionalProperties": true
120
+ },
121
+ "result": {
122
+ "enum": [
123
+ "pass",
124
+ "fail",
125
+ "warning"
126
+ ]
127
+ }
128
+ },
129
+ "additionalProperties": true,
130
+ "$defs": {
131
+ "artifactPointer": {
132
+ "type": "object",
133
+ "required": [
134
+ "path"
135
+ ],
136
+ "properties": {
137
+ "path": {
138
+ "type": "string",
139
+ "minLength": 1
140
+ },
141
+ "sha256": {
142
+ "type": "string",
143
+ "pattern": "^[0-9a-f]{64}$"
144
+ },
145
+ "description": {
146
+ "type": "string",
147
+ "minLength": 1
148
+ }
149
+ },
150
+ "additionalProperties": true
151
+ }
152
+ }
153
+ }
@@ -0,0 +1,200 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kfd.libkungfu.dev/schemas/kfd-standards.schema.json",
4
+ "title": "KFD standards metadata",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "contract",
9
+ "metadataSchema",
10
+ "source",
11
+ "standards"
12
+ ],
13
+ "properties": {
14
+ "schemaVersion": {
15
+ "const": 1
16
+ },
17
+ "contract": {
18
+ "const": "kfd-standards-metadata"
19
+ },
20
+ "metadataSchema": {
21
+ "type": "object",
22
+ "required": [
23
+ "id",
24
+ "path",
25
+ "version"
26
+ ],
27
+ "properties": {
28
+ "id": {
29
+ "type": "string",
30
+ "format": "uri"
31
+ },
32
+ "path": {
33
+ "type": "string"
34
+ },
35
+ "version": {
36
+ "type": "string"
37
+ }
38
+ },
39
+ "additionalProperties": false
40
+ },
41
+ "source": {
42
+ "type": "object",
43
+ "required": [
44
+ "package",
45
+ "registry",
46
+ "decisionsDir"
47
+ ],
48
+ "properties": {
49
+ "package": {
50
+ "const": "@kungfu-tech/kfd"
51
+ },
52
+ "registry": {
53
+ "const": "registry.json"
54
+ },
55
+ "decisionsDir": {
56
+ "const": "decisions"
57
+ }
58
+ },
59
+ "additionalProperties": false
60
+ },
61
+ "standards": {
62
+ "type": "object",
63
+ "patternProperties": {
64
+ "^kfd-[1-9][0-9]*$": {
65
+ "$ref": "#/$defs/standard"
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ }
70
+ },
71
+ "additionalProperties": false,
72
+ "$defs": {
73
+ "standard": {
74
+ "type": "object",
75
+ "required": [
76
+ "key",
77
+ "id",
78
+ "number",
79
+ "label",
80
+ "title",
81
+ "kind",
82
+ "status",
83
+ "revision",
84
+ "metadataSchemaVersion",
85
+ "document",
86
+ "compatibility",
87
+ "schemaIds",
88
+ "schemaPaths",
89
+ "concepts"
90
+ ],
91
+ "properties": {
92
+ "key": {
93
+ "type": "string",
94
+ "pattern": "^kfd-[1-9][0-9]*$"
95
+ },
96
+ "id": {
97
+ "type": "string",
98
+ "pattern": "^KFD-[1-9][0-9]*$"
99
+ },
100
+ "number": {
101
+ "type": "integer",
102
+ "minimum": 1
103
+ },
104
+ "label": {
105
+ "type": "string",
106
+ "pattern": "^KFD-[1-9][0-9]*$"
107
+ },
108
+ "title": {
109
+ "type": "string",
110
+ "minLength": 1
111
+ },
112
+ "kind": {
113
+ "enum": [
114
+ "principle",
115
+ "procedure"
116
+ ]
117
+ },
118
+ "status": {
119
+ "enum": [
120
+ "draft",
121
+ "active",
122
+ "superseded"
123
+ ]
124
+ },
125
+ "revision": {
126
+ "type": "integer",
127
+ "minimum": 1
128
+ },
129
+ "metadataSchemaVersion": {
130
+ "type": "string"
131
+ },
132
+ "document": {
133
+ "type": "object",
134
+ "required": [
135
+ "path",
136
+ "url"
137
+ ],
138
+ "properties": {
139
+ "path": {
140
+ "type": "string"
141
+ },
142
+ "url": {
143
+ "type": "string",
144
+ "format": "uri"
145
+ }
146
+ },
147
+ "additionalProperties": false
148
+ },
149
+ "compatibility": {
150
+ "type": "object",
151
+ "required": [
152
+ "packageLine",
153
+ "registrySchemaVersion",
154
+ "metadataSchemaVersion",
155
+ "rule"
156
+ ],
157
+ "properties": {
158
+ "packageLine": {
159
+ "type": "string"
160
+ },
161
+ "registrySchemaVersion": {
162
+ "type": "integer",
163
+ "minimum": 1
164
+ },
165
+ "metadataSchemaVersion": {
166
+ "type": "string"
167
+ },
168
+ "rule": {
169
+ "type": "string"
170
+ }
171
+ },
172
+ "additionalProperties": false
173
+ },
174
+ "schemaIds": {
175
+ "type": "object",
176
+ "minProperties": 1,
177
+ "additionalProperties": {
178
+ "type": "string",
179
+ "format": "uri"
180
+ }
181
+ },
182
+ "schemaPaths": {
183
+ "type": "object",
184
+ "minProperties": 1,
185
+ "additionalProperties": {
186
+ "type": "string"
187
+ }
188
+ },
189
+ "concepts": {
190
+ "type": "object",
191
+ "minProperties": 1,
192
+ "additionalProperties": {
193
+ "type": "string"
194
+ }
195
+ }
196
+ },
197
+ "additionalProperties": false
198
+ }
199
+ }
200
+ }
package/standards.json ADDED
@@ -0,0 +1,128 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "contract": "kfd-standards-metadata",
4
+ "metadataSchema": {
5
+ "id": "https://kfd.libkungfu.dev/schemas/kfd-standards.schema.json",
6
+ "path": "schemas/kfd-standards.schema.json",
7
+ "version": "1"
8
+ },
9
+ "source": {
10
+ "package": "@kungfu-tech/kfd",
11
+ "registry": "registry.json",
12
+ "decisionsDir": "decisions"
13
+ },
14
+ "standards": {
15
+ "kfd-1": {
16
+ "key": "kfd-1",
17
+ "id": "KFD-1",
18
+ "number": 1,
19
+ "label": "KFD-1",
20
+ "title": "Contracts must not drift: contract worlds need one fact source",
21
+ "kind": "procedure",
22
+ "status": "active",
23
+ "revision": 1,
24
+ "metadataSchemaVersion": "1",
25
+ "document": {
26
+ "path": "decisions/kfd-1.md",
27
+ "url": "https://kfd.libkungfu.dev/1"
28
+ },
29
+ "compatibility": {
30
+ "packageLine": "v1.0",
31
+ "registrySchemaVersion": 1,
32
+ "metadataSchemaVersion": "1",
33
+ "rule": "Substantive semantic changes mint a new KFD; compatible metadata additions keep schemaVersion 1."
34
+ },
35
+ "schemaIds": {
36
+ "metadata": "https://kfd.libkungfu.dev/schemas/kfd-standards.schema.json",
37
+ "contractWorld": "https://kfd.libkungfu.dev/schemas/kfd-1/contract-world.schema.json",
38
+ "witness": "https://kfd.libkungfu.dev/schemas/kfd-1/witness.schema.json"
39
+ },
40
+ "schemaPaths": {
41
+ "metadata": "schemas/kfd-standards.schema.json",
42
+ "contractWorld": "schemas/kfd-1/contract-world.schema.json",
43
+ "witness": "schemas/kfd-1/witness.schema.json"
44
+ },
45
+ "concepts": {
46
+ "factSource": "fact source",
47
+ "contractWorld": "contract world",
48
+ "weldedSurfaceRegister": "welded-surface register",
49
+ "witness": "contract witness"
50
+ }
51
+ },
52
+ "kfd-2": {
53
+ "key": "kfd-2",
54
+ "id": "KFD-2",
55
+ "number": 2,
56
+ "label": "KFD-2",
57
+ "title": "Trust must start from facts: responsibility must be inspectable",
58
+ "kind": "principle",
59
+ "status": "active",
60
+ "revision": 1,
61
+ "metadataSchemaVersion": "1",
62
+ "document": {
63
+ "path": "decisions/kfd-2.md",
64
+ "url": "https://kfd.libkungfu.dev/2"
65
+ },
66
+ "compatibility": {
67
+ "packageLine": "v1.0",
68
+ "registrySchemaVersion": 1,
69
+ "metadataSchemaVersion": "1",
70
+ "rule": "Substantive semantic changes mint a new KFD; compatible metadata additions keep schemaVersion 1."
71
+ },
72
+ "schemaIds": {
73
+ "metadata": "https://kfd.libkungfu.dev/schemas/kfd-standards.schema.json"
74
+ },
75
+ "schemaPaths": {
76
+ "metadata": "schemas/kfd-standards.schema.json"
77
+ },
78
+ "concepts": {
79
+ "facts": "inspectable facts",
80
+ "responsibilityState": "responsibility state",
81
+ "trust": "trust from facts"
82
+ }
83
+ },
84
+ "kfd-3": {
85
+ "key": "kfd-3",
86
+ "id": "KFD-3",
87
+ "number": 3,
88
+ "label": "KFD-3",
89
+ "title": "Cooperation must start from transparent value: compliance must not be coerced",
90
+ "kind": "principle",
91
+ "status": "active",
92
+ "revision": 1,
93
+ "metadataSchemaVersion": "1",
94
+ "document": {
95
+ "path": "decisions/kfd-3.md",
96
+ "url": "https://kfd.libkungfu.dev/3"
97
+ },
98
+ "compatibility": {
99
+ "packageLine": "v1.0",
100
+ "registrySchemaVersion": 1,
101
+ "metadataSchemaVersion": "1",
102
+ "rule": "Substantive semantic changes mint a new KFD; compatible metadata additions keep schemaVersion 1."
103
+ },
104
+ "schemaIds": {
105
+ "metadata": "https://kfd.libkungfu.dev/schemas/kfd-standards.schema.json",
106
+ "collaborationInterface": "https://kfd.libkungfu.dev/schemas/kfd-3/collaboration-interface.schema.json",
107
+ "witness": "https://kfd.libkungfu.dev/schemas/kfd-3/witness.schema.json"
108
+ },
109
+ "schemaPaths": {
110
+ "metadata": "schemas/kfd-standards.schema.json",
111
+ "collaborationInterface": "schemas/kfd-3/collaboration-interface.schema.json",
112
+ "witness": "schemas/kfd-3/witness.schema.json"
113
+ },
114
+ "concepts": {
115
+ "transparentValue": "transparent value",
116
+ "stableChoice": "stable choice",
117
+ "explainableConstraints": "explainable constraints",
118
+ "nonCoercion": "non-coercive cooperation",
119
+ "participant": "participant",
120
+ "collaborationInterface": "collaboration interface",
121
+ "minimalEntrypoint": "minimal entrypoint",
122
+ "discoverability": "discoverability",
123
+ "closure": "closed-world interface classification",
124
+ "choicePath": "choice path"
125
+ }
126
+ }
127
+ }
128
+ }