@kungfu-tech/kfd 1.0.0-alpha.0 → 1.0.0-alpha.2

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,15 @@ 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
+
116
125
  ## Current decisions
117
126
 
118
127
  | ID | Kind | Title | Status |
@@ -137,6 +146,9 @@ reference KFDs; KFDs never depend on repository internals.
137
146
  ```text
138
147
  decisions/ one markdown file per decision (kfd-N.md)
139
148
  registry.json machine-readable index (schemaVersion 1, contract kfd-registry)
149
+ standards.json machine-readable KFD standard metadata (schemaVersion 1,
150
+ contract kfd-standards-metadata)
151
+ schemas/ JSON schemas for package metadata and KFD-owned schema IDs
140
152
  site/ machine-readable site bundle for kfd.libkungfu.dev renderers
141
153
  release-impact.json
142
154
  Buildchain surface-aware impact ledger for production release passports
@@ -144,9 +156,12 @@ scripts/ conformance check: registry and documents must agree
144
156
  ```
145
157
 
146
158
  `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.
159
+ uniqueness, registry/document agreement, standards metadata/schema agreement,
160
+ status validity, and the release impact ledger required by Buildchain
161
+ production release passports. Releases are governed by Buildchain; this package
162
+ versions itself under KFD-1's own rules: the outer package line remains `v1.0`,
163
+ while patch and prerelease numbers are advanced by Buildchain release
164
+ promotion.
150
165
 
151
166
  ## Release impact ledger
152
167
 
@@ -160,7 +175,9 @@ release-passport-impact-json: release-impact.json
160
175
  For ordinary KFD content changes, keep `kfd-content` at `patch`. Move
161
176
  `kfd-registry-schema` or `kfd-package-structure` to `minor` or `major` only
162
177
  when those machine-consumed surfaces add or break fields, meanings, package
163
- paths, or published structure under KFD-1.
178
+ paths, or published structure under KFD-1. These values are Buildchain release
179
+ passport impact classifications; they do not by themselves open a new
180
+ `@kungfu-tech/kfd` package major or minor line.
164
181
 
165
182
  ## License
166
183
 
@@ -157,10 +157,12 @@ and does not drift invisibly.
157
157
  KFD documents are append-only. A KFD's number is immutable and is the
158
158
  content-layer coordinate; substantive semantic change is made by minting a new
159
159
  KFD that supersedes the old number (namespace welding applied to decisions).
160
- Consequently, in the `@kungfu-tech/kfd` package, content operations new
161
- KFDs, status flips, editorial clarificationsare patches; only the machine
162
- surfaces of the package itself (the registry schema, the package structure)
163
- can move minor or major.
160
+ Consequently, in the `@kungfu-tech/kfd` package, the outer package line stays
161
+ fixed at `v1.0`. Content operationsnew KFDs, status flips, editorial
162
+ clarifications — are patches. Machine surfaces of the package itself (the
163
+ registry schema, the package structure) can still require `minor` or `major`
164
+ surface-impact review in the Buildchain release passport, but that review
165
+ classification is not a silent package-line upgrade.
164
166
 
165
167
  ## Adopters
166
168
 
package/docs/MAP.md CHANGED
@@ -9,6 +9,8 @@
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
11
  | What does a specific decision say? | [`../decisions/`](../decisions) (index: [`../registry.json`](../registry.json)) |
12
+ | What machine metadata should Buildchain or another consumer import for KFD standard identity and schema IDs? | [`../standards.json`](../standards.json) |
13
+ | What schema validates the standards metadata surface? | [`../schemas/kfd-standards.schema.json`](../schemas/kfd-standards.schema.json) |
12
14
  | How do I cite a decision? | [`../README.md`](../README.md) — cite by number, e.g. `KFD-1` |
13
15
  | How do decisions change over time? | [`../CONTRIBUTING.md`](../CONTRIBUTING.md) — append-only; explicit supersession mints a new number |
14
16
  | How is this package versioned and released? | [KFD-1](../decisions/kfd-1.md) applied to itself; Buildchain governs releases |
package/package.json CHANGED
@@ -1,10 +1,37 @@
1
1
  {
2
2
  "name": "@kungfu-tech/kfd",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0-alpha.2",
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
- "files": ["README.md", "decisions", "registry.json", "site", "docs"],
7
- "scripts": {"check": "node scripts/check.mjs"},
8
- "publishConfig": {"registry": "https://registry.npmjs.org/", "access": "public"},
9
- "repository": {"type": "git", "url": "git+https://github.com/kungfu-systems/kfd.git"}
6
+ "files": [
7
+ "README.md",
8
+ "decisions",
9
+ "registry.json",
10
+ "standards.json",
11
+ "schemas",
12
+ "site",
13
+ "docs"
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
+ },
26
+ "scripts": {
27
+ "check": "node scripts/check.mjs"
28
+ },
29
+ "publishConfig": {
30
+ "registry": "https://registry.npmjs.org/",
31
+ "access": "public"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/kungfu-systems/kfd.git"
36
+ }
10
37
  }
@@ -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,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,118 @@
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
+ },
107
+ "schemaPaths": {
108
+ "metadata": "schemas/kfd-standards.schema.json"
109
+ },
110
+ "concepts": {
111
+ "transparentValue": "transparent value",
112
+ "stableChoice": "stable choice",
113
+ "explainableConstraints": "explainable constraints",
114
+ "nonCoercion": "non-coercive cooperation"
115
+ }
116
+ }
117
+ }
118
+ }