@kungfu-tech/kfd 1.0.0-alpha.21 → 1.0.0-alpha.22

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.
@@ -0,0 +1,255 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kfd.libkungfu.dev/schemas/kfd-1/publication-url-semantics.schema.json",
4
+ "title": "KFD-1 publication URL semantics",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "contract",
9
+ "standard",
10
+ "publication",
11
+ "routes",
12
+ "immutableArtifacts",
13
+ "archivePolicy"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "const": 1
18
+ },
19
+ "contract": {
20
+ "const": "kfd-1-publication-url-semantics"
21
+ },
22
+ "standard": {
23
+ "const": "kfd-1"
24
+ },
25
+ "publication": {
26
+ "$ref": "#/$defs/publication"
27
+ },
28
+ "routes": {
29
+ "$ref": "#/$defs/routes"
30
+ },
31
+ "immutableArtifacts": {
32
+ "type": "array",
33
+ "items": {
34
+ "$ref": "#/$defs/immutableArtifact"
35
+ },
36
+ "minItems": 1
37
+ },
38
+ "archivePolicy": {
39
+ "$ref": "#/$defs/archivePolicy"
40
+ },
41
+ "lineage": {
42
+ "$ref": "#/$defs/lineage"
43
+ },
44
+ "siteConsumption": {
45
+ "$ref": "#/$defs/siteConsumption"
46
+ }
47
+ },
48
+ "additionalProperties": false,
49
+ "$defs": {
50
+ "uri": {
51
+ "type": "string",
52
+ "format": "uri"
53
+ },
54
+ "digest": {
55
+ "type": "string",
56
+ "pattern": "^[0-9a-f]{64}$"
57
+ },
58
+ "publication": {
59
+ "type": "object",
60
+ "required": [
61
+ "id",
62
+ "version",
63
+ "sourceCoordinate"
64
+ ],
65
+ "properties": {
66
+ "id": {
67
+ "type": "string",
68
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
69
+ },
70
+ "title": {
71
+ "type": "string",
72
+ "minLength": 1
73
+ },
74
+ "version": {
75
+ "type": "string",
76
+ "minLength": 1
77
+ },
78
+ "sourceCoordinate": {
79
+ "$ref": "#/$defs/sourceCoordinate"
80
+ }
81
+ },
82
+ "additionalProperties": false
83
+ },
84
+ "sourceCoordinate": {
85
+ "type": "object",
86
+ "required": [
87
+ "kind",
88
+ "repository",
89
+ "ref"
90
+ ],
91
+ "properties": {
92
+ "kind": {
93
+ "enum": [
94
+ "git-commit",
95
+ "git-tag",
96
+ "source-bundle",
97
+ "release-passport",
98
+ "other"
99
+ ]
100
+ },
101
+ "repository": {
102
+ "type": "string",
103
+ "minLength": 1
104
+ },
105
+ "ref": {
106
+ "type": "string",
107
+ "minLength": 1
108
+ },
109
+ "digest": {
110
+ "$ref": "#/$defs/digest"
111
+ },
112
+ "url": {
113
+ "$ref": "#/$defs/uri"
114
+ }
115
+ },
116
+ "additionalProperties": false
117
+ },
118
+ "routes": {
119
+ "type": "object",
120
+ "required": [
121
+ "canonicalUrl",
122
+ "immutableVersionBaseUrl"
123
+ ],
124
+ "properties": {
125
+ "canonicalUrl": {
126
+ "$ref": "#/$defs/uri",
127
+ "description": "Stable reader entrypoint. It may show the latest recommended version."
128
+ },
129
+ "latestUrl": {
130
+ "$ref": "#/$defs/uri",
131
+ "description": "Mutable latest alias or evidence entrypoint. It may move as new versions are published."
132
+ },
133
+ "evidenceUrl": {
134
+ "$ref": "#/$defs/uri",
135
+ "description": "Reader or agent entrypoint for release evidence."
136
+ },
137
+ "immutableVersionBaseUrl": {
138
+ "$ref": "#/$defs/uri",
139
+ "description": "Version-addressed base URL whose artifact contents must not change after publication."
140
+ }
141
+ },
142
+ "additionalProperties": false
143
+ },
144
+ "immutableArtifact": {
145
+ "type": "object",
146
+ "required": [
147
+ "id",
148
+ "kind",
149
+ "url",
150
+ "sha256"
151
+ ],
152
+ "properties": {
153
+ "id": {
154
+ "type": "string",
155
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
156
+ },
157
+ "kind": {
158
+ "enum": [
159
+ "pdf",
160
+ "source-bundle",
161
+ "release-passport",
162
+ "site-bundle",
163
+ "publication-registry",
164
+ "other"
165
+ ]
166
+ },
167
+ "url": {
168
+ "$ref": "#/$defs/uri"
169
+ },
170
+ "path": {
171
+ "type": "string",
172
+ "minLength": 1
173
+ },
174
+ "mediaType": {
175
+ "type": "string",
176
+ "minLength": 1
177
+ },
178
+ "sha256": {
179
+ "$ref": "#/$defs/digest"
180
+ },
181
+ "sourceCoordinate": {
182
+ "$ref": "#/$defs/sourceCoordinate"
183
+ }
184
+ },
185
+ "additionalProperties": false
186
+ },
187
+ "archivePolicy": {
188
+ "type": "object",
189
+ "required": [
190
+ "immutability",
191
+ "sameVersionDigestPolicy",
192
+ "destructiveSyncPolicy",
193
+ "historyRetention"
194
+ ],
195
+ "properties": {
196
+ "immutability": {
197
+ "const": "published-version-artifacts-are-append-only"
198
+ },
199
+ "sameVersionDigestPolicy": {
200
+ "const": "fail-on-digest-change"
201
+ },
202
+ "destructiveSyncPolicy": {
203
+ "const": "must-not-delete-immutable-prefix"
204
+ },
205
+ "historyRetention": {
206
+ "const": "site-builds-must-preserve-declared-historical-versions"
207
+ }
208
+ },
209
+ "additionalProperties": false
210
+ },
211
+ "lineage": {
212
+ "type": "object",
213
+ "properties": {
214
+ "supersedes": {
215
+ "type": "array",
216
+ "items": {
217
+ "type": "string"
218
+ },
219
+ "uniqueItems": true
220
+ },
221
+ "supersededBy": {
222
+ "type": "array",
223
+ "items": {
224
+ "type": "string"
225
+ },
226
+ "uniqueItems": true
227
+ },
228
+ "revisionNote": {
229
+ "type": "string"
230
+ }
231
+ },
232
+ "additionalProperties": false
233
+ },
234
+ "siteConsumption": {
235
+ "type": "object",
236
+ "required": [
237
+ "latestPackageRole",
238
+ "archiveRole",
239
+ "rendererRole"
240
+ ],
241
+ "properties": {
242
+ "latestPackageRole": {
243
+ "const": "may-update-canonical-and-latest-pages"
244
+ },
245
+ "archiveRole": {
246
+ "const": "owns-immutable-version-artifacts"
247
+ },
248
+ "rendererRole": {
249
+ "const": "render-and-link-without-forking-route-facts"
250
+ }
251
+ },
252
+ "additionalProperties": false
253
+ }
254
+ }
255
+ }
package/scripts/check.mjs CHANGED
@@ -273,16 +273,23 @@ if (kfd1?.schemaIds?.contractWorld !== "https://kfd.libkungfu.dev/schemas/kfd-1/
273
273
  if (kfd1?.schemaIds?.witness !== "https://kfd.libkungfu.dev/schemas/kfd-1/witness.schema.json") {
274
274
  fail("KFD-1 standards metadata must expose the canonical witness schema URI");
275
275
  }
276
- for (const concept of ["factSource", "contractWorld", "weldedSurfaceRegister", "witness", "surfaceClass", "compatibilityImpact", "impactProjection"]) {
276
+ if (kfd1?.schemaIds?.publicationUrlSemantics !== "https://kfd.libkungfu.dev/schemas/kfd-1/publication-url-semantics.schema.json") {
277
+ fail("KFD-1 standards metadata must expose the canonical publicationUrlSemantics schema URI");
278
+ }
279
+ if (kfd1?.schemaPaths?.publicationUrlSemantics !== "schemas/kfd-1/publication-url-semantics.schema.json") {
280
+ fail("KFD-1 standards metadata must expose the publicationUrlSemantics schema path");
281
+ }
282
+ for (const concept of ["factSource", "contractWorld", "weldedSurfaceRegister", "witness", "surfaceClass", "compatibilityImpact", "impactProjection", "publicationUrlSemantics", "canonicalUrl", "latestUrl", "immutableVersionUrl", "immutableArtifact", "archivePolicy", "sourceCoordinate"]) {
277
283
  if (!kfd1?.concepts?.[concept]) fail(`KFD-1 standards metadata missing concept ${concept}`);
278
284
  }
279
- for (const iface of ["contractWorld", "witness"]) {
285
+ for (const iface of ["contractWorld", "witness", "publicationUrlSemantics"]) {
280
286
  if (!kfd1?.interfaces?.[iface]) fail(`KFD-1 standards metadata missing interface ${iface}`);
281
287
  }
282
288
  const expectedKfd1SurfaceClasses = ["integration-time", "cross-time"];
283
289
  const expectedKfd1ImpactClasses = ["breaking", "additive", "none", "unclassifiable"];
284
290
  const kfd1ContractWorldSchema = JSON.parse(readFileSync("schemas/kfd-1/contract-world.schema.json", "utf8"));
285
291
  const kfd1WitnessSchema = JSON.parse(readFileSync("schemas/kfd-1/witness.schema.json", "utf8"));
292
+ const kfd1PublicationUrlSemanticsSchema = JSON.parse(readFileSync("schemas/kfd-1/publication-url-semantics.schema.json", "utf8"));
286
293
  for (const [schemaName, schemaDoc] of [["contractWorld", kfd1ContractWorldSchema], ["witness", kfd1WitnessSchema]]) {
287
294
  requireSameEnum(schemaDoc.$defs?.surfaceClass?.enum, expectedKfd1SurfaceClasses, `KFD-1 ${schemaName} surfaceClass`);
288
295
  requireSameEnum(schemaDoc.$defs?.compatibilityImpact?.enum, expectedKfd1ImpactClasses, `KFD-1 ${schemaName} compatibilityImpact`);
@@ -292,6 +299,27 @@ for (const [schemaName, schemaDoc] of [["contractWorld", kfd1ContractWorldSchema
292
299
  }
293
300
  }
294
301
  }
302
+ if (kfd1PublicationUrlSemanticsSchema.properties?.contract?.const !== "kfd-1-publication-url-semantics") {
303
+ fail("KFD-1 publicationUrlSemantics schema must describe the kfd-1-publication-url-semantics contract");
304
+ }
305
+ if (kfd1PublicationUrlSemanticsSchema.properties?.standard?.const !== "kfd-1") {
306
+ fail("KFD-1 publicationUrlSemantics schema must declare standard kfd-1");
307
+ }
308
+ for (const requiredField of ["canonicalUrl", "immutableVersionBaseUrl"]) {
309
+ if (!kfd1PublicationUrlSemanticsSchema.$defs?.routes?.required?.includes(requiredField)) {
310
+ fail(`KFD-1 publicationUrlSemantics routes must require ${requiredField}`);
311
+ }
312
+ }
313
+ for (const [field, expectedConst] of [
314
+ ["immutability", "published-version-artifacts-are-append-only"],
315
+ ["sameVersionDigestPolicy", "fail-on-digest-change"],
316
+ ["destructiveSyncPolicy", "must-not-delete-immutable-prefix"],
317
+ ["historyRetention", "site-builds-must-preserve-declared-historical-versions"],
318
+ ]) {
319
+ if (kfd1PublicationUrlSemanticsSchema.$defs?.archivePolicy?.properties?.[field]?.const !== expectedConst) {
320
+ fail(`KFD-1 publicationUrlSemantics archivePolicy.${field} must be ${expectedConst}`);
321
+ }
322
+ }
295
323
  const kfd1SurfaceRegister = kfd1?.surfaceRegister;
296
324
  if (kfd1SurfaceRegister?.factSource !== "standards.json#/standards/kfd-1/surfaceRegister") {
297
325
  fail("KFD-1 surfaceRegister must declare standards.json as its fact source");
@@ -552,6 +580,7 @@ if (!kfd1Witness) {
552
580
  const witnessedSurfaceNames = new Set(kfd1Witness.surfaces.map((surface) => surface.name));
553
581
  for (const requiredSurface of [
554
582
  "readme",
583
+ "kfd-1-publication-url-semantics-schema",
555
584
  "kfd-2-trust-taxonomy-schema",
556
585
  "kfd-2-trust-claims-schema",
557
586
  "kfd-2-trust-assessment-schema",
@@ -158,7 +158,7 @@
158
158
  "homepagePriority": 40,
159
159
  "defaultPresentation": "ordered-steps",
160
160
  "includeInFirstScreen": false,
161
- "markdown": "Agents consuming this package should start from the same sources as humans:\n\n1. Read this README for the foundation model and package map.\n2. Read `standards.json` for canonical KFD numbers, schema IDs, concept names,\n and interface contracts.\n3. Use `site/kfd-site.json` decision metadata or the KFD-3 collaboration\n interface fact-source metadata to identify the public KFD fact source.\n4. Use `schemas/kfd-2/trust-taxonomy.schema.json` for KFD-2 residual-risk and\n trust-downgrade values. Unknown taxonomy values are invalid.\n5. Use `schemas/kfd-2/trust-claims.schema.json` and\n `schemas/kfd-2/trust-assessment.schema.json` when a claim needs generic\n KFD-2 assessment instead of a release-specific passport.\n6. Use `schemas/kfd-3/collaboration-interface.schema.json` and\n `schemas/kfd-3/witness.schema.json` to inspect collaboration interfaces.\n7. If a needed KFD-2 taxonomy value is missing, open a KFD GitHub issue rather\n than inventing a local value:\n `https://github.com/kungfu-systems/kfd/issues/new?title=KFD-2%20trust%20taxonomy%20extension%20request`.\n\nKFD package semver is only the distribution version. KFD-owned machine\ninterfaces carry their own `schemaVersion` and `contract` fields. Compatible\nadditions may keep the same interface version; semantic changes, required-field\nchanges, verification meaning changes, or responsibility-boundary changes must\nuse a new interface version or contract.\n\nKFD-2 publishes trust-taxonomy, trust-claims, trust-assessment,\nrelease-claims, and release-trust-passport schemas under `schemas/kfd-2/`.\nThe generic schemas let humans, agents, Buildchain, and other systems assess\nwhether claims about KFD-1, KFD-3, KFD-4, future KFDs, or product surfaces are\nbound to source facts, evidence, hashes, audit boundaries, residual risk, and\nresponsibility state. The release schemas are a release-specific projection of\nthat model. See [`docs/KFD-2-usage.md`](docs/KFD-2-usage.md).\n\nKFD-3 also publishes a general collaboration-interface schema and witness\nschema under `schemas/kfd-3/`. These schemas are for participant-facing product\ninterfaces, not only agent APIs. A product such as Kungfu may implement an\nagent-first profile, but that profile remains a product-specific realization of\nKFD-3. The KFD-owned boundary is the standard vocabulary, schema IDs, and\nclosed-world evidence shape. See\n[`docs/KFD-3-usage.md`](docs/KFD-3-usage.md).\n\nKFD-4 publishes an observer-perspective schema under `schemas/kfd-4/`. It gives\nhumans and agents a standard vocabulary for observer, accepted facts,\nprojection policy, causal constraints, degraded evidence, and verification\nstate when a product shows a perspective-bearing timeline. The package-level\nclaim proves the KFD-owned interface surface; adopter runtime correctness\nrequires adopter-owned KFD-2 evidence."
161
+ "markdown": "Agents consuming this package should start from the same sources as humans:\n\n1. Read this README for the foundation model and package map.\n2. Read `standards.json` for canonical KFD numbers, schema IDs, concept names,\n and interface contracts.\n3. Use `site/kfd-site.json` decision metadata or the KFD-3 collaboration\n interface fact-source metadata to identify the public KFD fact source.\n4. Use `schemas/kfd-2/trust-taxonomy.schema.json` for KFD-2 residual-risk and\n trust-downgrade values. Unknown taxonomy values are invalid.\n5. Use `schemas/kfd-2/trust-claims.schema.json` and\n `schemas/kfd-2/trust-assessment.schema.json` when a claim needs generic\n KFD-2 assessment instead of a release-specific passport.\n6. Use `schemas/kfd-3/collaboration-interface.schema.json` and\n `schemas/kfd-3/witness.schema.json` to inspect collaboration interfaces.\n7. Use `schemas/kfd-1/publication-url-semantics.schema.json` when a package,\n paper, specification, or site bundle must distinguish stable reader URLs,\n latest aliases, and immutable versioned artifacts.\n8. If a needed KFD-2 taxonomy value is missing, open a KFD GitHub issue rather\n than inventing a local value:\n `https://github.com/kungfu-systems/kfd/issues/new?title=KFD-2%20trust%20taxonomy%20extension%20request`.\n\nKFD package semver is only the distribution version. KFD-owned machine\ninterfaces carry their own `schemaVersion` and `contract` fields. Compatible\nadditions may keep the same interface version; semantic changes, required-field\nchanges, verification meaning changes, or responsibility-boundary changes must\nuse a new interface version or contract.\n\nKFD-2 publishes trust-taxonomy, trust-claims, trust-assessment,\nrelease-claims, and release-trust-passport schemas under `schemas/kfd-2/`.\nThe generic schemas let humans, agents, Buildchain, and other systems assess\nwhether claims about KFD-1, KFD-3, KFD-4, future KFDs, or product surfaces are\nbound to source facts, evidence, hashes, audit boundaries, residual risk, and\nresponsibility state. The release schemas are a release-specific projection of\nthat model. See [`docs/KFD-2-usage.md`](docs/KFD-2-usage.md).\n\nKFD-3 also publishes a general collaboration-interface schema and witness\nschema under `schemas/kfd-3/`. These schemas are for participant-facing product\ninterfaces, not only agent APIs. A product such as Kungfu may implement an\nagent-first profile, but that profile remains a product-specific realization of\nKFD-3. The KFD-owned boundary is the standard vocabulary, schema IDs, and\nclosed-world evidence shape. See\n[`docs/KFD-3-usage.md`](docs/KFD-3-usage.md).\n\nKFD-4 publishes an observer-perspective schema under `schemas/kfd-4/`. It gives\nhumans and agents a standard vocabulary for observer, accepted facts,\nprojection policy, causal constraints, degraded evidence, and verification\nstate when a product shows a perspective-bearing timeline. The package-level\nclaim proves the KFD-owned interface surface; adopter runtime correctness\nrequires adopter-owned KFD-2 evidence."
162
162
  },
163
163
  {
164
164
  "id": "decision-metadata",
package/standards.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "document": {
26
26
  "path": "decisions/KFD-1.md",
27
27
  "url": "https://kfd.libkungfu.dev/1",
28
- "sha256": "0b7b1ec54d661b271f91f02cefa97b11e1d1ef9c637efd2d1878d5f9c9185d80"
28
+ "sha256": "dcc97d2e24ffc8f0380cd027ba973bf8268cff59fa9ab766b178e894bcf1f164"
29
29
  },
30
30
  "compatibility": {
31
31
  "packageLine": "v1.0",
@@ -36,12 +36,14 @@
36
36
  "schemaIds": {
37
37
  "metadata": "https://kfd.libkungfu.dev/schemas/kfd-standards.schema.json",
38
38
  "contractWorld": "https://kfd.libkungfu.dev/schemas/kfd-1/contract-world.schema.json",
39
- "witness": "https://kfd.libkungfu.dev/schemas/kfd-1/witness.schema.json"
39
+ "witness": "https://kfd.libkungfu.dev/schemas/kfd-1/witness.schema.json",
40
+ "publicationUrlSemantics": "https://kfd.libkungfu.dev/schemas/kfd-1/publication-url-semantics.schema.json"
40
41
  },
41
42
  "schemaPaths": {
42
43
  "metadata": "schemas/kfd-standards.schema.json",
43
44
  "contractWorld": "schemas/kfd-1/contract-world.schema.json",
44
- "witness": "schemas/kfd-1/witness.schema.json"
45
+ "witness": "schemas/kfd-1/witness.schema.json",
46
+ "publicationUrlSemantics": "schemas/kfd-1/publication-url-semantics.schema.json"
45
47
  },
46
48
  "interfaces": {
47
49
  "contractWorld": {
@@ -57,6 +59,13 @@
57
59
  "schemaId": "https://kfd.libkungfu.dev/schemas/kfd-1/witness.schema.json",
58
60
  "schemaPath": "schemas/kfd-1/witness.schema.json",
59
61
  "compatibilityRule": "Compatible additions may keep schemaVersion 1; semantic or required-field changes require a new interface version or contract."
62
+ },
63
+ "publicationUrlSemantics": {
64
+ "contract": "kfd-1-publication-url-semantics",
65
+ "schemaVersion": 1,
66
+ "schemaId": "https://kfd.libkungfu.dev/schemas/kfd-1/publication-url-semantics.schema.json",
67
+ "schemaPath": "schemas/kfd-1/publication-url-semantics.schema.json",
68
+ "compatibilityRule": "Compatible additions may keep schemaVersion 1; semantic or required-field changes require a new interface version or contract."
60
69
  }
61
70
  },
62
71
  "concepts": {
@@ -66,7 +75,14 @@
66
75
  "witness": "contract witness",
67
76
  "surfaceClass": "surface class",
68
77
  "compatibilityImpact": "compatibility impact",
69
- "impactProjection": "domain-specific impact projection"
78
+ "impactProjection": "domain-specific impact projection",
79
+ "publicationUrlSemantics": "publication URL semantics",
80
+ "canonicalUrl": "canonical reader URL",
81
+ "latestUrl": "latest alias URL",
82
+ "immutableVersionUrl": "immutable version URL",
83
+ "immutableArtifact": "immutable publication artifact",
84
+ "archivePolicy": "publication archive policy",
85
+ "sourceCoordinate": "publication source coordinate"
70
86
  },
71
87
  "surfaceRegister": {
72
88
  "factSource": "standards.json#/standards/kfd-1/surfaceRegister",
@@ -658,6 +674,23 @@
658
674
  "none": "Changes that do not touch this registered surface do not create KFD-1 compatibility impact for this surface.",
659
675
  "unclassifiable": "If impact cannot be classified, the surface register is deficient and must be fixed before the dependent gate may pass."
660
676
  }
677
+ },
678
+ {
679
+ "id": "kfd-1-publication-url-semantics-schema",
680
+ "class": "integration-time",
681
+ "classes": [
682
+ "integration-time",
683
+ "cross-time"
684
+ ],
685
+ "description": "Published JSON schema surface at schemas/kfd-1/publication-url-semantics.schema.json.",
686
+ "sourcePath": "schemas/kfd-1/publication-url-semantics.schema.json",
687
+ "weldRationale": "Buildchain and site repositories can bind to this surface when declaring canonical/latest/immutable publication URL semantics, and published version artifacts remain audit-relevant after release.",
688
+ "impactProjection": {
689
+ "breaking": "Incompatible changes to this registered surface require an explicit compatibility action before the dependent gate may pass.",
690
+ "additive": "Backward-compatible additions to this registered surface must be declared and may proceed through the domain projection as additive impact.",
691
+ "none": "Changes that do not touch this registered surface do not create KFD-1 compatibility impact for this surface.",
692
+ "unclassifiable": "If impact cannot be classified, the surface register is deficient and must be fixed before the dependent gate may pass."
693
+ }
661
694
  }
662
695
  ]
663
696
  }